diff options
| author | Yanis002 <35189056+Yanis002@users.noreply.github.com> | 2025-02-07 23:39:39 +0100 |
|---|---|---|
| committer | Yanis002 <35189056+Yanis002@users.noreply.github.com> | 2025-02-07 23:39:39 +0100 |
| commit | a9de8ab2ddd7024fa22c337fe5501e205f20a231 (patch) | |
| tree | ae669980d13f70b188fd48f54151930f8fe60633 /src | |
| parent | 68c6291568148ca26226540bdb0c2f59d7ab6445 (diff) | |
match `EquipHammer::IsUsable`
Diffstat (limited to 'src')
| -rw-r--r-- | src/00_Core/Player/EquipItem.cpp | 2 | ||||
| -rw-r--r-- | src/59_Hammer/Player/EquipHammer.cpp | 47 |
2 files changed, 47 insertions, 2 deletions
diff --git a/src/00_Core/Player/EquipItem.cpp b/src/00_Core/Player/EquipItem.cpp index 9256b13a..8751b91d 100644 --- a/src/00_Core/Player/EquipItem.cpp +++ b/src/00_Core/Player/EquipItem.cpp @@ -14,6 +14,6 @@ s32 EquipItem::vfunc_4c() const {} Vec3p *EquipItem::GetPlayerPos() {} void EquipItem::func_ov000_020be99c(Vec3p *param1) {} void EquipItem::func_ov000_020be9e4(s32 param1, s32 param2, s32 param3, s16 param4) {} -u16 EquipItem::GetAmmo() {} +s16 EquipItem::GetAmmo() const {} void EquipItem::GiveAmmo(u32 amount) {} bool EquipItem::GetHitbox(Cylinder *hitbox) const {} diff --git a/src/59_Hammer/Player/EquipHammer.cpp b/src/59_Hammer/Player/EquipHammer.cpp index 85a024a3..947f3132 100644 --- a/src/59_Hammer/Player/EquipHammer.cpp +++ b/src/59_Hammer/Player/EquipHammer.cpp @@ -1,13 +1,58 @@ #include "Player/EquipHammer.hpp" #include "Player/LinkStateItem.hpp" +#include "Player/PlayerLink.hpp" #include "Map/MapManager.hpp" #include "Item/ItemManager.hpp" +#include "DTCM/UnkStruct_027e0fd4.hpp" +#include "DTCM/UnkStruct_027e0d38.hpp" extern "C" void ApproachAngle_thunk(s16* src, s16* dst, u32 param3); extern "C" void func_ov000_020b853c(void); extern unk32 data_ov059_0219b180; -ARM bool EquipHammer::IsUsable(unk32 param1) const {} +ARM bool EquipHammer::IsUsable(unk32 param1) const { + ActorNavi *pAVar3; + + if (this->GetAmmo() <= 0) { + return false; + } + + if (data_027e0fd4->mUnk_0f0 != 0 || data_027e0fd4->mUnk_0f8 != 0) { + return false; + } + + pAVar3 = gItemManager->GetFairy(FairyId_Courage); + + if (pAVar3 == NULL || pAVar3->mUnk_3b8 != 0) { + return false; + } + + if (gItemManager->GetUnk_14d() != 0) { + return false; + } + + if (param1 != 0) { + LinkStateItem* pLVar4 = GetLinkStateItem(); + + if (pLVar4->mUnk_25[2] != 0 && pLVar4->mUnk_25[3] == 0) { + return false; + } + + if (data_027e0fd4->mUnk_0c6 < 0 && data_027e0d38->mUnk_0c.func_ov000_020a5e9c() != 0x2f) { + bool bVar5 = false; + + if (gPlayerLink->GetStateId() == 4 && gLinkState != NULL && gLinkState->mSubState == 0) { + bVar5 = true; + } + + if (!bVar5) { + return false; + } + } + } + + return true; +} ARM LinkStateItem *GetLinkStateItem() { return (LinkStateItem*)GetLinkState(1); |
