Ejemplo n.º 1
0
 public void RefreshHeroExperience()
 {
     // Updates hero experience to make sure panels are updated at startup.
     ExperienceToNextLvl      = ExperienceHelper.CalculateXpToNextLvl(this);
     ExperienceToNextLvlTotal = Experience + ExperienceToNextLvl;
     ExperienceProgress       = ExperienceHelper.CalculateXpProgress(this);
 }
Ejemplo n.º 2
0
    public void GainExperience(int experienceGained)
    {
        foreach (var artifact in User.Instance.CurrentHero.EquippedArtifacts)
        {
            artifact.ArtifactFunctionality.OnExperienceGained(ref experienceGained);
        }

        if (ExperienceToNextLvl != 0)
        {
            User.Instance.Achievements.IncreaseAchievementValue(NumericAchievementType.ExperienceGained, experienceGained);
        }

        (Application.Current.MainWindow as GameWindow).CreateFloatingTextUtility($"+{experienceGained}", (SolidColorBrush)Application.Current.FindResource("BrushExperienceRelated"), FloatingTextHelper.ExperiencePositionPoint);

        Experience += experienceGained;
        ExperienceHelper.CheckIfLeveledUpAndGrantBonuses(this);
        ExperienceToNextLvl      = ExperienceHelper.CalculateXpToNextLvl(this);
        ExperienceToNextLvlTotal = Experience + ExperienceToNextLvl;
        ExperienceProgress       = ExperienceHelper.CalculateXpProgress(this);
    }