mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-03-21 17:55:13 -05:00
Document healthbar (#931)
This commit is contained in:
parent
75545a47f2
commit
a3e29a09dd
|
|
@ -33,6 +33,7 @@
|
|||
#include "generated/time_of_day.h"
|
||||
#include "generated/trainer_score_events.h"
|
||||
#include "generated/trainers.h"
|
||||
#include "constants/battle/battle_script.h"
|
||||
#include "constants/animation_tags.h"
|
||||
#include "constants/battle_tower.h"
|
||||
#include "constants/boat_cutscene.h"
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
#include "struct_decls/battle_system.h"
|
||||
|
||||
#include "battle/battle_message.h"
|
||||
#include "battle/healthbar.h"
|
||||
#include "battle/message_defs.h"
|
||||
#include "battle/struct_ov16_0225BFFC_decl.h"
|
||||
#include "battle/struct_ov16_02265BBC.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle/struct_ov16_0226C378.h"
|
||||
|
||||
#include "pokemon_sprite.h"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
#ifndef POKEPLATINUM_OV16_02266F1C_H
|
||||
#define POKEPLATINUM_OV16_02266F1C_H
|
||||
#ifndef POKEPLATINUM_HEALTHBAR_H
|
||||
#define POKEPLATINUM_HEALTHBAR_H
|
||||
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "struct_decls/battle_system.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "narc.h"
|
||||
#include "palette.h"
|
||||
#include "sprite.h"
|
||||
#include "sprite_system.h"
|
||||
#include "sys_task_manager.h"
|
||||
|
||||
#define HEALTHBAR_INFO_NONE 0
|
||||
#define HEALTHBAR_INFO_HP_GAUGE (1 << 0)
|
||||
|
|
@ -50,6 +53,41 @@ enum HealthbarGaugeType {
|
|||
HEALTHBAR_GAUGE_EXP,
|
||||
};
|
||||
|
||||
typedef struct Healthbar {
|
||||
u8 state;
|
||||
ManagedSprite *mainSprite;
|
||||
ManagedSprite *arrowSprite;
|
||||
BattleSystem *battleSys;
|
||||
SysTask *task_10;
|
||||
Window unused_14;
|
||||
u8 battler;
|
||||
u8 type;
|
||||
u8 selectedPartySlot;
|
||||
u8 numSafariBalls;
|
||||
s32 curHP;
|
||||
s32 maxHP;
|
||||
s32 damage;
|
||||
s32 hpTemp;
|
||||
s32 curExp;
|
||||
s32 maxExp;
|
||||
s32 expReward;
|
||||
s32 expTemp;
|
||||
u8 level;
|
||||
u8 gender;
|
||||
u8 status;
|
||||
u8 caughtSpecies;
|
||||
u8 command;
|
||||
u8 delay;
|
||||
u8 unk_4E;
|
||||
u8 scrollDirection : 1;
|
||||
u8 doneScrolling : 1;
|
||||
u8 unused_4F_2 : 1;
|
||||
u8 numberMode : 1;
|
||||
u8 padding : 4;
|
||||
SysTask *task_50;
|
||||
u16 degrees;
|
||||
} Healthbar;
|
||||
|
||||
/**
|
||||
* @brief Load the resources required to display a healthbar.
|
||||
*
|
||||
|
|
@ -74,11 +112,11 @@ ManagedSprite *Healthbar_DrawSprite(SpriteSystem *spriteSys, SpriteManager *spri
|
|||
* @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);
|
||||
void ov16_02267220(Healthbar *healthbar);
|
||||
void ov16_02267258(Healthbar *healthbar);
|
||||
void ov16_022672C4(Healthbar *healthbar);
|
||||
void ov16_02267360(Healthbar *healthbar);
|
||||
void ov16_0226737C(Healthbar *healthbar);
|
||||
|
||||
/**
|
||||
* @brief Compute the battler's new HP after taking a given amount of
|
||||
|
|
@ -91,12 +129,12 @@ void ov16_0226737C(Healthbar *param0);
|
|||
* 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);
|
||||
s32 ov16_022674F8(Healthbar *healthbar);
|
||||
void Healthbar_CalcExp(Healthbar *healthbar, int expReward);
|
||||
s32 ov16_02267560(Healthbar *healthbar);
|
||||
void ov16_0226757C(Healthbar *healthbar);
|
||||
void ov16_022675AC(Healthbar *healthbar);
|
||||
void ov16_022675D8(Healthbar *healthbar, int priority);
|
||||
|
||||
/**
|
||||
* @brief Enable (or disable) the healthbar.
|
||||
|
|
@ -134,10 +172,10 @@ void Healthbar_Scroll(Healthbar *healthbar, enum HealthbarScrollDirection direct
|
|||
* @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);
|
||||
void ov16_0226834C(Healthbar *healthbar, u8 *param1);
|
||||
void ov16_02268468(Healthbar *healthbar);
|
||||
void ov16_0226846C(Healthbar *healthbar);
|
||||
void ov16_02268470(Healthbar *healthbar);
|
||||
void ov16_02268498(Healthbar *healthbar);
|
||||
|
||||
#endif // POKEPLATINUM_OV16_02266F1C_H
|
||||
#endif // POKEPLATINUM_HEALTHBAR_H
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV16_0225BFFC_T_H
|
||||
#define POKEPLATINUM_STRUCT_OV16_0225BFFC_T_H
|
||||
|
||||
#include "battle/healthbar.h"
|
||||
#include "battle/struct_ov16_0225BFFC_sub1.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle/struct_ov16_0226C378.h"
|
||||
#include "battle_anim/struct_ball_rotation_decl.h"
|
||||
#include "battle_anim/struct_ov12_02223764.h"
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
#ifndef POKEPLATINUM_STRUCT_OV16_022674C4_H
|
||||
#define POKEPLATINUM_STRUCT_OV16_022674C4_H
|
||||
|
||||
#include "struct_decls/battle_system.h"
|
||||
|
||||
#include "bg_window.h"
|
||||
#include "sprite.h"
|
||||
#include "sys_task_manager.h"
|
||||
|
||||
typedef struct {
|
||||
u8 state;
|
||||
ManagedSprite *mainSprite;
|
||||
ManagedSprite *arrowSprite;
|
||||
BattleSystem *battleSys;
|
||||
SysTask *unk_10;
|
||||
Window unk_14;
|
||||
u8 battler;
|
||||
u8 type;
|
||||
u8 selectedPartySlot;
|
||||
u8 unk_27;
|
||||
s32 curHP;
|
||||
s32 maxHP;
|
||||
s32 damage;
|
||||
s32 hpTemp;
|
||||
s32 curExp;
|
||||
s32 maxExp;
|
||||
s32 expReward;
|
||||
s32 expTemp;
|
||||
u8 unk_48;
|
||||
u8 unk_49;
|
||||
u8 status;
|
||||
u8 unk_4B;
|
||||
u8 unk_4C;
|
||||
u8 unk_4D;
|
||||
u8 unk_4E;
|
||||
u8 scrollDirection : 1;
|
||||
u8 doneScrolling : 1;
|
||||
u8 unk_4F_2 : 1;
|
||||
u8 numberMode : 1;
|
||||
u8 : 4;
|
||||
SysTask *unk_50;
|
||||
u16 unk_54;
|
||||
} Healthbar;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_OV16_022674C4_H
|
||||
|
|
@ -7,4 +7,6 @@
|
|||
|
||||
#define BALL_3_SHAKES_SUCCESS 4
|
||||
|
||||
#define HP_CALC_INSTANT_ZERO 0x7FFF
|
||||
|
||||
#endif // POKEPLATINUM_CONSTANTS_BATTLE_BATTLE_SCRIPT_H
|
||||
|
|
|
|||
|
|
@ -6481,7 +6481,7 @@
|
|||
"en_US": "{STRVAR_1 1, 0, 0}{COLOR 4}♀{COLOR 0}"
|
||||
},
|
||||
{
|
||||
"id": "BattleStrings_Text_00964",
|
||||
"id": "BattleStrings_Text_HealthbarPokemonName",
|
||||
"en_US": "{STRVAR_1 1, 0, 0}"
|
||||
},
|
||||
{
|
||||
|
|
@ -8204,11 +8204,11 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": "BattleStrings_Text_ParkBallls",
|
||||
"id": "BattleStrings_Text_ParkBalls",
|
||||
"en_US": "PARK BALLS"
|
||||
},
|
||||
{
|
||||
"id": "BattleStrings_Text_ParkBalllsLeft",
|
||||
"id": "BattleStrings_Text_ParkBallsLeft",
|
||||
"en_US": "Left: {STRVAR_1 51, 0, 0}"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "constants/battle/battle_script.h"
|
||||
#include "constants/heap.h"
|
||||
#include "constants/species.h"
|
||||
#include "generated/items.h"
|
||||
|
|
@ -58,7 +59,6 @@
|
|||
#include "battle/struct_ov16_02264650.h"
|
||||
#include "battle/struct_ov16_02264650_1.h"
|
||||
#include "battle/struct_ov16_02265BBC.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle/struct_ov16_02268A14_decl.h"
|
||||
#include "battle/struct_ov16_02269668.h"
|
||||
#include "battle/struct_ov16_0226C378.h"
|
||||
|
|
@ -564,24 +564,24 @@ void BattleDisplay_SlideHealthbarIn(BattleSystem *battleSys, BattlerData *battle
|
|||
healthbar->battleSys = battleSys;
|
||||
healthbar->battler = battlerData->battler;
|
||||
healthbar->type = Healthbar_Type(battlerData->battlerType, BattleSystem_GetBattleType(battleSys));
|
||||
healthbar->unk_4C = healthbarData->command;
|
||||
healthbar->command = healthbarData->command;
|
||||
healthbar->curHP = healthbarData->curHP;
|
||||
healthbar->maxHP = healthbarData->maxHP;
|
||||
healthbar->unk_48 = healthbarData->level;
|
||||
healthbar->unk_49 = healthbarData->gender;
|
||||
healthbar->level = healthbarData->level;
|
||||
healthbar->gender = healthbarData->gender;
|
||||
healthbar->damage = 0;
|
||||
healthbar->curExp = healthbarData->expFromLastLevel;
|
||||
healthbar->maxExp = healthbarData->expToNextLevel;
|
||||
healthbar->selectedPartySlot = healthbarData->selectedPartySlot;
|
||||
healthbar->status = healthbarData->status;
|
||||
healthbar->unk_4B = healthbarData->speciesCaught;
|
||||
healthbar->unk_4D = healthbarData->delay;
|
||||
healthbar->unk_27 = healthbarData->numSafariBalls;
|
||||
healthbar->caughtSpecies = healthbarData->speciesCaught;
|
||||
healthbar->delay = healthbarData->delay;
|
||||
healthbar->numSafariBalls = healthbarData->numSafariBalls;
|
||||
|
||||
Healthbar_Enable(healthbar, FALSE);
|
||||
Healthbar_DrawInfo(healthbar, healthbar->curHP, HEALTHBAR_INFO_ALL);
|
||||
|
||||
healthbar->unk_10 = SysTask_Start(SlideHealthbarInTask, healthbar, 1000);
|
||||
healthbar->task_10 = SysTask_Start(SlideHealthbarInTask, healthbar, 1000);
|
||||
}
|
||||
|
||||
void BattleDisplay_SlideHealthbarOut(BattleSystem *battleSys, BattlerData *battlerData)
|
||||
|
|
@ -591,11 +591,11 @@ void BattleDisplay_SlideHealthbarOut(BattleSystem *battleSys, BattlerData *battl
|
|||
|
||||
healthbar->battleSys = battleSys;
|
||||
healthbar->battler = battlerData->battler;
|
||||
healthbar->unk_4C = battlerData->data[0];
|
||||
healthbar->command = battlerData->data[0];
|
||||
|
||||
Healthbar_Scroll(healthbar, HEALTHBAR_SCROLL_OUT);
|
||||
|
||||
healthbar->unk_10 = SysTask_Start(SlideHealthbarOutTask, healthbar, 1000);
|
||||
healthbar->task_10 = SysTask_Start(SlideHealthbarOutTask, healthbar, 1000);
|
||||
}
|
||||
|
||||
void ov16_0225D5B8(BattleSystem *battleSys, BattlerData *param1, CommandSetMessage *message)
|
||||
|
|
@ -861,52 +861,52 @@ void ov16_0225DA44(BattleSystem *battleSys, BattlerData *param1)
|
|||
|
||||
void ov16_0225DA74(BattleSystem *battleSys, BattlerData *param1, HPGaugeUpdateMessage *message)
|
||||
{
|
||||
Healthbar *v0;
|
||||
Healthbar *healthbar;
|
||||
|
||||
GF_ASSERT(param1->healthbar.mainSprite != NULL);
|
||||
|
||||
v0 = ¶m1->healthbar;
|
||||
MI_CpuClear8(&v0->state, sizeof(u8));
|
||||
healthbar = ¶m1->healthbar;
|
||||
MI_CpuClear8(&healthbar->state, sizeof(u8));
|
||||
|
||||
v0->battleSys = battleSys;
|
||||
v0->unk_4C = message->command;
|
||||
v0->battler = param1->battler;
|
||||
v0->type = Healthbar_Type(param1->battlerType, BattleSystem_GetBattleType(battleSys));
|
||||
v0->curHP = message->curHP;
|
||||
v0->maxHP = message->maxHP;
|
||||
v0->damage = message->hpCalcTemp;
|
||||
v0->unk_48 = message->level;
|
||||
healthbar->battleSys = battleSys;
|
||||
healthbar->command = message->command;
|
||||
healthbar->battler = param1->battler;
|
||||
healthbar->type = Healthbar_Type(param1->battlerType, BattleSystem_GetBattleType(battleSys));
|
||||
healthbar->curHP = message->curHP;
|
||||
healthbar->maxHP = message->maxHP;
|
||||
healthbar->damage = message->hpCalcTemp;
|
||||
healthbar->level = message->level;
|
||||
|
||||
if (message->hpCalcTemp == 0x7fff) {
|
||||
v0->curHP = 0;
|
||||
v0->damage = 0;
|
||||
if (message->hpCalcTemp == HP_CALC_INSTANT_ZERO) {
|
||||
healthbar->curHP = 0;
|
||||
healthbar->damage = 0;
|
||||
}
|
||||
|
||||
v0->unk_10 = SysTask_Start(ov16_02262988, v0, 1000);
|
||||
healthbar->task_10 = SysTask_Start(ov16_02262988, healthbar, 1000);
|
||||
}
|
||||
|
||||
void ov16_0225DB00(BattleSystem *battleSys, BattlerData *param1, ExpGaugeUpdateMessage *message)
|
||||
{
|
||||
Healthbar *v0;
|
||||
Healthbar *healthbar;
|
||||
|
||||
GF_ASSERT(param1->healthbar.mainSprite != NULL);
|
||||
|
||||
v0 = ¶m1->healthbar;
|
||||
healthbar = ¶m1->healthbar;
|
||||
|
||||
MI_CpuClear8(&v0->state, sizeof(u8));
|
||||
MI_CpuClear8(&healthbar->state, sizeof(u8));
|
||||
|
||||
v0->battleSys = battleSys;
|
||||
v0->unk_4C = message->command;
|
||||
v0->battler = param1->battler;
|
||||
v0->curExp = message->curExp;
|
||||
v0->maxExp = message->expToNextLevel;
|
||||
v0->expReward = message->gainedExp - v0->curExp;
|
||||
healthbar->battleSys = battleSys;
|
||||
healthbar->command = message->command;
|
||||
healthbar->battler = param1->battler;
|
||||
healthbar->curExp = message->curExp;
|
||||
healthbar->maxExp = message->expToNextLevel;
|
||||
healthbar->expReward = message->gainedExp - healthbar->curExp;
|
||||
|
||||
if (param1->battlerType == 0) {
|
||||
v0->unk_10 = SysTask_Start(ov16_022629DC, v0, 1000);
|
||||
healthbar->task_10 = SysTask_Start(ov16_022629DC, healthbar, 1000);
|
||||
return;
|
||||
} else {
|
||||
BattleController_EmitClearCommand(v0->battleSys, v0->battler, v0->unk_4C);
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1142,28 +1142,28 @@ void ov16_0225DF6C(BattleSystem *battleSys, BattlerData *param1, AlertMsgMessage
|
|||
|
||||
void ov16_0225E008(BattleSystem *battleSys, BattlerData *param1, RefreshHPGaugeMessage *message)
|
||||
{
|
||||
Healthbar *v0 = ¶m1->healthbar;
|
||||
Healthbar *healthbar = ¶m1->healthbar;
|
||||
|
||||
MI_CpuClearFast(&v0->state, sizeof(u8));
|
||||
MI_CpuClearFast(&healthbar->state, sizeof(u8));
|
||||
|
||||
v0->battleSys = battleSys;
|
||||
v0->battler = param1->battler;
|
||||
v0->type = Healthbar_Type(param1->battlerType, BattleSystem_GetBattleType(battleSys));
|
||||
v0->unk_4C = message->command;
|
||||
v0->curHP = message->curHP;
|
||||
v0->maxHP = message->maxHP;
|
||||
v0->unk_48 = message->level;
|
||||
v0->unk_49 = message->gender;
|
||||
v0->damage = 0;
|
||||
v0->curExp = message->curExp;
|
||||
v0->maxExp = message->maxExp;
|
||||
v0->selectedPartySlot = message->partySlot;
|
||||
v0->status = message->status;
|
||||
v0->unk_4B = message->caughtSpecies;
|
||||
v0->unk_27 = message->numSafariBalls;
|
||||
healthbar->battleSys = battleSys;
|
||||
healthbar->battler = param1->battler;
|
||||
healthbar->type = Healthbar_Type(param1->battlerType, BattleSystem_GetBattleType(battleSys));
|
||||
healthbar->command = message->command;
|
||||
healthbar->curHP = message->curHP;
|
||||
healthbar->maxHP = message->maxHP;
|
||||
healthbar->level = message->level;
|
||||
healthbar->gender = message->gender;
|
||||
healthbar->damage = 0;
|
||||
healthbar->curExp = message->curExp;
|
||||
healthbar->maxExp = message->maxExp;
|
||||
healthbar->selectedPartySlot = message->partySlot;
|
||||
healthbar->status = message->status;
|
||||
healthbar->caughtSpecies = message->caughtSpecies;
|
||||
healthbar->numSafariBalls = message->numSafariBalls;
|
||||
|
||||
Healthbar_DrawInfo(v0, v0->curHP, ~HEALTHBAR_INFO_EXP_GAUGE);
|
||||
BattleController_EmitClearCommand(v0->battleSys, v0->battler, v0->unk_4C);
|
||||
Healthbar_DrawInfo(healthbar, healthbar->curHP, ~HEALTHBAR_INFO_EXP_GAUGE);
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
}
|
||||
|
||||
void ov16_0225E0BC(BattleSystem *battleSys, BattlerData *param1, ForgetMoveMessage *message)
|
||||
|
|
@ -2733,8 +2733,8 @@ static void SlideHealthbarInTask(SysTask *task, void *data)
|
|||
|
||||
switch (healthbar->state) {
|
||||
case SLIDE_HEALTHBAR_IN_STATE_ENABLE:
|
||||
if (healthbar->unk_4D > 0) {
|
||||
healthbar->unk_4D--;
|
||||
if (healthbar->delay > 0) {
|
||||
healthbar->delay--;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -2750,8 +2750,8 @@ static void SlideHealthbarInTask(SysTask *task, void *data)
|
|||
break;
|
||||
|
||||
default:
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->unk_4C);
|
||||
healthbar->unk_10 = NULL;
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
healthbar->task_10 = NULL;
|
||||
SysTask_Done(task);
|
||||
break;
|
||||
}
|
||||
|
|
@ -2780,8 +2780,8 @@ static void SlideHealthbarOutTask(SysTask *task, void *data)
|
|||
break;
|
||||
|
||||
default:
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->unk_4C);
|
||||
healthbar->unk_10 = NULL;
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
healthbar->task_10 = NULL;
|
||||
SysTask_Done(task);
|
||||
Healthbar_Enable(healthbar, FALSE);
|
||||
break;
|
||||
|
|
@ -2796,7 +2796,7 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
BattlerData *v3;
|
||||
u32 battleType;
|
||||
int v5;
|
||||
Healthbar *v6;
|
||||
Healthbar *healthbar;
|
||||
|
||||
v0 = (UnkStruct_ov16_0225D5B8 *)param1;
|
||||
v1 = BattleSystem_GetBgConfig(v0->battleSys);
|
||||
|
|
@ -2806,9 +2806,9 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
v5 = BattleSystem_GetPartner(v0->battleSys, v0->unk_09);
|
||||
|
||||
if (v5 != v0->unk_09) {
|
||||
v6 = BattleSystem_GetHealthbar(v0->battleSys, v5);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v5);
|
||||
} else {
|
||||
v6 = NULL;
|
||||
healthbar = NULL;
|
||||
}
|
||||
|
||||
switch (v0->unk_0A) {
|
||||
|
|
@ -2938,8 +2938,8 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
NARC_dtor(v13);
|
||||
}
|
||||
|
||||
if (v6 != NULL) {
|
||||
ov16_02268468(v6);
|
||||
if (healthbar != NULL) {
|
||||
ov16_02268468(healthbar);
|
||||
}
|
||||
|
||||
v0->unk_0A = 5;
|
||||
|
|
@ -2977,7 +2977,7 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
|
||||
ov16_02268C04(v16, v17, v2, 0, 0, NULL);
|
||||
ov16_0226BCCC(v2, 0);
|
||||
ov16_0226846C(v6);
|
||||
ov16_0226846C(healthbar);
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v3);
|
||||
NARC_dtor(v16);
|
||||
|
|
@ -2989,7 +2989,7 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
|
||||
ov16_02268C04(v18, v19, v2, 0, 0, NULL);
|
||||
ov16_0226BCCC(v2, 0);
|
||||
ov16_0226846C(v6);
|
||||
ov16_0226846C(healthbar);
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v3);
|
||||
NARC_dtor(v18);
|
||||
|
|
@ -3000,7 +3000,7 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
NARC *v21 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, HEAP_ID_BATTLE);
|
||||
|
||||
if (ov16_0226D088(v2) == 1) {
|
||||
ov16_0226846C(v6);
|
||||
ov16_0226846C(healthbar);
|
||||
v0->unk_0C = 0xff;
|
||||
}
|
||||
|
||||
|
|
@ -3024,7 +3024,7 @@ static void ov16_022604C8(SysTask *param0, void *param1)
|
|||
|
||||
ov16_02268C04(v22, v23, v2, 0, 0, NULL);
|
||||
ov16_0226BCCC(v2, 0);
|
||||
ov16_0226846C(v6);
|
||||
ov16_0226846C(healthbar);
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v3);
|
||||
ov16_02269218(v2);
|
||||
|
|
@ -3142,7 +3142,7 @@ static void ov16_02260C00(SysTask *param0, void *param1)
|
|||
BgConfig *v1 = BattleSystem_GetBgConfig(v0->battleSys);
|
||||
UnkStruct_ov16_02268A14 *v2;
|
||||
int v3;
|
||||
Healthbar *v4;
|
||||
Healthbar *healthbar;
|
||||
BattlerData *v5;
|
||||
|
||||
v2 = ov16_0223E02C(v0->battleSys);
|
||||
|
|
@ -3150,9 +3150,9 @@ static void ov16_02260C00(SysTask *param0, void *param1)
|
|||
v3 = BattleSystem_GetPartner(v0->battleSys, v0->unk_1D);
|
||||
|
||||
if (v3 != v0->unk_1D) {
|
||||
v4 = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
} else {
|
||||
v4 = NULL;
|
||||
healthbar = NULL;
|
||||
}
|
||||
|
||||
switch (v0->unk_20) {
|
||||
|
|
@ -3208,7 +3208,7 @@ static void ov16_02260C00(SysTask *param0, void *param1)
|
|||
if (v0->unk_08 != 0xff) {
|
||||
if ((BattleSystem_GetBattleType(v0->battleSys) & BATTLE_TYPE_DOUBLES) == FALSE) {
|
||||
ov16_0226BCCC(v2, 0);
|
||||
ov16_0226846C(v4);
|
||||
ov16_0226846C(healthbar);
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v5);
|
||||
}
|
||||
|
|
@ -3323,15 +3323,15 @@ static void ov16_02260F14(SysTask *param0, void *param1)
|
|||
BgConfig *v1 = BattleSystem_GetBgConfig(v0->battleSys);
|
||||
UnkStruct_ov16_02268A14 *v2;
|
||||
int v3;
|
||||
Healthbar *v4;
|
||||
Healthbar *healthbar;
|
||||
BattlerData *v5 = BattleSystem_GetBattlerData(v0->battleSys, v0->unk_0D);
|
||||
v2 = ov16_0223E02C(v0->battleSys);
|
||||
v3 = BattleSystem_GetPartner(v0->battleSys, v0->unk_0D);
|
||||
|
||||
if (v3 != v0->unk_0D) {
|
||||
v4 = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
} else {
|
||||
v4 = NULL;
|
||||
healthbar = NULL;
|
||||
}
|
||||
|
||||
switch (v0->unk_0F) {
|
||||
|
|
@ -3373,7 +3373,7 @@ static void ov16_02260F14(SysTask *param0, void *param1)
|
|||
if (v0->unk_08 != 0xff) {
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v5);
|
||||
ov16_0226846C(v4);
|
||||
ov16_0226846C(healthbar);
|
||||
|
||||
if (v0->unk_32 == 1) {
|
||||
ov16_0226BCCC(v2, 0);
|
||||
|
|
@ -3831,7 +3831,7 @@ static void ov16_022611DC(SysTask *param0, void *param1)
|
|||
v0->unk_0E++;
|
||||
break;
|
||||
case 21: {
|
||||
Healthbar *v18;
|
||||
Healthbar *healthbar;
|
||||
Pokemon *v19;
|
||||
int v20;
|
||||
int v21;
|
||||
|
|
@ -3839,32 +3839,32 @@ static void ov16_022611DC(SysTask *param0, void *param1)
|
|||
v20 = v0->unk_08->unk_04->selectedPartyIndex * 2;
|
||||
v21 = v0->unk_08->unk_04->pokemonPartySlots[v0->unk_08->unk_04->selectedPartyIndex];
|
||||
|
||||
v18 = BattleSystem_GetHealthbar(v0->battleSys, v20);
|
||||
MI_CpuClear8(&v18->state, sizeof(u8));
|
||||
v18->type = Healthbar_Type(BattleSystem_GetBattlerType(v0->battleSys, v20), BattleSystem_GetBattleType(v0->battleSys));
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v20);
|
||||
MI_CpuClear8(&healthbar->state, sizeof(u8));
|
||||
healthbar->type = Healthbar_Type(BattleSystem_GetBattlerType(v0->battleSys, v20), BattleSystem_GetBattleType(v0->battleSys));
|
||||
|
||||
v19 = BattleSystem_GetPartyPokemon(v0->battleSys, v20, v21);
|
||||
v18->curHP = Pokemon_GetValue(v19, MON_DATA_HP, NULL) - v0->unk_08->unk_04->currentDamage;
|
||||
v18->maxHP = Pokemon_GetValue(v19, MON_DATA_MAX_HP, NULL);
|
||||
v18->damage = v0->unk_08->unk_04->currentDamage;
|
||||
healthbar->curHP = Pokemon_GetValue(v19, MON_DATA_HP, NULL) - v0->unk_08->unk_04->currentDamage;
|
||||
healthbar->maxHP = Pokemon_GetValue(v19, MON_DATA_MAX_HP, NULL);
|
||||
healthbar->damage = v0->unk_08->unk_04->currentDamage;
|
||||
|
||||
if (Pokemon_GetValue(v19, MON_DATA_STATUS, NULL) == 0) {
|
||||
v18->status = 0;
|
||||
healthbar->status = 0;
|
||||
}
|
||||
|
||||
Healthbar_CalcHP(v18, v18->damage);
|
||||
Healthbar_CalcHP(healthbar, healthbar->damage);
|
||||
}
|
||||
v0->unk_0E++;
|
||||
break;
|
||||
case 22: {
|
||||
Healthbar *v22;
|
||||
Healthbar *healthbar;
|
||||
int v23;
|
||||
|
||||
v23 = v0->unk_08->unk_04->selectedPartyIndex * 2;
|
||||
v22 = BattleSystem_GetHealthbar(v0->battleSys, v23);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v23);
|
||||
|
||||
if (ov16_022674F8(v22) == -1) {
|
||||
Healthbar_DrawInfo(v22, NULL, HEALTHBAR_INFO_STATUS);
|
||||
if (ov16_022674F8(healthbar) == -1) {
|
||||
Healthbar_DrawInfo(healthbar, NULL, HEALTHBAR_INFO_STATUS);
|
||||
v0->unk_0E++;
|
||||
}
|
||||
} break;
|
||||
|
|
@ -3893,7 +3893,7 @@ static void ov16_022611DC(SysTask *param0, void *param1)
|
|||
v0->unk_0E++;
|
||||
} break;
|
||||
case 29: {
|
||||
Healthbar *v27;
|
||||
Healthbar *healthbar;
|
||||
int v28;
|
||||
MessageLoader *v29;
|
||||
BattleMessage v30;
|
||||
|
|
@ -3903,15 +3903,15 @@ static void ov16_022611DC(SysTask *param0, void *param1)
|
|||
int v34;
|
||||
|
||||
v28 = v0->unk_08->unk_04->selectedPartyIndex * 2;
|
||||
v27 = BattleSystem_GetHealthbar(v0->battleSys, v28);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v28);
|
||||
v34 = v0->unk_08->unk_04->pokemonPartySlots[v0->unk_08->unk_04->selectedPartyIndex];
|
||||
v33 = BattleSystem_GetPartyPokemon(v0->battleSys, v28, v34);
|
||||
|
||||
if (Pokemon_GetValue(v33, MON_DATA_STATUS, NULL) == 0) {
|
||||
v27->status = 0;
|
||||
healthbar->status = 0;
|
||||
}
|
||||
|
||||
Healthbar_DrawInfo(v27, v27->curHP, HEALTHBAR_INFO_STATUS);
|
||||
Healthbar_DrawInfo(healthbar, healthbar->curHP, HEALTHBAR_INFO_STATUS);
|
||||
|
||||
v30.tags = 2;
|
||||
v30.params[0] = v28 | (v0->unk_08->unk_0C[v28] << 8);
|
||||
|
|
@ -4330,14 +4330,14 @@ static void ov16_022623F0(SysTask *param0, void *param1)
|
|||
BgConfig *v1 = BattleSystem_GetBgConfig(v0->battleSys);
|
||||
UnkStruct_ov16_02268A14 *v2 = ov16_0223E02C(v0->battleSys);
|
||||
int v3;
|
||||
Healthbar *v4;
|
||||
Healthbar *healthbar;
|
||||
BattlerData *v5 = BattleSystem_GetBattlerData(v0->battleSys, v0->unk_0D);
|
||||
v3 = BattleSystem_GetPartner(v0->battleSys, v0->unk_0D);
|
||||
|
||||
if (v3 != v0->unk_0D) {
|
||||
v4 = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
healthbar = BattleSystem_GetHealthbar(v0->battleSys, v3);
|
||||
} else {
|
||||
v4 = NULL;
|
||||
healthbar = NULL;
|
||||
}
|
||||
|
||||
switch (v0->unk_0E) {
|
||||
|
|
@ -4424,7 +4424,7 @@ static void ov16_022623F0(SysTask *param0, void *param1)
|
|||
|
||||
ov16_022675AC(v0->unk_04);
|
||||
ov16_022647D8(v5);
|
||||
ov16_0226846C(v4);
|
||||
ov16_0226846C(healthbar);
|
||||
ov16_02269218(v2);
|
||||
ov16_02268C04(v12, v13, v2, 0, 0, NULL);
|
||||
|
||||
|
|
@ -4617,23 +4617,23 @@ static void ov16_0226292C(SysTask *param0, void *param1)
|
|||
|
||||
static void ov16_02262988(SysTask *param0, void *param1)
|
||||
{
|
||||
Healthbar *v0 = param1;
|
||||
Healthbar *healthbar = param1;
|
||||
int v1;
|
||||
|
||||
switch (v0->state) {
|
||||
switch (healthbar->state) {
|
||||
case 0:
|
||||
Healthbar_CalcHP(v0, v0->damage);
|
||||
v0->state++;
|
||||
Healthbar_CalcHP(healthbar, healthbar->damage);
|
||||
healthbar->state++;
|
||||
case 1:
|
||||
v1 = ov16_022674F8(v0);
|
||||
v1 = ov16_022674F8(healthbar);
|
||||
|
||||
if (v1 == -1) {
|
||||
v0->state++;
|
||||
healthbar->state++;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BattleController_EmitClearCommand(v0->battleSys, v0->battler, v0->unk_4C);
|
||||
v0->unk_10 = NULL;
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
healthbar->task_10 = NULL;
|
||||
SysTask_Done(param0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -4641,42 +4641,42 @@ static void ov16_02262988(SysTask *param0, void *param1)
|
|||
|
||||
static void ov16_022629DC(SysTask *param0, void *param1)
|
||||
{
|
||||
Healthbar *v0 = param1;
|
||||
Healthbar *healthbar = param1;
|
||||
int v1;
|
||||
|
||||
switch (v0->state) {
|
||||
switch (healthbar->state) {
|
||||
case 0:
|
||||
v0->unk_4E = 0;
|
||||
healthbar->unk_4E = 0;
|
||||
Sound_PlayEffect(SEQ_SE_DP_EXP);
|
||||
Healthbar_CalcExp(v0, v0->expReward);
|
||||
v0->state++;
|
||||
Healthbar_CalcExp(healthbar, healthbar->expReward);
|
||||
healthbar->state++;
|
||||
case 1:
|
||||
if (v0->unk_4E < 8) {
|
||||
v0->unk_4E++;
|
||||
if (healthbar->unk_4E < 8) {
|
||||
healthbar->unk_4E++;
|
||||
}
|
||||
|
||||
v1 = ov16_02267560(v0);
|
||||
v1 = ov16_02267560(healthbar);
|
||||
|
||||
if (v1 == -1) {
|
||||
if (v0->unk_4E >= 8) {
|
||||
if (healthbar->unk_4E >= 8) {
|
||||
Sound_StopEffect(1803, 0);
|
||||
v0->state = 100;
|
||||
healthbar->state = 100;
|
||||
} else {
|
||||
v0->state++;
|
||||
healthbar->state++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
v0->unk_4E++;
|
||||
healthbar->unk_4E++;
|
||||
|
||||
if (v0->unk_4E >= 8) {
|
||||
if (healthbar->unk_4E >= 8) {
|
||||
Sound_StopEffect(1803, 0);
|
||||
v0->state = 100;
|
||||
healthbar->state = 100;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BattleController_EmitClearCommand(v0->battleSys, v0->battler, v0->unk_4C);
|
||||
v0->unk_10 = NULL;
|
||||
BattleController_EmitClearCommand(healthbar->battleSys, healthbar->battler, healthbar->command);
|
||||
healthbar->task_10 = NULL;
|
||||
SysTask_Done(param0);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include "battle/struct_ov16_0225BFFC_decl.h"
|
||||
#include "battle/struct_ov16_0225BFFC_t.h"
|
||||
#include "battle/struct_ov16_02265BBC.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle/struct_ov16_02268A14_decl.h"
|
||||
#include "battle_anim/ov12_02235E94.h"
|
||||
#include "battle_anim/ov12_022380BC.h"
|
||||
|
|
@ -727,7 +726,7 @@ static void ov16_0225C79C(BattleSystem *battleSys, BattlerData *param1)
|
|||
{
|
||||
UnkStruct_ov16_02268A14 *v0;
|
||||
int v1;
|
||||
Healthbar *v2;
|
||||
Healthbar *healthbar;
|
||||
NARC *v3;
|
||||
NARC *v4;
|
||||
|
||||
|
|
@ -744,8 +743,8 @@ static void ov16_0225C79C(BattleSystem *battleSys, BattlerData *param1)
|
|||
v1 = BattleSystem_GetPartner(battleSys, param1->battler);
|
||||
|
||||
if (v1 != param1->battler) {
|
||||
v2 = BattleSystem_GetHealthbar(battleSys, v1);
|
||||
ov16_0226846C(v2);
|
||||
healthbar = BattleSystem_GetHealthbar(battleSys, v1);
|
||||
ov16_0226846C(healthbar);
|
||||
}
|
||||
|
||||
ov16_022675AC(¶m1->healthbar);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include "battle/ov16_0226E148.h"
|
||||
#include "battle/pokemon_sprite_data.h"
|
||||
#include "battle/struct_ov16_0225BFFC_decl.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle/struct_ov16_02268520.h"
|
||||
#include "battle/struct_ov16_02268A14_decl.h"
|
||||
#include "battle/struct_ov16_0226D160_decl.h"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -22,11 +22,11 @@
|
|||
#include "battle/battle_io_command.h"
|
||||
#include "battle/battle_lib.h"
|
||||
#include "battle/battle_system.h"
|
||||
#include "battle/healthbar.h"
|
||||
#include "battle/ov16_02268520.h"
|
||||
#include "battle/ov16_0226E148.h"
|
||||
#include "battle/struct_ov16_0223C2C0.h"
|
||||
#include "battle/struct_ov16_0225BFFC_decl.h"
|
||||
#include "battle/struct_ov16_022674C4.h"
|
||||
#include "battle_anim/battle_anim_system.h"
|
||||
#include "overlay010/ov10_0221F800.h"
|
||||
#include "overlay010/struct_ov10_0221F800.h"
|
||||
|
|
@ -1543,7 +1543,7 @@ static void ov16_0223CF8C(SysTask *param0, void *param1)
|
|||
{
|
||||
BattleSystem *battleSys = param1;
|
||||
BattlerData *v1;
|
||||
Healthbar *v2;
|
||||
Healthbar *healthbar;
|
||||
int v3;
|
||||
int v4;
|
||||
int v5;
|
||||
|
|
@ -1571,10 +1571,10 @@ static void ov16_0223CF8C(SysTask *param0, void *param1)
|
|||
v1 = BattleSystem_GetBattlerData(battleSys, v3);
|
||||
|
||||
if (((Battler_BootState(v1) == 0x0) && ((BattleSystem_GetBattleStatusMask(battleSys) & 0x10) == 0)) || ((BattleSystem_GetBattlerSide(battleSys, v3) == 0) && (BattleSystem_GetBattleStatusMask(battleSys) & 0x10))) {
|
||||
v2 = BattlerData_GetHealthbar(v1);
|
||||
healthbar = BattlerData_GetHealthbar(v1);
|
||||
|
||||
if (v2 != NULL) {
|
||||
if (HealthBar_Color(v2->curHP, v2->maxHP, 8 * 6) == 1) {
|
||||
if (healthbar != NULL) {
|
||||
if (HealthBar_Color(healthbar->curHP, healthbar->maxHP, 8 * 6) == 1) {
|
||||
v5 |= FlagIndex(v3);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user