From a19141c1f0b8879a9caa2a5cb2eb4a3003e99f24 Mon Sep 17 00:00:00 2001 From: Yanis002 <35189056+Yanis002@users.noreply.github.com> Date: Sat, 8 Feb 2025 02:12:17 +0100 Subject: small documentation --- include/Player/EquipHammer.hpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/Player/EquipHammer.hpp b/include/Player/EquipHammer.hpp index b65bbcbf..187100be 100644 --- a/include/Player/EquipHammer.hpp +++ b/include/Player/EquipHammer.hpp @@ -4,19 +4,27 @@ #include "Player/EquipItem.hpp" -class LinkStateItem; +// how long players should wait until the hammer is charged (aka bigger and more powerful) +#define HAMMER_CHARGE_TIMER 40 + +//! TODO: change "state" to "flags"? see `vfunc_2c` +typedef enum EquipHammerState { + /* 0x00000 */ EQUIP_HAMMER_STATE_IDLE = (0 << 16), + /* 0x10000 */ EQUIP_HAMMER_STATE_CHARGING = (1 << 16), + /* 0x20000 */ EQUIP_HAMMER_STATE_CHARGED = (2 << 16), +} EquipHammerState; class EquipHammer : public EquipItem { private: /* 00 (base) */ /* 09 */ unk8 mUnk_09[3]; - /* 0c */ Vec3p mUnk_0c; - /* 18 */ s32 mUnk_18; - /* 1c */ u8 mUnk_1c; - /* 1d */ u8 mUnk_1d; - /* 1e */ unk8 mUnk_1e[2]; - /* 20 */ unk32 mUnk_20; - /* 24 */ unk32 mUnk_24; + /* 0c */ Vec3p mUnk_0c; // hammer's position when it hits a surface? not updated if the hammer can't touch a surface + /* 18 */ EquipHammerState mState; + /* 1c */ bool mIsHeld; // holding the input from the touchscreen + /* 1d */ bool mIsReleased; // released the input from the touchscreen + /* 1e */ unk8 mUnk_1e[2]; // unused? + /* 20 */ s32 mChargeTimer; // charging timer to make it bigger, set to 40 frames by default + /* 24 */ unk32 mUnk_24; // timer that prevents the charge? /* 28 */ unk32 mUnk_28; /* 2c */ @@ -41,16 +49,18 @@ public: bool func_ov059_02198ed4(); void func_ov059_02198f10(Vec3p *vec, unk32 param2, s32 param3); void func_ov059_02198fa8(unk32 param1); - bool func_ov059_02198fe0(); + bool IsHammerCharged(); - inline s32 GetUnk_18(void) { - return mUnk_18; + inline s32 GetState(void) { + return mState; } - inline unk32 GetUnk_20(void) { - return mUnk_20; + inline unk32 GetChargeTimer(void) { + return mChargeTimer; } }; +class LinkStateItem; + extern LinkStateItem *GetLinkStateItem(); extern EquipHammer *GetEquipHammer(); -- cgit v1.2.3