mirror of
https://github.com/zeldaret/ph
synced 2026-07-10 14:23:55 -04:00
PlayerControl: Decomp 7%
This commit is contained in:
@@ -121,7 +121,7 @@ ARM FairyId ItemManager::GetEquippedFairy() const {
|
||||
return fairy;
|
||||
}
|
||||
|
||||
ARM ActorNavi *ItemManager::GetFairy(FairyId id) const {
|
||||
ARM ActorNaviBase *ItemManager::GetFairy(FairyId id) const {
|
||||
return mFairies[id];
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ extern void *data_027e10a4;
|
||||
extern "C" bool func_ov15_02136670(void *param1);
|
||||
extern unk8 data_ov29_0217a4ac[];
|
||||
ARM bool ItemManager::func_ov00_020ad790(unk32 param1) {
|
||||
unk32 unk1 = data_027e0d38->func_ov00_02078b40();
|
||||
unk32 unk1 = data_027e0d38->func_ov000_02078b40();
|
||||
if (unk1 == 2) return func_ov15_02136670(data_027e10a4);
|
||||
if (data_027e0d38->mUnk_14 == 1) return false;
|
||||
// NONMATCH: OverlayId_29 should be in constant pool
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include "Player/LinkStateItem.hpp"
|
||||
#include "DTCM/UnkStruct_027e103c.hpp"
|
||||
#include "DTCM/UnkStruct_027e1098.hpp"
|
||||
#include "Item/ItemManager.hpp"
|
||||
#include "Player/EquipBomb.hpp"
|
||||
#include "Player/EquipHammer.hpp"
|
||||
@@ -7,15 +9,8 @@
|
||||
#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);
|
||||
|
||||
extern s32 *data_027e103c;
|
||||
extern s32 *data_027e1098;
|
||||
|
||||
THUMB void LinkStateItem::vfunc_00() {}
|
||||
|
||||
ARM LinkStateId LinkStateItem::GetId() {
|
||||
@@ -39,11 +34,11 @@ ARM void LinkStateItem::OnStateLeave(s32 param1) {
|
||||
|
||||
switch (this->mEquipId) {
|
||||
case ItemFlag_BombchuBag:
|
||||
iVar3 = func_ov000_020cf01c(data_027e103c);
|
||||
iVar3 = data_027e103c->func_ov000_020cf01c();
|
||||
if (*(u8 *) (iVar3 + 0xe0) == '\0') {
|
||||
func_ov014_0213ec64((s32) GetEquipBombchu());
|
||||
GetEquipBombchu()->func_ov014_0213ec64();
|
||||
}
|
||||
func_ov014_0211fd04(data_027e1098);
|
||||
data_027e1098->func_ov014_0211fd04();
|
||||
break;
|
||||
case ItemFlag_OshusSword: break;
|
||||
case ItemFlag_WoodenShield: break;
|
||||
@@ -54,9 +49,9 @@ ARM void LinkStateItem::OnStateLeave(s32 param1) {
|
||||
case ItemFlag_Hammer: EquipHammer::StopUsing(this); break;
|
||||
case ItemFlag_PotionA:
|
||||
case ItemFlag_PotionB:
|
||||
iVar3 = (int) (data_027e103c);
|
||||
*(unk8 *) ((s16 *) data_027e103c + 0x15) = 0;
|
||||
func_ov000_020cf9dc(iVar3, 0, 0);
|
||||
UnkStruct_027e103c *unk = data_027e103c;
|
||||
unk->mUnk_2a = 0;
|
||||
unk->func_ov000_020cf9dc(0, 0);
|
||||
break;
|
||||
case ItemFlag_Shovel: EquipScoop::StopUsing(this); break;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#include "Player/PlayerControl.hpp"
|
||||
#include "Actor/ActorManager.hpp"
|
||||
#include "Actor/ActorNaviBase.hpp"
|
||||
#include "DTCM/UnkStruct_027e05f8.hpp"
|
||||
#include "DTCM/UnkStruct_027e077c.hpp"
|
||||
#include "DTCM/UnkStruct_027e0c68.hpp"
|
||||
#include "DTCM/UnkStruct_027e0d38.hpp"
|
||||
#include "DTCM/UnkStruct_027e103c.hpp"
|
||||
#include "Item/ItemManager.hpp"
|
||||
#include "Player/PlayerBase.hpp"
|
||||
#include "Save/AdventureFlags.hpp"
|
||||
|
||||
ARM bool PlayerControl::func_ov00_020aeeac() {
|
||||
@@ -82,8 +84,9 @@ ARM void PlayerControl::func_ov00_020af06c() {
|
||||
mUsingEquipItem = false;
|
||||
return;
|
||||
}
|
||||
bool usingEquipItem = mUsingEquipItem;
|
||||
if (mUnk_7a) {
|
||||
mUnk_7b = mUsingEquipItem;
|
||||
mUnk_7b = usingEquipItem;
|
||||
}
|
||||
if (gAdventureFlags->func_ov00_02097738() || data_027e0c68->mUnk_04 != 0) {
|
||||
if (data_027e0d38->func_ov000_02078b40() != 2) {
|
||||
@@ -91,27 +94,47 @@ ARM void PlayerControl::func_ov00_020af06c() {
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (gItemManager->mEquippedItem == ItemFlag_PotionA) {
|
||||
if (gItemManager->HasPotion(0)) {
|
||||
ItemManager *itemManager = gItemManager;
|
||||
if (itemManager->mEquippedItem == ItemFlag_PotionA) {
|
||||
if (itemManager->HasPotion(0)) {
|
||||
mUsingEquipItem = true;
|
||||
return;
|
||||
}
|
||||
} else if (gItemManager->mEquippedItem == ItemFlag_PotionB) {
|
||||
if (gItemManager->HasPotion(1)) {
|
||||
} else if (itemManager->mEquippedItem == ItemFlag_PotionB) {
|
||||
if (itemManager->HasPotion(1)) {
|
||||
mUsingEquipItem = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data_027e0d38->func_ov000_02078b40() == 2) {
|
||||
mUnk_7b = false;
|
||||
mUnk_7b = (mUnk_7b & gItemManager->func_ov00_020ad790(1)) != 0;
|
||||
mUnk_7b = true;
|
||||
mUnk_7b = (mUnk_7b & itemManager->func_ov00_020ad790(1)) != 0;
|
||||
} else {
|
||||
if (((data_027e05f8.mUnk_0 & 0x300) == 0) || !func_ov00_020aeef8()) {
|
||||
if (((data_027e05f8.mUnk_0 & 0x300) != 0) && mUnk_7e != 0 && func_ov00_020aeef8()) {
|
||||
mUnk_7b = true;
|
||||
} else {
|
||||
if (((data_027e05f8.mUnk_0 & 0x300) == 0) && mUnk_83) {
|
||||
mUnk_7b = false;
|
||||
} else {
|
||||
if (data_027e103c->mUnk_20 == 2 && !mTouch && func_ov00_020aeef8()) {
|
||||
mUnk_7b = !mUnk_7b;
|
||||
mUnk_7c = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
mUnk_7b = (mUnk_7b & itemManager->func_ov00_020ad790(1)) != 0;
|
||||
|
||||
if (itemManager->mEquippedItem == ItemFlag_Hammer && !mUsingEquipItem && mUnk_7b == true) {
|
||||
ActorNaviBase *courageFairy = itemManager->GetFairy(FairyId_Courage);
|
||||
if (courageFairy != NULL) {
|
||||
mAimWorld.x = courageFairy->mPos.x;
|
||||
mAimWorld.y = gPlayerPos.y + FLOAT_TO_Q20(0.5);
|
||||
mAimWorld.z = courageFairy->mPos.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!mUnk_7a) {
|
||||
mUsingEquipItem = mUnk_7b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user