public override void TakeDamage(Actor from, int dmgPoints) { GameManager.GetInstance().AddMessage(String.Format("The {0} attacks for {1} damage.", from.Name, dmgPoints)); stats.curHealth -= dmgPoints; if (stats.curHealth <= 0) { GameManager.GetInstance().AddMessage("You die."); GameManager.GetInstance().Quit(); } }
public override void MeleeAttack(Actor target) { if (attributes.CheckHit()) { int dmgPoints = attributes.CheckMeleeDamage(); GameManager.GetInstance().AddMessage(String.Format("You hit the {0} for {1} damage.", target.Name, dmgPoints)); target.TakeDamage(this, dmgPoints); } else { GameManager.GetInstance().AddMessage(String.Format("Your attack misses the {0}", target.Name)); } }
public override void MeleeAttack(Actor target) { if (attributes.CheckHit(target.Attributes)) { int attack_damage = attributes.CheckMeleeDamage(); if (inventory != null && inventory.equipped != null) attack_damage += GameManager.GetInstance().Random.Next(1, inventory.equipped.Damage + 1); ownerMap.Gamestate.AddMessage(String.Format("You hit the {0} for {1} damage.", target.Name, attack_damage)); target.TakeDamage(this, attack_damage); } else { ownerMap.Gamestate.AddMessage(String.Format("Your attack misses the {0}", target.Name)); } }
public virtual void TakeDamage(Actor from, int dmgPoints) { stats.curHealth -= dmgPoints; if (stats.curHealth <= 0) { GameManager.GetInstance().AddMessage(String.Format("The {0} dies.", name)); GameManager.GetInstance().Map.entities.Remove(this); } }
public virtual void MeleeAttack(Actor target) { if (attributes.CheckHit()) { target.TakeDamage(this, attributes.CheckMeleeDamage()); } }
public virtual void AddMana(Actor from, int points) { stats.curMana += points; if (stats.curMana > stats.maxMana) stats.curMana = stats.maxMana; }
public virtual void AddHealth(Actor from, int points) { stats.curHealth += points; if (stats.curHealth > stats.maxHealth) stats.curHealth = stats.maxHealth; }
public virtual void TakeDamage(Actor from, int dmgPoints) { stats.curHealth -= dmgPoints; if (stats.curHealth <= 0) { ownerMap.Gamestate.AddMessage(String.Format("The {0} dies.", name)); ownerMap.entities.Remove(this); } }
public virtual void MeleeAttack(Actor target) { if (attributes.CheckHit(target.Attributes)) { int attack_damage = attributes.CheckMeleeDamage(); if (inventory != null && inventory.equipped != null) attack_damage += GameManager.GetInstance().Random.Next(1, inventory.equipped.Damage + 1); target.TakeDamage(this, attack_damage); } else { ownerMap.Gamestate.AddMessage(String.Format("The {0} attacks, but misses.", Name)); } }