Insomnia ability pop-up (#2643)

* Insomnia ability pop-up

* remove B_MSG_STAYED_AWAKE_USING constant
This commit is contained in:
DizzyEggg 2023-02-07 18:47:23 +01:00 committed by GitHub
parent 7e9d40d401
commit ff088752e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 27 deletions

View file

@ -731,7 +731,7 @@
.4byte \ptr
.endm
.macro jumpifcantmakeasleep ptr:req
.macro jumpifuproarwakes ptr:req
.byte 0x84
.4byte \ptr
.endm

View file

@ -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

View file

@ -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

View file

@ -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)