diff options
Diffstat (limited to 'include/constants')
-rw-r--r-- | include/constants/battle.h | 52 | ||||
-rw-r--r-- | include/constants/battle_anim.h | 5 | ||||
-rw-r--r-- | include/constants/battle_script_commands.h | 79 |
3 files changed, 102 insertions, 34 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_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 |