Define appropriate constants as EQU

These constants are defined only once and shouldn't be redefined anyway.
This commit is contained in:
mid-kid 2019-05-12 16:46:40 +02:00
parent 649c8d38da
commit 476f9ba40d
4 changed files with 11 additions and 11 deletions

View File

@ -62,8 +62,8 @@ ENDM
; decorations:
; - DecorationAttributes (see data/decorations/attributes.asm)
; - DecorationIDs (see data/decorations/decorations.asm)
const_value = 1
__enum__ = 0
const_def 1
enum_start
; FindOwnedBeds.beds values (see engine/overworld/decorations.asm)
const BEDS
deco FEATHERY_BED
@ -121,7 +121,7 @@ __enum__ = 0
deco GEODUDE_DOLL
deco MACHOP_DOLL
deco TENTACOOL_DOLL
NUM_NON_TROPHY_DECOS = __enum__
NUM_NON_TROPHY_DECOS EQU __enum__
deco GOLD_TROPHY_DOLL
deco SILVER_TROPHY_DOLL
NUM_DECOS = __enum__
NUM_DECOS EQU __enum__

View File

@ -199,7 +199,7 @@
add_tm: MACRO
if !DEF(TM01)
TM01 = const_value
TM01 EQU const_value
enum_start 1
endc
define _\@_1, "TM_\1"
@ -260,11 +260,11 @@ ENDM
add_tm FIRE_PUNCH ; f0
add_tm FURY_CUTTER ; f1
add_tm NIGHTMARE ; f2
NUM_TMS = const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC
NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC
add_hm: MACRO
if !DEF(HM01)
HM01 = const_value
HM01 EQU const_value
endc
define _\@_1, "HM_\1"
const _\@_1
@ -278,7 +278,7 @@ ENDM
add_hm FLASH ; f7
add_hm WHIRLPOOL ; f8
add_hm WATERFALL ; f9
NUM_HMS = const_value - HM01
NUM_HMS EQU const_value - HM01
add_mt: MACRO
enum \1_TMNUM
@ -287,7 +287,7 @@ ENDM
add_mt FLAMETHROWER
add_mt THUNDERBOLT
add_mt ICE_BEAM
NUM_TM_HM_TUTOR = __enum__ + -1
NUM_TM_HM_TUTOR EQU __enum__ + -1
const ITEM_FA ; fa

View File

@ -332,7 +332,7 @@ Edit `GetMapMusic`:
add_tm PSYCHIC_M ; dd
...
add_tm NIGHTMARE ; f2
NUM_TMS = const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC
NUM_TMS EQU const_value - TM01 - 2 ; discount ITEM_C3 and ITEM_DC
```
`GetTMHMNumber` and `GetNumberedTMHM` in [engine/items/items.asm](https://github.com/pret/pokecrystal/blob/master/engine/items/items.asm) have to compensate for this.

View File

@ -14,7 +14,7 @@ endc
ENDM
enum: MACRO
\1 = __enum__
\1 EQU __enum__
__enum__ = __enum__ + __enumdir__
ENDM