2013-11-22 23:51:48 -08:00
|
|
|
INCLUDE "includes.asm"
|
|
|
|
|
2013-11-25 20:33:54 -08:00
|
|
|
|
|
|
|
SECTION "Events", ROMX, BANK[EVENTS]
|
2013-11-22 23:51:48 -08:00
|
|
|
|
2014-02-01 17:26:39 -08:00
|
|
|
OverworldLoop:: ; 966b0
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
2013-12-27 02:56:23 -08:00
|
|
|
ld [MapStatus], a
|
|
|
|
.loop
|
|
|
|
ld a, [MapStatus]
|
|
|
|
ld hl, .jumps
|
2013-11-22 02:04:32 -08:00
|
|
|
rst JumpTable
|
2013-12-27 02:56:23 -08:00
|
|
|
ld a, [MapStatus]
|
2013-11-22 02:04:32 -08:00
|
|
|
cp 3 ; done
|
2013-12-27 02:56:23 -08:00
|
|
|
jr nz, .loop
|
2013-11-22 02:04:32 -08:00
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
.jumps
|
|
|
|
dw StartMap
|
|
|
|
dw EnterMap
|
|
|
|
dw HandleMap
|
2013-11-22 02:04:32 -08:00
|
|
|
dw .done
|
|
|
|
; 966cb
|
|
|
|
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
ClearAllScriptFlags3: ; 966cb
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ld [ScriptFlags3], a
|
|
|
|
ret
|
|
|
|
; 966d0
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
SetAll_ScriptFlags3:: ; 966d0
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, $ff
|
|
|
|
ld [ScriptFlags3], a
|
|
|
|
ret
|
|
|
|
; 966d6
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
CheckBit5_ScriptFlags3: ; 966d6
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
bit 5, [hl]
|
|
|
|
ret
|
|
|
|
; 966dc
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
ResetBit2_ScriptFlags3: ; 966dc
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
res 2, [hl]
|
|
|
|
ret
|
|
|
|
; 966e2
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
ResetBit1_ScriptFlags3: ; 966e2
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
res 1, [hl]
|
|
|
|
ret
|
|
|
|
; 966e8
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
ResetBit0_ScriptFlags3: ; 966e8
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
res 0, [hl]
|
|
|
|
ret
|
|
|
|
; 966ee
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
ResetBit4_ScriptFlags3: ; 966ee
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
res 4, [hl]
|
|
|
|
ret
|
|
|
|
; 966f4
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
SetBit2_ScriptFlags3: ; 966f4
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
set 2, [hl]
|
|
|
|
ret
|
|
|
|
; 966fa
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
SetBit1_ScriptFlags3: ; 966fa
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
set 1, [hl]
|
|
|
|
ret
|
|
|
|
; 96700
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
SetBit0_ScriptFlags3: ; 96700
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
set 0, [hl]
|
|
|
|
ret
|
|
|
|
; 96706
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
SetBit4_ScriptFlags3: ; 96706
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
set 4, [hl]
|
|
|
|
ret
|
|
|
|
; 9670c
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
CheckBit2_ScriptFlags3: ; 9670c
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
bit 2, [hl]
|
|
|
|
ret
|
|
|
|
; 96712
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
CheckBit1_ScriptFlags3: ; 96712
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
bit 1, [hl]
|
|
|
|
ret
|
|
|
|
; 96718
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
CheckBit0_ScriptFlags3: ; 96718
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
bit 0, [hl]
|
|
|
|
ret
|
|
|
|
; 9671e
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
CheckBit4_ScriptFlags3: ; 9671e
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, ScriptFlags3
|
|
|
|
bit 4, [hl]
|
|
|
|
ret
|
|
|
|
; 96724
|
|
|
|
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
StartMap: ; 96724
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ld [ScriptVar], a
|
|
|
|
xor a
|
|
|
|
ld [ScriptRunning], a
|
2013-12-27 02:56:23 -08:00
|
|
|
ld hl, MapStatus
|
2013-11-22 02:04:32 -08:00
|
|
|
ld bc, $3e
|
|
|
|
call ByteFill
|
|
|
|
callba Function113e5
|
2013-12-22 14:30:35 -08:00
|
|
|
call ClearJoypad
|
2013-11-22 02:04:32 -08:00
|
|
|
; fallthrough
|
|
|
|
; 9673e
|
|
|
|
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
EnterMap: ; 9673e
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wd453], a
|
|
|
|
ld [wd454], a
|
2013-11-22 02:04:32 -08:00
|
|
|
call Function968d1
|
2014-01-26 19:07:19 -08:00
|
|
|
callba RunMapSetupScript
|
2015-07-15 12:48:44 -07:00
|
|
|
call ClearAllScriptFlags3
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [$ff9f]
|
|
|
|
cp $f7
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nz, .dontset
|
|
|
|
call SetAll_ScriptFlags3
|
|
|
|
.dontset
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [$ff9f]
|
|
|
|
cp $f3
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nz, .dontresetpoison
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ld [PoisonStepCount], a
|
2015-07-15 12:48:44 -07:00
|
|
|
.dontresetpoison
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ld [$ff9f], a
|
2013-12-27 02:56:23 -08:00
|
|
|
ld a, 2 ; HandleMap
|
|
|
|
ld [MapStatus], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 9676d
|
|
|
|
|
|
|
|
|
|
|
|
Function9676d: ; 9676d
|
|
|
|
ld c, 30
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
; 96773
|
|
|
|
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
HandleMap: ; 96773
|
2013-11-22 02:04:32 -08:00
|
|
|
call ResetOverworldDelay
|
|
|
|
call Function967c1
|
|
|
|
callba Function97e08
|
2013-12-27 02:56:23 -08:00
|
|
|
call MapEvents
|
|
|
|
|
|
|
|
; Not immediately entering a connected map will cause problems.
|
|
|
|
ld a, [MapStatus]
|
|
|
|
cp 2 ; HandleMap
|
2013-11-22 02:04:32 -08:00
|
|
|
ret nz
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
call Function967d1
|
|
|
|
call NextOverworldFrame
|
|
|
|
call Function967e1
|
|
|
|
call Function967f4
|
|
|
|
ret
|
|
|
|
; 96795
|
|
|
|
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
MapEvents: ; 96795
|
|
|
|
ld a, [MapEventStatus]
|
|
|
|
ld hl, .jumps
|
2013-11-22 02:04:32 -08:00
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
.jumps
|
|
|
|
dw .events
|
|
|
|
dw .no_events
|
2013-11-22 02:04:32 -08:00
|
|
|
; 967a1
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
.events ; 967a1
|
2013-11-22 02:04:32 -08:00
|
|
|
call PlayerEvents
|
2015-07-15 12:48:44 -07:00
|
|
|
call ClearAllScriptFlags3
|
2013-11-22 02:04:32 -08:00
|
|
|
callba ScriptEvents
|
|
|
|
ret
|
|
|
|
; 967ae
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
.no_events ; 967ae
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 967af
|
|
|
|
|
|
|
|
|
|
|
|
MaxOverworldDelay: ; 967af
|
|
|
|
db 2
|
|
|
|
; 967b0
|
|
|
|
|
|
|
|
ResetOverworldDelay: ; 967b0
|
|
|
|
ld a, [MaxOverworldDelay]
|
|
|
|
ld [OverworldDelay], a
|
|
|
|
ret
|
|
|
|
; 967b7
|
|
|
|
|
|
|
|
NextOverworldFrame: ; 967b7
|
|
|
|
ld a, [OverworldDelay]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
ld c, a
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
|
|
|
; 967c1
|
|
|
|
|
|
|
|
Function967c1: ; 967c1
|
2013-12-27 02:56:23 -08:00
|
|
|
ld a, [MapEventStatus]
|
|
|
|
cp 1 ; no events
|
2013-11-22 02:04:32 -08:00
|
|
|
ret z
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
call UpdateTime
|
2013-12-22 14:30:35 -08:00
|
|
|
call GetJoypad
|
2013-11-22 02:04:32 -08:00
|
|
|
call TimeOfDayPals
|
|
|
|
ret
|
|
|
|
; 967d1
|
|
|
|
|
|
|
|
Function967d1: ; 967d1
|
|
|
|
callba Function576a
|
|
|
|
callba Functiond497
|
|
|
|
call Function96812
|
|
|
|
ret
|
|
|
|
; 967e1
|
|
|
|
|
|
|
|
Function967e1: ; 967e1
|
2015-07-18 12:46:38 -07:00
|
|
|
callba RefreshMapAppearDisappear
|
2013-11-22 02:04:32 -08:00
|
|
|
callba Functiond4d2
|
|
|
|
callba Functionb8098
|
|
|
|
ret
|
|
|
|
; 967f4
|
|
|
|
|
|
|
|
Function967f4: ; 967f4
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wd150]
|
2013-11-22 02:04:32 -08:00
|
|
|
bit 5, a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .events
|
2013-11-22 02:04:32 -08:00
|
|
|
bit 6, a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .noevents
|
2013-11-22 02:04:32 -08:00
|
|
|
bit 4, a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nz, .noevents
|
|
|
|
call SetAll_ScriptFlags3
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.events
|
2013-12-27 02:56:23 -08:00
|
|
|
ld a, 0 ; events
|
|
|
|
ld [MapEventStatus], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.noevents
|
2013-12-27 02:56:23 -08:00
|
|
|
ld a, 1 ; no events
|
|
|
|
ld [MapEventStatus], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 96812
|
|
|
|
|
|
|
|
Function96812: ; 96812
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, wd150
|
2013-11-22 02:04:32 -08:00
|
|
|
bit 6, [hl]
|
|
|
|
ret z
|
|
|
|
|
2013-12-27 02:56:23 -08:00
|
|
|
callba Function81ca
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 9681f
|
|
|
|
|
|
|
|
|
|
|
|
PlayerEvents: ; 9681f
|
|
|
|
|
|
|
|
xor a
|
|
|
|
|
|
|
|
ld a, [ScriptRunning]
|
|
|
|
and a
|
|
|
|
ret nz
|
|
|
|
|
|
|
|
call Function968e4
|
|
|
|
|
|
|
|
call CheckTrainerBattle3
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call CheckTileEvent
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function97c30
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function968ec
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function9693a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call OWPlayerInput
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.ok
|
2013-11-22 02:04:32 -08:00
|
|
|
push af
|
2015-07-15 12:48:44 -07:00
|
|
|
callba EnableScriptMode
|
2013-11-22 02:04:32 -08:00
|
|
|
pop af
|
|
|
|
|
|
|
|
ld [ScriptRunning], a
|
|
|
|
call Function96beb
|
|
|
|
ld a, [ScriptRunning]
|
|
|
|
cp 4
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .ok2
|
2013-11-22 02:04:32 -08:00
|
|
|
cp 9
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .ok2
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
xor a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wc2da], a
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.ok2
|
2013-11-22 02:04:32 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96867
|
|
|
|
|
|
|
|
|
|
|
|
CheckTrainerBattle3: ; 96867
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
call CheckTrainerBattle2
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nc, .nope
|
2013-12-27 02:56:23 -08:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, 1
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.nope
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96874
|
|
|
|
|
|
|
|
|
|
|
|
CheckTileEvent: ; 96874
|
|
|
|
; Check for warps, tile triggers or wild battles.
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
call CheckBit2_ScriptFlags3
|
|
|
|
jr z, .bit2
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-16 15:10:10 -07:00
|
|
|
callba CheckMovingOffEdgeOfMap
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .return4
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function2238
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .return6
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.bit2
|
|
|
|
call CheckBit1_ScriptFlags3
|
|
|
|
jr z, .bit1
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-16 15:10:10 -07:00
|
|
|
call CheckCurrentMapXYTriggers
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .movement
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.bit1
|
|
|
|
call CheckBit0_ScriptFlags3
|
|
|
|
jr z, .bit0
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call CountStep
|
|
|
|
ret c
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.bit0
|
|
|
|
call CheckBit4_ScriptFlags3
|
|
|
|
jr z, .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function97cc0
|
|
|
|
ret c
|
2015-07-15 12:48:44 -07:00
|
|
|
jr .ok
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.ok
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.return4
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, 4
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.return6
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [StandingTile]
|
|
|
|
call CheckPitTile
|
2015-07-16 15:10:10 -07:00
|
|
|
jr nz, .pittile
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, 6
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-16 15:10:10 -07:00
|
|
|
.pittile
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, 5
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.movement
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, MovementAnimation
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call CallScript
|
|
|
|
ret
|
|
|
|
; 968c7
|
|
|
|
|
|
|
|
|
2014-02-01 17:26:39 -08:00
|
|
|
Function968c7:: ; 968c7
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, wd452
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec [hl]
|
|
|
|
ret z
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 968d1
|
|
|
|
|
|
|
|
Function968d1: ; 968d1
|
|
|
|
ld a, 5
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wd452], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 968d7
|
|
|
|
|
|
|
|
Function968d7: ; 968d7
|
|
|
|
ret
|
|
|
|
; 968d8
|
|
|
|
|
|
|
|
Function968d8: ; 968d8
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wd452]
|
2013-11-22 02:04:32 -08:00
|
|
|
cp 2
|
|
|
|
ret nc
|
|
|
|
ld a, 2
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wd452], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret
|
|
|
|
; 968e4
|
|
|
|
|
|
|
|
Function968e4: ; 968e4
|
2015-07-15 12:48:44 -07:00
|
|
|
call CheckBit5_ScriptFlags3
|
2013-11-22 02:04:32 -08:00
|
|
|
ret z
|
|
|
|
call Function2f3e
|
|
|
|
ret
|
|
|
|
; 968ec
|
|
|
|
|
|
|
|
Function968ec: ; 968ec
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wdc07]
|
2013-11-22 02:04:32 -08:00
|
|
|
and a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .nope
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
ld c, a
|
2015-07-15 12:48:44 -07:00
|
|
|
call CheckTriggers
|
2013-11-22 02:04:32 -08:00
|
|
|
cp c
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nc, .nope
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, wdc07 + 1
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-07-20 08:28:05 -07:00
|
|
|
rept 4
|
|
|
|
add hl,de
|
|
|
|
endr
|
2015-07-15 12:48:44 -07:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call GetFarHalfword
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call CallScript
|
|
|
|
|
|
|
|
ld hl, ScriptFlags
|
|
|
|
res 3, [hl]
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
callba EnableScriptMode
|
2013-11-22 02:04:32 -08:00
|
|
|
callba ScriptEvents
|
|
|
|
|
|
|
|
ld hl, ScriptFlags
|
|
|
|
bit 3, [hl]
|
2015-07-15 12:48:44 -07:00
|
|
|
jr z, .nope
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, ScriptDelay + 2
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [ScriptDelay + 1]
|
2013-11-22 02:04:32 -08:00
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.nope
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 9693a
|
|
|
|
|
|
|
|
Function9693a: ; 9693a
|
|
|
|
ld a, [InLinkBattle]
|
|
|
|
and a
|
2014-07-24 20:19:56 -07:00
|
|
|
jr nz, .nothing
|
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, StatusFlags2
|
|
|
|
bit 2, [hl]
|
|
|
|
jr z, .asm_96951
|
2014-07-24 20:19:56 -07:00
|
|
|
|
2013-11-22 02:04:32 -08:00
|
|
|
callba Function114a4
|
2014-07-24 20:19:56 -07:00
|
|
|
jr c, .elevator
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.asm_96951
|
|
|
|
callba Function11452
|
|
|
|
callba Function114e7
|
2014-07-24 20:19:56 -07:00
|
|
|
callba CheckPhoneCall
|
2013-11-22 02:04:32 -08:00
|
|
|
ret c
|
|
|
|
|
2014-07-24 20:19:56 -07:00
|
|
|
.nothing
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2014-07-24 20:19:56 -07:00
|
|
|
.elevator
|
2015-07-16 15:10:10 -07:00
|
|
|
ld a, BANK(BugCatchingContestOverScript)
|
|
|
|
ld hl, BugCatchingContestOverScript
|
2013-11-22 02:04:32 -08:00
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96970
|
|
|
|
|
|
|
|
Function96970: ; 96970
|
|
|
|
ld a, 8
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96974
|
|
|
|
|
|
|
|
|
|
|
|
OWPlayerInput: ; 96974
|
|
|
|
|
|
|
|
call PlayerMovement
|
|
|
|
ret c
|
|
|
|
and a
|
|
|
|
jr nz, .NoAction
|
|
|
|
|
|
|
|
; Can't perform button actions while sliding on ice.
|
|
|
|
callba Function80404
|
|
|
|
jr c, .NoAction
|
|
|
|
|
|
|
|
call CheckAPressOW
|
|
|
|
jr c, .Action
|
|
|
|
|
|
|
|
call CheckMenuOW
|
|
|
|
jr c, .Action
|
|
|
|
|
|
|
|
.NoAction
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.Action
|
|
|
|
push af
|
|
|
|
callba Function80422
|
|
|
|
pop af
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96999
|
|
|
|
|
|
|
|
|
|
|
|
CheckAPressOW: ; 96999
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
and A_BUTTON
|
|
|
|
ret z
|
|
|
|
call TryObjectEvent
|
|
|
|
ret c
|
|
|
|
call TryReadSign
|
|
|
|
ret c
|
|
|
|
call Function97c5f
|
|
|
|
ret c
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 969ac
|
|
|
|
|
|
|
|
|
|
|
|
PlayTalkObject: ; 969ac
|
|
|
|
push de
|
|
|
|
ld de, SFX_READ_TEXT_2
|
|
|
|
call PlaySFX
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
; 969b5
|
|
|
|
|
|
|
|
|
|
|
|
TryObjectEvent: ; 969b5
|
|
|
|
callba CheckFacingObject
|
|
|
|
jr c, .IsObject
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.IsObject
|
|
|
|
call PlayTalkObject
|
|
|
|
ld a, [hConnectedMapWidth]
|
2015-07-15 12:48:44 -07:00
|
|
|
call GetObjectStruct
|
|
|
|
ld hl, OBJECT_MAP_OBJECT_INDEX
|
2013-11-22 02:04:32 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-07-21 23:49:18 -07:00
|
|
|
ld [hLastTalked], a
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-21 23:49:18 -07:00
|
|
|
ld a, [hLastTalked]
|
2013-11-22 02:04:32 -08:00
|
|
|
call GetMapObject
|
2015-07-15 12:48:44 -07:00
|
|
|
ld hl, MAPOBJECT_COLOR
|
2013-11-22 02:04:32 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
2015-07-15 12:48:44 -07:00
|
|
|
and %00001111
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
; Bug: If IsInArray returns nc, data at bc will be executed as code.
|
|
|
|
push bc
|
|
|
|
ld de, 3
|
2015-07-15 12:48:44 -07:00
|
|
|
ld hl, .pointers
|
2013-11-22 02:04:32 -08:00
|
|
|
call IsInArray
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nc, .nope_bugged
|
2013-11-22 02:04:32 -08:00
|
|
|
pop bc
|
|
|
|
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
jp [hl]
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.nope_bugged
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.pointers
|
2013-11-22 02:04:32 -08:00
|
|
|
dbw 0, .zero
|
|
|
|
dbw 1, .one
|
|
|
|
dbw 2, .two
|
|
|
|
dbw 3, .three
|
|
|
|
dbw 4, .four
|
|
|
|
dbw 5, .five
|
|
|
|
dbw 6, .six
|
2015-07-15 12:48:44 -07:00
|
|
|
db -1
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96a04
|
|
|
|
|
|
|
|
.zero ; 96a04
|
2015-07-18 12:46:38 -07:00
|
|
|
ld hl, MAPOBJECT_SCRIPT_POINTER
|
2013-11-22 02:04:32 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call CallScript
|
|
|
|
; ld a, -1
|
|
|
|
ret
|
|
|
|
; 96a12
|
|
|
|
|
|
|
|
.one ; 96a12
|
2015-07-18 12:46:38 -07:00
|
|
|
ld hl, MAPOBJECT_SCRIPT_POINTER
|
2013-11-22 02:04:32 -08:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
ld de, EngineBuffer1
|
|
|
|
ld bc, 2
|
|
|
|
call FarCopyBytes
|
|
|
|
ld a, 3
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96a29
|
|
|
|
|
|
|
|
.two ; 96a29
|
|
|
|
call Function3674
|
|
|
|
ld a, 2
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96a30
|
|
|
|
|
|
|
|
.three ; 96a30
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96a32
|
|
|
|
|
|
|
|
.four ; 96a32
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96a34
|
|
|
|
|
|
|
|
.five ; 96a34
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96a36
|
|
|
|
|
|
|
|
.six ; 96a36
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96a38
|
|
|
|
|
|
|
|
|
|
|
|
TryReadSign: ; 96a38
|
|
|
|
call CheckFacingSign
|
|
|
|
jr c, .IsSign
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.IsSign
|
2015-07-15 12:48:44 -07:00
|
|
|
ld a, [wd040]
|
2013-11-22 02:04:32 -08:00
|
|
|
ld hl, .signs
|
|
|
|
rst JumpTable
|
|
|
|
ret
|
|
|
|
|
|
|
|
.signs
|
|
|
|
dw .read
|
|
|
|
dw .up
|
|
|
|
dw .down
|
|
|
|
dw .right
|
|
|
|
dw .left
|
|
|
|
dw .ifset
|
|
|
|
dw .ifnotset
|
|
|
|
dw .itemifset
|
2015-07-15 12:48:44 -07:00
|
|
|
dw .copy
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96a59
|
|
|
|
|
|
|
|
.up
|
|
|
|
ld b, UP << 2
|
|
|
|
jr .checkdir
|
|
|
|
.down
|
|
|
|
ld b, DOWN << 2
|
|
|
|
jr .checkdir
|
|
|
|
.right
|
|
|
|
ld b, RIGHT << 2
|
|
|
|
jr .checkdir
|
|
|
|
.left
|
|
|
|
ld b, LEFT << 2
|
|
|
|
jr .checkdir
|
|
|
|
|
|
|
|
.checkdir
|
|
|
|
ld a, [PlayerDirection]
|
|
|
|
and %1100
|
|
|
|
cp b
|
|
|
|
jp nz, .dontread
|
|
|
|
|
|
|
|
.read
|
|
|
|
call PlayTalkObject
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, wd041
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.itemifset
|
|
|
|
call CheckSignFlag
|
|
|
|
jp nz, .dontread
|
|
|
|
call PlayTalkObject
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
ld de, EngineBuffer1
|
|
|
|
ld bc, 3
|
|
|
|
call FarCopyBytes
|
2015-07-16 15:10:10 -07:00
|
|
|
ld a, BANK(SignpostItemScript)
|
|
|
|
ld hl, SignpostItemScript
|
2013-11-22 02:04:32 -08:00
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.copy
|
2013-11-22 02:04:32 -08:00
|
|
|
call CheckSignFlag
|
|
|
|
jr nz, .dontread
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
ld de, EngineBuffer1
|
|
|
|
ld bc, 3
|
|
|
|
call FarCopyBytes
|
|
|
|
jr .dontread
|
|
|
|
|
|
|
|
.ifset
|
|
|
|
call CheckSignFlag
|
|
|
|
jr z, .dontread
|
2015-07-15 12:48:44 -07:00
|
|
|
jr .thenread
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
.ifnotset
|
|
|
|
call CheckSignFlag
|
|
|
|
jr nz, .dontread
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.thenread
|
2013-11-22 02:04:32 -08:00
|
|
|
push hl
|
|
|
|
call PlayTalkObject
|
|
|
|
pop hl
|
2015-07-20 19:18:18 -07:00
|
|
|
rept 2
|
2013-11-22 02:04:32 -08:00
|
|
|
inc hl
|
2015-07-20 19:18:18 -07:00
|
|
|
endr
|
2013-11-22 02:04:32 -08:00
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call GetFarHalfword
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.dontread
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
; 96ad8
|
|
|
|
|
|
|
|
|
|
|
|
CheckSignFlag: ; 96ad8
|
2015-02-10 14:16:31 -08:00
|
|
|
ld hl, wd041
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
push hl
|
|
|
|
call GetMapScriptHeaderBank
|
|
|
|
call GetFarHalfword
|
|
|
|
ld e, l
|
|
|
|
ld d, h
|
2015-07-16 15:10:10 -07:00
|
|
|
ld b, $2 ; check
|
2013-11-22 02:04:32 -08:00
|
|
|
call EventFlagAction
|
|
|
|
ld a, c
|
|
|
|
and a
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 96af0
|
|
|
|
|
|
|
|
|
|
|
|
PlayerMovement: ; 96af0
|
|
|
|
callba DoPlayerMovement
|
|
|
|
ld a, c
|
|
|
|
ld hl, .pointers
|
|
|
|
rst JumpTable
|
|
|
|
ld a, c
|
|
|
|
ret
|
|
|
|
; 96afd
|
|
|
|
|
|
|
|
.pointers
|
|
|
|
dw .zero
|
|
|
|
dw .one
|
|
|
|
dw .two
|
|
|
|
dw .three
|
|
|
|
dw .four
|
|
|
|
dw .five
|
|
|
|
dw .six
|
|
|
|
dw .seven
|
|
|
|
|
|
|
|
.zero
|
|
|
|
.four ; 96b0d
|
|
|
|
xor a
|
|
|
|
ld c, a
|
|
|
|
ret
|
|
|
|
; 96b10
|
|
|
|
|
|
|
|
.seven ; 96b10
|
|
|
|
call Function968d7 ; empty
|
|
|
|
xor a
|
|
|
|
ld c, a
|
|
|
|
ret
|
|
|
|
; 96b16
|
|
|
|
|
|
|
|
.one ; 96b16
|
|
|
|
ld a, 5
|
|
|
|
ld c, a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96b1b
|
|
|
|
|
|
|
|
.two ; 96b1b
|
|
|
|
ld a, 9
|
|
|
|
ld c, a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96b20
|
|
|
|
|
|
|
|
.three ; 96b20
|
|
|
|
; force the player to move in some direction
|
2015-07-15 12:48:44 -07:00
|
|
|
ld a, BANK(Script_ForcedMovement)
|
|
|
|
ld hl, Script_ForcedMovement
|
2013-11-22 02:04:32 -08:00
|
|
|
call CallScript
|
|
|
|
; ld a, -1
|
|
|
|
ld c, a
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96b2b
|
|
|
|
|
|
|
|
.five
|
|
|
|
.six ; 96b2b
|
|
|
|
ld a, -1
|
|
|
|
ld c, a
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 96b30
|
|
|
|
|
|
|
|
|
|
|
|
CheckMenuOW: ; 96b30
|
|
|
|
xor a
|
|
|
|
ld [$ffa0], a
|
|
|
|
ld [$ffa1], a
|
|
|
|
ld a, [hJoyPressed]
|
|
|
|
|
|
|
|
bit 2, a ; SELECT
|
|
|
|
jr nz, .Select
|
|
|
|
|
|
|
|
bit 3, a ; START
|
|
|
|
jr z, .NoMenu
|
|
|
|
|
|
|
|
ld a, BANK(StartMenuScript)
|
|
|
|
ld hl, StartMenuScript
|
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
|
|
|
.NoMenu
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.Select
|
|
|
|
call PlayTalkObject
|
|
|
|
ld a, BANK(SelectMenuScript)
|
|
|
|
ld hl, SelectMenuScript
|
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96b58
|
|
|
|
|
|
|
|
|
|
|
|
StartMenuScript: ; 96b58
|
2015-01-20 00:01:23 -08:00
|
|
|
callasm StartMenu
|
|
|
|
jump StartMenuCallback
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96b5f
|
|
|
|
|
|
|
|
SelectMenuScript: ; 96b5f
|
2015-01-20 00:01:23 -08:00
|
|
|
callasm SelectMenu
|
|
|
|
jump SelectMenuCallback
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96b66
|
|
|
|
|
|
|
|
StartMenuCallback:
|
|
|
|
SelectMenuCallback: ; 96b66
|
|
|
|
copybytetovar $ffa0
|
2015-07-15 12:48:44 -07:00
|
|
|
if_equal %10000000, .Script
|
|
|
|
if_equal -1, .Asm
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96b72
|
|
|
|
|
|
|
|
.Script ; 96b72
|
2015-02-10 14:16:31 -08:00
|
|
|
ptjump wd0e8
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96b75
|
|
|
|
|
|
|
|
.Asm ; 96b75
|
2015-02-10 14:16:31 -08:00
|
|
|
ptcallasm wd0e8
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96b79
|
|
|
|
|
|
|
|
|
|
|
|
CountStep: ; 96b79
|
|
|
|
ld a, [InLinkBattle]
|
|
|
|
and a
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nz, .done
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
callba Function90136
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .setminus1
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
call Function96bd7
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .setminus1
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
ld hl, PoisonStepCount
|
|
|
|
inc [hl]
|
|
|
|
ld hl, StepCount
|
|
|
|
inc [hl]
|
|
|
|
jr nz, .asm_96b9c
|
|
|
|
|
|
|
|
callba StepHappiness
|
|
|
|
|
|
|
|
.asm_96b9c
|
|
|
|
ld a, [StepCount]
|
|
|
|
cp $80
|
|
|
|
jr nz, .asm_96bab
|
|
|
|
|
|
|
|
callba Function16f3e
|
2015-07-15 12:48:44 -07:00
|
|
|
jr nz, .set8
|
2013-11-22 02:04:32 -08:00
|
|
|
|
|
|
|
.asm_96bab
|
|
|
|
callba DaycareStep
|
|
|
|
|
|
|
|
ld hl, PoisonStepCount
|
|
|
|
ld a, [hl]
|
|
|
|
cp 4
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .poisoned
|
2013-11-22 02:04:32 -08:00
|
|
|
ld [hl], 0
|
|
|
|
|
|
|
|
callba Function505da
|
2015-07-15 12:48:44 -07:00
|
|
|
jr c, .setminus1
|
2013-11-22 02:04:32 -08:00
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.poisoned
|
2013-11-22 02:04:32 -08:00
|
|
|
callba Function97db3
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.done
|
2013-11-22 02:04:32 -08:00
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.setminus1
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, -1
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
.set8
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, 8
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96bd3
|
|
|
|
|
|
|
|
|
|
|
|
Function96bd3: ; 96bd3
|
2015-07-15 12:48:44 -07:00
|
|
|
ld a, 7
|
2013-11-22 02:04:32 -08:00
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96bd7
|
|
|
|
|
|
|
|
Function96bd7: ; 96bd7
|
2015-02-10 14:16:31 -08:00
|
|
|
ld a, [wdca1]
|
2013-11-22 02:04:32 -08:00
|
|
|
and a
|
|
|
|
ret z
|
|
|
|
dec a
|
2015-02-10 14:16:31 -08:00
|
|
|
ld [wdca1], a
|
2013-11-22 02:04:32 -08:00
|
|
|
ret nz
|
2015-07-16 15:10:10 -07:00
|
|
|
ld a, BANK(RepelWoreOffScript)
|
|
|
|
ld hl, RepelWoreOffScript
|
2013-11-22 02:04:32 -08:00
|
|
|
call CallScript
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 96beb
|
|
|
|
|
|
|
|
Function96beb: ; 96beb
|
|
|
|
ld a, [ScriptRunning]
|
|
|
|
and a
|
|
|
|
ret z
|
2015-07-15 12:48:44 -07:00
|
|
|
cp -1
|
2013-11-22 02:04:32 -08:00
|
|
|
ret z
|
2015-07-15 12:48:44 -07:00
|
|
|
cp 10
|
2013-11-22 02:04:32 -08:00
|
|
|
ret nc
|
|
|
|
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
ld hl, ScriptPointers96c0c
|
2015-07-20 08:28:05 -07:00
|
|
|
rept 3
|
|
|
|
add hl,bc
|
|
|
|
endr
|
2013-11-22 02:04:32 -08:00
|
|
|
ld a, [hli]
|
|
|
|
ld [ScriptBank], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [ScriptPos], a
|
|
|
|
ld a, [hl]
|
|
|
|
ld [ScriptPos + 1], a
|
|
|
|
ret
|
|
|
|
; 96c0c
|
|
|
|
|
|
|
|
ScriptPointers96c0c: ; 96c0c
|
2015-07-15 12:48:44 -07:00
|
|
|
dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d
|
|
|
|
dbw BANK(SeenByTrainerScript), SeenByTrainerScript
|
|
|
|
dbw BANK(TalkToTrainerScript), TalkToTrainerScript
|
|
|
|
dbw BANK(FindItemInBallScript), FindItemInBallScript
|
2013-11-22 02:04:32 -08:00
|
|
|
dbw BANK(UnknownScript_0x96c4d), UnknownScript_0x96c4d
|
2015-07-15 12:48:44 -07:00
|
|
|
dbw BANK(WarpToNewMapScript), WarpToNewMapScript
|
2013-11-22 02:04:32 -08:00
|
|
|
dbw BANK(FallIntoMapScript), FallIntoMapScript
|
|
|
|
dbw BANK(UnknownScript_0x124c8), UnknownScript_0x124c8
|
2015-07-15 12:48:44 -07:00
|
|
|
dbw BANK(HatchEggScript), HatchEggScript
|
2013-11-22 02:04:32 -08:00
|
|
|
dbw BANK(UnknownScript_0x96c4f), UnknownScript_0x96c4f
|
2015-07-15 12:48:44 -07:00
|
|
|
dbw BANK(Invalid_0x96c2d), Invalid_0x96c2d
|
2013-11-22 02:04:32 -08:00
|
|
|
; 96c2d
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
Invalid_0x96c2d: ; 96c2d
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96c2e
|
|
|
|
|
|
|
|
UnknownScript_0x96c2e: ; 96c2e
|
|
|
|
end
|
|
|
|
; 96c2f
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
HatchEggScript: ; 96c2f
|
|
|
|
callasm OverworldHatchEgg
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96c34
|
|
|
|
|
2015-07-15 12:48:44 -07:00
|
|
|
WarpToNewMapScript: ; 96c34
|
2013-11-22 02:04:32 -08:00
|
|
|
warpsound
|
|
|
|
newloadmap $f5
|
|
|
|
end
|
|
|
|
; 96c38
|
|
|
|
|
|
|
|
FallIntoMapScript: ; 96c38
|
|
|
|
newloadmap $f6
|
|
|
|
playsound SFX_KINESIS
|
2015-07-21 23:49:18 -07:00
|
|
|
applymovement PLAYER, MovementData_0x96c48
|
2013-11-22 02:04:32 -08:00
|
|
|
playsound SFX_STRENGTH
|
2015-01-20 00:01:23 -08:00
|
|
|
scall UnknownScript_0x96c4a
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96c48
|
|
|
|
|
|
|
|
MovementData_0x96c48: ; 96c48
|
|
|
|
skyfall
|
|
|
|
step_end
|
|
|
|
; 96c4a
|
|
|
|
|
|
|
|
UnknownScript_0x96c4a: ; 96c4a
|
|
|
|
earthquake 16
|
|
|
|
end
|
|
|
|
; 96c4d
|
|
|
|
|
|
|
|
UnknownScript_0x96c4d: ; 96c4d
|
|
|
|
reloadandreturn $f7
|
|
|
|
; 96c4f
|
|
|
|
|
|
|
|
UnknownScript_0x96c4f: ; 96c4f
|
|
|
|
deactivatefacing $3
|
2015-07-15 12:48:44 -07:00
|
|
|
callasm SetBit4_ScriptFlags3
|
2013-11-22 02:04:32 -08:00
|
|
|
end
|
|
|
|
; 96c56
|
|
|
|
|
2014-12-29 08:08:03 -08:00
|
|
|
INCLUDE "engine/scripting.asm"
|
|
|
|
INCLUDE "engine/events_2.asm"
|