aboutsummaryrefslogtreecommitdiffstats
path: root/engine/init_player_data.asm
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2016-03-17 18:00:47 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2016-03-17 18:00:54 -0400
commitb6d2115df4b4f9d86be898292fca473222941f1d (patch)
tree530796fd3f2b356d6af8442d6f6b1352b08012e1 /engine/init_player_data.asm
parentSplit bank1 up. (diff)
downloadpokeyellow-b6d2115df4b4f9d86be898292fca473222941f1d.tar.gz
pokeyellow-b6d2115df4b4f9d86be898292fca473222941f1d.tar.xz
pokeyellow-b6d2115df4b4f9d86be898292fca473222941f1d.zip
Split bank3 up.
Diffstat (limited to 'engine/init_player_data.asm')
-rw-r--r--engine/init_player_data.asm60
1 files changed, 60 insertions, 0 deletions
diff --git a/engine/init_player_data.asm b/engine/init_player_data.asm
new file mode 100644
index 00000000..c1b93505
--- /dev/null
+++ b/engine/init_player_data.asm
@@ -0,0 +1,60 @@
+InitPlayerData: ; f6d6 (3:76d6)
+InitPlayerData2:
+
+ call Random
+ ld a, [hRandomSub]
+ ld [wPlayerID], a
+
+ call Random
+ ld a, [hRandomAdd]
+ ld [wPlayerID + 1], a
+
+ ld a, $ff
+ ld [wUnusedD71B], a
+
+ ld a, 90 ; initialize happiness to 90
+ ld [wPikachuHappiness], a
+ ld a, $80
+ ld [wPikachuMood], a ; initialize mood
+
+ ld hl, wPartyCount
+ call InitializeEmptyList
+ ld hl, wNumInBox
+ call InitializeEmptyList
+ ld hl, wNumBagItems
+ call InitializeEmptyList
+ ld hl, wNumBoxItems
+ call InitializeEmptyList
+
+START_MONEY EQU $3000
+ ld hl, wPlayerMoney + 1
+ ld a, START_MONEY / $100
+ ld [hld], a
+ xor a
+ ld [hli], a
+ inc hl
+ ld [hl], a
+
+ ld [wMonDataLocation], a
+
+ ld hl, wObtainedBadges
+ ld [hli], a
+
+ ld [hl], a
+
+ ld hl, wPlayerCoins
+ ld [hli], a
+ ld [hl], a
+
+ ld hl, wGameProgressFlags
+ ld bc, wGameProgressFlagsEnd - wGameProgressFlags
+ call FillMemory ; clear all game progress flags
+
+ jp InitializeMissableObjectsFlags
+
+InitializeEmptyList: ; f730 (3:7730)
+ xor a ; count
+ ld [hli], a
+ dec a ; terminator
+ ld [hl], a
+ ret \ No newline at end of file