fix dire hit

This commit is contained in:
cawtds 2024-05-26 01:23:06 +02:00
parent ec66b4fe22
commit aa6a42ef41
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

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

View File

@ -190,7 +190,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

@ -12392,22 +12392,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;