summaryrefslogtreecommitdiff
path: root/include/constants
diff options
context:
space:
mode:
Diffstat (limited to 'include/constants')
-rw-r--r--include/constants/battle.h52
-rw-r--r--include/constants/battle_anim.h5
-rw-r--r--include/constants/battle_pyramid.h3
-rw-r--r--include/constants/battle_script_commands.h79
-rw-r--r--include/constants/map_scripts.h4
-rw-r--r--include/constants/metatile_labels.h4
-rw-r--r--include/constants/pokemon.h6
-rw-r--r--include/constants/trainers.h3
8 files changed, 116 insertions, 40 deletions
diff --git a/include/constants/battle.h b/include/constants/battle.h
index f1ce757e7..2534ade4b 100644
--- a/include/constants/battle.h
+++ b/include/constants/battle.h
@@ -306,4 +306,56 @@
#define B_WAIT_TIME_MED 48
#define B_WAIT_TIME_SHORT 32
+#define CASTFORM_NORMAL 0
+#define CASTFORM_FIRE 1
+#define CASTFORM_WATER 2
+#define CASTFORM_ICE 3
+#define NUM_CASTFORM_FORMS 4
+#define CASTFORM_SUBSTITUTE (1 << 7)
+
+#define FLEE_ITEM 1
+#define FLEE_ABILITY 2
+
+#define B_WIN_TYPE_NORMAL 0
+#define B_WIN_TYPE_ARENA 1
+
+// Window Ids for gStandardBattleWindowTemplates / gBattleArenaWindowTemplates
+#define B_WIN_MSG 0
+#define B_WIN_ACTION_PROMPT 1 // "What will {x} do?"
+#define B_WIN_ACTION_MENU 2 // "Fight/Pokémon/Bag/Run" menu
+#define B_WIN_MOVE_NAME_1 3 // Top left
+#define B_WIN_MOVE_NAME_2 4 // Top right
+#define B_WIN_MOVE_NAME_3 5 // Bottom left
+#define B_WIN_MOVE_NAME_4 6 // Bottom right
+#define B_WIN_PP 7
+#define B_WIN_DUMMY 8
+#define B_WIN_PP_REMAINING 9
+#define B_WIN_MOVE_TYPE 10
+#define B_WIN_SWITCH_PROMPT 11 // "Switch which?"
+#define B_WIN_YESNO 12
+#define B_WIN_LEVEL_UP_BOX 13
+#define B_WIN_LEVEL_UP_BANNER 14
+#define B_WIN_VS_PLAYER 15
+#define B_WIN_VS_OPPONENT 16
+#define B_WIN_VS_MULTI_PLAYER_1 17
+#define B_WIN_VS_MULTI_PLAYER_2 18
+#define B_WIN_VS_MULTI_PLAYER_3 19
+#define B_WIN_VS_MULTI_PLAYER_4 20
+#define B_WIN_VS_OUTCOME_DRAW 21
+#define B_WIN_VS_OUTCOME_LEFT 22
+#define B_WIN_VS_OUTCOME_RIGHT 23
+
+// The following are duplicate id values for windows that Battle Arena uses differently.
+#define ARENA_WIN_PLAYER_NAME 15
+#define ARENA_WIN_VS 16
+#define ARENA_WIN_OPPONENT_NAME 17
+#define ARENA_WIN_MIND 18
+#define ARENA_WIN_SKILL 19
+#define ARENA_WIN_BODY 20
+#define ARENA_WIN_JUDGEMENT_TITLE 21
+#define ARENA_WIN_JUDGEMENT_TEXT 22
+
+// Flag for BattlePutTextOnWindow. Never set
+#define B_WIN_COPYTOVRAM (1 << 7)
+
#endif // GUARD_CONSTANTS_BATTLE_H
diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h
index 4622876cc..48de594e2 100644
--- a/include/constants/battle_anim.h
+++ b/include/constants/battle_anim.h
@@ -318,7 +318,7 @@
#define SOUND_PAN_TARGET 63
// move background ids
-#define BG_DARK_ 0 // the same as BG_DARK but is unused
+#define BG_NONE 0 // the same as BG_DARK but is unused
#define BG_DARK 1
#define BG_GHOST 2
#define BG_PSYCHIC 3
@@ -395,6 +395,9 @@
// Tasks with return values often assign them to gBattleAnimArgs[7].
#define ARG_RET_ID 7
+// For createsprite macro to use internally
+#define ANIMSPRITE_IS_TARGET (1 << 7)
+
// Trapping Wrap-like moves end turn animation.
#define TRAP_ANIM_BIND 0
#define TRAP_ANIM_WRAP 0
diff --git a/include/constants/battle_pyramid.h b/include/constants/battle_pyramid.h
index 1be3c1115..ebb753882 100644
--- a/include/constants/battle_pyramid.h
+++ b/include/constants/battle_pyramid.h
@@ -4,9 +4,6 @@
#define TOTAL_ROUNDS 20
#define PICKUP_ITEMS_PER_ROUND 10
-#define FLOOR_WALKABLE_METATILE 0x28D
-#define FLOOR_EXIT_METATILE 0x28E
-
#define HINT_EXIT_DIRECTION 0
#define HINT_REMAINING_ITEMS 1
#define HINT_REMAINING_TRAINERS 2
diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h
index d5e3eb7bb..83aacf316 100644
--- a/include/constants/battle_script_commands.h
+++ b/include/constants/battle_script_commands.h
@@ -1,38 +1,51 @@
#ifndef GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
#define GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
-// Battle Scripting and BattleCommunication addresses
-#define sPAINSPLIT_HP gBattleScripting
-#define sBIDE_DMG gBattleScripting + 4
-#define sMULTIHIT_STRING gBattleScripting + 8
-#define sDMG_MULTIPLIER gBattleScripting + 0xE
-#define sTWOTURN_STRINGID gBattleScripting + 0xF
-#define sB_ANIM_ARG1 gBattleScripting + 0x10
-#define sB_ANIM_ARG2 gBattleScripting + 0x11
-#define sTRIPLE_KICK_POWER gBattleScripting + 0x12
-#define sMOVEEND_STATE gBattleScripting + 0x14
-#define sBATTLER_WITH_ABILITY gBattleScripting + 0x15
-#define sMULTIHIT_EFFECT gBattleScripting + 0x16
-#define sBATTLER gBattleScripting + 0x17
-#define sB_ANIM_TURN gBattleScripting + 0x18
-#define sB_ANIM_TARGETS_HIT gBattleScripting + 0x19
-#define sSTATCHANGER gBattleScripting + 0x1A
-#define sSTAT_ANIM_PLAYED gBattleScripting + 0x1B
-#define sGIVEEXP_STATE gBattleScripting + 0x1C
-#define sBATTLE_STYLE gBattleScripting + 0x1D
-#define sLVLBOX_STATE gBattleScripting + 0x1E
-#define sLEARNMOVE_STATE gBattleScripting + 0x1F
-#define sFIELD_20 gBattleScripting + 0x20
-#define sRESHOW_MAIN_STATE gBattleScripting + 0x21
-#define sRESHOW_HELPER_STATE gBattleScripting + 0x22
-#define sFIELD_23 gBattleScripting + 0x23
-#define sWINDOWS_TYPE gBattleScripting + 0x24
-#define sMULTIPLAYER_ID gBattleScripting + 0x25
-#define sSPECIAL_TRAINER_BATTLE_TYPE gBattleScripting + 0x26
+// The following correspond to the struct members of BattleScripting by adding their offset
+#define sPAINSPLIT_HP (gBattleScripting + 0x00) // painSplitHp
+#define sBIDE_DMG (gBattleScripting + 0x04) // bideDmg
+#define sMULTIHIT_STRING (gBattleScripting + 0x08) // multihitString
+#define sDMG_MULTIPLIER (gBattleScripting + 0x0E) // dmgMultiplier
+#define sTWOTURN_STRINGID (gBattleScripting + 0x0F) // twoTurnsMoveStringId
+#define sB_ANIM_ARG1 (gBattleScripting + 0x10) // animArg1
+#define sB_ANIM_ARG2 (gBattleScripting + 0x11) // animArg2
+#define sTRIPLE_KICK_POWER (gBattleScripting + 0x12) // tripleKickPower
+#define sMOVEEND_STATE (gBattleScripting + 0x14) // moveendState
+#define sBATTLER_WITH_ABILITY (gBattleScripting + 0x15) // battlerWithAbility
+#define sMULTIHIT_EFFECT (gBattleScripting + 0x16) // multihitMoveEffect
+#define sBATTLER (gBattleScripting + 0x17) // battler
+#define sB_ANIM_TURN (gBattleScripting + 0x18) // animTurn
+#define sB_ANIM_TARGETS_HIT (gBattleScripting + 0x19) // animTargetsHit
+#define sSTATCHANGER (gBattleScripting + 0x1A) // statChanger
+#define sSTAT_ANIM_PLAYED (gBattleScripting + 0x1B) // statAnimPlayed
+#define sGIVEEXP_STATE (gBattleScripting + 0x1C) // getexpState
+#define sBATTLE_STYLE (gBattleScripting + 0x1D) // battleStyle
+#define sLVLBOX_STATE (gBattleScripting + 0x1E) // drawlvlupboxState
+#define sLEARNMOVE_STATE (gBattleScripting + 0x1F) // learnMoveState
+#define sPURSUIT_DOUBLES_ATTACKER (gBattleScripting + 0x20) // pursuitDoublesAttacker
+#define sRESHOW_MAIN_STATE (gBattleScripting + 0x21) // reshowMainState
+#define sRESHOW_HELPER_STATE (gBattleScripting + 0x22) // reshowHelperState
+#define sLVLUP_HP (gBattleScripting + 0x23) // levelUpHP
+#define sWINDOWS_TYPE (gBattleScripting + 0x24) // windowsType
+#define sMULTIPLAYER_ID (gBattleScripting + 0x25) // multiplayerId
+#define sSPECIAL_TRAINER_BATTLE_TYPE (gBattleScripting + 0x26) // specialTrainerBattleType
-#define cEFFECT_CHOOSER gBattleCommunication + 3
-#define cMULTISTRING_CHOOSER gBattleCommunication + 5
-#define cMISS_TYPE gBattleCommunication + 6
+// Array entries for battle communication
+#define MULTIUSE_STATE 0
+#define CURSOR_POSITION 1
+#define TASK_ID 1 // task Id and cursor position share the same field
+#define SPRITES_INIT_STATE1 1 // shares the Id as well
+#define SPRITES_INIT_STATE2 2
+#define MOVE_EFFECT_BYTE 3
+#define ACTIONS_CONFIRMED_COUNT 4
+#define MULTISTRING_CHOOSER 5
+#define MISS_TYPE 6
+#define MSG_DISPLAY 7
+#define BATTLE_COMMUNICATION_ENTRIES_COUNT 8
+
+#define cEFFECT_CHOOSER (gBattleCommunication + MOVE_EFFECT_BYTE)
+#define cMULTISTRING_CHOOSER (gBattleCommunication + MULTISTRING_CHOOSER)
+#define cMISS_TYPE (gBattleCommunication + MISS_TYPE)
// Battle Script defines for getting the wanted battler
#define BS_TARGET 0
@@ -40,8 +53,8 @@
#define BS_EFFECT_BATTLER 2
#define BS_FAINTED 3
#define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon
-#define BS_UNK_5 5
-#define BS_UNK_6 6
+#define BS_FAINTED_LINK_MULTIPLE_1 5
+#define BS_FAINTED_LINK_MULTIPLE_2 6
#define BS_BATTLER_0 7
#define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability
#define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability
diff --git a/include/constants/map_scripts.h b/include/constants/map_scripts.h
index 7a56cc908..c89df3948 100644
--- a/include/constants/map_scripts.h
+++ b/include/constants/map_scripts.h
@@ -13,14 +13,14 @@
Almost exclusively used to set metatiles on the map before it's first drawn
6. ON_FRAME_TABLE: Run every frame after the map has faded in, before player input is processed.
- This is a table of scripts that each run if their condition is satisfied.
+ This is a table of scripts; only the first script whose condition is satisfied is run.
Used to trigger an event, such as the player exiting the cable car or the SS Tidal sailor announcing progress
2. ON_TRANSITION: Run during the transition to the map
Used to set map-specific flags/vars, update object positions/movement types, set weather, etc
5. ON_WARP_INTO_MAP_TABLE: Run after the map's objects are loaded.
- This is a table of scripts that each run if their condition is satisfied.
+ This is a table of scripts; only the first script whose condition is satisfied is run.
Used to add objects to the scene or update something about the player as they warp in (e.g. their facing dir or visibility)
Note that ON_TRANSITION may also handle object visibility, but would do so by modifying a flag or var
diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h
index 6159bf6cb..b4ee3eacf 100644
--- a/include/constants/metatile_labels.h
+++ b/include/constants/metatile_labels.h
@@ -788,4 +788,8 @@
#define METATILE_SecretBase_SpikesMat_BottomMid 0x32A
#define METATILE_SecretBase_SpikesMat_BottomRight 0x32B
+// gTileset_BattlePyramid
+#define METATILE_BattlePyramid_Floor 0x28D
+#define METATILE_BattlePyramid_Exit 0x28E
+
#endif // GUARD_METATILE_LABELS_H
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index 9bafa0a0b..827725fc2 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -339,4 +339,10 @@
#define MON_PIC_SIZE (64 * 64 / 2)
+#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
+#define BATTLE_ALIVE_ATK_SIDE 1
+#define BATTLE_ALIVE_DEF_SIDE 2
+
+#define SKIP_FRONT_ANIM (1 << 7)
+
#endif // GUARD_CONSTANTS_POKEMON_H
diff --git a/include/constants/trainers.h b/include/constants/trainers.h
index 3f22c7cef..31bad25df 100644
--- a/include/constants/trainers.h
+++ b/include/constants/trainers.h
@@ -110,6 +110,7 @@
#define TRAINER_PIC_RS_BRENDAN 91
#define TRAINER_PIC_RS_MAY 92
+// The player back pics are assumed to alternate according to the gender values (MALE/FEMALE)
#define TRAINER_BACK_PIC_BRENDAN 0
#define TRAINER_BACK_PIC_MAY 1
#define TRAINER_BACK_PIC_RED 2
@@ -334,7 +335,7 @@
#define TRAINER_CLASS_SAILOR 0x2f
#define TRAINER_CLASS_COOLTRAINER_2 0x30 // Used for only one trainer.
#define TRAINER_CLASS_MAGMA_ADMIN 0x31
-#define TRAINER_CLASS_PKMN_TRAINER_3 0x32
+#define TRAINER_CLASS_RIVAL 0x32
#define TRAINER_CLASS_BUG_CATCHER 0x33
#define TRAINER_CLASS_PKMN_RANGER 0x34
#define TRAINER_CLASS_MAGMA_LEADER 0x35