summaryrefslogtreecommitdiff
path: root/src/00_Core/Actor
diff options
context:
space:
mode:
authorSammygoodTunes <56520787+SammygoodTunes@users.noreply.github.com>2025-06-03 23:52:44 +0200
committerGitHub <noreply@github.com>2025-06-03 23:52:44 +0200
commit920023d800e853925eca42f0dc00510d01bc84bc (patch)
tree31f224a3add3df006f9a22ce1bd6bce17c2fa8f9 /src/00_Core/Actor
parent088f7b4771ff002831323a3176d12813520c4269 (diff)
parent21aaec6b40f8cb756e5ef4fff5552b980ab58d4e (diff)
Merge branch 'main' into decomp/MapManager
Diffstat (limited to 'src/00_Core/Actor')
-rw-r--r--src/00_Core/Actor/Actor.cpp19
-rw-r--r--src/00_Core/Actor/ActorManager.cpp5
-rw-r--r--src/00_Core/Actor/Dungeon/ActorSwitchObject.cpp109
3 files changed, 109 insertions, 24 deletions
diff --git a/src/00_Core/Actor/Actor.cpp b/src/00_Core/Actor/Actor.cpp
index 3c699ddc..4ef80de9 100644
--- a/src/00_Core/Actor/Actor.cpp
+++ b/src/00_Core/Actor/Actor.cpp
@@ -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;
}
diff --git a/src/00_Core/Actor/ActorManager.cpp b/src/00_Core/Actor/ActorManager.cpp
index 73ab6bbb..fed1075e 100644
--- a/src/00_Core/Actor/ActorManager.cpp
+++ b/src/00_Core/Actor/ActorManager.cpp
@@ -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;
diff --git a/src/00_Core/Actor/Dungeon/ActorSwitchObject.cpp b/src/00_Core/Actor/Dungeon/ActorSwitchObject.cpp
index 37c4511c..c767e5b9 100644
--- a/src/00_Core/Actor/Dungeon/ActorSwitchObject.cpp
+++ b/src/00_Core/Actor/Dungeon/ActorSwitchObject.cpp
@@ -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() {}