From 2fe782b11a039b52fd236da28fb2f1ae10cae7db Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 1 Apr 2015 16:51:04 +0200 Subject: Rename battle files and split move effects Part 4 e.asm, e_2. asm, and 14.asm --- engine/battle/init_battle_variables.asm | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 engine/battle/init_battle_variables.asm (limited to 'engine/battle/init_battle_variables.asm') diff --git a/engine/battle/init_battle_variables.asm b/engine/battle/init_battle_variables.asm new file mode 100644 index 00000000..457cc4e1 --- /dev/null +++ b/engine/battle/init_battle_variables.asm @@ -0,0 +1,40 @@ +InitBattleVariables: ; 525af (14:65af) + ld a, [hTilesetType] + ld [wd0d4], a + xor a + ld [wcd6a], a + ld [wBattleResult], a + ld hl, wcc2b + ld [hli], a + ld [hli], a + ld [hli], a + ld [hl], a + ld [wListScrollOffset], a + ld [wCriticalHitOrOHKO], a + ld [wBattleMonSpecies], a + ld [wPartyGainExpFlags], a + ld [wPlayerMonNumber], a + ld [wEscapedFromBattle], a + ld [wMapPalOffset], a + ld hl, wcf1d + ld [hli], a + ld [hl], a + ld hl, wccd3 + ld b, $3c +.loop + ld [hli], a + dec b + jr nz, .loop + inc a + ld [wccd9], a + ld a, [W_CURMAP] + cp SAFARI_ZONE_EAST + jr c, .notSafariBattle + cp SAFARI_ZONE_REST_HOUSE_1 + jr nc, .notSafariBattle + ld a, $2 ; safari battle + ld [W_BATTLETYPE], a +.notSafariBattle + ld hl, PlayBattleMusic + ld b, BANK(PlayBattleMusic) + jp Bankswitch -- cgit v1.2.3