78 lines
1.2 KiB
NASM
Raw Normal View History

Script_BattleWhiteout::
2015-11-11 16:11:08 -05:00
callasm BattleBGMap
sjump Script_Whiteout
2015-11-11 16:11:08 -05:00
OverworldWhiteoutScript::
2018-01-12 01:40:20 -05:00
refreshscreen
2015-11-11 16:11:08 -05:00
callasm OverworldBGMap
Script_Whiteout:
2015-11-11 16:11:08 -05:00
writetext .WhitedOutText
2015-11-25 10:16:29 -05:00
waitbutton
special FadeOutPalettesToWhite
2015-11-11 16:11:08 -05:00
pause 40
special HealParty
checkflag ENGINE_BUG_CONTEST_TIMER
iftrue .bug_contest
callasm HalveCoins
2015-11-11 16:11:08 -05:00
farscall Script_AbortBugContest
exitoverworld WHITED_OUT_IN_LEVEL
2018-02-02 21:09:17 -05:00
endall
2015-11-11 16:11:08 -05:00
.bug_contest
jumpstd BugContestResultsWarpScript
2015-11-11 16:11:08 -05:00
.WhitedOutText:
text_far _WhitedOutText
text_end
2015-11-11 16:11:08 -05:00
2018-06-24 16:09:41 +02:00
OverworldBGMap:
2015-11-11 16:11:08 -05:00
call ClearPalettes
call ClearScreen
2015-12-11 16:59:40 -05:00
call WaitBGMap2
call DisableOverworldHUD
xor a
ld [wDisplaySecondarySprites], a
farcall ClearSpriteAnims
call ClearSprites
call LoadStandardFont
call LoadFrame
2015-11-20 11:47:52 -05:00
call RotateThreePalettesLeft
ld a, FALSE
ld [wText2bpp], a
jp SpeechTextbox1bpp
2015-11-11 16:11:08 -05:00
2018-06-24 16:09:41 +02:00
BattleBGMap:
ld b, CGB_BATTLE_GRAYSCALE
call GetCGBLayout
2015-11-11 16:11:08 -05:00
call SetPalettes
ret
HalveCoins:
; Halve the player's coins.
ld hl, wCoins
2015-11-11 16:11:08 -05:00
ld a, [hl]
srl a
ld [hli], a
ld a, [hl]
rra
ld [hli], a
ld a, [hl]
rra
ld [hl], a
ret
2018-06-24 16:09:41 +02:00
GetWhiteoutSpawn:
2015-11-11 16:11:08 -05:00
ld a, [wLastSpawnMapGroup]
ld d, a
ld a, [wLastSpawnMapNumber]
ld e, a
2017-12-24 12:47:30 -05:00
farcall IsSpawnPoint
2015-11-11 16:11:08 -05:00
ld a, c
jr c, .yes
xor a ; SPAWN_LEVEL_1
2015-11-11 16:11:08 -05:00
.yes
2018-01-23 17:39:09 -05:00
ld [wDefaultSpawnpoint], a
2015-11-11 16:11:08 -05:00
ret