Skip to content

Commit

Permalink
Revise some map scripts, mostly for getting items
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Jul 16, 2020
1 parent 58f1089 commit 594c58a
Show file tree
Hide file tree
Showing 61 changed files with 371 additions and 348 deletions.
6 changes: 6 additions & 0 deletions constants/script_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ SLOTSMOUSE EQU $1614
const BIT_VOLCANOBADGE ; 6
const BIT_EARTHBADGE ; 7
NUM_BADGES EQU const_value

; OaksAideScript results
OAKS_AIDE_BAG_FULL EQU $00
OAKS_AIDE_GOT_ITEM EQU $01
OAKS_AIDE_NOT_ENOUGH_MONS EQU $80
OAKS_AIDE_REFUSED EQU $ff
2 changes: 1 addition & 1 deletion engine/events/hidden_objects/pokecenter_pc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ OpenPokemonCenterPC:
cp SPRITE_FACING_UP
ret nz
call EnableAutoTextBoxDrawing
ld a, $1
ld a, TRUE
ld [wAutoTextBoxDrawingControl], a
tx_pre_jump PokemonCenterPCText

Expand Down
8 changes: 4 additions & 4 deletions engine/events/oaks_aide.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ OaksAideScript:
jr nc, .bagFull
ld hl, OaksAideGotItemText
call PrintText
ld a, $1
ld a, OAKS_AIDE_GOT_ITEM
jr .done
.bagFull
ld hl, OaksAideNoRoomText
call PrintText
xor a
xor a ; OAKS_AIDE_BAG_FULL
jr .done
.notEnoughOwnedMons
ld hl, OaksAideUhOhText
call PrintText
ld a, $80
ld a, OAKS_AIDE_NOT_ENOUGH_MONS
jr .done
.choseNo
ld hl, OaksAideComeBackText
call PrintText
ld a, $ff
ld a, OAKS_AIDE_REFUSED
.done
ldh [hOaksAideResult], a
ret
Expand Down
2 changes: 1 addition & 1 deletion engine/slots/slot_machine.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PromptUserToPlaySlots:
call SaveScreenTilesToBuffer2
ld a, BANK(DisplayTextIDInit)
ld a, BANK(DisplayTextIDInit) ; TRUE
ld [wAutoTextBoxDrawingControl], a
ld b, a
ld hl, DisplayTextIDInit
Expand Down
2 changes: 1 addition & 1 deletion home/window.asm
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ EnableAutoTextBoxDrawing::
jr AutoTextBoxDrawingCommon

DisableAutoTextBoxDrawing::
ld a, $01
ld a, TRUE

AutoTextBoxDrawingCommon::
ld [wAutoTextBoxDrawingControl], a
Expand Down
34 changes: 16 additions & 18 deletions scripts/BluesHouse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,48 @@ BluesHouse_ScriptPointers:

BluesHouseScript0:
SetEvent EVENT_ENTERED_BLUES_HOUSE

; trigger the next script
ld a, 1
ld a, $1
ld [wBluesHouseCurScript], a
ret

BluesHouseScript1:
ret

BluesHouse_TextPointers:
dw BluesHouseText1
dw BluesHouseText2
dw BluesHouseText3
dw BluesHouseDaisySittingText
dw BluesHouseDaisyWalkingText
dw BluesHouseTownMapText

BluesHouseText1:
BluesHouseDaisySittingText:
text_asm
CheckEvent EVENT_GOT_TOWN_MAP
jr nz, .GotMap
jr nz, .got_town_map
CheckEvent EVENT_GOT_POKEDEX
jr nz, .GiveMap
jr nz, .give_town_map
ld hl, DaisyInitialText
call PrintText
jr .done

.GiveMap
.give_town_map
ld hl, DaisyOfferMapText
call PrintText
lb bc, TOWN_MAP, 1
call GiveItem
jr nc, .BagFull
jr nc, .bag_full
ld a, HS_TOWN_MAP
ld [wMissableObjectIndex], a
predef HideObject ; hide table map object
predef HideObject
ld hl, GotMapText
call PrintText
SetEvent EVENT_GOT_TOWN_MAP
jr .done

