2020-05-31 09:42:40 +01:00
|
|
|
; L0008.asm
|
2020-05-31 04:23:06 +01:00
|
|
|
; Generated 09.04.2000 by mlevel
|
|
|
|
; Modified 09.04.2000 by Abe Pralle
|
|
|
|
|
2020-06-15 06:19:36 +01:00
|
|
|
INCLUDE "Source/Defs.inc"
|
|
|
|
INCLUDE "Source/Levels.inc"
|
|
|
|
INCLUDE "Source/Items.inc"
|
2020-05-31 04:23:06 +01:00
|
|
|
|
|
|
|
STATE_NORMAL EQU 1
|
|
|
|
STATE_SPRAYTAKEN EQU 2
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
SECTION "Level0008Section",ROMX
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
dialog:
|
2020-05-31 09:42:40 +01:00
|
|
|
L0008_findspray_gtx:
|
2020-06-15 01:47:17 +01:00
|
|
|
INCBIN "Data/Dialog/Talk/L0008_findspray.gtx"
|
2020-05-31 04:23:06 +01:00
|
|
|
|
|
|
|
L0008_Contents::
|
|
|
|
DW L0008_Load
|
|
|
|
DW L0008_Init
|
|
|
|
DW L0008_Check
|
|
|
|
DW L0008_Map
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; Load
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
L0008_Load:
|
|
|
|
DW ((L0008_LoadFinished - L0008_Load2)) ;size
|
|
|
|
L0008_Load2:
|
|
|
|
call ParseMap
|
|
|
|
ret
|
|
|
|
|
|
|
|
L0008_LoadFinished:
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; Map
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
L0008_Map:
|
2020-05-31 09:42:40 +01:00
|
|
|
INCBIN "Data/Levels/L0008_forest.lvl"
|
2020-05-31 04:23:06 +01:00
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; Init
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
L0008_Init:
|
|
|
|
DW ((L0008_InitFinished - L0008_Init2)) ;size
|
|
|
|
L0008_Init2:
|
|
|
|
call State0To1
|
|
|
|
|
|
|
|
STDSETUPDIALOG
|
|
|
|
|
|
|
|
ldio a,[mapState]
|
|
|
|
cp STATE_SPRAYTAKEN
|
|
|
|
jr nz,.done
|
|
|
|
|
|
|
|
;remove spray from map
|
|
|
|
ld a,MAPBANK
|
|
|
|
ldio [$ff70],a
|
|
|
|
xor a
|
|
|
|
ld [$d32d],a
|
|
|
|
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
|
|
|
L0008_InitFinished:
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
; Check
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
L0008_Check:
|
|
|
|
DW ((L0008_CheckFinished - L0008_Check2)) ;size
|
|
|
|
L0008_Check2:
|
|
|
|
ldio a,[mapState]
|
|
|
|
cp STATE_SPRAYTAKEN
|
|
|
|
jr z,.done
|
|
|
|
|
|
|
|
xor a
|
|
|
|
ld hl,((.checkFoundSpray-L0008_Check2)+levelCheckRAM)
|
|
|
|
call CheckEachHero
|
|
|
|
.done
|
|
|
|
ret
|
|
|
|
|
|
|
|
.checkFoundSpray
|
|
|
|
ld c,a
|
|
|
|
call GetFirst
|
|
|
|
call GetCurZone
|
|
|
|
cp 2
|
|
|
|
jr z,.foundSpray
|
|
|
|
|
|
|
|
xor a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.foundSpray
|
|
|
|
;found spray
|
|
|
|
ld de,((.afterDialog-L0008_Check2)+levelCheckRAM)
|
|
|
|
call SetDialogSkip
|
|
|
|
|
|
|
|
call MakeIdle
|
|
|
|
|
|
|
|
call SetSpeakerFromHeroIndex
|
2020-05-31 09:42:40 +01:00
|
|
|
ld de,L0008_findspray_gtx
|
2020-05-31 04:23:06 +01:00
|
|
|
call ShowDialogAtBottom
|
|
|
|
.afterDialog
|
|
|
|
call ClearDialog
|
|
|
|
call ClearDialogSkipForward
|
|
|
|
call MakeNonIdle
|
|
|
|
|
|
|
|
ld bc,ITEM_BUGSPRAY
|
|
|
|
call AddInventoryItem
|
|
|
|
|
|
|
|
;remove spray from map
|
|
|
|
ld a,MAPBANK
|
|
|
|
ldio [$ff70],a
|
|
|
|
xor a
|
|
|
|
ld [$d32d],a
|
|
|
|
|
|
|
|
ld a,STATE_SPRAYTAKEN
|
|
|
|
ldio [mapState],a
|
|
|
|
|
|
|
|
ld a,1
|
|
|
|
ret
|
|
|
|
|
|
|
|
L0008_CheckFinished:
|
2022-01-08 03:29:25 +00:00
|
|
|
PRINT "0008 Script Sizes (Load/Init/Check) (of $500): "
|
|
|
|
PRINT (L0008_LoadFinished - L0008_Load2)
|
|
|
|
PRINT " / "
|
|
|
|
PRINT (L0008_InitFinished - L0008_Init2)
|
|
|
|
PRINT " / "
|
|
|
|
PRINT (L0008_CheckFinished - L0008_Check2)
|
|
|
|
PRINT "\n"
|
2020-05-31 04:23:06 +01:00
|
|
|
|