From f0346a9982ed2cda3f8d0aa5f14cfb1b8b84602e Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 22 Mar 2013 04:08:47 -0400 Subject: [PATCH] various minor additions -battle variable constants -step counters -turn update fns --- constants.asm | 26 ++++++++++++++++++++++++++ main.asm | 16 +++++++++++++++- wram.asm | 11 +++++++---- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/constants.asm b/constants.asm index 8a3d4d080..03df937c1 100644 --- a/constants.asm +++ b/constants.asm @@ -3249,6 +3249,8 @@ MUSIC_SUICUNE_BATTLE EQU 100 MUSIC_BATTLE_TOWER_LOBBY EQU 101 MUSIC_MOBILE_CENTER EQU 102 +MUSIC_MAHOGANY_MART EQU 100 ; grandfathered from gold + ; sound _4CH1 EQU $c0 _3CH1 EQU $80 @@ -3416,6 +3418,30 @@ BATTLETYPE_FORCEITEM EQU $0a BATTLETYPE_SUICUNE EQU $0c +; battle variables +BATTLE_VARS_SUBSTATUS1 EQU 0 +BATTLE_VARS_SUBSTATUS2 EQU 1 +BATTLE_VARS_SUBSTATUS3 EQU 2 +BATTLE_VARS_SUBSTATUS4 EQU 3 +BATTLE_VARS_SUBSTATUS5 EQU 4 +BATTLE_VARS_SUBSTATUS1_OPP EQU 5 +BATTLE_VARS_SUBSTATUS2_OPP EQU 6 +BATTLE_VARS_SUBSTATUS3_OPP EQU 7 +BATTLE_VARS_SUBSTATUS4_OPP EQU 8 +BATTLE_VARS_SUBSTATUS5_OPP EQU 9 +BATTLE_VARS_STATUS EQU 10 +BATTLE_VARS_STATUS_OPP EQU 11 +BATTLE_VARS_MOVE_ANIM EQU 12 +BATTLE_VARS_MOVE_EFFECT EQU 13 +BATTLE_VARS_MOVE_POWER EQU 14 +BATTLE_VARS_MOVE_TYPE EQU 15 +BATTLE_VARS_MOVE EQU 16 +BATTLE_VARS_LAST_COUNTER_MOVE EQU 17 +BATTLE_VARS_LAST_COUNTER_MOVE_OPP EQU 18 +BATTLE_VARS_LAST_MOVE EQU 19 +BATTLE_VARS_LAST_MOVE_OPP EQU 20 + + ; joypad BUTTONS EQU %00010000 D_PAD EQU %00100000 diff --git a/main.asm b/main.asm index 22f7e3b83..2eb22f10d 100644 --- a/main.asm +++ b/main.asm @@ -3415,7 +3415,21 @@ GetPartyLocation: ; 3927 jp AddNTimes ; 392d -INCBIN "baserom.gbc",$392d,$3b86 - $392d +INCBIN "baserom.gbc", $392d, $3985 - $392d + +SetPlayerTurn: ; 3985 + xor a + ld [hBattleTurn], a + ret +; 3989 + +SetEnemyTurn: ; 3989 + ld a, 1 + ld [hBattleTurn], a + ret +; 398e + +INCBIN "baserom.gbc", $398e, $3b86 - $398e LoadMusicByte: ; 3b86 ; load music data into CurMusicByte diff --git a/wram.asm b/wram.asm index a693e28c7..444856409 100644 --- a/wram.asm +++ b/wram.asm @@ -565,10 +565,8 @@ EnemyDamageTaken: ; c684 BattleScriptBuffer: ; c68a ds 40 -BattleScriptBufferLocLo: ; c6b2 - ds 1 -BattleScriptBufferLocHi: ; c6b3 - ds 1 +BattleScriptBufferLoc: ; c6b2 + ds 2 ds 25 @@ -1286,6 +1284,11 @@ Box13Name: ; dbe1 Box14Name: ; dbea ds 9 +SECTION "steps", BSS[$dc73] +StepCount: ; dc73 + ds 1 +PoisonStepCount: ; dc74 + ds 1 SECTION "FlypointPermissions", BSS[$dca5] FlypointPerms: ; dca5