diff options
Diffstat (limited to 'engine/overworld')
-rw-r--r-- | engine/overworld/advance_player_sprite.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/cable_club_npc.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/hidden_items.asm | 17 | ||||
-rwxr-xr-x | engine/overworld/hidden_objects.asm | 26 | ||||
-rw-r--r-- | engine/overworld/missable_objects.asm | 2 | ||||
-rwxr-xr-x | engine/overworld/pokecenter.asm | 8 |
6 files changed, 29 insertions, 28 deletions
diff --git a/engine/overworld/advance_player_sprite.asm b/engine/overworld/advance_player_sprite.asm index e02fb129..758dd558 100644 --- a/engine/overworld/advance_player_sprite.asm +++ b/engine/overworld/advance_player_sprite.asm @@ -7,7 +7,7 @@ _AdvancePlayerSprite:: ; f010c (3c:410c) dec [hl] jr nz,.afterUpdateMapCoords ; if it's the end of the animation, update the player's map coordinates - ld hl, wd430 + ld hl, wPikachuOverworldStateFlags res 5, [hl] ld a,[wYCoord] add b diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm index 8f279759..4170a936 100755 --- a/engine/overworld/cable_club_npc.asm +++ b/engine/overworld/cable_club_npc.asm @@ -1,7 +1,7 @@ CableClubNPC: ; 7035 (1:7035) ld hl, CableClubNPCWelcomeText call PrintText - call Func_154a + call CheckPikachuAsleep jr nz, .asm_7048 CheckEvent EVENT_GOT_POKEDEX jp nz, .receivedPokedex diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index f7f81070..39bb385d 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -9,7 +9,7 @@ HiddenItems: ; 76688 (1d:6688) predef FlagActionPredef ld a, c and a - ret nz + jr nz, .asm_75fa5 call EnableAutoTextBoxDrawing ld a, 1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -18,6 +18,11 @@ HiddenItems: ; 76688 (1d:6688) call GetItemName tx_pre_jump FoundHiddenItemText +.asm_75fa5 + ld a, $ff + ld [hItemAlreadyFound], a + ret + INCLUDE "data/hidden_item_coords.asm" FoundHiddenItemText: ; 7675b (1d:675b) @@ -54,7 +59,7 @@ HiddenCoins: ; 76799 (1d:6799) predef GetQuantityOfItemInBag ld a, b and a - ret z + jr z, .asm_760ce ld hl, HiddenCoinCoords call FindHiddenItemOrCoinsIndex ld [wHiddenItemOrCoinsIndex], a @@ -65,7 +70,7 @@ HiddenCoins: ; 76799 (1d:6799) predef FlagActionPredef ld a, c and a - ret nz + jr nz, .asm_760ce xor a ld [hUnusedCoinsByte], a ld [hCoins], a @@ -79,6 +84,12 @@ HiddenCoins: ; 76799 (1d:6799) cp 40 jr z, .bcd20 jr .bcd100 + +.asm_760ce + ld a, $ff + ld [hItemAlreadyFound], a + ret + .bcd10 ld a, $10 ld [hCoins + 1], a diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm index 3774c482..cba2a221 100755 --- a/engine/overworld/hidden_objects.asm +++ b/engine/overworld/hidden_objects.asm @@ -1,27 +1,17 @@ -; if a hidden object was found, stores $00 in [$ffee], else stores $ff -CheckForHiddenObject: ; 469a0 (11:69a0) - ld hl, $ffeb +; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff +CheckForHiddenObject: ; f25f8 (3c:65f8) + ld hl, hItemAlreadyFound xor a ld [hli], a ld [hli], a ld [hli], a ld [hl], a - ld de, $0 ld hl, HiddenObjectMaps -.hiddenMapLoop - ld a, [hli] - ld b, a - cp $ff - jr z, .noMatch + ld de, 3 ld a, [wCurMap] - cp b - jr z, .foundMatchingMap - inc de - inc de - jr .hiddenMapLoop -.foundMatchingMap - ld hl, HiddenObjectPointers - add hl, de + call IsInArray + jr nc, .noMatch + inc hl ld a, [hli] ld h, [hl] ld l, a @@ -65,7 +55,7 @@ CheckForHiddenObject: ; 469a0 (11:69a0) ret .noMatch ld a, $ff - ld [$ffee], a + ld [hDidntFindAnyHiddenObject], a ret ; checks if the coordinates in front of the player's sprite match Y in b and X in c diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm index f18a0823..65305d30 100644 --- a/engine/overworld/missable_objects.asm +++ b/engine/overworld/missable_objects.asm @@ -209,4 +209,4 @@ MissableObjectFlagAction: ; f062 (3:7062) pop de pop hl ld c, a - ret
\ No newline at end of file + ret diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm index 779d852c..3024ff7b 100755 --- a/engine/overworld/pokecenter.asm +++ b/engine/overworld/pokecenter.asm @@ -2,7 +2,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) ld a, [wCurMap] cp PEWTER_POKECENTER jr nz, .regularCenter - call Func_154a + call CheckPikachuAsleep jr z, .regularCenter ld hl, LooksContentText ; if pikachu is sleeping, don't heal call PrintText @@ -27,7 +27,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) call SetLastBlackoutMap callab IsStarterPikachuInOurParty jr nc, .notHealingPlayerPikachu - call Func_154a + call CheckPikachuAsleep jr nz, .notHealingPlayerPikachu call LoadCurrentMapView call Delay3 @@ -38,7 +38,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) call PrintText ld c, 64 call DelayFrames - call Func_154a + call CheckPikachuAsleep jr nz, .playerPikachuNotOnScreen call Func_152d callab IsStarterPikachuInOurParty @@ -58,7 +58,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) ld [wLastMusicSoundID], a ld [wNewSoundID], a call PlaySound - call Func_154a + call CheckPikachuAsleep jr nz, .doNotReturnPikachu callab IsStarterPikachuInOurParty call c, Func_6eaa |