10-14-2009, 09:55 PM
For the normal attacks you just need to leave the dummy elements from the computations made in elements_correct, right?
Use this modified version of the set_attack_damage_value code.
There would an alternative and cleaner way of doing this, but if this one works... :)
Use this modified version of the set_attack_damage_value code.
Code:
def set_attack_damage_value(attacker)
case DAMAGE_ALGORITHM_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)
dummy_elements = [2,3,7,8,9,10,] # add any dummy element IDs other scripts might use
self.damage *= elements_correct(attacker.element_set - dummy_elements)
self.damage /= 100
end
There would an alternative and cleaner way of doing this, but if this one works... :)