More battle code cleanup.

- Use more substatus constants.
- Reformat some code to be more atomic.
- Add constants for unused status prevention held item effects.
- Remove pointless or redundant comments.
This commit is contained in:
yenatch 2014-06-13 21:18:14 -07:00
parent 560b892b2d
commit eb9fc6676c
8 changed files with 721 additions and 725 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,8 @@
MAX_LEVEL EQU 100 MAX_LEVEL EQU 100
NUM_MOVES EQU 4 NUM_MOVES EQU 4
REST_TURNS EQU 2
ATTACK EQU 0 ATTACK EQU 0
DEFENSE EQU 1 DEFENSE EQU 1
SPEED EQU 2 SPEED EQU 2
@ -110,6 +112,7 @@ SUBSTATUS_UNLEASH EQU 0
SUBSTATUS_CANT_RUN EQU 7 SUBSTATUS_CANT_RUN EQU 7
SUBSTATUS_DESTINY_BOND EQU 6 SUBSTATUS_DESTINY_BOND EQU 6
SUBSTATUS_LOCK_ON EQU 5 SUBSTATUS_LOCK_ON EQU 5
SUBSTATUS_TRANSFORMED EQU 3
SUBSTATUS_TOXIC EQU 0 SUBSTATUS_TOXIC EQU 0
; environmental ; environmental
@ -119,6 +122,7 @@ SCREENS_SAFEGUARD EQU 2
SCREENS_SPIKES EQU 0 SCREENS_SPIKES EQU 0
; weather ; weather
WEATHER_NONE EQU 0
WEATHER_RAIN EQU 1 WEATHER_RAIN EQU 1
WEATHER_SUN EQU 2 WEATHER_SUN EQU 2
WEATHER_SANDSTORM EQU 3 WEATHER_SANDSTORM EQU 3

View File

@ -267,6 +267,7 @@ HELD_BERRY EQU $01
HELD_LEFTOVERS EQU $03 HELD_LEFTOVERS EQU $03
HELD_RESTORE_PP EQU $06 HELD_RESTORE_PP EQU $06
HELD_CLEANSE_TAG EQU $08 HELD_CLEANSE_TAG EQU $08
HELD_HEAL_POISON EQU $0a HELD_HEAL_POISON EQU $0a
HELD_HEAL_FREEZE EQU $0b HELD_HEAL_FREEZE EQU $0b
HELD_HEAL_BURN EQU $0c HELD_HEAL_BURN EQU $0c
@ -274,7 +275,24 @@ HELD_HEAL_SLEEP EQU $0d
HELD_HEAL_PARALYZE EQU $0e HELD_HEAL_PARALYZE EQU $0e
HELD_HEAL_STATUS EQU $0f HELD_HEAL_STATUS EQU $0f
HELD_HEAL_CONFUSION EQU $10 HELD_HEAL_CONFUSION EQU $10
HELD_PREVENT_POISON EQU $14
HELD_PREVENT_BURN EQU $15
HELD_PREVENT_FREEZE EQU $16
HELD_PREVENT_SLEEP EQU $17
HELD_PREVENT_PARALYZE EQU $18
HELD_PREVENT_CONFUSE EQU $19
HELD_ATTACK_UP EQU $1f
HELD_DEFENSE_UP EQU $20
HELD_SPEED_UP EQU $21
HELD_SP_ATTACK_UP EQU $22
HELD_SP_DEFENSE_UP EQU $23
HELD_ACCURACY_UP EQU $24
HELD_EVASION_UP EQU $25
HELD_METAL_POWDER EQU $2a HELD_METAL_POWDER EQU $2a
HELD_NORMAL_BOOST EQU $32 HELD_NORMAL_BOOST EQU $32
HELD_FIGHTING_BOOST EQU $33 HELD_FIGHTING_BOOST EQU $33
HELD_FLYING_BOOST EQU $34 HELD_FLYING_BOOST EQU $34
@ -292,6 +310,7 @@ HELD_ICE_BOOST EQU $3f
HELD_DRAGON_BOOST EQU $40 HELD_DRAGON_BOOST EQU $40
HELD_DARK_BOOST EQU $41 HELD_DARK_BOOST EQU $41
HELD_STEEL_BOOST EQU $42 HELD_STEEL_BOOST EQU $42
HELD_ESCAPE EQU $48 HELD_ESCAPE EQU $48
HELD_CRITICAL_UP EQU $49 HELD_CRITICAL_UP EQU $49
HELD_QUICK_CLAW EQU $4a HELD_QUICK_CLAW EQU $4a

View File

@ -72,9 +72,9 @@ D_DOWN EQU %10000000
; screen ; screen
HP_BAR_LENGTH EQU 6 HP_BAR_LENGTH EQU 6
HP_BAR_LENGTH_PX EQU 48 HP_BAR_LENGTH_PX EQU HP_BAR_LENGTH * 8
EXP_BAR_LENGTH EQU 8 EXP_BAR_LENGTH EQU 8
EXP_BAR_LENGTH_PX EQU 64 EXP_BAR_LENGTH_PX EQU EXP_BAR_LENGTH * 8
SCREEN_WIDTH EQU 20 SCREEN_WIDTH EQU 20
SCREEN_HEIGHT EQU 18 SCREEN_HEIGHT EQU 18

View File

@ -25,7 +25,7 @@ UNUSED_TYPES EQU const_value
const TYPE_17 const TYPE_17
const TYPE_18 const TYPE_18
const CURSE_T const CURSE_T
UNUSED_TYPES_END EQU const_value
SPECIAL EQU const_value SPECIAL EQU const_value
const FIRE const FIRE
@ -37,3 +37,4 @@ SPECIAL EQU const_value
const DRAGON const DRAGON
const DARK const DARK
TYPES_END EQU const_value

View File

@ -57004,7 +57004,7 @@ StatsScreenInit: ; 4dc8a
jr StatsScreenInit_gotaddress jr StatsScreenInit_gotaddress
Function4dc8f: ; 4dc8f Function4dc8f: ; 4dc8f
ld hl, Function4dcf7 ld hl, StatsScreenBattle
jr StatsScreenInit_gotaddress jr StatsScreenInit_gotaddress
StatsScreenInit_gotaddress: ; 4dc94 StatsScreenInit_gotaddress: ; 4dc94
@ -57063,7 +57063,7 @@ StatsScreenMain: ; 0x4dcd2
ret ret
; 0x4dcf7 ; 0x4dcf7
Function4dcf7: ; 4dcf7 StatsScreenBattle: ; 4dcf7
xor a xor a
ld [$cf63], a ld [$cf63], a
ld [$cf64], a ld [$cf64], a

View File

@ -552,7 +552,11 @@ LinkBattleRNCount:: ; c6e5
CurEnemyMoveNum:: ; c6e9 CurEnemyMoveNum:: ; c6e9
ds 1 ds 1
ds 10 ds 2
wPayDayMoney:: ds 3 ; c6ec
ds 5
AlreadyDisobeyed:: ; c6f4 AlreadyDisobeyed:: ; c6f4
ds 1 ds 1
@ -1176,8 +1180,12 @@ OTPartyMon6:: party_struct OTPartyMon6 ; d378
OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8 OTPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d3a8
OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea OTPartyMonNicknames:: ds PKMN_NAME_LENGTH * PARTY_LENGTH ; d3ea
ds 4
wBattleAction:: ds 1 ; d430
ds 1
SECTION "Map Events", WRAMX[$d432], BANK[1]
MapStatus:: ; d432 MapStatus:: ; d432
ds 1 ds 1
MapEventStatus:: ; d433 MapEventStatus:: ; d433