2017-10-06 15:06:45 +00:00
|
|
|
#ifndef GUARD_BATTLE_UTIL_H
|
|
|
|
#define GUARD_BATTLE_UTIL_H
|
|
|
|
|
|
|
|
#define MOVE_LIMITATION_ZEROMOVE (1 << 0)
|
|
|
|
#define MOVE_LIMITATION_PP (1 << 1)
|
|
|
|
#define MOVE_LIMITATION_DISABLED (1 << 2)
|
|
|
|
#define MOVE_LIMITATION_TORMENTED (1 << 3)
|
|
|
|
#define MOVE_LIMITATION_TAUNT (1 << 4)
|
|
|
|
#define MOVE_LIMITATION_IMPRISION (1 << 5)
|
|
|
|
|
2018-07-01 09:15:42 +00:00
|
|
|
#define ABILITYEFFECT_ON_SWITCHIN 0x0
|
|
|
|
#define ABILITYEFFECT_ENDTURN 0x1
|
|
|
|
#define ABILITYEFFECT_MOVES_BLOCK 0x2
|
|
|
|
#define ABILITYEFFECT_ABSORBING 0x3
|
|
|
|
#define ABILITYEFFECT_CONTACT 0x4
|
|
|
|
#define ABILITYEFFECT_IMMUNITY 0x5
|
|
|
|
#define ABILITYEFFECT_FORECAST 0x6
|
|
|
|
#define ABILITYEFFECT_SYNCHRONIZE 0x7
|
|
|
|
#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8
|
|
|
|
#define ABILITYEFFECT_INTIMIDATE1 0x9
|
|
|
|
#define ABILITYEFFECT_INTIMIDATE2 0xA
|
|
|
|
#define ABILITYEFFECT_TRACE 0xB
|
|
|
|
#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC
|
|
|
|
#define ABILITYEFFECT_CHECK_BATTLER_SIDE 0xD
|
|
|
|
#define ABILITYEFFECT_FIELD_SPORT 0xE
|
|
|
|
#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER 0xF
|
|
|
|
#define ABILITYEFFECT_COUNT_OTHER_SIDE 0x10
|
|
|
|
#define ABILITYEFFECT_COUNT_BATTLER_SIDE 0x11
|
|
|
|
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
|
|
|
|
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
|
|
|
|
#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF
|
2017-10-06 15:06:45 +00:00
|
|
|
|
2018-06-17 14:48:58 +00:00
|
|
|
#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0))
|
|
|
|
#define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0))
|
|
|
|
#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0))
|
|
|
|
|
2017-10-06 15:06:45 +00:00
|
|
|
#define ITEMEFFECT_ON_SWITCH_IN 0x0
|
|
|
|
|
2018-06-17 14:48:58 +00:00
|
|
|
#define WEATHER_HAS_EFFECT ((!ABILITY_ON_FIELD(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD(ABILITY_AIR_LOCK)))
|
|
|
|
#define WEATHER_HAS_EFFECT2 ((!ABILITY_ON_FIELD2(ABILITY_CLOUD_NINE) && !ABILITY_ON_FIELD2(ABILITY_AIR_LOCK)))
|
2017-10-06 15:06:45 +00:00
|
|
|
|
2018-02-08 10:17:41 +00:00
|
|
|
u8 GetBattlerForBattleScript(u8 caseId);
|
2017-10-06 15:06:45 +00:00
|
|
|
void PressurePPLose(u8 bankDef, u8 bankAtk, u16 move);
|
|
|
|
void PressurePPLoseOnUsingPerishSong(u8 bankAtk);
|
|
|
|
void PressurePPLoseOnUsingImprision(u8 bankAtk);
|
2018-02-06 19:48:02 +00:00
|
|
|
void MarkAllBattlersForControllerExec(void); // unused
|
2018-02-28 23:59:52 +00:00
|
|
|
void MarkBattlerForControllerExec(u8 battlerId);
|
2017-10-06 15:06:45 +00:00
|
|
|
void sub_803F850(u8 arg0);
|
2018-02-28 23:59:52 +00:00
|
|
|
void CancelMultiTurnMoves(u8 battlerId);
|
|
|
|
bool8 WasUnableToUseMove(u8 battlerId);
|
|
|
|
void PrepareStringBattle(u16 stringId, u8 battlerId);
|
2017-10-06 15:06:45 +00:00
|
|
|
void ResetSentPokesToOpponentValue(void);
|
2018-02-28 23:59:52 +00:00
|
|
|
void sub_803F9EC(u8 battlerId);
|
|
|
|
void sub_803FA70(u8 battlerId);
|
2017-10-06 15:06:45 +00:00
|
|
|
void BattleScriptPush(const u8* bsPtr);
|
|
|
|
void BattleScriptPushCursor(void);
|
|
|
|
void BattleScriptPop(void);
|
|
|
|
u8 TrySetCantSelectMoveBattleScript(void);
|
2018-02-28 23:59:52 +00:00
|
|
|
u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check);
|
2017-10-06 15:06:45 +00:00
|
|
|
bool8 AreAllMovesUnusable(void);
|
2018-02-28 23:59:52 +00:00
|
|
|
u8 GetImprisonedMovesCount(u8 battlerId, u16 move);
|
2017-10-06 15:06:45 +00:00
|
|
|
u8 UpdateTurnCounters(void);
|
|
|
|
u8 TurnBasedEffects(void);
|
2017-12-02 13:08:55 +00:00
|
|
|
bool8 HandleWishPerishSongOnTurnEnd(void);
|
|
|
|
bool8 HandleFaintedMonActions(void);
|
2017-10-06 15:06:45 +00:00
|
|
|
void TryClearRageStatuses(void);
|
|
|
|
u8 AtkCanceller_UnableToUseMove(void);
|
2018-07-01 09:15:42 +00:00
|
|
|
bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2);
|
2018-02-28 23:59:52 +00:00
|
|
|
u8 CastformDataTypeChange(u8 battlerId);
|
|
|
|
u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u8 ability, u8 special, u16 moveArg);
|
2017-10-06 15:06:45 +00:00
|
|
|
void BattleScriptExecute(const u8* BS_ptr);
|
|
|
|
void BattleScriptPushCursorAndCallback(const u8* BS_ptr);
|
2018-02-28 23:59:52 +00:00
|
|
|
u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn);
|
|
|
|
void ClearFuryCutterDestinyBondGrudge(u8 battlerId);
|
2017-10-06 15:06:45 +00:00
|
|
|
void HandleAction_RunBattleScript(void);
|
2018-02-28 23:59:52 +00:00
|
|
|
u8 GetMoveTarget(u16 move, u8 setTarget);
|
2017-12-02 13:08:55 +00:00
|
|
|
u8 IsMonDisobedient(void);
|
2017-10-06 15:06:45 +00:00
|
|
|
|
|
|
|
#endif // GUARD_BATTLE_UTIL_H
|