diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 4d0b9a6140..2d7bd436f3 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -731,7 +731,7 @@ .4byte \ptr .endm - .macro jumpifcantmakeasleep ptr:req + .macro jumpifuproarwakes ptr:req .byte 0x84 .4byte \ptr .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 113318f1f4..25386dbf01 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3167,7 +3167,9 @@ BattleScript_EffectSleep:: ppreduce jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_SLEEP, BattleScript_AlreadyAsleep - jumpifcantmakeasleep BattleScript_CantMakeAsleep + jumpifuproarwakes BattleScript_CantMakeAsleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects @@ -3264,6 +3266,14 @@ BattleScript_LeafGuardProtects: call BattleScript_LeafGuardProtectsRet orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd + +BattleScript_InsomniaProtects: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PKMNSTAYEDAWAKEUSING + waitmessage B_WAIT_TIME_LONG + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd BattleScript_AlreadyAsleep:: setalreadystatusedmoveattempt BS_ATTACKER @@ -3826,7 +3836,9 @@ BattleScript_EffectRest:: ppreduce jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_RestIsAlreadyAsleep jumpifability BS_ATTACKER, ABILITY_COMATOSE, BattleScript_RestIsAlreadyAsleep - jumpifcantmakeasleep BattleScript_RestCantSleep + jumpifuproarwakes BattleScript_RestCantSleep + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects trysetrest BattleScript_AlreadyAtFullHp pause B_WAIT_TIME_SHORT printfromtable gRestUsedStringIds @@ -5856,9 +5868,9 @@ BattleScript_EffectYawn:: attackcanceler attackstring ppreduce - jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective - jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_PrintBattlerAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBattlerAbilityMadeIneffective + jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBattlerAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_PURIFYING_SALT, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects @@ -5866,17 +5878,18 @@ BattleScript_EffectYawn:: jumpifsubstituteblocks BattleScript_ButItFailed jumpifsafeguard BattleScript_SafeguardProtected accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON - jumpifcantmakeasleep BattleScript_ButItFailed + jumpifuproarwakes BattleScript_ButItFailed setyawn BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNWASMADEDROWSY waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_PrintBankAbilityMadeIneffective:: +BattleScript_PrintBattlerAbilityMadeIneffective:: copybyte sBATTLER, gBattlerAbility BattleScript_PrintAbilityMadeIneffective:: pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp printstring STRINGID_PKMNSXMADEITINEFFECTIVE waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 636bcb94bf..3f8853024f 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -741,7 +741,6 @@ // gUproarAwakeStringIds #define B_MSG_CANT_SLEEP_UPROAR 0 #define B_MSG_UPROAR_KEPT_AWAKE 1 -#define B_MSG_STAYED_AWAKE_USING 2 // gUproarOverTurnStringIds #define B_MSG_UPROAR_CONTINUES 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 849206c48f..be5e2ee215 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -451,7 +451,7 @@ static void Cmd_manipulatedamage(void); static void Cmd_trysetrest(void); static void Cmd_jumpifnotfirstturn(void); static void Cmd_setmiracleeye(void); -static void Cmd_jumpifcantmakeasleep(void); +static void Cmd_jumpifuproarwakes(void); static void Cmd_stockpile(void); static void Cmd_stockpiletobasedamage(void); static void Cmd_stockpiletohpheal(void); @@ -710,7 +710,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = Cmd_trysetrest, //0x81 Cmd_jumpifnotfirstturn, //0x82 Cmd_setmiracleeye, //0x83 - Cmd_jumpifcantmakeasleep, //0x84 + Cmd_jumpifuproarwakes, //0x84 Cmd_stockpile, //0x85 Cmd_stockpiletobasedamage, //0x86 Cmd_stockpiletohpheal, //0x87 @@ -10692,26 +10692,12 @@ bool8 UproarWakeUpCheck(u8 battlerId) return TRUE; } -static void Cmd_jumpifcantmakeasleep(void) +static void Cmd_jumpifuproarwakes(void) { - const u8 *jumpPtr = T1_READ_PTR(gBattlescriptCurrInstr + 1); - u32 ability = GetBattlerAbility(gBattlerTarget); - if (UproarWakeUpCheck(gBattlerTarget)) - { - gBattlescriptCurrInstr = jumpPtr; - } - else if (ability == ABILITY_INSOMNIA || ability == ABILITY_VITAL_SPIRIT) - { - gLastUsedAbility = ability; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STAYED_AWAKE_USING; - gBattlescriptCurrInstr = jumpPtr; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); else - { gBattlescriptCurrInstr += 5; - } } static void Cmd_stockpile(void)