Exemplo n.º 1
0
 static int CalculateCounterDamage(TroopScript Attacker, TroopScript Defender, float CounterAtkScale,  int BattlefieldEffect)
 {
     int	AdjustedTroopSize= CalculateAdjustedTroopSize ( Attacker.GetNumber(),ReturnPeoplePerLine(Attacker),Attacker.GetChief().GetMuhReturns());
     int TroopDamage = 0;
     if (Attacker.GetClass().GetIfItsPhysical())
         TroopDamage = Mathf.RoundToInt	((AdjustedTroopSize*((float)CalculateAttack(Attacker.GetClass().GetAttack(),Attacker.GetChief().GetAttack(),Attacker.GetCounterAttackBuff())-(float)CalculateDefense(Defender.GetClass().GetDefense(),Defender.GetChief().GetDefense(),Defender.GetDefenseBuff(),Defender.GetPhalanx()))/15));
     else
         TroopDamage = Mathf.RoundToInt((AdjustedTroopSize*(((float)CalculateMagicAttack(Attacker.GetClass().GetIntelligence(),Attacker.GetChief().GetIntelligence(),Attacker.GetCounterMatkBuff())-(float)CalculateMagicDefense(Defender.GetChief().GetIntelligence(),Defender.GetMdefBuff()))/15)));
     if (TroopDamage>Attacker.GetNumber())
         TroopDamage = Attacker.GetNumber();
     int flatWeaponValue = Attacker.GetWeapon().Attack*((Attacker.GetClass().GetIfItsPhysical()&&Attacker.GetWeapon().physical||!Attacker.GetWeapon().physical&&!Attacker.GetClass().GetIfItsPhysical())?1:0);
     int Final = Mathf.RoundToInt(((TroopDamage*Attacker.GetWeapon().AttackModifier+flatWeaponValue)*CounterAtkScale)*BattlefieldEffect);
     return Final;
 }
Exemplo n.º 2
0
 static int CalculateDamage(TroopScript Attacker, TroopScript Defender, Skill Skillused, int BattlefieldEffect)
 {
     TroopScript thisGuysTerrain;
     int TroopDamage = 0;
     if (Skillused.SkillMaxRange > 1)
         thisGuysTerrain = Attacker;
     else thisGuysTerrain = Defender;
     int	AdjustedTroopSize= CalculateAdjustedTroopSize ( Attacker.GetNumber(),ReturnPeoplePerLine(thisGuysTerrain),Attacker.GetChief().GetMuhReturns());
     bool isPhysical = Skillused.isPhysical;
     if (isPhysical && Skillused.PiercesDefence == false)
     TroopDamage = Mathf.RoundToInt	((AdjustedTroopSize*((float)CalculateAttack(Attacker.GetClass().GetAttack(),Attacker.GetChief().GetAttack(),Attacker.GetDirectAttackBuff())-(float)CalculateDefense(Defender.GetClass().GetDefense(),Defender.GetChief().GetDefense(),Defender.GetDefenseBuff(),Defender.GetPhalanx()))/15));
     else if (isPhysical && Skillused.PiercesDefence == true)
         TroopDamage = Mathf.RoundToInt	((AdjustedTroopSize*((float)CalculateAttack(Attacker.GetClass().GetAttack(),Attacker.GetChief().GetAttack(),Attacker.GetDirectAttackBuff())-(float)CalculatePiercedDefense(Defender.GetClass().GetDefense(),Defender.GetChief().GetDefense(),Defender.GetDefenseBuff())/15)));
     else if (!isPhysical)
     TroopDamage = Mathf.RoundToInt((AdjustedTroopSize*(((float)CalculateMagicAttack(Attacker.GetClass().GetIntelligence(),Attacker.GetChief().GetIntelligence(),Attacker.GetDirectMatkBuff())-(float)CalculateMagicDefense(Defender.GetChief().GetIntelligence(),Defender.GetMdefBuff()))/15)));
     if (TroopDamage>Attacker.GetNumber())
         TroopDamage = Attacker.GetNumber();
     int flatWeaponValue = Attacker.GetWeapon().Attack*((isPhysical&&Attacker.GetWeapon().physical||!Attacker.GetWeapon().physical&&!isPhysical)?1:0);
     int Final = Mathf.RoundToInt(((TroopDamage*Attacker.GetWeapon().AttackModifier+flatWeaponValue)*Skillused.DamageScaling)*BattlefieldEffect);
     return Final;
 }
Exemplo n.º 3
0
 public static void Phalanx(TroopScript Caster)
 {
     bool phal = Caster.GetPhalanx();
     if (phal) Caster.SetPhalanx(false);
     else if (!phal) Caster.SetPhalanx(true);
 }