Exemplo n.º 1
0
        /// <summary>
        /// Обновление характеристик персонажа
        /// </summary>
        public void StatsUpdate()
        {
            this.Stats.MaxHealth = LevelSystem.HealthbyLevel(this.Stats.Level);
            this.Stats.Armor     = 0;

            if (helmet != null)
            {
                this.Stats.AdditionalHealth += helmet.armorStats.Health;
                this.Stats.Armor            += helmet.armorStats.Armor;
            }
            if (chest != null)
            {
                this.Stats.AdditionalHealth += chest.armorStats.Health;
                this.Stats.Armor            += chest.armorStats.Armor;
            }
            if (pants != null)
            {
                this.Stats.AdditionalHealth += pants.armorStats.Health;
                this.Stats.Armor            += pants.armorStats.Armor;
            }
            if (boots != null)
            {
                this.Stats.AdditionalHealth += boots.armorStats.Health;
                this.Stats.Armor            += boots.armorStats.Armor;
            }
            if (wrist != null)
            {
                this.Stats.AdditionalHealth += wrist.armorStats.Health;
                this.Stats.Armor            += wrist.armorStats.Armor;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Вычесть опыт персонажа
 /// </summary>
 /// <param name="count">Количество опыта</param>
 public void SubstractXp(int count)
 {
     Stats.Xp -= count;
     while (Stats.Xp < 0)
     {
         Stats = LevelSystem.LevelDown(Stats, -Stats.Xp);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Добавить опыт персонажа
 /// </summary>
 /// <param name="count">Количество опыта</param>
 public void AddingXp(int count)
 {
     Stats.Xp += count;
     while (Stats.Xp >= Stats.MaxXp)
     {
         Stats = LevelSystem.LevelUp(Stats, Stats.Xp - Stats.MaxXp);
     }
 }