Ejemplo n.º 1
0
 /// <summary>
 /// Depletes the specified amount of mana
 /// </summary>
 /// <param name="mana">The amount of mana to deplete</param>
 public void depleteMana(int mana)
 {
     this.mana = Math.Max(0, this.mana - mana);
     manaBar.update(this.mana, totalMana);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Damages the player by the specified amount
 /// </summary>
 /// <param name="damage">The amount of damage to inflict</param>
 public void damagePlayer(int damage)
 {
     health = Math.Max(0, health - damage);
     healthBar.update(health, MAX_HEALTH);
 }