-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from lhearachel/healthbars
Start documenting healthbar.c
- Loading branch information
Showing
276 changed files
with
3,626 additions
and
3,271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
#ifndef POKEPLATINUM_OV16_02266F1C_H | ||
#define POKEPLATINUM_OV16_02266F1C_H | ||
|
||
#include "struct_decls/struct_02002F38_decl.h" | ||
#include "struct_decls/struct_02006C24_decl.h" | ||
#include "struct_decls/struct_0200C6E4_decl.h" | ||
#include "struct_decls/struct_0200C704_decl.h" | ||
#include "struct_decls/cell_actor_data.h" | ||
#include "overlay016/struct_ov16_022674C4.h" | ||
|
||
#define HEALTHBAR_INFO_NONE 0 | ||
#define HEALTHBAR_INFO_HP_GAUGE (1 << 0) | ||
#define HEALTHBAR_INFO_CURRENT_HP (1 << 1) | ||
#define HEALTHBAR_INFO_MAX_HP (1 << 2) | ||
#define HEALTHBAR_INFO_LEVEL (1 << 3) | ||
#define HEALTHBAR_INFO_NAME (1 << 4) | ||
#define HEALTHBAR_INFO_EXP_GAUGE (1 << 5) | ||
#define HEALTHBAR_INFO_GENDER (1 << 6) | ||
#define HEALTHBAR_INFO_LEVEL_TEXT (1 << 7) | ||
#define HEALTHBAR_INFO_STATUS (1 << 8) | ||
#define HEALTHBAR_INFO_CAUGHT_SPECIES (1 << 9) | ||
#define HEALTHBAR_INFO_COUNT_SAFARI_BALLS (1 << 10) | ||
#define HEALTHBAR_INFO_REMAINING_SAFARI_BALLS (1 << 11) | ||
#define HEALTHBAR_INFO_COUNT_PARK_BALLS (1 << 12) | ||
#define HEALTHBAR_INFO_REMAINING_PARK_BALLS (1 << 13) | ||
|
||
#define HEALTHBAR_INFO_ALL ~0 | ||
|
||
#define HEALTHBAR_INFO_ALL_SAFARI (HEALTHBAR_INFO_COUNT_SAFARI_BALLS | HEALTHBAR_INFO_REMAINING_SAFARI_BALLS) | ||
#define HEALTHBAR_INFO_ALL_PARK (HEALTHBAR_INFO_COUNT_PARK_BALLS | HEALTHBAR_INFO_REMAINING_PARK_BALLS) | ||
#define HEALTHBAR_INFO_NOT_ON_ENEMY (HEALTHBAR_INFO_CURRENT_HP | HEALTHBAR_INFO_MAX_HP | HEALTHBAR_INFO_EXP_GAUGE) | ||
|
||
enum HealthbarType { | ||
HEALTHBAR_TYPE_PLAYER_SOLO = 0, | ||
HEALTHBAR_TYPE_ENEMY_SOLO, | ||
HEALTHBAR_TYPE_PLAYER_SLOT_1, | ||
HEALTHBAR_TYPE_ENEMY_SLOT_1, | ||
HEALTHBAR_TYPE_PLAYER_SLOT_2, | ||
HEALTHBAR_TYPE_ENEMY_SLOT_2, | ||
HEALTHBAR_TYPE_SAFARI_ZONE, | ||
HEALTHBAR_TYPE_PAL_PARK, | ||
}; | ||
|
||
enum HealthbarScrollDirection { | ||
HEALTHBAR_SCROLL_IN = 0, | ||
HEALTHBAR_SCROLL_OUT, | ||
}; | ||
|
||
enum HealthbarGaugeType { | ||
HEALTHBAR_GAUGE_HP = 0, | ||
HEALTHBAR_GAUGE_EXP, | ||
}; | ||
|
||
/** | ||
* @brief Load the resources required to display a healthbar. | ||
* | ||
* Though a NARC handle is required as a parameter, it is assumed to always be | ||
* an open handle to pl_batt_obj.narc. | ||
* | ||
* @param renderer | ||
* @param gfxHandler | ||
* @param narc | ||
* @param palette | ||
* @param healthbarType | ||
*/ | ||
void Healthbar_LoadResources(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, PaletteData *palette, enum HealthbarType healthbarType); | ||
CellActorData * ov16_02267060(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2); | ||
|
||
/** | ||
* @brief Draw the informational parts of the healthbar, according to a set | ||
* of input flags which control exactly what components to draw. | ||
* | ||
* @param healthbar | ||
* @param hp The battler's current HP | ||
* @param flags The components to be drawn, as a bitmask. | ||
*/ | ||
void Healthbar_DrawInfo(Healthbar *healthbar, u32 hp, u32 flags); | ||
void ov16_02267220(Healthbar * param0); | ||
void ov16_02267258(Healthbar * param0); | ||
void ov16_022672C4(Healthbar * param0); | ||
void ov16_02267360(Healthbar * param0); | ||
void ov16_0226737C(Healthbar * param0); | ||
|
||
/** | ||
* @brief Compute the battler's new HP after taking a given amount of | ||
* damage or restoring a certain amount of health. Additionally, cache | ||
* this difference, flooring it to the bounds of the battler's current | ||
* and maximum HP. | ||
* | ||
* @param healthbar | ||
* @param damage The amount of damage dealt to a battler. Negative | ||
* values are damage, positive values are recovery. | ||
*/ | ||
void Healthbar_CalcHP(Healthbar *healthbar, int damage); | ||
s32 ov16_022674F8(Healthbar * param0); | ||
void Healthbar_CalcExp(Healthbar * param0, int param1); | ||
s32 ov16_02267560(Healthbar * param0); | ||
void ov16_0226757C(Healthbar * param0); | ||
void ov16_022675AC(Healthbar * param0); | ||
void ov16_022675D8(Healthbar * param0, int param1); | ||
|
||
/** | ||
* @brief Enable (or disable) the healthbar. | ||
* | ||
* @param battleSys | ||
* @param enable If TRUE, enable the healthbar; otherwise, disable it. | ||
*/ | ||
void Healthbar_Enable(Healthbar *battleSys, BOOL enable); | ||
|
||
/** | ||
* @brief Offset the healthbar's position by a given value along the X and Y axes. | ||
* | ||
* @param healthbar | ||
* @param x X-axis offset for the healthbar from its current position. | ||
* @param y Y-axis offset for the healthbar from its current position. | ||
*/ | ||
void Healthbar_OffsetPositionXY(Healthbar *healthbar, int x, int y); | ||
|
||
/** | ||
* @brief Scroll the healthbar in or out. | ||
* | ||
* @param healthbar | ||
* @param direction The direction to scroll the healthbar. | ||
*/ | ||
void Healthbar_Scroll(Healthbar *healthbar, enum HealthbarScrollDirection direction); | ||
|
||
/** | ||
* @brief Determine the type of healthbar to be displayed for a given battler type | ||
* (solo player, solo enemy, or any slot in doubles) and battle type. | ||
* | ||
* Pal Park and Safari Zone use a different healthbar type than normal battles. | ||
* | ||
* @param battlerType The type of battler which the healthbar represents. | ||
* @param battleType The type of battle in which the healthbar will be used. | ||
* @return The resulting healthbar type; see enum HealthbarType. | ||
*/ | ||
u8 Healthbar_Type(int battlerType, u32 battleType); | ||
void ov16_0226834C(Healthbar * param0, u8 * param1); | ||
void ov16_02268468(Healthbar * param0); | ||
void ov16_0226846C(Healthbar * param0); | ||
void ov16_02268470(Healthbar * param0); | ||
void ov16_02268498(Healthbar * param0); | ||
|
||
#endif // POKEPLATINUM_OV16_02266F1C_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef POKEPLATINUM_CONSTANTS_FONT_H | ||
#define POKEPLATINUM_CONSTANTS_FONT_H | ||
|
||
typedef u32 FONT_COLOR; | ||
|
||
#define FONT_COLOR_MASK 0xFF | ||
#define FONT_COLOR_LETTER_SHIFT 16 | ||
#define FONT_COLOR_SHADOW_SHIFT 8 | ||
#define FONT_COLOR_BG_SHIFT 0 | ||
|
||
#define MAKE_FONT_COLOR(letter, shadow, bg) ((FONT_COLOR)( \ | ||
((letter & FONT_COLOR_MASK) << FONT_COLOR_LETTER_SHIFT) \ | ||
| ((shadow & FONT_COLOR_MASK) << FONT_COLOR_SHADOW_SHIFT) \ | ||
| ((bg & FONT_COLOR_MASK) << FONT_COLOR_BG_SHIFT) \ | ||
)) | ||
|
||
enum FontType { | ||
FONT_SYSTEM = 0, | ||
FONT_NPC_TALK, | ||
FONT_BUTTONS, | ||
FONT_UNK, | ||
|
||
FONT_MAX, | ||
}; | ||
|
||
#endif // POKEPLATINUM_CONSTANTS_FONT_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.