Fixed typo in egg generatio, fixed typo in battle code that changes a Pokémon's type, fixed bug in AI that prevents switching

This commit is contained in:
Maruno17
2021-05-15 20:28:15 +01:00
parent f303b84033
commit 66b40fd181
3 changed files with 5 additions and 5 deletions

View File

@@ -10,7 +10,7 @@ class PokeBattle_AI
return false if @battle.wildBattle?
shouldSwitch = forceSwitch
batonPass = -1
moveType = -1
moveType = nil
skill = @battle.pbGetOwnerFromBattlerIndex(idxBattler).skill_level || 0
battler = @battle.battlers[idxBattler]
# If Pokémon is within 6 levels of the foe, and foe's last move was
@@ -107,7 +107,7 @@ class PokeBattle_AI
end
end
# moveType is the type of the target's last used move
if moveType>=0 && Effectiveness.ineffective?(pbCalcTypeMod(moveType,battler,battler))
if moveType && Effectiveness.ineffective?(pbCalcTypeMod(moveType,battler,battler))
weight = 65
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
if Effectiveness.super_effective?(typeMod)
@@ -115,7 +115,7 @@ class PokeBattle_AI
weight = 85
end
list.unshift(i) if pbAIRandom(100)<weight # Put this Pokemon first
elsif moveType>=0 && Effectiveness.resistant?(pbCalcTypeMod(moveType,battler,battler))
elsif moveType && Effectiveness.resistant?(pbCalcTypeMod(moveType,battler,battler))
weight = 40
typeMod = pbCalcTypeModPokemon(pkmn,battler.pbDirectOpposing(true))
if Effectiveness.super_effective?(typeMod)