handleultraburst, handleprimalreversion, handlemegaevo

This commit is contained in:
Eduardo Quezada 2023-08-31 22:24:58 -04:00
parent 1513443c39
commit 4ac61ad15f
3 changed files with 45 additions and 38 deletions

View File

@ -1382,6 +1382,24 @@
.4byte \ptr .4byte \ptr
.endm .endm
.macro handlemegaevo battler:req, case:req
callnative BS_HandleMegaEvolution
.byte \battler
.byte \case
.endm
.macro handleprimalreversion battler:req, case:req
callnative BS_HandlePrimalReversion
.byte \battler
.byte \case
.endm
.macro handleultraburst battler:req, case:req
callnative BS_HandleUltraBurst
.byte \battler
.byte \case
.endm
@ various command changed to more readable macros @ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req .macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
@ -1627,21 +1645,6 @@
.4byte \failInstr .4byte \failInstr
.endm .endm
.macro handlemegaevo battler:req, case:req
various \battler, VARIOUS_HANDLE_MEGA_EVO
.byte \case
.endm
.macro handleprimalreversion battler:req, case:req
various \battler, VARIOUS_HANDLE_PRIMAL_REVERSION
.byte \case
.endm
.macro handleultraburst battler:req, case:req
various \battler, VARIOUS_HANDLE_ULTRA_BURST
.byte \case
.endm
.macro handleformchange battler:req, case:req .macro handleformchange battler:req, case:req
various \battler, VARIOUS_HANDLE_FORM_CHANGE various \battler, VARIOUS_HANDLE_FORM_CHANGE
.byte \case .byte \case

View File

@ -210,7 +210,6 @@
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 118 #define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 118
#define VARIOUS_CONSUME_BERRY 119 #define VARIOUS_CONSUME_BERRY 119
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 120 #define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 120
#define VARIOUS_HANDLE_PRIMAL_REVERSION 121
#define VARIOUS_APPLY_PLASMA_FISTS 122 #define VARIOUS_APPLY_PLASMA_FISTS 122
#define VARIOUS_JUMP_IF_SPECIES 123 #define VARIOUS_JUMP_IF_SPECIES 123
#define VARIOUS_UPDATE_ABILITY_POPUP 124 #define VARIOUS_UPDATE_ABILITY_POPUP 124
@ -257,7 +256,6 @@
#define VARIOUS_TRY_REVIVAL_BLESSING 165 #define VARIOUS_TRY_REVIVAL_BLESSING 165
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE 166 #define VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE 166
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION 167 #define VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION 167
#define VARIOUS_HANDLE_ULTRA_BURST 168
// Cmd_manipulatedamage // Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0 #define DMG_CHANGE_SIGN 0

View File

@ -9626,27 +9626,6 @@ static void Cmd_various(void)
} }
return; return;
} }
case VARIOUS_HANDLE_MEGA_EVO:
{
VARIOUS_ARGS(u8 case_);
HandleScriptMegaPrimalBurst(cmd->case_, gActiveBattler, HANDLE_TYPE_MEGA_EVOLUTION);
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_HANDLE_PRIMAL_REVERSION:
{
VARIOUS_ARGS(u8 case_);
HandleScriptMegaPrimalBurst(cmd->case_, gActiveBattler, HANDLE_TYPE_PRIMAL_REVERSION);
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_HANDLE_ULTRA_BURST:
{
VARIOUS_ARGS(u8 case_);
HandleScriptMegaPrimalBurst(cmd->case_, gActiveBattler, HANDLE_TYPE_ULTRA_BURST);
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_HANDLE_FORM_CHANGE: case VARIOUS_HANDLE_FORM_CHANGE:
{ {
VARIOUS_ARGS(u8 case_); VARIOUS_ARGS(u8 case_);
@ -16383,3 +16362,30 @@ void BS_SetSnow(void)
} }
gBattlescriptCurrInstr = cmd->nextInstr; gBattlescriptCurrInstr = cmd->nextInstr;
} }
void BS_HandleMegaEvolution(void)
{
NATIVE_ARGS(u8 battler, u8 caseId);
gActiveBattler = GetBattlerForBattleScript(cmd->battler);
HandleScriptMegaPrimalBurst(cmd->caseId, gActiveBattler, HANDLE_TYPE_MEGA_EVOLUTION);
gBattlescriptCurrInstr = cmd->nextInstr;
}
void BS_HandlePrimalReversion(void)
{
NATIVE_ARGS(u8 battler, u8 caseId);
gActiveBattler = GetBattlerForBattleScript(cmd->battler);
HandleScriptMegaPrimalBurst(cmd->caseId, gActiveBattler, HANDLE_TYPE_PRIMAL_REVERSION);
gBattlescriptCurrInstr = cmd->nextInstr;
}
void BS_HandleUltraBurst(void)
{
NATIVE_ARGS(u8 battler, u8 caseId);
gActiveBattler = GetBattlerForBattleScript(cmd->battler);
HandleScriptMegaPrimalBurst(cmd->caseId, gActiveBattler, HANDLE_TYPE_ULTRA_BURST);
gBattlescriptCurrInstr = cmd->nextInstr;
}