示例#1
0
 private int GetDefendedChange(int change, int elementID, Combatant user, Combatant target)
 {
     // race damage
     if(!this.ignoreRace)
     {
         change *= user.GetRaceDamageFactor(target.raceID);
         change /= 100;
     }
     // size damage
     if(!this.ignoreSize)
     {
         change *= user.GetSizeDamageFactor(target.sizeID);
         change /= 100;
     }
     // element defence
     if(!this.ignoreRace && elementID >= 0)
     {
         change *= target.GetElementDefence(elementID);
         change /= 100;
     }
     // defend command
     if(!this.ignoreDefend && target.isDefending)
     {
         change = (int)(change * DataHolder.Formula(DataHolder.BattleSystem().defendFormula).Calculate(user, target));
         change /= 100;
     }
     return change;
 }