From 9a20f8c737b53b4a078ade02df95d1e3d6346f3f Mon Sep 17 00:00:00 2001 From: dannye <33dannye@gmail.com> Date: Sun, 7 Feb 2021 12:35:46 -0600 Subject: Add alias test macros for jumps with NULL destination --- src/macros/scripts.asm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'src/macros/scripts.asm') 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 -- cgit v1.2.3