Added more debug logging to AI, fixed some bugs in AI

This commit is contained in:
Maruno17
2023-01-16 19:29:28 +00:00
parent 98f16c2afa
commit 2627d68782
21 changed files with 280 additions and 115 deletions

View File

@@ -1,6 +1,8 @@
class Battle::AI
#=============================================================================
# Decide whether the opponent should use an item on the Pokémon
# TODO: Maybe don't cure a status problem if the Pokémon has an ability or
# something that makes it benefit from having that problem.
#=============================================================================
def pbEnemyShouldUseItem?
item = nil
@@ -14,7 +16,7 @@ class Battle::AI
end
# Register use of item
@battle.pbRegisterItem(@user.index, item, idxTarget)
PBDebug.log("[AI] #{@user.pbThis} (#{@user.index}) will use item #{GameData::Item.get(item).name}")
PBDebug.log_ai("#{@user.name} will use item #{GameData::Item.get(item).name}")
return true
end