diff options
Diffstat (limited to 'scripts/safarizoneentrance.asm')
-rwxr-xr-x | scripts/safarizoneentrance.asm | 124 |
1 files changed, 16 insertions, 108 deletions
diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index 5f800987..97578475 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -2,7 +2,8 @@ SafariZoneEntranceScript: call EnableAutoTextBoxDrawing ld hl, SafariZoneEntranceScriptPointers ld a, [wSafariZoneEntranceCurScript] - jp CallFunctionInTable + call JumpTable + ret SafariZoneEntranceScriptPointers: dw .SafariZoneEntranceScript0 @@ -25,7 +26,7 @@ SafariZoneEntranceScriptPointers: xor a ld [hJoyHeld], a ld a, SPRITE_FACING_RIGHT - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, [wCoordIndex] cp $1 jr z, .asm_7520f @@ -43,8 +44,8 @@ SafariZoneEntranceScriptPointers: ret .CoordsData_75221: - db $02,$03 - db $02,$04 + db $02, $03 + db $02, $04 db $FF .SafariZoneEntranceScript1 @@ -85,6 +86,8 @@ SafariZoneEntranceScriptPointers: call DisplayTextID xor a ld [wNumSafariBalls], a + ld [wSafariSteps], a + ld [wSafariSteps], a ; ????? ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk @@ -117,10 +120,10 @@ SafariZoneEntranceScriptPointers: SafariZoneEntranceAutoWalk: push af - ld b,0 - ld a,c - ld [wSimulatedJoypadStatesIndex],a - ld hl,wSimulatedJoypadStatesEnd + ld b, 0 + ld a, c + ld [wSimulatedJoypadStatesIndex], a + ld hl, wSimulatedJoypadStatesEnd pop af call FillMemory jp StartSimulatingJoypadStates @@ -143,95 +146,21 @@ SafariZoneEntranceTextPointers: db "@" .SafariZoneEntranceText4 - TX_FAR SafariZoneEntranceText_9e6e4 TX_ASM - ld a, MONEY_BOX - ld [wTextBoxID],a - call DisplayTextBoxID - call YesNoChoice - ld a,[wCurrentMenuItem] - and a - jp nz,.PleaseComeAgain - xor a - ld [hMoney],a - ld a,$05 - ld [hMoney + 1],a - ld a,$00 - ld [hMoney + 2],a - call HasEnoughMoney - jr nc,.success - ld hl,.NotEnoughMoneyText - call PrintText - jr .CantPayWalkDown - -.success - xor a - ld [wPriceTemp],a - ld a,$05 - ld [wPriceTemp + 1],a - ld a,$00 - ld [wPriceTemp + 2],a - ld hl,wPriceTemp + 2 - ld de,wPlayerMoney + 2 - ld c,3 - predef SubBCDPredef - ld a,MONEY_BOX - ld [wTextBoxID],a - call DisplayTextBoxID - ld hl,.MakePaymentText - call PrintText - ld a,30 - ld [wNumSafariBalls],a - ld a,502 / $100 - ld [wSafariSteps],a - ld a, 502 % $100 - ld [wSafariSteps + 1],a - ld a,D_UP - ld c,3 - call SafariZoneEntranceAutoWalk - SetEvent EVENT_IN_SAFARI_ZONE - ResetEventReuseHL EVENT_SAFARI_GAME_OVER - ld a,3 - ld [wSafariZoneEntranceCurScript],a - jr .done - -.PleaseComeAgain - ld hl,.PleaseComeAgainText - call PrintText -.CantPayWalkDown - ld a,D_DOWN - ld c,1 - call SafariZoneEntranceAutoWalk - ld a,4 - ld [wSafariZoneEntranceCurScript],a -.done + callab Func_f1f77 jp TextScriptEnd -.MakePaymentText - TX_FAR SafariZoneEntranceText_9e747 - db $b - TX_FAR _SafariZoneEntranceText_75360 - db "@" - -.PleaseComeAgainText - TX_FAR _SafariZoneEntranceText_75365 - db "@" - -.NotEnoughMoneyText - TX_FAR _SafariZoneEntranceText_7536a - db "@" - .SafariZoneEntranceText5 TX_FAR SafariZoneEntranceText_9e814 TX_ASM call YesNoChoice - ld a,[wCurrentMenuItem] + ld a, [wCurrentMenuItem] and a jr nz, .asm_7539c ld hl, .SafariZoneEntranceText_753bb call PrintText xor a - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, D_DOWN ld c, $3 call SafariZoneEntranceAutoWalk @@ -243,7 +172,7 @@ SafariZoneEntranceTextPointers: ld hl, .SafariZoneEntranceText_753c0 call PrintText ld a, SPRITE_FACING_UP - ld [wSpriteStateData1 + 9], a + ld [wPlayerFacingDirection], a ld a, D_UP ld c, $1 call SafariZoneEntranceAutoWalk @@ -268,26 +197,5 @@ SafariZoneEntranceTextPointers: .SafariZoneEntranceText2 TX_ASM - ld hl,.FirstTimeQuestionText - call PrintText - call YesNoChoice - ld a,[wCurrentMenuItem] - and a - ld hl,.RegularText - jr nz,.Explanation - ld hl,.ExplanationText -.Explanation - call PrintText + callab Func_f203e jp TextScriptEnd - -.FirstTimeQuestionText - TX_FAR _SafariZoneEntranceText_753e6 - db "@" - -.ExplanationText - TX_FAR _SafariZoneEntranceText_753eb - db "@" - -.RegularText - TX_FAR _SafariZoneEntranceText_753f0 - db "@" |