Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert various to callnatives - Part 1 #3269

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 45 additions & 40 deletions asm/macros/battle_script.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,51 @@
.4byte \ptr
.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

.macro jumpifshelltrap battler:req, jumpInstr:req
callnative BS_JumpIfShellTrap
.byte \battler
.4byte \jumpInstr
.endm

.macro jumpifemergencyexited battler:req, jumpInstr:req
callnative BS_JumpIfEmergencyExited
.byte \battler
.4byte \jumpInstr
.endm

.macro jumpifrodaffected battler:req, jumpInstr:req
callnative BS_JumpIfRod
.4byte \jumpInstr
.endm

.macro jumpifabsorbaffected battler:req, jumpInstr:req
callnative BS_JumpIfAbsorb
.4byte \jumpInstr
.endm

.macro jumpifmotoraffected battler:req, jumpInstr:req
callnative BS_JumpIfMotor
.4byte \jumpInstr
.endm

@ various command changed to more readable macros
.macro cancelmultiturnmoves battler:req
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
Expand Down Expand Up @@ -1633,21 +1678,6 @@
.4byte \failInstr
.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
various \battler, VARIOUS_HANDLE_FORM_CHANGE
.byte \case
Expand Down Expand Up @@ -2020,21 +2050,6 @@
various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK
.endm

.macro jumpifrodaffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_ROD
.4byte \jumpInstr
.endm

.macro jumpifabsorbaffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_ABSORB
.4byte \jumpInstr
.endm

.macro jumpifmotoraffected battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_MOTOR
.4byte \jumpInstr
.endm

.macro jumpifteanoberry jumpInstr:req
various BS_ATTACKER, VARIOUS_TEATIME_TARGETS
.4byte \jumpInstr
Expand Down Expand Up @@ -2299,16 +2314,6 @@
waitmessage B_WAIT_TIME_LONG
.endm

.macro jumpifemergencyexited battler:req, jumpInstr:req
various \battler, VARIOUS_JUMP_IF_EMERGENCY_EXITED
.4byte \jumpInstr
.endm

.macro jumpifshelltrap battler:req, ptr:req
various \battler, VARIOUS_JUMP_IF_SHELL_TRAP
.4byte \ptr
.endm

.macro hitswitchtargetfailed
various 0, VARIOUS_HIT_SWITCH_TARGET_FAILED
.endm
Expand Down
87 changes: 40 additions & 47 deletions include/constants/battle_script_commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,53 +210,46 @@
#define VARIOUS_TRY_ACTIVATE_BATTLE_BOND 118
#define VARIOUS_CONSUME_BERRY 119
#define VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL 120
#define VARIOUS_HANDLE_PRIMAL_REVERSION 121
#define VARIOUS_APPLY_PLASMA_FISTS 122
#define VARIOUS_JUMP_IF_SPECIES 123
#define VARIOUS_UPDATE_ABILITY_POPUP 124
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127
#define VARIOUS_PHOTON_GEYSER_CHECK 128
#define VARIOUS_SHELL_SIDE_ARM_CHECK 129
#define VARIOUS_TRY_NO_RETREAT 130
#define VARIOUS_TRY_TAR_SHOT 131
#define VARIOUS_CAN_TAR_SHOT_WORK 132
#define VARIOUS_CHECK_POLTERGEIST 133
#define VARIOUS_SET_OCTOLOCK 134
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 135
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 136
#define VARIOUS_JUMP_IF_UNDER_200 137
#define VARIOUS_SET_SKY_DROP 138
#define VARIOUS_CLEAR_SKY_DROP 139
#define VARIOUS_SKY_DROP_YAWN 140
#define VARIOUS_JUMP_IF_HOLD_EFFECT 142
#define VARIOUS_CURE_CERTAIN_STATUSES 143
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 144
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 145
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 146
#define VARIOUS_SAVE_BATTLER_ITEM 147
#define VARIOUS_RESTORE_BATTLER_ITEM 148
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 149
#define VARIOUS_SET_BEAK_BLAST 150
#define VARIOUS_SWAP_SIDE_STATUSES 151
#define VARIOUS_SWAP_STATS 152
#define VARIOUS_JUMP_IF_ROD 153
#define VARIOUS_JUMP_IF_ABSORB 154
#define VARIOUS_JUMP_IF_MOTOR 155
#define VARIOUS_TEATIME_INVUL 156
#define VARIOUS_TEATIME_TARGETS 157
#define VARIOUS_TRY_WIND_RIDER_POWER 158
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 159
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 160
#define VARIOUS_JUMP_IF_EMERGENCY_EXITED 161
#define VARIOUS_STORE_HEALING_WISH 162
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 163
#define VARIOUS_JUMP_IF_SHELL_TRAP 164
#define VARIOUS_TRY_REVIVAL_BLESSING 165
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE 166
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION 167
#define VARIOUS_HANDLE_ULTRA_BURST 168
#define VARIOUS_APPLY_PLASMA_FISTS 121
#define VARIOUS_JUMP_IF_SPECIES 122
#define VARIOUS_UPDATE_ABILITY_POPUP 123
#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124
#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 125
#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 126
#define VARIOUS_PHOTON_GEYSER_CHECK 127
#define VARIOUS_SHELL_SIDE_ARM_CHECK 128
#define VARIOUS_TRY_NO_RETREAT 129
#define VARIOUS_TRY_TAR_SHOT 130
#define VARIOUS_CAN_TAR_SHOT_WORK 131
#define VARIOUS_CHECK_POLTERGEIST 132
#define VARIOUS_SET_OCTOLOCK 133
#define VARIOUS_CUT_1_3_HP_RAISE_STATS 134
#define VARIOUS_TRY_END_NEUTRALIZING_GAS 135
#define VARIOUS_JUMP_IF_UNDER_200 136
#define VARIOUS_SET_SKY_DROP 137
#define VARIOUS_CLEAR_SKY_DROP 138
#define VARIOUS_SKY_DROP_YAWN 139
#define VARIOUS_JUMP_IF_HOLD_EFFECT 140
#define VARIOUS_CURE_CERTAIN_STATUSES 141
#define VARIOUS_TRY_RESET_NEGATIVE_STAT_STAGES 142
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_BERRY 143
#define VARIOUS_JUMP_IF_LAST_USED_ITEM_HOLD_EFFECT 144
#define VARIOUS_SAVE_BATTLER_ITEM 145
#define VARIOUS_RESTORE_BATTLER_ITEM 146
#define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 147
#define VARIOUS_SET_BEAK_BLAST 148
#define VARIOUS_SWAP_SIDE_STATUSES 149
#define VARIOUS_SWAP_STATS 150
#define VARIOUS_TEATIME_INVUL 151
#define VARIOUS_TEATIME_TARGETS 152
#define VARIOUS_TRY_WIND_RIDER_POWER 153
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 154
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 155
#define VARIOUS_STORE_HEALING_WISH 156
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 157
#define VARIOUS_TRY_REVIVAL_BLESSING 158
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE 159
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION 160

// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0
Expand Down
Loading