Пример #1
0
        public int CalculateDamageDone(string incomingAttackType, int effectivePower)
        {
            if (Immunities != null && Immunities.Contains(incomingAttackType))
            {
                return(0);
            }

            if (Weaknesses != null && Weaknesses.Contains(incomingAttackType))
            {
                return(effectivePower * 2);
            }

            return(effectivePower);
        }
Пример #2
0
 public int HowMuchWouldYouHitMe(Group s)
 {
     if (Immunities.Contains(s.AttackType))
     {
         return(0);
     }
     else if (Weaknesses.Contains(s.AttackType))
     {
         return(s.EffectivePower * 2);
     }
     {
         return(s.EffectivePower);
     }
 }
Пример #3
0
 public int ComputeDamage(AttackType attackType, int damage)
 {
     if (Immunity.Contains(attackType))
     {
         return(0);
     }
     else if (Weaknesses.Contains(attackType))
     {
         return(damage * 2);
     }
     else
     {
         return(damage);
     }
 }
Пример #4
0
            public int DamageReceivedOnAttack(Group attackingGroup)
            {
                if (ImmuneTo.Contains(attackingGroup.Attack.Type))
                {
                    return(0);
                }

                var damage = attackingGroup.EffectivePower;

                if (Weaknesses.Contains(attackingGroup.Attack.Type))
                {
                    damage = damage * 2;
                }

                return(damage);
            }
Пример #5
0
            public int GetDamage(BattleGroup attackingGroup)
            {
                if (attackingGroup.Type == Type)
                {
                    return(0);
                }

                int damage = attackingGroup.EffectivePower;

                if (Immunities.Contains(attackingGroup.AttackType))
                {
                    damage = 0;
                }
                if (Weaknesses.Contains(attackingGroup.AttackType))
                {
                    damage *= 2;
                }
                return(damage);
            }
Пример #6
0
        ////////////////////
        // Stat Functions //
        ////////////////////

        public bool IsWeakTo(Element element)
        {
            return(Weaknesses.Contains(element));
        }
Пример #7
0
 public bool IsWeakTo(Attack attack) => Weaknesses.Contains(attack);