From 7acb5b697f6d2794b43be9cbdf1e9068c90f2102 Mon Sep 17 00:00:00 2001 From: jojobear13 Date: Thu, 18 Jan 2024 18:25:16 -0600 Subject: [PATCH] fixes for CatDog Beauty quest --- scripts/SilphCo7F.asm | 8 ++++---- scripts/VermilionCity.asm | 29 +++++++++++++++++++++++------ text/VermilionCity.asm | 2 +- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index 3bfacd4f..b4130ebc 100644 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -309,8 +309,8 @@ SilphCo7TrainerHeader3: SilphCo7Text1: ; lapras guy text_asm - ld a, [wd72c] - bit 2, a + ld a, [wd72e] + bit 0, a jr z, .givelapras CheckEvent EVENT_BEAT_SILPH_CO_GIOVANNI jr nz, .savedsilph @@ -329,8 +329,8 @@ SilphCo7Text1: call EnableAutoTextBoxDrawing ld hl, .HeresYourLaprasText call PrintText - ld hl, wd72c - set 2, [hl] + ld hl, wd72e + set 0, [hl] jr .done .savedsilph ld hl, .LaprasGuySavedText diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 50cbdc9a..6a51a544 100644 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -370,14 +370,23 @@ VermilionBeauty: ; All it really achieves is weird architecture for like 3-4 less machine cycles. ld a, [wBeautyCounter] ; Alright, if you got here, then the event is in progress. cp 5 ; Do you have 5 of the scrunklies? - jr z, .eventIsFinished ; Big if true. - jr nz, .eventInProgress ; Small if false. +; jr z, .eventIsFinished ; Big if true. +; jr nz, .eventInProgress ; Small if false. + jr nc, .eventIsFinished ; A set z flag happens for exactly 5. A cleared carry flag happens for values 5 to 255. + jr c, .eventInProgress ; And a set carry flag happens for values 0 to 4. ; Let us start the game. .eventStart ld hl, BeautyText1 ; Let's open the text. call PrintText call CatsDogsChoice + + ;account for cancelling with the B button + ld hl, _BeautyWait + ldh a, [hJoyHeld] + and B_BUTTON + jr nz, .skip5 + ld a, [wCurrentMenuItem] ; Let's load what they picked. 0 is cats, 1 is dogs. and a jr nz, .getArcanine ; Skip storing Growlithe if dogs. @@ -401,7 +410,8 @@ VermilionBeauty: ; Now if the event is finished, she needs to hand the Pokemon over. .eventIsFinished - call SaveScreenTilesToBuffer1 ; saves us from some corruption disasters if nicknaming. +; call SaveScreenTilesToBuffer1 ; saves us from some corruption disasters if nicknaming. +; ...not needed anymore as this was fixed in commit dd71684 ld hl, BeautyFinish1 ld a, [wBeautyChoice] cp GROWLITHE @@ -418,10 +428,10 @@ VermilionBeauty: .skip3 call GivePokemon jr nc, .done - call LoadScreenTilesFromBuffer1 ; saves us from some corruption disasters if nicknaming. +; call LoadScreenTilesFromBuffer1 ; saves us from some corruption disasters if nicknaming. SetEvent EVENT_VERMILION_BEAUTY_DONE ; and now we can finally rest. - ld hl, wd72e - set 0, [hl] +; ld hl, wd72e ;not needed since EVENT_VERMILION_BEAUTY_DONE is the event bit for this. +; set 0, [hl] jr .done ; Now if it's already been said and done, we go here. @@ -435,6 +445,7 @@ VermilionBeauty: .skip4 call PrintText ld hl, BeautyExplainCont +.skip5 call PrintText ;fallthrough .done @@ -490,3 +501,9 @@ BeautyExplain2: BeautyExplainCont: text_far _BeautyExplainCont text_end + +_BeautyWait: + text "I can wait on" + line "your answer." + done + db "@" \ No newline at end of file diff --git a/text/VermilionCity.asm b/text/VermilionCity.asm index 16588801..59c7a53a 100644 --- a/text/VermilionCity.asm +++ b/text/VermilionCity.asm @@ -136,7 +136,7 @@ _BeautyText2:: prompt ; needed for text to scroll correctly - it looks and acts fine in-game, don't worry. _BeautyChoice:: ; this is separate for the in-progress event. - text "If you catch 5" + text "If you catch 5 new" line "@" text_ram wcd6d ; efficiency - means we don't need two separate texts... text ", I'll"