/// <summary> /// Remove a Charge from the Consumable in order to restaure Health /// <para />If the number of Charge reach 0, the Item is destroyed /// </summary> /// <param name="hero"></param> public override void Use(Hero hero) { if (this.ChargesLeft >= 1) { this.ChargesLeft--; hero.Heal(HealingPower); } if (ChargesLeft <= 0) { throw new ItemDestroyedException(); } }
public override void Add(Hero hero) { base.Add(hero); if (this.HitPointBonus > 0) { hero.IncreaseMaxLife(this.HitPointBonus); hero.Heal(this.HitPointBonus); } if (this.AgilityBonus > 0) { hero.IncreaseAgility(this.AgilityBonus); } }