Esempio n. 1
0
 public void LogDead()
 {
     if (Dead)
     {
         BattleLog.Save(Name + " is dead. Hitpoints dropped to " + _hitPoints);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Log data about the character to the battle log.
 /// </summary>
 public void LogSurvivor()
 {
     if (!Dead)
     {
         BattleLog.Save(Name + " survived with " + _hitPoints + " hit points left");
     }
 }
Esempio n. 3
0
        public void ReceiveDamage(int damage)
        {
            int armor = 0;

            _hitPoints += armor;
            _hitPoints -= damage;

            string message = $"{Name} receives {damage} damage , and is down to {_hitPoints} HP";


            BattleLog.Save(message);
            if (Dead)
            {
                BattleLog.Save(Name + " died!");
                LogDead();
            }

            if (Alive)
            {
                LogSurvivor();
            }
        }
        public void ReceiveDamage(int damage)
        {
            int armor = 0;

            foreach (DefenceObject defence in BackPack)
            {
                if (defence.Enchanced)
                {
                    armor += defence.MinDefence + 1;
                    armor += defence.MaxDefence + 1;
                }
                else
                {
                    armor += defence.MinDefence;
                    armor += defence.MaxDefence;
                }
            }

            _hitPoints += armor;
            _hitPoints -= damage;

            string message = $"{Name} receives {damage} damage , and is down to {_hitPoints} HP";


            BattleLog.Save(message);
            if (Dead)
            {
                BattleLog.Save(Name + " died!");
                LogDead();
            }

            if (Alive)
            {
                LogSurvivor();
            }
        }