diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-19 16:30:07 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-19 16:30:07 -0400 |
commit | bcc4380d40767983a0b253d486bb3c82f0f1fd07 (patch) | |
tree | ad39266430b203c3ea8f7bcd7b2b57868e4cb38f | |
parent | 84694218926e2668ef137783f3c2607f62fa936f (diff) |
Port 'add_tmnum' from pokecrystal
-rw-r--r-- | constants/item_constants.asm | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/constants/item_constants.asm b/constants/item_constants.asm index d4566c71..bb779fe4 100644 --- a/constants/item_constants.asm +++ b/constants/item_constants.asm @@ -118,23 +118,25 @@ NUM_FLOORS EQU const_value - 1 - NUM_ITEMS ; match the actual number below. NUM_TMS EQU 50 +__tmhm_value__ = NUM_TMS + 1 + +add_tmnum: MACRO +\1_TMNUM EQU __tmhm_value__ +__tmhm_value__ = __tmhm_value__ + 1 +ENDM + add_hm: MACRO ; Defines three constants: ; - HM_\1: the item id, starting at $C4 ; - \1_TMNUM: the learnable TM/HM flag, starting at 51 ; - HM##_MOVE: alias for the move id, equal to the value of \1 -; The first usage also defines HM01 as the first HM item id. -IF !DEF(HM01) -HM01 EQU const_value -__tmhm_value__ = NUM_TMS + 1 -ENDC const HM_\1 -\1_TMNUM EQU __tmhm_value__ -__HM_VALUE = __tmhm_value__ - NUM_TMS -HM{02d:__HM_VALUE}_MOVE EQU \1 -__tmhm_value__ = __tmhm_value__ + 1 +HM_VALUE = __tmhm_value__ - NUM_TMS +HM{02d:HM_VALUE}_MOVE EQU \1 + add_tmnum \1 ENDM +HM01 EQU const_value add_hm CUT ; $C4 add_hm FLY ; $C5 add_hm SURF ; $C6 @@ -142,22 +144,19 @@ ENDM add_hm FLASH ; $C8 NUM_HMS EQU const_value - HM01 +__tmhm_value__ = 1 + add_tm: MACRO ; Defines three constants: ; - TM_\1: the item id, starting at $C9 ; - \1_TMNUM: the learnable TM/HM flag, starting at 1 ; - TM##_MOVE: alias for the move id, equal to the value of \1 -; The first usage also defines TM01 as the first TM item id. -IF !DEF(TM01) -TM01 EQU const_value -__tmhm_value__ = 1 -ENDC const TM_\1 -\1_TMNUM EQU __tmhm_value__ TM{02d:__tmhm_value__}_MOVE EQU \1 -__tmhm_value__ = __tmhm_value__ + 1 + add_tmnum \1 ENDM +TM01 EQU const_value add_tm MEGA_PUNCH ; $C9 add_tm RAZOR_WIND ; $CA add_tm SWORDS_DANCE ; $CB |