pokeemerald/include/battle_script_commands.h

58 lines
2.4 KiB
C
Raw Normal View History

2017-10-06 17:06:45 +02:00
#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
#define GUARD_BATTLE_SCRIPT_COMMANDS_H
2021-10-13 22:39:21 +02:00
#include "constants/battle_script_commands.h"
2020-07-17 02:12:12 +02:00
2021-10-08 22:50:52 +02:00
// Arguments for 'flags' in HandleBattleWindow
#define WINDOW_CLEAR (1 << 0)
#define WINDOW_BG1 (1 << 7)
// Arguments for 'xStart, yStart, xEnd, yEnd' in HandleBattleWindow
#define YESNOBOX_X_Y 24, 8, 29, 13
2020-12-13 23:02:21 +01:00
struct StatFractions
{
u8 dividend;
u8 divisor;
};
2023-09-14 11:05:00 +02:00
s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordAbility, u32 abilityAtk, u32 abilityDef, u32 holdEffectAtk);
s32 CalcCritChanceStage(u32 battlerAtk, u32 battlerDef, u32 move, bool32 recordAbility);
2023-09-14 11:05:00 +02:00
s32 GetCritHitChance(s32 critChanceIndex);
2022-01-13 17:28:27 +01:00
u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect);
2018-02-27 18:13:28 +01:00
u8 GetBattlerTurnOrderNum(u8 battlerId);
2019-08-22 15:57:33 +02:00
bool32 NoAliveMonsForEitherParty(void);
2019-02-14 13:17:27 +01:00
void SetMoveEffect(bool32 primary, u32 certain);
bool32 CanBattlerSwitch(u32 battlerId);
void BattleDestroyYesNoCursorAt(u8 cursorPosition);
void BattleCreateYesNoCursorAt(u8 cursorPosition);
2017-10-06 17:06:45 +02:00
void BufferMoveToLearnIntoBattleTextBuff2(void);
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
2018-02-27 18:13:28 +01:00
bool8 UproarWakeUpCheck(u8 battlerId);
bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move);
bool32 DoesDisguiseBlockMove(u32 battlerAtk, u32 battlerDef, u32 move);
bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget);
bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget);
2018-12-02 23:50:51 +01:00
bool32 CanUseLastResort(u8 battlerId);
u32 IsFlowerVeilProtected(u32 battler);
2019-12-16 09:29:20 +01:00
u32 IsLeafGuardProtected(u32 battler);
2020-04-19 21:18:39 +02:00
bool32 IsShieldsDownProtected(u32 battler);
u32 IsAbilityStatusProtected(u32 battler);
bool32 TryResetBattlerStatChanges(u8 battler);
2020-12-13 23:02:21 +01:00
bool32 CanCamouflage(u8 battlerId);
u16 GetNaturePowerMove(void);
u16 GetSecretPowerMoveEffect(void);
void StealTargetItem(u8 battlerStealer, u8 battlerItem);
2021-10-15 22:06:50 +02:00
u8 GetCatchingBattler(void);
u32 GetHighestStatId(u32 battlerId);
bool32 ProteanTryChangeType(u32 battler, u32 ability, u32 move, u32 moveType);
bool32 DoSwitchInAbilitiesItems(u32 battlerId);
u8 GetFirstFaintedPartyIndex(u8 battlerId);
2023-09-13 09:27:49 +02:00
bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler);
2017-10-06 17:06:45 +02:00
extern void (* const gBattleScriptingCommandsTable[])(void);
2020-07-17 02:12:12 +02:00
extern const u8 gBattlePalaceNatureToMoveGroupLikelihood[NUM_NATURES][4];
2020-12-13 23:02:21 +01:00
extern const struct StatFractions gAccuracyStageRatios[];
2017-10-06 17:06:45 +02:00
#endif // GUARD_BATTLE_SCRIPT_COMMANDS_H