Esempio n. 1
0
        public virtual void GetAttacked(AttackParams attack)
        {
            equipment.Protect(attack);

            body.TakeAttack(attack);

            GotAttacked(this, new AttackedEventArgs(attack.attacker));

            CheckForDeath();
        }
Esempio n. 2
0
 public void TakeAttack(AttackParams attack)
 {
     if (attack.EperSquare >= (Health / Area))
     {
         isDead = true;
     }
     else
     {
         AddInjury();
     }
     TakeEnergyHit(attack);
 }
Esempio n. 3
0
 public void TakeEnergyHit(AttackParams attack)
 {
     if (attack.E > Health)
     {
         isDead = true;
     }
     else
     {
         float damagePerBodyPart = attack.E / bodyParts.Count;
         foreach (var item in bodyParts)
         {
             item.TakeDamage(damagePerBodyPart / absorbationK);
         }
     }
 }
Esempio n. 4
0
        public AttackParams Protect(AttackParams attack)
        {
            bool isPenetrated = true;

            foreach (var item in bodyEquipment)
            {
                if (!attack.IsActive)
                {
                    continue;
                }
                if (isPenetrated)
                {
                    isPenetrated = item.TryPenetrate(attack);
                }
                else
                {
                    item.AbsorbEnergy(attack);
                }
            }
            return(attack);
        }
Esempio n. 5
0
 public AttackAction(AttackParams attackParams) : base()
 {
     this.attackParams = attackParams;
 }
Esempio n. 6
0
        public virtual void Attack(Character target, AttackParams attackParams)
        {
            attackParams.attacker = this;

            target.GetAttacked(attackParams);
        }