Merge branch 'main' into decomp/MapManager

This commit is contained in:
SammygoodTunes
2025-06-03 23:52:44 +02:00
committed by GitHub
68 changed files with 2393 additions and 390 deletions
+5 -14
View File
@@ -5,6 +5,8 @@ extern "C" {
#include "Actor/Actor.hpp"
#include "Actor/ActorManager.hpp"
#include "Actor/ActorPlayerDummy.hpp"
#include "DTCM/UnkStruct_027e077c.hpp"
#include "DTCM/UnkStruct_027e103c.hpp"
#include "Item/ItemManager.hpp"
#include "Map/MapManager.hpp"
#include "Player/EquipSword.hpp"
@@ -115,7 +117,7 @@ ARM bool Actor::vfunc_08() {
return true;
}
ARM void Actor::vfunc_0c() {}
ARM bool Actor::vfunc_0c() {}
ARM void Actor::vfunc_10(u32 param1) {}
ARM void Actor::vfunc_24() {}
ARM void Actor::vfunc_28() {}
@@ -255,20 +257,9 @@ ARM bool Actor::func_ov00_020c195c() {
return true;
}
struct UnkStruct2 {
/* 0 */ u32 mUnk_0;
/* 4 */ u32 mUnk_4;
/* 8 */
};
extern UnkStruct2 data_027e077c;
extern u8 data_02056be4[];
extern "C" bool func_ov05_02103f4c(s32 param1);
extern s32 data_027e103c;
ARM bool Actor::func_ov00_020c198c() {
u32 unk1 = data_027e077c.mUnk_0;
u32 unk2 = data_027e077c.mUnk_4;
if (data_027e077c.mUnk_0 != data_027e077c.mUnk_4 || (data_02056be4[unk1] & 1) != 0 || (data_02056be4[unk2] & 4) != 0 ||
func_ov05_02103f4c(data_027e103c) || gPlayer->mHealth <= 0)
if (data_027e077c.GetUnk0() != data_027e077c.GetUnk4() || (data_02056be4[data_027e077c.GetUnk0()] & 1) != 0 ||
(data_02056be4[data_027e077c.GetUnk4()] & 4) != 0 || data_027e103c->func_ov005_02103f4c() || gPlayer->mHealth <= 0)
{
return false;
}
+2 -3
View File
@@ -1,4 +1,5 @@
#include "Actor/ActorManager.hpp"
#include "DTCM/UnkStruct_027e077c.hpp"
#include "DTCM/UnkStruct_027e103c.hpp"
#include "Map/MapManager.hpp"
@@ -8,8 +9,6 @@ extern "C" Cylinder *func_ov000_020c3ef0(void *, u32 index);
extern "C" bool func_ov000_020c3f08(void *, u32 index);
extern "C" void func_ov000_020c3f3c(void *, u32 index, Cylinder *cylinder);
extern "C" void func_ov000_020c3f54(void *, u32 param2);
extern s32 data_027e077c;
extern u8 data_02056be4[];
ARM void ActorManager::DeleteActor(u32 index, bool param2) {
if (!param2) {
@@ -52,7 +51,7 @@ ARM void ActorManager::func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr,
q20 minDistance = 0x7fffffff;
Actor **actorIter = actorMgr->mActorTable;
u8 unkByte = data_02056be4[data_027e077c];
u8 unkByte = data_02056be4[data_027e077c.GetUnk0()];
bool unk1 = (unkByte & 1) != 0;
Actor **actorTableEnd = actorIter + actorMgr->mMaxActorIndex;
+102 -7
View File
@@ -1,15 +1,110 @@
#include "Actor/Dungeon/ActorSwitchObject.hpp"
#include "Map/MapManager.hpp"
ActorType ActorSwitchObject::gType = ActorType(ActorTypeId_SwitchObject, (ActorCreateFunc) ActorSwitchObject::Create, NULL);
ActorSwitchObject *ActorSwitchObject::Create() {}
bool ActorSwitchObject::vfunc_08() {}
void ActorSwitchObject::vfunc_0c() {}
void ActorSwitchObject::vfunc_14(u32 param1) {}
void ActorSwitchObject::vfunc_18(u32 param1) {}
bool ActorSwitchObject::func_ov000_0208fc10(s32 param1) {}
void ActorSwitchObject::func_ov000_0208fc7c() {}
bool ActorSwitchObject::vfunc_08() {
Actor::vfunc_08();
this->func_ov000_0208fc7c();
this->mUnk_130 = 0;
return true;
}
bool ActorSwitchObject::vfunc_0c() {
return this->func_ov00_020c1bfc(0) ? this->func_ov000_0208fc10(1) : this->func_ov000_0208fc10(0);
}
void ActorSwitchObject::vfunc_14(u32 param1) {
bool bVar1;
u32 uVar2;
u32 uVar3;
s32 iVar4;
s32 iVar5;
bVar1 = this->func_ov00_020c313c(param1);
if (bVar1 == NULL) {
return;
}
uVar2 = this->mUnk_130;
switch (uVar2) {
default:
if (uVar2 == 2) {
break;
}
return;
case 0:
uVar3 = this->func_ov000_0208fcb4();
switch (uVar3) {
case 1: this->func_ov000_0208fc10(1); return;
case 2: this->func_ov000_0208fc10(2); return;
default: return;
}
bVar1 = this->func_ov000_0208fc10(2);
return;
case 1:
iVar4 = this->func_ov000_0208fcb4();
if (iVar4 == 1) {
return;
}
bVar1 = this->func_ov000_0208fc10(0);
return;
}
iVar5 = this->mActiveFrames + 1;
this->mActiveFrames = iVar5;
if (iVar5 < 0x1e) {
return;
}
this->func_ov000_0209032c();
bVar1 = this->func_ov000_0208fc10(0);
return;
}
void ActorSwitchObject::vfunc_18(u32 param1) {
this->vfunc_14(param1);
}
bool ActorSwitchObject::func_ov000_0208fc10(s32 param1) {
this->mUnk_130 = param1;
switch (param1) {
case 0: this->func_ov00_020c1c20(0, 0); break;
case 1:
this->func_ov00_020c1c20(0, 1);
if (this->mUnk_158 == 0) {
this->mAlive = false;
}
break;
case 2:
this->func_ov000_0208fef8();
this->mActiveFrames = 0;
break;
}
return true;
}
void ActorSwitchObject::func_ov000_0208fc7c() {
this->mUnk_158 = this->mUnk_020.mUnk_00[1];
this->mUnk_15c = this->mUnk_020.mUnk_00[2];
this->mUnk_164 = this->mUnk_020.mUnk_0a[1];
this->mUnk_168 = this->mUnk_164 + this->mUnk_020.mUnk_00[0];
this->mUnk_16c = this->mUnk_020.mUnk_08[1];
this->mUnk_160 = this->mUnk_164;
}
bool ActorSwitchObject::func_ov000_0208fcb4() {}
void ActorSwitchObject::func_ov000_0208fef8() {}
void ActorSwitchObject::func_ov000_0209032c() {}
void ActorSwitchObject::func_ov000_0209032c() {
unk32 i;
for (i = this->mUnk_164; i < this->mUnk_168; i++) {
gMapManager->func_ov00_02084b38(i, this->mUnk_16c, 0);
}
}
ActorSwitchObject::~ActorSwitchObject() {}
+1 -4
View File
@@ -231,7 +231,7 @@ ARM u16 ItemManager::GetAmmo(ItemFlag equipId) const {
return (*mAmmo)[equipId];
}
ARM void ItemManager::GiveAmmo(ItemFlag equipId, u16 amount) {
ARM void ItemManager::GiveAmmo(ItemFlag equipId, u32 amount) {
(*mAmmo)[equipId] += amount;
if ((*mAmmo)[equipId] <= this->GetMaxAmmo(equipId)) return;
(*mAmmo)[equipId] = this->GetMaxAmmo(equipId);
@@ -240,9 +240,6 @@ ARM void ItemManager::GiveAmmo(ItemFlag equipId, u16 amount) {
extern void *data_027e10a4;
extern "C" bool func_ov015_02136670(void *param1);
extern u8 data_ov022_0217a4ac[];
extern "C" bool _ZN14PlayerLinkBase18func_ov00_020bbd80Ei(unk32 param1, unk32 param2);
extern "C" bool _ZNK11ItemManager7HasItemEi();
extern "C" void _ZN11ItemManager12GetEquipItemEi();
ARM bool ItemManager::func_ov00_020ad790(unk32 param1) {
unk32 unk1 = data_027e0d38->func_ov000_02078b40();
if (unk1 == 2) return func_ov015_02136670(data_027e10a4);
+3 -3
View File
@@ -16,7 +16,7 @@ void LinkStateBase::UpdateSwordShieldInUse() {}
void LinkStateBase::func_ov00_020a81b8(unk32 param1, unk32 param2) {}
LinkStateItem *LinkStateBase::GetLinkItemState() {}
void LinkStateBase::LookAt(Vec3p *target) {}
void LinkStateBase::func_ov00_020a81fc() {}
void LinkStateBase::func_ov00_020a81fc(Vec3p *param1, unk32 param2) {}
void LinkStateBase::AddHealth(s16 amount) {}
void LinkStateBase::func_ov00_020a8224(unk32 param1) {}
void LinkStateBase::TurnTo(s16 angle, unk32 param2, unk32 speed) {}
@@ -38,7 +38,7 @@ bool LinkStateBase::func_ov00_020a8638(unk32 param1) {}
void LinkStateBase::Clear_PlayerLinkBase_Unk48(u16 flags) {}
void LinkStateBase::func_ov00_020a8680(unk32 param1, unk16 param2, bool param3) {}
void LinkStateBase::PlayerLinkBase_func_ov00_020bccc8() {}
bool LinkStateBase::PlayerLinkBase_vfunc_58() {}
bool LinkStateBase::PlayerLinkBase_vfunc_58(unk32 param1, ActorRef *param2) {}
bool LinkStateBase::func_ov00_020a8704(s16 *pAngle) {}
bool LinkStateBase::func_ov00_020a8774(Vec3p *param1, s32 angle) {}
void LinkStateBase::func_ov00_020a8844(Vec3p *param1, bool param2, bool param3) {}
@@ -46,7 +46,7 @@ void LinkStateBase::func_ov00_020a8954(bool param1, unk32 *param2) {}
void LinkStateBase::func_ov00_020a8994() {}
void LinkStateBase::func_ov00_020a89bc(unk32 param1, unk32 param2) {}
void LinkStateBase::func_ov00_020a8a08(unk32 param1) {}
void LinkStateBase::func_ov00_020a8a4c(unk32 param1, unk32 param2) {}
void LinkStateBase::func_ov00_020a8a4c(const void *param1, unk32 param2) {}
void LinkStateBase::func_ov00_020a8a90(unk32 param1) {}
void LinkStateBase::func_ov00_020a8ab0(unk32 param1) {}
void LinkStateBase::func_ov00_020a8ad0(unk32 param1) {}
+2 -6
View File
@@ -1,5 +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"
@@ -8,13 +9,8 @@
#include "Player/PlayerControl.hpp"
#include "Save/AdventureFlags.hpp"
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_027e1098;
THUMB void LinkStateItem::vfunc_00() {}
ARM LinkStateId LinkStateItem::GetId() {
@@ -42,7 +38,7 @@ ARM void LinkStateItem::OnStateLeave(s32 param1) {
if (*(u8 *) (iVar3 + 0xe0) == '\0') {
GetEquipBombchu()->func_ov014_0213ec64();
}
func_ov014_0211fd04(data_027e1098);
data_027e1098->func_ov014_0211fd04();
break;
case ItemFlag_OshusSword: break;
case ItemFlag_WoodenShield: break;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Player/LinkStateMove.hpp"
unk32 data_ov000_020e56f0 = 0x800;
unk32 LinkStateMove::data_ov000_020e56f0 = 0x800;
THUMB void LinkStateMove::vfunc_00() {}
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -18,8 +18,8 @@ void PlayerControlData::vfunc_2c() {}
void PlayerControlData::vfunc_30() {}
void PlayerControlData::vfunc_34() {}
unk32 PlayerControlData::vfunc_7c() {}
unk32 PlayerControlData::vfunc_74() {}
unk32 PlayerControlData::vfunc_78() {}
unk32 PlayerControlData::vfunc_74(s32 param1) {}
unk32 PlayerControlData::vfunc_78(s32 param1) {}
void PlayerControlData::func_ov000_020b484c(s32 param1, s32 param2, s32 param3) {}
void PlayerControlData::vfunc_6c(s32 param1, Vec3p *param2) {}
void PlayerControlData::vfunc_5c() {}
+8 -3
View File
@@ -1,5 +1,10 @@
#include "Player/LinkStateMove.hpp"
LinkStateMove::LinkStateMove(PlayerLinkBase *link) :
LinkStateBase(link) {}
LinkStateMove::~LinkStateMove() {}
THUMB LinkStateMove::LinkStateMove(PlayerLinkBase *link) :
LinkStateBase(link),
mUnk_0c(0),
mUnk_14(false),
mUnk_15(false),
mUnk_16(false) {}
THUMB LinkStateMove::~LinkStateMove() {}
+245 -3
View File
@@ -1,5 +1,247 @@
#include "Player/LinkStateMove.hpp"
#include "DTCM/UnkStruct_027e0d38.hpp"
#include "Player/LinkStateDamage.hpp"
#include "Player/LinkStateFollow.hpp"
#include "Player/LinkStateInteract.hpp"
#include "Player/LinkStateItem.hpp"
#include "Player/LinkStateRoll.hpp"
#include "Player/PlayerControl.hpp"
#include "Save/AdventureFlags.hpp"
#include "Unknown/UnkStruct_02037750.hpp"
void LinkStateMove::func_ov005_021113d0() {}
void LinkStateMove::vfunc_1c() {}
bool LinkStateMove::vfunc_3c() {}
class UnkFilterActor : public FilterActorBase {
public:
/* 00 (base) */
/* 04 */ Actor *mActor;
/* 08 */ q20 mUnk_08;
/* 0c */ Vec3p mPos;
/* 18 */ s16 mAngle;
/* 1a */
/* 0 */ virtual bool Filter(Actor *actor) override;
/* 4 */
};
struct UnkStruct_ov005_021123ac {
/* 00 */ unk32 mUnk_00;
/* 04 */ unk32 mUnk_04;
/* 08 */ unk32 mUnk_08;
/* 0c */ unk32 mUnk_0c;
/* 10 */
};
ARM void LinkStateMove::func_ov005_021113d0() {
mUnk_12 = 10;
}
static q4 data_ov005_02112be4 = FLOAT_TO_Q20(16 / 15.0);
static q20 data_ov005_02112be8 = FLOAT_TO_Q20(1 / 64.0);
static q20 data_ov005_02112bec = FLOAT_TO_Q20(1 / 3.0);
static const Vec3p data_ov005_021123ac = {
FLOAT_TO_Q20(0.0122),
FLOAT_TO_Q20(1.0),
FLOAT_TO_Q20(0.0),
};
static Vec3p data_ov005_02112bf0 = {
FLOAT_TO_Q20(0.3),
FLOAT_TO_Q20(0.25),
FLOAT_TO_Q20(0.01),
};
static const volatile q20 data_ov005_021123b8 = FLOAT_TO_Q20(15.0);
extern LinkStateFollow *GetLinkStateFollow();
extern unk32 data_027e0618;
extern "C" bool Lerp(s32 *pValue, s32 dest, s32 factor, unk32 param4, u32 step);
extern unk32 data_027e0ffc;
extern "C" void func_ov000_020ceacc(unk32 *param1, unk32 param2, Vec3p *param3, unk32 param4);
ARM void LinkStateMove::vfunc_1c() {
Actor *grabActor = this->GetGrabActor();
Vec3p sp4C;
s32 temp_r7 = GetLinkStateFollow()->func_ov00_020a9180(&sp4C);
s32 temp_r0 = UnkStruct_02037750::GetLinkStateInteract()->func_ov00_020ab770(&sp4C);
bool var_r9;
if ((temp_r0 == 0) && (temp_r7 == 0)) {
var_r9 = false;
} else {
var_r9 = true;
}
LinkStateDamage *damage = (LinkStateDamage *) GetLinkState(LinkStateId_Damage);
if (damage->vfunc_20(var_r9) != 0) {
this->ChangeLinkState(LinkStateId_Damage);
return;
}
if ((gAdventureFlags->func_ov00_02097738() == 0) && (data_027e0d38->mUnk_14 != 1)) {
LinkStateInteract *interact = (LinkStateInteract *) GetLinkState(LinkStateId_Interact);
if (interact->vfunc_20(var_r9) != 0) {
this->ChangeLinkState(LinkStateId_Interact);
return;
}
LinkStateFollow *follow = (LinkStateFollow *) GetLinkState(LinkStateId_Follow);
if (follow->vfunc_20(var_r9) != 0) {
this->ChangeLinkState(LinkStateId_Follow);
return;
}
LinkStateRoll *roll = (LinkStateRoll *) GetLinkState(LinkStateId_Roll);
if (roll->vfunc_20(var_r9) != 0) {
this->ChangeLinkState(LinkStateId_Roll);
return;
}
LinkStateItem *item = (LinkStateItem *) GetLinkState(LinkStateId_Item);
if (item->vfunc_20(var_r9) != 0) {
this->ChangeLinkState(LinkStateId_Item);
return;
}
}
if ((temp_r0 == 2) || (temp_r7 == 8)) {
this->UpdateSwordShieldInUse();
} else {
if ((temp_r0 == 3) || (temp_r0 == 4) || (temp_r0 == 5) || (temp_r7 == 3) || (temp_r7 == 4) || (temp_r7 == 5) ||
(temp_r7 == 9) || ((temp_r7 - 0xD) <= 1U))
{
this->EquipItem_vfunc_28();
}
}
if (data_027e0618 != 6) {
s32 temp_r7_2 = gPlayerControl->func_ov00_020b0418();
if ((this->func_ov00_020a8f2c() == 0) && (temp_r7_2 > 0)) {
mUnk_0c = temp_r7_2;
}
if (mUnk_0c > 0) {
q4 temp_r8 = data_ov005_02112be4;
s16 temp_r1 = *this->GetPlayerAngle() + this->Get_PlayerControlData_Unk32();
this->TurnTo(temp_r1, temp_r1, temp_r8);
s32 temp_r1_2 = mUnk_0c;
if (temp_r7_2 > temp_r1_2) {
temp_r1_2 = temp_r7_2 - temp_r1_2;
Lerp(&mUnk_0c, temp_r7_2 + temp_r1_2, data_ov005_02112bec, MUL_Q20(data_ov005_02112be8, data_ov005_02112bec),
0x7FFFFFFF);
if (mUnk_0c > FLOAT_TO_Q20(1.0)) {
mUnk_0c = FLOAT_TO_Q20(1.0);
}
} else {
Lerp(&mUnk_0c, temp_r7_2, data_ov000_020e56f0, MUL_Q20(data_ov005_02112be8, data_ov000_020e56f0), 0x7FFFFFFF);
}
}
}
s32 var_r4;
if (mUnk_16 != 1) {
if (var_r9 != 0) {
Vec3p sp40 = {0, 0, 0};
sp40.x = sp4C.x - this->GetPlayerPos()->x;
sp40.z = sp4C.z - this->GetPlayerPos()->z;
if (Vec3p_Length(&sp40) > FLOAT_TO_Q20(0.2)) {
var_r4 = this->func_ov005_0210f808(FLOAT_TO_Q20(1.0), &sp4C, grabActor != NULL);
} else {
gPlayerControl->StopFollowing();
}
} else {
s32 temp_r1_3 = gPlayerControl->func_ov00_020b034c();
var_r4 = this->func_ov005_0210f808(temp_r1_3, NULL, grabActor != NULL);
if (gAdventureFlags->func_ov00_02097750() == 0) {
UnkFilterActor filter;
filter.mActor = NULL;
filter.mUnk_08 = FLOAT_TO_Q20(4.0);
Vec3p pos = *this->GetPlayerPos();
filter.mPos = pos;
filter.mAngle = *this->GetPlayerAngle();
if (gActorManager->FilterActors(&filter, NULL) > 0) {
q20 temp_r1_4 = FLOAT_TO_Q20(4.0) - filter.mUnk_08;
Vec3p spC = filter.mActor->mPos;
spC.y += filter.mActor->mYOffset;
q20 var_r2 = MUL_Q20(temp_r1_4, FLOAT_TO_Q20(0.25)) + FLOAT_TO_Q20(0.1);
if (var_r2 >= FLOAT_TO_Q20(1.0)) {
var_r2 = FLOAT_TO_Q20(1.0);
}
this->func_ov00_020a81fc(&spC, var_r2);
this->func_ov005_021113d0();
}
}
if (mUnk_12 > 0) {
this->func_ov005_021107fc();
mUnk_12 -= 1;
} else if ((this->Get_PlayerLinkBase_Unk5e() != 0) && (var_r4 == 0)) {
this->func_ov00_020a8294(0, FLOAT_TO_Q20(0.2));
this->func_ov00_020a827c(0, FLOAT_TO_Q20(0.2));
}
if ((grabActor != NULL) && (grabActor->mType == ActorTypeId_Cucco)) {
if (this->func_ov00_020a8b80() != 0) {
mUnk_10 = 0x19;
} else if (mUnk_10 > 0) {
*(unk16 *) ((u32) this->func_ov00_020a8d40() + 0xa8) = 0x4CD;
if (mUnk_10 == 0x19) {
func_ov000_020ceacc(&data_027e0ffc, 0x23D, this->GetPlayerPos(), 0);
}
mUnk_10 -= 1;
} else {
LinkStateInteract *interact = UnkStruct_02037750::GetLinkStateInteract();
interact->SetGrabActorVelocity(this->GetPlayerVel());
}
}
}
}
if (this->GetGrabActor() == NULL) {
if (var_r4 <= data_ov005_02112bf0.x) {
this->func_ov005_021112ec();
}
if (mUnk_15) {
if (!mUnk_16) {
this->func_ov00_020a8a4c(&data_ov005_021123ac, 0);
this->func_ov00_020a8ad0(0);
mUnk_16 = true;
} else if (mUnk_0c > 0) {
q20 temp_r4 = data_ov005_021123b8;
if (this->func_ov00_020a8d6c() >= temp_r4) {
this->func_ov00_020a8ad0(this->func_ov00_020a8d6c() - (temp_r4 - FLOAT_TO_Q20(7.0)));
}
} else {
mUnk_15 = false;
mUnk_16 = false;
}
}
ActorRef sp4;
sp4.Reset();
this->PlayerLinkBase_vfunc_58(0, &sp4);
return;
}
this->PlayerLinkBase_vfunc_58(1, this->GetGrabActorRef());
}
ARM bool LinkStateMove::vfunc_3c() {
if ((gPlayerControl->GetFollowActor() == NULL) && (gPlayerControl->mFollowObject == NULL) &&
(this->Get_PlayerControlData_Unk120() != 2) && (this->Get_PlayerControlData_Unk120() != 3))
{
return true;
}
return false;
}
ARM bool UnkFilterActor::Filter(Actor *actor) {
if (!actor->mVisible) {
return false;
}
s32 temp_r0 = actor->mUnk_12c;
if ((temp_r0 != 2) && (temp_r0 != 5)) {
return false;
}
Vec3p sp0;
Vec3p_Sub(&actor->mPos, &mPos, &sp0);
s16 angle2 = mAngle;
s16 angle1 = (s16) Atan2(sp0.x, sp0.z);
s32 var_r6 = (s16) (angle1 - angle2) >> 3;
if (var_r6 < 0) {
var_r6 = -var_r6;
}
q20 length = Vec3p_Length(&sp0);
s32 temp_r2 = length + MUL_Q20(var_r6, FLOAT_TO_Q20(4.0));
if (temp_r2 < mUnk_08) {
mActor = actor;
mUnk_08 = temp_r2;
return true;
}
return false;
}
+5 -6
View File
@@ -5,7 +5,6 @@
#include "System/Random.hpp"
extern "C" {
void func_ov000_0207a1c8(bool *param_1, unk32 param_2, Vec3p *param_3);
void func_0202bc38(unk32 param_1, Vec3p *param_2, u32 param_3, Actor_UnkStruct_012 *param_4, bool);
void func_ov005_02102c2c(u32 *param_1, int param_2, Vec3p *param_3, int param_4, int param_5, u32 param_6, int param_7,
char param_8, char param_9, char param_10);
@@ -71,9 +70,9 @@ bool ActorRupee::vfunc_08() {
func_ov14_0213b204(0);
break;
case 1:
q20 x = gRandom->Next(FLOAT_TO_Q20(0.1335));
q20 y = gRandom->Next(FLOAT_TO_Q20(0.2));
q20 z = gRandom->Next(FLOAT_TO_Q20(0.1335));
q20 x = gRandom.Next(FLOAT_TO_Q20(0.1335));
q20 y = gRandom.Next(FLOAT_TO_Q20(0.2));
q20 z = gRandom.Next(FLOAT_TO_Q20(0.1335));
mVel.x = x - FLOAT_TO_Q20(0.0666);
mVel.y = y + FLOAT_TO_Q20(0.3333);
@@ -263,14 +262,14 @@ void ActorRupee::vfunc_14(u32 param1) {
if (func_ov00_020c313c(param1)) {
Update(false);
}
func_ov000_0207a1c8(&mUnk_0a4.mUnk_00, param1, &mPos);
mUnk_0a4.func_ov000_0207a1c8(param1, &mPos);
}
void ActorRupee::vfunc_18(u32 param1) {
if (func_ov00_020c313c(param1)) {
Update(true);
}
func_ov000_0207a1c8(&mUnk_0a4.mUnk_00, param1, &mPos);
mUnk_0a4.func_ov000_0207a1c8(param1, &mPos);
}
#define VFUNC20_COND (param1 ? mUnk_0a4.mUnk_01 : mUnk_0a4.mUnk_00)
+340
View File
@@ -0,0 +1,340 @@
#include "Actor/Player/ActorRefill.hpp"
#include "DTCM/UnkStruct_027e0d38.hpp"
#include "DTCM/UnkStruct_027e103c.hpp"
#include "Item/ItemManager.hpp"
#include "System/Random.hpp"
static char *sShipTypes[8] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
extern u32 **data_027e0fe0[];
ARM ActorRefillBombs *ActorRefillBombs::Create() {
return new(*data_027e0fe0[0], 4) ActorRefillBombs();
}
ActorType ActorRefillBombs::gType = ActorType(ActorTypeId_RefillBombs, (ActorCreateFunc) ActorRefillBombs::Create, NULL);
ARM ActorRefillBombchus *ActorRefillBombchus::Create() {
return new(*data_027e0fe0[0], 4) ActorRefillBombchus();
}
ActorType ActorRefillBombchus::gType =
ActorType(ActorTypeId_RefillBombchus, (ActorCreateFunc) ActorRefillBombchus::Create, NULL);
ARM ActorRefillArrows *ActorRefillArrows::Create() {
return new(*data_027e0fe0[0], 4) ActorRefillArrows();
}
ActorType ActorRefillArrows::gType = ActorType(ActorTypeId_RefillArrows, (ActorCreateFunc) ActorRefillArrows::Create, NULL);
ARM ActorRefillTime *ActorRefillTime::Create() {
return new(*data_027e0fe0[0], 4) ActorRefillTime();
}
ActorType ActorRefillTime::gType = ActorType(ActorTypeId_RefillTime, (ActorCreateFunc) ActorRefillTime::Create, NULL);
ARM ActorLSTM *ActorLSTM::Create() {
return new(*data_027e0fe0[0], 4) ActorLSTM();
}
ActorType ActorLSTM::gType = ActorType(ActorTypeId_LSTM, (ActorCreateFunc) ActorLSTM::Create, NULL);
ARM ActorRefill::ActorRefill(unk32 param1) :
mUnk_158(0),
mUnk_15c(0x56),
mUnk_160(param1),
mUnk_164(0x1f) {}
ARM ActorRefill::~ActorRefill() {}
ARM bool ActorRefill::vfunc_08() {
ItemManager *itemManager;
if (this->vfunc_b4() == ItemFlag_None) {
if (data_027e0d38->func_ov000_02078b40() != 3) {
return false;
}
} else {
ItemManager *itemManager = gItemManager;
ItemFlag item = this->vfunc_b4();
if (!itemManager->HasItem(item)) {
return false;
}
}
mHitbox.pos.x = 0;
mHitbox.pos.y = FLOAT_TO_Q20(0.3);
mHitbox.pos.z = 0;
mHitbox.size = FLOAT_TO_Q20(0.3);
mUnk_08c.pos.x = mHitbox.pos.x;
mUnk_08c.pos.y = mHitbox.pos.y;
mUnk_08c.pos.z = mHitbox.pos.z;
mUnk_08c.size = mHitbox.size;
mUnk_0a4.mUnk_04.x = 0;
mUnk_0a4.mUnk_04.y = FLOAT_TO_Q20(0.3);
mUnk_0a4.mUnk_04.z = 0;
mUnk_0a4.mUnk_10 = FLOAT_TO_Q20(1.3);
mUnk_09c.mUnk_0 &= ~0xa4;
mUnk_09c.mUnk_3 = 1;
mMaxFall = mUnk_08c.size + -1;
this->func_ov014_02135364(0);
return true;
}
extern unk32 data_ov000_020eec9c;
extern "C" void func_ov000_020d7ad4(unk32 *param1, unk32 param2);
ARM void ActorRefill::vfunc_14(u32 param1) {
s32 temp_r0_4;
s32 temp_r6;
s8 var_r0;
u32 temp_r0;
u32 temp_r0_3;
u32 temp_r1;
Vec3p *temp_r0_2;
if (this->func_ov00_020c313c(param1) != 0) {
this->IncreaseActiveFrames();
temp_r0 = mUnk_130;
switch (temp_r0) {
case 0:
this->ApplyGravity();
temp_r0_2 = &mPos;
Vec3p_Add(temp_r0_2, &mVel, temp_r0_2);
this->func_01fffd04(0);
if (mUnk_110 || mUnk_112 || mUnk_113) {
mVel.x = 0;
mVel.z = 0;
}
if (mUnk_111) {
this->func_ov014_02135364(1);
} else if (this->func_ov00_020c2c0c()) {
this->func_ov014_02135364(4);
} else if (this->func_ov00_020c2d54()) {
this->func_ov014_02135364(5);
}
break;
case 1:
case 2:
case 4:
case 5:
if (this->CollidesWithPlayer(PlayerCollide_PickupFlags) != 0) {
if (this->vfunc_b4() == -1) {
data_027e103c->func_ov000_020cfbf0(mUnk_158 * 60, 1, 0);
} else {
ItemManager *itemManager = gItemManager;
itemManager->GiveAmmo(this->vfunc_b4(), mUnk_158);
}
func_ov000_020d7ad4(&data_ov000_020eec9c, 0x100);
this->func_ov014_02135364(3);
} else {
temp_r0_3 = mUnk_130;
switch (temp_r0_3) {
case 0:
case 3: break;
case 1:
if (this->func_ov00_020c2c0c()) {
this->func_ov014_02135364(4);
} else if (this->func_ov00_020c2d54()) {
this->func_ov014_02135364(5);
} else if (mActiveFrames >= 180) {
this->func_ov014_02135364(2);
}
break;
case 2:
if (mActiveFrames % 8 < 4) {
mUnk_164 = 0;
} else {
mUnk_164 = 31;
}
if (this->func_ov00_020c2c0c()) {
this->func_ov014_02135364(4);
} else if (this->func_ov00_020c2d54()) {
this->func_ov014_02135364(5);
} else if (mActiveFrames >= 60) {
this->func_ov014_02135364(3);
}
break;
case 4:
if (!this->func_ov00_020c2c70()) {
this->func_ov014_02135364(1);
}
break;
case 5:
if (!this->func_ov00_020c2de4()) {
this->func_ov014_02135364(1);
}
break;
}
}
break;
}
this->KillInBounds();
}
mUnk_0a4.func_ov000_0207a1c8(param1, &mPos);
}
ARM bool ActorRefill::func_ov014_02135364(unk32 param1) {
mUnk_130 = param1;
mUnk_164 = 31;
mActiveFrames = 0;
switch (mUnk_130) {
case 0:
case 2: break;
case 1:
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
break;
case 3: this->Kill(); break;
}
return true;
}
extern "C" void func_0202bc38(bool param1, Vec3p *pos, unk32 param2, Actor_UnkStruct_012 *param3, unk32 param4);
extern u32 data_ov000_020e9370[];
extern "C" void func_ov005_02102c2c(u32 *param_1, int param_2, Vec3p *param_3, int param_4, int param_5, u32 param_6,
int param_7, char param_8, char param_9, char param_10);
ARM void ActorRefill::vfunc_20(bool param1) {
bool var_r0;
if (param1) {
var_r0 = mUnk_0a4.mUnk_01;
} else {
var_r0 = mUnk_0a4.mUnk_00;
}
if (var_r0 && mUnk_164 != 0) {
Actor_UnkStruct_012 sp18;
sp18.mUnk_04 = 5;
sp18.mUnk_08 = 2;
sp18.mUnk_0c = 2;
sp18.mUnk_14 = 0x800;
sp18.mUnk_18 = 0x1000;
sp18.mUnk_02 = mUnk_164;
func_0202bc38(param1, &mPos, mUnk_15c, &sp18, 0);
func_ov005_02102c2c(&data_ov000_020e9370[0], 0, &mPos, 0x400, 0x400, 0, mUnk_164, 0, 0, 1);
}
}
extern unk32 *data_027e0e58;
extern "C" void func_ov000_0207c1b0(unk32 *param1, unk32 param2, Vec3p *param3, unk32 param4, unk32 param5, unk32 param6);
ARM void ActorRefill::func_ov014_02135474() {
s32 iVar1 = mUnk_130;
if (iVar1 != 4 && iVar1 != 5) {
func_ov000_0207c1b0(data_027e0e58, 0x241, &mPos, 2, 0, 0);
func_ov000_0207c1b0(data_027e0e58, 0x242, &mPos, 2, 0, 0);
mAlive = false;
}
}
ARM ActorRefillBombs::ActorRefillBombs() :
ActorRefill(0) {
mUnk_158 = 3;
mUnk_15c = 0x2e;
}
ARM ActorRefillBombs::~ActorRefillBombs() {}
ARM ItemFlag ActorRefillBombs::vfunc_b4() {
return ItemFlag_BombBag;
}
ARM ActorRefillBombchus::ActorRefillBombchus() :
ActorRefill(1) {
mUnk_158 = 3;
mUnk_15c = 0x2f;
}
ARM ActorRefillBombchus::~ActorRefillBombchus() {}
ARM ItemFlag ActorRefillBombchus::vfunc_b4() {
return ItemFlag_BombchuBag;
}
ARM ActorRefillArrows::ActorRefillArrows() :
ActorRefill(2) {
mUnk_158 = 5;
mUnk_15c = 0x2d;
}
ARM ActorRefillArrows::~ActorRefillArrows() {}
ARM ItemFlag ActorRefillArrows::vfunc_b4() {
return ItemFlag_Bow;
}
ARM ActorRefillTime::ActorRefillTime() :
ActorRefill(3) {
mUnk_158 = 5;
mUnk_15c = 0x44;
}
ARM ActorRefillTime::~ActorRefillTime() {}
ARM bool ActorRefillTime::vfunc_08() {
if (!ActorRefill::vfunc_08()) {
return false;
}
switch (mUnk_020.mUnk_00[0]) {
case 2: mUnk_158 = 5; break;
case 4: mUnk_158 = 15; break;
case 5: mUnk_158 = 30; break;
default:
case 0:
case 1:
case 3:
s32 temp_ip = gRandom.Next(10);
if (temp_ip >= 9) {
mUnk_158 = 30;
} else if (temp_ip >= 6) {
mUnk_158 = 15;
} else {
mUnk_158 = 5;
}
break;
}
switch (mUnk_158) {
case 15: mUnk_15c = 0x45; break;
case 30: mUnk_15c = 0x46; break;
default: mUnk_15c = 0x44; break;
}
return true;
}
ARM ItemFlag ActorRefillTime::vfunc_b4() {
return ItemFlag_None;
}
ARM ActorLSTM::ActorLSTM() :
ActorRefill(3) {
mUnk_158 = -5;
mUnk_15c = 0x47;
}
ARM ActorLSTM::~ActorLSTM() {}
ARM bool ActorLSTM::vfunc_08() {
if (!ActorRefill::vfunc_08()) {
return false;
}
switch (mUnk_020.mUnk_00[0]) {
case 2: mUnk_158 = -5; break;
case 4: mUnk_158 = -15; break;
case 5: mUnk_158 = -30; break;
default:
case 0:
case 1:
case 3:
s32 temp_ip = gRandom.Next(10);
if (temp_ip >= 9) {
mUnk_158 = -30;
} else if (temp_ip >= 6) {
mUnk_158 = -15;
} else {
mUnk_158 = -5;
}
break;
}
switch (mUnk_158) {
case -15: mUnk_15c = 0x48; break;
case -30: mUnk_15c = 0x49; break;
default: mUnk_15c = 0x47; break;
}
return true;
}
ARM ItemFlag ActorLSTM::vfunc_b4() {
return ItemFlag_None;
}
+1 -1
View File
@@ -11,7 +11,7 @@ void DebugHierarchyBase::vfunc_10() {}
void DebugHierarchyBase::vfunc_14() {}
void DebugHierarchyBase::vfunc_18() {}
void DebugHierarchyBase::vfunc_1c() {}
void DebugHierarchyBase::vfunc_20() {}
void DebugHierarchyBase::vfunc_20(unk32 param1, const char *param2, unk32 param3, unk32 param4, unk32 param5, unk32 param6) {}
void DebugHierarchyBase::vfunc_24() {}
void DebugHierarchyBase::vfunc_28() {}
void DebugHierarchyBase::vfunc_2c() {}
+1 -1
View File
@@ -1,5 +1,5 @@
#include "Player/LinkStateBase.hpp"
LinkStateBase *GetLinkState(s32 index) {
LinkStateBase *GetLinkState(LinkStateId index) {
return gLinkStates[index];
}