Verify data table and name list sizes with assertion macros

Fixes #312
This commit is contained in:
Rangi 2021-03-25 16:33:05 -04:00
parent e1f6bb5393
commit 95ec2cf039
139 changed files with 863 additions and 437 deletions

View file

@ -1,4 +1,5 @@
TrainerAIPointers:
table_width 3, TrainerAIPointers
; one entry per trainer class
; first byte, number of times (per Pokémon) it can occur
; next two bytes, pointer to AI subroutine for trainer class
@ -50,3 +51,4 @@ TrainerAIPointers:
dbw 3, GenericAI
dbw 2, AgathaAI ; agatha
dbw 1, LanceAI ; lance
assert_table_length NUM_TRAINERS

View file

@ -4,10 +4,12 @@ REPT _NARG
shift
ENDR
db 0 ; end
list_index = list_index + 1
ENDM
; move choice modification methods that are applied for each trainer class
TrainerClassMoveChoiceModifications:
list_start TrainerClassMoveChoiceModifications
move_choices ; YOUNGSTER
move_choices 1 ; BUG CATCHER
move_choices 1 ; LASS
@ -55,3 +57,4 @@ TrainerClassMoveChoiceModifications:
move_choices 1 ; CHANNELER
move_choices 1 ; AGATHA
move_choices 1, 3 ; LANCE
assert_list_length NUM_TRAINERS

View file

@ -269,7 +269,7 @@ BikerData:
; Route 17
; From https://www.smogon.com/smog/issue27/glitch:
; 0E:5FC2 is offset of the ending 0 for this first Biker on Route 17.
; BaseStats + (MonBaseStatsEnd - MonBaseStats) * (000 - 1) = $5FC2;
; BaseStats + (BASE_DATA_SIZE) * (000 - 1) = $5FC2;
; that's the formula from GetMonHeader for the base stats of mon #000.
; (BaseStats = $43DE and BANK(BaseStats) = $0E.)
; Finally, PokedexOrder lists 0 as the dex ID for every MissingNo.

View file

@ -4,6 +4,7 @@ pic_money: MACRO
ENDM
TrainerPicAndMoneyPointers::
table_width 5, TrainerPicAndMoneyPointers
; pic pointer, base reward money
; money received after battle = base money × level of highest-level enemy mon
pic_money YoungsterPic, 1500
@ -53,3 +54,4 @@ TrainerPicAndMoneyPointers::
pic_money ChannelerPic, 3000
pic_money AgathaPic, 9900
pic_money LancePic, 9900
assert_table_length NUM_TRAINERS