diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-10-13 16:39:21 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-10-13 17:44:04 -0400 |
commit | def6cc8158c09f3458866f1fa5983e58022c4101 (patch) | |
tree | e37c8d4dd3add48cf6c3ea638b147b3cd27a126d /include | |
parent | fc15b0d5f0b9c6d004ca4c30c79557606a4b0eeb (diff) |
Label battle script macro arguments
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 20 | ||||
-rw-r--r-- | include/battle_script_commands.h | 1 | ||||
-rw-r--r-- | include/constants/battle_script_commands.h | 75 |
3 files changed, 48 insertions, 48 deletions
diff --git a/include/battle.h b/include/battle.h index 5a30bc90c..9434b9aa8 100644 --- a/include/battle.h +++ b/include/battle.h @@ -41,19 +41,6 @@ #define B_ACTION_NOTHING_FAINTED 13 // when choosing an action #define B_ACTION_NONE 0xFF -// 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 MOVE_TARGET_SELECTED 0 #define MOVE_TARGET_DEPENDS (1 << 0) #define MOVE_TARGET_USER_OR_SELECTED (1 << 1) @@ -487,6 +474,8 @@ struct BattleStruct #define SET_STATCHANGER(statId, stage, goesDown)(gBattleScripting.statChanger = (statId) + (stage << 4) + (goesDown << 7)) +// NOTE: The members of this struct have hard-coded offsets +// in include/constants/battle_script_commands.h struct BattleScripting { s32 painSplitHp; @@ -509,7 +498,7 @@ struct BattleScripting u8 battleStyle; u8 drawlvlupboxState; u8 learnMoveState; - u8 field_20; + u8 pursuitDoublesAttacker; u8 reshowMainState; u8 reshowHelperState; u8 levelUpHP; @@ -518,9 +507,6 @@ struct BattleScripting u8 specialTrainerBattleType; }; -// rom_80A5C6C - - struct BattleSpriteInfo { u16 invisible:1; // 0x1 diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index 90b6d80e8..cb81ad812 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -2,6 +2,7 @@ #define GUARD_BATTLE_SCRIPT_COMMANDS_H #include "constants/pokemon.h" +#include "constants/battle_script_commands.h" // Arguments for 'flags' in HandleBattleWindow #define WINDOW_CLEAR (1 << 0) diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index f3e11b4be..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 |