diff options
Diffstat (limited to 'scripts/route24.asm')
-rwxr-xr-x | scripts/route24.asm | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/scripts/route24.asm b/scripts/route24.asm index f6822a35..4e83a5cd 100755 --- a/scripts/route24.asm +++ b/scripts/route24.asm @@ -22,8 +22,7 @@ Route24ScriptPointers: ; 513cb (14:53cb) dw Route24Script4 Route24Script0: ; 513d5 (14:53d5) - ld a, [wd7ef] - bit 0, a + CheckEvent EVENT_GOT_NUGGET jp nz, CheckFightingMapTrainers ld hl, CoordsData_5140e call ArePlayerCoordsInArray @@ -33,9 +32,7 @@ Route24Script0: ; 513d5 (14:53d5) ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID - ld hl, wd7f0 - bit 1, [hl] - res 1, [hl] + CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE ret z ld a, D_DOWN ld [wSimulatedJoypadStatesEnd], a @@ -67,8 +64,7 @@ Route24Script3: ; 51422 (14:5422) call UpdateSprites ld a, $f0 ld [wJoyIgnore], a - ld hl, wd7ef - set 1, [hl] + SetEvent EVENT_BEAT_ROUTE24_ROCKET ld a, $1 ld [hSpriteIndexOrTextID], a call DisplayTextID @@ -91,54 +87,54 @@ Route24TextPointers: ; 5144b (14:544b) Route24TrainerHeaders: ; 5145b (14:545b) Route24TrainerHeader0: ; 5145b (14:545b) - db $2 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_0 db ($4 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_0 dw Route24BattleText1 ; TextBeforeBattle dw Route24AfterBattleText1 ; TextAfterBattle dw Route24EndBattleText1 ; TextEndBattle dw Route24EndBattleText1 ; TextEndBattle Route24TrainerHeader2: ; 51467 (14:5467) - db $3 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_2 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_2 dw Route24BattleText2 ; TextBeforeBattle dw Route24AfterBattleText2 ; TextAfterBattle dw Route24EndBattleText2 ; TextEndBattle dw Route24EndBattleText2 ; TextEndBattle Route24TrainerHeader3: ; 51473 (14:5473) - db $4 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_3 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_3 dw Route24BattleText3 ; TextBeforeBattle dw Route24AfterBattleText3 ; TextAfterBattle dw Route24EndBattleText3 ; TextEndBattle dw Route24EndBattleText3 ; TextEndBattle Route24TrainerHeader4: ; 5147f (14:547f) - db $5 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_4 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_4 dw Route24BattleText4 ; TextBeforeBattle dw Route24AfterBattleText4 ; TextAfterBattle dw Route24EndBattleText4 ; TextEndBattle dw Route24EndBattleText4 ; TextEndBattle Route24TrainerHeader5: ; 5148b (14:548b) - db $6 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_5 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_5 dw Route24BattleText5 ; TextBeforeBattle dw Route24AfterBattleText5 ; TextAfterBattle dw Route24EndBattleText5 ; TextEndBattle dw Route24EndBattleText5 ; TextEndBattle Route24TrainerHeader6: ; 51497 (14:5497) - db $7 ; flag's bit + dbEventFlagBit EVENT_BEAT_ROUTE_24_TRAINER_6 db ($1 << 4) ; trainer's view range - dw wd7ef ; flag's byte + dwEventFlagAddress EVENT_BEAT_ROUTE_24_TRAINER_6 dw Route24BattleText6 ; TextBeforeBattle dw Route24AfterBattleText6 ; TextAfterBattle dw Route24EndBattleText6 ; TextEndBattle @@ -148,18 +144,15 @@ Route24TrainerHeader6: ; 51497 (14:5497) Route24Text1: ; 514a4 (14:54a4) TX_ASM - ld hl, wd7f0 - res 1, [hl] - ld a, [wd7ef] - bit 0, a + ResetEvent EVENT_NUGGET_REWARD_AVAILABLE + CheckEvent EVENT_GOT_NUGGET jr nz, .asm_514f9 ld hl, Route24Text_51510 call PrintText ld bc, (NUGGET << 8) | 1 call GiveItem jr nc, .BagFull - ld hl, wd7ef - set 0, [hl] + SetEvent EVENT_GOT_NUGGET ld hl, Route24Text_5151a call PrintText ld hl, Route24Text_51526 @@ -187,8 +180,7 @@ Route24Text1: ; 514a4 (14:54a4) .BagFull ld hl, Route24Text_51521 call PrintText - ld hl, wd7f0 - set 1, [hl] + SetEvent EVENT_NUGGET_REWARD_AVAILABLE jp TextScriptEnd Route24Text_51510: ; 51510 (14:5510) |