pokered/scripts/seafoamislands5.asm

174 lines
3.1 KiB
NASM
Raw Normal View History

SeafoamIslands5Script:
2014-05-18 18:19:10 +00:00
call EnableAutoTextBoxDrawing
2015-08-31 02:38:41 +00:00
ld a, [wSeafoamIslands5CurScript]
2014-05-18 18:19:10 +00:00
ld hl, SeafoamIslands5ScriptPointers
jp CallFunctionInTable
SeafoamIslands5Script_467a5:
2014-05-18 18:19:10 +00:00
xor a
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ret
SeafoamIslands5ScriptPointers:
2014-05-18 18:19:10 +00:00
dw SeafoamIslands5Script0
dw SeafoamIslands5Script1
dw SeafoamIslands5Script2
dw SeafoamIslands5Script3
dw SeafoamIslands5Script4
SeafoamIslands5Script4:
2015-08-31 02:38:41 +00:00
ld a, [wIsInBattle]
2014-05-18 18:19:10 +00:00
cp $ff
jr z, SeafoamIslands5Script_467a5
call EndTrainerBattle
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
ret
SeafoamIslands5Script0:
2015-07-21 17:36:03 +00:00
CheckBothEventsSet EVENT_SEAFOAM3_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM3_BOULDER2_DOWN_HOLE
2014-05-18 18:19:10 +00:00
ret z
ld hl, .Coords
2014-05-18 18:19:10 +00:00
call ArePlayerCoordsInArray
ret nc
2015-07-19 03:49:52 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
cp $3
jr nc, .asm_467e6
2015-07-26 02:26:54 +00:00
ld a, NPC_MOVEMENT_UP
ld [wSimulatedJoypadStatesEnd + 1], a
ld a, 2
2014-05-18 18:19:10 +00:00
jr .asm_467e8
.asm_467e6
2015-07-26 02:26:54 +00:00
ld a, 1
2014-05-18 18:19:10 +00:00
.asm_467e8
ld [wSimulatedJoypadStatesIndex], a
ld a, D_UP
ld [wSimulatedJoypadStatesEnd], a
call StartSimulatingJoypadStates
2015-08-31 02:38:41 +00:00
ld hl, wFlags_D733
2014-05-18 18:19:10 +00:00
res 2, [hl]
ld a, $1
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
ret
.Coords
2014-05-18 18:19:10 +00:00
db $11,$14
db $11,$15
db $10,$14
db $10,$15
db $FF
SeafoamIslands5Script1:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
and a
ret nz
xor a
2014-05-25 17:51:53 +00:00
ld [wJoyIgnore], a
2014-05-18 18:19:10 +00:00
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
ret
SeafoamIslands5Script2:
2015-07-21 17:36:03 +00:00
CheckBothEventsSet EVENT_SEAFOAM4_BOULDER1_DOWN_HOLE, EVENT_SEAFOAM4_BOULDER2_DOWN_HOLE
2014-05-18 18:19:10 +00:00
ld a, $0
jr z, .asm_46849
ld hl, .Coords
2014-05-18 18:19:10 +00:00
call ArePlayerCoordsInArray
ld a, $0
jr nc, .asm_46849
2015-07-19 03:49:52 +00:00
ld a, [wCoordIndex]
2014-05-18 18:19:10 +00:00
cp $1
jr nz, .asm_46837
ld de, RLEMovementData_46859
jr .asm_4683a
.asm_46837
ld de, RLEMovementData_46852
.asm_4683a
ld hl, wSimulatedJoypadStatesEnd
2014-05-18 18:19:10 +00:00
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
call StartSimulatingJoypadStates
2014-05-18 18:19:10 +00:00
ld a, $3
.asm_46849
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
ret
.Coords
2014-05-18 18:19:10 +00:00
db $0E,$04
db $0E,$05
db $FF
RLEMovementData_46852:
db D_UP,$03
db D_RIGHT,$02
db D_UP,$01
2014-05-18 18:19:10 +00:00
db $FF
RLEMovementData_46859:
db D_UP,$03
db D_RIGHT,$03
db D_UP,$01
2014-05-18 18:19:10 +00:00
db $FF
SeafoamIslands5Script3:
ld a, [wSimulatedJoypadStatesIndex]
2014-05-18 18:19:10 +00:00
ld b, a
cp $1
call z, SeaFoamIslands5Script_46872
ld a, b
and a
ret nz
ld a, $0
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
ret
SeaFoamIslands5Script_46872:
2014-05-18 18:19:10 +00:00
xor a
2014-09-13 07:50:56 +00:00
ld [wWalkBikeSurfState], a
ld [wWalkBikeSurfStateCopy], a
2014-05-18 18:19:10 +00:00
jp ForceBikeOrSurf
SeafoamIslands5TextPointers:
2014-05-18 18:19:10 +00:00
dw BoulderText
dw BoulderText
dw ArticunoText
2014-05-18 18:19:10 +00:00
dw SeafoamIslands5Text4
dw SeafoamIslands5Text5
ArticunoTrainerHeader:
dbEventFlagBit EVENT_BEAT_ARTICUNO
2014-05-18 18:19:10 +00:00
db ($0 << 4) ; trainer's view range
dwEventFlagAddress EVENT_BEAT_ARTICUNO
dw ArticunoBattleText ; TextBeforeBattle
dw ArticunoBattleText ; TextAfterBattle
dw ArticunoBattleText ; TextEndBattle
dw ArticunoBattleText ; TextEndBattle
2014-05-18 18:19:10 +00:00
db $ff
ArticunoText:
2015-07-03 19:58:50 +00:00
TX_ASM
ld hl, ArticunoTrainerHeader
2014-05-18 18:19:10 +00:00
call TalkToTrainer
ld a, $4
2015-08-31 02:38:41 +00:00
ld [wSeafoamIslands5CurScript], a
2014-05-18 18:19:10 +00:00
jp TextScriptEnd
ArticunoBattleText:
TX_FAR _ArticunoBattleText
2015-07-03 19:58:50 +00:00
TX_ASM
2014-05-18 18:19:10 +00:00
ld a, ARTICUNO
call PlayCry
call WaitForSoundToFinish
jp TextScriptEnd
SeafoamIslands5Text4:
2014-05-18 18:19:10 +00:00
TX_FAR _SeafoamIslands5Text4
db "@"
SeafoamIslands5Text5:
2014-05-18 18:19:10 +00:00
TX_FAR _SeafoamIslands5Text5
db "@"