mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed Pokédex showing genders for the wrong species, fixed AI always switching sleeping/frozen Pokémon, fixed class PngAnimatedBitmap animating slowly
This commit is contained in:
@@ -408,8 +408,10 @@ Battle::AI::Handlers::ShouldSwitch.add(:asleep,
|
||||
end
|
||||
# Doesn't have sufficiently raised stats that would be lost by switching
|
||||
next false if battler.stages.any? { |key, val| val >= 2 }
|
||||
# 50% chance to not bother
|
||||
next false if ai.pbAIRandom(100) < 50
|
||||
# A reserve Pokémon is awake and not frozen
|
||||
next false if reserves.none? { |pkmn| ![:SLEEP, :FROZEN].include?(pkmn.status) }
|
||||
# 60% chance to not bother
|
||||
next false if ai.pbAIRandom(100) < 60
|
||||
PBDebug.log_ai("#{battler.name} wants to switch because it is asleep and can't do anything")
|
||||
next true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user