Decompile some Action classes (#104)

* various action classes

* rename instanceset fns

* rename isFork -> isChangeable
This commit is contained in:
notyourav 2022-10-17 23:27:57 -07:00 committed by GitHub
parent bc6fe73df1
commit 2f62d26424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 1062 additions and 823 deletions

View File

@ -893,17 +893,17 @@ action::Escape:
action::EscapeBackTurn: action::EscapeBackTurn:
status: pending status: pending
action::EventAddGameDataIntAction: action::EventAddGameDataIntAction:
status: pending status: done
action::EventAddGameDataToRupeeAction: action::EventAddGameDataToRupeeAction:
status: pending status: done
action::EventAppearCheckPointNum: action::EventAppearCheckPointNum:
status: pending status: done
action::EventAppearFlyDistance: action::EventAppearFlyDistance:
status: pending status: done
action::EventAppearGolfCount: action::EventAppearGolfCount:
status: pending status: done
action::EventAppearRaceResult: action::EventAppearRaceResult:
status: pending status: done
action::EventAppearRupeeAction: action::EventAppearRupeeAction:
status: pending status: pending
action::EventAutoSaveAction: action::EventAutoSaveAction:
@ -973,9 +973,9 @@ action::EventFlagOFFAction:
action::EventFlagONAction: action::EventFlagONAction:
status: pending status: pending
action::EventHoverNullASPlay: action::EventHoverNullASPlay:
status: pending status: done
action::EventHoverNullASPlayBase: action::EventHoverNullASPlayBase:
status: pending status: done
action::EventIncreaseFameAction: action::EventIncreaseFameAction:
status: pending status: pending
action::EventIncreaseGameDataIntAction: action::EventIncreaseGameDataIntAction:
@ -2093,13 +2093,13 @@ action::KokkoThrown:
action::KorokFlowerAppear: action::KorokFlowerAppear:
status: pending status: pending
action::KorokFlowerVanish: action::KorokFlowerVanish:
status: pending status: done
action::KorokFlowerWait: action::KorokFlowerWait:
status: pending status: done
action::KorokTargetMove: action::KorokTargetMove:
status: pending status: done
action::KorokTargetWait: action::KorokTargetWait:
status: pending status: done
action::LandOnCeil: action::LandOnCeil:
status: pending status: pending
action::LandRagdoll: action::LandRagdoll:
@ -2421,7 +2421,7 @@ action::NPCSellHorse:
action::NPCSellItem: action::NPCSellItem:
status: pending status: pending
action::NPCStartTurnToPlayer: action::NPCStartTurnToPlayer:
status: pending status: done
action::NpcSwimMove: action::NpcSwimMove:
status: pending status: pending
action::NpcSwimNavMove: action::NpcSwimNavMove:

File diff suppressed because it is too large Load Diff

@ -1 +1 @@
Subproject commit c355f876626638d265c7eb7bf90928e25e161bec Subproject commit 3077c49affa2770c5336764ca062ed50e7444b5b

@ -1 +1 @@
Subproject commit 24d64b1255378c36299f84a28297e16e37b8e569 Subproject commit 79f528be96a3d7c844847ab6371e0ae6b38c83c7

View File

@ -70,7 +70,7 @@ bool ForkAI::isFailed() const {
for (; i < num_children; ++i) { for (; i < num_children; ++i) {
auto* child = getChild(i); auto* child = getChild(i);
failed |= child->isFailed(); failed |= child->isFailed();
if (!child->isFinished() && !child->isFailed() && !child->isFlag4Set()) if (!child->isFinished() && !child->isFailed() && !child->isChangeable())
break; break;
} }
return i == num_children && failed; return i == num_children && failed;
@ -86,16 +86,16 @@ bool ForkAI::isFinished() const {
break; break;
if (child->isFinished()) if (child->isFinished())
finished = true; finished = true;
else if (!child->isFlag4Set()) else if (!child->isChangeable())
break; break;
} }
return i == num_children && finished; return i == num_children && finished;
} }
bool ForkAI::isFlag4Set() const { bool ForkAI::isChangeable() const {
const int num_children = getNumChildren(); const int num_children = getNumChildren();
for (int i = 0; i < num_children; ++i) { for (int i = 0; i < num_children; ++i) {
if (!getChild(i)->isFlag4Set()) if (!getChild(i)->isChangeable())
return false; return false;
} }
return true; return true;

View File

@ -17,7 +17,7 @@ public:
void leave_() override; void leave_() override;
bool isFailed() const override; bool isFailed() const override;
bool isFinished() const override; bool isFinished() const override;
bool isFlag4Set() const override; bool isChangeable() const override;
bool handleMessage_(const ksys::Message& message) override; bool handleMessage_(const ksys::Message& message) override;
bool handleAck_(const ksys::MessageAck& message) override; bool handleAck_(const ksys::MessageAck& message) override;
void getCurrentName(sead::BufferedSafeString* name, ActionBase* last) const override; void getCurrentName(sead::BufferedSafeString* name, ActionBase* last) const override;

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventAddGameDataIntAction.h" #include "Game/AI/Action/actionEventAddGameDataIntAction.h"
#include "KingSystem/GameData/gdtManager.h"
namespace uking::action { namespace uking::action {
@ -13,6 +14,14 @@ bool EventAddGameDataIntAction::init_(sead::Heap* heap) {
void EventAddGameDataIntAction::enter_(ksys::act::ai::InlineParamPack* params) { void EventAddGameDataIntAction::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); ksys::act::ai::Action::enter_(params);
if (mGameDataIntSrcName_d.isEmpty() || mGameDataIntDstName_d.isEmpty()) {
setFailed();
mFlags.set(Flag::Changeable);
return;
}
mIsReady = true;
} }
void EventAddGameDataIntAction::leave_() { void EventAddGameDataIntAction::leave_() {
@ -27,6 +36,32 @@ void EventAddGameDataIntAction::loadParams_() {
void EventAddGameDataIntAction::calc_() { void EventAddGameDataIntAction::calc_() {
ksys::act::ai::Action::calc_(); ksys::act::ai::Action::calc_();
if (isFinished() || isFailed()) {
return;
}
if (!mIsReady) {
setFinished();
mFlags.set(Flag::Changeable);
return;
}
mIsReady = false;
auto* gdm = ksys::gdt::Manager::instance();
if (gdm == nullptr) {
setFailed();
mFlags.set(Flag::Changeable);
return;
}
s32 value = 0;
if (gdm->getParam().get().getS32(&value, mGameDataIntSrcName_d)) {
if (*mIsSignInversion_d) {
value = -value;
}
gdm->incrementS32(value, mGameDataIntDstName_d);
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -24,6 +24,8 @@ protected:
sead::SafeString mGameDataIntDstName_d{}; sead::SafeString mGameDataIntDstName_d{};
// dynamic_param at offset 0x38 // dynamic_param at offset 0x38
sead::SafeString mGameDataIntSrcName_d{}; sead::SafeString mGameDataIntSrcName_d{};
bool mIsReady{};
}; };
} // namespace uking::action } // namespace uking::action

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionEventAddGameDataToRupeeAction.h" #include "Game/AI/Action/actionEventAddGameDataToRupeeAction.h"
#include "KingSystem/GameData/gdtManager.h"
#include "KingSystem/System/UIGlue.h"
namespace uking::action { namespace uking::action {
@ -13,6 +15,19 @@ bool EventAddGameDataToRupeeAction::init_(sead::Heap* heap) {
void EventAddGameDataToRupeeAction::enter_(ksys::act::ai::InlineParamPack* params) { void EventAddGameDataToRupeeAction::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); ksys::act::ai::Action::enter_(params);
s32 val = 0;
auto* gdm = ksys::gdt::Manager::instance();
if (!gdm->getParam().get().getS32(&val, mGameDataIntAddValueName_d)) {
ksys::ui::initRupeeCounter();
return;
}
if (*mIsSignInversion_d) {
val = -val;
}
gdm->incrementS32(val, "CurrentRupee");
ksys::ui::initRupeeCounter();
} }
void EventAddGameDataToRupeeAction::leave_() { void EventAddGameDataToRupeeAction::leave_() {
@ -26,6 +41,10 @@ void EventAddGameDataToRupeeAction::loadParams_() {
void EventAddGameDataToRupeeAction::calc_() { void EventAddGameDataToRupeeAction::calc_() {
ksys::act::ai::Action::calc_(); ksys::act::ai::Action::calc_();
if (!ksys::ui::isRupeeCounterActive()) {
setFinished();
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventAppearCheckPointNum.h" #include "Game/AI/Action/actionEventAppearCheckPointNum.h"
#include "Game/UI/uiUtils.h"
namespace uking::action { namespace uking::action {
@ -11,6 +12,11 @@ bool EventAppearCheckPointNum::init_(sead::Heap* heap) {
return ksys::act::ai::Action::init_(heap); return ksys::act::ai::Action::init_(heap);
} }
bool EventAppearCheckPointNum::oneShot_() {
ui::setShowCheckPoint(*mIconType_d, mGameDataIntTargetCounter_d);
return ksys::act::ai::Action::oneShot_();
}
void EventAppearCheckPointNum::loadParams_() { void EventAppearCheckPointNum::loadParams_() {
getDynamicParam(&mIconType_d, "IconType"); getDynamicParam(&mIconType_d, "IconType");
getDynamicParam(&mGameDataIntTargetCounter_d, "GameDataIntTargetCounter"); getDynamicParam(&mGameDataIntTargetCounter_d, "GameDataIntTargetCounter");

View File

@ -14,6 +14,8 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
int* mIconType_d{}; int* mIconType_d{};
// dynamic_param at offset 0x28 // dynamic_param at offset 0x28

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventAppearFlyDistance.h" #include "Game/AI/Action/actionEventAppearFlyDistance.h"
#include "Game/UI/uiUtils.h"
namespace uking::action { namespace uking::action {
@ -10,6 +11,11 @@ bool EventAppearFlyDistance::init_(sead::Heap* heap) {
return ksys::act::ai::Action::init_(heap); return ksys::act::ai::Action::init_(heap);
} }
bool EventAppearFlyDistance::oneShot_() {
ui::setShowFlyDistance(mGameDataFloatDistance_d);
return ksys::act::ai::Action::oneShot_();
}
void EventAppearFlyDistance::loadParams_() { void EventAppearFlyDistance::loadParams_() {
getDynamicParam(&mGameDataFloatDistance_d, "GameDataFloatDistance"); getDynamicParam(&mGameDataFloatDistance_d, "GameDataFloatDistance");
} }

View File

@ -14,6 +14,8 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
sead::SafeString mGameDataFloatDistance_d{}; sead::SafeString mGameDataFloatDistance_d{};
}; };

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventAppearGolfCount.h" #include "Game/AI/Action/actionEventAppearGolfCount.h"
#include "Game/UI/uiUtils.h"
namespace uking::action { namespace uking::action {
@ -10,6 +11,11 @@ bool EventAppearGolfCount::init_(sead::Heap* heap) {
return ksys::act::ai::Action::init_(heap); return ksys::act::ai::Action::init_(heap);
} }
bool EventAppearGolfCount::oneShot_() {
ui::setShowGolfCount(mGameDataIntTargetCounter_d);
return ksys::act::ai::Action::oneShot_();
}
void EventAppearGolfCount::loadParams_() { void EventAppearGolfCount::loadParams_() {
getDynamicParam(&mGameDataIntTargetCounter_d, "GameDataIntTargetCounter"); getDynamicParam(&mGameDataIntTargetCounter_d, "GameDataIntTargetCounter");
} }

View File

@ -14,6 +14,8 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
sead::SafeString mGameDataIntTargetCounter_d{}; sead::SafeString mGameDataIntTargetCounter_d{};
}; };

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventAppearRaceResult.h" #include "Game/AI/Action/actionEventAppearRaceResult.h"
#include "Game/UI/uiUtils.h"
namespace uking::action { namespace uking::action {
@ -10,6 +11,11 @@ bool EventAppearRaceResult::init_(sead::Heap* heap) {
return ksys::act::ai::Action::init_(heap); return ksys::act::ai::Action::init_(heap);
} }
bool EventAppearRaceResult::oneShot_() {
ui::setShowRaceResult(*mResultType_d);
return ksys::act::ai::Action::oneShot_();
}
void EventAppearRaceResult::loadParams_() { void EventAppearRaceResult::loadParams_() {
getDynamicParam(&mResultType_d, "ResultType"); getDynamicParam(&mResultType_d, "ResultType");
} }

View File

@ -14,6 +14,8 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
int* mResultType_d{}; int* mResultType_d{};
}; };

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionEventHoverNullASPlay.h" #include "Game/AI/Action/actionEventHoverNullASPlay.h"
#include "KingSystem/Physics/System/physInstanceSet.h"
namespace uking::action { namespace uking::action {
@ -12,9 +13,13 @@ bool EventHoverNullASPlay::init_(sead::Heap* heap) {
void EventHoverNullASPlay::enter_(ksys::act::ai::InlineParamPack* params) { void EventHoverNullASPlay::enter_(ksys::act::ai::InlineParamPack* params) {
EventHoverNullASPlayBase::enter_(params); EventHoverNullASPlayBase::enter_(params);
mCCAccessor.changeMotionType(mActor->getCharacterController(), ksys::act::MotionType::Hover);
} }
void EventHoverNullASPlay::leave_() { void EventHoverNullASPlay::leave_() {
resetAllMotion(mActor);
EventHoverNullASPlayBase::leave_(); EventHoverNullASPlayBase::leave_();
} }

View File

@ -1,7 +1,9 @@
#pragma once #pragma once
#include "Game/AI/Action/actionEventHoverNullASPlayBase.h" #include "Game/AI/Action/actionEventHoverNullASPlayBase.h"
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/ActorSystem/actAiAction.h" #include "KingSystem/ActorSystem/actAiAction.h"
#include "KingSystem/ActorSystem/actCCAccessor.h"
namespace uking::action { namespace uking::action {
@ -18,6 +20,13 @@ public:
protected: protected:
void calc_() override; void calc_() override;
void resetAllMotion(ksys::act::Actor* actor) {
mCCAccessor.resetRigidBodyMotion(actor);
mCCAccessor.resetMotionType(actor->getCharacterController());
}
ksys::act::CCAccessor mCCAccessor;
}; };
} // namespace uking::action } // namespace uking::action

View File

@ -12,7 +12,8 @@ bool EventHoverNullASPlayBase::init_(sead::Heap* heap) {
} }
void EventHoverNullASPlayBase::enter_(ksys::act::ai::InlineParamPack* params) { void EventHoverNullASPlayBase::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); playAS(mASName_d.cstr(), *mIsIgnoreSame_d, *mASSlot_d, *mSequenceBank_d, -1.0);
mFlags.set(ksys::act::ai::Action::Flag::Changeable);
} }
void EventHoverNullASPlayBase::leave_() { void EventHoverNullASPlayBase::leave_() {
@ -28,7 +29,9 @@ void EventHoverNullASPlayBase::loadParams_() {
} }
void EventHoverNullASPlayBase::calc_() { void EventHoverNullASPlayBase::calc_() {
ksys::act::ai::Action::calc_(); if (!isFailed() && isFinishedAS(*mASSlot_d, *mSequenceBank_d)) {
setFinished();
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -12,7 +12,7 @@ bool Fork::init_(sead::Heap* heap) {
void Fork::enter_(ksys::act::ai::InlineParamPack* params) { void Fork::enter_(ksys::act::ai::InlineParamPack* params) {
if (*mIsChangeable_s) if (*mIsChangeable_s)
mFlags.set(Flag::_4); mFlags.set(Flag::Changeable);
} }
void Fork::leave_() { void Fork::leave_() {
@ -37,7 +37,7 @@ void Fork::setEndState() {
setFailed(); setFailed();
break; break;
case 2: case 2:
mFlags.set(ksys::act::ai::ActionBase::Flag::_4); mFlags.set(ksys::act::ai::ActionBase::Flag::Changeable);
break; break;
} }
} }

View File

@ -15,7 +15,7 @@ bool GameDataAddFloat::oneShot_() {
auto* gdm = ksys::gdt::Manager::instance(); auto* gdm = ksys::gdt::Manager::instance();
if (!gdm) { if (!gdm) {
setFailed(); setFailed();
mFlags.set(Flag::_4); mFlags.set(Flag::Changeable);
return false; return false;
} }

View File

@ -15,7 +15,7 @@ bool GameDataAddInt::oneShot_() {
auto* gdm = ksys::gdt::Manager::instance(); auto* gdm = ksys::gdt::Manager::instance();
if (!gdm) { if (!gdm) {
setFailed(); setFailed();
mFlags.set(Flag::_4); mFlags.set(Flag::Changeable);
return false; return false;
} }

View File

@ -15,7 +15,7 @@ bool GameDataAddVec3::oneShot_() {
auto* gdm = ksys::gdt::Manager::instance(); auto* gdm = ksys::gdt::Manager::instance();
if (!gdm) { if (!gdm) {
setFailed(); setFailed();
mFlags.set(Flag::_4); mFlags.set(Flag::Changeable);
return false; return false;
} }

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionKorokFlowerAppear.h" #include "Game/AI/Action/actionKorokFlowerAppear.h"
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
namespace uking::action { namespace uking::action {
@ -11,7 +13,18 @@ bool KorokFlowerAppear::init_(sead::Heap* heap) {
} }
void KorokFlowerAppear::enter_(ksys::act::ai::InlineParamPack* params) { void KorokFlowerAppear::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); mActor->getActorFlags2().reset(ksys::act::Actor::ActorFlag2::_20);
auto* main_body = mActor->getMainBody();
auto* tgt_body = mActor->getTgtBody();
if (main_body != nullptr && tgt_body != nullptr) {
main_body->setContactNone();
main_body->resetFlag200();
tgt_body->setContactNone();
tgt_body->resetFlag200();
}
mFlags.set(Flag::Changeable);
setFinished();
} }
void KorokFlowerAppear::leave_() { void KorokFlowerAppear::leave_() {

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionKorokFlowerVanish.h" #include "Game/AI/Action/actionKorokFlowerVanish.h"
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
namespace uking::action { namespace uking::action {
@ -11,7 +13,17 @@ bool KorokFlowerVanish::init_(sead::Heap* heap) {
} }
void KorokFlowerVanish::enter_(ksys::act::ai::InlineParamPack* params) { void KorokFlowerVanish::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); mActor->emitBasicSigOn();
mActor->getActorFlags2().set(ksys::act::Actor::ActorFlag2::_20);
auto* main_body = mActor->getMainBody();
auto* tgt_body = mActor->getTgtBody();
if (main_body != nullptr && tgt_body != nullptr) {
main_body->setContactAll();
main_body->setFlag200();
tgt_body->setContactAll();
tgt_body->setFlag200();
}
} }
void KorokFlowerVanish::leave_() { void KorokFlowerVanish::leave_() {

View File

@ -1,4 +1,5 @@
#include "Game/AI/Action/actionKorokFlowerWait.h" #include "Game/AI/Action/actionKorokFlowerWait.h"
#include "KingSystem/ActorSystem/actActor.h"
namespace uking::action { namespace uking::action {
@ -21,7 +22,10 @@ void KorokFlowerWait::leave_() {
void KorokFlowerWait::loadParams_() {} void KorokFlowerWait::loadParams_() {}
void KorokFlowerWait::calc_() { void KorokFlowerWait::calc_() {
ksys::act::ai::Action::calc_(); if (mActor->checkBasicSig()) {
mFlags.set(Flag::Changeable);
setFinished();
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -1,4 +1,8 @@
#include "Game/AI/Action/actionKorokTargetMove.h" #include "Game/AI/Action/actionKorokTargetMove.h"
#include <math/seadMatrixCalcCommon.hpp>
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
#include "KingSystem/System/VFR.h"
namespace uking::action { namespace uking::action {
@ -26,7 +30,24 @@ void KorokTargetMove::loadParams_() {
} }
void KorokTargetMove::calc_() { void KorokTargetMove::calc_() {
ksys::act::ai::Action::calc_(); auto* actor = mActor;
auto* body = actor->getMainBody();
if (*mIsBezier_d || *mIsTargetWarp_m) {
body->setPosition(*mTargetPos_d, true);
setFinished();
return;
}
sead::Matrix34f mtx = actor->getMtx();
sead::Vector3f pos(mtx(0, 3), mtx(1, 3), mtx(2, 3));
ksys::VFR::chaseVec(&pos, *mTargetPos_d, *mSpeed_d);
body->changePosition(pos, true);
sead::Vector3f t = pos - *mTargetPos_d;
if (t.length() < *mSpeed_d) {
setFinished();
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionKorokTargetWait.h" #include "Game/AI/Action/actionKorokTargetWait.h"
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/Physics/RigidBody/physRigidBody.h"
namespace uking::action { namespace uking::action {
@ -11,7 +13,7 @@ bool KorokTargetWait::init_(sead::Heap* heap) {
} }
void KorokTargetWait::enter_(ksys::act::ai::InlineParamPack* params) { void KorokTargetWait::enter_(ksys::act::ai::InlineParamPack* params) {
ksys::act::ai::Action::enter_(params); mTime = 0;
} }
void KorokTargetWait::leave_() { void KorokTargetWait::leave_() {
@ -24,7 +26,13 @@ void KorokTargetWait::loadParams_() {
} }
void KorokTargetWait::calc_() { void KorokTargetWait::calc_() {
ksys::act::ai::Action::calc_(); mActor->getMainBody()->setLinearVelocity(sead::Vector3f::zero);
if (mTime >= *mDynStopTime_d) {
mFlags.set(ksys::act::ai::Action::Flag::Changeable);
setFinished();
} else {
mTime += 1.0;
}
} }
} // namespace uking::action } // namespace uking::action

View File

@ -22,6 +22,8 @@ protected:
const float* mSpeedDecreRate_s{}; const float* mSpeedDecreRate_s{};
// dynamic_param at offset 0x28 // dynamic_param at offset 0x28
float* mDynStopTime_d{}; float* mDynStopTime_d{};
f32 mTime;
}; };
} // namespace uking::action } // namespace uking::action

View File

@ -1,4 +1,6 @@
#include "Game/AI/Action/actionNPCStartTurnToPlayer.h" #include "Game/AI/Action/actionNPCStartTurnToPlayer.h"
#include "KingSystem/ActorSystem/actActor.h"
#include "KingSystem/Utils/Thread/Message.h"
namespace uking::action { namespace uking::action {
@ -10,6 +12,14 @@ bool NPCStartTurnToPlayer::init_(sead::Heap* heap) {
return ksys::act::ai::Action::init_(heap); return ksys::act::ai::Action::init_(heap);
} }
bool NPCStartTurnToPlayer::oneShot_() {
mValue = *mTurnRange_d * 0.5f;
sendMessage(*mActor->getMesTransceiverId(), ksys::MessageType(0x8000078), &mValue);
return ksys::act::ai::Action::oneShot_();
}
void NPCStartTurnToPlayer::loadParams_() { void NPCStartTurnToPlayer::loadParams_() {
getDynamicParam(&mTurnRange_d, "TurnRange"); getDynamicParam(&mTurnRange_d, "TurnRange");
} }

View File

@ -14,8 +14,12 @@ public:
void loadParams_() override; void loadParams_() override;
protected: protected:
bool oneShot_() override;
// dynamic_param at offset 0x20 // dynamic_param at offset 0x20
float* mTurnRange_d{}; float* mTurnRange_d{};
float mValue;
}; };
} // namespace uking::action } // namespace uking::action

View File

@ -15,7 +15,7 @@ void SendMessage::enter_(ksys::act::ai::InlineParamPack* params) {
if (*mSendTiming_s == 0) if (*mSendTiming_s == 0)
doSendMessage(); doSendMessage();
mFlags.set(Flag::_4); mFlags.set(Flag::Changeable);
setFinished(); setFinished();
} }

View File

@ -34,6 +34,11 @@ int getItemGeneralLife(const char* name);
// TODO: move this to yet another translation unit (TBD but not the same one as the above) // TODO: move this to yet another translation unit (TBD but not the same one as the above)
void addItemForDebug(const sead::SafeString& name, int value); void addItemForDebug(const sead::SafeString& name, int value);
void setShowCheckPoint(s32 icon_type, const sead::SafeString& counter_name);
void setShowFlyDistance(const sead::SafeString& distance);
void setShowGolfCount(const sead::SafeString& counter_name);
void setShowRaceResult(s32 result_type);
int countCookResultsCheck(const sead::SafeString& name, s32 effect_type); int countCookResultsCheck(const sead::SafeString& name, s32 effect_type);
int countCookResultsAllOk(const sead::SafeString& name); int countCookResultsAllOk(const sead::SafeString& name);
int getItemValue(const sead::SafeString& name); int getItemValue(const sead::SafeString& name);

View File

@ -1,126 +1,127 @@
target_sources(uking PRIVATE target_sources(uking PRIVATE
Attention/actAttention.cpp Attention/actAttention.cpp
Attention/actAttention.h Attention/actAttention.h
Awareness/actAwareness.cpp Awareness/actAwareness.cpp
Awareness/actAwareness.h Awareness/actAwareness.h
Awareness/actAwarenessDefs.cpp Awareness/actAwarenessDefs.cpp
Awareness/actAwarenessDefs.h Awareness/actAwarenessDefs.h
Awareness/actAwarenessInstance.cpp Awareness/actAwarenessInstance.cpp
Awareness/actAwarenessInstance.h Awareness/actAwarenessInstance.h
LOD/actLodState.cpp LOD/actLodState.cpp
LOD/actLodState.h LOD/actLodState.h
Profiles/actPlayerBase.cpp Profiles/actPlayerBase.cpp
Profiles/actPlayerBase.h Profiles/actPlayerBase.h
Profiles/actRopeBase.cpp Profiles/actRopeBase.cpp
Profiles/actRopeBase.h Profiles/actRopeBase.h
actActor.cpp actActor.cpp
actActor.h actActor.h
actActorCaptureMgr.cpp actActorCaptureMgr.cpp
actActorCaptureMgr.h actActorCaptureMgr.h
actActorConstDataAccess.cpp actActorConstDataAccess.cpp
actActorConstDataAccess.h actActorConstDataAccess.h
actActorCreator.cpp actActorCreator.cpp
actActorCreator.h actActorCreator.h
actActorEditorNode.cpp actActorEditorNode.cpp
actActorEditorNode.h actActorEditorNode.h
actActorFactory.cpp actActorFactory.cpp
actActorFactory.h actActorFactory.h
actActorHeapUtil.cpp actActorHeapUtil.cpp
actActorHeapUtil.h actActorHeapUtil.h
actActorLimiter.cpp actActorLimiter.cpp
actActorLimiter.h actActorLimiter.h
actActorLinkConstDataAccess.cpp actActorLinkConstDataAccess.cpp
actActorLinkConstDataAccess.h actActorLinkConstDataAccess.h
actActorParam.cpp actActorParam.cpp
actActorParam.h actActorParam.h
actActorParamMgr.cpp actActorParamMgr.cpp
actActorParamMgr.h actActorParamMgr.h
actActorSystem.cpp actActorSystem.cpp
actActorSystem.h actActorSystem.h
actActorTemplate.cpp actActorTemplate.cpp
actActorTemplate.h actActorTemplate.h
actActorUtil.cpp actActorUtil.cpp
actActorUtil.h actActorUtil.h
actAiAction.cpp actAiAction.cpp
actAiAction.h actAiAction.h
actAiActionBase.cpp actAiActionBase.cpp
actAiActionBase.h actAiActionBase.h
actAiAi.cpp actAiAi.cpp
actAiAi.h actAiAi.h
actAiBehavior.cpp actAiBehavior.cpp
actAiBehavior.h actAiBehavior.h
actAiClassDef.cpp actAiClassDef.cpp
actAiClassDef.h actAiClassDef.h
actAiInlineParam.h actAiInlineParam.h
actAiParam.cpp actAiParam.cpp
actAiParam.h actAiParam.h
actAiQuery.cpp actAiQuery.cpp
actAiQuery.h actAiQuery.h
actAiQueries.cpp actAiQueries.cpp
actAiQueries.h actAiQueries.h
actAiRoot.cpp actAiRoot.cpp
actAiRoot.h actAiRoot.h
actASSetting.cpp actASSetting.cpp
actASSetting.h actASSetting.h
actBaseProc.cpp actBaseProc.cpp
actBaseProc.h actBaseProc.h
actBaseProcCreateTask.cpp actBaseProcCreateTask.cpp
actBaseProcCreateTask.h actBaseProcCreateTask.h
actBaseProcCreateTaskSelector.cpp actBaseProcCreateTaskSelector.cpp
actBaseProcCreateTaskSelector.h actBaseProcCreateTaskSelector.h
actBaseProcDeleter.cpp actBaseProcDeleter.cpp
actBaseProcDeleter.h actBaseProcDeleter.h
actBaseProcHandle.cpp actBaseProcHandle.cpp
actBaseProcHandle.h actBaseProcHandle.h
actBaseProcHeapMgr.cpp actBaseProcHeapMgr.cpp
actBaseProcHeapMgr.h actBaseProcHeapMgr.h
actBaseProcInitializer.cpp actBaseProcInitializer.cpp
actBaseProcInitializer.h actBaseProcInitializer.h
actBaseProcJob.cpp actBaseProcJob.cpp
actBaseProcJob.h actBaseProcJob.h
actBaseProcJobHandler.cpp actBaseProcJobHandler.cpp
actBaseProcJobHandler.h actBaseProcJobHandler.h
actBaseProcJobQue.cpp actBaseProcJobQue.cpp
actBaseProcJobQue.h actBaseProcJobQue.h
actBaseProcLink.cpp actBaseProcLink.cpp
actBaseProcLink.h actBaseProcLink.h
actBaseProcMap.cpp actBaseProcMap.cpp
actBaseProcMap.h actBaseProcMap.h
actBaseProcMgr.cpp actBaseProcMgr.cpp
actBaseProcMgr.h actBaseProcMgr.h
actBaseProcUnit.cpp actBaseProcUnit.cpp
actBaseProcUnit.h actBaseProcUnit.h
actClusteredRenderer.cpp actCCAccessor.h
actClusteredRenderer.h actClusteredRenderer.cpp
actDebug.cpp actClusteredRenderer.h
actDebug.h actDebug.cpp
actGlobalParameter.cpp actDebug.h
actGlobalParameter.h actGlobalParameter.cpp
actInfoCommon.cpp actGlobalParameter.h
actInfoCommon.h actInfoCommon.cpp
actInfoData.cpp actInfoCommon.h
actInfoData.h actInfoData.cpp
actInstParamPack.cpp actInfoData.h
actInstParamPack.h actInstParamPack.cpp
actLifeRecoveryInfo.h actInstParamPack.h
actPhysicsConstraints.cpp actLifeRecoveryInfo.h
actPhysicsConstraints.h actPhysicsConstraints.cpp
actPhysicsUserTag.cpp actPhysicsConstraints.h
actPhysicsUserTag.h actPhysicsUserTag.cpp
actPlayerInfo.cpp actPhysicsUserTag.h
actPlayerInfo.h actPlayerInfo.cpp
actTag.h actPlayerInfo.h
actTag.h
actionDummyAction.cpp actionDummyAction.cpp
actionDummyAction.h actionDummyAction.h
aiDummyAi.cpp aiDummyAi.cpp
aiDummyAi.h aiDummyAi.h
behaviorDummyBehavior.cpp behaviorDummyBehavior.cpp
behaviorDummyBehavior.h behaviorDummyBehavior.h
queryDummyQuery.cpp queryDummyQuery.cpp
queryDummyQuery.h queryDummyQuery.h
) )

View File

@ -40,9 +40,10 @@ class UMii;
namespace phys { namespace phys {
class StaticCompoundRigidBodyGroup; class StaticCompoundRigidBodyGroup;
class Physics; class InstanceSet;
class Reaction; class Reaction;
class RigidBody; class RigidBody;
class CharacterController;
} // namespace phys } // namespace phys
namespace res { namespace res {
@ -112,6 +113,7 @@ public:
enum class ActorFlag2 { enum class ActorFlag2 {
InstEvent = 0x8, InstEvent = 0x8,
_20 = 0x20,
NoDistanceCheck = 0x80, NoDistanceCheck = 0x80,
Alive = 0x4000000, Alive = 0x4000000,
}; };
@ -140,12 +142,19 @@ public:
const sead::Vector3f& getVelocity() const { return mVelocity; } const sead::Vector3f& getVelocity() const { return mVelocity; }
const sead::Vector3f& getAngVelocity() const { return mAngVelocity; } const sead::Vector3f& getAngVelocity() const { return mAngVelocity; }
const sead::Vector3f& getScale() const { return mScale; } const sead::Vector3f& getScale() const { return mScale; }
phys::RigidBody* getMainBody() const { return mMainBody; }
phys::RigidBody* getTgtBody() const { return mTgtBody; }
const MesTransceiverId* getMesTransceiverId() const { return mMsgTransceiver.getId(); }
f32 getDeleteDistance() const { f32 getDeleteDistance() const {
return sead::Mathf::sqrt(sead::Mathf::clampMin(mDeleteDistanceSq, 0.0f)); return sead::Mathf::sqrt(sead::Mathf::clampMin(mDeleteDistanceSq, 0.0f));
} }
void setDeleteDistance(f32 distance) { mDeleteDistanceSq = sead::Mathf::square(distance); } void setDeleteDistance(f32 distance) { mDeleteDistanceSq = sead::Mathf::square(distance); }
phys::CharacterController* getCharacterController();
void clearFlag(ActorFlag flag); void clearFlag(ActorFlag flag);
bool checkFlag(ActorFlag flag) const; bool checkFlag(ActorFlag flag) const;
void setFlag(ActorFlag flag); void setFlag(ActorFlag flag);
@ -278,6 +287,7 @@ public:
void emitBasicSigOn(); void emitBasicSigOn();
void emitBasicSigOff(); void emitBasicSigOff();
bool checkBasicSig() const;
void nullsub_4649(); // Some kind of logging which has been excluded from the build? void nullsub_4649(); // Some kind of logging which has been excluded from the build?
@ -386,7 +396,7 @@ protected:
/* 0x560 */ as::ASList* mASList = nullptr; /* 0x560 */ as::ASList* mASList = nullptr;
/* 0x568 */ xlink::XLink* mXLink = nullptr; /* 0x568 */ xlink::XLink* mXLink = nullptr;
/* 0x570 */ ActorParam* mActorParam = nullptr; /* 0x570 */ ActorParam* mActorParam = nullptr;
/* 0x578 */ phys::Physics* mPhysics = nullptr; /* 0x578 */ phys::InstanceSet* mPhysics = nullptr;
/* 0x580 */ PhysicsConstraints mConstraints; /* 0x580 */ PhysicsConstraints mConstraints;
/* 0x598 */ void* _598 = nullptr; /* 0x598 */ void* _598 = nullptr;
/* 0x5a0 */ BoneControl* mBoneControl = nullptr; /* 0x5a0 */ BoneControl* mBoneControl = nullptr;

View File

@ -13,6 +13,7 @@ struct AIDefSet;
class Message; class Message;
class MessageAck; class MessageAck;
struct MesTransceiverId; struct MesTransceiverId;
struct MessageType;
} // namespace ksys } // namespace ksys
namespace ksys::res { namespace ksys::res {
@ -69,6 +70,8 @@ public:
void leave(); void leave();
bool oneShot(InlineParamPack* params); bool oneShot(InlineParamPack* params);
bool sendMessage(const MesTransceiverId& dest, const MessageType& type, void* user_data);
Action* getCurrentAction(); Action* getCurrentAction();
bool handleMessage(const Message& message); bool handleMessage(const Message& message);
bool handleAck(const MessageAck& message); bool handleAck(const MessageAck& message);
@ -78,9 +81,12 @@ public:
const char* getClassName() const; const char* getClassName() const;
const char* getName() const; const char* getName() const;
void playAS(const char* name, bool repeat, u32 slot, u32 seq_bank, f32 t);
bool isFinishedAS(u32 slot, u32 seq_bank);
virtual bool isFailed() const { return mFlags.isOn(Flag::Failed); } virtual bool isFailed() const { return mFlags.isOn(Flag::Failed); }
virtual bool isFinished() const { return mFlags.isOn(Flag::Finished); } virtual bool isFinished() const { return mFlags.isOn(Flag::Finished); }
virtual bool isFlag4Set() const { return mFlags.isOn(Flag::_4); } virtual bool isChangeable() const { return mFlags.isOn(Flag::Changeable); }
virtual bool hasPreDeleteCb() { return false; } virtual bool hasPreDeleteCb() { return false; }
virtual bool hasUpdateForPreDeleteCb() { return false; } virtual bool hasUpdateForPreDeleteCb() { return false; }
@ -123,7 +129,7 @@ protected:
enum class Flag : u8 { enum class Flag : u8 {
Finished = 1, Finished = 1,
Failed = 2, Failed = 2,
_4 = 4, Changeable = 4,
TriggerAction = 8, TriggerAction = 8,
DynamicParamChild = 0x10, DynamicParamChild = 0x10,
_20 = 0x20, _20 = 0x20,
@ -154,7 +160,7 @@ protected:
void resetFlags() { void resetFlags() {
mFlags.reset(Flag::Failed); mFlags.reset(Flag::Failed);
mFlags.reset(Flag::Finished); mFlags.reset(Flag::Finished);
mFlags.reset(Flag::_4); mFlags.reset(Flag::Changeable);
} }
res::AIProgram* getAIProg() const; res::AIProgram* getAIProg() const;

View File

@ -186,12 +186,12 @@ bool Ai::reenter(ActionBase* other, const sead::SafeString& context) {
return child->takeOver(other_child, getName()); return child->takeOver(other_child, getName());
} }
bool Ai::isFlag4Set() const { bool Ai::isChangeable() const {
auto* child = getCurrentChild(); auto* child = getCurrentChild();
if (child) if (child)
return child->isFlag4Set(); return child->isChangeable();
return mFlags.isOn(Flag::_4); return mFlags.isOn(Flag::Changeable);
} }
ActionBase* Ai::getCurrentChild() const { ActionBase* Ai::getCurrentChild() const {

View File

@ -11,7 +11,7 @@ public:
explicit Ai(const InitArg& arg); explicit Ai(const InitArg& arg);
~Ai() override; ~Ai() override;
bool isFlag4Set() const override; bool isChangeable() const override;
void calc() override; void calc() override;
ActionBase* changeChildLater(const sead::SafeString& name) override; ActionBase* changeChildLater(const sead::SafeString& name) override;
void getParams(ParamNameTypePairs* pairs, bool update_use_count) const override; void getParams(ParamNameTypePairs* pairs, bool update_use_count) const override;

View File

@ -30,7 +30,7 @@ public:
explicit RootAi(const InitArg& arg); explicit RootAi(const InitArg& arg);
~RootAi() override; ~RootAi() override;
bool isFlag4Set() const override { return true; } bool isChangeable() const override { return true; }
bool init_(sead::Heap* heap) override; bool init_(sead::Heap* heap) override;
void enter_(InlineParamPack* params) override; void enter_(InlineParamPack* params) override;
void leave_() override; void leave_() override;

View File

@ -0,0 +1,26 @@
#pragma once
namespace ksys::phys {
class CharacterController;
};
namespace ksys::act {
class Actor;
// todo: move?
enum class MotionType {
Hover = 3,
};
class CCAccessor {
public:
CCAccessor();
~CCAccessor();
void changeMotionType(phys::CharacterController* cc, MotionType motion_type);
void resetRigidBodyMotion(Actor* actor);
void resetMotionType(phys::CharacterController* cc);
};
} // namespace ksys::act

View File

@ -5,7 +5,7 @@ namespace ksys::act::ai {
DummyAction::DummyAction(const InitArg& arg) : Action(arg) {} DummyAction::DummyAction(const InitArg& arg) : Action(arg) {}
void DummyAction::enter_(InlineParamPack* params) { void DummyAction::enter_(InlineParamPack* params) {
mFlags.set(ActionBase::Flag::_4); mFlags.set(ActionBase::Flag::Changeable);
} }
void DummyAction::calc_() {} void DummyAction::calc_() {}

View File

@ -9,7 +9,7 @@ class DummyAi : public Ai {
public: public:
explicit DummyAi(const InitArg& arg); explicit DummyAi(const InitArg& arg);
bool isFlag4Set() const override { return true; } bool isChangeable() const override { return true; }
void enter_(InlineParamPack* params) override; void enter_(InlineParamPack* params) override;
protected: protected:

View File

@ -1,193 +1,195 @@
target_sources(uking PRIVATE target_sources(uking PRIVATE
Cloth/physClothParam.cpp CharacterController/physCharacterController.h
Cloth/physClothParam.h
Cloth/physClothResource.cpp
Cloth/physClothResource.h
Constraint/physConstraint.cpp Cloth/physClothParam.cpp
Constraint/physConstraint.h Cloth/physClothParam.h
Cloth/physClothResource.cpp
Cloth/physClothResource.h
Ragdoll/physRagdollConfig.cpp Constraint/physConstraint.cpp
Ragdoll/physRagdollConfig.h Constraint/physConstraint.h
Ragdoll/physRagdollControllerKeyList.h
Ragdoll/physRagdollControllerKeyList.cpp
Ragdoll/physRagdollController.cpp
Ragdoll/physRagdollController.h
Ragdoll/physRagdollControllerMgr.cpp
Ragdoll/physRagdollControllerMgr.h
Ragdoll/physRagdollParam.cpp
Ragdoll/physRagdollParam.h
Ragdoll/physRagdollResource.cpp
Ragdoll/physRagdollResource.h
Ragdoll/physRagdollRigidBody.cpp
Ragdoll/physRagdollRigidBody.h
Rig/physBoneAccessor.cpp Ragdoll/physRagdollConfig.cpp
Rig/physBoneAccessor.h Ragdoll/physRagdollConfig.h
Rig/physModelBoneAccessor.cpp Ragdoll/physRagdollControllerKeyList.h
Rig/physModelBoneAccessor.h Ragdoll/physRagdollControllerKeyList.cpp
Rig/physSkeletonMapper.cpp Ragdoll/physRagdollController.cpp
Rig/physSkeletonMapper.h Ragdoll/physRagdollController.h
Ragdoll/physRagdollControllerMgr.cpp
Ragdoll/physRagdollControllerMgr.h
Ragdoll/physRagdollParam.cpp
Ragdoll/physRagdollParam.h
Ragdoll/physRagdollResource.cpp
Ragdoll/physRagdollResource.h
Ragdoll/physRagdollRigidBody.cpp
Ragdoll/physRagdollRigidBody.h
RigidBody/physEdgeRigidBodyParam.cpp Rig/physBoneAccessor.cpp
RigidBody/physEdgeRigidBodyParam.h Rig/physBoneAccessor.h
RigidBody/physMotionAccessor.cpp Rig/physModelBoneAccessor.cpp
RigidBody/physMotionAccessor.h Rig/physModelBoneAccessor.h
RigidBody/physRigidBody.cpp Rig/physSkeletonMapper.cpp
RigidBody/physRigidBody.h Rig/physSkeletonMapper.h
RigidBody/physRigidBodyAccessor.cpp
RigidBody/physRigidBodyAccessor.h
RigidBody/physRigidBodyContactEvent.h
RigidBody/physRigidBodyFromResource.cpp
RigidBody/physRigidBodyFromResource.h
RigidBody/physRigidBodyFromShape.cpp
RigidBody/physRigidBodyFromShape.h
RigidBody/physRigidBodyMotionEntity.cpp
RigidBody/physRigidBodyMotionEntity.h
RigidBody/physRigidBodyMotionSensor.cpp
RigidBody/physRigidBodyMotionSensor.h
RigidBody/physRigidBodyParam.cpp
RigidBody/physRigidBodyParam.h
RigidBody/physRigidBodyRequestMgr.cpp
RigidBody/physRigidBodyRequestMgr.h
RigidBody/physRigidBodyResource.cpp
RigidBody/physRigidBodyResource.h
RigidBody/physRigidBodySet.cpp
RigidBody/physRigidBodySet.h
RigidBody/physRigidBodySetParam.cpp
RigidBody/physRigidBodySetParam.h
RigidBody/Shape/Box/physBoxRigidBody.cpp RigidBody/physEdgeRigidBodyParam.cpp
RigidBody/Shape/Box/physBoxRigidBody.h RigidBody/physEdgeRigidBodyParam.h
RigidBody/Shape/Box/physBoxShape.cpp RigidBody/physMotionAccessor.cpp
RigidBody/Shape/Box/physBoxShape.h RigidBody/physMotionAccessor.h
RigidBody/Shape/BoxWater/physBoxWaterRigidBody.cpp RigidBody/physRigidBody.cpp
RigidBody/Shape/BoxWater/physBoxWaterRigidBody.h RigidBody/physRigidBody.h
RigidBody/Shape/BoxWater/physBoxWaterShape.cpp RigidBody/physRigidBodyAccessor.cpp
RigidBody/Shape/BoxWater/physBoxWaterShape.h RigidBody/physRigidBodyAccessor.h
RigidBody/Shape/Capsule/physCapsuleRigidBody.cpp RigidBody/physRigidBodyContactEvent.h
RigidBody/Shape/Capsule/physCapsuleRigidBody.h RigidBody/physRigidBodyFromResource.cpp
RigidBody/Shape/Capsule/physCapsuleShape.cpp RigidBody/physRigidBodyFromResource.h
RigidBody/Shape/Capsule/physCapsuleShape.h RigidBody/physRigidBodyFromShape.cpp
RigidBody/Shape/CharacterPrism/physCharacterPrismShape.cpp RigidBody/physRigidBodyFromShape.h
RigidBody/Shape/CharacterPrism/physCharacterPrismShape.h RigidBody/physRigidBodyMotionEntity.cpp
RigidBody/Shape/Cylinder/physCylinderRigidBody.cpp RigidBody/physRigidBodyMotionEntity.h
RigidBody/Shape/Cylinder/physCylinderRigidBody.h RigidBody/physRigidBodyMotionSensor.cpp
RigidBody/Shape/Cylinder/physCylinderShape.cpp RigidBody/physRigidBodyMotionSensor.h
RigidBody/Shape/Cylinder/physCylinderShape.h RigidBody/physRigidBodyParam.cpp
RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.cpp RigidBody/physRigidBodyParam.h
RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.h RigidBody/physRigidBodyRequestMgr.cpp
RigidBody/Shape/CylinderWater/physCylinderWaterShape.cpp RigidBody/physRigidBodyRequestMgr.h
RigidBody/Shape/CylinderWater/physCylinderWaterShape.h RigidBody/physRigidBodyResource.cpp
RigidBody/Shape/List/physListShape.cpp RigidBody/physRigidBodyResource.h
RigidBody/Shape/List/physListShape.h RigidBody/physRigidBodySet.cpp
RigidBody/Shape/List/physListShapeRigidBody.cpp RigidBody/physRigidBodySet.h
RigidBody/Shape/List/physListShapeRigidBody.h RigidBody/physRigidBodySetParam.cpp
RigidBody/Shape/Polytope/physPolytopeRigidBody.cpp RigidBody/physRigidBodySetParam.h
RigidBody/Shape/Polytope/physPolytopeRigidBody.h
RigidBody/Shape/Polytope/physPolytopeShape.cpp
RigidBody/Shape/Polytope/physPolytopeShape.h
RigidBody/Shape/Sphere/physSphereRigidBody.cpp
RigidBody/Shape/Sphere/physSphereRigidBody.h
RigidBody/Shape/Sphere/physSphereShape.cpp
RigidBody/Shape/Sphere/physSphereShape.h
RigidBody/Shape/physShape.h
RigidBody/Shape/physShapeParamObj.cpp
RigidBody/Shape/physShapeParamObj.h
RigidBody/TeraMesh/physTeraMeshRigidBody.cpp RigidBody/Shape/Box/physBoxRigidBody.cpp
RigidBody/TeraMesh/physTeraMeshRigidBody.h RigidBody/Shape/Box/physBoxRigidBody.h
RigidBody/TeraMesh/physTeraMeshRigidBodyResource.cpp RigidBody/Shape/Box/physBoxShape.cpp
RigidBody/TeraMesh/physTeraMeshRigidBodyResource.h RigidBody/Shape/Box/physBoxShape.h
RigidBody/Shape/BoxWater/physBoxWaterRigidBody.cpp
RigidBody/Shape/BoxWater/physBoxWaterRigidBody.h
RigidBody/Shape/BoxWater/physBoxWaterShape.cpp
RigidBody/Shape/BoxWater/physBoxWaterShape.h
RigidBody/Shape/Capsule/physCapsuleRigidBody.cpp
RigidBody/Shape/Capsule/physCapsuleRigidBody.h
RigidBody/Shape/Capsule/physCapsuleShape.cpp
RigidBody/Shape/Capsule/physCapsuleShape.h
RigidBody/Shape/CharacterPrism/physCharacterPrismShape.cpp
RigidBody/Shape/CharacterPrism/physCharacterPrismShape.h
RigidBody/Shape/Cylinder/physCylinderRigidBody.cpp
RigidBody/Shape/Cylinder/physCylinderRigidBody.h
RigidBody/Shape/Cylinder/physCylinderShape.cpp
RigidBody/Shape/Cylinder/physCylinderShape.h
RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.cpp
RigidBody/Shape/CylinderWater/physCylinderWaterRigidBody.h
RigidBody/Shape/CylinderWater/physCylinderWaterShape.cpp
RigidBody/Shape/CylinderWater/physCylinderWaterShape.h
RigidBody/Shape/List/physListShape.cpp
RigidBody/Shape/List/physListShape.h
RigidBody/Shape/List/physListShapeRigidBody.cpp
RigidBody/Shape/List/physListShapeRigidBody.h
RigidBody/Shape/Polytope/physPolytopeRigidBody.cpp
RigidBody/Shape/Polytope/physPolytopeRigidBody.h
RigidBody/Shape/Polytope/physPolytopeShape.cpp
RigidBody/Shape/Polytope/physPolytopeShape.h
RigidBody/Shape/Sphere/physSphereRigidBody.cpp
RigidBody/Shape/Sphere/physSphereRigidBody.h
RigidBody/Shape/Sphere/physSphereShape.cpp
RigidBody/Shape/Sphere/physSphereShape.h
RigidBody/Shape/physShape.h
RigidBody/Shape/physShapeParamObj.cpp
RigidBody/Shape/physShapeParamObj.h
RigidBody/TerrainHeightField/physTerrainHeightFieldRigidBody.h RigidBody/TeraMesh/physTeraMeshRigidBody.cpp
RigidBody/TeraMesh/physTeraMeshRigidBody.h
RigidBody/TeraMesh/physTeraMeshRigidBodyResource.cpp
RigidBody/TeraMesh/physTeraMeshRigidBodyResource.h
StaticCompound/physStaticCompound.cpp RigidBody/TerrainHeightField/physTerrainHeightFieldRigidBody.h
StaticCompound/physStaticCompound.h
StaticCompound/physStaticCompoundAutogen.cpp
StaticCompound/physStaticCompoundInfo.cpp
StaticCompound/physStaticCompoundInfo.h
StaticCompound/physStaticCompoundMgr.cpp
StaticCompound/physStaticCompoundMgr.h
StaticCompound/physStaticCompoundRigidBodyGroup.cpp
StaticCompound/physStaticCompoundRigidBodyGroup.h
StaticCompound/physStaticCompoundUtil.cpp
StaticCompound/physStaticCompoundUtil.h
SupportBone/physSupportBoneParam.cpp StaticCompound/physStaticCompound.cpp
SupportBone/physSupportBoneParam.h StaticCompound/physStaticCompound.h
SupportBone/physSupportBoneResource.cpp StaticCompound/physStaticCompoundAutogen.cpp
SupportBone/physSupportBoneResource.h StaticCompound/physStaticCompoundInfo.cpp
SupportBone/physSupportBoneResourceMainBone.cpp StaticCompound/physStaticCompoundInfo.h
StaticCompound/physStaticCompoundMgr.cpp
StaticCompound/physStaticCompoundMgr.h
StaticCompound/physStaticCompoundRigidBodyGroup.cpp
StaticCompound/physStaticCompoundRigidBodyGroup.h
StaticCompound/physStaticCompoundUtil.cpp
StaticCompound/physStaticCompoundUtil.h
System/physCharacterControllerParam.cpp SupportBone/physSupportBoneParam.cpp
System/physCharacterControllerParam.h SupportBone/physSupportBoneParam.h
System/physClosestPointQuery.cpp SupportBone/physSupportBoneResource.cpp
System/physClosestPointQuery.h SupportBone/physSupportBoneResource.h
System/physClosestPointQueryWithInfo.cpp SupportBone/physSupportBoneResourceMainBone.cpp
System/physClosestPointQueryWithInfo.h
System/physCollisionInfo.cpp
System/physCollisionInfo.h
System/physContactInfoParam.cpp
System/physContactInfoParam.h
System/physContactLayerCollisionInfo.cpp
System/physContactLayerCollisionInfo.h
System/physContactLayerCollisionInfoGroup.cpp
System/physContactLayerCollisionInfoGroup.h
System/physContactListener.cpp
System/physContactListener.h
System/physContactMgr.cpp
System/physContactMgr.h
System/physContactPointInfo.cpp
System/physContactPointInfo.h
System/physLayerContactPointInfo.cpp
System/physLayerContactPointInfo.h
System/physEntityContactListener.cpp
System/physEntityContactListener.h
System/physEntityGroupFilter.cpp
System/physEntityGroupFilter.h
System/physGroupFilter.cpp
System/physGroupFilter.h
System/physInstanceSet.cpp
System/physInstanceSet.h
System/physMaterialTable.cpp
System/physMaterialTable.h
System/physParamSet.cpp
System/physParamSet.h
System/physPhantom.cpp
System/physPhantom.h
System/physQueryContactPointInfo.cpp
System/physQueryContactPointInfo.h
System/physRayCast.cpp
System/physRayCast.h
System/physRayCastBodyQuery.cpp
System/physRayCastBodyQuery.h
System/physRayCastForRequest.cpp
System/physRayCastForRequest.h
System/physRayCastRequestMgr.cpp
System/physRayCastRequestMgr.h
System/physSensorContactListener.cpp
System/physSensorContactListener.h
System/physSensorGroupFilter.cpp
System/physSensorGroupFilter.h
System/physShapeCast.cpp
System/physShapeCast.h
System/physShapeCastWithInfo.cpp
System/physShapeCastWithInfo.h
System/physSystem.cpp
System/physSystem.h
System/physSystemData.cpp
System/physSystemData.h
System/physUserTag.cpp
System/physUserTag.h
physConversions.h System/physCharacterControllerParam.cpp
physDefines.cpp System/physCharacterControllerParam.h
physDefines.h System/physClosestPointQuery.cpp
physHavokMemoryAllocator.cpp System/physClosestPointQuery.h
physHavokMemoryAllocator.h System/physClosestPointQueryWithInfo.cpp
physHeapUtil.h System/physClosestPointQueryWithInfo.h
physLayerMaskBuilder.h System/physCollisionInfo.cpp
physMaterialMask.cpp System/physCollisionInfo.h
physMaterialMask.h System/physContactInfoParam.cpp
) System/physContactInfoParam.h
System/physContactLayerCollisionInfo.cpp
System/physContactLayerCollisionInfo.h
System/physContactLayerCollisionInfoGroup.cpp
System/physContactLayerCollisionInfoGroup.h
System/physContactListener.cpp
System/physContactListener.h
System/physContactMgr.cpp
System/physContactMgr.h
System/physContactPointInfo.cpp
System/physContactPointInfo.h
System/physLayerContactPointInfo.cpp
System/physLayerContactPointInfo.h
System/physEntityContactListener.cpp
System/physEntityContactListener.h
System/physEntityGroupFilter.cpp
System/physEntityGroupFilter.h
System/physGroupFilter.cpp
System/physGroupFilter.h
System/physInstanceSet.cpp
System/physInstanceSet.h
System/physMaterialTable.cpp
System/physMaterialTable.h
System/physParamSet.cpp
System/physParamSet.h
System/physPhantom.cpp
System/physPhantom.h
System/physQueryContactPointInfo.cpp
System/physQueryContactPointInfo.h
System/physRayCast.cpp
System/physRayCast.h
System/physRayCastBodyQuery.cpp
System/physRayCastBodyQuery.h
System/physRayCastForRequest.cpp
System/physRayCastForRequest.h
System/physRayCastRequestMgr.cpp
System/physRayCastRequestMgr.h
System/physSensorContactListener.cpp
System/physSensorContactListener.h
System/physSensorGroupFilter.cpp
System/physSensorGroupFilter.h
System/physShapeCast.cpp
System/physShapeCast.h
System/physShapeCastWithInfo.cpp
System/physShapeCastWithInfo.h
System/physSystem.cpp
System/physSystem.h
System/physSystemData.cpp
System/physSystemData.h
System/physUserTag.cpp
System/physUserTag.h
physConversions.h
physDefines.cpp
physDefines.h
physHavokMemoryAllocator.cpp
physHavokMemoryAllocator.h
physHeapUtil.h
physLayerMaskBuilder.h
physMaterialMask.cpp
physMaterialMask.h
)

View File

@ -0,0 +1,13 @@
#pragma once
#include "KingSystem/Physics/physDefines.h"
namespace ksys::phys {
class CharacterController {
public:
void sub_7100F5EC30();
void sub_7100F60604();
void enableCollisionMaybe_0(ContactLayer);
};
} // namespace ksys::phys

View File

@ -479,6 +479,8 @@ public:
const auto& getMotionFlags() const { return mMotionFlags; } const auto& getMotionFlags() const { return mMotionFlags; }
void resetMotionFlagDirect(const MotionFlag flag) { mMotionFlags.reset(flag); } void resetMotionFlagDirect(const MotionFlag flag) { mMotionFlags.reset(flag); }
void setMotionFlag(MotionFlag flag); void setMotionFlag(MotionFlag flag);
void setFlag200() { mFlags.set(Flag::_200); }
void resetFlag200() { mFlags.reset(Flag::_200); }
hkpRigidBody* getHkBody() const { return mHkBody; } hkpRigidBody* getHkBody() const { return mHkBody; }

View File

@ -1,4 +1,5 @@
#include "KingSystem/Physics/System/physInstanceSet.h" #include "KingSystem/Physics/System/physInstanceSet.h"
#include "KingSystem/Physics/CharacterController/physCharacterController.h"
#include "KingSystem/Physics/Ragdoll/physRagdollController.h" #include "KingSystem/Physics/Ragdoll/physRagdollController.h"
#include "KingSystem/Physics/RigidBody/physRigidBodySet.h" #include "KingSystem/Physics/RigidBody/physRigidBodySet.h"
#include "KingSystem/Physics/System/physCollisionInfo.h" #include "KingSystem/Physics/System/physCollisionInfo.h"
@ -146,16 +147,16 @@ void InstanceSet::sub_7100FBB00C(phys::RigidBody* body, phys::RigidBodyParam* pa
body->clearSensorReceiverIgnoredLayer(); body->clearSensorReceiverIgnoredLayer();
} }
void* InstanceSet::sub_7100FBBC28(const sead::SafeString& name) const { RigidBody* InstanceSet::findRigidBody(const sead::SafeString& name) const {
for (auto& rb : mRigidBodySets) { for (auto& rb : mRigidBodySets) {
void* p = rb.findBodyByHavokName(name); RigidBody* p = rb.findBodyByHavokName(name);
if (p != nullptr) if (p != nullptr)
return p; return p;
} }
return nullptr; return nullptr;
} }
s32 InstanceSet::sub_7100FBBC78(const sead::SafeString& name) const { s32 InstanceSet::findContactPointInfo(const sead::SafeString& name) const {
s32 idx = 0; s32 idx = 0;
for (auto& info : mContactPointInfo) { for (auto& info : mContactPointInfo) {
if (name == info.getName()) if (name == info.getName())
@ -165,7 +166,7 @@ s32 InstanceSet::sub_7100FBBC78(const sead::SafeString& name) const {
return -1; return -1;
} }
s32 InstanceSet::sub_7100FBBD9C(const sead::SafeString& name) const { s32 InstanceSet::findCollisionInfo(const sead::SafeString& name) const {
s32 idx = 0; s32 idx = 0;
for (auto& info : mCollisionInfo) { for (auto& info : mCollisionInfo) {
if (name == info.getName()) if (name == info.getName())

View File

@ -37,14 +37,6 @@ class RigidBodySet;
class SystemGroupHandler; class SystemGroupHandler;
class UserTag; class UserTag;
// TODO: move to a separate header
class CharacterController {
public:
void sub_7100F5EC30();
void sub_7100F60604();
void enableCollisionMaybe_0(ContactLayer);
};
class InstanceSet : public sead::hostio::Node { class InstanceSet : public sead::hostio::Node {
public: public:
enum class Flag : u32 { enum class Flag : u32 {
@ -82,9 +74,9 @@ public:
void setMtxAndScale(const sead::Matrix34f& mtx, bool a2, bool a3, f32 scale); void setMtxAndScale(const sead::Matrix34f& mtx, bool a2, bool a3, f32 scale);
void sub_7100FBB4B4(); void sub_7100FBB4B4();
void* findX(const sead::SafeString& a1, const sead::SafeString& a2) const; void* findX(const sead::SafeString& a1, const sead::SafeString& a2) const;
void* sub_7100FBBC28(const sead::SafeString& name) const; RigidBody* findRigidBody(const sead::SafeString& name) const;
s32 sub_7100FBBC78(const sead::SafeString& name) const; s32 findContactPointInfo(const sead::SafeString& name) const;
s32 sub_7100FBBD9C(const sead::SafeString& name) const; s32 findCollisionInfo(const sead::SafeString& name) const;
void sub_7100FBD284(const sead::Matrix34f& mtx); void sub_7100FBD284(const sead::Matrix34f& mtx);
void sub_7100FBC890(const sead::Matrix34f& mtx, bool a2, bool a3); void sub_7100FBC890(const sead::Matrix34f& mtx, bool a2, bool a3);
s32 sub_7100FBDA2C(const sead::SafeString& name) const; s32 sub_7100FBDA2C(const sead::SafeString& name) const;

View File

@ -1,63 +1,63 @@
target_sources(uking PRIVATE target_sources(uking PRIVATE
Account.cpp Account.cpp
Account.h Account.h
AutoDim.cpp AutoDim.cpp
AutoDim.h AutoDim.h
BasicProfiler.cpp BasicProfiler.cpp
BasicProfiler.h BasicProfiler.h
CameraEditor.cpp CameraEditor.cpp
CameraEditor.h CameraEditor.h
CameraMgr.cpp CameraMgr.cpp
CameraMgr.h CameraMgr.h
CoreInfo.h CoreInfo.h
DebugFinder.cpp DebugFinder.cpp
DebugFinder.h DebugFinder.h
DebugMessage.h DebugMessage.h
HavokWorkerMgr.cpp HavokWorkerMgr.cpp
HavokWorkerMgr.h HavokWorkerMgr.h
Hio.cpp Hio.cpp
Hio.h Hio.h
KingEditor.cpp KingEditor.cpp
KingEditor.h KingEditor.h
MemoryProfiler.cpp MemoryProfiler.cpp
MemoryProfiler.h MemoryProfiler.h
MessageCapture.cpp MessageCapture.cpp
MessageCapture.h MessageCapture.h
OcclusionQueryCylinder.cpp OcclusionQueryCylinder.cpp
OcclusionQueryCylinder.h OcclusionQueryCylinder.h
OverlayArena.cpp OverlayArena.cpp
OverlayArena.h OverlayArena.h
OverlayArenaSystem.cpp OverlayArenaSystem.cpp
OverlayArenaSystem.h OverlayArenaSystem.h
OverlayArenaSystemS1.h OverlayArenaSystemS1.h
OverlayArenaSystemS2.h OverlayArenaSystemS2.h
Patrol.cpp Patrol.cpp
Patrol.h Patrol.h
PlayReportMgr.cpp PlayReportMgr.cpp
PlayReportMgr.h PlayReportMgr.h
ProductReporter.cpp ProductReporter.cpp
ProductReporter.h ProductReporter.h
Revision.cpp Revision.cpp
Revision.h Revision.h
StageInfo.cpp StageInfo.cpp
StageInfo.h StageInfo.h
StarterPackMgr.cpp StarterPackMgr.cpp
StarterPackMgr.h StarterPackMgr.h
StringBoard.h StringBoard.h
SystemPauseMgr.cpp SystemPauseMgr.cpp
SystemPauseMgr.h SystemPauseMgr.h
SystemTimers.cpp SystemTimers.cpp
SystemTimers.h SystemTimers.h
Terminal.cpp Terminal.cpp
Terminal.h Terminal.h
Timer.cpp Timer.cpp
Timer.h Timer.h
UIGlue.cpp UIGlue.cpp
UIGlue.h UIGlue.h
VideoRecorder.cpp VideoRecorder.cpp
VideoRecorder.h VideoRecorder.h
VFR.cpp VFR.cpp
VFR.h VFR.h
VFRValue.cpp VFRValue.cpp
VFRValue.h VFRValue.h
) )

View File

@ -5,5 +5,7 @@
namespace ksys::ui { namespace ksys::ui {
int getPorchNum(const sead::SafeString& name); int getPorchNum(const sead::SafeString& name);
void initRupeeCounter();
bool isRupeeCounterActive();
} // namespace ksys::ui } // namespace ksys::ui

View File

@ -14,7 +14,7 @@ _vtable_fn_names = [
"_ZN5uking6action{}D0Ev", "_ZN5uking6action{}D0Ev",
"_ZNK5uking6action{}8isFailedEv", "_ZNK5uking6action{}8isFailedEv",
"_ZNK5uking6action{}10isFinishedEv", "_ZNK5uking6action{}10isFinishedEv",
"_ZNK5uking6action{}10isFlag4SetEv", "_ZNK5uking6action{}12isChangeableEv",
"_ZN5uking6action{}14hasPreDeleteCbEv", "_ZN5uking6action{}14hasPreDeleteCbEv",
"_ZN5uking6action{}23hasUpdateForPreDeleteCbEv", "_ZN5uking6action{}23hasUpdateForPreDeleteCbEv",
"_ZN5uking6action{}2m9Ev", "_ZN5uking6action{}2m9Ev",

View File

@ -14,7 +14,7 @@ _vtable_fn_names = [
"_ZN5uking2ai{}D0Ev", "_ZN5uking2ai{}D0Ev",
"_ZNK5uking2ai{}8isFailedEv", "_ZNK5uking2ai{}8isFailedEv",
"_ZNK5uking2ai{}10isFinishedEv", "_ZNK5uking2ai{}10isFinishedEv",
"_ZNK5uking2ai{}10isFlag4SetEv", "_ZNK5uking2ai{}12isChangeableEv",
"_ZN5uking2ai{}14hasPreDeleteCbEv", "_ZN5uking2ai{}14hasPreDeleteCbEv",
"_ZN5uking2ai{}23hasUpdateForPreDeleteCbEv", "_ZN5uking2ai{}23hasUpdateForPreDeleteCbEv",
"_ZN5uking2ai{}2m9Ev", "_ZN5uking2ai{}2m9Ev",