Closed Rangi42 closed 2 years ago
Can we add an additional end_trainer assert? Something like...
assert ((@ - {CURRENT_TRAINER_LABEL}) / CURRENT_TRAINER_MON_SIZE > 0) && \
((@ - {CURRENT_TRAINER_LABEL}) / CURRENT_TRAINER_MON_SIZE < PARTY_LENGTH), \
"def_trainer: expected number of pokemon to be > 0 or <= {d:PARTY_LENGTH}"
See the discussion in #pokecrystal with @mid-kid about that.
LGTM
@aaaaaa123456789 pointed out that this could still have false negatives. This has six bytes of party data, which is enough for one mon with MOVES
, but is actually three NORMAL
mons:
def_trainer "KEITH@", TRAINERTYPE_MOVES
db 17, GROWLITHE
db 18, GROWLITHE
db 19, GROWLITHE
end_trainer
I don't want to macroize the entire thing I don't want to macroize the entire thing I don't want to macroize the entire thing aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
We can also just, not do this :)
Yeah, if it were a simple def_X
/end_X
macro pair like the rest I'd do it, but it's not.
Concept: begin each party with
def_trainer
, and end them withend_trainer
, which will declare thedb -1
terminator and assert that the total party size corresponds to theTRAINERTYPE
.