mirror of
https://github.com/zeldaret/ph
synced 2026-06-24 17:03:21 -04:00
LinkStateInteract (#135)
* Map symbol in Game * LinkStateInteract 19% * DebugHierarchy -> Bhio * LinkStateInteract 89% * LinkStateInteract 93% * Japanese strings * Fix build * Fix regression * Fix regressions * Rename BhioBase.cpp
This commit is contained in:
@@ -604,8 +604,8 @@ ARM bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **out) {
|
||||
case ActorTypeId_BTRF:
|
||||
case ActorTypeId_STNE:
|
||||
case ActorTypeId_TARU:
|
||||
case ActorTypeId_BKEY:
|
||||
case ActorTypeId_FORC:
|
||||
case ActorTypeId_BossKey:
|
||||
case ActorTypeId_ForceGem:
|
||||
case ActorTypeId_FLTB:
|
||||
case ActorTypeId_TSUB:
|
||||
knockback.mUnk_10 = 10;
|
||||
@@ -748,8 +748,8 @@ ARM void Actor::GetHitbox(Cylinder *hitbox) {
|
||||
hitbox->pos.z = mPos.z;
|
||||
hitbox->pos.y += mHitbox.pos.y;
|
||||
|
||||
q20 sin = gSinCosTable[angle];
|
||||
q20 cos = gSinCosTable[angle + 1];
|
||||
q20 sin = FX_SinCosTable_[angle];
|
||||
q20 cos = FX_SinCosTable_[angle + 1];
|
||||
Vec3p_Rotate(&mHitbox.pos, sin, cos, &hitbox->pos);
|
||||
}
|
||||
|
||||
@@ -761,8 +761,8 @@ ARM void Actor::GetUnk_08c(Cylinder *param1) {
|
||||
param1->pos.z = mPos.z;
|
||||
param1->pos.y += mUnk_08c.pos.y;
|
||||
|
||||
q20 sin = gSinCosTable[angle];
|
||||
q20 cos = gSinCosTable[angle + 1];
|
||||
q20 sin = FX_SinCosTable_[angle];
|
||||
q20 cos = FX_SinCosTable_[angle + 1];
|
||||
Vec3p_Rotate(&mUnk_08c.pos, sin, cos, ¶m1->pos);
|
||||
}
|
||||
|
||||
|
||||
@@ -2483,7 +2483,7 @@ s32 MapManager::func_ov00_02085a34(Vec3p *param_2, s32 param_3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
unk8 MapManager::func_ov00_02085c60(Vec3p *param_2, unk32 *param_3, unk32 *param_4, u32 param_5) {
|
||||
unk8 MapManager::func_ov00_02085c60(UnkStruct *param_2, unk32 *param_3, unk32 *param_4, u32 param_5) {
|
||||
s64 lVar1;
|
||||
s32 *puVar2;
|
||||
unk32 dVar3; // dword
|
||||
@@ -2502,24 +2502,6 @@ unk8 MapManager::func_ov00_02085c60(Vec3p *param_2, unk32 *param_3, unk32 *param
|
||||
Vec3p VStack_b0;
|
||||
Vec3p VStack_a4;
|
||||
Vec3p VStack_98;
|
||||
Vec3p aVStack_8c[3];
|
||||
unk16 uStack_68;
|
||||
unk16 uStack_66;
|
||||
unk16 uStack_64;
|
||||
unk16 uStack_62;
|
||||
unk16 uStack_60;
|
||||
unk8 uStack_3e;
|
||||
unk8 uStack_3d;
|
||||
unk8 uStack_3c;
|
||||
unk8 uStack_3b;
|
||||
unk8 uStack_34;
|
||||
unk8 uStack_33;
|
||||
unk8 uStack_32;
|
||||
unk8 uStack_31;
|
||||
unk8 uStack_30;
|
||||
unk8 uStack_2f;
|
||||
unk32 uStack_2c;
|
||||
unk32 uStack_28;
|
||||
|
||||
if (param_5 == 0) {
|
||||
return 0;
|
||||
@@ -2565,47 +2547,31 @@ unk8 MapManager::func_ov00_02085c60(Vec3p *param_2, unk32 *param_3, unk32 *param
|
||||
VStack_d8.pos.z = 0;
|
||||
VStack_d8.radius = param_5;
|
||||
do {
|
||||
bVar4 = func_01ffbe78(param_2, &VStack_b0, &VStack_bc, &VStack_d8);
|
||||
bVar4 = func_01ffbe78(param_2, &VStack_b0, &VStack_bc, &VStack_d8, 0, 0, 0, 0);
|
||||
if (bVar4) {
|
||||
VStack_e4.x = param_2->x;
|
||||
VStack_e4.y = param_2->y;
|
||||
VStack_e4.z = param_2->z;
|
||||
VStack_f0.x = param_2[1].x;
|
||||
VStack_f0.y = param_2[1].y;
|
||||
VStack_f0.z = param_2[1].z;
|
||||
VStack_e4.x = param_2->mUnk_00.x;
|
||||
VStack_e4.y = param_2->mUnk_00.y;
|
||||
VStack_e4.z = param_2->mUnk_00.z;
|
||||
VStack_f0.x = param_2->mUnk_0c.x;
|
||||
VStack_f0.y = param_2->mUnk_0c.y;
|
||||
VStack_f0.z = param_2->mUnk_0c.z;
|
||||
Vec3p_Normalize(&VStack_f0, &VStack_f0);
|
||||
Vec3p_Scale(&VStack_f0, param_5);
|
||||
Vec3p_Add(&VStack_e4, &VStack_f0, &VStack_e4);
|
||||
dVar3 = 0xffff;
|
||||
param_2->x = VStack_e4.x;
|
||||
param_2->y = VStack_e4.y;
|
||||
param_2->z = VStack_e4.z;
|
||||
uStack_68 = (u16) dVar3;
|
||||
uStack_60 = 0;
|
||||
uStack_3e = 0;
|
||||
uStack_3d = 0;
|
||||
uStack_3c = 0;
|
||||
uStack_3b = 0;
|
||||
uStack_34 = 0;
|
||||
uStack_33 = 0;
|
||||
uStack_32 = 0;
|
||||
uStack_31 = 0;
|
||||
uStack_30 = 0;
|
||||
uStack_2f = 0;
|
||||
uStack_2c = 0xffffffff;
|
||||
uStack_28 = 0xffffffff;
|
||||
uStack_66 = uStack_68;
|
||||
uStack_64 = uStack_68;
|
||||
uStack_62 = uStack_68;
|
||||
bVar5 = func_01ffbe78(aVStack_8c, &VStack_e4, &VStack_e4, &VStack_d8);
|
||||
dVar3 = 0xffff;
|
||||
param_2->mUnk_00.x = VStack_e4.x;
|
||||
param_2->mUnk_00.y = VStack_e4.y;
|
||||
param_2->mUnk_00.z = VStack_e4.z;
|
||||
UnkStruct aVStack_8c;
|
||||
bVar5 = func_01ffbe78(&aVStack_8c, &VStack_e4, &VStack_e4, &VStack_d8, 0, 0, 0, 0);
|
||||
if (bVar5) {
|
||||
VStack_e4.x = aVStack_8c[0].x;
|
||||
VStack_e4.y = aVStack_8c[0].y;
|
||||
VStack_e4.z = aVStack_8c[0].z;
|
||||
VStack_e4.x = aVStack_8c.mUnk_00.x;
|
||||
VStack_e4.y = aVStack_8c.mUnk_00.y;
|
||||
VStack_e4.z = aVStack_8c.mUnk_00.z;
|
||||
}
|
||||
func_ov000_0207920c(data_027e0d3c, &VStack_e4, (unk32 *) &iStack_104, 0);
|
||||
param_2[8].x = iStack_104.x;
|
||||
param_2[8].y = iStack_104.y;
|
||||
((Vec3p *) param_2 + 8)->x = iStack_104.x;
|
||||
((Vec3p *) param_2 + 8)->y = iStack_104.y;
|
||||
return 1;
|
||||
}
|
||||
VStack_bc.x = VStack_b0.x;
|
||||
@@ -2617,12 +2583,12 @@ unk8 MapManager::func_ov00_02085c60(Vec3p *param_2, unk32 *param_3, unk32 *param
|
||||
bVar5 = true;
|
||||
}
|
||||
} while (!bVar5);
|
||||
param_2->x = VStack_98.x;
|
||||
param_2->y = VStack_98.y;
|
||||
param_2->z = VStack_98.z;
|
||||
param_2->mUnk_00.x = VStack_98.x;
|
||||
param_2->mUnk_00.y = VStack_98.y;
|
||||
param_2->mUnk_00.z = VStack_98.z;
|
||||
func_ov000_0207920c(puVar2, &VStack_98, &iStack_10c, 0);
|
||||
param_2[8].x = iStack_10c;
|
||||
param_2[8].y = iStack_108;
|
||||
((Vec3p *) param_2 + 8)->x = iStack_10c;
|
||||
((Vec3p *) param_2 + 8)->y = iStack_108;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ void LinkStateBase::ChangeLinkState(LinkStateId id) {}
|
||||
void LinkStateBase::ChangeLinkSubState(LinkStateId id, s32 subState) {}
|
||||
void LinkStateBase::EquipItem_vfunc_28() {}
|
||||
void LinkStateBase::UpdateSwordShieldInUse() {}
|
||||
void LinkStateBase::func_ov00_020a81b8(unk32 param1, unk32 param2) {}
|
||||
void LinkStateBase::func_ov00_020a81b8(unk32 param1, Vec3p *param2) {}
|
||||
LinkStateItem *LinkStateBase::GetLinkItemState() {}
|
||||
void LinkStateBase::LookAt(Vec3p *target) {}
|
||||
void LinkStateBase::func_ov00_020a81fc(Vec3p *param1, unk32 param2) {}
|
||||
@@ -65,13 +65,13 @@ bool LinkStateBase::func_ov00_020a8c34() {}
|
||||
Vec3p *LinkStateBase::GetPlayerPos() {}
|
||||
Vec3p *LinkStateBase::GetPlayerVel() {}
|
||||
unk8 *LinkStateBase::func_ov00_020a8c64() {}
|
||||
s16 *LinkStateBase::GetPlayerAngle() {}
|
||||
u16 *LinkStateBase::GetPlayerAngle() {}
|
||||
void *LinkStateBase::GetPlayer_Unk18() {}
|
||||
s32 LinkStateBase::Get_PlayerControlData_Unk32() {}
|
||||
Actor *LinkStateBase::GetGrabActor() {}
|
||||
ActorRef *LinkStateBase::GetGrabActorRef() {}
|
||||
unk32 LinkStateBase::Grab() {}
|
||||
s32 LinkStateBase::Get_PlayerLinkBase_Unk44() {}
|
||||
s32 *LinkStateBase::Get_PlayerLinkBase_Unk44() {}
|
||||
bool LinkStateBase::IsEquipBeingUsed(ItemFlag id) {}
|
||||
EquipItem *LinkStateBase::GetEquipItem(ItemFlag id) {}
|
||||
UnkStruct_027e0fd4 *LinkStateBase::func_ov00_020a8d40() {}
|
||||
@@ -81,5 +81,5 @@ 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() {}
|
||||
Bhio *LinkStateBase::GetBhio0() {}
|
||||
Bhio *LinkStateBase::GetBhio1() {}
|
||||
|
||||
@@ -5,7 +5,7 @@ void UnkStruct_ov004_0210abb8::vfunc_08(unk32 param1) {}
|
||||
bool LinkStateCutscene::func_ov000_020b1e98(s32 param1) {}
|
||||
bool LinkStateCutscene::func_ov000_020b1eb8() {}
|
||||
bool LinkStateCutscene::func_ov000_020b1eec() {}
|
||||
void LinkStateCutscene::CreateDebugHierarchy() {}
|
||||
void LinkStateCutscene::LoadBhio() {}
|
||||
void LinkStateCutscene::OnStateEnter() {}
|
||||
void LinkStateCutscene::OnStateLeave(s32 param1) {}
|
||||
LinkStateId LinkStateCutscene::GetId() {}
|
||||
|
||||
@@ -21,68 +21,41 @@ LinkStateBase_UnkStruct1 LinkStateDamage::data_ov000_020e5b30 = {39, {0x1000, 0,
|
||||
LinkStateBase_UnkStruct1 LinkStateDamage::data_ov000_020e5b40 = {10, {0x800, 0, 0x4000}};
|
||||
LinkStateBase_UnkStruct1 LinkStateDamage::data_ov000_020e5b50 = {84, {0x1000, 0, 0x19000}};
|
||||
|
||||
THUMB void LinkStateDamage::CreateDebugHierarchy() {
|
||||
unk32 id = 'LDMG';
|
||||
|
||||
THUMB void LinkStateDamage::LoadBhio() {
|
||||
s32 unk1 = this->PlayerControlData_vfunc_14(data_ov000_020e5af0.mUnk_00);
|
||||
|
||||
// Front minor damage regeneration speed "前小ダメ再生速度"
|
||||
const char *description1 = "\x91O\x8f\xac\x83_\x83\x81\x8d\xc4\x90\xb6\x91\xac\x93x\x00\x00\x00";
|
||||
// Front minor damage regeneration speed
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "前小ダメ再生速度", &data_ov000_020e5af0.mUnk_04.x, 8, 0, 0x2000);
|
||||
|
||||
// Front minor damage start frame "前小ダメ開始フレーム"
|
||||
const char *description2 = "\x91O\x8f\xac\x83_\x83\x81\x8aJ\x8en\x83t\x83\x8c\x81[\x83\x80\x00\x00\x00";
|
||||
// Front minor damage start frame
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "前小ダメ開始フレーム", &data_ov000_020e5af0.mUnk_04.y, 8, 0, unk1 / 2);
|
||||
|
||||
// Front minor damage end frame "前小ダメ終了フレーム"
|
||||
const char *description3 = "\x91O\x8F\xAC\x83_\x83\x81\x8FI\x97\xB9\x83t\x83\x8c\x81[\x83\x80\x00\x00\x00";
|
||||
// Front minor damage end frame
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "前小ダメ終了フレーム", &data_ov000_020e5af0.mUnk_04.z, 8, unk1 / 2, unk1);
|
||||
|
||||
DebugHierarchy *debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5af0.mUnk_04.x);
|
||||
debugHierarchy->GetChildNode(1, description1, id, &data_ov000_020e5af0.mUnk_04.x, 8, 0, 0x2000, 0);
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5af0.mUnk_04.y);
|
||||
debugHierarchy->GetChildNode(1, description2, id, &data_ov000_020e5af0.mUnk_04.y, 8, 0, unk1 / 2, 0);
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5af0.mUnk_04.z);
|
||||
debugHierarchy->GetChildNode(1, description3, id, &data_ov000_020e5af0.mUnk_04.z, 8, unk1 / 2, unk1, 0);
|
||||
unk1 = this->PlayerControlData_vfunc_14(data_ov000_020e5b00.mUnk_00);
|
||||
|
||||
// Back minor damage regeneration speed "後小ダメ再生速度"
|
||||
const char *description4 = "\x8c\xE3\x8F\xAC\x83_\x83\x81\x8D\xC4\x90\xB6\x91\xAC\x93x\x00\x00\x00";
|
||||
// Back minor damage regeneration speed
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "後小ダメ再生速度", &data_ov000_020e5b00.mUnk_04.x, 8, 0, 0x2000);
|
||||
|
||||
// Back minor damage start frame "後小ダメ開始フレーム"
|
||||
const char *description5 = "\x8C\xE3\x8F\xAC\x83_\x83\x81\x8AJ\x8En\x83t\x83\x8c\x81[\x83\x80\x00\x00\x00";
|
||||
// Back minor damage start frame
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "後小ダメ開始フレーム", &data_ov000_020e5b00.mUnk_04.y, 8, 0, unk1 / 2);
|
||||
|
||||
// Back minor damage end frame "後小ダメ終了フレーム"
|
||||
const char *description6 = "\x8C\xE3\x8F\xAC\x83_\x83\x81\x8FI\x97\xB9\x83t\x83\x8c\x81[\x83\x80\x00\x00\x00";
|
||||
// Back minor damage end frame
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "後小ダメ終了フレーム", &data_ov000_020e5b00.mUnk_04.z, 8, unk1 / 2, unk1);
|
||||
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5b00.mUnk_04.x);
|
||||
debugHierarchy->GetChildNode(1, description4, id, &data_ov000_020e5b00.mUnk_04.x, 8, 0, 0x2000, 0);
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5b00.mUnk_04.y);
|
||||
debugHierarchy->GetChildNode(1, description5, id, &data_ov000_020e5b00.mUnk_04.y, 8, 0, unk1 / 2, 0);
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5b00.mUnk_04.z);
|
||||
debugHierarchy->GetChildNode(1, description6, id, &data_ov000_020e5b00.mUnk_04.z, 8, unk1 / 2, unk1, 0);
|
||||
// Number of tears [verb]
|
||||
this->GetBhio0()->GetField2(false, 'LDMG', "ビリビリ回数", &data_ov000_020e5aec, 6, 0, 0x14);
|
||||
|
||||
// Number of tears [verb] "ビリビリ回数"
|
||||
const char *description7 = "\x83r\x83\x8A\x83r\x83\x8A\x89\xF1\x90\x94\x00\x00\x00";
|
||||
// Tear [verb] playback speed
|
||||
this->GetBhio0()->GetField2(true, 'LDMG', "ビリビリ再生速度", &data_ov000_020e5adc.mUnk_04.x, 8, 0, 0x2000);
|
||||
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->GetChildNode(0, description7, id, &data_ov000_020e5aec, 6, 0, 0x14, 0);
|
||||
|
||||
// Tear [verb] playback speed "ビリビリ再生速度"
|
||||
const char *description8 = "\x83r\x83\x8A\x83r\x83\x8A\x8D\xC4\x90\xB6\x91\xAC\x93x\x00\x00\x00";
|
||||
|
||||
debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e5adc.mUnk_04.x);
|
||||
debugHierarchy->GetChildNode(1, description8, id, &data_ov000_020e5adc.mUnk_04.x, 8, 0, 0x2000, 0);
|
||||
this->GetDebugHierarchy0();
|
||||
this->GetDebugHierarchy0();
|
||||
this->GetDebugHierarchy0();
|
||||
this->GetDebugHierarchy0();
|
||||
this->GetDebugHierarchy0();
|
||||
this->GetDebugHierarchy1();
|
||||
this->GetBhio0();
|
||||
this->GetBhio0();
|
||||
this->GetBhio0();
|
||||
this->GetBhio0();
|
||||
this->GetBhio0();
|
||||
this->GetBhio1();
|
||||
}
|
||||
|
||||
ARM void LinkStateDamage::OnStateEnter() {
|
||||
@@ -150,7 +123,7 @@ ARM void LinkStateDamage::Knockback(Vec3p *knockbackVec, unk32 param2) {
|
||||
playerVel->y = knockbackVec->y;
|
||||
playerVel->z = knockbackVec->z;
|
||||
s16 groundAngle = FX_Atan2Idx(knockbackVec->x, knockbackVec->z);
|
||||
s16 *playerAngle = this->GetPlayerAngle();
|
||||
u16 *playerAngle = this->GetPlayerAngle();
|
||||
*playerAngle = groundAngle - 0x8000;
|
||||
this->mUnk_24[12] = 0;
|
||||
this->mUnk_22 = param2;
|
||||
|
||||
@@ -1,30 +1,696 @@
|
||||
#include "Player/LinkStateInteract.hpp"
|
||||
#include "Map/MapManager.hpp"
|
||||
#include "Player/PlayerControl.hpp"
|
||||
#include "Unknown/UnkStruct_020eec9c.hpp"
|
||||
|
||||
void LinkStateInteract::vfunc_00() {}
|
||||
LinkStateId LinkStateInteract::GetId() {}
|
||||
void LinkStateInteract::CreateDebugHierarchy() {}
|
||||
s32 LinkStateInteract::GetGrabActorId() {}
|
||||
void LinkStateInteract::OnStateEnter() {}
|
||||
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() {}
|
||||
bool LinkStateInteract::vfunc_24(s32 param1) {}
|
||||
bool LinkStateInteract::vfunc_34(Vec3p *param1) {}
|
||||
void LinkStateInteract::SetGrabActorVelocity(Vec3p *velocity) {}
|
||||
void LinkStateInteract::SetBombVelocity(Vec3p *velocity) {}
|
||||
void LinkStateInteract::func_ov00_020ab6c8() {}
|
||||
unk32 LinkStateInteract::func_ov00_020ab770(Vec3p *param1) {}
|
||||
unk32 LinkStateInteract::func_ov00_020ab7bc(Vec3p *param1, Actor *actor) {}
|
||||
void LinkStateInteract::SetNormalizedThrowOffset(Vec3p *target) {}
|
||||
void LinkStateInteract::SetThrowOffset(Vec3p *target) {}
|
||||
void LinkStateInteract::func_ov00_020ab934(Vec3p *target) {}
|
||||
void LinkStateInteract::func_ov00_020ab97c(Vec3p *target) {}
|
||||
void LinkStateInteract::func_ov00_020ab9b8(u32 param1, bool param2) {}
|
||||
void LinkStateInteract::Grab(ActorRef *ref) {}
|
||||
void LinkStateInteract::func_ov00_020abba0(ActorRef *ref) {}
|
||||
void LinkStateInteract::func_ov00_020abbdc(ActorRef *ref) {}
|
||||
void LinkStateInteract::func_ov00_020abc18(ActorRef *ref) {}
|
||||
bool LinkStateInteract::func_ov00_020abc40() {}
|
||||
bool LinkStateInteract::func_ov00_020abc78(ActorRef *ref) {}
|
||||
static char *sShipTypes[] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
|
||||
|
||||
THUMB void LinkStateInteract::vfunc_00() {}
|
||||
|
||||
ARM LinkStateId LinkStateInteract::GetId() {
|
||||
return LinkStateId_Interact;
|
||||
}
|
||||
|
||||
ARM s32 LinkStateInteract::GetGrabActorId() {
|
||||
switch (mSubState) {
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return mGrabRef.id;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static unk32 data_ov000_020e5928 = 0x2;
|
||||
static LinkStateBase_UnkStruct1 data_ov000_020e592c = {0x1d, {0x1666, 0x0, 0x5000}};
|
||||
static LinkStateBase_UnkStruct1 data_ov000_020e593c = {0x1e, {0x1999, 0x2000, 0xa000}};
|
||||
static LinkStateBase_UnkStruct1 data_ov000_020e594c = {0x1e, {0xffffe800, 0xa000, 0x0}};
|
||||
static LinkStateBase_UnkStruct1 data_ov000_020e595c = {0x22, {0x1000, 0x0, 0xf000}};
|
||||
|
||||
THUMB void LinkStateInteract::LoadBhio() {
|
||||
u32 dVar1;
|
||||
Bhio *piVar2;
|
||||
Bhio *piVar3;
|
||||
int iVar4;
|
||||
|
||||
const char *fieldName;
|
||||
|
||||
// Lift playback speed
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "持ち上げ再生速度", &data_ov000_020e593c.mUnk_04.x, 8, 0, 0x3000);
|
||||
|
||||
// Lift start frame
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "持ち上げ開始フレーム", &data_ov000_020e593c.mUnk_04.y, 8, 0,
|
||||
data_ov000_020e593c.mUnk_04.z / 2);
|
||||
|
||||
// Lift end frame
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "持ち上げ終了フレーム", &data_ov000_020e593c.mUnk_04.z, 8,
|
||||
data_ov000_020e593c.mUnk_04.z / 2, data_ov000_020e593c.mUnk_04.z);
|
||||
|
||||
iVar4 = this->PlayerControlData_vfunc_14(data_ov000_020e595c.mUnk_00);
|
||||
|
||||
// Throw playback speed
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "投げ再生速度", &data_ov000_020e595c.mUnk_04.x, 8, 0, 0x3000);
|
||||
|
||||
// Throw start frame
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "投げ開始フレーム", &data_ov000_020e595c.mUnk_04.y, 8, 0, iVar4 / 2);
|
||||
|
||||
// Throw end frame
|
||||
this->GetBhio0()->GetField2(true, 'LGRB', "投げ終了フレーム", &data_ov000_020e595c.mUnk_04.z, 8, iVar4 / 2, iVar4);
|
||||
|
||||
this->GetBhio0();
|
||||
|
||||
// Stop time
|
||||
this->GetBhio0()->GetField2(false, 'LPSH', "停止時間", &data_ov000_020e5928, 6, 0, data_ov000_020e5928 * 2);
|
||||
this->GetBhio0();
|
||||
return;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::OnStateEnter() {
|
||||
if (mSubState != 6) {
|
||||
this->func_ov00_020a82ac();
|
||||
this->EquipItem_vfunc_28();
|
||||
}
|
||||
switch (mSubState) {
|
||||
case 0:
|
||||
this->ChangeLinkState(0);
|
||||
break;
|
||||
case 1:
|
||||
gPlayerControl->SetUnk_80();
|
||||
this->func_ov00_020a8a4c(&data_ov000_020e592c, 1);
|
||||
break;
|
||||
case 2:
|
||||
this->func_ov00_020a8a4c(&data_ov000_020e593c, 1);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
if (this->GetGrabActor() != NULL) {
|
||||
data_ov000_020eec9c.func_ov000_020d7b20(0x125, this->GetPlayerPos());
|
||||
s16 angle = FX_Atan2Idx(mThrowOffset.x, mThrowOffset.z);
|
||||
*this->GetPlayerAngle() = angle;
|
||||
this->func_ov00_020a89bc(&data_ov000_020e595c, 1);
|
||||
} else {
|
||||
this->func_ov00_020a8994();
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (this->GetGrabActor() != NULL) {
|
||||
s16 angle = FX_Atan2Idx(mThrowOffset.x, mThrowOffset.z);
|
||||
*this->GetPlayerAngle() = angle;
|
||||
this->func_ov00_020a8a4c(&data_ov000_020e594c, 1);
|
||||
} else {
|
||||
this->ChangeLinkState(0);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
gPlayerControl->SetUnk_80();
|
||||
if (gActorManager->GetActor(&mGrabRef) != NULL) {
|
||||
*this->Get_PlayerLinkBase_Unk44() = 0;
|
||||
} else {
|
||||
this->ChangeLinkState(0);
|
||||
}
|
||||
mUnk_24.func_020350b4(1, 0, 0, 0, 0);
|
||||
mUnk_24.func_020351b8(0, 0, 0, 0);
|
||||
mUnk_b2 = false;
|
||||
break;
|
||||
case 8:
|
||||
if (mUnk_b0) {
|
||||
*this->Get_PlayerLinkBase_Unk44() = 1;
|
||||
}
|
||||
mUnk_0c = data_ov000_020e5928;
|
||||
break;
|
||||
case 9:
|
||||
if (mUnk_b1) {
|
||||
*this->Get_PlayerLinkBase_Unk44() = -1;
|
||||
}
|
||||
mUnk_0c = data_ov000_020e5928;
|
||||
break;
|
||||
case 6:
|
||||
gPlayerControl->SetUnk_80();
|
||||
break;
|
||||
default:
|
||||
this->ChangeLinkState(0);
|
||||
break;
|
||||
}
|
||||
if (mSubState != 7) {
|
||||
mUnk_ac = mSubState;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::OnStateLeave(s32 param1) {
|
||||
LinkStateBase::OnStateLeave(param1);
|
||||
if (gPlayerControl->mUnk_80) {
|
||||
gPlayerControl->StopFollowing();
|
||||
}
|
||||
Actor *actor = this->GetGrabActor();
|
||||
if (mSubState != 1) {
|
||||
return;
|
||||
}
|
||||
if (actor == NULL) {
|
||||
return;
|
||||
}
|
||||
if (actor->mGrabbed) {
|
||||
return;
|
||||
}
|
||||
this->GetGrabActorRef()->Reset();
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::func_ov00_020aa818() {
|
||||
ItemManager *temp_r4 = gItemManager;
|
||||
ActorNaviBase *fairy = temp_r4->GetFairy(temp_r4->GetEquippedFairy());
|
||||
fairy->func_ov000_020ba458();
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020aa844(Actor *actor) {
|
||||
Vec3p sp20;
|
||||
Vec3p_Sub(&actor->mPos, this->GetPlayerPos(), &sp20);
|
||||
u16 temp_r6 = *this->GetPlayerAngle();
|
||||
s16 cos = COS(*this->GetPlayerAngle());
|
||||
s16 sin = SIN(temp_r6);
|
||||
q20 rx = MUL_Q20(sp20.x, -cos) + MUL_Q20(sp20.z, sin);
|
||||
Cylinder sp10;
|
||||
actor->GetHitbox(&sp10);
|
||||
q20 rz = MUL_Q20(sp20.x, sin) + MUL_Q20(sp20.z, cos);
|
||||
rz -= (sp10.size + 0x666);
|
||||
|
||||
this->GetPlayerVel()->x = 0;
|
||||
this->GetPlayerVel()->z = 0;
|
||||
|
||||
q20 unk = FLOAT_TO_Q20(1 / 12.0);
|
||||
if (rx > 0) {
|
||||
q20 var_r6 = unk;
|
||||
if (rx <= unk) {
|
||||
var_r6 = rx;
|
||||
}
|
||||
this->GetPlayerVel()->x += MUL_Q20(var_r6, -cos);
|
||||
q20 var_r4_4 = rx;
|
||||
if (var_r4_4 > unk) {
|
||||
var_r4_4 = unk;
|
||||
}
|
||||
this->GetPlayerVel()->z += MUL_Q20(var_r4_4, sin);
|
||||
} else if (rx < 0) {
|
||||
q20 var_r6_2 = -unk;
|
||||
if (rx >= -unk) {
|
||||
var_r6_2 = rx;
|
||||
}
|
||||
this->GetPlayerVel()->x += MUL_Q20(var_r6_2, -cos);
|
||||
q20 var_r4_5 = rx;
|
||||
if (var_r4_5 < -unk) {
|
||||
var_r4_5 = -unk;
|
||||
}
|
||||
this->GetPlayerVel()->z += MUL_Q20(var_r4_5, sin);
|
||||
}
|
||||
if (rz > 0) {
|
||||
q20 var_r4_2 = unk;
|
||||
if (rz <= unk) {
|
||||
var_r4_2 = rz;
|
||||
}
|
||||
this->GetPlayerVel()->x += MUL_Q20(var_r4_2, sin);
|
||||
q20 var_r7_2 = rz;
|
||||
if (var_r7_2 > unk) {
|
||||
var_r7_2 = unk;
|
||||
}
|
||||
this->GetPlayerVel()->z += MUL_Q20(var_r7_2, cos);
|
||||
} else if (rz < 0) {
|
||||
q20 var_r4_3 = -unk;
|
||||
if (rz >= -unk) {
|
||||
var_r4_3 = rz;
|
||||
}
|
||||
this->GetPlayerVel()->x += MUL_Q20(var_r4_3, sin);
|
||||
q20 var_r7_3 = rz;
|
||||
if (var_r7_3 < -unk) {
|
||||
var_r7_3 = -unk;
|
||||
}
|
||||
this->GetPlayerVel()->z += MUL_Q20(var_r7_3, cos);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" unk32 GetCardinal(s16 angle);
|
||||
extern "C" u16 func_0202bba8(unk32);
|
||||
extern "C" void func_ov023_02171410(LinkStateRoll *, Actor *, Vec3p *);
|
||||
ARM bool LinkStateInteract::vfunc_20(s32 param1) {
|
||||
if (this->HasFlags_PlayerLinkBase_Unk48(2) || !this->func_ov00_020a8b80()) {
|
||||
return false;
|
||||
}
|
||||
Actor *temp_r0 = this->GetGrabActor();
|
||||
if ((temp_r0 != NULL) && (param1 == 0)) {
|
||||
bool var_r6 = false;
|
||||
if ((u32) (gItemManager->mEquippedItem - 9) <= 1) {
|
||||
mThrowOffset = gVec3p_ZERO;
|
||||
s32 temp_r3 = *this->GetPlayerAngle();
|
||||
s16 temp_ip = SIN(temp_r3);
|
||||
s16 temp_r2 = COS(temp_r3);
|
||||
mThrowOffset.x += MUL_Q20(temp_ip, 0x4cd);
|
||||
mThrowOffset.z += MUL_Q20(temp_r2, 0x4cd);
|
||||
var_r6 = true;
|
||||
}
|
||||
bool var_r5 = temp_r0->vfunc_2c() != -1;
|
||||
if (!var_r5 && (var_r6 || gPlayerControl->func_ov00_020b05e8(&mThrowOffset))) {
|
||||
PlayerControl *pPlayerControl = gPlayerControl;
|
||||
pPlayerControl->mUsingEquipItem = false;
|
||||
pPlayerControl->mUnk_7b = false;
|
||||
|
||||
mSubState = 5;
|
||||
return true;
|
||||
}
|
||||
if (var_r6 || gPlayerControl->func_ov00_020b049c(&mThrowOffset, var_r5)) {
|
||||
PlayerControl *pPlayerControl = gPlayerControl;
|
||||
pPlayerControl->mUsingEquipItem = false;
|
||||
pPlayerControl->mUnk_7b = false;
|
||||
|
||||
mSubState = 3;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
ActorRef sp14 = gPlayerControl->mFollowRef;
|
||||
Actor *var_r6_2 = gActorManager->GetActor(&sp14);
|
||||
if (var_r6_2 == NULL) {
|
||||
if (gPlayerControl->func_ov00_020b0ad0(this->func_ov00_020a8d40()->mUnk_0ec)) {
|
||||
var_r6_2 = this->func_ov00_020a8d40()->mUnk_0ec;
|
||||
sp14 = var_r6_2->mRef;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (gPlayerControl->mUnk_80) {
|
||||
return false;
|
||||
}
|
||||
if (!gPlayerControl->func_ov00_020afe88(var_r6_2->mUnk_12c, temp_r0 != NULL)) {
|
||||
gPlayerControl->StopFollowing();
|
||||
return false;
|
||||
}
|
||||
Vec3p sp5C;
|
||||
if ((var_r6_2->mUnk_12c == 2) && (this->GetGrabActor() == NULL)) {
|
||||
Vec3p_Axpy(0x6000, &var_r6_2->mVel, &var_r6_2->mPos, &sp5C);
|
||||
UnkStruct sp68;
|
||||
Vec3p sp28;
|
||||
sp28 = var_r6_2->mPos;
|
||||
if (gMapManager->func_01ffbe78(&sp68, &sp5C, &sp28, (Sphere *) &var_r6_2->mUnk_08c, var_r6_2->mRef.id,
|
||||
(s32) var_r6_2->mUnk_09c.mUnk_0, 0, 0)) {
|
||||
sp5C = sp68.mUnk_00;
|
||||
}
|
||||
} else {
|
||||
this->func_ov00_020ab7bc(&sp5C, var_r6_2);
|
||||
}
|
||||
Vec3p sp50;
|
||||
Vec3p_Sub(&sp5C, this->GetPlayerPos(), &sp50);
|
||||
Cylinder sp40;
|
||||
var_r6_2->GetHitbox(&sp40);
|
||||
switch (var_r6_2->mUnk_12c) {
|
||||
case 1:
|
||||
if (Vec3p_Length(&sp50) < 0x800) {
|
||||
gPlayerControl->SetUnk_80();
|
||||
}
|
||||
return false;
|
||||
case 2:
|
||||
if (!PlayerBase::GetEquipSword()->UpdateInUse(1)) {
|
||||
return false;
|
||||
}
|
||||
if (this->GetGrabActor() == NULL) {
|
||||
if (this->GetCurrentCharacter() == PlayerCharacter_Gongoron) {
|
||||
func_ov023_02171410(this->GetLinkStateRoll(), var_r6_2, &sp50);
|
||||
return 0;
|
||||
}
|
||||
q20 temp_r0_4 = Vec3p_Length(&sp50);
|
||||
if (temp_r0_4 < (s32) (sp40.size + 0x3800)) {
|
||||
s16 temp_r6_2 = (s16) FX_Atan2Idx(sp50.x, sp50.z);
|
||||
if (temp_r0_4 < 0x1CCD) {
|
||||
s16 temp_r1 = temp_r6_2 - *(s16 *) this->GetPlayerAngle();
|
||||
if ((s32) temp_r1 > 0x4000) {
|
||||
this->func_ov00_020a81b8(1, &sp5C);
|
||||
} else if ((s32) temp_r1 >= -0x4000) {
|
||||
this->func_ov00_020a81b8(0, &sp5C);
|
||||
} else {
|
||||
this->func_ov00_020a81b8(2, &sp5C);
|
||||
}
|
||||
} else {
|
||||
if (temp_r0_4 < 0x2B33 && ABS(sp50.y) < 0x1333) {
|
||||
this->func_ov00_020a81b8(3, &sp5C);
|
||||
} else {
|
||||
if (this->func_ov00_020a8d40()->mUnk_05a != 0) {
|
||||
return false;
|
||||
}
|
||||
this->func_ov00_020a81b8(4, &sp5C);
|
||||
}
|
||||
}
|
||||
*this->GetPlayerAngle() = temp_r6_2;
|
||||
}
|
||||
} else if (Vec3p_Length(&sp50) < 0x4000) {
|
||||
Vec3p_Sub(&var_r6_2->mPos, this->GetPlayerPos(), &mThrowOffset);
|
||||
PlayerControl *pPlayerControl = gPlayerControl;
|
||||
pPlayerControl->mUsingEquipItem = false;
|
||||
pPlayerControl->mUnk_7b = false;
|
||||
gPlayerControl->SetUnk_80();
|
||||
mSubState = 3;
|
||||
mGrabRef = sp14;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 3:
|
||||
if (Vec3p_Length(&sp50) < 0x400) {
|
||||
Vec3p sp34;
|
||||
Vec3p_Sub(&sp40.pos, this->GetPlayerPos(), &sp34);
|
||||
if ((sp34.x != 0) || (sp34.z != 0)) {
|
||||
s16 temp_r0_5 = (s16) FX_Atan2Idx(sp34.x, sp34.z);
|
||||
u16 temp_r0_6 = func_0202bba8(GetCardinal(temp_r0_5));
|
||||
s16 var_r1_2 = temp_r0_5 - temp_r0_6;
|
||||
if ((s32) var_r1_2 < 0) {
|
||||
var_r1_2 = 0 - var_r1_2;
|
||||
}
|
||||
if ((s32) var_r1_2 > 0x18E4) {
|
||||
return 0;
|
||||
}
|
||||
*this->GetPlayerAngle() = temp_r0_6;
|
||||
}
|
||||
mSubState = 7;
|
||||
mUnk_0c = 0;
|
||||
mGrabRef = sp14;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 4:
|
||||
if ((Vec3p_Length(&sp50) < (s32) (sp40.size + 0xC00)) && !this->func_ov005_0211139c()) {
|
||||
*this->GetGrabActorRef() = var_r6_2->mRef;
|
||||
mSubState = 1;
|
||||
this->LookAt(&var_r6_2->mPos);
|
||||
mGrabRef = sp14;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 5:
|
||||
if (var_r6_2->CollidesWithLink() && this->func_ov005_021113b4()) {
|
||||
var_r6_2->SetUnk_11c(1);
|
||||
mSubState = 6;
|
||||
mGrabRef = sp14;
|
||||
this->EquipItem_vfunc_28();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case 6:
|
||||
gPlayerControl->StopFollowing();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ARM LinkStateRoll *LinkStateInteract::GetLinkStateRoll() {
|
||||
return (LinkStateRoll *) GetLinkState(LinkStateId_Roll);
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::vfunc_24(s32 param1) {
|
||||
switch (param1) {
|
||||
case 4:
|
||||
if (mSubState == 6) {
|
||||
return LinkStateBase::vfunc_24(param1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
switch (mSubState) {
|
||||
case 3:
|
||||
case 4:
|
||||
case 8:
|
||||
case 9:
|
||||
return false;
|
||||
}
|
||||
return LinkStateBase::vfunc_24(param1);
|
||||
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (mSubState) {
|
||||
case 1:
|
||||
case 7:
|
||||
return LinkStateBase::vfunc_24(param1);
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::vfunc_34(Vec3p *param1) {
|
||||
if (this->Get_PlayerControlData_Unk120() == 0x1E) {
|
||||
s32 temp_r0 = this->func_ov00_020a8d50();
|
||||
s32 var_r5;
|
||||
if (temp_r0 < 0x2000) {
|
||||
var_r5 = 0;
|
||||
} else if (temp_r0 >= 0x7000) {
|
||||
var_r5 = 0x1000;
|
||||
} else {
|
||||
var_r5 = CoDivide64By32(temp_r0 - 0x2000, 0x5000);
|
||||
}
|
||||
s32 playerAngle = *this->GetPlayerAngle();
|
||||
u16 var_r1 = ((((s64) var_r5) << 14) + 0x800) >> 12;
|
||||
s32 var_r3 = ((s64) COS(var_r1)) * 0xb33;
|
||||
s32 var_r9 = ((s64) SIN(var_r1)) * 0xb33;
|
||||
s32 var_r2 = ((s64) SIN(playerAngle));
|
||||
s32 var_ip = ((s64) COS(playerAngle));
|
||||
|
||||
// WIP xyz values
|
||||
param1->x += var_r3;
|
||||
param1->y += var_r9;
|
||||
param1->z += var_ip;
|
||||
} else {
|
||||
param1->y += 0xB33;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::SetGrabActorVelocity(Vec3p *velocity) {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
Vec3p vec = gVec3p_ZERO;
|
||||
if (velocity == NULL) {
|
||||
velocity = &vec;
|
||||
}
|
||||
grabActor->Drop(velocity);
|
||||
this->GetGrabActorRef()->Reset();
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::SetBombVelocity(Vec3p *velocity) {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
if (grabActor->mType != ActorTypeId_Bomb && grabActor->mType != ActorTypeId_Cucco) {
|
||||
return;
|
||||
}
|
||||
this->SetGrabActorVelocity(velocity);
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020ab6c8() {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
switch (grabActor->mType) {
|
||||
case ActorTypeId_Cucco:
|
||||
case ActorTypeId_Bomb:
|
||||
case ActorTypeId_StorageDrum:
|
||||
case ActorTypeId_TARU:
|
||||
case ActorTypeId_STNE:
|
||||
case ActorTypeId_TSUB:
|
||||
grabActor->Kill();
|
||||
return;
|
||||
}
|
||||
this->SetGrabActorVelocity(NULL);
|
||||
}
|
||||
|
||||
ARM unk32 LinkStateInteract::func_ov00_020ab770(Vec3p *param1) {
|
||||
Actor *followActor = gPlayerControl->GetFollowActor();
|
||||
if (followActor == NULL || this->func_ov00_020ab7bc(param1, followActor) == 0) {
|
||||
return 0;
|
||||
}
|
||||
return followActor->mUnk_12c;
|
||||
}
|
||||
|
||||
extern "C" unk32 GetCardinal(s16 angle);
|
||||
ARM unk32 LinkStateInteract::func_ov00_020ab7bc(Vec3p *param1, Actor *actor) {
|
||||
param1->x = actor->mPos.x;
|
||||
param1->y = actor->mPos.y;
|
||||
param1->z = actor->mPos.z;
|
||||
switch (actor->mUnk_12c) {
|
||||
case 2:
|
||||
return PlayerBase::GetEquipSword()->IsUsable(1);
|
||||
case 3:
|
||||
Vec3p sp10;
|
||||
Cylinder hitbox;
|
||||
actor->GetHitbox(&hitbox);
|
||||
Vec3p_Sub(this->GetPlayerPos(), param1, &sp10);
|
||||
s32 temp_r4 = hitbox.size + 0x666;
|
||||
u32 temp_r0_3 = GetCardinal((s16) FX_Atan2Idx(sp10.x, sp10.z));
|
||||
switch (temp_r0_3) {
|
||||
case 0:
|
||||
param1->x += temp_r4;
|
||||
break;
|
||||
case 1:
|
||||
param1->x -= temp_r4;
|
||||
break;
|
||||
case 2:
|
||||
param1->z += temp_r4;
|
||||
break;
|
||||
case 3:
|
||||
param1->z -= temp_r4;
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::SetNormalizedThrowOffset(Vec3p *target) {
|
||||
Vec3p *playerPos = this->GetPlayerPos();
|
||||
Vec3p_Sub(target, playerPos, &mThrowOffset);
|
||||
Vec3p_SetLength(&mThrowOffset, FLOAT_TO_Q20(1.0), &mThrowOffset);
|
||||
mSubState = 5;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::SetThrowOffset(Vec3p *target) {
|
||||
Vec3p *playerPos = this->GetPlayerPos();
|
||||
Vec3p_Sub(target, playerPos, &mThrowOffset);
|
||||
mSubState = 3;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020ab934(Vec3p *target) {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
Vec3p *playerPos = this->GetPlayerPos();
|
||||
Vec3p_Sub(target, playerPos, &mThrowOffset);
|
||||
mSubState = 3;
|
||||
this->ChangeLinkState(2);
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020ab97c(Vec3p *target) {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
Vec3p *playerPos = this->GetPlayerPos();
|
||||
Vec3p_Sub(target, playerPos, &mThrowOffset);
|
||||
mSubState = 4;
|
||||
}
|
||||
|
||||
extern "C" unk32 func_ov017_0215dff0(Actor *param1, Vec3p *param2);
|
||||
extern "C" unk32 func_ov017_0215e338(Actor *param1, Vec3p *param2);
|
||||
ARM void LinkStateInteract::func_ov00_020ab9b8(s32 param1, bool param2) {
|
||||
Actor *grabActor = this->GetGrabActor();
|
||||
if (grabActor == NULL) {
|
||||
return;
|
||||
}
|
||||
bool var_r5 = true;
|
||||
if (param2) {
|
||||
Vec3p spC = *this->GetPlayerPos();
|
||||
Vec3p_Add(this->GetPlayerPos(), &mThrowOffset, &spC);
|
||||
switch (grabActor->mType) {
|
||||
case ActorTypeId_BossKey:
|
||||
if (func_ov017_0215dff0(grabActor, &spC) != 0) {
|
||||
var_r5 = false;
|
||||
this->func_ov00_020aa818();
|
||||
}
|
||||
break;
|
||||
case ActorTypeId_ForceGem:
|
||||
if (func_ov017_0215e338(grabActor, &spC) != 0) {
|
||||
this->func_ov00_020aa818();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (var_r5) {
|
||||
Vec3p sp0;
|
||||
sp0.x = 0;
|
||||
sp0.y = 0;
|
||||
sp0.z = 0;
|
||||
|
||||
u16 playerAngle = *this->GetPlayerAngle();
|
||||
s32 temp_r1_3 = MUL_Q20(param1, FLOAT_TO_Q20(0.16));
|
||||
|
||||
sp0.x += MUL_Q20(SIN(playerAngle), temp_r1_3);
|
||||
sp0.z += MUL_Q20(COS(playerAngle), temp_r1_3);
|
||||
grabActor->Drop(&sp0);
|
||||
}
|
||||
this->GetGrabActorRef()->Reset();
|
||||
data_ov000_020eec9c.func_ov000_020d7a84(0xCC, this->GetPlayerPos());
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::Grab(ActorRef *ref) {
|
||||
mGrabRef = *ref;
|
||||
this->ChangeLinkSubState(LinkStateId_Interact, 6);
|
||||
return true;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020abba0(ActorRef *ref) {
|
||||
if (this->func_ov00_020abc40()) {
|
||||
this->Grab(ref);
|
||||
return;
|
||||
}
|
||||
mGrabRef = *ref;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020abbdc(ActorRef *ref) {
|
||||
if (this->func_ov00_020abc40()) {
|
||||
this->Grab(ref);
|
||||
return;
|
||||
}
|
||||
mGrabRef = *ref;
|
||||
}
|
||||
|
||||
ARM void LinkStateInteract::func_ov00_020abc18(ActorRef *ref) {
|
||||
if (this->func_ov00_020abc40()) {
|
||||
this->Grab(ref);
|
||||
}
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::func_ov00_020abc40() {
|
||||
if (this->GetStateId() != 2 || mSubState != 6) {
|
||||
if (this->GetStateId() != 6) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ARM bool LinkStateInteract::func_ov00_020abc78(ActorRef *ref) {
|
||||
s32 temp_r0;
|
||||
ActorRef *temp_r0_2;
|
||||
Actor *temp_r6;
|
||||
|
||||
if (!this->func_ov00_020a8b80()) {
|
||||
return false;
|
||||
}
|
||||
if (this->GetGrabActor() != NULL) {
|
||||
return false;
|
||||
}
|
||||
temp_r0 = this->GetStateId();
|
||||
switch (temp_r0) {
|
||||
case 0:
|
||||
break;
|
||||
case 1: {
|
||||
PlayerControl *pPlayerControl = gPlayerControl;
|
||||
pPlayerControl->mUsingEquipItem = false;
|
||||
pPlayerControl->mUnk_7b = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
temp_r6 = gActorManager->GetActor(ref);
|
||||
temp_r0_2 = this->GetGrabActorRef();
|
||||
*temp_r0_2 = *ref;
|
||||
this->LookAt(&temp_r6->mPos);
|
||||
mGrabRef = *ref;
|
||||
data_ov000_020eec9c.func_ov000_020d7a84(0xCB, this->GetPlayerPos());
|
||||
this->GetGrabActor()->Grab();
|
||||
this->ChangeLinkSubState(LinkStateId_Interact, 2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -9,15 +9,9 @@ ARM LinkStateId LinkStateMove::GetId() {
|
||||
return LinkStateId_Move;
|
||||
}
|
||||
|
||||
THUMB void LinkStateMove::CreateDebugHierarchy() {
|
||||
unk32 id = 'LMOV';
|
||||
// Breath volume decay rate "息吹きボリューム低下率"
|
||||
const char *description = "\x91\xa7\x90\x81\x82\xab\x83{\x83\x8a\x83\x85\x81[\x83\x80\x92\xe1\x89\xba\x97\xa6";
|
||||
|
||||
DebugHierarchy *debugHierarchy = this->GetDebugHierarchy0();
|
||||
debugHierarchy->vfunc_3c(id, &data_ov000_020e56f0);
|
||||
|
||||
debugHierarchy->GetChildNode(1, description, id, &data_ov000_020e56f0, 8, 0, 0x1000, 0);
|
||||
THUMB void LinkStateMove::LoadBhio() {
|
||||
// Breath volume decay rate
|
||||
this->GetBhio0()->GetField2(true, 'LMOV', "息吹きボリューム低下率", &data_ov000_020e56f0, 8, 0, 0x1000);
|
||||
}
|
||||
|
||||
ARM void LinkStateMove::OnStateEnter() {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
void LinkStateRoll::vfunc_00() {}
|
||||
LinkStateId LinkStateRoll::GetId() {}
|
||||
void LinkStateRoll::CreateDebugHierarchy() {}
|
||||
void LinkStateRoll::LoadBhio() {}
|
||||
void LinkStateRoll::OnStateEnter() {}
|
||||
void LinkStateRoll::OnStateLeave(s32 param1) {}
|
||||
bool LinkStateRoll::vfunc_20(s32 param1) {}
|
||||
|
||||
@@ -37,9 +37,9 @@ ARM bool PlayerControl::func_ov00_020aeef8() {
|
||||
|
||||
THUMB void PlayerControl::func_ov00_020aef30() {
|
||||
this->ResetTouchWorld();
|
||||
if (mDebug) {
|
||||
if (mBhio) {
|
||||
// 操作 = Operation
|
||||
mDebug->vfunc_20(0, "\x91\x80\x8d\xec", 'PCTL', 'PLYR', 0, 0);
|
||||
mBhio->vfunc_20(0, "\x91\x80\x8d\xec", 'PCTL', 'PLYR', 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "Debug/DebugHierarchy.hpp"
|
||||
|
||||
DebugHierarchy::~DebugHierarchy() {}
|
||||
@@ -0,0 +1,3 @@
|
||||
#include "Player/Bhio.hpp"
|
||||
|
||||
Bhio::~Bhio() {}
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
LinkStateBase::LinkStateBase(PlayerLinkBase *link) {}
|
||||
LinkStateBase::~LinkStateBase() {}
|
||||
void LinkStateBase::CreateDebugHierarchy() {}
|
||||
void LinkStateBase::LoadBhio() {}
|
||||
|
||||
@@ -108,7 +108,7 @@ ARM void LinkStateMove::vfunc_1c() {
|
||||
if (mUnk_0c > 0) {
|
||||
|
||||
q4 temp_r8 = data_ov005_02112be4;
|
||||
s16 temp_r1 = *this->GetPlayerAngle() + this->Get_PlayerControlData_Unk32();
|
||||
s16 temp_r1 = *(s16 *) this->GetPlayerAngle() + this->Get_PlayerControlData_Unk32();
|
||||
this->TurnTo(temp_r1, temp_r1, temp_r8);
|
||||
s32 temp_r1_2 = mUnk_0c;
|
||||
if (temp_r7_2 > temp_r1_2) {
|
||||
@@ -143,7 +143,7 @@ ARM void LinkStateMove::vfunc_1c() {
|
||||
filter.mUnk_08 = FLOAT_TO_Q20(4.0);
|
||||
Vec3p pos = *this->GetPlayerPos();
|
||||
filter.mPos = pos;
|
||||
filter.mAngle = *this->GetPlayerAngle();
|
||||
filter.mAngle = *(s16 *) this->GetPlayerAngle();
|
||||
if (gActorManager->FilterActors(&filter, NULL) > 0) {
|
||||
q20 temp_r1_4 = FLOAT_TO_Q20(4.0) - filter.mUnk_08;
|
||||
Vec3p spC = filter.mActor->mPos;
|
||||
|
||||
@@ -251,39 +251,6 @@ THUMB Actor *EquipBombchu::func_ov058_02199400() {
|
||||
extern "C" void func_ov014_02124ff4(Sphere *sphere);
|
||||
extern "C" bool func_0202b2f8(Vec3p *param_1, Vec3p *param_2, unk32 param_3);
|
||||
THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
struct TempStruct1 {
|
||||
/* 00 */ unk8 mUnk_00[0xe];
|
||||
/* 0e */ unk8 mUnk_0e;
|
||||
/* 0f */ unk8 mUnk_0f;
|
||||
/* 10 */ unk8 mUnk_10;
|
||||
/* 11 */ unk8 mUnk_11;
|
||||
/* 12 */ unk8 mUnk_12[0x6];
|
||||
/* 18 */ volatile unk8 mUnk_18;
|
||||
/* 19 */ unk8 mUnk_19;
|
||||
/* 1a */ unk8 mUnk_1a;
|
||||
/* 1b */ unk8 mUnk_1b;
|
||||
/* 1c */ unk8 mUnk_1c;
|
||||
/* 1d */ unk8 mUnk_1d;
|
||||
/* 1e */
|
||||
};
|
||||
|
||||
struct TempStruct2 {
|
||||
union {
|
||||
/* 00 */ Vec3p mUnk_00;
|
||||
struct {
|
||||
/* 00 */ u16 mUnk_00_x;
|
||||
/* 02 */ u16 mUnk_02;
|
||||
/* 04 */ u16 mUnk_04;
|
||||
/* 06 */ u16 mUnk_06;
|
||||
/* 08 */ unk32 mUnk_08;
|
||||
};
|
||||
};
|
||||
/* 0c */ unk8 mUnk_0c[0x34];
|
||||
/* 40 */
|
||||
};
|
||||
|
||||
TempStruct1 sp214;
|
||||
TempStruct2 sp1D4;
|
||||
AABB sp1BC;
|
||||
Vec3p sp1B0;
|
||||
Vec3p sp1A4;
|
||||
@@ -484,21 +451,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
}
|
||||
}
|
||||
}
|
||||
sp1D4.mUnk_00_x = -1;
|
||||
sp1D4.mUnk_02 = -1;
|
||||
sp1D4.mUnk_04 = -1;
|
||||
sp1D4.mUnk_06 = -1;
|
||||
sp1D4.mUnk_00.z = 0;
|
||||
sp214.mUnk_0e = 0;
|
||||
sp214.mUnk_0f = 0;
|
||||
sp214.mUnk_10 = 0;
|
||||
sp214.mUnk_11 = 0;
|
||||
sp214.mUnk_18 = 0U;
|
||||
sp214.mUnk_19 = 0U;
|
||||
sp214.mUnk_1a = 0;
|
||||
sp214.mUnk_1b = 0;
|
||||
sp214.mUnk_1c = 0;
|
||||
sp214.mUnk_1d = 0;
|
||||
UnkStruct sp1D4;
|
||||
if (var_r6_2 < sp1B0.y) {
|
||||
if ((sp1B0.y - var_r6_2) < 0x999) {
|
||||
var_r6_2 = sp1B0.y;
|
||||
@@ -528,7 +481,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
sp194.pos.y = 9;
|
||||
sp194.pos.z = 0xCF;
|
||||
sp194.radius = 1;
|
||||
temp_r0_8 = gMapManager->func_01ffbe78(&sp1D4.mUnk_00, &spE0, &spD4, &sp194);
|
||||
temp_r0_8 = gMapManager->func_01ffbe78(&sp1D4, &spE0, &spD4, &sp194, 0, 0, 0, 0);
|
||||
if (sUnk_02198d00.mUnk_10.x != 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -550,7 +503,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
mUnk_47 = 0;
|
||||
mUnk_46 = 1;
|
||||
} else {
|
||||
if (sp214.mUnk_18 != 0) {
|
||||
if (sp1D4.mUnk_58 != 0) {
|
||||
if (mUnk_18 <= 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -607,7 +560,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
sp194.pos.y = 9;
|
||||
sp194.pos.z = 0xCF;
|
||||
sp194.radius = 1;
|
||||
temp_r0_16 = gMapManager->func_01ffbe78(&sp1D4.mUnk_00, &sp170, &spB0, &sp194);
|
||||
temp_r0_16 = gMapManager->func_01ffbe78(&sp1D4, &sp170, &spB0, &sp194, 0, 0, 0, 0);
|
||||
if (sUnk_02198d00.mUnk_10.x != 0) {
|
||||
return 0;
|
||||
}
|
||||
@@ -621,7 +574,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
}
|
||||
gMapManager->func_ov00_02083c7c(&sp170, sp24_unk4);
|
||||
} else {
|
||||
if (sp214.mUnk_18 == 0) {
|
||||
if (sp1D4.mUnk_58 == 0) {
|
||||
return false;
|
||||
}
|
||||
sp170.x = sp1D4.mUnk_00.x;
|
||||
@@ -654,7 +607,7 @@ THUMB bool EquipBombchu::func_ov058_02199498(Vec3p *vec) {
|
||||
vec->y = temp_r0_22;
|
||||
vec->z = sp1B0.z;
|
||||
} else {
|
||||
if (sp214.mUnk_19 == 0) {
|
||||
if (sp1D4.mUnk_59 == 0) {
|
||||
return 0;
|
||||
}
|
||||
sp158.x = sp1D4.mUnk_00.x;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
static char *gShipParts[8] = {"anc", "bow", "hul", "can", "dco", "pdl", "fnl", "brg"};
|
||||
|
||||
extern "C" void ApproachAngle_thunk(s16 *src, s16 dst, u32 param3);
|
||||
extern "C" void ApproachAngle_thunk(u16 *src, s16 dst, u32 param3);
|
||||
|
||||
ARM bool EquipHammer::IsUsable(unk32 param1) const {
|
||||
ActorNavi *pAVar3;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "Map/MapManager.hpp"
|
||||
|
||||
bool MapManager::func_01ffbe78(Vec3p *param1, Vec3p *param2, Vec3p *param3, Sphere *param4) {}
|
||||
bool MapManager::func_01ffbe78(UnkStruct *param1, Vec3p *param2, Vec3p *param3, Sphere *param4, s32 actorId, u16 param6,
|
||||
unk32 param7, unk32 param8) {}
|
||||
bool MapManager::func_01ffbf5c(struct UnkStruct *param1, Vec3p *param2, Vec3p *param3, s32 length, unk32 param5, unk32 param6,
|
||||
UnkStruct_ov000_020beba8 *param7, unk32 param8) {}
|
||||
bool MapManager::func_01ffc118(s32 *param1, Vec3p *param2, Vec3p *param3, s32 param4, s32 *param5, u32 param6, s32 *param7) {}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#include "Player/Bhio.hpp"
|
||||
|
||||
BhioBase::BhioBase() {}
|
||||
BhioBase::~BhioBase() {}
|
||||
BhioGroup *BhioBase::FindGroup(u32 id) {}
|
||||
bool BhioBase::GetField(bool param1, const char *fieldName, u32 groupId, s32 *pValue, unk32 param5, unk32 param6, unk32 param7,
|
||||
unk32 param8) {}
|
||||
void BhioBase::vfunc_08() {}
|
||||
void BhioBase::vfunc_0c() {}
|
||||
void BhioBase::vfunc_10() {}
|
||||
void BhioBase::vfunc_14() {}
|
||||
void BhioBase::vfunc_18() {}
|
||||
void BhioBase::vfunc_1c() {}
|
||||
void BhioBase::vfunc_20(unk32 param1, const char *param2, unk32 param3, unk32 param4, unk32 param5, unk32 param6) {}
|
||||
void BhioBase::vfunc_24() {}
|
||||
void BhioBase::vfunc_28() {}
|
||||
void BhioBase::vfunc_2c() {}
|
||||
void BhioBase::vfunc_30() {}
|
||||
void BhioBase::vfunc_38() {}
|
||||
void BhioBase::vfunc_3c(u32 groupId, s32 *pValue) {}
|
||||
@@ -1,20 +0,0 @@
|
||||
#include "Debug/DebugHierarchyBase.hpp"
|
||||
|
||||
DebugHierarchyBase::DebugHierarchyBase() {}
|
||||
DebugHierarchyBase::~DebugHierarchyBase() {}
|
||||
DebugHierarchyNode *DebugHierarchyBase::FindNode(u32 id) {}
|
||||
bool DebugHierarchyBase::GetChildNode(unk32 param1, const char *description, u32 parent, s32 *param4, unk32 param5,
|
||||
unk32 param6, unk32 param7, unk32 param8) {}
|
||||
void DebugHierarchyBase::vfunc_08() {}
|
||||
void DebugHierarchyBase::vfunc_0c() {}
|
||||
void DebugHierarchyBase::vfunc_10() {}
|
||||
void DebugHierarchyBase::vfunc_14() {}
|
||||
void DebugHierarchyBase::vfunc_18() {}
|
||||
void DebugHierarchyBase::vfunc_1c() {}
|
||||
void DebugHierarchyBase::vfunc_20(unk32 param1, const char *param2, unk32 param3, unk32 param4, unk32 param5, unk32 param6) {}
|
||||
void DebugHierarchyBase::vfunc_24() {}
|
||||
void DebugHierarchyBase::vfunc_28() {}
|
||||
void DebugHierarchyBase::vfunc_2c() {}
|
||||
void DebugHierarchyBase::vfunc_30() {}
|
||||
void DebugHierarchyBase::vfunc_38() {}
|
||||
void DebugHierarchyBase::vfunc_3c(unk32 param1, void *param2) {}
|
||||
Reference in New Issue
Block a user