diff options
| author | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2026-01-17 22:38:33 -0600 |
| commit | bc2354dd6626ce28bb9561547ed2107cfa56c18e (patch) | |
| tree | 5902d4c3389253c76b7c3351e0d7dfecb551c28d /home/trainers.asm | |
| parent | Identify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff) | |
| parent | Use macros for `WildMonEncounterSlotChances` (#562) (diff) | |
| download | pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/trainers.asm')
| -rw-r--r-- | home/trainers.asm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/home/trainers.asm b/home/trainers.asm index fa9167fc..6e007a95 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -19,7 +19,7 @@ ExecuteCurMapScriptInTable:: ld hl, wStatusFlags7 bit BIT_USE_CUR_MAP_SCRIPT, [hl] res BIT_USE_CUR_MAP_SCRIPT, [hl] - jr z, .useProvidedIndex ; test if map script index was overridden manually + jr z, .useProvidedIndex ; test if map script index was overridden manually ld a, [wCurMapScript] .useProvidedIndex pop hl @@ -31,12 +31,12 @@ ExecuteCurMapScriptInTable:: LoadGymLeaderAndCityName:: push de ld de, wGymCityName - ld bc, $11 - call CopyData ; load city name + ld bc, GYM_CITY_LENGTH + call CopyData ; load city name pop hl ld de, wGymLeaderName ld bc, NAME_LENGTH - jp CopyData ; load gym leader name + jp CopyData ; load gym leader name ; reads specific information from trainer header (pointed to at wTrainerHeaderPtr) ; a: offset in header data @@ -155,7 +155,7 @@ ENDC ldh [hJoyHeld], a call TrainerWalkUpToPlayer_Bank0 ld hl, wCurMapScript - inc [hl] ; increment map script index (next script function is usually DisplayEnemyTrainerTextAndStartBattle) + inc [hl] ; increment map script index (next script function is usually DisplayEnemyTrainerTextAndStartBattle) ret ; display the before battle text after the enemy trainer has walked up to the player's sprite @@ -179,7 +179,7 @@ StartTrainerBattle:: ld hl, wStatusFlags4 set BIT_UNKNOWN_4_1, [hl] ld hl, wCurMapScript - inc [hl] ; increment map script index (next script function is usually EndTrainerBattle) + inc [hl] ; increment map script index (next script function is usually EndTrainerBattle) ret EndTrainerBattle:: @@ -201,14 +201,14 @@ EndTrainerBattle:: call TrainerFlagAction ; flag trainer as fought ld a, [wEnemyMonOrTrainerClass] cp OPP_ID_OFFSET - jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) - ld hl, wMissableObjectList + jr nc, .skipRemoveSprite ; test if trainer was fought (in that case skip removing the corresponding sprite) + ld hl, wToggleableObjectList ld de, $2 ld a, [wSpriteIndex] - call IsInArray ; search for sprite ID + call IsInArray ; search for sprite ID inc hl ld a, [hl] - ld [wMissableObjectIndex], a ; load corresponding missable object index and remove it + ld [wToggleableObjectIndex], a ; load corresponding toggleable object index and remove it predef HideObject .skipRemoveSprite ld hl, wStatusFlags5 @@ -269,7 +269,7 @@ CheckForEngagingTrainers:: .trainerLoop call StoreTrainerHeaderPointer ; set trainer header pointer to current trainer ld a, [de] - ld [wSpriteIndex], a ; store trainer flag's bit + ld [wSpriteIndex], a ; store trainer flag's bit ld [wTrainerHeaderFlagBit], a cp -1 ret z @@ -278,7 +278,7 @@ CheckForEngagingTrainers:: ld b, FLAG_TEST ld a, [wTrainerHeaderFlagBit] ld c, a - call TrainerFlagAction ; read trainer flag + call TrainerFlagAction ; read trainer flag ld a, c and a ; has the trainer already been defeated? jr nz, .continue @@ -299,7 +299,7 @@ CheckForEngagingTrainers:: pop hl ld a, [wTrainerSpriteOffset] and a - ret nz ; break if the trainer is engaging + ret nz ; break if the trainer is engaging .continue ld hl, $c add hl, de @@ -364,8 +364,8 @@ PrintEndBattleText:: GetSavedEndBattleTextPointer:: ld a, [wBattleResult] and a -; won battle jr nz, .lostBattle +; won battle ld a, [wEndBattleWinTextPointer] ld h, a ld a, [wEndBattleWinTextPointer + 1] |
