Esempio n. 1
0
        public override void SufferAttack(CharacterFeatures ennemy, EDamageType damageType)
        {
            var currentLifeBeforeAttack = CurrentLife;

            base.SufferAttack(ennemy, damageType);

            SufferedDamage += currentLifeBeforeAttack - CurrentLife;
        }
        public virtual void SufferAttack(CharacterFeatures ennemy, EDamageType damageType)
        {
            if (IsDead())
            {
                Death();
                return;
            }
            var margeAttack = GetMargeAttack(ennemy.GetAttackJet());

            if (margeAttack > 0)
            {
                //Console.WriteLine("Je prend une grosse tatane dans la gueule !");
                if (damageType == EDamageType.Physical || damageType == EDamageType.Holy && !IsUndead)
                {
                    CurrentLife -= margeAttack * ennemy.GetAttackJet() / 100;
                    if (CurrentLife <= 0)
                    {
                        Death();
                    }
                }
                else if (damageType == EDamageType.Holy && IsUndead)
                {
                    CurrentLife -= margeAttack * ennemy.GetAttackJet() * 2 / 100;
                    if (CurrentLife <= 0)
                    {
                        Death();
                    }
                }

                if (ennemy is Vampire)
                {
                    //passif: vampire se soige de 50% des dégats qu'il donné
                    ennemy.CurrentLife += Damages / 2;
                }
            }
            else
            {
                //Console.WriteLine("Je contre attaque !");
                ennemy.CurrentLife += margeAttack;
            }

            if (ennemy.IsHide || IsHide)
            {
                ennemy.IsHide = false;
                IsHide        = false;
            }


            if (CurrentLife <= 0)
            {
                Death();
            }
        }
Esempio n. 3
0
 public override void Power(CharacterFeatures cible)
 {
     cible.PowerTimer = new Timer(GetSpeedJet() + SufferedDamage);
     SufferedDamage   = 0;
 }
 public virtual void Power(CharacterFeatures cible)
 {
 }