2022-01-10 16:55:26 +01:00
|
|
|
#include "common.h"
|
|
|
|
#include "npc.h"
|
|
|
|
#include "hud_element.h"
|
|
|
|
|
|
|
|
#define MAX_ICONS (64)
|
|
|
|
|
|
|
|
enum StatusIconFlag {
|
|
|
|
STATUS_ICON_FLAG_USED = 0x001,
|
|
|
|
STATUS_ICON_FLAG_BATTLE = 0x002,
|
|
|
|
STATUS_ICON_FLAG_DEBUFF = 0x004,
|
|
|
|
STATUS_ICON_FLAG_STATIC = 0x008,
|
|
|
|
STATUS_ICON_FLAG_TRANSPARENT = 0x010,
|
|
|
|
STATUS_ICON_FLAG_STATUS_CHILL_OUT = 0x020,
|
|
|
|
STATUS_ICON_FLAG_BOOST_JUMP = 0x040,
|
|
|
|
STATUS_ICON_FLAG_BOOST_HAMMER = 0x080,
|
|
|
|
STATUS_ICON_FLAG_BOOST_PARTNER = 0x100,
|
|
|
|
STATUS_ICON_FLAG_SURPRISE = 0x200,
|
|
|
|
STATUS_ICON_FLAG_PERIL = 0x400,
|
|
|
|
STATUS_ICON_FLAG_DANGER = 0x800,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum StatusIconTask {
|
|
|
|
STATUS_ICON_TASK_NONE = 0,
|
|
|
|
STATUS_ICON_TASK_LOAD = 1,
|
|
|
|
STATUS_ICON_TASK_DRAW = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct HudComplexStatusIcon {
|
|
|
|
/* 0x0 */ s8 active;
|
|
|
|
/* 0x1 */ s8 removing;
|
|
|
|
/* 0x2 */ s8 activeTask;
|
|
|
|
/* 0x3 */ s8 removingTask;
|
|
|
|
/* 0x4 */ s8 unk_04;
|
|
|
|
/* 0x5 */ s8 frameCounter;
|
|
|
|
/* 0x8 */ s32 activeElementID;
|
|
|
|
/* 0xC */ s32 removingElementID;
|
|
|
|
} HudComplexStatusIcon; // size = 0x10
|
|
|
|
|
|
|
|
typedef struct HudSimpleStatusIcon {
|
|
|
|
/* 0x0 */ s8 active;
|
|
|
|
/* 0x1 */ s8 removing;
|
|
|
|
/* 0x4 */ s32 activeElementID;
|
|
|
|
} HudSimpleStatusIcon; // size = 0x8
|
|
|
|
|
|
|
|
typedef struct HudStatusIcon {
|
|
|
|
/* 0x00 */ s32 flags;
|
|
|
|
/* 0x04 */ Vec3f worldPos;
|
|
|
|
/* 0x10 */ s32 status1Radius;
|
|
|
|
/* 0x14 */ s32 status1OffsetY;
|
|
|
|
/* 0x18 */ s32 status2Radius;
|
|
|
|
/* 0x1C */ s32 status2OffsetY;
|
|
|
|
/* 0x20 */ s32 status3Radius;
|
|
|
|
/* 0x24 */ s32 status3OffsetY;
|
|
|
|
/* 0x28 */ s32 status4Radius;
|
|
|
|
/* 0x2C */ s32 status4OffsetY;
|
|
|
|
/* 0x30 */ s32 offsetY;
|
2022-08-17 03:04:23 +02:00
|
|
|
/* 0x34 */ f32 offsetX;
|
2022-01-10 16:55:26 +01:00
|
|
|
/* 0x38 */ HudComplexStatusIcon status1;
|
|
|
|
/* 0x48 */ HudComplexStatusIcon status2;
|
|
|
|
/* 0x58 */ HudComplexStatusIcon status3;
|
|
|
|
/* 0x68 */ HudComplexStatusIcon status4;
|
|
|
|
/* 0x78 */ HudSimpleStatusIcon boostJump;
|
|
|
|
/* 0x80 */ s32 prevIndexBoostJump;
|
|
|
|
/* 0x84 */ HudSimpleStatusIcon boostHammer;
|
|
|
|
/* 0x8C */ s32 prevIndexBoostHammer;
|
|
|
|
/* 0x90 */ HudSimpleStatusIcon boostPartner;
|
|
|
|
/* 0x98 */ HudSimpleStatusIcon surprise;
|
|
|
|
/* 0xA0 */ HudSimpleStatusIcon peril;
|
|
|
|
/* 0xA8 */ HudSimpleStatusIcon danger;
|
|
|
|
} HudStatusIcon; // size = 0xB0
|
|
|
|
|
|
|
|
extern s16 D_80078160[];
|
|
|
|
extern s16 D_80078164[];
|
|
|
|
extern s32 D_80078168[];
|
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
extern HudScript HES_Item_Present;
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
extern PopupMessage D_800A0BC0[32];
|
|
|
|
extern s32 D_800A0F40;
|
|
|
|
extern HudStatusIcon* D_800A0F44;
|
|
|
|
|
2022-06-09 21:03:11 +02:00
|
|
|
extern HudScript HES_AsleepBegin;
|
|
|
|
extern HudScript HES_AsleepEnd;
|
|
|
|
extern HudScript HES_ElectrifiedBegin;
|
|
|
|
extern HudScript HES_ElectrifiedEnd;
|
|
|
|
extern HudScript HES_ParalyzedBegin;
|
|
|
|
extern HudScript HES_ParalyzedEnd;
|
|
|
|
extern HudScript HES_DizzyEnd;
|
|
|
|
extern HudScript HES_PoisonedBegin;
|
|
|
|
extern HudScript HES_PoisonedEnd;
|
|
|
|
extern HudScript HES_DizzyBegin;
|
|
|
|
extern HudScript HES_FrozenBegin;
|
|
|
|
extern HudScript HES_FrozenEnd;
|
|
|
|
extern HudScript HES_WeakenedLoop;
|
|
|
|
extern HudScript HES_WeakenedBegin;
|
|
|
|
extern HudScript HES_WeakenedEnd;
|
|
|
|
extern HudScript HES_StoppedBegin;
|
|
|
|
extern HudScript HES_StoppedEnd;
|
|
|
|
extern HudScript HES_ShrunkBegin;
|
|
|
|
extern HudScript HES_ShrunkEnd;
|
|
|
|
extern HudScript HES_TransparentBegin;
|
|
|
|
extern HudScript HES_TransparentEnd;
|
|
|
|
extern HudScript HES_BoostJumpBegin;
|
|
|
|
extern HudScript HES_BoostJumpEnd;
|
|
|
|
extern HudScript HES_BoostHammerBegin;
|
|
|
|
extern HudScript HES_BoostHammerEnd;
|
|
|
|
extern HudScript HES_BoostPartner;
|
|
|
|
extern HudScript HES_Surprise;
|
|
|
|
extern HudScript HES_Peril;
|
|
|
|
extern HudScript HES_Danger;
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void update_merlee_message(void* popup);
|
|
|
|
void draw_merlee_message(void* popup);
|
2022-01-10 16:55:26 +01:00
|
|
|
void func_80045BC8(void);
|
|
|
|
void init_all_status_icons(void);
|
2022-07-08 14:57:08 +02:00
|
|
|
void update_all_status_icons(void* popup);
|
|
|
|
void draw_all_status_icons(void* popup);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
void func_80045AC0(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
popup->active = FALSE;
|
|
|
|
popup->message = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
create_generic_entity_world(NULL, func_80045BC8);
|
|
|
|
init_all_status_icons();
|
|
|
|
}
|
|
|
|
|
|
|
|
void func_80045B10(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
if (popup->message != NULL) {
|
|
|
|
heap_free(popup->message);
|
|
|
|
}
|
|
|
|
popup->active = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void update_merlee_messages(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
if (popup->active && popup->updateFunc != NULL) {
|
|
|
|
popup->updateFunc(popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void func_80045BC8(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
if (popup->active && popup->unk_08 != NULL) {
|
|
|
|
popup->unk_08(popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void draw_merlee_messages(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
if (popup->active && popup->drawFunc != NULL) {
|
|
|
|
popup->drawFunc(popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PopupMessage* get_current_merlee_message(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(D_800A0BC0); i++) {
|
|
|
|
PopupMessage* popup = &D_800A0BC0[i];
|
|
|
|
if (!popup->active) {
|
|
|
|
popup->active = TRUE;
|
|
|
|
return popup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void dispose_merlee_message(PopupMessage* popup) {
|
|
|
|
if (popup->message != NULL) {
|
|
|
|
heap_free(popup->message);
|
|
|
|
popup->message = NULL;
|
|
|
|
}
|
|
|
|
popup->active = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void show_merlee_message(s16 messageIndex, s16 duration) {
|
|
|
|
PopupMessage* popup = get_current_merlee_message();
|
|
|
|
|
|
|
|
if (popup != NULL) {
|
|
|
|
popup->updateFunc = update_merlee_message;
|
|
|
|
popup->drawFunc = draw_merlee_message;
|
|
|
|
popup->unk_17 = 1;
|
|
|
|
popup->unk_00 = 0;
|
|
|
|
popup->unk_08 = NULL;
|
|
|
|
popup->messageIndex = messageIndex;
|
|
|
|
popup->duration = duration;
|
|
|
|
popup->unk_16 = 0;
|
|
|
|
D_800A0F40 = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void update_merlee_message(void* data) {
|
|
|
|
PopupMessage* popup = data;
|
2022-01-10 16:55:26 +01:00
|
|
|
s32 closeMessage = FALSE;
|
|
|
|
|
|
|
|
switch (popup->unk_16) {
|
|
|
|
case 0:
|
|
|
|
popup->unk_16 = 1;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
popup->unk_16 = 2;
|
|
|
|
break;
|
|
|
|
case 2:
|
2022-06-13 18:34:22 +02:00
|
|
|
if (gGameStatusPtr->pressedButtons[0] & 0xC000) {
|
2022-01-10 16:55:26 +01:00
|
|
|
popup->duration = 0;
|
|
|
|
}
|
|
|
|
if (popup->duration != 0) {
|
|
|
|
popup->duration--;
|
|
|
|
} else {
|
|
|
|
popup->unk_16 = 3;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
popup->unk_16 = 4;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
closeMessage = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (closeMessage) {
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_9, WINDOW_UPDATE_HIDE);
|
2022-01-10 16:55:26 +01:00
|
|
|
D_800A0F40 = 0;
|
|
|
|
dispose_merlee_message(popup);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void draw_merlee_message_string(PopupMessage* popup, s32 posX, s32 posY) {
|
|
|
|
s32 messageID = D_80078168[popup->messageIndex];
|
|
|
|
|
|
|
|
posY += 6;
|
|
|
|
posX += 15;
|
|
|
|
|
|
|
|
posY += D_80078164[get_msg_lines(messageID) - 1];
|
|
|
|
|
|
|
|
draw_msg(messageID, posX, posY, 255, 15, 0);
|
|
|
|
}
|
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void draw_merlee_message(void* data) {
|
|
|
|
PopupMessage* popup = data;
|
2022-01-10 16:55:26 +01:00
|
|
|
s32 messageID;
|
|
|
|
s32 xPos;
|
|
|
|
s32 width;
|
|
|
|
|
|
|
|
if (popup->unk_17 != 0) {
|
|
|
|
popup->unk_17 = 0;
|
|
|
|
messageID = D_80078168[popup->messageIndex];
|
|
|
|
width = get_msg_width(messageID, 0) + 30;
|
|
|
|
xPos = 160 - (width / 2);
|
2022-08-06 14:14:04 +02:00
|
|
|
set_window_properties(WINDOW_ID_9, xPos, 80, width, D_80078160[get_msg_lines(messageID) - 1], 0, draw_merlee_message_string, popup, -1);
|
2022-03-30 14:07:13 +02:00
|
|
|
set_window_update(WINDOW_ID_9, WINDOW_UPDATE_SHOW);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 is_merlee_message_done(void) {
|
|
|
|
return D_800A0F40;
|
|
|
|
}
|
|
|
|
|
|
|
|
void init_all_status_icons(void) {
|
|
|
|
int i;
|
|
|
|
HudStatusIcon* icons;
|
|
|
|
PopupMessage* popup = get_current_merlee_message();
|
|
|
|
|
|
|
|
if (popup != NULL) {
|
2022-07-08 14:57:08 +02:00
|
|
|
popup->updateFunc = update_all_status_icons;
|
2022-01-10 16:55:26 +01:00
|
|
|
popup->unk_00 = 0;
|
|
|
|
popup->unk_08 = NULL;
|
2022-07-08 14:57:08 +02:00
|
|
|
popup->drawFunc = draw_all_status_icons;
|
2022-01-10 16:55:26 +01:00
|
|
|
popup->message = general_heap_malloc(64 * sizeof(HudStatusIcon));
|
|
|
|
icons = D_800A0F44 = (HudStatusIcon*)(popup->message);
|
|
|
|
ASSERT(icons != NULL);
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_ICONS; i++, icons++)
|
|
|
|
icons->flags = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void update_all_status_icons(void* data) {
|
|
|
|
PopupMessage* popup = data;
|
2022-01-10 16:55:26 +01:00
|
|
|
HudStatusIcon* icon;
|
|
|
|
int i;
|
|
|
|
s32 elementID;
|
|
|
|
|
|
|
|
for (i = 0, icon = D_800A0F44; i < MAX_ICONS; i++, icon++) {
|
|
|
|
if (icon->flags == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status1.activeTask == STATUS_ICON_TASK_LOAD) {
|
|
|
|
switch (icon->status1.active) {
|
|
|
|
case STATUS_SLEEP:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_AsleepBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_PARALYZE:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_ParalyzedBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_DIZZY:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_DizzyBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_FEAR:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_WeakenedLoop);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_STOP:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_StoppedBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_POISON:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_PoisonedBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_SHRINK:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_ShrunkBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_FROZEN:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_FrozenBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status1.activeElementID = hud_element_create(&HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status1.activeTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (icon->status1.removingTask) {
|
|
|
|
case STATUS_ICON_TASK_NONE:
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_LOAD:
|
|
|
|
switch (icon->status1.removing) {
|
|
|
|
case STATUS_SLEEP:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_AsleepEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_PARALYZE:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_ParalyzedEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_DIZZY:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_DizzyEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_FEAR:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_WeakenedLoop);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_STOP:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_StoppedEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_POISON:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_PoisonedEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_SHRINK:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_ShrunkEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
case STATUS_FROZEN:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_FrozenEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status1.removingElementID, &HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon->status1.frameCounter = 10;
|
|
|
|
icon->status1.removingTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case STATUS_ICON_TASK_DRAW:
|
|
|
|
if (icon->status1.frameCounter != 0) {
|
|
|
|
icon->status1.frameCounter--;
|
|
|
|
} else {
|
|
|
|
icon->status1.removing = 0;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(icon->status1.removingElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status1.removingTask = STATUS_ICON_TASK_NONE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status2.activeTask == STATUS_ICON_TASK_LOAD) {
|
|
|
|
switch (icon->status2.active) {
|
|
|
|
case STATUS_STATIC:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status2.activeElementID = hud_element_create(&HES_ElectrifiedBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status2.activeElementID = hud_element_create(&HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status2.activeTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (icon->status2.removingTask) {
|
|
|
|
case STATUS_ICON_TASK_NONE:
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_LOAD:
|
|
|
|
switch (icon->status2.removing) {
|
|
|
|
case STATUS_STATIC:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status2.removingElementID, &HES_ElectrifiedEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status2.removingElementID, &HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon->status2.frameCounter = 20;
|
|
|
|
icon->status2.removingTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_DRAW:
|
|
|
|
if (icon->status2.frameCounter != 0) {
|
|
|
|
icon->status2.frameCounter--;
|
|
|
|
} else {
|
|
|
|
icon->status2.removing = 0;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(icon->status2.removingElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status2.removingTask = STATUS_ICON_TASK_NONE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status3.activeTask == STATUS_ICON_TASK_LOAD) {
|
|
|
|
switch (icon->status3.active) {
|
2022-08-17 03:04:23 +02:00
|
|
|
case STATUS_TRANSPARENT:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status3.activeElementID = hud_element_create(&HES_TransparentBegin);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status3.activeElementID = hud_element_create(&HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status3.activeTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (icon->status3.removingTask) {
|
|
|
|
case STATUS_ICON_TASK_NONE:
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_LOAD:
|
|
|
|
switch (icon->status3.removing) {
|
2022-08-17 03:04:23 +02:00
|
|
|
case STATUS_TRANSPARENT:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status3.removingElementID, &HES_TransparentEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
default:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status3.removingElementID, &HES_Item_Present);
|
2022-01-10 16:55:26 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon->status3.frameCounter = 20;
|
|
|
|
icon->status3.removingTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_DRAW:
|
|
|
|
if (icon->status3.frameCounter != 0) {
|
|
|
|
icon->status3.frameCounter--;
|
|
|
|
} else {
|
|
|
|
icon->status3.removing = 0;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(icon->status3.removingElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status3.removingTask = STATUS_ICON_TASK_NONE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status4.activeTask == STATUS_ICON_TASK_LOAD) {
|
2022-06-09 21:03:11 +02:00
|
|
|
elementID = icon->status4.activeElementID = hud_element_create(&HES_WeakenedBegin);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(elementID, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status4.activeTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (icon->status4.removingTask) {
|
|
|
|
case STATUS_ICON_TASK_NONE:
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_LOAD:
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(icon->status4.removingElementID, &HES_WeakenedEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status4.frameCounter = 20;
|
|
|
|
icon->status4.removingTask = STATUS_ICON_TASK_DRAW;
|
|
|
|
break;
|
|
|
|
case STATUS_ICON_TASK_DRAW:
|
|
|
|
if (icon->status4.frameCounter != 0) {
|
|
|
|
icon->status4.frameCounter--;
|
|
|
|
} else {
|
|
|
|
icon->status4.removing = 0;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(icon->status4.removingElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->status4.removingTask = STATUS_ICON_TASK_NONE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->boostJump.removing) {
|
|
|
|
if (icon->boostJump.removing == 1) {
|
|
|
|
s32 index = icon->prevIndexBoostJump;
|
|
|
|
|
2022-03-12 10:49:32 +01:00
|
|
|
if (get_hud_element(index)->flags & HUD_ELEMENT_FLAGS_ANIMATION_FINISHED) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(index);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->boostJump.removing = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->boostHammer.removing) {
|
|
|
|
if (icon->boostHammer.removing == 1) {
|
|
|
|
s32 index = icon->prevIndexBoostHammer;
|
|
|
|
|
2022-03-12 10:49:32 +01:00
|
|
|
if (get_hud_element(index)->flags & HUD_ELEMENT_FLAGS_ANIMATION_FINISHED) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(index);
|
2022-01-10 16:55:26 +01:00
|
|
|
icon->boostHammer.removing = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void draw_all_status_icons(void* data) {
|
|
|
|
PopupMessage* popup = data;
|
2022-01-10 16:55:26 +01:00
|
|
|
HudStatusIcon* icon;
|
|
|
|
s32 elementId;
|
|
|
|
f32 x, y, z;
|
|
|
|
s32 screenX, screenY, screenZ;
|
|
|
|
s32 isActiveDrawn, iconCounter;
|
|
|
|
s32 offsetY;
|
|
|
|
Camera* camera = &gCameras[gCurrentCameraID];
|
|
|
|
int i;
|
|
|
|
|
|
|
|
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE, 12, 20, SCREEN_WIDTH - 12, SCREEN_HEIGHT - 20);
|
|
|
|
gDPPipeSync(gMasterGfxPos++);
|
|
|
|
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
|
|
|
|
gDPSetTexturePersp(gMasterGfxPos++, G_TP_NONE);
|
|
|
|
gDPSetTextureLOD(gMasterGfxPos++, G_TL_TILE);
|
|
|
|
gDPSetTextureDetail(gMasterGfxPos++, G_TD_CLAMP);
|
|
|
|
gDPSetTextureConvert(gMasterGfxPos++, G_TC_FILT);
|
|
|
|
gDPSetCombineKey(gMasterGfxPos++, G_CK_NONE);
|
|
|
|
gDPSetAlphaCompare(gMasterGfxPos++, G_AC_NONE);
|
|
|
|
gDPNoOp(gMasterGfxPos++);
|
|
|
|
gDPSetColorDither(gMasterGfxPos++, G_CD_DISABLE);
|
|
|
|
gDPSetAlphaDither(gMasterGfxPos++, G_AD_DISABLE);
|
|
|
|
gSPTexture(gMasterGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
|
|
|
|
|
|
|
|
for (i = 0, icon = D_800A0F44; i < MAX_ICONS; i++, icon++) {
|
|
|
|
if (icon->flags == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
iconCounter = 0;
|
|
|
|
isActiveDrawn = 0;
|
|
|
|
if (icon->status1.activeTask == STATUS_ICON_TASK_DRAW) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_DEBUFF) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status1.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status1OffsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status1.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
iconCounter = 1;
|
|
|
|
isActiveDrawn = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status1.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status1.removingElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
if (isActiveDrawn == 0) {
|
|
|
|
iconCounter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status1OffsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status1Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status1.removingElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
isActiveDrawn = 0;
|
|
|
|
if (icon->status2.activeTask == STATUS_ICON_TASK_DRAW) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_STATIC) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status2.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 0) {
|
|
|
|
offsetY = -17;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status2OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status2.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
iconCounter++;
|
|
|
|
isActiveDrawn = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status2.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status2.removingElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 0) {
|
|
|
|
offsetY = -17;
|
|
|
|
}
|
|
|
|
if (isActiveDrawn == 0) {
|
|
|
|
iconCounter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status2OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status2Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status2.removingElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
isActiveDrawn = 0;
|
|
|
|
if (icon->status3.activeTask == STATUS_ICON_TASK_DRAW) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_TRANSPARENT) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status3.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 1) {
|
|
|
|
offsetY = -17;
|
|
|
|
} if (iconCounter == 0) {
|
|
|
|
offsetY = -34;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status3OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status3.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
iconCounter++;
|
|
|
|
isActiveDrawn = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status3.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status3.removingElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 1) {
|
|
|
|
offsetY = -17;
|
|
|
|
}
|
|
|
|
if (iconCounter == 0) {
|
|
|
|
offsetY = -34;
|
|
|
|
}
|
|
|
|
if (isActiveDrawn == 0) {
|
|
|
|
iconCounter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status3OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status3Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status3.removingElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
isActiveDrawn = 0;
|
|
|
|
if (icon->status4.activeTask == STATUS_ICON_TASK_DRAW) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_STATUS_CHILL_OUT) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status4.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 2) {
|
|
|
|
offsetY = -17;
|
|
|
|
}
|
|
|
|
if (iconCounter == 1) {
|
|
|
|
offsetY = -34;
|
|
|
|
}
|
|
|
|
if (iconCounter == 0) {
|
|
|
|
offsetY = -51;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status4OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status4.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
iconCounter++;
|
|
|
|
isActiveDrawn = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (icon->status4.removingTask == STATUS_ICON_TASK_DRAW && (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1)) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->status4.removingElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
offsetY = 0;
|
|
|
|
if (iconCounter == 2) {
|
|
|
|
offsetY = -17;
|
|
|
|
}
|
|
|
|
if (iconCounter == 1) {
|
|
|
|
offsetY = -34;
|
|
|
|
}
|
|
|
|
if (iconCounter == 0) {
|
|
|
|
offsetY = -51;
|
|
|
|
}
|
|
|
|
if (isActiveDrawn == 0) {
|
|
|
|
iconCounter++;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
y = icon->worldPos.y + icon->status4OffsetY + offsetY;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
add_vec2D_polar(&x, &z, icon->status4Radius, clamp_angle(camera->currentYaw + 90));
|
|
|
|
get_screen_coords(gCurrentCameraID, x, y, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->status4.removingElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX - 8, screenY - 8);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->boostJump.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_JUMP) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->boostJump.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->boostJump.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 12);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
if (icon->boostJump.removing) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->prevIndexBoostJump, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->prevIndexBoostJump;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 12);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->boostHammer.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_HAMMER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->boostHammer.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->boostHammer.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 12);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
if (icon->boostHammer.removing) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->prevIndexBoostHammer, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->prevIndexBoostHammer;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 12);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->boostPartner.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_BOOST_PARTNER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->boostPartner.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->boostPartner.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 12);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->surprise.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_SURPRISE) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->surprise.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->surprise.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 15);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->peril.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_PERIL) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->peril.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->peril.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 16);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
|
|
|
|
do {
|
|
|
|
if (icon->danger.active) {
|
|
|
|
if (icon->flags & STATUS_ICON_FLAG_DANGER) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
} else if (icon->flags & STATUS_ICON_FLAG_BATTLE || gGameStatusPtr->isBattle != 1) {
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_clear_flags(icon->danger.activeElementID, HUD_ELEMENT_FLAGS_DISABLED);
|
2022-01-10 16:55:26 +01:00
|
|
|
|
|
|
|
x = icon->worldPos.x;
|
|
|
|
z = icon->worldPos.z;
|
|
|
|
|
|
|
|
get_screen_coords(gCurrentCameraID, x, icon->worldPos.y + icon->offsetY, z, &screenX, &screenY, &screenZ);
|
|
|
|
elementId = icon->danger.activeElementID;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_render_pos(elementId, screenX + 2, screenY - 16);
|
|
|
|
hud_element_draw_next(elementId);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} while (0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
s32 create_status_icon_set(void) {
|
|
|
|
s32 i;
|
|
|
|
HudStatusIcon* icon;
|
|
|
|
|
|
|
|
for (icon = D_800A0F44, i = 0; i < MAX_ICONS; icon++, i++) {
|
|
|
|
if (icon->flags == 0) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ASSERT(i < MAX_ICONS);
|
|
|
|
|
|
|
|
icon->flags = STATUS_ICON_FLAG_USED;
|
|
|
|
if (gGameStatusPtr->isBattle) {
|
|
|
|
icon->flags = STATUS_ICON_FLAG_BATTLE | STATUS_ICON_FLAG_USED;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon->worldPos.x = 0;
|
|
|
|
icon->worldPos.y = 0;
|
|
|
|
icon->worldPos.z = 0;
|
|
|
|
|
|
|
|
icon->status1Radius = 0;
|
|
|
|
icon->status1OffsetY = 0;
|
|
|
|
icon->status2Radius = 0;
|
|
|
|
icon->status2OffsetY = 0;
|
|
|
|
icon->status3Radius = 0;
|
|
|
|
icon->status3OffsetY = 0;
|
|
|
|
icon->status4Radius = 0;
|
|
|
|
icon->status4OffsetY = 0;
|
|
|
|
icon->status1.active = 0;
|
|
|
|
icon->status1.removing = 0;
|
|
|
|
icon->status1.activeTask = 0;
|
|
|
|
icon->status1.removingTask = 0;
|
|
|
|
icon->status2.active = 0;
|
|
|
|
icon->status2.removing = 0;
|
|
|
|
icon->status2.activeTask = 0;
|
|
|
|
icon->status2.removingTask = 0;
|
|
|
|
icon->status3.active = 0;
|
|
|
|
icon->status3.removing = 0;
|
|
|
|
icon->status3.activeTask = 0;
|
|
|
|
icon->status3.removingTask = 0;
|
|
|
|
icon->status4.active = 0;
|
|
|
|
icon->status4.removing = 0;
|
|
|
|
icon->status4.activeTask = 0;
|
|
|
|
icon->status4.removingTask = 0;
|
|
|
|
icon->boostJump.active = 0;
|
|
|
|
icon->boostJump.removing = 0;
|
|
|
|
icon->boostHammer.active = 0;
|
|
|
|
icon->boostHammer.removing = 0;
|
|
|
|
icon->boostPartner.active = 0;
|
|
|
|
icon->surprise.active = 0;
|
|
|
|
icon->peril.active = 0;
|
|
|
|
icon->danger.active = 0;
|
|
|
|
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_all_status_icons(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
remove_status_debuff(iconID);
|
|
|
|
remove_status_static(iconID);
|
|
|
|
remove_status_transparent(iconID);
|
|
|
|
remove_status_chill_out(iconID);
|
|
|
|
remove_status_icon_boost_jump(iconID);
|
|
|
|
remove_status_icon_boost_hammer(iconID);
|
|
|
|
remove_status_icon_boost_partner(iconID);
|
|
|
|
remove_status_icon_surprise(iconID);
|
|
|
|
remove_status_icon_peril(iconID);
|
|
|
|
remove_status_icon_danger(iconID);
|
|
|
|
statusIcon->flags = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_status_icons_properties(s32 iconID, f32 x, f32 y, f32 z, s32 arg, s32 arg2, s32 radius, s32 offsetY) {
|
|
|
|
HudStatusIcon* icon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
icon->worldPos.x = x;
|
|
|
|
icon->worldPos.y = y;
|
|
|
|
icon->worldPos.z = z;
|
|
|
|
icon->status1Radius = radius + 17;
|
|
|
|
icon->status1OffsetY = offsetY;
|
|
|
|
icon->status2Radius = radius + 17;
|
|
|
|
icon->status2OffsetY = offsetY + 17;
|
|
|
|
icon->status3Radius = radius + 17;
|
|
|
|
icon->status3OffsetY = offsetY + 34;
|
|
|
|
icon->status4Radius = radius + 17;
|
|
|
|
icon->status4OffsetY = offsetY + 51;
|
|
|
|
}
|
|
|
|
|
2022-08-17 03:04:23 +02:00
|
|
|
void set_status_icons_offset(s32 iconID, s32 offsetY, f32 offsetX) {
|
2022-01-10 16:55:26 +01:00
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->offsetY = offsetY;
|
2022-08-17 03:04:23 +02:00
|
|
|
statusIcon->offsetX = offsetX;
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_debuff(s32 iconID, s32 statusID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_DEBUFF;
|
|
|
|
if (statusIcon->status1.active != statusID) {
|
|
|
|
remove_status_debuff(iconID);
|
|
|
|
statusIcon->status1.active = statusID;
|
|
|
|
statusIcon->status1.activeTask = STATUS_ICON_TASK_LOAD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_debuff(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->status1.active && !statusIcon->status1.removing) {
|
|
|
|
statusIcon->status1.removing = statusIcon->status1.active;
|
|
|
|
statusIcon->status1.removingTask = STATUS_ICON_TASK_LOAD;
|
|
|
|
statusIcon->status1.active = STATUS_END;
|
|
|
|
statusIcon->status1.activeTask = STATUS_ICON_TASK_NONE;
|
|
|
|
statusIcon->status1.frameCounter = 10;
|
|
|
|
statusIcon->status1.removingElementID = statusIcon->status1.activeElementID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_debuff(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_DEBUFF;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_static(s32 iconID, s32 statusID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_STATIC;
|
|
|
|
if (statusIcon->status2.active != statusID) {
|
|
|
|
remove_status_static(iconID);
|
|
|
|
statusIcon->status2.active = statusID;
|
|
|
|
statusIcon->status2.activeTask = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_static(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->status2.active && !statusIcon->status2.removing) {
|
|
|
|
statusIcon->status2.removing = statusIcon->status2.active;
|
|
|
|
statusIcon->status2.removingTask = TRUE;
|
|
|
|
statusIcon->status2.active = FALSE;
|
|
|
|
statusIcon->status2.activeTask = FALSE;
|
|
|
|
statusIcon->status2.frameCounter = 10;
|
|
|
|
statusIcon->status2.removingElementID = statusIcon->status2.activeElementID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_2(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_STATIC;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_transparent(s32 iconID, s32 statusID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_TRANSPARENT;
|
|
|
|
if (statusIcon->status3.active != statusID) {
|
|
|
|
remove_status_transparent(iconID);
|
|
|
|
statusIcon->status3.active = statusID;
|
|
|
|
statusIcon->status3.activeTask = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_transparent(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->status3.active && !statusIcon->status3.removing) {
|
|
|
|
statusIcon->status3.removing = statusIcon->status3.active;
|
|
|
|
statusIcon->status3.removingTask = TRUE;
|
|
|
|
statusIcon->status3.active = FALSE;
|
|
|
|
statusIcon->status3.activeTask = FALSE;
|
|
|
|
statusIcon->status3.frameCounter = 10;
|
|
|
|
statusIcon->status3.removingElementID = statusIcon->status3.activeElementID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_transparent(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_TRANSPARENT;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_chill_out(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_STATUS_CHILL_OUT;
|
|
|
|
if (!statusIcon->status4.active) {
|
|
|
|
statusIcon->status4.active = TRUE;
|
|
|
|
statusIcon->status4.activeTask = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_chill_out(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->status4.active && !statusIcon->status4.removing) {
|
|
|
|
statusIcon->status4.removing = statusIcon->status4.active;
|
|
|
|
statusIcon->status4.removingTask = TRUE;
|
|
|
|
statusIcon->status4.active = FALSE;
|
|
|
|
statusIcon->status4.activeTask = FALSE;
|
|
|
|
statusIcon->status4.frameCounter = 10;
|
|
|
|
statusIcon->status4.removingElementID = statusIcon->status4.activeElementID;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_chill_out(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_STATUS_CHILL_OUT;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_boost_jump(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_BOOST_JUMP;
|
|
|
|
if (!statusIcon->boostJump.active) {
|
|
|
|
statusIcon->boostJump.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_BoostJumpBegin);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->boostJump.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_boost_jump(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->boostJump.active) {
|
|
|
|
s32 hudElemIndex = statusIcon->boostJump.activeElementID;
|
|
|
|
statusIcon->boostJump.active = FALSE;
|
|
|
|
statusIcon->boostJump.removing = TRUE;
|
|
|
|
statusIcon->prevIndexBoostJump = hudElemIndex;
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(hudElemIndex, &HES_BoostJumpEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_boost_jump(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_BOOST_JUMP;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_boost_hammer(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_BOOST_HAMMER;
|
|
|
|
if (!statusIcon->boostHammer.active) {
|
|
|
|
statusIcon->boostHammer.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_BoostHammerBegin);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->boostHammer.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_boost_hammer(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->boostHammer.active) {
|
|
|
|
s32 hudElemIndex = statusIcon->boostHammer.activeElementID;
|
|
|
|
statusIcon->boostHammer.active = FALSE;
|
|
|
|
statusIcon->boostHammer.removing = FALSE;
|
|
|
|
statusIcon->prevIndexBoostHammer = hudElemIndex;
|
2022-06-09 21:03:11 +02:00
|
|
|
hud_element_set_script(hudElemIndex, &HES_BoostHammerEnd);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_boost_hammer(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_BOOST_HAMMER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_boost_partner(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_BOOST_PARTNER;
|
|
|
|
if (!statusIcon->boostPartner.active) {
|
|
|
|
statusIcon->boostPartner.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_BoostPartner);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->boostPartner.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_boost_partner(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->boostPartner.active) {
|
|
|
|
statusIcon->boostPartner.active = FALSE;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(statusIcon->boostPartner.activeElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_boost_partner(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_BOOST_PARTNER;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_surprise(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_SURPRISE;
|
|
|
|
if (!statusIcon->surprise.active) {
|
|
|
|
statusIcon->surprise.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_Surprise);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->surprise.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_surprise(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->surprise.active) {
|
|
|
|
statusIcon->surprise.active = FALSE;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(statusIcon->surprise.activeElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_surprise(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_SURPRISE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_peril(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_PERIL;
|
|
|
|
if (!statusIcon->peril.active) {
|
|
|
|
statusIcon->peril.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_Peril);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->peril.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_peril(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->peril.active) {
|
|
|
|
statusIcon->peril.active = FALSE;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(statusIcon->peril.activeElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_peril(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_PERIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void create_status_icon_danger(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
s32 hudElement;
|
|
|
|
|
|
|
|
statusIcon->flags &= ~STATUS_ICON_FLAG_DANGER;
|
|
|
|
if (!statusIcon->danger.active) {
|
|
|
|
statusIcon->danger.active = TRUE;
|
2022-06-09 21:03:11 +02:00
|
|
|
hudElement = hud_element_create(&HES_Danger);
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_DISABLED);
|
|
|
|
hud_element_set_flags(hudElement, HUD_ELEMENT_FLAGS_80);
|
2022-01-10 16:55:26 +01:00
|
|
|
statusIcon->danger.activeElementID = hudElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void remove_status_icon_danger(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
if (statusIcon->danger.active) {
|
|
|
|
statusIcon->danger.active = FALSE;
|
2022-03-26 12:47:10 +01:00
|
|
|
hud_element_free(statusIcon->danger.activeElementID);
|
2022-01-10 16:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void enable_status_icon_danger(s32 iconID) {
|
|
|
|
HudStatusIcon* statusIcon = &D_800A0F44[iconID];
|
|
|
|
|
|
|
|
statusIcon->flags |= STATUS_ICON_FLAG_DANGER;
|
|
|
|
}
|
|
|
|
|
|
|
|
const f32 status_icons_rodata_alignment = 0.0f;
|