Fixed typos in def pbCalcTypeModPokemon, fixed party screen navigation errors when there are no Pokémon, advanced battle Debug functions now trigger modifiers, can now always change a Pokémon's form to 0

This commit is contained in:
Maruno17
2022-09-10 16:33:11 +01:00
parent 18ffd4fb94
commit dcba641a86
4 changed files with 16 additions and 6 deletions

View File

@@ -83,12 +83,12 @@ class Battle::AI
# For switching. Determines the effectiveness of a potential switch-in against
# an opposing battler.
def pbCalcTypeModPokemon(battlerThis, _battlerOther)
mod1 = Effectiveness.calculate(battlerThis.types[0], target.types[0], target.types[1])
def pbCalcTypeModPokemon(battlerThis, battlerOther)
mod1 = Effectiveness.calculate(battlerThis.types[0], battlerOther.types[0], battlerOther.types[1])
mod2 = Effectiveness::NORMAL_EFFECTIVE
if battlerThis.types.length > 1
mod2 = Effectiveness.calculate(battlerThis.types[1], target.types[0], target.types[1])
mod2 = mod2.to_f / Effectivenesss::NORMAL_EFFECTIVE
mod2 = Effectiveness.calculate(battlerThis.types[1], battlerOther.types[0], battlerOther.types[1])
mod2 = mod2.to_f / Effectiveness::NORMAL_EFFECTIVE
end
return mod1 * mod2
end