public void UpdateLevel() { levelProgress += levelProgressPerSecond * levelProgressMultiplier; if (levelProgress >= 1) { level++; LeveledUp?.Invoke(level); // levelProgressMultiplier = 50 / level; levelProgress = 0; } }
public void AddExperience(int exp) { Experience += exp; CurrentGame.Journal.Write(new ExperienceGainedMessage(exp)); var xpToLevelUp = GetXpToLevelUp(); if (Experience >= xpToLevelUp) { Log.Debug($"Leveled Up. EXP: {Experience}, EXP to LVL: {GetXpToLevelUp()}"); Level++; Experience -= xpToLevelUp; CurrentGame.Journal.Write(new LevelUpMessage(Level)); LeveledUp?.Invoke(this, EventArgs.Empty); } }
private void OnLeveledUp() { LeveledUp?.Invoke(this); }
private void LeveledUpHandler(object sender, PokemonEventArgs e) { LeveledUp?.Invoke(this, EventArgs); }
internal static void InvokeLeveledUp(EventArgsLevelUp.LevelType type, int newLevel) { LeveledUp.Invoke(null, new EventArgsLevelUp(type, newLevel)); }