summaryrefslogtreecommitdiff
path: root/src/code/z_lifemeter.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2022-12-08 13:54:38 -0500
committerGitHub <noreply@github.com>2022-12-08 15:54:38 -0300
commitb73d18b1541b39f99fcbc085f3119b73777fea89 (patch)
tree2efa387b8cb98049327614f6ad9cf6318fb49fa7 /src/code/z_lifemeter.c
parentea83e49e6e2790b6cd7477110c8d1c535420b64e (diff)
`z_parameter`: Main (#1157)
* main docs * formatting and bss issues * PR Suggestions * missed enums * better macros/enums * restrictions improvement, still wip * fix name, more common restriction patterns * more restrictions cleanup * rm comment
Diffstat (limited to 'src/code/z_lifemeter.c')
-rw-r--r--src/code/z_lifemeter.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/code/z_lifemeter.c b/src/code/z_lifemeter.c
index d4927ae97..669aa338a 100644
--- a/src/code/z_lifemeter.c
+++ b/src/code/z_lifemeter.c
@@ -36,7 +36,7 @@ TexturePtr HeartDDTextures[] = {
void LifeMeter_Init(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- interfaceCtx->unkTimer = 320;
+ interfaceCtx->healthTimer = 320;
interfaceCtx->health = gSaveContext.save.playerData.health;
@@ -167,39 +167,44 @@ void LifeMeter_UpdateColors(PlayState* play) {
sBeatingHeartsDDEnv[2] = (u8)(bFactor + 0) & 0xFF;
}
+// Unused
s32 LifeMeter_SaveInterfaceHealth(PlayState* play) {
- gSaveContext.save.playerData.health = play->interfaceCtx.health;
+ InterfaceContext* interfaceCtx = &play->interfaceCtx;
+
+ gSaveContext.save.playerData.health = interfaceCtx->health;
return 1;
}
+// Unused
s32 LifeMeter_IncreaseInterfaceHealth(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- interfaceCtx->unkTimer = 320;
+ interfaceCtx->healthTimer = 320;
interfaceCtx->health += 0x10;
if (play->interfaceCtx.health >= gSaveContext.save.playerData.health) {
play->interfaceCtx.health = gSaveContext.save.playerData.health;
- return 1;
+ return true;
}
- return 0;
+ return false;
}
+// Unused
s32 LifeMeter_DecreaseInterfaceHealth(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
- if (interfaceCtx->unkTimer != 0) {
- interfaceCtx->unkTimer--;
+ if (interfaceCtx->healthTimer != 0) {
+ interfaceCtx->healthTimer--;
} else {
- interfaceCtx->unkTimer = 320;
+ interfaceCtx->healthTimer = 320;
interfaceCtx->health -= 0x10;
if (interfaceCtx->health <= 0) {
interfaceCtx->health = 0;
play->damagePlayer(play, -(((void)0, gSaveContext.save.playerData.health) + 1));
- return 1;
+ return true;
}
}
- return 0;
+ return false;
}
void LifeMeter_Draw(PlayState* play) {