Esempio n. 1
0
 static bool CanCounter(TroopScript Attacker, TroopScript Defender, Skill SkillUsedToAttack)
 {
     bool ret = false;
     bool SkillAllows = SkillUsedToAttack.CanCounter;
     Vector2 AttackerPosition = Attacker.gridPosition;
     Vector2 DefenderPosition = Defender.gridPosition;
     int max = Defender.GetCounterMaxRange();
     int min = Defender.GetCounterMinRange();
     float value = Mathf.Abs(AttackerPosition.x-DefenderPosition.x)+Mathf.Abs(AttackerPosition.y-DefenderPosition.y);
     if (value > min && value < max && SkillAllows)
         ret = true;
         //yadda yadda check distance and skills
         return ret;
 }
Esempio n. 2
0
 public static void RearGuardCharge(TroopScript Caster, TroopScript Target)
 {
     float DamageScaling = 1.5f;
     if (Target.GetCounterMaxRange()>Caster.GetCounterMinRange())
         DamageScaling = 3;
     Skill RearGuard = Skill.FromListOfSkills(muhSkills.RearGuardCharge);
     RearGuard.DamageScaling = DamageScaling;
     MeleeFightingScript(Caster,Target,RearGuard);
 }