sovereignx/include/battle_script_commands.h

67 lines
2.6 KiB
C
Raw Permalink Normal View History

2017-10-06 16:06:45 +01:00
#ifndef GUARD_BATTLE_SCRIPT_COMMANDS_H
#define GUARD_BATTLE_SCRIPT_COMMANDS_H
2021-10-13 21:39:21 +01:00
#include "constants/battle_script_commands.h"
2020-07-17 01:12:12 +01:00
2021-10-08 21:50:52 +01: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 22:02:21 +00:00
struct StatFractions
{
u8 dividend;
u8 divisor;
};
2023-09-28 21:41:42 +01:00
struct PickupItem
{
u16 itemId;
u8 percentage[10];
};
2023-09-14 10:05:00 +01: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);
2024-06-09 20:30:49 +01:00
s32 GetCritHitOdds(s32 critChanceIndex);
2022-01-13 16:28:27 +00:00
u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u32 defAbility, u32 atkHoldEffect, u32 defHoldEffect);
2018-02-27 17:13:28 +00:00
u8 GetBattlerTurnOrderNum(u8 battlerId);
Added support for XY's Sky Battles (#2950) * Original implementation from Phlayne * Moved Sky Battle Flag / Var into a config * Optimized existing code and fixed existing bugs Added error message for when sky battle var and flag are not set Merged CanDoSkyBattle and PrepareSkyBattle into one special * Added compatibility for Gen7+ * Commented out Volt Crash from banned moves * Cleaned up debug scripts from testing * Fixed bug where player did not white out even if they had no healthy Pokémon and only an egg Zeroed out both Sky Battle configs * Removed extra include from src/field_specials.c Removed extra line break in src/battle_script_commands.c * Added FLAG_DISABLED_IN_SKY_BATTLE Added FLAG_DISABLED_IN_SKY_BATTLE to appropriate moves * Changed DoesSkyBattleCancelCurrentMove to look at move flags * Fixed alignment and spacing in battle_moves.h * Added FLAG_DISABLED_IN_SKY_BATTLE to Sticky Web * Added FLAG_DISABLED_IN_SKY_BATTLE to Steel Roller * Disabled the ability to change Battle Terrain when Sky Battle is happening Stopped Ceaseless Edge from spawning Spikes when Sky Battle is happening Added B_SKY_BATTLE_STRICT_MECHANICS config * Fixed bug with SKY_BATTLE_STRICT_MECHANICS where conditions were not consistently being applied * Add rulesVariants to the BattleStruct Added skyBattle check in AllocateBattleResources * Replaced B_FLAG_SKY_BATTLE checks with rulesVariants.skyBattle checks * Fixed debug script * Reverted include/config/battle.h * Fixed spacing and placement of functions * Fixed debug script omission Fixed bug where Spikes did not set from Ceaseless Edge and Stone Axe * Added FLAG_DISABLED_IN_SKY_BATTLE to Psychic Terrain * Addressed DizzyEgg PR feedback * Forgot a file in last commit * Addressed feedback from DizzyEggg * Address Lunos' PR feedback * Update specials.inc Added an empty line at the end of data/specials.inc * Fixed spacing * Apply suggestions from code review Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Updated skyBattleBanned and HandleBattleVariantEndParty to use correct names * Removed STRICT_MOVES and STRICT_MECHANICS * Fixed minor spacing issues with merge * Merged in upcoming * Implemented feedback from Jasper https://github.com/rh-hideout/pokeemerald-expansion/pull/2950/files/5da6117d1bc725900c6386e62ab719f8e1695027 --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-11-26 15:59:44 +00:00
bool32 NoAliveMonsForPlayer(void);
2019-08-22 14:57:33 +01:00
bool32 NoAliveMonsForEitherParty(void);
void SetMoveEffect(bool32 primary, bool32 certain);
bool32 CanBattlerSwitch(u32 battlerId);
void BattleDestroyYesNoCursorAt(u8 cursorPosition);
void BattleCreateYesNoCursorAt(u8 cursorPosition);
2017-10-06 16:06:45 +01:00
void BufferMoveToLearnIntoBattleTextBuff2(void);
void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags);
2018-02-27 17:13:28 +00:00
bool8 UproarWakeUpCheck(u8 battlerId);
bool32 DoesSubstituteBlockMove(u32 battlerAtk, u32 battlerDef, u32 move);
bool32 DoesDisguiseBlockMove(u32 battler, u32 move);
bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget);
bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget);
2018-12-02 22:50:51 +00:00
bool32 CanUseLastResort(u8 battlerId);
u32 IsFlowerVeilProtected(u32 battler);
2019-12-16 08:29:20 +00:00
u32 IsLeafGuardProtected(u32 battler);
2020-04-19 20:18:39 +01:00
bool32 IsShieldsDownProtected(u32 battler);
u32 IsAbilityStatusProtected(u32 battler);
bool32 TryResetBattlerStatChanges(u8 battler);
2020-12-13 22:02:21 +00:00
bool32 CanCamouflage(u8 battlerId);
Gimmick Refactor (#4449) * consolidated gimmick checks, triggers, communication, and activation; updated test runner * fixed improper use of .usableGimmick * cleaning up battle_dynamax.c, changing function args to u32s * fixed '#ifdef TESTING' causing errors * updated z-moves to use gimmick interface, pared down redundancies; no AI/tests * added support for z-moves in tests, consolidated gimmick fields * removed ShouldUseMaxMove and .usingMaxMove * renamed TryChangeZIndicator, updated z move display * added several z-move tests and fixed various z-move interactions; fixed z-move category calc * fixed useless battler arg in GetTypeBasedZMove * added basic test check for bad Z-Move or Mega usage * reworked test runner gimmick functionality; added support for Ultra Burst + Z-Move to test Light That Burns the Sky * fixed gimmick test logic; fixed damage category override * fixed mega rayquaza test fail * consolidated gimmick indicator logic; added graphics to gGimmicksInfo * removed TeraData struct * reimplemented AI logic for Z-Moves; no changes * updated Z-Move and Ultra Burst trigger gfx * added testrunner check for multiple gimmick use * fixed duplicate z-move call in test * reorganized data/graphics/gimmicks.h * added signature Z-Move ability tests; implemented Guardian of Alola * fixed bad test update * fixed Thousand Arrows not affecting Tera Flying; clean-up * fixed -ate tests * fixed tera tests * fixed tera tests really * fixed last batch of tests * fixed -ate mega test again * code review * code review pt.2 * tweaked CanTera again * dynamax flag only required for player
2024-06-22 21:25:40 +01:00
u32 GetNaturePowerMove(u32 battler);
void StealTargetItem(u8 battlerStealer, u8 battlerItem);
2021-10-15 21:06:50 +01:00
u8 GetCatchingBattler(void);
u32 GetHighestStatId(u32 battlerId);
bool32 ProteanTryChangeType(u32 battler, u32 ability, u32 move, u32 moveType);
bool32 ShouldTeraShellDistortTypeMatchups(u32 move, u32 battlerDef);
Added support for XY's Sky Battles (#2950) * Original implementation from Phlayne * Moved Sky Battle Flag / Var into a config * Optimized existing code and fixed existing bugs Added error message for when sky battle var and flag are not set Merged CanDoSkyBattle and PrepareSkyBattle into one special * Added compatibility for Gen7+ * Commented out Volt Crash from banned moves * Cleaned up debug scripts from testing * Fixed bug where player did not white out even if they had no healthy Pokémon and only an egg Zeroed out both Sky Battle configs * Removed extra include from src/field_specials.c Removed extra line break in src/battle_script_commands.c * Added FLAG_DISABLED_IN_SKY_BATTLE Added FLAG_DISABLED_IN_SKY_BATTLE to appropriate moves * Changed DoesSkyBattleCancelCurrentMove to look at move flags * Fixed alignment and spacing in battle_moves.h * Added FLAG_DISABLED_IN_SKY_BATTLE to Sticky Web * Added FLAG_DISABLED_IN_SKY_BATTLE to Steel Roller * Disabled the ability to change Battle Terrain when Sky Battle is happening Stopped Ceaseless Edge from spawning Spikes when Sky Battle is happening Added B_SKY_BATTLE_STRICT_MECHANICS config * Fixed bug with SKY_BATTLE_STRICT_MECHANICS where conditions were not consistently being applied * Add rulesVariants to the BattleStruct Added skyBattle check in AllocateBattleResources * Replaced B_FLAG_SKY_BATTLE checks with rulesVariants.skyBattle checks * Fixed debug script * Reverted include/config/battle.h * Fixed spacing and placement of functions * Fixed debug script omission Fixed bug where Spikes did not set from Ceaseless Edge and Stone Axe * Added FLAG_DISABLED_IN_SKY_BATTLE to Psychic Terrain * Addressed DizzyEgg PR feedback * Forgot a file in last commit * Addressed feedback from DizzyEggg * Address Lunos' PR feedback * Update specials.inc Added an empty line at the end of data/specials.inc * Fixed spacing * Apply suggestions from code review Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com> * Updated skyBattleBanned and HandleBattleVariantEndParty to use correct names * Removed STRICT_MOVES and STRICT_MECHANICS * Fixed minor spacing issues with merge * Merged in upcoming * Implemented feedback from Jasper https://github.com/rh-hideout/pokeemerald-expansion/pull/2950/files/5da6117d1bc725900c6386e62ab719f8e1695027 --------- Co-authored-by: Eduardo Quezada D'Ottone <eduardo602002@gmail.com>
2023-11-26 15:59:44 +00:00
bool32 IsMoveNotAllowedInSkyBattles(u32 move);
bool32 DoSwitchInAbilities(u32 battlerId);
u8 GetFirstFaintedPartyIndex(u8 battlerId);
2023-09-13 08:27:49 +01:00
bool32 IsMoveAffectedByParentalBond(u32 move, u32 battler);
void SaveBattlerTarget(u32 battler);
void SaveBattlerAttacker(u32 battler);
2017-10-06 16:06:45 +01:00
extern void (* const gBattleScriptingCommandsTable[])(void);
2020-12-13 22:02:21 +00:00
extern const struct StatFractions gAccuracyStageRatios[];
2017-10-06 16:06:45 +01:00
#endif // GUARD_BATTLE_SCRIPT_COMMANDS_H