update .clang-format rules (#120)

This commit is contained in:
Yanis
2025-07-16 15:33:58 +02:00
committed by GitHub
parent ce9f96d932
commit 7a01af4783
25 changed files with 841 additions and 453 deletions
+6 -4
View File
@@ -3,9 +3,10 @@ IndentWidth: 4
ColumnLimit: 127
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
InsertBraces: true
IndentCaseLabels: true
IndentExternBlock: NoIndent
@@ -15,7 +16,7 @@ IndentAccessModifiers: false
AccessModifierOffset: -4
AlignConsecutiveAssignments: Consecutive
AlignEscapedNewlines: DontAlign
AlignEscapedNewlines: LeftWithLastLine
AlignTrailingComments: Leave
BreakConstructorInitializers: AfterColon
@@ -26,7 +27,8 @@ SpaceAfterCStyleCast: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterPlacementOperator: false
AfterControlStatements: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterControlStatement: MultiLine
AfterControlStatement: Never
+1 -1
View File
@@ -7,7 +7,7 @@
#define BMG_MAGIC "MESGbmg1"
#define BMG_GET_INF1(pGroups, flags) ((pGroups)->entries[(flags) >> 0x10].func_02037258((flags) & 0xFFFF))
#define BMG_GET_MSG_OFFSET(pGroups, flags) (BMG_GET_INF1((pGroups), (flags))->offset)
#define BMG_GET_MSG_ADDR(pGroups, flags) \
#define BMG_GET_MSG_ADDR(pGroups, flags) \
((u32) (pGroups)->entries[(flags) >> 0x10].pDAT1 + (BMG_GET_MSG_OFFSET((pGroups), (flags)) & ~1))
enum BMGTag {
+131 -58
View File
@@ -174,9 +174,13 @@ 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) {
u16 unk1 = mUnk_07a;
if (mUnk_129) unk1 = mUnk_126;
if (mUnk_129) {
unk1 = mUnk_126;
}
if (unk1 != 0xffff) {
if ((*param1 & 4) == 0 && (*param1 & 8) == 0) return;
if ((*param1 & 4) == 0 && (*param1 & 8) == 0) {
return;
}
unk32 unk2;
unk32 unk3;
if (func_ov00_02079470(data_027e0d3c, &mPos, 0, 0, &unk2, &unk3, 0, 0)) {
@@ -191,17 +195,23 @@ ARM void Actor::vfunc_1c(u16 *param1) {
ARM void Actor::vfunc_20(bool param1) {}
ARM void Actor::SetUnk_129(bool value) {
if (mUnk_128) mUnk_129 = value;
if (mUnk_128) {
mUnk_129 = value;
}
}
ARM bool Actor::SetUnk_11b() {
if (mUnk_11b) return false;
if (mUnk_11b) {
return false;
}
mUnk_11b = true;
return true;
}
ARM bool Actor::SetVelocity(Vec3p *vel) {
if (!mUnk_11b) return false;
if (!mUnk_11b) {
return false;
}
mVel = *vel;
mUnk_11b = false;
return true;
@@ -251,18 +261,21 @@ ARM bool Actor::vfunc_98() {}
ARM bool Actor::vfunc_9c() {}
ARM bool Actor::func_ov00_020c195c() {
if (!mUnk_11b) return false;
if (!mUnk_11b) {
return false;
}
gPlayerLink->func_ov000_020bc854(&mPos);
return true;
}
ARM bool Actor::func_ov00_020c198c() {
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)
{
(data_02056be4[data_027e077c.GetUnk4()] & 4) != 0 || data_027e103c->func_ov005_02103f4c() || gPlayer->mHealth <= 0) {
return false;
}
if (gPlayerLink && !gPlayerLink->func_ov000_020bd304()) {
return false;
}
if (gPlayerLink && !gPlayerLink->func_ov000_020bd304()) return false;
return true;
}
@@ -277,12 +290,12 @@ 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;
}
default: return false;
default:
return false;
}
}
@@ -336,7 +349,9 @@ ARM bool Actor::IsNearLink() {
q20 z = playerPos.z;
q20 dx = abs(playerPos.x - mPos.x);
if (dx > FLOAT_TO_Q20(10.0)) return false;
if (dx > FLOAT_TO_Q20(10.0)) {
return false;
}
q20 dz = abs(playerPos.z - mPos.z);
return dz <= FLOAT_TO_Q20(10.0);
}
@@ -354,12 +369,16 @@ ARM void Actor::func_ov00_020c1cf8() {
}
ARM bool Actor::func_ov00_020c1d58() {
if (gAdventureFlags->func_ov00_02097738()) return false;
if (gAdventureFlags->func_ov00_02097738()) {
return false;
}
return gPlayer->vfunc_04() != false;
}
ARM bool Actor::func_ov00_020c1da0(s32 param1, Vec3p *param2) {
if (!this->func_ov00_020c1d58()) return false;
if (!this->func_ov00_020c1d58()) {
return false;
}
Vec3p vec;
if (param2) {
@@ -372,8 +391,12 @@ ARM bool Actor::func_ov00_020c1da0(s32 param1, Vec3p *param2) {
}
ARM bool Actor::func_ov00_020c1e2c(s32 param1, Vec3p *param2) {
if (!this->func_ov00_020c1d58()) return false;
if (mHitbox.size < 0) return false;
if (!this->func_ov00_020c1d58()) {
return false;
}
if (mHitbox.size < 0) {
return false;
}
Vec3p vec;
if (param2) {
@@ -391,7 +414,9 @@ ARM bool Actor::func_ov00_020c1e2c(s32 param1, Vec3p *param2) {
}
ARM bool Actor::func_ov00_020c1ef8(Cylinder *param1, Vec3p *param2, s32 param3, s32 param4) {
if (!this->func_ov00_020c1d58()) return false;
if (!this->func_ov00_020c1d58()) {
return false;
}
if (gPlayer->CollidesWith(param1)) {
return gPlayer->vfunc_30(param3, param2, param4);
}
@@ -399,7 +424,9 @@ ARM bool Actor::func_ov00_020c1ef8(Cylinder *param1, Vec3p *param2, s32 param3,
}
ARM bool Actor::func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec3p *param4, u8 param5, s32 param6) {
if (!this->func_ov00_020c1d58()) return false;
if (!this->func_ov00_020c1d58()) {
return false;
}
if (gPlayer->func_ov00_020a7c60(param1, param2, param3)) {
return gPlayer->vfunc_30(param5, param4, param6);
}
@@ -407,7 +434,9 @@ ARM bool Actor::func_ov00_020c1f5c(Vec3p *param1, Vec3p *param2, s32 param3, Vec
}
ARM bool Actor::func_ov00_020c1fc8(PlayerCollide flags) {
if (gAdventureFlags->func_ov00_02097738()) return false;
if (gAdventureFlags->func_ov00_02097738()) {
return false;
}
bool result = false;
if (mHitbox.size >= 0) {
Vec3p vecFromPlayer;
@@ -463,7 +492,9 @@ ARM bool Actor::CollidesWithShield(Cylinder *param1) {
s32 currAngle = gPlayerAngle;
s32 angle = Atan2(vecFromPlayer.x, vecFromPlayer.z);
s32 angleDiff = (s16) angle - currAngle;
if (angleDiff < 0) angleDiff = -angleDiff;
if (angleDiff < 0) {
angleDiff = -angleDiff;
}
if (angleDiff <= DEG_TO_ANG(90) && gPlayer->EquipCollidesWith(param1, ItemFlag_WoodenShield)) {
return true;
}
@@ -475,19 +506,29 @@ ARM bool Actor::CollidesWithPlayer(PlayerCollide flags) {
Cylinder hitbox;
this->GetHitbox(&hitbox);
if (flags & PlayerCollide_Player) {
if (gPlayer->CollidesWith(&hitbox)) return true;
if (gPlayer->CollidesWith(&hitbox)) {
return true;
}
}
if (flags & PlayerCollide_Sword) {
if (gPlayer->EquipCollidesWith(&hitbox, ItemFlag_OshusSword)) return true;
if (gPlayer->EquipCollidesWith(&hitbox, ItemFlag_OshusSword)) {
return true;
}
}
if (flags & PlayerCollide_Shield) {
if (this->CollidesWithShield(&hitbox)) return true;
if (this->CollidesWithShield(&hitbox)) {
return true;
}
}
if (flags & PlayerCollide_Gongoron) {
if (gPlayerLink && gPlayerLink->GongoronCollidesWith(&hitbox)) return true;
if (gPlayerLink && gPlayerLink->GongoronCollidesWith(&hitbox)) {
return true;
}
}
if (flags & PlayerCollide_Hammer) {
if (gPlayer->EquipCollidesWith(&hitbox, ItemFlag_Hammer)) return true;
if (gPlayer->EquipCollidesWith(&hitbox, ItemFlag_Hammer)) {
return true;
}
}
}
return false;
@@ -507,8 +548,12 @@ ARM void Actor::func_ov00_020c23d4(ActorRef *ref, Actor *actor, Cylinder *cylind
}
ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
if (out) *out = NULL;
if (gAdventureFlags->func_ov00_02097738()) return false;
if (out) {
*out = NULL;
}
if (gAdventureFlags->func_ov00_02097738()) {
return false;
}
bool result = false;
if (mHitbox.size >= 0) {
@@ -529,28 +574,28 @@ ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
knockback.actor = actor;
switch (actor->mType) {
case ActorTypeId_SBEM: {
case ActorTypeId_SBEM:
knockback.mUnk_10 = 1;
} break;
break;
case ActorTypeId_Arrow: {
case ActorTypeId_Arrow:
knockback.mUnk_10 = 7;
} break;
break;
case ActorTypeId_BMRN: {
case ActorTypeId_BMRN:
knockback.mUnk_10 = 5;
} break;
break;
case ActorTypeId_GrapplingHook: {
case ActorTypeId_GrapplingHook:
knockback.mUnk_10 = 8;
} break;
break;
case ActorTypeId_Bomb:
case ActorTypeId_Blast:
case ActorTypeId_BMTY:
case ActorTypeId_CBLS: {
case ActorTypeId_CBLS:
knockback.mUnk_10 = 6;
} break;
break;
case ActorTypeId_TSBH:
case ActorTypeId_BIGR:
@@ -560,23 +605,25 @@ 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;
break;
case ActorTypeId_VLR0: {
case ActorTypeId_VLR0:
knockback.mUnk_10 = 4;
} break;
break;
default: {
default:
knockback.mUnk_10 = 11;
} break;
break;
}
result = this->vfunc_48(&knockback);
if (result) {
actor->mUnk_040 = this->mRef;
if (out) *out = actor;
if (out) {
*out = actor;
}
}
}
}
@@ -590,15 +637,21 @@ ARM bool Actor::CollidesWith(Actor *other) {
Cylinder a, b;
this->GetHitbox(&a);
other->GetHitbox(&b);
if (a.Overlaps(&b)) collides = true;
if (a.Overlaps(&b)) {
collides = true;
}
}
}
return collides;
}
ARM bool Actor::func_ov00_020c27a8(unk32 param1) {
if (mUnk_11b) return false;
if (param1 == 0) return mUnk_12c != 0;
if (mUnk_11b) {
return false;
}
if (param1 == 0) {
return mUnk_12c != 0;
}
return mUnk_12c == param1;
}
@@ -614,7 +667,9 @@ ARM bool Actor::IsFollowedByLink() {
}
ARM void Actor::StopLinkFollow() {
if (!this->IsFollowedByLink()) return;
if (!this->IsFollowedByLink()) {
return;
}
gPlayerControl->StopFollowing();
}
@@ -667,7 +722,9 @@ ARM void Actor::func_ov00_020c2988(Vec3p *param1, q20 param2, Vec3p *param3) {
param3->y = 0;
param3->z = z1 - z0;
q20 dist = this->XzDistanceTo(param1);
if (dist < param2) param2 = dist;
if (dist < param2) {
param2 = dist;
}
func_0202d95c(param3, param2);
}
@@ -709,7 +766,9 @@ ARM void Actor::GetUnk_08c(Cylinder *param1) {
ARM void Actor::IncreaseActiveFrames() {
mActiveFrames += 1;
if (mActiveFrames < 0) mActiveFrames = 0;
if (mActiveFrames < 0) {
mActiveFrames = 0;
}
}
ARM bool Actor::func_ov00_020c2c0c() {
@@ -793,7 +852,9 @@ ARM bool Actor::func_ov00_020c2e7c() {
s32 unk2 = unk1;
if (unk1 >= 0) {
unk1 = rope->mUnk_70;
if (unk1 >= unk2) result = true;
if (unk1 >= unk2) {
result = true;
}
}
}
return result;
@@ -828,9 +889,13 @@ ARM bool Actor::func_ov00_020c2ed4() {
}
} else {
index = rope->func_ov14_0213d480(mRef.id);
if (index >= 0) return true;
if (index >= 0) {
return true;
}
}
if (rope->mUnk_6a) {
mVel = gVec3p_ZERO;
}
if (rope->mUnk_6a) mVel = gVec3p_ZERO;
return false;
}
@@ -852,7 +917,9 @@ ARM bool Actor::IsHitboxTouched(bool param1) {
ARM void Actor::ApplyGravity() {
mVel.y -= mGravity;
if (mVel.y < -mMaxFall) mVel.y = -mMaxFall;
if (mVel.y < -mMaxFall) {
mVel.y = -mMaxFall;
}
}
ARM bool Actor::func_ov00_020c3094() {
@@ -885,18 +952,24 @@ ARM bool Actor::func_ov00_020c313c(u32 param1) {
}
ARM void Actor::func_ov00_020c3158() {
if (mUnk_03c < 0) return;
if (mUnk_03c < 0) {
return;
}
gMapManager->SetMapDataFlag1(mUnk_03c, 1);
}
ARM void Actor::Kill() {
mAlive = false;
if (mUnk_119 == 0) return;
if (mUnk_119 == 0) {
return;
}
this->func_ov00_020c3158();
}
ARM void Actor::KillInBounds() {
if (mPos.y >= -FLOAT_TO_Q20(10.0)) return;
if (mPos.y >= -FLOAT_TO_Q20(10.0)) {
return;
}
this->Kill();
}
+39 -13
View File
@@ -47,7 +47,9 @@ ARM void ActorManager::DeleteActor(u32 index, bool param2) {
ARM void ActorManager::func_ov00_020c3484(ActorRef *ref, ActorManager *actorMgr, unk32 param3) {
ref->Reset();
if (data_027e103c->mUnk_24 == 0) return;
if (data_027e103c->mUnk_24 == 0) {
return;
}
q20 minDistance = 0x7fffffff;
Actor **actorIter = actorMgr->mActorTable;
@@ -153,13 +155,19 @@ ARM Actor *ActorManager::GetActor(ActorRef *ref) {
}
ARM bool FilterActor::Filter(Actor *actor) {
if (mType != actor->mType) return false;
if (mUnk_08 != -1 && mUnk_08 != actor->mUnk_034.id) return false;
if (mType != actor->mType) {
return false;
}
if (mUnk_08 != -1 && mUnk_08 != actor->mUnk_034.id) {
return false;
}
if (mExcludeRefs != NULL) {
for (s32 i = 0; mExcludeRefs[i].id != -1; ++i) {
ActorRef *ref = &mExcludeRefs[i];
volatile Actor *actor2 = actor;
if (ref->id == actor2->mRef.id) return false;
if (ref->id == actor2->mRef.id) {
return false;
}
}
}
if (mExcludeNotInAABB) {
@@ -168,7 +176,9 @@ ARM bool FilterActor::Filter(Actor *actor) {
pos.y = actor->mPos.y;
pos.z = actor->mPos.z;
bool result = !mAABB.ContainsInXZ(&pos);
if (result) return false;
if (result) {
return false;
}
}
if (mExcludeNotInSphere) {
Vec3p pos;
@@ -176,14 +186,18 @@ ARM bool FilterActor::Filter(Actor *actor) {
pos.y = actor->mPos.y;
pos.z = actor->mPos.z;
bool result = !mSphere.ContainsInXZ(&pos);
if (result) return false;
if (result) {
return false;
}
}
return true;
}
ARM s32 ActorManager::FilterActors(FilterActorBase *filter, ActorList *filteredActors) {
s32 numApplied = 0;
if (filteredActors != NULL) filteredActors->length = 0;
if (filteredActors != NULL) {
filteredActors->length = 0;
}
Actor **actorIter = mActorTable;
Actor **actorTableEnd = actorIter + mMaxActorIndex;
@@ -247,7 +261,9 @@ ARM void ActorManager::func_ov00_020c399c(u32 index, Cylinder *cylinder) {
}
ARM Actor *ActorManager::func_ov00_020c39ac(s32 index, const ActorTypeId *actorTypes, bool param3) {
if (actorTypes == NULL && param3) return NULL;
if (actorTypes == NULL && param3) {
return NULL;
}
Actor *actor = mActorTable[index];
Actor *result = NULL;
@@ -277,7 +293,9 @@ ARM Actor *ActorManager::func_ov00_020c39ac(s32 index, const ActorTypeId *actorT
otherActor3->mHitbox.pos.z = oldHitbox.pos.z;
otherActor3->mHitbox.size = oldHitbox.size;
if (result != NULL) break;
if (result != NULL) {
break;
}
}
}
}
@@ -288,7 +306,9 @@ ARM Actor *ActorManager::func_ov00_020c39ac(s32 index, const ActorTypeId *actorT
}
ARM s32 ActorManager::func_ov00_020c3b2c(s32 *param1) {
if (param1 != NULL) *param1 = 0;
if (param1 != NULL) {
*param1 = 0;
}
s32 i;
s32 numAlive = 0;
@@ -309,11 +329,15 @@ ARM s32 ActorManager::func_ov00_020c3b2c(s32 *param1) {
}
ARM s32 ActorManager::func_ov00_020c3bb0(unk32 param1, s32 *param2) {
if (param2 != NULL) *param2 = 0;
if (param2 != NULL) {
*param2 = 0;
}
AABB boxes[8];
s32 numBoxes = gMapManager->GetTriggerBoundingBoxes(param1, boxes, ARRAY_LEN_U(boxes));
if (numBoxes <= 0) return 0;
if (numBoxes <= 0) {
return 0;
}
s32 i;
s32 numInBox = 0;
@@ -350,7 +374,9 @@ ARM s32 ActorManager::func_ov00_020c3bb0(unk32 param1, s32 *param2) {
ARM void ActorManager::func_ov00_020c3ce8(unk32 param1, bool param2) {
AABB boxes[8];
s32 numBoxes = gMapManager->GetTriggerBoundingBoxes(param1, boxes, ARRAY_LEN_U(boxes));
if (numBoxes <= 0) return;
if (numBoxes <= 0) {
return;
}
s32 i;
Actor **actorIter = mActorTable;
@@ -39,7 +39,9 @@ ARM void ActorActionObject::vfunc_14(u32 param1) {
u32 flag = mUnk_020.mUnk_00[2];
bool bVar3;
switch (mUnk_020.mUnk_00[0]) {
case 0: bVar3 = true; break;
case 0:
bVar3 = true;
break;
case 1:
if (gPlayerLink->mGrabActor.id != -1 && gPlayerLink->GetStateId() == LinkStateId_Move) {
bVar3 = true;
@@ -54,7 +56,9 @@ ARM void ActorActionObject::vfunc_14(u32 param1) {
bVar3 = false;
}
break;
default: bVar3 = false; break;
default:
bVar3 = false;
break;
}
if (!bVar3) {
+19 -8
View File
@@ -71,14 +71,16 @@ ARM void ActorEventIcon::func_ov000_02090648(u32 param1) {
return;
}
break;
case 1: break;
case 1:
break;
case 2:
if (this->mUnk_160.mUnk_5c.mUnk_08 >= 0x5A000 && Vec3p_Distance(&this->mPos, &gPlayerPos) > 0x1000) {
this->func_ov000_02090774(1);
return;
}
break;
default: break;
default:
break;
}
if (this->mUnk_160.mUnk_5c.mUnk_00 == 1) {
@@ -95,8 +97,10 @@ ARM void ActorEventIcon::func_ov000_02090648(u32 param1) {
}
}
break;
case 1: break;
default: break;
case 1:
break;
default:
break;
}
this->mUnk_160.func_0203516c();
@@ -106,9 +110,14 @@ ARM bool ActorEventIcon::func_ov000_02090774(u32 param1) {
this->mUnk_130 = param1;
switch (this->mUnk_130) {
case 0: this->mUnk_158 = 0; break;
case 1: this->mAlive = false; break;
default: break;
case 0:
this->mUnk_158 = 0;
break;
case 1:
this->mAlive = false;
break;
default:
break;
}
return true;
@@ -140,7 +149,9 @@ ARM void ActorEventIcon::vfunc_1c(u16 *param1) {
iStack_10 -= 0x11;
}
break;
default: iStack_10 += this->mUnk_15c; break;
default:
iStack_10 += this->mUnk_15c;
break;
}
this->mUnk_160.func_02034a1c(iStack_c, iStack_10, 0);
@@ -37,9 +37,14 @@ void ActorSwitchObject::vfunc_14(u32 param1) {
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;
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;
@@ -72,7 +77,9 @@ bool ActorSwitchObject::func_ov000_0208fc10(s32 param1) {
this->mUnk_130 = param1;
switch (param1) {
case 0: this->func_ov00_020c1c20(0, 0); break;
case 0:
this->func_ov00_020c1c20(0, 0);
break;
case 1:
this->func_ov00_020c1c20(0, 1);
if (this->mUnk_158 == 0) {
+8 -4
View File
@@ -11,8 +11,10 @@ THUMB bool Item::func_ov00_020ad020(ItemId item) {
case ItemId_GoldenCannon:
case ItemId_GoldenHull:
case ItemId_Unk_126:
case ItemId_Unk_133: return true;
default: break;
case ItemId_Unk_133:
return true;
default:
break;
}
return false;
@@ -25,8 +27,10 @@ THUMB bool Item::func_ov00_020ad068(ItemId item) {
case ItemId_SpiritOfCourageUpgradeLvl1:
case ItemId_SpiritOfPowerUpgradeLvl2:
case ItemId_SpiritOfWisdomUpgradeLvl2:
case ItemId_SpiritOfCourageUpgradeLvl2: return true;
default: break;
case ItemId_SpiritOfCourageUpgradeLvl2:
return true;
default:
break;
}
return false;
+256 -182
View File
@@ -125,7 +125,9 @@ THUMB void ItemManager::Load(const SaveItemManager *save) {
ARM FairyId ItemManager::GetEquippedFairy() const {
FairyId fairy = mEquippedFairy;
if (fairy == FairyId_None) return FairyId_Courage;
if (fairy == FairyId_None) {
return FairyId_Courage;
}
return fairy;
}
@@ -149,7 +151,9 @@ ARM void ItemManager::TickEquipItem(void) {
}
(*mEquipItems)[ItemFlag_OshusSword]->vfunc_30();
(*mEquipItems)[ItemFlag_WoodenShield]->vfunc_30();
if (data_027e0d38->mUnk_14 == 1) return;
if (data_027e0d38->mUnk_14 == 1) {
return;
}
if (equip != ItemFlag_None && mEquipLoadTimer == 0) {
(*mEquipItems)[equip]->vfunc_30();
}
@@ -194,11 +198,17 @@ ARM void ItemManager::EquipItem_vfunc_38(unk32 param1) {
this->Sword_vfunc_38(param1);
this->Shield_vfunc_38(param1);
}
if (data_027e0d38->mUnk_14 == 1) return;
if (data_027e0d38->mUnk_14 == 1) {
return;
}
ItemFlag equip = this->GetEquippedItem();
if (equip == ItemFlag_None) return;
if (mEquipLoadTimer > 0) return;
if (equip == ItemFlag_None) {
return;
}
if (mEquipLoadTimer > 0) {
return;
}
(*mEquipItems)[equip]->vfunc_38(param1);
}
@@ -233,7 +243,9 @@ ARM u16 ItemManager::GetAmmo(ItemFlag equipId) const {
ARM void ItemManager::GiveAmmo(ItemFlag equipId, u32 amount) {
(*mAmmo)[equipId] += amount;
if ((*mAmmo)[equipId] <= this->GetMaxAmmo(equipId)) return;
if ((*mAmmo)[equipId] <= this->GetMaxAmmo(equipId)) {
return;
}
(*mAmmo)[equipId] = this->GetMaxAmmo(equipId);
}
@@ -242,8 +254,12 @@ extern "C" bool func_ov015_02136670(void *param1);
extern u8 data_ov022_0217a4ac[];
ARM bool ItemManager::func_ov00_020ad790(unk32 param1) {
unk32 unk1 = data_027e0d38->func_ov000_02078b40();
if (unk1 == 2) return func_ov015_02136670(data_027e10a4);
if (data_027e0d38->mUnk_14 == 1) return false;
if (unk1 == 2) {
return func_ov015_02136670(data_027e10a4);
}
if (data_027e0d38->mUnk_14 == 1) {
return false;
}
if (gOverlayManager.mLoadedOverlays[OverlayIndex_6] == OverlayId_29 && data_ov022_0217a4ac[0x54] != 0) {
return false;
}
@@ -251,13 +267,14 @@ ARM bool ItemManager::func_ov00_020ad790(unk32 param1) {
ItemFlag equipId = mForcedItem;
bool unk2 = !gMapManager->func_ov00_020849f8();
if (mEquippedItem != ItemFlag_None && (unk2 || (u32) mEquippedItem - 9 <= 1) &&
(gPlayerLink == 0 || gPlayerLink->func_ov000_020bbd80(param1)) && this->HasItem(mEquippedItem))
{
(gPlayerLink == 0 || gPlayerLink->func_ov000_020bbd80(param1)) && this->HasItem(mEquippedItem)) {
equipId = mEquippedItem;
}
if (equipId != ItemFlag_None) {
if (mEquipLoadTimer != 0) return param1 == 0;
if (mEquipLoadTimer != 0) {
return param1 == 0;
}
return this->GetEquipItem(equipId)->IsUsable(param1);
}
return false;
@@ -276,7 +293,9 @@ THUMB s8 ItemManager::GetShipPartCount(ShipPart part, ShipType type) const {
}
THUMB void ItemManager::SetShipPartCount(ShipPart part, ShipType type, s8 count) {
if (count > 99) count = 99;
if (count > 99) {
count = 99;
}
mShipParts[part][type] = count;
}
@@ -285,7 +304,9 @@ THUMB s8 ItemManager::GetTreasureCount(Treasure treasure) const {
}
THUMB void ItemManager::SetTreasureCount(Treasure treasure, s8 count) {
if (count > 99) count = 99;
if (count > 99) {
count = 99;
}
mTreasure[treasure] = count;
}
@@ -300,16 +321,22 @@ THUMB u16 ItemManager::GetFishSize(u32 index) const {
THUMB s32 ItemManager::GetFishSize_Divided(u32 index) const {
q20 quotient = CoDivide64By32(INT_TO_Q20(mFishSize[index]), FLOAT_TO_Q20(2.54));
s32 result = ROUND_Q20(quotient);
if (result < 1) result = 1;
if (result < 1) {
result = 1;
}
return result;
}
THUMB void ItemManager::SetFishSize(u32 index, u16 value) {
u8 count = mFishCount[index] + 1;
if (count > 99) count = 99;
if (count > 99) {
count = 99;
}
mFishCount[index] = count;
if (value > mFishSize[index]) {
if (value > 9999) value = 9999;
if (value > 9999) {
value = 9999;
}
mFishSize[index] = value;
}
}
@@ -319,10 +346,14 @@ const u16 sBombBagSizes[] = {10, 20, 30, 0};
THUMB u16 ItemManager::GetMaxAmmo(ItemFlag equipId) const {
switch (equipId) {
case ItemFlag_Bow: return (sQuiverSizes + 1)[mQuiverSize];
case ItemFlag_BombBag: return sBombBagSizes[mBombBagSize];
case ItemFlag_BombchuBag: return sBombBagSizes[mBombchuBagSize];
default: return 1;
case ItemFlag_Bow:
return (sQuiverSizes + 1)[mQuiverSize];
case ItemFlag_BombBag:
return sBombBagSizes[mBombBagSize];
case ItemFlag_BombchuBag:
return sBombBagSizes[mBombchuBagSize];
default:
return 1;
}
}
@@ -335,17 +366,27 @@ THUMB u8 ItemManager::GetMaxTreasureCount() const {
}
ARM u32 ItemManager::GetActiveFairyLevel(FairyId id) const {
if (mEquippedFairy == FairyId_None) return 0;
if (mEquippedFairy == FairyId_None) {
return 0;
}
FairyId fairy = this->GetEquippedFairy();
if (fairy == FairyId_Courage && mUnk_14d != 0) return 0;
if (fairy == FairyId_Courage && mUnk_14d != 0) {
return 0;
}
fairy = this->GetEquippedFairy();
if (id == fairy) return this->GetFairyLevel(id);
if (id == fairy) {
return this->GetFairyLevel(id);
}
return 0;
}
ARM u32 ItemManager::GetFairyLevel(FairyId id) const {
if (this->HasItem(ItemFlag_FAIRY_LV2 + id)) return 2;
if (this->HasItem(ItemFlag_FAIRY_LV1 + id)) return 1;
if (this->HasItem(ItemFlag_FAIRY_LV2 + id)) {
return 2;
}
if (this->HasItem(ItemFlag_FAIRY_LV1 + id)) {
return 1;
}
return 0;
}
@@ -475,8 +516,7 @@ THUMB void ItemManager::LoadFanfareItem(ItemId 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)
{
id == ItemId_Unk_126 || id == ItemId_Unk_133) {
model = *data_027e1058;
} else if (id >= ItemId_TREASURE_START && id <= ItemId_TREASURE_END) {
model = LoadTreasureItemFanfare(data_027e105c, id - ItemId_TREASURE_START, true, false);
@@ -535,266 +575,277 @@ extern "C" void GiveShipPart(ShipPart part, ShipType type);
extern "C" void EquipLinebeckCannon();
THUMB void ItemManager::GiveItem(ItemId id) {
switch (id) {
case ItemId_SmallKey: {
case ItemId_SmallKey:
this->GiveKeys(1);
} break;
break;
case ItemId_GreenRupee: {
case ItemId_GreenRupee:
this->GiveRupees(1, true);
} break;
break;
case ItemId_BlueRupee: {
case ItemId_BlueRupee:
this->GiveRupees(5, true);
} break;
break;
case ItemId_RedRupee: {
case ItemId_RedRupee:
this->GiveRupees(20, true);
} break;
break;
case ItemId_BigGreenRupee: {
case ItemId_BigGreenRupee:
this->GiveRupees(100, true);
} break;
break;
case ItemId_BigRedRupee: {
case ItemId_BigRedRupee:
this->GiveRupees(200, true);
} break;
break;
case ItemId_GoldRupee: {
case ItemId_GoldRupee:
this->GiveRupees(300, true);
} break;
break;
case ItemId_OshusSword: {
case ItemId_OshusSword:
SET_FLAG(mItemFlags.flags, ItemFlag_OshusSword);
this->GetEquipItem(ItemFlag_OshusSword)->GiveAmmo(1);
} break;
break;
case ItemId_WoodenShield: {
case ItemId_WoodenShield:
SET_FLAG(mItemFlags.flags, ItemFlag_WoodenShield);
this->GetEquipItem(ItemFlag_WoodenShield)->GiveAmmo(1);
} break;
break;
case ItemId_BombBag: {
case ItemId_BombBag:
this->GiveEquipItem(ItemFlag_BombBag, 10);
} break;
break;
case ItemId_BombchuBag: {
case ItemId_BombchuBag:
this->GiveEquipItem(ItemFlag_BombchuBag, 10);
} break;
break;
case ItemId_Bow: {
case ItemId_Bow:
this->GiveEquipItem(ItemFlag_Bow, 20);
} break;
break;
case ItemId_Boomerang: {
case ItemId_Boomerang:
this->GiveEquipItem(ItemFlag_Boomerang, 1);
} break;
break;
case ItemId_Scoop: {
case ItemId_Scoop:
this->GiveEquipItem(ItemFlag_Shovel, 1);
} break;
break;
case ItemId_Hammer: {
case ItemId_Hammer:
this->GiveEquipItem(ItemFlag_Hammer, 1);
} break;
break;
case ItemId_Rope: {
case ItemId_Rope:
this->GiveEquipItem(ItemFlag_GrapplingHook, 1);
} break;
break;
case ItemId_PhantomHourglass: {
case ItemId_PhantomHourglass:
SET_FLAG(mItemFlags.flags, ItemFlag_Hourglass);
gAdventureFlags->Set(AdventureFlag_Hourglass, true);
} break;
break;
case ItemId_SWSeaChart: {
case ItemId_SWSeaChart:
SET_FLAG(mItemFlags.flags, ItemFlag_SeaChartSW);
gAdventureFlags->Set(AdventureFlag_SWSeaChart, true);
} break;
break;
case ItemId_NWSeaChart: {
case ItemId_NWSeaChart:
SET_FLAG(mItemFlags.flags, ItemFlag_SeaChartNW);
gAdventureFlags->Set(AdventureFlag_NWSeaChart, true);
} break;
break;
case ItemId_SESeaChart: {
case ItemId_SESeaChart:
SET_FLAG(mItemFlags.flags, ItemFlag_SeaChartSE);
gAdventureFlags->Set(AdventureFlag_SESeaChart, true);
} break;
break;
case ItemId_NESeaChart: {
case ItemId_NESeaChart:
SET_FLAG(mItemFlags.flags, ItemFlag_SeaChartNE);
gAdventureFlags->Set(AdventureFlag_NESeaChart, true);
} break;
break;
case ItemId_FishingRod: {
case ItemId_FishingRod:
SET_FLAG(mItemFlags.flags, ItemFlag_FishingRod);
gAdventureFlags->Set(AdventureFlag_FishingRod, true);
} break;
break;
case ItemId_Cannon: {
case ItemId_Cannon:
SET_FLAG(mItemFlags.flags, ItemFlag_Cannon);
gAdventureFlags->Set(AdventureFlag_Cannon, true);
GiveShipPart(ShipPart_Cannon, ShipType_Linebeck);
EquipLinebeckCannon();
} break;
break;
case ItemId_SunKey: {
case ItemId_SunKey:
SET_FLAG(mItemFlags.flags, ItemFlag_SunKey);
gAdventureFlags->Set(AdventureFlag_SunKey, true);
} break;
break;
case ItemId_Unk_39: {
case ItemId_Unk_39:
SET_FLAG(mItemFlags.flags, ItemFlag_Unk_39);
gAdventureFlags->Set(AdventureFlag_Unk_23, true);
} break;
break;
case ItemId_Quiver: {
case ItemId_Quiver:
this->UpgradeQuiver();
} break;
break;
case ItemId_BigBombBag: {
case ItemId_BigBombBag:
this->UpgradeBombBag();
} break;
break;
case ItemId_BigBombchuBag: {
case ItemId_BigBombchuBag:
this->UpgradeBombchuBag();
} break;
break;
case ItemId_KingsKey: {
case ItemId_KingsKey:
SET_FLAG(mItemFlags.flags, ItemFlag_KingsKey);
} break;
break;
case ItemId_GhostKey: {
case ItemId_GhostKey:
SET_FLAG(mItemFlags.flags, ItemFlag_GhostKey);
} break;
break;
case ItemId_PowerGem: {
case ItemId_PowerGem:
mNumGems[Gem_Power] += 1;
} break;
break;
case ItemId_WisdomGem: {
case ItemId_WisdomGem:
mNumGems[Gem_Wisdom] += 1;
} break;
break;
case ItemId_CourageGem: {
case ItemId_CourageGem:
mNumGems[Gem_Courage] += 1;
} break;
break;
case ItemId_SalvageArm: {
case ItemId_SalvageArm:
SET_FLAG(mItemFlags.flags, ItemFlag_SalvageArm);
gAdventureFlags->Set(AdventureFlag_SalvageArm, true);
gPlayerManager->mSalvageArmHealth = 5;
} break;
break;
case ItemId_SwordsmanScroll: {
case ItemId_SwordsmanScroll:
SET_FLAG(mItemFlags.flags, ItemFlag_SwordsmansScroll);
} break;
break;
case ItemId_Crimsonine: {
case ItemId_Crimsonine:
gAdventureFlags->Set(AdventureFlag_Crimsonine, true);
} break;
break;
case ItemId_Azurine: {
case ItemId_Azurine:
gAdventureFlags->Set(AdventureFlag_Azurine, true);
} break;
break;
case ItemId_Aquanine: {
case ItemId_Aquanine:
gAdventureFlags->Set(AdventureFlag_Aquanine, true);
} break;
break;
case ItemId_SpiritOfPowerUpgradeLvl1: {
case ItemId_SpiritOfPowerUpgradeLvl1:
SET_FLAG(mItemFlags.flags, ItemFlag_PowerLv1);
} break;
break;
case ItemId_SpiritOfWisdomUpgradeLvl1: {
case ItemId_SpiritOfWisdomUpgradeLvl1:
SET_FLAG(mItemFlags.flags, ItemFlag_WisdomLv1);
} break;
break;
case ItemId_SpiritOfCourageUpgradeLvl1: {
case ItemId_SpiritOfCourageUpgradeLvl1:
SET_FLAG(mItemFlags.flags, ItemFlag_CourageLv1);
} break;
break;
case ItemId_SpiritOfPowerUpgradeLvl2: {
case ItemId_SpiritOfPowerUpgradeLvl2:
SET_FLAG(mItemFlags.flags, ItemFlag_PowerLv2);
} break;
break;
case ItemId_SpiritOfWisdomUpgradeLvl2: {
case ItemId_SpiritOfWisdomUpgradeLvl2:
SET_FLAG(mItemFlags.flags, ItemFlag_WisdomLv2);
} break;
break;
case ItemId_SpiritOfCourageUpgradeLvl2: {
case ItemId_SpiritOfCourageUpgradeLvl2:
SET_FLAG(mItemFlags.flags, ItemFlag_CourageLv2);
} break;
break;
case ItemId_RedPotion: {
case ItemId_RedPotion:
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
if (mPotions[i] != Potion_None) {
continue;
}
this->SetPotion(i, Potion_Red);
break;
}
} break;
break;
case ItemId_PurplePotion: {
case ItemId_PurplePotion:
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
if (mPotions[i] != Potion_None) {
continue;
}
this->SetPotion(i, Potion_Purple);
break;
}
} break;
break;
case ItemId_YellowPotion: {
case ItemId_YellowPotion:
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] != Potion_None) continue;
if (mPotions[i] != Potion_None) {
continue;
}
this->SetPotion(i, Potion_Yellow);
break;
}
} break;
break;
case ItemId_SandOfHours: {
case ItemId_SandOfHours:
mHourglassSandFrames += 3600;
} break;
break;
case ItemId_GoldenChimney: {
case ItemId_GoldenChimney:
gAdventureFlags->Set(AdventureFlag_ReceivedGoldenChimney, true);
GiveShipPart(ShipPart_Chimney, ShipType_Golden);
} break;
break;
case ItemId_GoldenHandrail: {
case ItemId_GoldenHandrail:
gAdventureFlags->Set(AdventureFlag_ReceivedGoldenHandrail, true);
GiveShipPart(ShipPart_Handrail, ShipType_Golden);
} break;
break;
case ItemId_GoldenCannon: {
case ItemId_GoldenCannon:
gAdventureFlags->Set(AdventureFlag_ReceivedGoldenCannon, true);
GiveShipPart(ShipPart_Cannon, ShipType_Golden);
} break;
break;
case ItemId_GoldenHull: {
case ItemId_GoldenHull:
gAdventureFlags->Set(AdventureFlag_ReceivedGoldenHull, true);
GiveShipPart(ShipPart_Hull, ShipType_Golden);
} break;
break;
case ItemId_CycloneSlate: {
case ItemId_CycloneSlate:
SET_FLAG(mItemFlags.flags, ItemFlag_CycloneSlate);
} break;
break;
case ItemId_BigCatchLure: {
case ItemId_BigCatchLure:
SET_FLAG(mItemFlags.flags, ItemFlag_BigCatchLure);
} break;
break;
case ItemId_Rupoor10: {
case ItemId_Rupoor10:
this->GiveRupees(-10, true);
} break;
break;
case ItemId_Rupoor50: {
case ItemId_Rupoor50:
this->GiveRupees(-50, true);
} break;
break;
case ItemId_Nothing: break;
case ItemId_Unk_5: break;
case ItemId_Unk_16: break;
case ItemId_Unk_131: break;
case ItemId_Unk_132: break;
case ItemId_Nothing:
break;
case ItemId_Unk_5:
break;
case ItemId_Unk_16:
break;
case ItemId_Unk_131:
break;
case ItemId_Unk_132:
break;
default: {
if (ItemId_TREASURE_CHART_START <= id && id <= ItemId_TREASURE_CHART_END) {
@@ -803,8 +854,7 @@ THUMB void ItemManager::GiveItem(ItemId id) {
} break;
}
if (gAdventureFlags->Get(AdventureFlag_Azurine) && gAdventureFlags->Get(AdventureFlag_Crimsonine) &&
gAdventureFlags->Get(AdventureFlag_Aquanine))
{
gAdventureFlags->Get(AdventureFlag_Aquanine)) {
gAdventureFlags->Set(AdventureFlag_Unk_128, true);
}
}
@@ -822,9 +872,9 @@ THUMB void ItemManager::GiveEquipItem(ItemFlag item, u16 ammo) {
THUMB void ItemManager::UnequipPotion() {
switch (mEquippedItem) {
case ItemFlag_PotionA:
case ItemFlag_PotionB: {
case ItemFlag_PotionB:
this->EquipPreviousItem();
} break;
break;
}
}
@@ -856,13 +906,19 @@ ARM unk32 ItemManager::GetNumKeys() const {
THUMB void ItemManager::GiveKeys(u32 amount) {
s32 keys = amount + gMapManager->GetNumKeys();
if (keys >= MAX_KEYS) keys = MAX_KEYS;
if (keys <= 0) keys = 0;
if (keys >= MAX_KEYS) {
keys = MAX_KEYS;
}
if (keys <= 0) {
keys = 0;
}
gMapManager->SetNumKeys(keys);
}
ARM ItemFlag ItemManager::GetEquippedItem() const {
if (mForcedItem != ItemFlag_None) return mForcedItem;
if (mForcedItem != ItemFlag_None) {
return mForcedItem;
}
return mEquippedItem;
}
@@ -879,7 +935,9 @@ ARM void ItemManager::EquipPreviousItem() {
THUMB void ItemManager::ForceEquipItem(ItemFlag equipId) {
for (ItemFlag i = ItemFlag_EQUIP_START; i < ItemFlag_EQUIP_END; ++i) {
if (i == equipId) continue;
if (i == equipId) {
continue;
}
(*mEquipItems)[i - ItemFlag_EQUIP_START]->UpdateInUse(0);
}
mForcedItem = equipId;
@@ -888,7 +946,9 @@ THUMB void ItemManager::ForceEquipItem(ItemFlag equipId) {
THUMB bool ItemManager::ClearForcedEquipItem() {
mForcedItem = ItemFlag_None;
if (mEquippedItem != ItemFlag_None) return this->SetEquippedItem(mEquippedItem);
if (mEquippedItem != ItemFlag_None) {
return this->SetEquippedItem(mEquippedItem);
}
return false;
}
@@ -898,17 +958,23 @@ ARM void ItemManager::UpdateSwordShieldInUse() {
}
THUMB void ItemManager::UpgradeQuiver() {
if (mQuiverSize < MAX_AMMO_UPGRADE) mQuiverSize += 1;
if (mQuiverSize < MAX_AMMO_UPGRADE) {
mQuiverSize += 1;
}
(*mAmmo)[ItemFlag_Bow] = this->GetMaxAmmo(ItemFlag_Bow);
}
THUMB void ItemManager::UpgradeBombBag() {
if (mBombBagSize < MAX_AMMO_UPGRADE) mBombBagSize += 1;
if (mBombBagSize < MAX_AMMO_UPGRADE) {
mBombBagSize += 1;
}
(*mAmmo)[ItemFlag_BombBag] = this->GetMaxAmmo(ItemFlag_BombBag);
}
THUMB void ItemManager::UpgradeBombchuBag() {
if (mBombchuBagSize < MAX_AMMO_UPGRADE) mBombchuBagSize += 1;
if (mBombchuBagSize < MAX_AMMO_UPGRADE) {
mBombchuBagSize += 1;
}
(*mAmmo)[ItemFlag_BombchuBag] = this->GetMaxAmmo(ItemFlag_BombchuBag);
}
@@ -936,23 +1002,29 @@ 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;
}
}
ARM bool ItemManager::HasAllPotions() const {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (!this->HasPotion(i)) return false;
if (!this->HasPotion(i)) {
return false;
}
}
return true;
}
ARM bool ItemManager::HasPurplePotion() const {
for (s32 i = 0; i < MAX_POTIONS; ++i) {
if (mPotions[i] == Potion_Purple) return true;
if (mPotions[i] == Potion_Purple) {
return true;
}
}
return false;
}
@@ -961,21 +1033,23 @@ extern "C" void func_020196bc(ItemModel *param1, unk32 param2);
extern "C" void func_020196fc(ItemModel *param1, unk32 param2);
THUMB void ItemManager::LoadDungeonItemModels() {
for (s32 i = 0; i < DungeonItemModelId_COUNT; ++i) {
if (mDungeonItemModels[i] == NULL) continue;
if (mDungeonItemModels[i] == NULL) {
continue;
}
u16 unk1, unk2;
switch (i) {
case DungeonItemModelId_RoundCrystal:
case DungeonItemModelId_SquareCrystal:
case DungeonItemModelId_TriangleCrystal: {
case DungeonItemModelId_TriangleCrystal:
unk1 = data_027e0f78->mUnk_1e;
unk2 = data_027e0f78->mUnk_1c;
} break;
break;
default: {
default:
unk1 = data_027e0f78->mUnk_1a;
unk2 = data_027e0f78->mUnk_18;
} break;
break;
}
func_020196bc(mDungeonItemModels[i], unk1);
func_020196fc(mDungeonItemModels[i], unk2);
@@ -993,38 +1067,38 @@ THUMB void ItemManager::PlayItemFanfareSfx(ItemId item) {
switch (item) {
case ItemId_PowerGem:
case ItemId_WisdomGem:
case ItemId_CourageGem: {
case ItemId_CourageGem:
sfx = SfxId_Fanfare_Gem;
} break;
break;
case ItemId_GoldRupee: {
case ItemId_GoldRupee:
sfx = SfxId_Fanfare_GoldRupee;
} break;
break;
case ItemId_SmallKey:
case ItemId_GreenRupee:
case ItemId_BlueRupee:
case ItemId_RedRupee: {
case ItemId_RedRupee:
sfx = SfxId_Fanfare_Rupee;
} break;
break;
case ItemId_Rupoor10:
case ItemId_Rupoor50: {
case ItemId_Rupoor50:
sfx = SfxId_Fanfare_Rupoor;
} break;
break;
case ItemId_Nothing:
case ItemId_HerosNewClothes: {
case ItemId_HerosNewClothes:
sfx = SfxId_Fanfare_Nothing_2;
} break;
break;
case ItemId_HeartContainer: {
case ItemId_HeartContainer:
sfx = SfxId_Fanfare_HeartContainer;
} break;
break;
default: {
default:
sfx = SfxId_Fanfare_Treasure;
} break;
break;
}
if (gItemManager->mFanfareSfx != SfxId_None) {
sfx = gItemManager->mFanfareSfx;
+82 -42
View File
@@ -334,14 +334,18 @@ ARM bool MapManager::func_ov00_020824cc(s32 param_2) {
ARM s32 MapManager::func_ov00_02082504() {
s32 var = this->mMap->vfunc_4c();
if (var == 2) return this->mMap->mUnk_1ac;
if (var == 2) {
return this->mMap->mUnk_1ac;
}
return 0;
}
ARM Vec3p *MapManager::func_ov00_02082538() {
s32 var1 = this->mMap->vfunc_4c();
Vec3p var0;
if (var1 == 2) return &this->mMap->mUnk_1a0;
if (var1 == 2) {
return &this->mMap->mUnk_1a0;
}
var0 = gPlayerPos;
return &var0;
}
@@ -396,12 +400,20 @@ ARM void MapManager::CreateMap(unk32 mapType, unk32 param_3, unk32 param_4) {
MapBase *mapBase;
if (this->mMap == NULL) {
switch (mapType) {
case 4: this->mMap = new(data_027e0ce0[1], 4) Case_0(param_3, param_4); break;
case 2: this->mMap = new(data_027e0ce0[1], 4) MapBase(param_3, param_4); break;
case 0: this->mMap = new(data_027e0ce0[1], 4) Case_4(param_3, param_4); break;
case 4:
this->mMap = new(data_027e0ce0[1], 4) Case_0(param_3, param_4);
break;
case 2:
this->mMap = new(data_027e0ce0[1], 4) MapBase(param_3, param_4);
break;
case 0:
this->mMap = new(data_027e0ce0[1], 4) Case_4(param_3, param_4);
break;
case 1:
case 3:
default: this->mMap = new(data_027e0ce0[1], 4) Case_Default(param_3, param_4); break;
default:
this->mMap = new(data_027e0ce0[1], 4) Case_Default(param_3, param_4);
break;
}
}
}
@@ -488,8 +500,10 @@ ARM s32 MapManager::func_ov00_02082914(unk32 param_2) {
case 0xfb:
case 0xfc:
case 0xfd:
case 0xfe: break;
default: return (int) this;
case 0xfe:
break;
default:
return (int) this;
}
local_44.mId = -1;
local_44.mUnk_10 = 0;
@@ -563,8 +577,7 @@ void MapManager::func_ov00_02082b3c(unk32 *param_2, Vec2b *param_3) {
uVar4 = this->GetCurrentMapPosX();
if (((((param_3->x) == uVar4) && (uVar4 = this->GetCurrentMapPosY(), (param_3->y) == uVar4)) &&
((*(s32 *) (param_2 + 8) != 1 || (*(s32 *) (*(s32 *) data_027e0d38 + 0x14) != 1)))) &&
(*(char *) (param_2 + 0x15) == '\0'))
{
(*(char *) (param_2 + 0x15) == '\0')) {
gAdventureFlags->func_ov00_020976c8();
this->mUnk_0c = *(unk32 *) (param_2 + 0x13);
gPlayer->TeleportToEntrance(*(unk32 *) (param_2 + 0x13), false);
@@ -607,7 +620,8 @@ ARM u8 MapManager::func_ov00_02082d40() {
switch (this->mCourse->mType) {
case CourseType_Sea:
return this->mCourse->mMapGrid[(u8) this->mCourse->mCurrMapPos.x][(u8) this->mCourse->mCurrMapPos.y];
default: return this->mCourse->mUnk_0b1;
default:
return this->mCourse->mUnk_0b1;
}
}
@@ -1257,7 +1271,8 @@ ARM bool MapManager::func_ov00_02083e70(Vec2b *param_2) {
case 0x1b:
case 0x2b:
case 0x4e:
case 0x4f: return true;
case 0x4f:
return true;
}
iVar1 = this->MapData_vfunc_60(param_2);
@@ -1437,7 +1452,8 @@ ARM s32 MapManager::func_ov00_02084164(Vec2b *param_2) {
case 0x51:
case 0x52:
case 0x53:
case 0x54: return 1;
case 0x54:
return 1;
}
return 0;
}
@@ -1587,10 +1603,13 @@ ARM s32 MapManager::func_ov00_020846a4() {
switch (this->mCourse->mType) {
case CourseType_Dungeon:
case CourseType_TempleOfTheOceanKing:
case CourseType_Battle: return 1;
case CourseType_Sea: return 2;
case CourseType_Battle:
return 1;
case CourseType_Sea:
return 2;
case CourseType_Normal:
default: return 0;
default:
return 0;
}
}
return iVar1;
@@ -1692,8 +1711,10 @@ bool MapManager::func_ov00_02084838() {
case 0x13:
case 0x14:
case 0x15:
case 0x16: return true;
default: return false;
case 0x16:
return true;
default:
return false;
}
}
@@ -1704,7 +1725,8 @@ bool MapManager::func_ov00_020848b8() {
case 0xc:
case 0xd:
case 0xf:
case 0x11: return true;
case 0x11:
return true;
}
return false;
}
@@ -1751,7 +1773,8 @@ bool MapManager::func_ov00_020849dc() {
ARM bool MapManager::func_ov00_020849f8() {
switch (data_027e0d38->mUnk_0c.func_ov000_020a5e9c()) {
case 5: return true;
case 5:
return true;
default:
if (this->GetMapData_Unk_06() != 0 && !this->func_ov00_020849c0()) {
return true;
@@ -1784,7 +1807,9 @@ ARM bool MapManager::func_ov00_02084ac4(u32 actorId) {
return false;
}
if (iVar1->mType != ActorTypeId_EVIC) return false;
if (iVar1->mType != ActorTypeId_EVIC) {
return false;
}
iVar1->mAlive = false;
return true;
}
@@ -1819,10 +1844,17 @@ ARM void MapManager::func_ov00_02084b38(u32 param_2, unk32 param_3, bool param_4
}
pMVar1->mUnk_180[param_2 >> 5].mUnk_0 &= ~(1 << (param_2 & 0x1f));
break;
case 1: this->mCourse->SetMapDataFlag0(param_2, param_4); break;
case 2: this->mCourse->SetFlag0(param_2, param_4); break;
case 3: this->mCourse->SetFlag1(param_2, param_4); break;
default: break;
case 1:
this->mCourse->SetMapDataFlag0(param_2, param_4);
break;
case 2:
this->mCourse->SetFlag0(param_2, param_4);
break;
case 3:
this->mCourse->SetFlag1(param_2, param_4);
break;
default:
break;
}
}
@@ -1833,11 +1865,19 @@ bool MapManager::func_ov00_02084be0(u32 param_2, unk32 param_3) {
return false;
}
switch (param_3) {
case 0: return (this->mMap->mUnk_180[param_2 >> 5].mUnk_0 & 1 << (param_2 & 0x1f)) != 0;
case 1: bVar1 = this->mCourse->GetMapDataFlag0(param_2); return bVar1;
case 2: bVar1 = this->mCourse->GetFlag0(param_2); return bVar1;
case 3: bVar1 = this->mCourse->SetFlag1(param_2); return bVar1;
default: return false;
case 0:
return (this->mMap->mUnk_180[param_2 >> 5].mUnk_0 & 1 << (param_2 & 0x1f)) != 0;
case 1:
bVar1 = this->mCourse->GetMapDataFlag0(param_2);
return bVar1;
case 2:
bVar1 = this->mCourse->GetFlag0(param_2);
return bVar1;
case 3:
bVar1 = this->mCourse->SetFlag1(param_2);
return bVar1;
default:
return false;
}
}
@@ -2025,8 +2065,10 @@ unk32 MapManager::func_ov00_02084ebc(Vec3p *param_2) {
case 0x1f:
case 0x27:
case 0x28:
case 0x29: return 0;
default: break;
case 0x29:
return 0;
default:
break;
}
} else if (iVar2 == 0x37) {
return 0;
@@ -2165,8 +2207,7 @@ s32 MapManager::func_ov00_0208527c(MapManager *param_1, unk32 param_2, unk32 *pa
for (; (int) uVar1 <= (int) uVar6; uVar1 = uVar1 + 1) {
// iVar4 = puVar2->MapData_vfunc_78(0);
if (((iVar4 != 0) && ((*(u32 *) (iVar4 + 4) & 4) != 0)) &&
(iVar5 = func_ov000_0208b73c(iVar4, param_2), iVar5 != 0))
{
(iVar5 = func_ov000_0208b73c(iVar4, param_2), iVar5 != 0)) {
*param_3 = *(unk32 *) (iVar4 + 0x18);
param_3[1] = *(unk32 *) (iVar4 + 0x1c);
param_3[2] = *(unk32 *) (iVar4 + 0x20);
@@ -2227,8 +2268,7 @@ s32 MapManager::func_ov00_020853fc(MapManager *param_1, Vec3p *param_2, s32 *par
// iVar3 = gMapManager->MapData_vfunc_78(0);
if ((((iVar3 != 0) && ((*(u32 *) (iVar3 + 4) & 4) != 0)) &&
(iVar4 = Vec3p_Distance((Vec3p *) (iVar3 + 0x18), param_2), iVar4 < *param_3)) &&
(iVar5 = func_ov000_0208b7d0(iVar3, param_2), iVar5 != 0))
{
(iVar5 = func_ov000_0208b7d0(iVar3, param_2), iVar5 != 0)) {
*param_3 = iVar4;
iVar7 = iVar3;
}
@@ -2302,7 +2342,8 @@ unk32 MapManager::func_ov00_02085594(Vec3p *param_2) {
case 0x1f:
case 0x27:
case 0x28:
case 0x29: return 0;
case 0x29:
return 0;
}
} else if (iVar2 == 0x37) {
return 0;
@@ -2448,8 +2489,9 @@ s32 MapManager::func_ov00_02085a34(Vec3p *param_2, s32 param_3) {
// iVar2 = (**(code **) (*piVar1 + 0x3c))(piVar1, 1); // What is this?
return iVar2;
}
} else if (iVar2 == 0x61)
} else if (iVar2 == 0x61) {
goto LAB_overlay_d_0__02085afc;
}
return -1;
}
if ((iVar2 < 0x38) && (iVar2 != 1)) {
@@ -2795,8 +2837,7 @@ bool MapManager::func_ov00_02086284(s32 *param_2, Vec3p *param_3, Vec3p *param_4
local_70.z = local_5c;
if ((((*(char *) ((int) param_2 + 5) != '\0') && ((param_6 & 0x80) != 0)) &&
(iVar2 = Vec3p_Distance(&local_70, param_3), iVar2 <= local_58)) &&
((local_60 + local_54 <= param_4->y && (iVar2 = param_5 + local_60 + local_54, param_3->y <= iVar2))))
{
((local_60 + local_54 <= param_4->y && (iVar2 = param_5 + local_60 + local_54, param_3->y <= iVar2)))) {
param_7->y = iVar2;
param_8->x = 0;
param_8->y = 0x1000;
@@ -2844,8 +2885,7 @@ bool MapManager::func_ov00_02086284(s32 *param_2, Vec3p *param_3, Vec3p *param_4
}
if (((*(char *) ((int) param_2 + 5) != '\0') && ((param_6 & 0x80) != 0)) &&
(((param_3->x < local_94 && (((local_a0.x <= param_3->x && (param_3->z < local_8c)) && (local_98 <= param_3->z)))) ||
(local_90 + param_5 <= param_4->y))))
{
(local_90 + param_5 <= param_4->y)))) {
param_7->y = local_90 + param_5;
param_8->x = 0;
param_8->y = 0x1000;
+31 -13
View File
@@ -19,8 +19,10 @@ ARM LinkStateId LinkStateItem::GetId() {
ARM s32 LinkStateItem::IsHammerEquipped() {
switch (this->mEquipId) {
case ItemFlag_Hammer: return 0;
default: return -1;
case ItemFlag_Hammer:
return 0;
default:
return -1;
}
}
@@ -40,20 +42,32 @@ ARM void LinkStateItem::OnStateLeave(s32 param1) {
}
data_027e1098->func_ov014_0211fd04();
break;
case ItemFlag_OshusSword: break;
case ItemFlag_WoodenShield: break;
case ItemFlag_Boomerang: break;
case ItemFlag_BombBag: this->StopUsingBomb(param1); break;
case ItemFlag_Bow: break;
case ItemFlag_GrapplingHook: this->StopUsingRope(); break;
case ItemFlag_Hammer: this->StopUsingHammer(); break;
case ItemFlag_OshusSword:
break;
case ItemFlag_WoodenShield:
break;
case ItemFlag_Boomerang:
break;
case ItemFlag_BombBag:
this->StopUsingBomb(param1);
break;
case ItemFlag_Bow:
break;
case ItemFlag_GrapplingHook:
this->StopUsingRope();
break;
case ItemFlag_Hammer:
this->StopUsingHammer();
break;
case ItemFlag_PotionA:
case ItemFlag_PotionB:
UnkStruct_027e103c *pData_027e103c = data_027e103c;
pData_027e103c->mUnk_2a = 0;
pData_027e103c->func_ov000_020cf9dc(0, 0);
break;
case ItemFlag_Shovel: this->StopUsingScoop(); break;
case ItemFlag_Shovel:
this->StopUsingScoop();
break;
}
if (this->mEquipId != ItemFlag_None) {
@@ -63,10 +77,14 @@ ARM void LinkStateItem::OnStateLeave(s32 param1) {
switch (this->mEquipId) {
case ItemFlag_None:
case ItemFlag_OshusSword: break;
case ItemFlag_WoodenShield: break;
case ItemFlag_OshusSword:
break;
case ItemFlag_WoodenShield:
break;
case ItemFlag_PotionA:
case ItemFlag_PotionB: this->EquipItem_vfunc_28(); break;
case ItemFlag_PotionB:
this->EquipItem_vfunc_28();
break;
default:
this->EquipItem_vfunc_28();
if (param1 != 4 && param1 != 2) {
+4 -2
View File
@@ -51,8 +51,10 @@ ARM bool LinkStateMove::vfunc_24(s32 param1) {
return LinkStateBase::vfunc_24(param1);
}
switch (param1) {
case 2: return true;
default: return false;
case 2:
return true;
default:
return false;
}
}
+21 -17
View File
@@ -236,8 +236,10 @@ ARM bool PlayerControl::func_ov00_020af4a4() {
switch (data_027e077c.GetUnk0()) {
case 0x1a:
case 0x1b:
case 0x1c: return true;
default: return false;
case 0x1c:
return true;
default:
return false;
}
}
return false;
@@ -419,8 +421,12 @@ ARM void PlayerControl::func_ov00_020afb6c() {
s32 iVar8 = 0;
u32 uVar9 = 3;
switch (followActor->mUnk_12c) {
case 0: mFollowRef.Reset(); break;
case 1: iVar8 = 1; break;
case 0:
mFollowRef.Reset();
break;
case 1:
iVar8 = 1;
break;
case 5:
iVar8 = 2;
uVar9 = 1;
@@ -518,12 +524,15 @@ ARM bool PlayerControl::func_ov00_020afeec(unk32 param1, bool param2) {
case 1:
case 2:
case 7:
case 13: return true;
case 13:
return true;
case 10:
case 11: return param2;
case 11:
return param2;
default: return !param2;
default:
return !param2;
}
}
@@ -749,14 +758,12 @@ ARM bool PlayerControl::func_ov00_020b0778(Vec3p *param1, u32 angle, unk32 *para
temp_r5 = mTouchY - sp4;
if (this->CheckTouchedNow(1) != 0) {
if (((var_r6 - 0x18) <= temp_r4) && (temp_r4 <= (var_r6 + 0x18)) && ((var_r7 - 0x18) <= temp_r5) &&
(temp_r5 <= (var_r7 + 0x18)))
{
(temp_r5 <= (var_r7 + 0x18))) {
*param3 = FLOAT_TO_Q20(1.0);
return true;
}
if (((-0x18 - var_r6) <= temp_r4) && (temp_r4 <= (0x18 - var_r6)) && ((-0x18 - var_r7) <= temp_r5) &&
(temp_r5 <= (0x18 - var_r7)))
{
(temp_r5 <= (0x18 - var_r7))) {
*param3 = -FLOAT_TO_Q20(1.0);
return true;
}
@@ -783,14 +790,12 @@ ARM bool PlayerControl::func_ov00_020b0778(Vec3p *param1, u32 angle, unk32 *para
}
if (this->CheckTouching(1) != 0) {
if (((var_r6 < 0) && (temp_r4 < (var_r6 + 0x18))) || ((var_r6 > 0) && (temp_r4 > (var_r6 - 0x18))) ||
((var_r7 < 0) && (temp_r5 < (var_r7 + 0x18))) || ((var_r7 > 0) && (temp_r5 > (var_r7 - 0x18))))
{
((var_r7 < 0) && (temp_r5 < (var_r7 + 0x18))) || ((var_r7 > 0) && (temp_r5 > (var_r7 - 0x18)))) {
*param3 = FLOAT_TO_Q20(1.0);
return true;
}
if (((var_r6 > 0) && (temp_r4 < (0x18 - var_r6))) || ((var_r6 < 0) && (temp_r4 > (-0x18 - var_r6))) ||
((var_r7 > 0) && (temp_r5 < (0x18 - var_r7))) || ((var_r7 < 0) && (temp_r5 > (-0x18 - var_r7))))
{
((var_r7 > 0) && (temp_r5 < (0x18 - var_r7))) || ((var_r7 < 0) && (temp_r5 > (-0x18 - var_r7)))) {
*param3 = -FLOAT_TO_Q20(1.0);
return true;
}
@@ -852,8 +857,7 @@ ARM bool PlayerControl::func_ov00_020b0b0c(s16 *pAngle, ItemFlag *pEquipId, unk3
}
if ((this->CheckUntouchedNow(1) && mTouchDuration >= 0 && mTouchDuration < 21) ||
(this->CheckTouchFast(1) && mTouchSlowDuration > 21))
{
(this->CheckTouchFast(1) && mTouchSlowDuration > 21)) {
s32 dy = INT_TO_Q20(mTouchLastY - mTouchFastY);
s32 dx = INT_TO_Q20(mTouchLastX - mTouchFastX);
Vec3p local_20;
+2 -4
View File
@@ -96,8 +96,7 @@ ARM void LinkStateMove::vfunc_1c() {
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))
{
(temp_r7 == 9) || ((temp_r7 - 0xD) <= 1U)) {
this->EquipItem_vfunc_28();
}
}
@@ -209,8 +208,7 @@ ARM void LinkStateMove::vfunc_1c() {
ARM bool LinkStateMove::vfunc_3c() {
if ((gPlayerControl->GetFollowActor() == NULL) && (gPlayerControl->mFollowObject == NULL) &&
(this->Get_PlayerControlData_Unk120() != 2) && (this->Get_PlayerControlData_Unk120() != 3))
{
(this->Get_PlayerControlData_Unk120() != 2) && (this->Get_PlayerControlData_Unk120() != 3)) {
return true;
}
return false;
+5 -2
View File
@@ -108,8 +108,11 @@ ARM GameModeId GameStart::vfunc_08(bool param1) {
}
}
break;
case 0: mode = GameModeId_Adventure; break;
default: break;
case 0:
mode = GameModeId_Adventure;
break;
default:
break;
}
return mode;
+41 -18
View File
@@ -86,7 +86,9 @@ bool ActorRupee::Init() {
mVel.z = 0;
func_ov14_0213b204(0);
break;
case 3: func_ov14_0213b204(5); break;
case 3:
func_ov14_0213b204(5);
break;
}
}
@@ -122,23 +124,32 @@ void ActorRupee::Move() {
ItemId ActorRupee::GetRupeeCutsceneItemId() {
switch (mRupeeId) {
case RupeeId_Green: return ItemId_None;
case RupeeId_Green:
return ItemId_None;
case RupeeId_Blue: return ItemId_None;
case RupeeId_Blue:
return ItemId_None;
case RupeeId_Red: return ItemId_None;
case RupeeId_Red:
return ItemId_None;
case RupeeId_BigGreen: return ItemId_BigGreenRupee;
case RupeeId_BigGreen:
return ItemId_BigGreenRupee;
case RupeeId_BigRed: return ItemId_BigRedRupee;
case RupeeId_BigRed:
return ItemId_BigRedRupee;
case RupeeId_Gold: return ItemId_GoldRupee;
case RupeeId_Gold:
return ItemId_GoldRupee;
case RupeeId_Rupoor10: return ItemId_Rupoor10;
case RupeeId_Rupoor10:
return ItemId_Rupoor10;
case RupeeId_Rupoor50: return ItemId_Rupoor50;
case RupeeId_Rupoor50:
return ItemId_Rupoor50;
default: break;
default:
break;
}
return ItemId_None;
@@ -146,7 +157,9 @@ ItemId ActorRupee::GetRupeeCutsceneItemId() {
void ActorRupee::func_ov14_0213b204(unk32 param1) {
switch (param1) {
case 0: mVisible = true; break;
case 0:
mVisible = true;
break;
case 1:
case 2:
case 3:
@@ -188,10 +201,17 @@ void ActorRupee::Update(bool param1) {
uVar3 = -1;
switch (mRupeeId) {
case RupeeId_Green: uVar3 = 0xfa; break;
case RupeeId_Blue: uVar3 = 0xfb; break;
case RupeeId_Red: uVar3 = 0xfc; break;
default: break;
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);
@@ -252,7 +272,8 @@ void ActorRupee::Update(bool param1) {
func_ov14_0213b204(1);
}
break;
default: break;
default:
break;
}
KillInBounds();
@@ -323,9 +344,11 @@ bool ActorRupee::func_ov14_0213b70c(RupeeId id) {
case RupeeId_BigGreen:
case RupeeId_BigRed:
case RupeeId_Gold:
case RupeeId_Rupoor50: return true;
case RupeeId_Rupoor50:
return true;
default: break;
default:
break;
}
return false;
+43 -15
View File
@@ -123,7 +123,8 @@ ARM void ActorRefill::vfunc_14(u32 param1) {
temp_r0_3 = mUnk_130;
switch (temp_r0_3) {
case 0:
case 3: break;
case 3:
break;
case 1:
if (this->func_ov00_020c2c0c()) {
this->func_ov014_02135364(4);
@@ -172,13 +173,16 @@ ARM bool ActorRefill::func_ov014_02135364(unk32 param1) {
mActiveFrames = 0;
switch (mUnk_130) {
case 0:
case 2: break;
case 2:
break;
case 1:
mVel.x = 0;
mVel.y = 0;
mVel.z = 0;
break;
case 3: this->Kill(); break;
case 3:
this->Kill();
break;
}
return true;
}
@@ -268,9 +272,15 @@ ARM bool ActorRefillTime::Init() {
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;
case 2:
mUnk_158 = 5;
break;
case 4:
mUnk_158 = 15;
break;
case 5:
mUnk_158 = 30;
break;
default:
case 0:
case 1:
@@ -286,9 +296,15 @@ ARM bool ActorRefillTime::Init() {
break;
}
switch (mUnk_158) {
case 15: mUnk_15c = 0x45; break;
case 30: mUnk_15c = 0x46; break;
default: mUnk_15c = 0x44; break;
case 15:
mUnk_15c = 0x45;
break;
case 30:
mUnk_15c = 0x46;
break;
default:
mUnk_15c = 0x44;
break;
}
return true;
}
@@ -310,9 +326,15 @@ ARM bool ActorLSTM::Init() {
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;
case 2:
mUnk_158 = -5;
break;
case 4:
mUnk_158 = -15;
break;
case 5:
mUnk_158 = -30;
break;
default:
case 0:
case 1:
@@ -328,9 +350,15 @@ ARM bool ActorLSTM::Init() {
break;
}
switch (mUnk_158) {
case -15: mUnk_15c = 0x48; break;
case -30: mUnk_15c = 0x49; break;
default: mUnk_15c = 0x47; break;
case -15:
mUnk_15c = 0x48;
break;
case -30:
mUnk_15c = 0x49;
break;
default:
mUnk_15c = 0x47;
break;
}
return true;
}
+14 -6
View File
@@ -235,7 +235,9 @@ ARM void ActorNavi::func_ov059_0219aba8(u32 param1) {
this->mOffsetPos = auStack_e0.mUnk_14;
}
break;
default: this->func_ov000_020b853c(); break;
default:
this->func_ov000_020b853c();
break;
}
pIVar3 = gItemManager;
@@ -251,7 +253,8 @@ ARM void ActorNavi::func_ov059_0219aba8(u32 param1) {
pIVar3->func_ov000_020c0c44(&this->mUnk_2f0);
pIVar3->func_ov000_020c0e5c(&this->mUnk_2f0, 1);
break;
default: break;
default:
break;
}
}
@@ -283,7 +286,8 @@ ARM bool ActorNavi::func_ov059_0219af14() {
this->mVel.y = this->mOffsetPos.y - this->mPos.y;
return true;
}
default: break;
default:
break;
}
return false;
@@ -294,9 +298,13 @@ ARM bool ActorNavi::func_ov059_0219afc4() {
this->func_ov059_0219933c(0);
switch (this->mUnk_130) {
case 3: this->mOffsetPos.y = gPlayerPos.y + 0x1666; return true;
case 4: return true;
default: break;
case 3:
this->mOffsetPos.y = gPlayerPos.y + 0x1666;
return true;
case 4:
return true;
default:
break;
}
return false;
+3 -1
View File
@@ -41,7 +41,9 @@ ARM void ActorType::Unregister() {
ActorType **previous = NULL;
for (actorType = sActorTypeList.head; actorType != NULL; actorType = actorType->next) {
if (actorType == this) break;
if (actorType == this) {
break;
}
previous = current;
current = &actorType->next;
}
+6 -2
View File
@@ -87,8 +87,12 @@ THUMB u16 BMGFileInfo::func_020371c8(u32 *pFile, s16 unk_18) {
//! TODO: fake?
this->pDAT1 = (SectionDAT1 *) (pSection + 1);
break;
case BMG_TAG_FLW1: this->pFLW1 = (SectionFLW1 *) pSection; break;
case BMG_TAG_FLI1: this->pFLI1 = (SectionFLI1 *) pSection; break;
case BMG_TAG_FLW1:
this->pFLW1 = (SectionFLW1 *) pSection;
break;
case BMG_TAG_FLI1:
this->pFLI1 = (SectionFLI1 *) pSection;
break;
}
pSection = (SectionBase *) ((u8 *) pSection + pSection->size);
+17 -10
View File
@@ -47,8 +47,11 @@ THUMB void MessageManager::func_02036490() {
this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLE, 2);
this->pGroups->func_020372f0(BMG_FILE_INDEX_BATTLECOMMON, 2);
break;
case GameModeId_Contact: this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2); break;
default: break;
case GameModeId_Contact:
this->pGroups->func_020372f0(BMG_FILE_INDEX_MAINSELECT, 2);
break;
default:
break;
}
for (s32 i = 0; i < ARRAY_LEN(this->mUnk_18); i++) {
@@ -66,8 +69,8 @@ THUMB void MessageManager::func_02036490() {
this->mUnk_18[0]->mUnk_39 = 0;
this->mUnk_18[1]->mUnk_39 = 1;
if (gGame.mModeId == GameModeId_Adventure || gGame.mModeId == GameModeId_FileSelect || gGame.mModeId == GameModeId_Battle)
{
if (gGame.mModeId == GameModeId_Adventure || gGame.mModeId == GameModeId_FileSelect ||
gGame.mModeId == GameModeId_Battle) {
for (s32 i = 0; i < ARRAY_LEN(this->mUnk_28); i++) {
switch (data_02056924[i + 1]) {
case 0:
@@ -83,7 +86,9 @@ THUMB void MessageManager::func_02036490() {
this->mUnk_28[i]->func_0203dc74(0x50, 0x60);
this->mUnk_28[i]->mUnk_2c = &data_02068e6c;
break;
case 2: this->mUnk_28[i] = NULL; break;
case 2:
this->mUnk_28[i] = NULL;
break;
case 3:
if (func_0202ab48() == 0) {
this->mUnk_28[i] = new(data_027e0ce0[1], 4) MsgProc_Type2();
@@ -93,7 +98,8 @@ THUMB void MessageManager::func_02036490() {
this->mUnk_28[i] = NULL;
}
break;
default: break;
default:
break;
}
if (this->mUnk_28[i] != NULL) {
@@ -194,8 +200,10 @@ ARM bool MessageManager::func_02036824(void) {
switch (data_027e077c.mUnk_0) {
case 0x01:
case 0x37:
case 0x3B: return true;
default: break;
case 0x3B:
return true;
default:
break;
}
return false;
@@ -515,8 +523,7 @@ ARM UnkStruct_020397f8 *MessageManager::func_02036f68(u32 param_2, u8 *param_3)
if (data_ov000_020eec9c.func_ov000_020d7f18(0x19) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x18) == 0 &&
data_ov000_020eec9c.func_ov000_020d7f18(0x34) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x35) == 0 &&
data_ov000_020eec9c.func_ov000_020d7f18(0x1A) == 0 && data_ov000_020eec9c.func_ov000_020d7f18(0x1B) == 0 &&
(param_3[12]) != 7)
{
(param_3[12]) != 7) {
data_ov000_020eec9c.func_ov000_020d77e4(0x1C);
}
+18 -9
View File
@@ -74,7 +74,8 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) {
if ((s32) uVar7 <= 0) {
switch (uVar7) {
case 0x0:
case 0x2f: break;
case 0x2f:
break;
case 0x7:
if (data_027e0d54[0xd] != 0) {
return -0x1;
@@ -117,12 +118,18 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) {
}
return uVar10;
case 0x4: return gAdventureFlags->Get(param1 + 0x4) != false;
case 0x5: return gActorManager->func_ov00_020c3b2c(NULL) != 0;
case 0x6: break;
case 0x8: return (((data_027e0cb4[(param1 + 0x4) >> 5]) & 1) << ((param1 + 0x4) & 0x1f)) == 0x0;
case 0x9: break;
case 0xa: break;
case 0x4:
return gAdventureFlags->Get(param1 + 0x4) != false;
case 0x5:
return gActorManager->func_ov00_020c3b2c(NULL) != 0;
case 0x6:
break;
case 0x8:
return (((data_027e0cb4[(param1 + 0x4) >> 5]) & 1) << ((param1 + 0x4) & 0x1f)) == 0x0;
case 0x9:
break;
case 0xa:
break;
case 0xb:
lVar2 = gRandom.mRandomValue * gRandom.mFactor;
uVar7 = lVar2;
@@ -143,8 +150,10 @@ ARM unk32 UnkStruct_02037750::vfunc_28(s32 param1) {
}
}
return (int) (char) uVar10;
case 0xd: return gItemManager->GetNumRupees() != 0;
case 0xe: return gItemManager->HasItem(param1 + 0x4) != 0;
case 0xd:
return gItemManager->GetNumRupees() != 0;
case 0xe:
return gItemManager->HasItem(param1 + 0x4) != 0;
default:
if (uVar7 == 0x2f) {
return gItemManager->HasItem((param1 + 0x4) + 0x60) != 0;
+17 -8
View File
@@ -57,8 +57,7 @@ ARM void UnkStruct_02038aa0::func_02038b74(void) {}
ARM bool UnkStruct_02038aa0::func_02038b78() {
if (data_027e0c54 == 0) {
if ((this->mUnk_50 != 0 && gMessageManager.func_02036850() != 0) ||
(this->mUnk_50 == 0 && gMessageManager.func_02036824() != 0))
{
(this->mUnk_50 == 0 && gMessageManager.func_02036824() != 0)) {
return true;
}
@@ -204,12 +203,22 @@ ARM void UnkStruct_02038aa0::vfunc_64() {}
ARM s32 UnkStruct_02038aa0::vfunc_68(unk32 param1) {
switch (param1) {
case 0: break;
case 1: this->mUnk_34 = 4; break;
case 2: this->mUnk_34 = 6; break;
case 3: this->mUnk_34 = 1; break;
case 4: this->mUnk_34 = 0; break;
default: break;
case 0:
break;
case 1:
this->mUnk_34 = 4;
break;
case 2:
this->mUnk_34 = 6;
break;
case 3:
this->mUnk_34 = 1;
break;
case 4:
this->mUnk_34 = 0;
break;
default:
break;
}
return ((this->mUnk_18 << 3) - this->func_020337d8(param1)) / 2;
+48 -23
View File
@@ -148,7 +148,9 @@ ARM void UnkStruct_020397f8::vfunc_2c() {
if (this->mUnk_15c == 1) {
if (this->mUnk_586 == ((data_02056be4[data_027e077c.mUnk_0] & 1) != 0)) {
switch (this->mUnk_150[1]) {
case 0: this->func_0203b0ec(1); break;
case 0:
this->func_0203b0ec(1);
break;
case 2:
case 3:
if (this->func_0203a3e0() != 0) {
@@ -362,8 +364,7 @@ ARM void UnkStruct_020397f8::vfunc_48() {
ARM void UnkStruct_020397f8::func_0203a35c() {
if ((this->mUnk_57c == 1 || this->mUnk_150[3] != 0) ||
(this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0)
{
(this->mUnk_128.mUnk_04 == NULL || this->mUnk_128.mUnk_04[0] == 0) != 0) {
if (this->func_0203a3e0()) {
s16 mUnk_56e = this->mUnk_56e;
s16 mUnk_570 = this->mUnk_570;
@@ -427,7 +428,8 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) {
if (gTouchControl.mTouch == 0) {
switch (this->mUnk_150[1]) {
case 3:
case 4: break;
case 4:
break;
case 5:
if (data_027e103c->mUnk_20 == 3) {
this->func_0203b0ec(1);
@@ -438,7 +440,8 @@ ARM void UnkStruct_020397f8::vfunc_44(s32 touchLastX, s32 touchLastY) {
this->func_0203b0ec(1);
}
break;
case 7: break;
case 7:
break;
case 2:
//! TODO: fixme
// if (this->mUnk_164->mUnk_168.mUnk_06 <= 0) {
@@ -522,8 +525,7 @@ ARM void UnkStruct_020397f8::vfunc_50(EntryINF1 *param1, unk32 param2, s32 *para
}
if (gGame.mModeId == GameModeId_Adventure && data_027e0d38->func_ov000_02078b40() == 2 &&
func_ov003_020f3f94(data_ov009_0211f5b4) == 0)
{
func_ov003_020f3f94(data_ov009_0211f5b4) == 0) {
UnkStruct_020397f8 *pVar4 = (UnkStruct_020397f8 *) gMessageManager.mUnk_28[4];
if (pVar4 != NULL && pVar4->mUnk_15c > 0) {
@@ -740,14 +742,16 @@ ARM unk32 UnkStruct_020397f8::vfunc_1c(u16 *param1, UnkStruct_0203b264 *param2,
}
switch (this->mUnk_57a) {
case 0: return this->func_0203905c(param1, param2, param3, param4);
case 0:
return this->func_0203905c(param1, param2, param3, param4);
case 1:
UnknownMsgChoiceStruct *pChoiceData;
s32 i = this->func_0203a30c();
pChoiceData = &this->mUnk_428[this->mUnk_528[i]];
return this->mUnk_164->func_0203cb5c(
*param1, (((pChoiceData->mUnk_00->mUnk_0[3] << 0x10) | ((u16 *) pChoiceData->mUnk_00->mUnk_0)[2]) + ~0xFFFE));
default: break;
default:
break;
}
return 0;
@@ -767,16 +771,30 @@ ARM void UnkStruct_020397f8::vfunc_60(func_0203b410_param1 *param1, unk32 param2
if (this->func_02032fa4() == 0) {
switch (param1->mUnk_0c) {
case 0:
case 1: uVar6 = this->mUnk_580 != 0; break;
case 2: uVar6 = 2; break;
case 3: uVar6 = 3; break;
case 5: uVar6 = 4; break;
case 6: uVar6 = 5; break;
case 1:
uVar6 = this->mUnk_580 != 0;
break;
case 2:
uVar6 = 2;
break;
case 3:
uVar6 = 3;
break;
case 5:
uVar6 = 4;
break;
case 6:
uVar6 = 5;
break;
default:
// why???
switch (param1->mUnk_0c) {
case 4: uVar6 = 8; break;
case 7: uVar6 = 9; break;
case 4:
uVar6 = 8;
break;
case 7:
uVar6 = 9;
break;
default:
if (this->mUnk_580 != 0) {
uVar6 = 7;
@@ -825,8 +843,7 @@ ARM void UnkStruct_020397f8::vfunc_64(s16 *param1) {
unk32 uVar2;
if (this->mUnk_50 != 0 || data_027e0db0.mUnk_04 > 0 || func_0203c084() != 0 ||
(gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738()))
{
(gAdventureFlags->Exists() && gAdventureFlags->func_ov00_02097738())) {
uVar2 = 0x16;
} else {
uVar2 = 0;
@@ -858,15 +875,23 @@ ARM void UnkStruct_020397f8::func_0203b764() {
this->func_02039440(data_02056a04[i * 0x18], data_02056a16[i]);
switch (this->mUnk_57b) {
case 1: this->mUnk_158.y -= 38; break;
case 1:
this->mUnk_158.y -= 38;
break;
case 2:
switch (this->pInfoEntry->mUnk_06) {
case 2: this->mUnk_158.y -= 111; break;
case 3: this->mUnk_158.y -= 98; break;
default: break;
case 2:
this->mUnk_158.y -= 111;
break;
case 3:
this->mUnk_158.y -= 98;
break;
default:
break;
}
break;
default: break;
default:
break;
}
}
+12 -5
View File
@@ -56,8 +56,10 @@ const u16 data_020562e2[] = {
THUMB bool UnkStruct_02063220::func_0202f3f0(unk32 param1) {
switch (param1) {
case 2:
case 3: return true;
default: break;
case 3:
return true;
default:
break;
}
return false;
@@ -67,9 +69,14 @@ THUMB unk32 UnkStruct_02063220::func_0202f400(unk32 param1) {
unk32 ret = 0;
switch (param1) {
case 2: ret = 1; break;
case 3: ret = 2; break;
default: break;
case 2:
ret = 1;
break;
case 3:
ret = 2;
break;
default:
break;
}
return ret;