Rewrites of disabling move AI function codes, fixed various AI errors

This commit is contained in:
Maruno17
2023-01-19 22:30:55 +00:00
parent 0c9df4627e
commit f7578002ea
16 changed files with 359 additions and 217 deletions

View File

@@ -267,6 +267,18 @@ class Battle::AI::AIBattler
return ret
end
def has_damaging_move_of_type?(*types)
check_for_move do |m|
return true if m.damagingMove? && types.include?(m.pbCalcType(@battler))
end
return false
end
def has_move_with_function?(*functions)
check_for_move { |m| return true if functions.include?(m.function) }
return false
end
#=============================================================================
def can_switch_lax?