Pokémon sent into battle now default to the Fight option, fixed bugs in Instruct, fixed some AI bugs, fixed parameter mixup for def pbMoveCanTarget?, renamed function to function_code everywhere, fixed black party Pokémon icons in storage, added some more AI testing code

This commit is contained in:
Maruno17
2023-06-18 20:12:36 +01:00
parent 9c2a9130a5
commit b5e37248b9
42 changed files with 305 additions and 174 deletions

View File

@@ -293,7 +293,7 @@ class Battle::Battler
end
# "But it failed!" checks
if move.pbMoveFailed?(user, targets)
PBDebug.log(sprintf("[Move failed] In function code %s's def pbMoveFailed?", move.function))
PBDebug.log(sprintf("[Move failed] In function code %s's def pbMoveFailed?", move.function_code))
user.lastMoveFailed = true
pbCancelMoves
pbEndTurn(choice)
@@ -356,7 +356,7 @@ class Battle::Battler
# Pokémon which becomes Ghost-type because of Protean, it should
# target and curse itself. I think this is silly, so I'm making it
# choose a random opponent to curse instead.
if move.function == "CurseTargetOrLowerUserSpd1RaiseUserAtkDef1" && targets.length == 0
if move.function_code == "CurseTargetOrLowerUserSpd1RaiseUserAtkDef1" && targets.length == 0
choice[3] = -1
targets = pbFindTargets(choice, move, user)
end
@@ -528,7 +528,7 @@ class Battle::Battler
oldLastRoundMoved = b.lastRoundMoved
@battle.pbDisplay(_INTL("{1} used the move instructed by {2}!", b.pbThis, user.pbThis(true)))
b.effects[PBEffects::Instructed] = true
if b.pbCanChooseMove?(@moves[idxMove], false)
if b.pbCanChooseMove?(b.moves[idxMove], false)
PBDebug.logonerr do
b.pbUseMoveSimple(b.lastMoveUsed, b.lastRegularMoveTarget, idxMove, false)
end