pokered/scripts/BillsHouse.asm

215 lines
3.7 KiB
NASM
Raw Normal View History

BillsHouse_Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
2015-08-31 02:38:41 +00:00
ld a, [wBillsHouseCurScript]
ld hl, BillsHouse_ScriptPointers
2014-05-18 18:19:10 +00:00
jp CallFunctionInTable
BillsHouse_ScriptPointers:
2014-05-18 18:19:10 +00:00
dw BillsHouseScript0
dw BillsHouseScript1
dw BillsHouseScript2
dw BillsHouseScript3
dw BillsHouseScript4
dw BillsHouseScript5
2016-06-12 00:24:04 +00:00
BillsHouseScript0:
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
BillsHouseScript1:
ld a, [wSpritePlayerStateData1FacingDirection]
and a ; cp SPRITE_FACING_DOWN
2014-05-18 18:19:10 +00:00
ld de, MovementData_1e79c
jr nz, .notDown
2014-05-18 18:19:10 +00:00
ld de, MovementData_1e7a0
.notDown
2014-05-18 18:19:10 +00:00
ld a, $1
ldh [hSpriteIndex], a
2014-05-18 18:19:10 +00:00
call MoveSprite
ld a, $2
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
MovementData_1e79c:
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db -1 ; end
2014-05-18 18:19:10 +00:00
; make Bill walk around the player
2016-06-12 00:24:04 +00:00
MovementData_1e7a0:
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_UP
db NPC_MOVEMENT_LEFT
db NPC_MOVEMENT_UP
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseScript2:
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
ld a, HS_BILL_POKEMON
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
2015-07-21 17:36:03 +00:00
SetEvent EVENT_BILL_SAID_USE_CELL_SEPARATOR
2014-05-18 18:19:10 +00:00
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $3
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
BillsHouseScript3:
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_USED_CELL_SEPARATOR_ON_BILL
2014-05-18 18:19:10 +00:00
ret z
ld a, $f0
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $2
2014-09-13 07:50:56 +00:00
ld [wSpriteIndex], a
2014-05-18 18:19:10 +00:00
ld a, $c
ldh [hSpriteScreenYCoord], a
2014-05-18 18:19:10 +00:00
ld a, $40
ldh [hSpriteScreenXCoord], a
ld a, 6
ldh [hSpriteMapYCoord], a
ld a, 5
ldh [hSpriteMapXCoord], a
call SetSpritePosition1
ld a, HS_BILL_1
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
ld c, 8
2014-05-18 18:19:10 +00:00
call DelayFrames
ld a, $2
ldh [hSpriteIndex], a
2014-05-18 18:19:10 +00:00
ld de, MovementData_1e807
call MoveSprite
ld a, $4
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
MovementData_1e807:
db NPC_MOVEMENT_DOWN
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_RIGHT
db NPC_MOVEMENT_DOWN
db -1 ; end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseScript4:
ld a, [wd730]
2014-05-18 18:19:10 +00:00
bit 0, a
ret nz
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2015-07-21 17:36:03 +00:00
SetEvent EVENT_MET_BILL_2 ; this event seems redundant
SetEvent EVENT_MET_BILL
2014-05-18 18:19:10 +00:00
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
2014-05-18 18:19:10 +00:00
ret
2016-06-12 00:24:04 +00:00
BillsHouseScript5:
2014-05-18 18:19:10 +00:00
ld a, $4
ldh [hSpriteIndexOrTextID], a
2014-05-18 18:19:10 +00:00
call DisplayTextID
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
2014-05-18 18:19:10 +00:00
ret
BillsHouse_TextPointers:
2014-05-18 18:19:10 +00:00
dw BillsHouseText1
dw BillsHouseText2
dw BillsHouseText3
dw BillsHouseText4
2016-06-12 00:24:04 +00:00
BillsHouseText4:
script_bills_pc
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText1:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, BillsHouseText_1e865
call PrintText
call YesNoChoice
ld a, [wCurrentMenuItem]
2014-05-18 18:19:10 +00:00
and a
jr nz, .asm_1e85a
.asm_1e84d
2014-05-18 18:19:10 +00:00
ld hl, BillsHouseText_1e86a
call PrintText
ld a, $1
2015-08-31 02:38:41 +00:00
ld [wBillsHouseCurScript], a
jr .asm_1e862
.asm_1e85a
2014-05-18 18:19:10 +00:00
ld hl, BillsHouseText_1e86f
call PrintText
jr .asm_1e84d
.asm_1e862
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
BillsHouseText_1e865:
text_far _BillsHouseText_1e865
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText_1e86a:
text_far _BillsHouseText_1e86a
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText_1e86f:
text_far _BillsHouseText_1e86f
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText2:
text_asm
2015-07-21 17:36:03 +00:00
CheckEvent EVENT_GOT_SS_TICKET
jr nz, .asm_1e8a9
2014-05-18 18:19:10 +00:00
ld hl, BillThankYouText
call PrintText
2015-12-15 04:09:30 +00:00
lb bc, S_S_TICKET, 1
2014-05-18 18:19:10 +00:00
call GiveItem
jr nc, .BagFull
ld hl, SSTicketReceivedText
call PrintText
2015-07-21 17:36:03 +00:00
SetEvent EVENT_GOT_SS_TICKET
ld a, HS_CERULEAN_GUARD_1
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef ShowObject
ld a, HS_CERULEAN_GUARD_2
2015-07-25 03:27:59 +00:00
ld [wMissableObjectIndex], a
predef HideObject
.asm_1e8a9
2014-05-18 18:19:10 +00:00
ld hl, BillsHouseText_1e8cb
call PrintText
jr .asm_1e8b7
2014-05-18 18:19:10 +00:00
.BagFull
ld hl, SSTicketNoRoomText
call PrintText
.asm_1e8b7
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
BillThankYouText:
text_far _BillThankYouText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SSTicketReceivedText:
text_far _SSTicketReceivedText
sound_get_key_item
text_promptbutton
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
SSTicketNoRoomText:
text_far _SSTicketNoRoomText
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText_1e8cb:
text_far _BillsHouseText_1e8cb
text_end
2014-05-18 18:19:10 +00:00
2016-06-12 00:24:04 +00:00
BillsHouseText3:
text_asm
2014-05-18 18:19:10 +00:00
ld hl, BillsHouseText_1e8da
call PrintText
jp TextScriptEnd
2016-06-12 00:24:04 +00:00
BillsHouseText_1e8da:
text_far _BillsHouseText_1e8da
text_end