diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 014a8bb7f..9ba68ef05 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1053,8 +1053,9 @@ .byte 0xca .endm - .macro setcharge + .macro setcharge battler:req .byte 0xcb + .byte \battler .endm .macro callterrainattack diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 39712db73..8ec2038ad 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3079,12 +3079,9 @@ BattleScript_TryTailwindAbilitiesLoop_WindRider: BattleScript_TryTailwindAbilitiesLoop_WindPower: call BattleScript_AbilityPopUp - copybyte sSAVED_BATTLER, gBattlerAttacker - copybyte gBattlerAttacker, gBattlerTarget - setcharge + setcharge BS_TARGET printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER waitmessage B_WAIT_TIME_LONG - copybyte gBattlerAttacker, sSAVED_BATTLER goto BattleScript_TryTailwindAbilitiesLoop_Increment BattleScript_EffectMircleEye: @@ -5872,7 +5869,7 @@ BattleScript_EffectCharge:: attackcanceler attackstring ppreduce - setcharge + setcharge BS_ATTACKER attackanimation waitanimation .if B_CHARGE_SPDEF_RAISE >= GEN_5 @@ -6937,27 +6934,6 @@ BattleScript_TailwindEnds:: waitmessage B_WAIT_TIME_LONG end2 -BattleScript_WindPowerActivatesEnd2:: - setbyte gBattlerAttacker, 0 -BattleScript_WindPowerLoop: - printstring STRINGID_EMPTYSTRING3 - jumpifability BS_ATTACKER, ABILITY_WIND_POWER, BattleScript_WindPowerLoop_Cont - goto BattleScript_WindPowerIncrement -BattleScript_WindPowerLoop_Cont: - jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerIncrement - goto BattleScript_WindPower_Activate -BattleScript_WindPower_Activate: - call BattleScript_AbilityPopUp - setcharge - printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER - waitmessage B_WAIT_TIME_LONG -BattleScript_WindPowerIncrement: - addbyte gBattlerAttacker, 1 - jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_WindPowerLoop -BattleScript_WindPowerEnd: - destroyabilitypopup - end2 - BattleScript_TrickRoomEnds:: printstring STRINGID_TRICKROOMENDS waitmessage B_WAIT_TIME_LONG @@ -7419,11 +7395,8 @@ BattleScript_AngerShellRet: return BattleScript_WindPowerActivates:: -.if B_CHECK_IF_CHARGED_UP == TRUE - jumpifstatus3 BS_ATTACKER, STATUS3_CHARGED_UP, BattleScript_WindPowerActivates_Ret -.endif call BattleScript_AbilityPopUp - setcharge + setcharge BS_TARGET printstring STRINGID_BEINGHITCHARGEDPKMNWITHPOWER waitmessage B_WAIT_TIME_LONG BattleScript_WindPowerActivates_Ret: @@ -10461,6 +10434,7 @@ BattleScript_SymbiosisActivates:: return BattleScript_TargetAbilityStatRaiseRet:: + copybyte sSAVED_BATTLER, gBattlerAttacker copybyte gBattlerAbility, gEffectBattler copybyte gBattlerAttacker, gBattlerTarget call BattleScript_AbilityPopUp @@ -10468,6 +10442,7 @@ BattleScript_TargetAbilityStatRaiseRet:: setgraphicalstatchangevalues call BattleScript_StatUp BattleScript_TargetAbilityStatRaiseRet_End: + copybyte gBattlerAttacker, sSAVED_BATTLER return BattleScript_PokemonCantUseTheMove:: diff --git a/src/battle_message.c b/src/battle_message.c index d2ca9dfd7..26b02ab5b 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -783,7 +783,7 @@ static const u8 sText_AttackerMeltedTheIce[] = _("{B_ATK_NAME_WITH_PREFIX} melte static const u8 sText_TargetToughedItOut[] = _("{B_DEF_NAME_WITH_PREFIX} toughed it out\nto show you its best side!"); static const u8 sText_AttackerLostElectricType[] = _("{B_ATK_NAME_WITH_PREFIX} used up all\nof its electricity!"); static const u8 sText_AttackerSwitchedStatWithTarget[] = _("{B_ATK_NAME_WITH_PREFIX} switched {B_BUFF1}\nwith its target!"); -static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_ATK_NAME_WITH_PREFIX} with power!"); +static const u8 sText_BeingHitChargedPkmnWithPower[] = _("Being hit by {B_CURRENT_MOVE}\ncharged {B_DEF_NAME_WITH_PREFIX} with power!"); static const u8 sText_SunlightActivatedAbility[] = _("The harsh sunlight activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); static const u8 sText_StatWasHeightened[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_BUFF1} was heightened!"); static const u8 sText_ElectricTerrainActivatedAbility[] = _("The Electric Terrain activated\n{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_LAST_ABILITY}!"); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 74e13b6d8..0b54a460c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14274,10 +14274,11 @@ static void Cmd_setforcedtarget(void) static void Cmd_setcharge(void) { - CMD_ARGS(); + CMD_ARGS(u8 battler); - gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP; - gDisableStructs[gBattlerAttacker].chargeTimer = 2; + u8 battler = GetBattlerForBattleScript(cmd->battler); + gStatuses3[battler] |= STATUS3_CHARGED_UP; + gDisableStructs[battler].chargeTimer = 2; gBattlescriptCurrInstr++; gBattlescriptCurrInstr = cmd->nextInstr; }