.GotMap
.got_town_map
ld hl, DaisyUseMapText
call PrintText
jr .done

.BagFull
.bag_full
ld hl, DaisyBagFullText
call PrintText
.done
Expand All @@ -80,10 +78,10 @@ DaisyUseMapText:
text_far _DaisyUseMapText
text_end

BluesHouseText2: ; Daisy, walking around
text_far _BluesHouseText2
BluesHouseDaisyWalkingText:
text_far _BluesHouseDaisyWalkingText
text_end

BluesHouseText3: ; map on table
text_far _BluesHouseText3
BluesHouseTownMapText:
text_far _BluesHouseTownMapText
text_end
14 changes: 7 additions & 7 deletions scripts/CeladonDiner.asm
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ CeladonDinerText4:
CeladonDinerText5:
text_asm
CheckEvent EVENT_GOT_COIN_CASE
jr nz, .asm_eb14d
jr nz, .got_item
ld hl, CeladonDinerText_491a7
call PrintText
lb bc, COIN_CASE, 1
call GiveItem
jr nc, .BagFull
jr nc, .bag_full
SetEvent EVENT_GOT_COIN_CASE
ld hl, ReceivedCoinCaseText
call PrintText
jr .asm_68b61
.BagFull
jr .done
.bag_full
ld hl, CoinCaseNoRoomText
call PrintText
jr .asm_68b61
.asm_eb14d
jr .done
.got_item
ld hl, CeladonDinerText_491b7
call PrintText
.asm_68b61
.done
jp TextScriptEnd

CeladonDinerText_491a7:
Expand Down
8 changes: 4 additions & 4 deletions scripts/CeladonMansion1F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ CeladonMansion1F_TextPointers:
dw CeladonMansion1Text4
dw CeladonMansion1Text5

CeladonMansion1_486a1:
CeladonMansion1_PlayCryScript:
call PlayCry
jp TextScriptEnd

CeladonMansion1Text1:
text_far _CeladonMansion1Text1
text_asm
ld a, MEOWTH
jp CeladonMansion1_486a1
jp CeladonMansion1_PlayCryScript

CeladonMansion1Text2:
text_far _CeladonMansion1Text2
Expand All @@ -26,13 +26,13 @@ CeladonMansion1Text3:
text_far _CeladonMansion1Text3
text_asm
ld a, CLEFAIRY
jp CeladonMansion1_486a1
jp CeladonMansion1_PlayCryScript

CeladonMansion1Text4:
text_far _CeladonMansion1Text4
text_asm
ld a, NIDORAN_F
jp CeladonMansion1_486a1
jp CeladonMansion1_PlayCryScript

CeladonMansion1Text5:
text_far _CeladonMansion1Text5
Expand Down
16 changes: 7 additions & 9 deletions scripts/CeladonMansion3F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,30 @@ WriterText:

DirectorText:
text_asm

; check pokédex
ld hl, wPokedexOwned
ld b, wPokedexOwnedEnd - wPokedexOwned
call CountSetBits
ld a, [wNumSetBits]
cp 150
jr nc, .CompletedDex
ld hl, .GameDesigner
cp NUM_POKEMON - 1 ; discount Mew
jr nc, .completed_dex
ld hl, .GameDesignerText
jr .done
.CompletedDex
.completed_dex
ld hl, .CompletedDexText
.done
call PrintText
jp TextScriptEnd

.GameDesigner
.GameDesignerText:
text_far _GameDesignerText
text_end

.CompletedDexText
.CompletedDexText:
text_far _CompletedDexText
text_promptbutton
text_asm
callfar DisplayDiploma
ld a, $1
ld a, TRUE
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
jp TextScriptEnd

