pokeemerald/include/constants/battle_script_commands.h

160 lines
7.6 KiB
C
Raw Normal View History

2018-02-08 11:17:41 +01:00
#ifndef GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
#define GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H
2021-10-13 22:39:21 +02:00
// 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
2018-02-08 11:17:41 +01:00
2021-10-13 22:39:21 +02:00
// 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)
2018-02-08 11:17:41 +01:00
// Battle Script defines for getting the wanted battler
#define BS_TARGET 0
#define BS_ATTACKER 1
#define BS_EFFECT_BATTLER 2
#define BS_FAINTED 3
2019-09-27 08:46:33 +02:00
#define BS_ATTACKER_WITH_PARTNER 4 // for Cmd_updatestatusicon
#define BS_FAINTED_LINK_MULTIPLE_1 5 // for openpartyscreen
#define BS_FAINTED_LINK_MULTIPLE_2 6 // for openpartyscreen
2021-04-03 18:38:07 +02:00
#define BS_BATTLER_0 7
2019-09-15 23:58:12 +02:00
#define BS_ATTACKER_SIDE 8 // for Cmd_jumpifability
#define BS_NOT_ATTACKER_SIDE 9 // for Cmd_jumpifability
2018-02-08 11:17:41 +01:00
#define BS_SCRIPTING 10
#define BS_PLAYER1 11
#define BS_OPPONENT1 12
#define BS_PLAYER2 13 // for Cmd_updatestatusicon
2018-02-08 11:17:41 +01:00
#define BS_OPPONENT2 14
2019-09-27 08:46:33 +02:00
// Cmd_accuracycheck
2018-02-08 11:17:41 +01:00
#define NO_ACC_CALC 0xFFFE
#define NO_ACC_CALC_CHECK_LOCK_ON 0xFFFF
#define ACC_CURR_MOVE 0
// compare operands
2021-04-03 18:38:07 +02:00
#define CMP_EQUAL 0
#define CMP_NOT_EQUAL 1
#define CMP_GREATER_THAN 2
#define CMP_LESS_THAN 3
#define CMP_COMMON_BITS 4
#define CMP_NO_COMMON_BITS 5
2018-02-08 11:17:41 +01:00
2019-09-27 08:46:33 +02:00
// Cmd_various
2018-02-08 11:17:41 +01:00
#define VARIOUS_CANCEL_MULTI_TURN_MOVES 0
#define VARIOUS_SET_MAGIC_COAT_TARGET 1
#define VARIOUS_IS_RUNNING_IMPOSSIBLE 2
#define VARIOUS_GET_MOVE_TARGET 3
2020-07-17 02:12:12 +02:00
#define VARIOUS_GET_BATTLER_FAINTED 4
2018-02-08 11:17:41 +01:00
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
2021-09-24 20:30:15 +02:00
#define VARIOUS_RESET_PLAYER_FAINTED 7
2020-07-17 02:12:12 +02:00
#define VARIOUS_PALACE_FLAVOR_TEXT 8
2018-11-11 18:33:16 +01:00
#define VARIOUS_ARENA_JUDGMENT_WINDOW 9
#define VARIOUS_ARENA_OPPONENT_MON_LOST 10
#define VARIOUS_ARENA_PLAYER_MON_LOST 11
#define VARIOUS_ARENA_BOTH_MONS_LOST 12
2018-02-08 11:17:41 +01:00
#define VARIOUS_EMIT_YESNOBOX 13
2021-09-24 20:30:15 +02:00
#define VARIOUS_DRAW_ARENA_REF_TEXT_BOX 14
#define VARIOUS_ERASE_ARENA_REF_TEXT_BOX 15
2018-11-11 18:33:16 +01:00
#define VARIOUS_ARENA_JUDGMENT_STRING 16
#define VARIOUS_ARENA_WAIT_STRING 17
2018-02-08 11:17:41 +01:00
#define VARIOUS_WAIT_CRY 18
#define VARIOUS_RETURN_OPPONENT_MON1 19
#define VARIOUS_RETURN_OPPONENT_MON2 20
2018-08-25 21:04:12 +02:00
#define VARIOUS_VOLUME_DOWN 21
#define VARIOUS_VOLUME_UP 22
2018-11-11 18:33:16 +01:00
#define VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT 23
2021-09-24 20:30:15 +02:00
#define VARIOUS_PALACE_TRY_ESCAPE_STATUS 24
2018-02-08 11:17:41 +01:00
#define VARIOUS_SET_TELEPORT_OUTCOME 25
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
2019-09-27 08:46:33 +02:00
// Cmd_manipulatedmg
2019-09-15 23:58:12 +02:00
#define DMG_CHANGE_SIGN 0
#define DMG_RECOIL_FROM_MISS 1
#define DMG_DOUBLED 2
2018-02-08 11:17:41 +01:00
2019-09-27 08:46:33 +02:00
// Cmd_jumpifcantswitch
2021-04-03 18:38:07 +02:00
#define SWITCH_IGNORE_ESCAPE_PREVENTION (1 << 7)
2018-02-08 11:17:41 +01:00
2019-09-27 08:46:33 +02:00
// Cmd_statbuffchange
#define STAT_CHANGE_ALLOW_PTR (1 << 0) // If set, allow use of jumpptr. Set in every use of statbuffchange
#define STAT_CHANGE_NOT_PROTECT_AFFECTED (1 << 5)
2018-02-08 11:17:41 +01:00
2019-09-27 08:46:33 +02:00
// stat change flags for Cmd_playstatchangeanimation
2021-04-03 18:38:07 +02:00
#define STAT_CHANGE_NEGATIVE (1 << 0)
#define STAT_CHANGE_BY_TWO (1 << 1)
#define STAT_CHANGE_MULTIPLE_STATS (1 << 2)
#define STAT_CHANGE_CANT_PREVENT (1 << 3)
2018-02-08 11:17:41 +01:00
2019-09-27 08:46:33 +02:00
// stat flags for Cmd_playstatchangeanimation
2021-04-03 18:38:07 +02:00
#define BIT_HP (1 << 0)
#define BIT_ATK (1 << 1)
#define BIT_DEF (1 << 2)
#define BIT_SPEED (1 << 3)
#define BIT_SPATK (1 << 4)
#define BIT_SPDEF (1 << 5)
#define BIT_ACC (1 << 6)
#define BIT_EVASION (1 << 7)
#define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen
2019-09-27 08:46:33 +02:00
// cases for Cmd_moveend
2019-08-23 14:46:21 +02:00
#define MOVEEND_RAGE 0
#define MOVEEND_DEFROST 1
#define MOVEEND_SYNCHRONIZE_TARGET 2
2019-09-27 18:27:36 +02:00
#define MOVEEND_ON_DAMAGE_ABILITIES 3
2019-09-15 23:58:12 +02:00
#define MOVEEND_IMMUNITY_ABILITIES 4
2019-08-23 14:46:21 +02:00
#define MOVEEND_SYNCHRONIZE_ATTACKER 5
#define MOVEEND_CHOICE_MOVE 6
#define MOVEEND_CHANGED_ITEMS 7
#define MOVEEND_ATTACKER_INVISIBLE 8
#define MOVEEND_ATTACKER_VISIBLE 9
#define MOVEEND_TARGET_VISIBLE 10
#define MOVEEND_ITEM_EFFECTS_ALL 11
#define MOVEEND_KINGSROCK_SHELLBELL 12
#define MOVEEND_SUBSTITUTE 13
#define MOVEEND_UPDATE_LAST_MOVES 14
#define MOVEEND_MIRROR_MOVE 15
#define MOVEEND_NEXT_TARGET 16
#define MOVEEND_COUNT 17
2019-03-30 12:37:18 +01:00
2018-02-08 11:17:41 +01:00
#endif // GUARD_CONSTANTS_BATTLE_SCRIPT_COMMANDS_H