| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | #include <container/seadPtrArray.h> |
| 5 | #include <container/seadRingBuffer.h> |
| 6 | #include <math/seadMatrix.h> |
| 7 | #include <math/seadQuat.h> |
| 8 | #include <math/seadVector.h> |
| 9 | |
| 10 | #include "Library/LiveActor/LiveActor.h" |
| 11 | |
| 12 | namespace al { |
| 13 | struct ActorInitInfo; |
| 14 | class ActorMatrixCameraTarget; |
| 15 | class CameraTicket; |
| 16 | class EventFlowExecutor; |
| 17 | class HitSensor; |
| 18 | class JointLocalAxisRotator; |
| 19 | class MtxConnector; |
| 20 | class SensorMsg; |
| 21 | } // namespace al |
| 22 | |
| 23 | class IUsePlayerHack; |
| 24 | class CapTargetInfo; |
| 25 | class PlayerHackStartShaderCtrl; |
| 26 | |
| 27 | class HackFork : public al::LiveActor { |
| 28 | public: |
| 29 | HackFork(const char* name); |
| 30 | void init(const al::ActorInitInfo& initInfo) override; |
| 31 | void attackSensor(al::HitSensor* self, al::HitSensor* other) override; |
| 32 | bool receiveMsg(const al::SensorMsg* message, al::HitSensor* other, |
| 33 | al::HitSensor* self) override; |
| 34 | void initAfterPlacement() override; |
| 35 | void control() override; |
| 36 | void calcAnim() override; |
| 37 | |
| 38 | void initBasicPoseInfo(); |
| 39 | bool tryTouch(f32 force, const char* reactionName); |
| 40 | void resetCapMtx(al::HitSensor* sensor); |
| 41 | bool isNerveHackable() const; |
| 42 | bool isHack() const; |
| 43 | void controlSpring(); |
| 44 | void checkSwing(); |
| 45 | bool trySwingJump(); |
| 46 | bool updateInput(sead::Vector3f* pullDirection, sead::Vector3f frontDir); |
| 47 | f32 getJumpRange() const; |
| 48 | |
| 49 | void bendAndTwist(const sead::Vector3f& direction, const sead::Vector3f& front); |
| 50 | void shoot(); |
| 51 | void updateCapMtx(); |
| 52 | void calcHackDir(al::HitSensor* sensor); |
| 53 | |
| 54 | void exeWait(); |
| 55 | void exeHackStartWait(); |
| 56 | void exeDamping(); |
| 57 | void exeHackStart(); |
| 58 | void exeHackWait(); |
| 59 | void exeHackBend(); |
| 60 | void exeHackShoot(); |
| 61 | |
| 62 | private: |
| 63 | IUsePlayerHack* mPlayerHack = nullptr; |
| 64 | CapTargetInfo* mCapTargetInfo = nullptr; |
| 65 | const char* mJointName = nullptr; |
| 66 | sead::Matrix34f mCapPoseMtx = sead::Matrix34f::ident; |
| 67 | sead::Matrix34f mInvJointMtx = sead::Matrix34f::ident; |
| 68 | sead::Matrix34f mStartingPoseMtx = sead::Matrix34f::ident; |
| 69 | sead::Matrix34f mNextCapPoseMtx = sead::Matrix34f::ident; |
| 70 | al::CameraTicket* mCameraTicket = nullptr; |
| 71 | al::ActorMatrixCameraTarget* mMatrixCameraTarget = nullptr; |
| 72 | sead::Matrix34f mCameraTargetMtx = sead::Matrix34f::ident; |
| 73 | sead::Vector3f mCameraOffset = {0.0f, 0.0f, 0.0f}; |
| 74 | bool mIsHackBoard = false; |
| 75 | f32 mDampingStrength = 0.0f; |
| 76 | sead::Vector3f mSideDir = sead::Vector3f::ez; |
| 77 | f32 mDampingForce = 0.0f; |
| 78 | sead::PtrArray<al::JointLocalAxisRotator> mJointRotationHolder; |
| 79 | f32 mTouchForce = 0.0f; |
| 80 | bool mIsHackSwing = false; |
| 81 | u32 mTimeSinceSwingStart = 0; |
| 82 | bool mIsSwingJump = false; |
| 83 | bool mIsReadyToShoot = false; |
| 84 | sead::FixedRingBuffer<sead::Vector3f, 10> mInputBuffer; |
| 85 | bool mIsHorizontal = false; |
| 86 | sead::Quatf mInvInitialHackDir = sead::Quatf::unit; |
| 87 | sead::Vector3f mPullDirection2 = {0.0f, 0.0f, 0.0f}; |
| 88 | sead::Vector3f mPullDirection = {0.0f, 0.0f, 0.0f}; |
| 89 | sead::Vector3f mUpDir = {0.0f, 0.0f, 0.0f}; |
| 90 | sead::Quatf mHackDir = sead::Quatf::unit; |
| 91 | sead::Quatf mUpsideDownInitialHackDir = sead::Quatf::unit; |
| 92 | bool mIsPullDown = false; |
| 93 | bool mIsLimitterFree = false; |
| 94 | s32 mTouchDelay = 0; |
| 95 | s32 mAirVel = 0; |
| 96 | al::MtxConnector* mMtxConnector = nullptr; |
| 97 | al::EventFlowExecutor* mEventFlowExecutor = nullptr; |
| 98 | PlayerHackStartShaderCtrl* mHackStartShaderCtrl = nullptr; |
| 99 | sead::Vector3f mHeadGuidePos = {0.0f, 0.0f, 0.0f}; |
| 100 | }; |
| 101 | |