Expand Down
4 changes: 2 additions & 2 deletions scripts/CeladonMansionRoofHouse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ CeladonMansion5Text2:
text_asm
lb bc, EEVEE, 25
call GivePokemon
jr nc, .asm_24365
jr nc, .party_full
ld a, HS_CELADON_MANSION_EEVEE_GIFT
ld [wMissableObjectIndex], a
predef HideObject
.asm_24365
.party_full
jp TextScriptEnd
14 changes: 7 additions & 7 deletions scripts/CeladonMart3F.asm
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ CeladonMart3F_TextPointers:
CeladonMart3Text1:
text_asm
CheckEvent EVENT_GOT_TM18
jr nz, .asm_a5463
jr nz, .got_item
ld hl, TM18PreReceiveText
call PrintText
lb bc, TM_COUNTER, 1
call GiveItem
jr nc, .BagFull
jr nc, .bag_full
SetEvent EVENT_GOT_TM18
ld hl, ReceivedTM18Text
jr .asm_81359
.BagFull
jr .done
.bag_full
ld hl, TM18NoRoomText
jr .asm_81359
.asm_a5463
jr .done
.got_item
ld hl, TM18ExplanationText
.asm_81359
.done
call PrintText
jp TextScriptEnd

Expand Down
19 changes: 9 additions & 10 deletions scripts/CeladonMartElevator.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,22 @@ CeladonMartElevatorScript_48631:
jp CopyData

CeladonMartElevatorFloors:
db 5 ; number of elements in list
db 5 ; #
db FLOOR_1F
db FLOOR_2F
db FLOOR_3F
db FLOOR_4F
db FLOOR_5F
db $FF
db -1 ; end

CeladonMartElevatorWarpMaps:
; first byte is warp number
; second byte is map number
; These specify where the player goes after getting out of the elevator.
db $05, CELADON_MART_1F
db $02, CELADON_MART_2F
db $02, CELADON_MART_3F
db $02, CELADON_MART_4F
db $02, CELADON_MART_5F
CeladonMartElevatorWarpMaps:
; warp number, map id
db 5, CELADON_MART_1F
db 2, CELADON_MART_2F
db 2, CELADON_MART_3F
db 2, CELADON_MART_4F
db 2, CELADON_MART_5F
CeladonMartElevatorWarpMapsEnd:

CeladonMartElevatorScript_48654:
Expand Down
15 changes: 12 additions & 3 deletions scripts/CeruleanBadgeHouse.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CeruleanBadgeHouse_Script:
ld a, $1
ld a, TRUE
ld [wAutoTextBoxDrawingControl], a
dec a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
Expand Down Expand Up @@ -34,7 +34,7 @@ CeruleanHouse2Text1:
jr c, .asm_74e60
ld hl, TextPointers_74e86
ld a, [wcf91]
sub $15
sub BOULDERBADGE
add a
ld d, $0
ld e, a
Expand All @@ -52,7 +52,16 @@ CeruleanHouse2Text1:
jp TextScriptEnd

BadgeItemList:
db $8,BOULDERBADGE,CASCADEBADGE,THUNDERBADGE,RAINBOWBADGE,SOULBADGE,MARSHBADGE,VOLCANOBADGE,EARTHBADGE,$FF
db 8 ; #
db BOULDERBADGE
db CASCADEBADGE
db THUNDERBADGE
db RAINBOWBADGE
db SOULBADGE
db MARSHBADGE
db VOLCANOBADGE
db EARTHBADGE
db -1 ; end

CeruleanHouse2Text_74e77:
text_far _CeruleanHouse2Text_74e77
Expand Down
10 changes: 5 additions & 5 deletions scripts/CeruleanTrashedHouse.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ CeruleanTrashedHouse_TextPointers:

CeruleanHouseTrashedText1:
text_asm
ld b, $e4
ld b, TM_DIG
predef GetQuantityOfItemInBag
and b
jr z, .asm_f8734
jr z, .no_dig_tm
ld hl, CeruleanHouseTrashedText_1d6b0
call PrintText
jr .asm_8dfe9
.asm_f8734
jr .done
.no_dig_tm
ld hl, CeruleanHouseTrashedText_1d6ab
call PrintText
.asm_8dfe9
.done
jp TextScriptEnd

CeruleanHouseTrashedText_1d6ab:
Expand Down
2 changes: 1 addition & 1 deletion scripts/CinnabarLabFossilRoom.asm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ FossilsList:
db DOME_FOSSIL
db HELIX_FOSSIL
db OLD_AMBER
db $00
db 0 ; end

Lab4Text1:
text_asm
Expand Down
Loading

0 comments on commit 594c58a

Please sign in to comment.