Match and link CHealthInfo

Former-commit-id: a859570ce0
This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-14 01:37:09 +03:00
parent 7e940d50d7
commit 85358450a7
4 changed files with 15 additions and 2 deletions

View File

@ -280,7 +280,7 @@ LIBS = [
"MetroidPrime/HUD/CHudBallInterface",
"MetroidPrime/Tweaks/CTweakGuiColors",
"MetroidPrime/ScriptObjects/CFishCloud",
"MetroidPrime/CHealthInfo",
["MetroidPrime/CHealthInfo", True],
"MetroidPrime/Player/CGameState",
"MetroidPrime/ScriptObjects/CScriptVisorFlare",
"MetroidPrime/ScriptObjects/CScriptWorldTeleporter",

View File

@ -3,9 +3,12 @@
#include "types.h"
class CInputStream;
class CHealthInfo {
public:
CHealthInfo(float hp, float resist) : x0_health(hp), x4_knockbackResistance(resist) {}
explicit CHealthInfo(CInputStream&);
void SetHP(float hp) { x0_health = hp; }
void SetKnockbackResistance(float resist) { x4_knockbackResistance = resist; }
float GetHP() const { return x0_health; }

View File

@ -247,7 +247,7 @@ METROIDPRIME :=\
$(BUILD_DIR)/asm/MetroidPrime/HUD/CHudBallInterface.o\
$(BUILD_DIR)/asm/MetroidPrime/Tweaks/CTweakGuiColors.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CFishCloud.o\
$(BUILD_DIR)/asm/MetroidPrime/CHealthInfo.o\
$(BUILD_DIR)/src/MetroidPrime/CHealthInfo.o\
$(BUILD_DIR)/asm/MetroidPrime/Player/CGameState.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptVisorFlare.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptWorldTeleporter.o\

View File

@ -0,0 +1,10 @@
#include "MetroidPrime/CHealthInfo.hpp"
#include "Kyoto/Streams/CInputStream.hpp"
CHealthInfo::CHealthInfo(CInputStream& in)
{
in.ReadLong();
x0_health = in.ReadFloat();
x4_knockbackResistance = in.ReadFloat();
}