Example #1
0
        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();
            }
        }
Example #2
0
 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));
     }
 }
Example #3
0
        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));
            }
        }
Example #4
0
 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);
     }
 }
Example #5
0
 public virtual void MeleeAttack(Actor target)
 {
     if (attributes.CheckHit())
     {
         target.TakeDamage(this, attributes.CheckMeleeDamage());
     }
 }
Example #6
0
 public virtual void AddMana(Actor from, int points)
 {
     stats.curMana += points;
     if (stats.curMana > stats.maxMana) stats.curMana = stats.maxMana;
 }
Example #7
0
 public virtual void AddHealth(Actor from, int points)
 {
     stats.curHealth += points;
     if (stats.curHealth > stats.maxHealth) stats.curHealth = stats.maxHealth;
 }
Example #8
0
 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);
     }
 }
Example #9
0
        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));
            }
        }