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); }
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); } }
public int ComputeDamage(AttackType attackType, int damage) { if (Immunity.Contains(attackType)) { return(0); } else if (Weaknesses.Contains(attackType)) { return(damage * 2); } else { return(damage); } }
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); }
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); }
//////////////////// // Stat Functions // //////////////////// public bool IsWeakTo(Element element) { return(Weaknesses.Contains(element)); }
public bool IsWeakTo(Attack attack) => Weaknesses.Contains(attack);