2017-12-09 05:50:59 +00:00
|
|
|
; significant level values
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF MAX_LEVEL EQU 100
|
|
|
|
DEF MIN_LEVEL EQU 2
|
|
|
|
DEF EGG_LEVEL EQU 5
|
2017-12-09 05:50:59 +00:00
|
|
|
|
|
|
|
; maximum moves known per mon
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_MOVES EQU 4
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2017-12-09 05:50:59 +00:00
|
|
|
; significant stat values
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF BASE_STAT_LEVEL EQU 7
|
|
|
|
DEF MAX_STAT_LEVEL EQU 13
|
2014-06-14 04:18:14 +00:00
|
|
|
|
2017-12-25 18:40:10 +00:00
|
|
|
; turns that sleep lasts
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF REST_SLEEP_TURNS EQU 2
|
|
|
|
DEF TREEMON_SLEEP_TURNS EQU 7
|
2017-12-09 05:50:59 +00:00
|
|
|
|
2018-01-09 20:39:48 +00:00
|
|
|
; default move priority
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF BASE_PRIORITY EQU 1
|
2018-01-09 20:39:48 +00:00
|
|
|
|
2018-01-10 22:30:27 +00:00
|
|
|
; type effectiveness factors, scaled by 10
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF SUPER_EFFECTIVE EQU 20
|
|
|
|
DEF MORE_EFFECTIVE EQU 15
|
|
|
|
DEF EFFECTIVE EQU 10
|
|
|
|
DEF NOT_VERY_EFFECTIVE EQU 05
|
|
|
|
DEF NO_EFFECT EQU 00
|
2018-01-10 22:30:27 +00:00
|
|
|
|
2020-10-22 01:34:18 +00:00
|
|
|
; enemy AI behavior
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF BASE_AI_SWITCH_SCORE EQU 10
|
2020-10-22 01:34:18 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerStatLevels and wEnemyStatLevels indexes (see wram.asm)
|
2018-01-10 22:30:27 +00:00
|
|
|
; GetStatName arguments (see data/battle/stat_names.asm)
|
2015-07-13 05:37:11 +00:00
|
|
|
const_def
|
|
|
|
const ATTACK
|
|
|
|
const DEFENSE
|
|
|
|
const SPEED
|
|
|
|
const SP_ATTACK
|
|
|
|
const SP_DEFENSE
|
|
|
|
const ACCURACY
|
|
|
|
const EVASION
|
2017-12-09 05:50:59 +00:00
|
|
|
const ABILITY ; used for BattleCommand_Curse
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_LEVEL_STATS EQU const_value
|
2013-06-13 20:10:39 +00:00
|
|
|
|
2017-12-26 22:47:05 +00:00
|
|
|
; move struct members (see data/moves/moves.asm)
|
2021-03-16 21:53:42 +00:00
|
|
|
rsreset
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF MOVE_ANIM rb ; 0
|
|
|
|
DEF MOVE_EFFECT rb ; 1
|
|
|
|
DEF MOVE_POWER rb ; 2
|
|
|
|
DEF MOVE_TYPE rb ; 3
|
|
|
|
DEF MOVE_ACC rb ; 4
|
|
|
|
DEF MOVE_PP rb ; 5
|
|
|
|
DEF MOVE_CHANCE rb ; 6
|
|
|
|
DEF MOVE_LENGTH EQU _RS
|
2013-06-11 01:56:34 +00:00
|
|
|
|
|
|
|
; stat constants
|
2017-12-09 05:50:59 +00:00
|
|
|
; indexes for:
|
2018-01-23 22:39:09 +00:00
|
|
|
; - wPlayerStats and wEnemyStats (see wram.asm)
|
2017-12-09 05:50:59 +00:00
|
|
|
; - party_struct and battle_struct members (see macros/wram.asm)
|
2018-01-31 16:38:45 +00:00
|
|
|
const_def 1
|
2015-07-13 05:37:11 +00:00
|
|
|
const STAT_HP
|
|
|
|
const STAT_ATK
|
|
|
|
const STAT_DEF
|
|
|
|
const STAT_SPD
|
|
|
|
const STAT_SATK
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_EXP_STATS EQU const_value - 1
|
2015-07-13 05:37:11 +00:00
|
|
|
const STAT_SDEF
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_STATS EQU const_value - 1
|
|
|
|
DEF NUM_BATTLE_STATS EQU NUM_STATS - 1 ; don't count HP
|
2017-12-09 05:50:59 +00:00
|
|
|
|
|
|
|
; stat formula constants
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF STAT_MIN_NORMAL EQU 5
|
|
|
|
DEF STAT_MIN_HP EQU 10
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF MAX_STAT_VALUE EQU 999
|
2017-12-25 00:49:57 +00:00
|
|
|
|
2013-06-11 01:56:34 +00:00
|
|
|
; shiny dvs
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF ATKDEFDV_SHINY EQU $EA
|
|
|
|
DEF SPDSPCDV_SHINY EQU $AA
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2017-12-09 05:50:59 +00:00
|
|
|
; battle classes (wBattleMode values)
|
2018-01-31 16:38:45 +00:00
|
|
|
const_def 1
|
2015-07-13 05:37:11 +00:00
|
|
|
const WILD_BATTLE
|
|
|
|
const TRAINER_BATTLE
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; battle types (wBattleType values)
|
2015-07-13 05:37:11 +00:00
|
|
|
const_def
|
|
|
|
const BATTLETYPE_NORMAL
|
|
|
|
const BATTLETYPE_CANLOSE
|
|
|
|
const BATTLETYPE_DEBUG
|
|
|
|
const BATTLETYPE_TUTORIAL
|
|
|
|
const BATTLETYPE_FISH
|
|
|
|
const BATTLETYPE_ROAMING
|
|
|
|
const BATTLETYPE_CONTEST
|
|
|
|
const BATTLETYPE_SHINY
|
|
|
|
const BATTLETYPE_TREE
|
|
|
|
const BATTLETYPE_TRAP
|
|
|
|
const BATTLETYPE_FORCEITEM
|
|
|
|
const BATTLETYPE_CELEBI
|
|
|
|
const BATTLETYPE_SUICUNE
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2021-03-16 21:53:42 +00:00
|
|
|
; BattleVarPairs indexes (see home/battle_vars.asm)
|
2015-07-13 05:37:11 +00:00
|
|
|
const_def
|
|
|
|
const BATTLE_VARS_SUBSTATUS1
|
|
|
|
const BATTLE_VARS_SUBSTATUS2
|
|
|
|
const BATTLE_VARS_SUBSTATUS3
|
|
|
|
const BATTLE_VARS_SUBSTATUS4
|
|
|
|
const BATTLE_VARS_SUBSTATUS5
|
|
|
|
const BATTLE_VARS_SUBSTATUS1_OPP
|
|
|
|
const BATTLE_VARS_SUBSTATUS2_OPP
|
|
|
|
const BATTLE_VARS_SUBSTATUS3_OPP
|
|
|
|
const BATTLE_VARS_SUBSTATUS4_OPP
|
|
|
|
const BATTLE_VARS_SUBSTATUS5_OPP
|
|
|
|
const BATTLE_VARS_STATUS
|
|
|
|
const BATTLE_VARS_STATUS_OPP
|
|
|
|
const BATTLE_VARS_MOVE_ANIM
|
|
|
|
const BATTLE_VARS_MOVE_EFFECT
|
|
|
|
const BATTLE_VARS_MOVE_POWER
|
|
|
|
const BATTLE_VARS_MOVE_TYPE
|
|
|
|
const BATTLE_VARS_MOVE
|
|
|
|
const BATTLE_VARS_LAST_COUNTER_MOVE
|
|
|
|
const BATTLE_VARS_LAST_COUNTER_MOVE_OPP
|
|
|
|
const BATTLE_VARS_LAST_MOVE
|
|
|
|
const BATTLE_VARS_LAST_MOVE_OPP
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_BATTLE_VARS EQU const_value
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2021-03-16 21:53:42 +00:00
|
|
|
; BattleVarLocations indexes (see home/battle_vars.asm)
|
2017-12-09 05:50:59 +00:00
|
|
|
const_def
|
|
|
|
const PLAYER_SUBSTATUS_1
|
|
|
|
const ENEMY_SUBSTATUS_1
|
|
|
|
const PLAYER_SUBSTATUS_2
|
|
|
|
const ENEMY_SUBSTATUS_2
|
|
|
|
const PLAYER_SUBSTATUS_3
|
|
|
|
const ENEMY_SUBSTATUS_3
|
|
|
|
const PLAYER_SUBSTATUS_4
|
|
|
|
const ENEMY_SUBSTATUS_4
|
|
|
|
const PLAYER_SUBSTATUS_5
|
|
|
|
const ENEMY_SUBSTATUS_5
|
|
|
|
const PLAYER_STATUS
|
|
|
|
const ENEMY_STATUS
|
|
|
|
const PLAYER_MOVE_ANIMATION
|
|
|
|
const ENEMY_MOVE_ANIMATION
|
|
|
|
const PLAYER_MOVE_EFFECT
|
|
|
|
const ENEMY_MOVE_EFFECT
|
|
|
|
const PLAYER_MOVE_POWER
|
|
|
|
const ENEMY_MOVE_POWER
|
|
|
|
const PLAYER_MOVE_TYPE
|
|
|
|
const ENEMY_MOVE_TYPE
|
|
|
|
const PLAYER_CUR_MOVE
|
|
|
|
const ENEMY_CUR_MOVE
|
|
|
|
const PLAYER_COUNTER_MOVE
|
|
|
|
const ENEMY_COUNTER_MOVE
|
|
|
|
const PLAYER_LAST_MOVE
|
|
|
|
const ENEMY_LAST_MOVE
|
2021-03-04 03:22:41 +00:00
|
|
|
assert const_value % 2 == 0
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF NUM_BATTLE_VAR_LOCATION_PAIRS EQU const_value / 2
|
2017-12-09 05:50:59 +00:00
|
|
|
|
|
|
|
; status condition bit flags
|
2022-06-18 02:25:56 +00:00
|
|
|
DEF SLP_MASK EQU %111 ; 0-7 turns
|
2018-01-31 16:38:45 +00:00
|
|
|
const_def 3
|
2015-07-13 05:37:11 +00:00
|
|
|
const PSN
|
|
|
|
const BRN
|
|
|
|
const FRZ
|
|
|
|
const PAR
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2022-06-18 02:25:56 +00:00
|
|
|
DEF ALL_STATUS EQU (1 << PSN) | (1 << BRN) | (1 << FRZ) | (1 << PAR) | SLP_MASK
|
2015-11-08 18:27:26 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerSubStatus1 or wEnemySubStatus1 bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SUBSTATUS_NIGHTMARE
|
|
|
|
const SUBSTATUS_CURSE
|
|
|
|
const SUBSTATUS_PROTECT
|
|
|
|
const SUBSTATUS_IDENTIFIED
|
|
|
|
const SUBSTATUS_PERISH
|
|
|
|
const SUBSTATUS_ENDURE
|
|
|
|
const SUBSTATUS_ROLLOUT
|
|
|
|
const SUBSTATUS_IN_LOVE
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerSubStatus2 or wEnemySubStatus2 bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SUBSTATUS_CURLED
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerSubStatus3 or wEnemySubStatus3 bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SUBSTATUS_BIDE
|
|
|
|
const SUBSTATUS_RAMPAGE
|
|
|
|
const SUBSTATUS_IN_LOOP
|
|
|
|
const SUBSTATUS_FLINCHED
|
|
|
|
const SUBSTATUS_CHARGED
|
|
|
|
const SUBSTATUS_UNDERGROUND
|
|
|
|
const SUBSTATUS_FLYING
|
|
|
|
const SUBSTATUS_CONFUSED
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerSubStatus4 or wEnemySubStatus4 bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SUBSTATUS_X_ACCURACY
|
|
|
|
const SUBSTATUS_MIST
|
|
|
|
const SUBSTATUS_FOCUS_ENERGY
|
2020-07-08 20:20:15 +00:00
|
|
|
const_skip
|
2020-07-08 19:30:23 +00:00
|
|
|
const SUBSTATUS_SUBSTITUTE
|
|
|
|
const SUBSTATUS_RECHARGE
|
|
|
|
const SUBSTATUS_RAGE
|
|
|
|
const SUBSTATUS_LEECH_SEED
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerSubStatus5 or wEnemySubStatus5 bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SUBSTATUS_TOXIC
|
2020-07-08 20:20:15 +00:00
|
|
|
const_skip
|
|
|
|
const_skip
|
2020-07-08 19:30:23 +00:00
|
|
|
const SUBSTATUS_TRANSFORMED
|
|
|
|
const SUBSTATUS_ENCORED
|
|
|
|
const SUBSTATUS_LOCK_ON
|
|
|
|
const SUBSTATUS_DESTINY_BOND
|
|
|
|
const SUBSTATUS_CANT_RUN
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
; wPlayerScreens or wEnemyScreens bit flags
|
2020-07-08 19:30:23 +00:00
|
|
|
const_def
|
|
|
|
const SCREENS_SPIKES
|
2020-07-08 20:20:15 +00:00
|
|
|
const_skip
|
2020-07-08 19:30:23 +00:00
|
|
|
const SCREENS_SAFEGUARD
|
|
|
|
const SCREENS_LIGHT_SCREEN
|
|
|
|
const SCREENS_REFLECT
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2018-01-23 21:45:34 +00:00
|
|
|
; values in wBattleWeather
|
2015-07-13 05:37:11 +00:00
|
|
|
const_def
|
|
|
|
const WEATHER_NONE
|
|
|
|
const WEATHER_RAIN
|
|
|
|
const WEATHER_SUN
|
|
|
|
const WEATHER_SANDSTORM
|
|
|
|
const WEATHER_RAIN_END
|
|
|
|
const WEATHER_SUN_END
|
|
|
|
const WEATHER_SANDSTORM_END
|
2013-06-11 01:56:34 +00:00
|
|
|
|
2015-11-06 14:04:27 +00:00
|
|
|
; wBattleAction
|
|
|
|
const_def
|
|
|
|
const BATTLEACTION_MOVE1
|
|
|
|
const BATTLEACTION_MOVE2
|
|
|
|
const BATTLEACTION_MOVE3
|
|
|
|
const BATTLEACTION_MOVE4
|
|
|
|
const BATTLEACTION_SWITCH1
|
|
|
|
const BATTLEACTION_SWITCH2
|
|
|
|
const BATTLEACTION_SWITCH3
|
|
|
|
const BATTLEACTION_SWITCH4
|
|
|
|
const BATTLEACTION_SWITCH5
|
|
|
|
const BATTLEACTION_SWITCH6
|
2020-07-08 20:20:15 +00:00
|
|
|
const_skip
|
|
|
|
const_skip
|
|
|
|
const_skip
|
2018-10-21 04:52:10 +00:00
|
|
|
const BATTLEACTION_SKIPTURN
|
|
|
|
const BATTLEACTION_STRUGGLE
|
2015-11-06 14:04:27 +00:00
|
|
|
const BATTLEACTION_FORFEIT
|
|
|
|
|
2018-07-28 23:27:34 +00:00
|
|
|
; wBattlePlayerAction
|
|
|
|
const_def
|
|
|
|
const BATTLEPLAYERACTION_USEMOVE
|
|
|
|
const BATTLEPLAYERACTION_USEITEM
|
|
|
|
const BATTLEPLAYERACTION_SWITCH
|
|
|
|
|
2017-12-09 05:50:59 +00:00
|
|
|
; wBattleResult
|
2015-11-06 14:04:27 +00:00
|
|
|
const_def
|
|
|
|
const WIN
|
|
|
|
const LOSE
|
|
|
|
const DRAW
|
2018-04-05 15:44:02 +00:00
|
|
|
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF BATTLERESULT_CAUGHT_CELEBI EQU 6
|
|
|
|
DEF BATTLERESULT_BOX_FULL EQU 7
|
|
|
|
DEF BATTLERESULT_BITMASK EQU (1 << BATTLERESULT_CAUGHT_CELEBI) | (1 << BATTLERESULT_BOX_FULL)
|
2021-03-22 20:41:17 +00:00
|
|
|
|
|
|
|
; link_battle_record struct
|
2022-06-06 21:25:42 +00:00
|
|
|
DEF LINK_BATTLE_RECORD_LENGTH EQU 2 + (NAME_LENGTH - 1) + 2 * 3
|
|
|
|
DEF NUM_LINK_BATTLE_RECORDS EQU 5
|