Match and link CHealthInfo

This commit is contained in:
Henrique Gemignani Passos Lima 2022-10-14 01:37:09 +03:00
parent b923d9cb52
commit a859570ce0
No known key found for this signature in database
GPG Key ID: E224F951761145F8
4 changed files with 15 additions and 2 deletions

View File

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

View File

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

View File

@ -247,7 +247,7 @@ METROIDPRIME :=\
$(BUILD_DIR)/asm/MetroidPrime/HUD/CHudBallInterface.o\ $(BUILD_DIR)/asm/MetroidPrime/HUD/CHudBallInterface.o\
$(BUILD_DIR)/asm/MetroidPrime/Tweaks/CTweakGuiColors.o\ $(BUILD_DIR)/asm/MetroidPrime/Tweaks/CTweakGuiColors.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CFishCloud.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/Player/CGameState.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptVisorFlare.o\ $(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptVisorFlare.o\
$(BUILD_DIR)/asm/MetroidPrime/ScriptObjects/CScriptWorldTeleporter.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();
}