Merge branch 'main' into actor-manager

This commit is contained in:
Aetias
2024-10-21 20:36:15 +02:00
686 changed files with 383930 additions and 1775946 deletions
+62 -83
View File
@@ -1,5 +1,5 @@
extern "C" {
#include <stdlib.h>
#include <stdlib.h>
}
#include "Actor/Actor.hpp"
@@ -13,7 +13,7 @@ extern "C" {
#include "Player/TouchControl.hpp"
#include "Save/AdventureFlags.hpp"
static char *sShipTypes[] = { "brg", "anc", "bow", "hul", "can", "dco", "pdl", "fnl" };
static char *sShipTypes[] = {"brg", "anc", "bow", "hul", "can", "dco", "pdl", "fnl"};
struct UnkStruct3 {
/* 0 */ s16 mUnk_0;
@@ -21,45 +21,16 @@ struct UnkStruct3 {
/* 3 */
};
const UnkStruct3 sUnkTable[] = {
{ 0xff, 2 },
{ 0xff, 2 },
{ 0xff, 2 },
{ 0xff, 2 },
{ 0xff, 2 },
{ 6, 2 },
{ 4, 2 },
{ 4, 2 },
{ 4, 2 },
{ 1, 2 },
{ 12, 2 },
{ 4, 2 },
{ 4, 2 },
{ 8, 2 },
{ 12, 2 },
{ 2, 2 },
{ 2, 2 },
{ 20, 2 },
{ 20, 2 },
{ 1, 2 },
{ 4, 2 },
{ 4, 2 },
{ 4, 2 },
{ 8, 2 },
{ 4, 2 },
{ 0xff, 2 },
{ 20, 2 },
{ 6, 2 },
{ 6, 2 },
{ 2, 2 },
{0xff, 2}, {0xff, 2}, {0xff, 2}, {0xff, 2}, {0xff, 2}, {6, 2}, {4, 2}, {4, 2}, {4, 2}, {1, 2},
{12, 2}, {4, 2}, {4, 2}, {8, 2}, {12, 2}, {2, 2}, {2, 2}, {20, 2}, {20, 2}, {1, 2},
{4, 2}, {4, 2}, {4, 2}, {8, 2}, {4, 2}, {0xff, 2}, {20, 2}, {6, 2}, {6, 2}, {2, 2},
};
KILL(_ZN19Actor_UnkStruct_020C2Ev)
Actor_UnkStruct_020::Actor_UnkStruct_020():
Actor_UnkStruct_020::Actor_UnkStruct_020() :
mUnk_0c(-1),
mUnk_0d(0),
mUnk_0e(1),
mUnk_10(-1)
{
mUnk_10(-1) {
for (s32 i = 0; i < 4; ++i) {
mUnk_00[i] = 0;
}
@@ -69,8 +40,7 @@ Actor_UnkStruct_020::Actor_UnkStruct_020():
}
}
KILL(_ZN5ActorC1Ev)
ARM Actor::Actor():
ARM Actor::Actor() :
mType(ActorTypeId_Null),
mRef(-1, -1),
mUnk_010(0),
@@ -124,20 +94,19 @@ ARM Actor::Actor():
mActiveFrames(0),
mUnk_13c(0),
mUnk_140(0),
mUnk_144(0)
{
mUnk_144(0) {
mUnk_014.x = 0;
mUnk_014.y = 0;
mUnk_014.z = 0;
mPos.x = 0;
mPos.y = 0;
mPos.z = 0;
mPos.x = 0;
mPos.y = 0;
mPos.z = 0;
mPrevPos.x = 0;
mPrevPos.y = 0;
mPrevPos.z = 0;
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
}
ARM Actor::~Actor() {}
@@ -198,7 +167,8 @@ struct UnkStruct1 {
};
extern void *data_027e0d3c;
extern unk32 data_02063e4c;
extern "C" bool func_ov00_02079470(void *param1, Vec3p *param2, unk32 param3, unk32 param4, unk32 *param5, unk32 *param6, unk32 param7, unk32 param8);
extern "C" bool func_ov00_02079470(void *param1, Vec3p *param2, unk32 param3, unk32 param4, unk32 *param5, unk32 *param6,
unk32 param7, unk32 param8);
extern "C" void func_01ffbe34(UnkStruct1 *param1);
extern "C" void func_020313c8(unk32 *param1, unk32 param2, unk32 param3, u32 param4, UnkStruct1 *param5);
ARM void Actor::vfunc_1c(u16 *param1) {
@@ -217,7 +187,7 @@ ARM void Actor::vfunc_1c(u16 *param1) {
}
}
ARM void Actor::vfunc_20(s32 param1) {}
ARM void Actor::vfunc_20(bool param1) {}
ARM void Actor::SetUnk_129(bool value) {
if (mUnk_128) mUnk_129 = value;
@@ -231,7 +201,7 @@ ARM bool Actor::SetUnk_11b() {
ARM bool Actor::SetVelocity(Vec3p *vel) {
if (!mUnk_11b) return false;
mVel = *vel;
mVel = *vel;
mUnk_11b = false;
return true;
}
@@ -297,13 +267,9 @@ 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.mUnk_0 != data_027e077c.mUnk_4 || (data_02056be4[unk1] & 1) != 0 || (data_02056be4[unk2] & 4) != 0 ||
func_ov05_02103f4c(data_027e103c) || gPlayer->mHealth <= 0)
{
return false;
}
if (gPlayerLink && !gPlayerLink->func_ov00_020bd304()) return false;
@@ -321,8 +287,7 @@ ARM bool KillPickupsFilter::Filter(Actor *actor) {
case ActorTypeId_FLAL:
case ActorTypeId_FLBM:
case ActorTypeId_FLBT:
case ActorTypeId_FLTM:
{
case ActorTypeId_FLTM: {
actor->Kill();
return true;
}
@@ -338,16 +303,16 @@ ARM void Actor::KillPickupItemActors() {
ARM bool Actor::TrySetTransform(Transform *transform) {
mPrevPos = mPos;
mPos = transform->pos;
mAngle = transform->angle;
mPos = transform->pos;
mAngle = transform->angle;
mVisible = transform->visible;
return true;
}
ARM void Actor::SetTransform(Transform *transform) {
mPrevPos = mPos;
mPos = transform->pos;
mAngle = transform->angle;
mPos = transform->pos;
mAngle = transform->angle;
mVisible = transform->visible;
}
@@ -378,7 +343,8 @@ ARM bool Actor::vfunc_4c(unk32 *param1) {
ARM bool Actor::IsNearLink() {
Vec3p playerPos = gPlayerPos;
q20 z = playerPos.z;
q20 z = playerPos.z;
q20 dx = abs(playerPos.x - mPos.x);
if (dx > FLOAT_TO_Q20(10.0)) return false;
q20 dz = abs(playerPos.z - mPos.z);
@@ -459,38 +425,42 @@ ARM bool Actor::func_ov00_020c1fc8(PlayerCollide flags) {
if (this->CollidesWithPlayer(flags & PlayerCollide_Sword)) {
Knockback knockback;
knockback.mUnk_00 = gPlayer->EquipItem_vfunc_2c();
knockback.vec = vecFromPlayer;
knockback.vec = vecFromPlayer;
knockback.mUnk_10 = 0;
knockback.actor = NULL;
knockback.actor = NULL;
result = this->vfunc_48(&knockback);
} else if (this->CollidesWithPlayer(flags & PlayerCollide_Shield)) {
Knockback knockback;
knockback.mUnk_00 = 0;
knockback.vec = vecFromPlayer;
knockback.vec = vecFromPlayer;
if ((s32) gItemManager->GetActiveFairyLevel(FairyId_Wisdom) >= 1) {
knockback.mUnk_10 = 3;
} else {
knockback.mUnk_10 = 2;
}
knockback.actor = NULL;
result = this->vfunc_48(&knockback);
} else if (this->CollidesWithPlayer(flags & PlayerCollide_Hammer)) {
Knockback knockback;
knockback.mUnk_00 = gPlayer->EquipItem_vfunc_2c();
knockback.vec = vecFromPlayer;
knockback.vec = vecFromPlayer;
knockback.mUnk_10 = 4;
knockback.actor = NULL;
knockback.actor = NULL;
result = this->vfunc_48(&knockback);
} else if (this->CollidesWithPlayer(flags & PlayerCollide_Gongoron)) {
Knockback knockback;
knockback.mUnk_00 = gPlayerLink->vfunc_78();
knockback.vec = vecFromPlayer;
knockback.vec = vecFromPlayer;
if (knockback.mUnk_00 != 0) {
knockback.mUnk_10 = 9;
} else {
knockback.mUnk_10 = 2;
}
knockback.actor = NULL;
result = this->vfunc_48(&knockback);
}
}
@@ -501,8 +471,8 @@ ARM bool Actor::CollidesWithShield(Cylinder *param1) {
Vec3p vecFromPlayer;
Vec3p_Sub(&mPos, &gPlayerPos, &vecFromPlayer);
s32 currAngle = gPlayerAngle;
s32 angle = Atan2(vecFromPlayer.x, vecFromPlayer.z);
s32 angleDiff = (s16)angle - currAngle;
s32 angle = Atan2(vecFromPlayer.x, vecFromPlayer.z);
s32 angleDiff = (s16) angle - currAngle;
if (angleDiff < 0) angleDiff = -angleDiff;
if (angleDiff <= DEG_TO_ANG(90) && gPlayer->EquipCollidesWith(param1, ItemFlag_WoodenShield)) {
return true;
@@ -558,6 +528,7 @@ ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
if (actor->mType == ActorTypeId_Arrow || actor->mType == ActorTypeId_SBEM) {
q20 cos = COS(actor->mAngle);
q20 sin = SIN(actor->mAngle);
knockback.vec.x = sin;
knockback.vec.y = 0;
knockback.vec.z = cos;
@@ -565,7 +536,7 @@ ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
Vec3p_Sub(&mPos, &actor->mPrevPos, &knockback.vec);
}
knockback.mUnk_00 = actor->mUnk_125;
knockback.actor = actor;
knockback.actor = actor;
switch (actor->mType) {
case ActorTypeId_SBEM: {
@@ -599,8 +570,7 @@ ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
case ActorTypeId_BKEY:
case ActorTypeId_FORC:
case ActorTypeId_FLTB:
case ActorTypeId_TSUB:
{
case ActorTypeId_TSUB: {
knockback.mUnk_10 = 10;
} break;
@@ -678,12 +648,14 @@ ARM q20 Actor::XzDistanceToLink() {
Vec3p src;
Vec3p_CopyXZ(&mPos, &src);
Vec3p dest = gPlayerPos;
dest.y = 0;
return Vec3p_Distance(&src, &dest);
}
ARM s16 Actor::GetAngleTo(Vec3p *vec) {
s16 angle = mAngle;
q20 dz = vec->z - mPos.z;
q20 dx = vec->x - mPos.x;
if (dx != 0 || dz != 0) {
@@ -700,10 +672,11 @@ extern "C" void func_0202d95c(Vec3p *param1, q20 param2);
ARM void Actor::func_ov00_020c2988(Vec3p *param1, q20 param2, Vec3p *param3) {
q20 z1 = param1->z;
q20 z0 = mPos.z;
param3->x = param1->x - mPos.x;
param3->y = 0;
param3->z = z1 - z0;
q20 dist = this->XzDistanceTo(param1);
q20 dist = this->XzDistanceTo(param1);
if (dist < param2) param2 = dist;
func_0202d95c(param3, param2);
}
@@ -719,8 +692,8 @@ ARM bool Actor::func_ov00_020c29ec(q20 param1) {
}
ARM void Actor::GetHitbox(Cylinder *hitbox) {
hitbox->size = mHitbox.size;
u32 angle = 2 * (mAngle >> 4);
hitbox->size = mHitbox.size;
u32 angle = 2 * (mAngle >> 4);
hitbox->pos.x = mPos.x;
hitbox->pos.y = mPos.y;
hitbox->pos.z = mPos.z;
@@ -732,8 +705,8 @@ ARM void Actor::GetHitbox(Cylinder *hitbox) {
}
ARM void Actor::GetUnk_08c(Cylinder *param1) {
param1->size = mUnk_08c.size;
u32 angle = 2 * (mAngle >> 4);
param1->size = mUnk_08c.size;
u32 angle = 2 * (mAngle >> 4);
param1->pos.x = mPos.x;
param1->pos.y = mPos.y;
param1->pos.z = mPos.z;
@@ -780,8 +753,8 @@ ARM bool Actor::func_ov00_020c2c70() {
return boomerang != NULL;
}
ARM EquipBoomerang* Actor::GetEquipBoomerang() {
return (EquipBoomerang*) ItemManager::GetEquipItemUnchecked(ItemFlag_Boomerang);
ARM EquipBoomerang *Actor::GetEquipBoomerang() {
return (EquipBoomerang *) ItemManager::GetEquipItemUnchecked(ItemFlag_Boomerang);
}
ARM bool Actor::func_ov00_020c2d54() {
@@ -806,6 +779,7 @@ ARM bool Actor::func_ov00_020c2de4() {
Vec3p vel;
EquipRope *rope = EquipSword::GetEquipRope();
Actor *actor = rope->func_ov14_0213d420();
if (actor) {
Vec3p_Sub(&actor->mPos, &mPos, &vel);
@@ -822,6 +796,7 @@ ARM bool Actor::func_ov00_020c2de4() {
ARM bool Actor::func_ov00_020c2e7c() {
bool result = false;
EquipRope *rope = EquipSword::GetEquipRope();
if (!mUnk_11d) {
s32 unk1 = rope->func_ov14_0213ddd4(this);
@@ -841,6 +816,7 @@ ARM bool Actor::func_ov00_020c2ebc() {
ARM bool Actor::func_ov00_020c2ed4() {
EquipRope *rope = EquipSword::GetEquipRope();
s32 index = rope->func_ov14_0213d440(mRef.id);
if (index >= 0) {
bool unk1 = rope->func_ov14_0213d420();
@@ -870,6 +846,7 @@ ARM bool Actor::func_ov00_020c2ed4() {
ARM bool Actor::IsHitboxTouched(bool param1) {
q20 size = mHitbox.size;
bool result = false;
if (size >= 0) {
Vec3p pos = mPos;
@@ -901,7 +878,7 @@ ARM bool Actor::func_ov00_020c3094() {
return result;
}
ARM Vec3p* Actor::GetPos() {
ARM Vec3p *Actor::GetPos() {
return &mPos;
}
@@ -948,6 +925,7 @@ ARM void Actor::vfunc_ac() {}
ARM void Actor::func_ov00_020c3200(s32 param1) {
const UnkStruct3 *entry = &sUnkTable[param1];
mUnk_122 = sUnkTable[param1].mUnk_0;
mUnk_120 = sUnkTable[param1].mUnk_0;
mUnk_124 = entry->mUnk_2;
@@ -965,7 +943,7 @@ ARM void Actor::GetLinkPos(Vec3p *result) {
ARM void Actor::GetLinkDummyPos(Vec3p *result) {
ActorRef dummyRef;
ActorManager::FindActorByType(&dummyRef, gActorManager, ActorTypeId_PlayerDummy);
ActorPlayerDummy *dummy = (ActorPlayerDummy*) gActorManager->GetActor(&dummyRef);
ActorPlayerDummy *dummy = (ActorPlayerDummy *) gActorManager->GetActor(&dummyRef);
if (dummy != NULL && dummy->mUnk_16e == 0) {
*result = dummy->mPos;
return;
@@ -980,3 +958,4 @@ Actor_UnkStruct_09c::Actor_UnkStruct_09c() {
mUnk_4 = 0;
}
Actor_UnkStruct_012::Actor_UnkStruct_012() {}
+20 -19
View File
@@ -1,20 +1,21 @@
#include "Actor/ActorManager.hpp"
void ActorManager::func_ov00_020c3484(ActorRef *ref, Actor *actor, unk32 param3) {}
Actor* ActorManager::GetActor(ActorRef *ref) {}
void ActorManager::Actor_vfunc_10(u32 param1) {}
Actor *ActorManager::FindActorById(u32 id) {}
Actor *ActorManager::GetActor(ActorRef *ref) {}
bool FilterActor::Filter(Actor *actor) {}
s32 ActorManager::FilterActors(FilterActorBase *filter, ActorList *filteredActors) {}
void ActorManager::FindActorByType(ActorRef *ref, ActorManager *manager, ActorTypeId type) {}
void ActorManager::FindNearestActorOfType(ActorRef *ref, ActorManager *manager, ActorTypeId type, Vec3p *pos) {}
bool ActorManager::func_ov00_020c398c(u32 index) {}
void ActorManager::func_ov00_020c399c(u32 index, Cylinder *cylinder) {}
Actor* ActorManager::func_ov00_020c39ac(u32 index, const ActorTypeId *actorTypes, bool param3) {}
Actor *ActorManager::func_ov00_020c39ac(u32 index, const ActorTypeId *actorTypes, bool param3) {}
s32 ActorManager::func_ov00_020c3b2c(s32 *param1) {}
s32 ActorManager::func_ov00_020c3bb0(unk32 param1, s32 *param2) {}
void ActorManager::func_ov00_020c3ce8(unk32 param1, unk32 param2) {}
void ActorManager::Actor_vfunc_28() {}
extern void func_ov00_020c3f54(void *, u32 param2);
extern s32 *data_027e103c;
extern s32 *data_027e077c;
@@ -29,7 +30,7 @@ ARM void ActorManager::DeleteActor(u32 index, bool param2) {
if (this->mActorTable[index] != NULL) {
delete this->mActorTable[index];
}
this->mActorTable[index] = NULL;
if (param2) {
@@ -37,7 +38,7 @@ ARM void ActorManager::DeleteActor(u32 index, bool param2) {
}
this->mNumActors--;
if (index + 1 != this->mMaxActorIndex) {
return;
}
@@ -59,7 +60,7 @@ ARM void ActorManager::Actor_vfunc_10(u32 param1) {
Actor *actor;
int i;
u32 uVar1 = param1;
u32 uVar1 = param1;
Actor **currentActor = this->mActorTable;
for (i = 0; i < this->mMaxActorIndex; ++i) {
@@ -75,7 +76,7 @@ ARM void ActorManager::Actor_vfunc_10(u32 param1) {
return;
}
ARM Actor* ActorManager::FindActorById(s32 id) {
ARM Actor *ActorManager::FindActorById(s32 id) {
u32 actorId;
s32 cacheIndex;
Actor *actor;
@@ -88,24 +89,24 @@ ARM Actor* ActorManager::FindActorById(s32 id) {
if ((cacheIndex >= 0) && (cacheIndex < this->mMaxActorIndex)) {
pActor = this->mActorTable;
if (pActor[cacheIndex] != NULL) {
if ((Actor**)(u32)pActor[cacheIndex]->mAlive != NULL && id == pActor[cacheIndex]->mId) {
if ((Actor **) (u32) pActor[cacheIndex]->mAlive != NULL && id == pActor[cacheIndex]->mId) {
actor = pActor[cacheIndex];
goto ret;
}
}
}
pActor = this->mActorTable;
actorId = this->mMaxActorIndex;
pActor = this->mActorTable;
actorId = this->mMaxActorIndex;
lastActor = pActor + actorId;
for (; pActor < lastActor; pActor = pActor + 1) {
if (*pActor != NULL) {
actorId = (u32)(*pActor)->mAlive;
if (actorId != 0 && id == (*pActor)->mId) {
actor = *pActor;
break;
if (*pActor != NULL) {
actorId = (u32) (*pActor)->mAlive;
if (actorId != 0 && id == (*pActor)->mId) {
actor = *pActor;
break;
}
}
}
}
}
@@ -113,13 +114,13 @@ ret:
return actor;
}
Actor* ActorManager::GetActor(ActorRef *ref) {
Actor *ActorManager::GetActor(ActorRef *ref) {
Actor *pActor;
u32 alive;
alive = ref->index;
if ((s32)alive < 0) {
if ((s32) alive < 0) {
return NULL;
}
@@ -128,7 +129,7 @@ Actor* ActorManager::GetActor(ActorRef *ref) {
alive = pActor->mAlive;
if (alive != 0 && ref->id == pActor->mId) {
return pActor;
}
}
}
return NULL;
+68 -92
View File
@@ -1,10 +1,10 @@
#include "Item/ItemManager.hpp"
#include "Player/PlayerLinkBase.hpp"
static const char *sShipPartTypes[] = { "anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg" };
static const char *sShipPartTypes[] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
extern u32 *data_027e0ce0[];
THUMB ItemManager* ItemManager::Create() {
THUMB ItemManager *ItemManager::Create() {
gItemManager = new(data_027e0ce0[1], 4) ItemManager();
return gItemManager;
}
@@ -24,12 +24,12 @@ THUMB void ItemManager::Save(SaveItemManager *save) {
for (s32 i = 0; i < NUM_POTIONS; ++i) {
save->potions[i] = mPotions[i];
}
save->numBombs = (u8) (*mAmmo)[ItemFlag_BombBag];
save->numBombchus = (u8) (*mAmmo)[ItemFlag_BombchuBag];
save->numArrows = (u8) (*mAmmo)[ItemFlag_Bow];
save->equippedItem = (u8) mEquippedItem;
save->numBombs = (u8) (*mAmmo)[ItemFlag_BombBag];
save->numBombchus = (u8) (*mAmmo)[ItemFlag_BombchuBag];
save->numArrows = (u8) (*mAmmo)[ItemFlag_Bow];
save->equippedItem = (u8) mEquippedItem;
save->salvagedTreasureFlags = mSalvagedTreasureFlags;
save->hourglassSeconds = FastDivide(mHourglassSandFrames, 60);
save->hourglassSeconds = FastDivide(mHourglassSandFrames, 60);
for (s32 i = 0; i < Gem_COUNT; ++i) {
save->numGems[i] = mNumGems[i];
}
@@ -48,8 +48,8 @@ THUMB void ItemManager::Save(SaveItemManager *save) {
save->unk_9f[i] = mUnk_098[i];
save->unk_82[i] = mUnk_09e[i];
}
save->quiverSize = mQuiverSize;
save->bombBagSize = mBombBagSize;
save->quiverSize = mQuiverSize;
save->bombBagSize = mBombBagSize;
save->bombchuBagSize = mBombchuBagSize;
if (mEquippedFairy == FairyId_None) {
save->equippedFairy = 3;
@@ -61,21 +61,20 @@ THUMB void ItemManager::Save(SaveItemManager *save) {
THUMB void ItemManager::Load(const SaveItemManager *save) {
mItemFlags = save->itemFlags;
mNumRupees = save->numRupees;
mHourglassSandFrames = save->hourglassSeconds <= MAX_HOURGLASS_SECONDS
? save->hourglassSeconds * 60
: MAX_HOURGLASS_SECONDS * 60;
mHourglassSandFrames =
save->hourglassSeconds <= MAX_HOURGLASS_SECONDS ? save->hourglassSeconds * 60 : MAX_HOURGLASS_SECONDS * 60;
for (s32 i = ItemFlag_EQUIP_START; i < ItemFlag_EQUIP_END; ++i) {
if (GET_FLAG(mItemFlags.flags, (u32) i)) {
(*mAmmo)[i] = 1;
}
}
(*mAmmo)[ItemFlag_BombBag] = save->numBombs;
(*mAmmo)[ItemFlag_BombBag] = save->numBombs;
(*mAmmo)[ItemFlag_BombchuBag] = save->numBombchus;
(*mAmmo)[ItemFlag_Bow] = save->numArrows;
(*mAmmo)[ItemFlag_Bow] = save->numArrows;
for (s32 i = 0; i < NUM_POTIONS; ++i) {
mPotions[i] = save->potions[i];
}
mEquippedItem = save->equippedItem;
mEquippedItem = save->equippedItem;
mSalvagedTreasureFlags = save->salvagedTreasureFlags;
for (s32 i = 0; i < Gem_COUNT; ++i) {
mNumGems[i] = save->numGems[i];
@@ -95,10 +94,10 @@ THUMB void ItemManager::Load(const SaveItemManager *save) {
mUnk_098[i] = save->unk_9f[i];
mUnk_09e[i] = save->unk_82[i];
}
mQuiverSize = save->quiverSize;
mBombBagSize = save->bombBagSize;
mQuiverSize = save->quiverSize;
mBombBagSize = save->bombBagSize;
mBombchuBagSize = save->bombchuBagSize;
mEquippedFairy = save->equippedFairy;
mEquippedFairy = save->equippedFairy;
if (mEquippedFairy >= FairyId_COUNT) {
mEquippedFairy = FairyId_None;
}
@@ -121,7 +120,7 @@ ARM FairyId ItemManager::GetEquippedFairy() const {
return fairy;
}
ARM ActorNavi* ItemManager::GetFairy(FairyId id) const {
ARM ActorNavi *ItemManager::GetFairy(FairyId id) const {
return mFairies[id];
}
@@ -150,29 +149,29 @@ ARM void ItemManager::TickEquipItem(void) {
ARM void ItemManager::func_ov00_020ad528() {}
ARM ItemModel* ItemManager::GetItemModel(ItemModelId id) {
ARM ItemModel *ItemManager::GetItemModel(ItemModelId id) {
return mItemModels[id];
}
extern unk32 data_027e0fc4;
extern "C" void* func_ov00_020bb3a8(unk32 param1, u32 index);
extern "C" void *func_ov00_020bb3a8(unk32 param1, u32 index);
extern "C" void func_ov00_020c0bdc(void *param1, unk32 param2);
ARM void ItemManager::func_ov00_020ad538(unk32 param1) const {
void* unk1 = func_ov00_020bb3a8(data_027e0fc4, 6);
void *unk1 = func_ov00_020bb3a8(data_027e0fc4, 6);
func_ov00_020c0bdc(unk1, param1);
}
ARM void ItemManager::func_ov00_020ad560(unk32 param1) const {
void* unk1 = func_ov00_020bb3a8(data_027e0fc4, 7);
void *unk1 = func_ov00_020bb3a8(data_027e0fc4, 7);
func_ov00_020c0bdc(unk1, param1);
}
ARM ItemModel* ItemManager::GetDungeonItemModel(u32 index) {
ARM ItemModel *ItemManager::GetDungeonItemModel(u32 index) {
return mDungeonItemModels[index];
}
ARM void ItemManager::func_ov00_020ad594(unk32 param1) const {
void* unk1 = func_ov00_020bb3a8(data_027e0fc4, 11);
void *unk1 = func_ov00_020bb3a8(data_027e0fc4, 11);
func_ov00_020c0bdc(unk1, param1);
}
@@ -191,7 +190,7 @@ ARM void ItemManager::EquipItem_vfunc_38(unk32 param1) {
this->Shield_vfunc_38(param1);
}
if (data_027e0d38->mUnk_14 == 1) return;
ItemFlag equip = this->GetEquippedItem();
if (equip == ItemFlag_None) return;
if (mEquipLoadTimer > 0) return;
@@ -215,7 +214,7 @@ ARM s32 ItemManager::EquipItem_vfunc_2c(ItemFlag equipId) {
return (*mEquipItems)[equipId]->vfunc_2c();
}
ARM EquipItem* ItemManager::GetEquipItem(ItemFlag equipId) {
ARM EquipItem *ItemManager::GetEquipItem(ItemFlag equipId) {
if (equipId == ItemFlag_None) {
return NULL;
} else {
@@ -237,14 +236,10 @@ extern "C" unk32 func_ov00_02078b40(UnkStruct_027e0d38 *param1);
extern void *data_027e10a4;
extern "C" bool func_ov15_02136670(void *param1);
extern unk8 data_ov29_0217a4ac[];
extern "C" bool _ZN10MapManager18func_ov00_020849f8Ei(void *param1);
extern "C" bool _ZN14PlayerLinkBase18func_ov00_020bbd80Ei(unk32 param1, unk32 param2);
extern "C" bool _ZNK11ItemManager7HasItemEi();
extern "C" void _ZN11ItemManager12GetEquipItemEi();
ARM bool NONMATCH(ItemManager::func_ov00_020ad790)(unk32 param1) {
#ifndef NONMATCHING
#include "../asm/ov00/Item/ItemManager_func_ov00_020ad790.inc"
#else
ARM bool ItemManager::func_ov00_020ad790(unk32 param1) {
unk32 unk1 = func_ov00_02078b40(data_027e0d38);
if (unk1 == 2) return func_ov15_02136670(data_027e10a4);
if (data_027e0d38->mUnk_14 == 1) return false;
@@ -252,24 +247,20 @@ ARM bool NONMATCH(ItemManager::func_ov00_020ad790)(unk32 param1) {
if (gOverlayManager.mLoadedOverlays[OverlayIndex_6] == OverlayId_29 && data_ov29_0217a4ac[0x54] != 0) {
return false;
}
ItemFlag equipId = mForcedItem;
bool unk2 = !gMapManager->func_ov00_020849f8();
if (
mEquippedItem != ItemFlag_None &&
(unk2 || (u32) mEquippedItem - 9 <= 1) &&
(gPlayerLink == 0 || gPlayerLink->func_ov00_020bbd80(param1)) &&
this->HasItem(mEquippedItem)
) {
bool unk2 = !gMapManager->func_ov00_020849f8(equipId);
if (mEquippedItem != ItemFlag_None && (unk2 || (u32) mEquippedItem - 9 <= 1) &&
(gPlayerLink == 0 || gPlayerLink->func_ov00_020bbd80(param1)) && this->HasItem(mEquippedItem))
{
equipId = mEquippedItem;
}
if (equipId != ItemFlag_None) {
if (mEquipLoadTimer != 0) return param1 == 0;
return this->GetEquipItem(equipId)->IsUsable(param1);
}
return false;
#endif
}
THUMB ShipType ItemManager::GetEquippedShipPart(ShipPart part) const {
@@ -308,7 +299,7 @@ THUMB u16 ItemManager::GetUnk_09e(u32 index) const {
THUMB s32 ItemManager::GetUnk_09e_Divided(u32 index) const {
q20 quotient = Divide(INT_TO_Q20(mUnk_09e[index]), FLOAT_TO_Q20(2.54));
s32 result = ROUND_Q20(quotient);
s32 result = ROUND_Q20(quotient);
if (result < 1) result = 1;
return result;
}
@@ -323,7 +314,7 @@ THUMB void ItemManager::SetUnk_09e(u32 index, u16 value) {
}
}
const u16 sQuiverSizes[] = {20, 20, 30, 50};
const u16 sQuiverSizes[] = {20, 20, 30, 50};
const u16 sBombBagSizes[] = {10, 20, 30};
THUMB u16 ItemManager::GetMaxAmmo(ItemFlag equipId) const {
@@ -383,11 +374,12 @@ THUMB void ItemManager::RemoveItem(ItemFlag item) {
extern ItemModel **data_027e1058;
extern ItemModel **data_027e105c;
extern "C" ItemModel* func_ov00_02079ffc(void*, const char *modelName, const char *textureName, unk32 param4, unk8 param5, unk8 param6, bool param7);
extern "C" ItemModel* LoadTreasureItemFanfare(ItemModel**, s32 treasureType, bool, bool);
static char *sDefaultItemModel = "key";
extern "C" ItemModel *func_ov00_02079ffc(void *, const char *modelName, const char *textureName, unk32 param4, unk8 param5,
unk8 param6, bool param7);
extern "C" ItemModel *LoadTreasureItemFanfare(ItemModel **, s32 treasureType, bool, bool);
static char *sDefaultItemModel = "key";
static char *sItemModelNames[70] = {
[ItemId_None] = "key",
[ItemId_Nothing] = "key",
[ItemId_SmallKey] = "key",
[ItemId_GreenRupee] = "rupee_g",
[ItemId_OshusSword] = "swA",
@@ -480,37 +472,24 @@ static char *sItemModelNames3[9] = {
[ItemId_Unk_135 - ItemId_CycloneSlate] = NULL,
};
char *sSpecialItemModelNames[7] = {
"mapTakara\0\0",
"arrowpodL\0\0",
"bmbagL\0",
"bcbagL\0",
"Player/get/gd_\0",
".nsbmd\0",
".nsbtx\0",
"mapTakara\0\0", "arrowpodL\0\0", "bmbagL\0", "bcbagL\0", "Player/get/gd_\0", ".nsbmd\0", ".nsbtx\0",
};
THUMB void ItemManager::LoadFanfareItem(ItemId id) {
mFanfareItem = id;
ItemModel *model;
if (
id == ItemId_Unk_43 ||
id == ItemId_Cannon ||
(id >= ItemId_GOLDEN_SHIP_START && id <= ItemId_GOLDEN_SHIP_END) ||
id == ItemId_Unk_126 ||
id == ItemId_Unk_133
) {
if (id == ItemId_Unk_43 || id == ItemId_Cannon || (id >= ItemId_GOLDEN_SHIP_START && id <= ItemId_GOLDEN_SHIP_END) ||
id == ItemId_Unk_126 || id == ItemId_Unk_133)
{
model = *data_027e1058;
} else if (
id >= ItemId_TREASURE_START &&
id <= ItemId_TREASURE_END
) {
} else if (id >= ItemId_TREASURE_START && id <= ItemId_TREASURE_END) {
model = LoadTreasureItemFanfare(data_027e105c, id - ItemId_TREASURE_START, true, false);
} else if (id == ItemId_Unk_125) {
model = *data_027e105c;
} else {
char modelName[0x80] = {};
char modelName[0x80] = {};
char textureName[0x80] = {};
const char *itemName = NULL;
const char *itemName = NULL;
if (id == ItemId_Quiver && (s32) mQuiverSize >= 1) {
itemName = sSpecialItemModelNames[1];
} else if (id == ItemId_BigBombBag && (s32) mBombBagSize >= 1) {
@@ -774,11 +753,11 @@ THUMB void ItemManager::GiveItem(ItemId id) {
break;
}
} break;
case ItemId_SandOfHours: {
mHourglassSandFrames += 3600;
} break;
case ItemId_GoldenChimney: {
gAdventureFlags->Set(AdventureFlag_ReceivedGoldenChimney, true);
GiveShipPart(ShipPart_Chimney, ShipType_Golden);
@@ -814,8 +793,8 @@ THUMB void ItemManager::GiveItem(ItemId id) {
case ItemId_Rupoor50: {
this->GiveRupees(-50, true);
} break;
case ItemId_None: break;
case ItemId_Nothing: break;
case ItemId_Unk_5: break;
case ItemId_Unk_16: break;
case ItemId_Unk_131: break;
@@ -827,11 +806,9 @@ THUMB void ItemManager::GiveItem(ItemId id) {
}
} break;
}
if (
gAdventureFlags->Get(AdventureFlag_Azurine) &&
gAdventureFlags->Get(AdventureFlag_Crimsonine) &&
gAdventureFlags->Get(AdventureFlag_Aquanine)
) {
if (gAdventureFlags->Get(AdventureFlag_Azurine) && gAdventureFlags->Get(AdventureFlag_Crimsonine) &&
gAdventureFlags->Get(AdventureFlag_Aquanine))
{
gAdventureFlags->Set(AdventureFlag_Unk_128, true);
}
}
@@ -841,7 +818,7 @@ THUMB void ItemManager::GiveEquipItem(ItemFlag item, u16 ammo) {
SET_FLAG(mItemFlags.flags, flag);
this->GetEquipItem(item)->GiveAmmo(ammo);
if (mEquippedItem == ItemFlag_None) {
this->mEquippedItem = item;
this->mEquippedItem = item;
this->mEquipLoadTimer = 1;
}
}
@@ -862,7 +839,7 @@ ARM s32 ItemManager::GetMaxRupees() const {
extern void *data_027e103c;
extern "C" s32 func_ov00_020cf374(void *param1, bool param2);
extern "C" void func_ov05_02104004(void *param1);
ARM void ItemManager::GiveRupees(s16 amount, bool param2) {
ARM void ItemManager::GiveRupees(s32 amount, bool param2) {
s32 newRupees = mNumRupees + amount;
if (newRupees > this->GetMaxRupees()) {
newRupees = this->GetMaxRupees();
@@ -898,8 +875,8 @@ ARM ItemFlag ItemManager::GetEquippedItem() const {
ARM bool ItemManager::SetEquippedItem(ItemFlag equipId) {
mPrevEquippedItem = mEquippedItem;
mEquippedItem = equipId;
mEquipLoadTimer = 2;
mEquippedItem = equipId;
mEquipLoadTimer = 2;
return true;
}
@@ -912,7 +889,7 @@ THUMB void ItemManager::ForceEquipItem(ItemFlag equipId) {
if (i == equipId) continue;
(*mEquipItems)[i - ItemFlag_EQUIP_START]->UpdateInUse(0);
}
mForcedItem = equipId;
mForcedItem = equipId;
mEquipLoadTimer = 1;
}
@@ -966,12 +943,10 @@ ARM bool ItemManager::HasPotion(u32 index) const {
switch (mPotions[index]) {
case Potion_Red:
case Potion_Purple:
case Potion_Yellow:
return true;
case Potion_Yellow: return true;
case Potion_None:
default:
return false;
default: return false;
}
}
@@ -1032,7 +1007,7 @@ THUMB void ItemManager::PlayItemFanfareSfx(ItemId item) {
case ItemId_GoldRupee: {
sfx = SfxId_Fanfare_GoldRupee;
} break;
case ItemId_SmallKey:
case ItemId_GreenRupee:
case ItemId_BlueRupee:
@@ -1040,12 +1015,12 @@ THUMB void ItemManager::PlayItemFanfareSfx(ItemId item) {
sfx = SfxId_Fanfare_Rupee;
} break;
case ItemId_Rupoor10:
case ItemId_Rupoor10:
case ItemId_Rupoor50: {
sfx = SfxId_Fanfare_Rupoor;
} break;
case ItemId_None:
case ItemId_Nothing:
case ItemId_HerosNewClothes: {
sfx = SfxId_Fanfare_Nothing_2;
} break;
@@ -1053,13 +1028,14 @@ THUMB void ItemManager::PlayItemFanfareSfx(ItemId item) {
case ItemId_HeartContainer: {
sfx = SfxId_Fanfare_HeartContainer;
} break;
default: {
sfx = SfxId_Fanfare_Treasure;
} break;
}
if (gItemManager->mFanfareSfx != SfxId_None) {
sfx = gItemManager->mFanfareSfx;
gItemManager->mFanfareSfx = SfxId_None;
}
PlaySoundEffect(&data_ov00_020eec68, sfx);
+4 -4
View File
@@ -2,12 +2,12 @@
void Course::GetDungeonProgress(CourseProgress *param_2) {}
void Course::func_ov00_0207ca28(s32 param_2, unk32 param_3, unk32 param_4) {}
char* Course::SetCourseName(char *src) {}
char *Course::SetCourseName(char *src) {}
void Course::func_ov00_0207ca78(unk32 param_2, unk8 param_3, unk32 param_4) {}
bool Course::func_ov00_0207caa8(s32 param_2, unk32 *param_3, unk8 *param_4) {}
unk32 Course::func_ov00_0207cb30(s32 param_2) {}
void Course::FindMapGridPos(Vec2b *pos, Course *param_2, u32 map) {}
Vec3p* Course::FindMapCenter(unk32 map) {}
Vec3p *Course::FindMapCenter(unk32 map) {}
void Course::func_ov00_0207cbe8(s32 param_2) {}
unk8 Course::func_ov00_0207cc24(s32 param_2) {}
unk32 Course::FindMapData_Unk_08(unk32 map) {}
@@ -47,5 +47,5 @@ void Course::SetMapDataFlag3(unk32 param_2, bool param_3) {}
bool Course::GetMapDataFlag3(unk32 param_2) {}
void Course::SetMapDataFlag4(unk32 param_2, unk32 param_3) {}
bool Course::GetMapDataFlag4(unk32 param_2) {}
MapData* Course::FindMapData(u32 map) {}
MapData* Course::FindCurrentMapData() {}
MapData *Course::FindMapData(u32 map) {}
MapData *Course::FindCurrentMapData() {}
+3 -3
View File
@@ -29,7 +29,7 @@ unk8 MapBase::func_ov00_0207e968() {}
unk8 MapBase::func_ov00_0207e96c() {}
unk8 MapBase::vfunc_6c(unk32 param_2, unk32 param_3, unk32 param_4) {}
unk32 MapBase::vfunc_70(Vec3p *param_2) {}
s32* MapBase::vfunc_74(Vec3p *param_2) {}
s32 *MapBase::vfunc_74(Vec3p *param_2) {}
unk8 MapBase::func_ov00_0207f100() {}
bool MapBase::func_ov00_0207f104(unk32 param_2, unk32 param_3) {}
unk32 MapBase::func_ov00_0207f1f4(Vec3p *param_2, unk32 *param_3) {}
@@ -74,7 +74,7 @@ unk8 MapBase::GetTriggerBoundingBoxes(unk32 param_2, AABB *param_3, unk32 param_
unk32 MapBase::GetOverlappingTrigger(Vec3p *param_2) {}
bool TriggerBase::Overlaps() {}
unk8 MapBase::FindTrigger(unk32 type) {}
unk8 MapBase::GetOverlappingTriggers(Vec3p *param_2, TriggerBase * *triggers, unk32 capacity) {}
unk8 MapBase::GetOverlappingTriggers(Vec3p *param_2, TriggerBase **triggers, unk32 capacity) {}
bool MapBase::IsTriggerTypeOverlapped(unk32 type, Vec3p *param_3) {}
bool MapBase::AnyTrigger_func_0c(unk32 type) {}
unk32 TriggerBase::vfunc_0c() {}
@@ -99,7 +99,7 @@ bool MapBase::func_ov00_02080824(unk32 param_2, unk32 param_3) {}
bool MapBase::AddUnk_130(unk32 param_2) {}
bool MapBase::func_ov00_020809b8(unk32 param_2) {}
unk8 MapBase::func_ov00_02080a78(Vec3p *param_2) {}
void MapBase_Unk2::func_ov00_02080ad0(TriggerBase * *param_2, TriggerBase * *param_3) {}
void MapBase_Unk2::func_ov00_02080ad0(TriggerBase **param_2, TriggerBase **param_3) {}
unk8 MapBase::func_ov00_02080b24(Vec2b *param_2) {}
void MapBase::func_ov00_02080d08(unk32 param_2) {}
void MapBase::vfunc_bc() {}
+7 -5
View File
@@ -17,7 +17,7 @@ unk8 MapManager::func_ov00_02082454(unk32 param_2, unk32 param_3) {}
unk8 MapManager::func_ov00_02082494(unk32 param_2) {}
unk8 MapManager::func_ov00_020824cc(unk32 param_2) {}
unk8 MapManager::func_ov00_02082504() {}
unk8 * MapManager::func_ov00_02082538() {}
unk8 *MapManager::func_ov00_02082538() {}
void MapManager::func_ov00_02082594() {}
void MapManager::func_ov00_020825ac() {}
s32 MapManager::GetCourseFilePath(char *courseName, char *buf) {}
@@ -39,7 +39,7 @@ bool MapManager::func_ov00_020828f8(s32 *param_2) {}
unk8 MapManager::GetCourseData_Unk_b0() {}
s32 MapManager::func_ov00_02082914(unk32 param_2) {}
unk8 MapManager::func_ov00_02082acc() {}
unk32 * MapManager::func_ov00_02082adc() {}
unk32 *MapManager::func_ov00_02082adc() {}
unk8 MapManager::func_ov00_02082af4() {}
bool MapManager::func_ov00_02082b3c(s32 param_2) {}
unk8 MapManager::func_ov00_02082d08() {}
@@ -131,7 +131,7 @@ s32 MapManager::func_ov00_02083ef8(Vec3p *param_2, Vec3p *param_3, unk32 param_4
void MapManager::func_ov00_02083f44(Vec3p *param_2) {}
unk8 MapManager::MapData_vfunc_6c() {}
unk8 MapManager::MapData_vfunc_70() {}
unk8 MapManager::func_ov00_02083fb0(unk32 param_1, MapManager *param_2, unk32 param_3) {}
unk8 MapManager::func_ov00_02083fb0(u32 *param_1, MapManager *param_2, Vec3p *param_3) {}
void MapManager::func_ov00_02084024(unk32 param_2, AABB *param_3) {}
unk8 MapManager::MapData_vfunc_54() {}
unk8 MapManager::func_ov00_020840a0(unk8 param_2, unk8 param_3, unk32 param_4) {}
@@ -196,5 +196,7 @@ unk8 MapManager::func_ov00_020858b0() {}
s32 MapManager::func_ov00_02085a34(unk32 param_2, unk32 param_3) {}
unk8 MapManager::func_ov00_02085c60(unk32 param_2, unk32 param_3, unk32 param_4, unk32 param_5) {}
unk8 MapManager::func_ov00_02086044(unk32 param_2, unk32 param_3, unk32 param_4) {}
bool MapManager::func_ov00_02086284(s32 *param_2, Vec3p *param_3, Vec3p *param_4, s32 param_5, u16 param_6, Vec3p *param_7, Vec3p *param_8) {}
bool MapManager::func_ov00_02086a84(s32 *param_2, Vec3p *param_3, Vec3p *param_4, s32 param_5, s32 param_6, unk32 param_7, Vec3p *param_8, Vec3p *param_9) {}
bool MapManager::func_ov00_02086284(s32 *param_2, Vec3p *param_3, Vec3p *param_4, s32 param_5, u16 param_6, Vec3p *param_7,
Vec3p *param_8) {}
bool MapManager::func_ov00_02086a84(s32 *param_2, Vec3p *param_3, Vec3p *param_4, s32 param_5, s32 param_6, unk32 param_7,
Vec3p *param_8, Vec3p *param_9) {}
+13 -13
View File
@@ -14,7 +14,7 @@ void LinkStateBase::ChangeLinkSubState(LinkStateId id, s32 subState) {}
void LinkStateBase::EquipItem_vfunc_28() {}
void LinkStateBase::UpdateSwordShieldInUse() {}
void LinkStateBase::func_ov00_020a81b8(unk32 param1, unk32 param2) {}
LinkStateItem* LinkStateBase::GetLinkItemState() {}
LinkStateItem *LinkStateBase::GetLinkItemState() {}
void LinkStateBase::LookAt(Vec3p *target) {}
void LinkStateBase::func_ov00_020a81fc() {}
void LinkStateBase::AddHealth(s16 amount) {}
@@ -57,29 +57,29 @@ bool LinkStateBase::HasFlags_PlayerLinkBase_Unk48(u16 flags) {}
unk8 LinkStateBase::Get_PlayerLinkBase_Unk5e() {}
unk32 LinkStateBase::Get_PlayerControlData_Unk004() {}
PlayerCharacter LinkStateBase::GetCurrentCharacter() {}
PlayerControlData* LinkStateBase::GetPlayerControlData() {}
PlayerControlData *LinkStateBase::GetPlayerControlData() {}
LinkStateId LinkStateBase::GetStateId() {}
s32 LinkStateBase::GetHealth() {}
s32 LinkStateBase::GetCurrentCharacterHealth() {}
bool LinkStateBase::func_ov00_020a8c34() {}
Vec3p* LinkStateBase::GetPlayerPos() {}
Vec3p* LinkStateBase::GetPlayerVel() {}
unk8* LinkStateBase::func_ov00_020a8c64() {}
s16* LinkStateBase::GetPlayerAngle() {}
void* LinkStateBase::GetPlayer_Unk18() {}
Vec3p *LinkStateBase::GetPlayerPos() {}
Vec3p *LinkStateBase::GetPlayerVel() {}
unk8 *LinkStateBase::func_ov00_020a8c64() {}
s16 *LinkStateBase::GetPlayerAngle() {}
void *LinkStateBase::GetPlayer_Unk18() {}
s32 LinkStateBase::Get_PlayerControlData_Unk32() {}
Actor* LinkStateBase::GetGrabActor() {}
ActorRef* LinkStateBase::GetGrabActorRef() {}
Actor *LinkStateBase::GetGrabActor() {}
ActorRef *LinkStateBase::GetGrabActorRef() {}
unk32 LinkStateBase::Grab() {}
s32 LinkStateBase::Get_PlayerLinkBase_Unk44() {}
bool LinkStateBase::IsEquipBeingUsed(ItemFlag id) {}
EquipItem* LinkStateBase::GetEquipItem(ItemFlag id) {}
void* LinkStateBase::func_ov00_020a8d40() {}
EquipItem *LinkStateBase::GetEquipItem(ItemFlag id) {}
void *LinkStateBase::func_ov00_020a8d40() {}
unk32 LinkStateBase::func_ov00_020a8d50() {}
unk32 LinkStateBase::func_ov00_020a8d6c() {}
s32 LinkStateBase::PlayerControlData_vfunc_14(s32 param1) {}
unk32 LinkStateBase::Get_PlayerControlData_Unk100() {}
unk32 LinkStateBase::Get_PlayerControlData_Unk120() {}
s32 LinkStateBase::Get_PlayerLinkBase_Unk38() {}
DebugHierarchy* LinkStateBase::GetDebugHierarchy0() {}
DebugHierarchy* LinkStateBase::GetDebugHierarchy1() {}
DebugHierarchy *LinkStateBase::GetDebugHierarchy0() {}
DebugHierarchy *LinkStateBase::GetDebugHierarchy1() {}
+1 -1
View File
@@ -6,7 +6,7 @@ void LinkStateFollow::MoveTowardTarget() {}
void LinkStateFollow::OnStateLeave(s32 param1) {}
bool LinkStateFollow::vfunc_24(s32 param1) {}
bool LinkStateFollow::vfunc_28() {}
LinkStateCutscene* LinkStateFollow::GetLinkStateCutscene() {}
LinkStateCutscene *LinkStateFollow::GetLinkStateCutscene() {}
bool LinkStateFollow::vfunc_34(Vec3p *param1) {}
bool LinkStateFollow::func_ov00_020a9180(Vec3p *param1) {}
bool LinkStateFollow::func_ov00_020a9210(Vec3p *param1, Actor *param2) {}
+1 -1
View File
@@ -9,7 +9,7 @@ void LinkStateInteract::OnStateLeave(s32 param1) {}
bool LinkStateInteract::func_ov00_020aa818() {}
void LinkStateInteract::func_ov00_020aa844(Actor *param1) {}
bool LinkStateInteract::vfunc_20(s32 param1) {}
LinkStateRoll* LinkStateInteract::GetLinkStateRoll() {}
LinkStateRoll *LinkStateInteract::GetLinkStateRoll() {}
bool LinkStateInteract::vfunc_24(s32 param1) {}
bool LinkStateInteract::vfunc_34(Vec3p *param1) {}
void LinkStateInteract::SetGrabActorVelocity(Vec3p *velocity) {}
+2 -2
View File
@@ -4,7 +4,7 @@ void LinkStateItem::vfunc_00() {}
LinkStateId LinkStateItem::GetId() {}
s32 LinkStateItem::IsHammerEquipped() {}
void LinkStateItem::OnStateLeave(s32 param1) {}
EquipBombchu* LinkStateItem::GetEquipBombchu() {}
LinkStateMove* LinkStateItem::GetLinkStateMove() {}
EquipBombchu *LinkStateItem::GetEquipBombchu() {}
LinkStateMove *LinkStateItem::GetLinkStateMove() {}
bool LinkStateItem::func_ov00_020abf70() {}
bool LinkStateItem::vfunc_28() {}
+2 -2
View File
@@ -5,8 +5,8 @@ ItemFlag PlayerBase::GetEquipId() {}
bool PlayerBase::CanMove() {}
void PlayerBase::SetUpdatePos(bool updatePos) {}
void PlayerBase::SetVisible(bool visible) {}
EquipSword* PlayerBase::GetEquipSword() {}
EquipShield* PlayerBase::GetEquipShield() {}
EquipSword *PlayerBase::GetEquipSword() {}
EquipShield *PlayerBase::GetEquipShield() {}
void PlayerBase::LookAt(Vec3p *target) {}
bool PlayerBase::func_ov00_020a7c00(s32 param1) {}
bool PlayerBase::CollidesWith(Cylinder *cylinder) {}
+1 -1
View File
@@ -4,7 +4,7 @@ bool PlayerControl::func_ov00_020aeeac() {}
void PlayerControl::func_ov00_020aeef8() {}
void PlayerControl::func_ov00_020aef30() {}
void PlayerControl::UpdateAim() {}
Actor* PlayerControl::GetFollowActor() {}
Actor *PlayerControl::GetFollowActor() {}
bool PlayerControl::func_ov00_020af01c(unk8 *param1) {}
void PlayerControl::SetUnk_80() {}
void PlayerControl::StopFollowing() {}
+4 -4
View File
@@ -32,14 +32,14 @@ unk32 AdventureFlags::Get_FlagsUnk_44(int index) {}
unk32 AdventureFlags::Get_FlagsUnk_30(int index) {}
bool AdventureFlags::Get_FlagsUnk_00(int index, FlagsUnk2 *result) {}
bool AdventureFlags::Get_FlagsUnk_18(int index, FlagsUnk2 *result) {}
FlagsUnk* AdventureFlags::Get_FlagsUnk(int index) {}
FlagsUnk *AdventureFlags::Get_FlagsUnk(int index) {}
bool AdventureFlags::func_ov00_02097e6c() {}
bool AdventureFlags::func_ov00_02097e7c() {}
bool AdventureFlags::func_ov00_02097ea4() {}
unk32 AdventureFlags::func_ov00_02097ecc() {}
void* AdventureFlags::func_ov00_02097f8c() {}
void* AdventureFlags::func_ov00_02097fac() {}
void* AdventureFlags::func_ov00_02097fd0() {}
void *AdventureFlags::func_ov00_02097f8c() {}
void *AdventureFlags::func_ov00_02097fac() {}
void *AdventureFlags::func_ov00_02097fd0() {}
void AdventureFlags::func_ov00_02097ff4(bool param1, bool param2) {}
unk32 AdventureFlags::func_ov00_02098058() {}
bool AdventureFlags::func_ov00_02098064(unk32 param1) {}
+330 -15
View File
@@ -1,20 +1,335 @@
#include "Actor/ActorRupee.hpp"
#include "Item/ItemManager.hpp"
#include "Map/MapManager.hpp"
#include "Player/PlayerLinkBase.hpp"
#include "System/Random.hpp"
ActorType ActorRupee::gType;
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);
void func_ov000_020d7ad4(u32 *param1, u32 param2);
}
u16 GetRupeeValue(RupeeId id);
char *gShipParts[8] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
extern u32 *data_ov014_021589d8;
extern u32 data_ov000_020e9370[];
extern u32 data_ov000_020eec9c[];
extern u32 **data_027e0fe0[];
ActorType ActorRupee::gType = ActorType(ActorTypeId_Rupee, (ActorCreateFunc) ActorRupee::Create, NULL);
#pragma section force_data begin
ActorType_UnkClass data_ov014_021589f4 = ActorType_UnkClass(FLOAT_TO_Q21(0.4662), FLOAT_TO_Q19(0.4661));
#pragma section force_data end
ActorRupee *ActorRupee::Create() {
ActorRupee *newRupee = new(*data_027e0fe0[0], 4) ActorRupee();
return newRupee;
}
ActorRupee::ActorRupee() {
mRupeeId = 8;
mUnk_15c = 0;
}
// https://decomp.me/scratch/1qjCc
bool ActorRupee::vfunc_08() {
u32 dVar5;
u32 iVar7;
mRupeeId = mUnk_020.mUnk_00[0];
dVar5 = func_ov14_0213b70c(mRupeeId) ? *data_ov014_021589d8 : FLOAT_TO_Q20(0.666);
iVar7 = (s32) dVar5 >> 1;
mHitbox.pos.x = 0;
mHitbox.pos.y = iVar7;
mHitbox.pos.z = 0;
mHitbox.size = iVar7;
mUnk_08c.pos = mHitbox.pos;
mUnk_08c.size = mHitbox.size;
mUnk_0a4.mUnk_04.x = 0;
mUnk_0a4.mUnk_04.y = iVar7;
mUnk_0a4.mUnk_04.z = 0;
mUnk_0a4.mUnk_10 = iVar7 + FLOAT_TO_Q20(1.0);
mUnk_09c.mUnk_0 &= 0xFFFFFF4F;
mUnk_09c.mUnk_3 = 1;
mMaxFall = mUnk_08c.size - 1;
if (mUnk_03c >= 0) {
func_ov14_0213b204(1);
} else {
switch (mUnk_144) {
case 0:
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
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));
mVel.x = x - FLOAT_TO_Q20(0.0666);
mVel.y = y + FLOAT_TO_Q20(0.3333);
mVel.z = z - FLOAT_TO_Q20(0.0666);
func_ov14_0213b204(0);
break;
case 2:
mVel.x = 0;
mVel.y = FLOAT_TO_Q20(0.5);
mVel.z = 0;
func_ov14_0213b204(0);
break;
case 3: func_ov14_0213b204(5); break;
}
}
return true;
}
bool ActorRupee::vfunc_60() {
return func_ov14_0213b70c(mRupeeId);
}
ActorRupee* ActorRupee::Create() {}
ActorRupee::ActorRupee() {}
bool ActorRupee::vfunc_08() {}
bool ActorRupee::vfunc_60() {}
void ActorRupee::vfunc_64() {}
void ActorRupee::Move() {}
ItemId ActorRupee::GetRupeeCutsceneItemId() {}
void ActorRupee::func_ov14_0213b204(unk32 param1) {}
void ActorRupee::Update(bool param1) {}
void ActorRupee::vfunc_14(u32 param1) {}
void ActorRupee::vfunc_18(u32 param1) {}
void ActorRupee::vfunc_20(s32 param1) {}
void ActorRupee::func_ov14_0213b5f4(RupeeId id, unk32 param2, Vec3p *param3, bool param4) {}
void ActorRupee::func_ov14_0213b6a4(RupeeId id, void *param2) {}
bool ActorRupee::func_ov14_0213b70c(RupeeId id) {}
void ActorRupee::Move() {
s32 size;
ApplyGravity();
Vec3p_Add(&mPos, &mVel, &mPos); // Vec3p::Add()
mUnk_09c.mUnk_3 = 1;
size = mMaxFall = mUnk_08c.size - 1;
size += mUnk_014.y;
if (size < mPos.y) {
mUnk_09c.mUnk_0 = 0x49;
} else {
mUnk_09c.mUnk_0 = 0xcb;
}
if (this->func_01fffd04(0)) {
mVel.x = 0;
mVel.z = 0;
}
}
ItemId ActorRupee::GetRupeeCutsceneItemId() {
switch (mRupeeId) {
case RupeeId_Green: return ItemId_None;
case RupeeId_Blue: return ItemId_None;
case RupeeId_Red: return ItemId_None;
case RupeeId_BigGreen: return ItemId_BigGreenRupee;
case RupeeId_BigRed: return ItemId_BigRedRupee;
case RupeeId_Gold: return ItemId_GoldRupee;
case RupeeId_Rupoor10: return ItemId_Rupoor10;
case RupeeId_Rupoor50: return ItemId_Rupoor50;
default: break;
}
return ItemId_None;
}
void ActorRupee::func_ov14_0213b204(unk32 param1) {
switch (param1) {
case 0: mVisible = true; break;
case 1:
case 2:
case 3:
case 4:
case 5:
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
break;
}
mActiveFrames = 0;
mUnk_130 = param1;
}
void ActorRupee::Update(bool param1) {
ItemId cutsceneItemId;
s32 uVar3;
Vec3p local_1c;
u32 local_20;
u16 rupeeValue;
mPrevPos = mPos;
IncreaseActiveFrames();
if ((mUnk_130 != 3) && (++mUnk_15c >= 6) && CollidesWithPlayer(PlayerCollide_PickupFlags)) {
cutsceneItemId = GetRupeeCutsceneItemId();
if (cutsceneItemId >= 0) {
if (gPlayerLink->func_ov00_020bce48(cutsceneItemId)) {
Kill();
} else {
func_ov14_0213b204(3);
}
} else {
ItemManager *pItemMgr = gItemManager;
rupeeValue = GetRupeeValue(mRupeeId);
pItemMgr->GiveRupees(rupeeValue, false);
uVar3 = -1;
switch (mRupeeId) {
case RupeeId_Green: uVar3 = 0xfa; break;
case RupeeId_Blue: uVar3 = 0xfb; break;
case RupeeId_Red: uVar3 = 0xfc; break;
default: break;
}
func_ov000_020d7ad4(data_ov000_020eec9c, uVar3);
Kill();
}
}
if (!(mUnk_130 != 0 && mUnk_130 != 1 && mUnk_130 != 2)) {
if (func_ov00_020c2c0c()) {
func_ov14_0213b204(4);
} else if (func_ov00_020c2d54()) {
func_ov14_0213b204(5);
}
}
switch (mUnk_130) {
case 0:
Move();
if (mUnk_111) {
local_1c = mPos;
MapManager::func_ov00_02083fb0(&local_20, gMapManager, &local_1c);
if (((local_20 >> 5) & 3) == 2) {
Kill();
} else {
func_ov14_0213b204(1);
}
}
break;
case 3:
PlayerLinkBase *pLink = gPlayerLink;
if (pLink->func_ov00_020bce48(GetRupeeCutsceneItemId())) {
Kill();
}
break;
case 1:
if (param1) {
mActiveFrames = 0;
}
if ((mUnk_03c < 0) && (mActiveFrames >= 180)) {
func_ov14_0213b204(2);
}
break;
case 2:
if (param1) {
mActiveFrames = 0;
}
if (mActiveFrames >= 60) {
Kill();
}
break;
case 4:
if (!func_ov00_020c2c70()) {
func_ov14_0213b204(1);
}
break;
case 5:
if (!func_ov00_020c2de4()) {
func_ov14_0213b204(1);
}
break;
default: break;
}
KillInBounds();
}
void ActorRupee::vfunc_14(u32 param1) {
if (func_ov00_020c313c(param1)) {
Update(false);
}
func_ov000_0207a1c8(&mUnk_0a4.mUnk_00, param1, &mPos);
}
void ActorRupee::vfunc_18(u32 param1) {
if (func_ov00_020c313c(param1)) {
Update(true);
}
func_ov000_0207a1c8(&mUnk_0a4.mUnk_00, param1, &mPos);
}
#define VFUNC20_COND (param1 ? mUnk_0a4.mUnk_01 : mUnk_0a4.mUnk_00)
void ActorRupee::vfunc_20(bool param1) {
if (VFUNC20_COND && !(mUnk_130 == 2 && mActiveFrames % 8 < 4) && VFUNC20_COND) {
func_ov14_0213b5f4(mRupeeId, param1, &mPos, true);
}
}
void ActorRupee::func_ov14_0213b5f4(RupeeId id, unk32 param2, Vec3p *param3, bool param4) {
Actor_UnkStruct_012 unk_class;
static const u32 data_ov014_02153e28[] = {
// sRupeePalettes
0x9, // RupeeId_Green
0xA, // RupeeId_Blue
0x8, // RupeeId_Red
0x9, // RupeeId_BigGreen
0x8, // RupeeId_BigRed
0xB, // RupeeId_Gold
0xC, // RupeeId_Rupoor10
0xC, // RupeeId_Rupoor50
};
func_ov14_0213b6a4(id, &unk_class);
func_0202bc38(param2, param3, data_ov014_02153e28[id], &unk_class, 0);
if (param4) {
u32 var = func_ov14_0213b70c(id) ? 0x4cd : 0x400;
func_ov005_02102c2c(&data_ov000_020e9370[0], 0, param3, var, var, 0, 0x1f, 0, 1, 1);
}
}
void ActorRupee::func_ov14_0213b6a4(RupeeId id, Actor_UnkStruct_012 *param2) {
param2->mUnk_04 = 3;
if (func_ov14_0213b70c(id)) {
param2->mUnk_08 = 2;
param2->mUnk_0c = 2;
param2->mUnk_14 = data_ov014_021589f4.unk_00;
param2->mUnk_18 = data_ov014_021589f4.unk_04;
} else {
param2->mUnk_08 = 2;
param2->mUnk_0c = 2;
param2->mUnk_14 = FLOAT_TO_Q21(0.333);
param2->mUnk_18 = FLOAT_TO_Q19(0.333);
}
}
bool ActorRupee::func_ov14_0213b70c(RupeeId id) {
switch (id) {
case RupeeId_BigGreen:
case RupeeId_BigRed:
case RupeeId_Gold:
case RupeeId_Rupoor50: return true;
default: break;
}
return false;
}
ActorRupee::~ActorRupee() {}
+4 -8
View File
@@ -2,16 +2,12 @@
ActorTypeList sActorTypeList;
// Kill duplicate dtors
KILL(_ZN9ActorTypeC2EjPFP5ActorvEPFivE)
KILL(_ZN9ActorTypeD2Ev)
ARM ActorType::ActorType(ActorTypeId id, ActorCreateFunc create, unk32 (*unk_08)()) {
this->id = id;
this->id = id;
this->create = create;
this->unk_08 = unk_08;
this->unk_0c = 0;
this->next = NULL;
this->next = NULL;
this->Register();
sActorTypeList.tail = this;
}
@@ -41,13 +37,13 @@ ARM void ActorType::Register() {
ARM void ActorType::Unregister() {
ActorType *actorType;
ActorType **current = &sActorTypeList.head;
ActorType **current = &sActorTypeList.head;
ActorType **previous = NULL;
for (actorType = sActorTypeList.head; actorType != NULL; actorType = actorType->next) {
if (actorType == this) break;
previous = current;
current = &actorType->next;
current = &actorType->next;
}
if (previous != NULL) {