summaryrefslogtreecommitdiff
path: root/src/macros/scripts.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2021-02-07 12:35:46 -0600
committerdannye <33dannye@gmail.com>2021-02-07 12:35:46 -0600
commit9a20f8c737b53b4a078ade02df95d1e3d6346f3f (patch)
tree9cc3aeb48b61cda79ea74a0823e59eb5f4aad25a /src/macros/scripts.asm
parent794701bf871f56d06b9567ef0ea84ebb98710572 (diff)
Add alias test macros for jumps with NULL destination
Diffstat (limited to 'src/macros/scripts.asm')
-rw-r--r--src/macros/scripts.asm38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/macros/scripts.asm b/src/macros/scripts.asm
index 3249cfe..bd500a2 100644
--- a/src/macros/scripts.asm
+++ b/src/macros/scripts.asm
@@ -647,6 +647,13 @@ jump_if_event_zero: MACRO
dw \2 ; Script Label
ENDM
+; Tests if a given event is zero
+test_if_event_zero: MACRO
+ run_command ScriptCommand_JumpIfEventZero
+ db \1 ; event (ex EVENT_IMAKUNI_WIN_COUNT)
+ dw NULL
+ENDM
+
; Jumps to a script position if a given event is nonzero
jump_if_event_nonzero: MACRO
run_command ScriptCommand_JumpIfEventNonzero
@@ -662,6 +669,14 @@ jump_if_event_equal: MACRO
dw \3 ; Script Label
ENDM
+; Tests if an event matches given value
+test_if_event_equal: MACRO
+ run_command ScriptCommand_JumpIfEventEqual
+ db \1 ; event (ex EVENT_IMAKUNI_WIN_COUNT)
+ db \2 ; value
+ dw NULL
+ENDM
+
; Jumps to a script position if an event does not match a given value
jump_if_event_not_equal: MACRO
run_command ScriptCommand_JumpIfEventNotEqual
@@ -670,6 +685,14 @@ jump_if_event_not_equal: MACRO
dw \3 ; Script Label
ENDM
+; Tests if an event does not match a given value
+test_if_event_not_equal: MACRO
+ run_command ScriptCommand_JumpIfEventNotEqual
+ db \1 ; event (ex EVENT_IMAKUNI_WIN_COUNT)
+ db \2 ; value
+ dw NULL
+ENDM
+
; Jumps to a script position if an event is greater than or equal to a given value
jump_if_event_greater_or_equal: MACRO
run_command ScriptCommand_JumpIfEventGreaterOrEqual
@@ -686,6 +709,14 @@ jump_if_event_less_than: MACRO
dw \3 ; Script Label
ENDM
+; Tests if an event is less than a given value
+test_if_event_less_than: MACRO
+ run_command ScriptCommand_JumpIfEventLessThan
+ db \1 ; event (ex EVENT_IMAKUNI_WIN_COUNT)
+ db \2 ; value
+ dw NULL
+ENDM
+
; Sets an event to its maximum possible value
max_out_event_value: MACRO
run_command ScriptCommand_MaxOutEventValue
@@ -712,6 +743,13 @@ jump_if_event_false: MACRO
dw \2 ; Script Label
ENDM
+; Tests if an event is false
+test_if_event_false: MACRO
+ run_command ScriptCommand_JumpIfEventFalse
+ db \1 ; event (ex EVENT_RECEIVED_LEGENDARY_CARDS)
+ dw NULL
+ENDM
+
; Increments given event's value (truncates the new value)
increment_event_value: MACRO
run_command ScriptCommand_IncrementEventValue