Improved AI code for weather-causing moves, added AI getting flags from trainer types, added Legendary/Mythical flags to pokemon.txt, added Setting to make wild Legendary/Mythical Pokémon smarter

This commit is contained in:
Maruno17
2023-02-20 23:33:09 +00:00
parent 0e4053f837
commit d0c99aa512
21 changed files with 610 additions and 241 deletions

View File

@@ -201,6 +201,8 @@ class Battle::AI::AIBattler
return active_types.include?(GameData::Type.get(type).id)
end
# TODO: Also make a def effectiveness_of_move_against_battler which calls
# pbCalcTypeModSingle instead of effectiveness_of_type_against_single_battler_type.
def effectiveness_of_type_against_battler(type, user = nil)
ret = Effectiveness::NORMAL_EFFECTIVE_MULTIPLIER
return ret if !type
@@ -214,8 +216,6 @@ class Battle::AI::AIBattler
end
else
@battler.pbTypes(true).each do |defend_type|
# TODO: Need to check the move's pbCalcTypeModSingle because particular
# moves can modify that method to give different effectivenesses.
ret *= effectiveness_of_type_against_single_battler_type(type, defend_type, user)
end
ret *= 2 if self.effects[PBEffects::TarShot] && type == :FIRE