I am using the Enu sideview battle system and have unsuccessfully attempted to try and modify the script.
Issue: Change the order in which damage is dealt:
For example, in my tests:
Attacker attacks monster (0 PDEF, 0% Resistance) = 623 damage
Attacker attacks monster (50 PDEF, 0% Resistance) = 527 damage
Attacker attacks monster (0 PDEF, 50% Resistance) = 311 damage
Attacker attacks monster (50 PDEF, 50% Resistance) = 263 damage
The 96 damage drop from the first two test cases and the 48 damage drop from the last two test cases most likely show that the attacker goes through PDEF calculations first, then resistance calculations.
It may be supported by the order of the code as well:
In this script, when 0, 1, 2, and 3 refer to different damage formulas which can be changed at the start of the script (not shown).
I would like it if one could change the order of this formula correctly so that the resistance is calculated first and the PDEF calculations calculated afterward.
I will learn from your example and try doing mdef calculations by myself.
Thanks for your time, Nukei.
Issue: Change the order in which damage is dealt:
For example, in my tests:
Attacker attacks monster (0 PDEF, 0% Resistance) = 623 damage
Attacker attacks monster (50 PDEF, 0% Resistance) = 527 damage
Attacker attacks monster (0 PDEF, 50% Resistance) = 311 damage
Attacker attacks monster (50 PDEF, 50% Resistance) = 263 damage
The 96 damage drop from the first two test cases and the 48 damage drop from the last two test cases most likely show that the attacker goes through PDEF calculations first, then resistance calculations.
It may be supported by the order of the code as well:
Code:
 def set_attack_damage_value(attacker)
  case DAMAGE_ALOGARITHM_TYPE
  when 0
   atk = [attacker.atk - (self.pdef / 2), 0].max
   str = [20 + attacker.str, 0].max
  when 1
   atk = [attacker.atk - ((attacker.atk * self.pdef) / 1000), 0].max
   str = [20 + attacker.str, 0].max
  when 2
   atk = 20
   str = [(attacker.str * 4) - (self.dex * 2) , 0].max
  when 3
   atk = [(10 + attacker.atk) - (self.pdef / 2), 0].max
   str = [(20 + attacker.str) - (self.dex / 2), 0].max
  end
  self.damage = atk * str / 20
  self.damage = 1 if self.damage == 0 and (rand(100) > 40)
  self.damage *= elements_correct(attacker.element_set)
  self.damage /= 100
 end
In this script, when 0, 1, 2, and 3 refer to different damage formulas which can be changed at the start of the script (not shown).
I would like it if one could change the order of this formula correctly so that the resistance is calculated first and the PDEF calculations calculated afterward.
I will learn from your example and try doing mdef calculations by myself.
Thanks for your time, Nukei.