Пример #1
0
 public static void LevelUp(Combatant hero)
 {
     if (hero.Experience >= hero.ExperienceToLevel)
     {
         hero.Level++;
         double increaseHP = (double)hero.MaxHP + hero.MaxHP * .1;
         hero.MaxHP = (int)increaseHP;
         double increaseMP = (double)hero.MaxMP + hero.MaxMP * .1;
         hero.MaxMP = (int)increaseMP;
         MessageBox.Show($"Congratulations!You have advanced to level{hero.Level} Your maximum HP has increased to {hero.MaxHP} and your maximum resource has increased to {hero.MaxMP}. You've earned 2 stat points!");
         hero.SkillPoints      += 2;
         hero.HP                = hero.MaxHP;
         hero.MP                = hero.MaxMP;
         hero.Experience       -= hero.ExperienceToLevel;
         hero.ExperienceToLevel = hero.Level * 12;
         Debuffs.ClearDebuffs();
     }
 }
Пример #2
0
 public static void EndCombat(Combatant hero, Combatant enemy)
 {
     if (hero.ClassType == "Thief")
     {
         double extraGold = enemy.Gold * .2;
         MessageBox.Show($"You win! You received {enemy.Gold + (int)extraGold} gold and {enemy.Experience} experience points!");
     }
     else
     {
         MessageBox.Show($"You win! You received {enemy.Gold} gold and {enemy.Experience} experience points!");
         hero.Gold += enemy.Gold;
     }
     hero.Experience += enemy.Experience;
     Buffs.ResetStatsAndBuffs(hero);
     inCombat = false;
     Debuffs.ClearEnemyDebuffs();
     CharacterMethods.LevelUp(hero);
     return;
 }