sovereignx/include/battle_interface.h

133 lines
4.6 KiB
C
Raw Normal View History

2017-10-09 17:18:40 +01:00
#ifndef GUARD_BATTLE_INTERFACE_H
#define GUARD_BATTLE_INTERFACE_H
2018-12-16 17:35:10 +00:00
#include "battle_controllers.h"
enum
{
HP_CURRENT,
2022-08-25 15:40:56 +01:00
HP_MAX,
HP_BOTH
};
2017-10-22 17:43:15 +01:00
enum
{
HEALTH_BAR,
EXP_BAR
};
2017-11-04 15:11:13 +00:00
enum
{
HP_BAR_EMPTY,
HP_BAR_RED,
HP_BAR_YELLOW,
HP_BAR_GREEN,
HP_BAR_FULL,
};
2017-10-19 17:25:48 +01:00
#define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF
#define TAG_HEALTHBOX_PLAYER2_TILE 0xD700
#define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701
#define TAG_HEALTHBOX_OPPONENT2_TILE 0xD702
2018-06-18 23:43:15 +01:00
#define TAG_HEALTHBAR_PLAYER1_TILE 0xD704
#define TAG_HEALTHBAR_OPPONENT1_TILE 0xD705
#define TAG_HEALTHBAR_PLAYER2_TILE 0xD706
#define TAG_HEALTHBAR_OPPONENT2_TILE 0xD707
2022-08-17 16:44:20 +01:00
#define TAG_HEALTHBOX_PALS_1 0xD709
#define TAG_HEALTHBOX_PALS_2 0xD70A
2017-10-19 17:25:48 +01:00
#define TAG_HEALTHBOX_SAFARI_TILE 0xD70B
#define TAG_STATUS_SUMMARY_BAR_TILE 0xD70C
#define TAG_STATUS_SUMMARY_BAR_PAL 0xD710
#define TAG_STATUS_SUMMARY_BALLS_PAL 0xD712
#define TAG_STATUS_SUMMARY_BALLS_TILE 0xD714
2022-08-17 16:44:20 +01:00
#define TAG_HEALTHBAR_PAL TAG_HEALTHBAR_PLAYER1_TILE
#define TAG_HEALTHBOX_PAL TAG_HEALTHBOX_PLAYER1_TILE
#define TAG_SHADOW_PAL TAG_HEALTHBOX_PLAYER1_TILE
#define TAG_SHADOW_TILE 0xD759
2022-08-17 16:44:20 +01:00
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
#define TAG_GIMMICK_TRIGGER_TILE 0xD777
2019-05-02 22:10:01 +01:00
#define TAG_MEGA_INDICATOR_TILE 0xD778
2021-08-25 07:35:21 +01:00
#define TAG_ALPHA_INDICATOR_TILE 0xD779
#define TAG_OMEGA_INDICATOR_TILE 0xD77A
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
#define TAG_DYNAMAX_INDICATOR_TILE 0xD77B
#define TAG_NORMAL_INDICATOR_TILE 0xD77C
#define TAG_FIGHTING_INDICATOR_TILE 0xD77D
#define TAG_FLYING_INDICATOR_TILE 0xD77E
#define TAG_POISON_INDICATOR_TILE 0xD77F
#define TAG_GROUND_INDICATOR_TILE 0xD780
#define TAG_ROCK_INDICATOR_TILE 0xD781
#define TAG_BUG_INDICATOR_TILE 0xD782
#define TAG_GHOST_INDICATOR_TILE 0xD783
#define TAG_STEEL_INDICATOR_TILE 0xD784
// empty spot for TYPE_MYSTERY
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
#define TAG_FIRE_INDICATOR_TILE 0xD786
#define TAG_WATER_INDICATOR_TILE 0xD787
#define TAG_GRASS_INDICATOR_TILE 0xD788
#define TAG_ELECTRIC_INDICATOR_TILE 0xD789
#define TAG_PSYCHIC_INDICATOR_TILE 0xD78A
#define TAG_ICE_INDICATOR_TILE 0xD78B
#define TAG_DRAGON_INDICATOR_TILE 0xD78C
#define TAG_DARK_INDICATOR_TILE 0xD78D
#define TAG_FAIRY_INDICATOR_TILE 0xD78E
#define TAG_STELLAR_INDICATOR_TILE 0xD78F
#define TAG_TERA_TRIGGER_TILE 0xD790
#define TAG_GIMMICK_TRIGGER_PAL 0xD777
2021-08-25 07:35:21 +01:00
#define TAG_MEGA_INDICATOR_PAL 0xD778
2023-03-11 18:48:21 +00:00
#define TAG_MISC_INDICATOR_PAL 0xD779 // Alpha, Omega, and Dynamax indicators use the same palette as each of them only uses 4 different colors.
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
#define TAG_TERA_INDICATOR_PAL 0xD77A
2018-09-17 21:40:49 +01:00
2017-10-09 17:18:40 +01:00
enum
{
HEALTHBOX_ALL,
HEALTHBOX_CURRENT_HP,
HEALTHBOX_MAX_HP,
HEALTHBOX_LEVEL,
HEALTHBOX_NICK,
HEALTHBOX_HEALTH_BAR,
HEALTHBOX_EXP_BAR,
2017-10-18 22:52:21 +01:00
HEALTHBOX_UNUSED_7,
HEALTHBOX_UNUSED_8,
2017-10-09 17:18:40 +01:00
HEALTHBOX_STATUS_ICON,
HEALTHBOX_SAFARI_ALL_TEXT,
HEALTHBOX_SAFARI_BALLS_TEXT
};
u32 WhichBattleCoords(u32 battlerId);
2018-09-01 17:36:08 +01:00
u8 CreateBattlerHealthboxSprites(u8 battler);
2017-10-09 17:18:40 +01:00
u8 CreateSafariPlayerHealthboxSprites(void);
2018-09-01 17:36:08 +01:00
void SetBattleBarStruct(u8 battler, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue);
2017-10-09 17:18:40 +01:00
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId);
2017-10-19 14:28:41 +01:00
void SetHealthboxSpriteVisible(u8 healthboxSpriteId);
2017-10-19 17:25:48 +01:00
void DummyBattleInterfaceFunc(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly);
2021-02-03 06:30:08 +00:00
void UpdateOamPriorityInAllHealthboxes(u8 priority, bool32 hideHpBoxes);
2018-09-01 17:36:08 +01:00
void InitBattlerHealthboxCoords(u8 battler);
void GetBattlerHealthboxCoords(u8 battler, s16 *x, s16 *y);
2022-08-25 15:40:56 +01:00
void UpdateHpTextInHealthbox(u32 healthboxSpriteId, u32 maxOrCurrent, s16 currHp, s16 maxHp);
2017-10-19 14:28:41 +01:00
void SwapHpBarsWithHpText(void);
2022-06-01 17:41:57 +01:00
u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart);
2018-06-28 20:06:32 +01:00
void Task_HidePartyStatusSummary(u8 taskId);
2017-10-19 14:28:41 +01:00
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
2022-05-21 20:21:50 +01:00
s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 unused);
2017-10-19 14:28:41 +01:00
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
u8 GetHPBarLevel(s16 hp, s16 maxhp);
2018-09-29 11:47:35 +01:00
void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle);
void DestroyAbilityPopUp(u8 battlerId);
2021-06-25 20:37:59 +01:00
bool32 CanThrowLastUsedBall(void);
void TryHideLastUsedBall(void);
void TryRestoreLastUsedBall(void);
void TryAddLastUsedBallItemSprites(void);
void SwapBallToDisplay(bool32 sameBall);
void ArrowsChangeColorLastBallCycle(bool32 showArrows);
2021-10-12 15:32:51 +01:00
void UpdateAbilityPopup(u8 battlerId);
void CategoryIcons_LoadSpritesGfx(void);
2017-10-09 17:18:40 +01:00
#endif // GUARD_BATTLE_INTERFACE_H