LinkStateItem::OnStateLeave 71% match

This commit is contained in:
mike8699
2025-01-01 21:12:01 -05:00
parent 12877211ed
commit bf43adef41
5 changed files with 75 additions and 45 deletions
+65 -35
View File
@@ -4,8 +4,15 @@
#include "Player/EquipItem.hpp"
#include "Player/EquipScoop.hpp"
#include "Player/LinkStateItem.hpp"
#include "Player/PlayerControl.hpp"
#include "Save/AdventureFlags.hpp"
extern unk32 func_ov000_020cf01c(s32 *param1);
extern void func_ov000_020cf9dc(s32 param1, s32 param2, s32 param3);
extern void func_ov014_0213ec64(s32 param1);
extern void func_ov014_0211fd04(s32 param1);
extern void func_ov000_020b7e6c(s32 *param1);
void LinkStateItem::vfunc_00() {}
LinkStateId LinkStateItem::GetId() {
@@ -21,45 +28,68 @@ s32 LinkStateItem::IsHammerEquipped() {
}
}
void LinkStateItem::OnStateLeave(s32 param1) {
EquipItem *pEVar1;
LinkStateMove *pLVar2;
s32 iVar3;
unk32 *puVar4;
EquipItem *pEVar1;
LinkStateMove *pLVar2;
s32 iVar3;
unk32 *puVar4;
unk32 *puVar5;
LinkStateBase::OnStateLeave(param1);
LinkStateBase::OnStateLeave(param1);
switch(this->mEquipId) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
EquipScoop::StopUsing(this);
break;
case 4:
EquipBomb::StopUsing(this);
break;
case 5:
break;
case 6:
EquipRope::StopUsing(this);
break;
case 7:
// TODO
break;
case 8:
EquipHammer::StopUsing(this);
break;
case 9:
case 10:
// TODO
break;
}
switch (this->mEquipId) {
case 0: break;
case 1: break;
case 2: break;
case 3: EquipScoop::StopUsing(this); break;
case 4: EquipBomb::StopUsing(this); break;
case 5: break;
case 6: EquipRope::StopUsing(this); break;
case 7:
/* bombchu */
iVar3 = func_ov000_020cf01c((s32 *) (*(s32 *) 0x20abf44));
if (*(char *) (iVar3 + 0xe0) == '\0') {
func_ov014_0213ec64((s32) GetEquipBombchu());
}
func_ov014_0211fd04(*(s32 *) (0x20abf48));
break;
case 8: EquipHammer::StopUsing(this); break;
case 9:
case 10:
iVar3 = *(int *) (0x20abf44);
*(unk8 *) (iVar3 + 0x2a) = 0;
func_ov000_020cf9dc(iVar3, 0, 0);
}
this->mNextEquip = 0xffffffff;
if (this->mEquipId != -1) {
pEVar1 = this->GetEquipItem(this->mEquipId);
pEVar1->vfunc_1c();
}
if ((this->mEquipId <= 9 && this->mEquipId >= 9) || (this->mEquipId <= 1 && this->mEquipId >= -1)) {
this->EquipItem_vfunc_28();
} else {
this->EquipItem_vfunc_28();
if (param1 != 4 && param1 != 2) {
pLVar2 = this->GetLinkStateMove();
pLVar2->mUnk_14 = true;
}
}
this->mNextEquip = 0xffffffff;
puVar4 = (unk32 *) this + 20;
puVar5 = (unk32 *) this + 22;
for (; puVar4 != puVar5; puVar4 = puVar4 + 4) {
func_ov000_020b7e6c(puVar4);
}
if (gPlayerControl->mUnk_80 != false) {
gPlayerControl->StopFollowing();
}
this->mUnk_25[1] = 0;
return;
}
EquipBombchu *LinkStateItem::GetEquipBombchu() {