summaryrefslogtreecommitdiff
path: root/event/whiteout.asm
diff options
context:
space:
mode:
Diffstat (limited to 'event/whiteout.asm')
-rwxr-xr-xevent/whiteout.asm84
1 files changed, 84 insertions, 0 deletions
diff --git a/event/whiteout.asm b/event/whiteout.asm
new file mode 100755
index 000000000..6cf6976cf
--- /dev/null
+++ b/event/whiteout.asm
@@ -0,0 +1,84 @@
+Script_BattleWhiteout:: ; 0x124c1
+ callasm BattleBGMap
+ jump Script_Whiteout
+; 0x124c8
+
+Script_OverworldWhiteout:: ; 0x124c8
+ refreshscreen $0
+ callasm OverworldBGMap
+
+Script_Whiteout: ; 0x124ce
+ writetext .WhitedOutText
+ closetext
+ special FadeBlackBGMap
+ pause 40
+ special HealParty
+ checkflag ENGINE_BUG_CONTEST_TIMER
+ iftrue .bug_contest
+ callasm HalveMoney
+ callasm GetWhiteoutSpawn
+ farscall Script_AbortBugContest
+ special WarpToSpawnPoint
+ newloadmap MAPSETUP_WARP
+ resetfuncs
+
+.bug_contest
+ jumpstd bugcontestresultswarp
+; 0x124f5
+
+.WhitedOutText: ; 0x124f5
+ ; is out of useable #MON! whited out!
+ text_jump UnknownText_0x1c0a4e
+ db "@"
+; 0x124fa
+
+OverworldBGMap: ; 124fa
+ call ClearPalettes
+ call ClearScreen
+ call Function3200
+ call HideSprites
+ call Function4f0
+ ret
+; 1250a
+
+BattleBGMap: ; 1250a
+ ld b, $0
+ call GetSGBLayout
+ call SetPalettes
+ ret
+; 12513
+
+HalveMoney: ; 12513
+
+; Empty function...
+ callba MobileFn_1060c7
+
+; Halve the player's money.
+ ld hl, Money
+ ld a, [hl]
+ srl a
+ ld [hli], a
+ ld a, [hl]
+ rra
+ ld [hli], a
+ ld a, [hl]
+ rra
+ ld [hl], a
+ ret
+; 12527
+
+
+GetWhiteoutSpawn: ; 12527
+ ld a, [wLastSpawnMapGroup]
+ ld d, a
+ ld a, [wLastSpawnMapNumber]
+ ld e, a
+ callba IsSpawnPoint
+ ld a, c
+ jr c, .yes
+ xor a ; SPAWN_HOME
+
+.yes
+ ld [wd001], a
+ ret
+; 1253d