Fix dire hit being used on incorrect target (#4626)

* fix getboxmondata for evolutiontracker if compiled with agbcc

* fix dire hit being used on incorrect battler
This commit is contained in:
cawtds 2024-05-26 00:06:55 +02:00 committed by GitHub
parent a507af300e
commit 474f929c02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 9 deletions

View file

@ -855,8 +855,9 @@
.byte 0x99
.endm
.macro setfocusenergy
.macro setfocusenergy battler:req
.byte 0x9a
.byte \battler
.endm
.macro transformdataexecution

View file

@ -3451,7 +3451,7 @@ BattleScript_EffectFocusEnergy::
attackstring
ppreduce
jumpifstatus2 BS_ATTACKER, STATUS2_FOCUS_ENERGY_ANY, BattleScript_ButItFailed
setfocusenergy
setfocusenergy BS_TARGET
attackanimation
waitanimation
printfromtable gFocusEnergyUsedStringIds

View file

@ -122,7 +122,7 @@ BattleScript_ItemSetMist::
BattleScript_ItemSetFocusEnergy::
call BattleScript_UseItemMessage
jumpifstatus2 BS_ATTACKER, STATUS2_FOCUS_ENERGY_ANY, BattleScript_ButItFailed
setfocusenergy
setfocusenergy BS_ATTACKER
playmoveanimation BS_ATTACKER, MOVE_FOCUS_ENERGY
waitanimation
copybyte sBATTLER, gBattlerAttacker

View file

@ -12477,22 +12477,23 @@ static void Cmd_setmist(void)
static void Cmd_setfocusenergy(void)
{
CMD_ARGS();
CMD_ARGS(u8 battler);
u8 battler = GetBattlerForBattleScript(cmd->battler);
if ((gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || (gAbsentBattlerFlags & gBitTable[gBattlerTarget])))
|| gBattleMons[gBattlerTarget].status2 & STATUS2_FOCUS_ENERGY_ANY)
if ((gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || (gAbsentBattlerFlags & gBitTable[battler])))
|| gBattleMons[battler].status2 & STATUS2_FOCUS_ENERGY_ANY)
{
gMoveResultFlags |= MOVE_RESULT_FAILED;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_FOCUS_ENERGY_FAILED;
}
else if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && !IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_DRAGON))
else if (gMovesInfo[gCurrentMove].effect == EFFECT_DRAGON_CHEER && !IS_BATTLER_OF_TYPE(battler, TYPE_DRAGON))
{
gBattleMons[gBattlerTarget].status2 |= STATUS2_DRAGON_CHEER;
gBattleMons[battler].status2 |= STATUS2_DRAGON_CHEER;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED;
}
else
{
gBattleMons[gBattlerTarget].status2 |= STATUS2_FOCUS_ENERGY;
gBattleMons[battler].status2 |= STATUS2_FOCUS_ENERGY;
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_GETTING_PUMPED;
}
gBattlescriptCurrInstr = cmd->nextInstr;