Fixed X items being unusable by AI, finally fixed step after battle caused by a turn

This commit is contained in:
Maruno17
2020-10-29 19:53:57 +00:00
parent 66aea40198
commit c40f95838a
5 changed files with 67 additions and 119 deletions

View File

@@ -83,7 +83,7 @@ class PokeBattle_Battle
end
end
# Uses an item on a Pokémon in the player's party.
# Uses an item on a Pokémon in the trainer's party.
def pbUseItemOnPokemon(item,idxParty,userBattler)
trainerName = pbGetOwnerName(userBattler.index)
pbUseItemMessage(item,trainerName)
@@ -100,14 +100,14 @@ class PokeBattle_Battle
pbReturnUnusedItemToBag(item,userBattler.index)
end
# Uses an item on a Pokémon in battle that belongs to the player.
def pbUseItemOnBattler(item,idxParty,userBattler)
# Uses an item on a Pokémon in battle that belongs to the trainer.
def pbUseItemOnBattler(item,idxBattler,userBattler)
trainerName = pbGetOwnerName(userBattler.index)
pbUseItemMessage(item,trainerName)
pkmn = pbParty(userBattler.index)[idxParty]
battler = pbFindBattler(idxParty,userBattler.index)
idxBattler = userBattler.index if idxBattler<0
battler = @battlers[idxBattler]
ch = @choices[userBattler.index]
if ItemHandlers.triggerCanUseInBattle(item,pkmn,battler,ch[3],true,self,@scene,false)
if ItemHandlers.triggerCanUseInBattle(item,battler.pokemon,battler,ch[3],true,self,@scene,false)
ItemHandlers.triggerBattleUseOnBattler(item,battler,@scene)
ch[1] = 0 # Delete item from choice
return