1#pragma once
2
3#include <basis/seadTypes.h>
4#include <math/seadVector.h>
5
6#include "Library/Nerve/NerveStateBase.h"
7
8namespace al {
9class LiveActor;
10class HitSensor;
11} // namespace al
12
13class IUsePlayerHack;
14class IUsePlayerCollision;
15
16class HackerStateWingFly : public al::ActorStateBase {
17public:
18 HackerStateWingFly(al::LiveActor* actor, IUsePlayerHack** hack, IUsePlayerCollision* collision);
19
20 void appear() override;
21 void goFlyRise();
22 void attackSensor(al::HitSensor* self, al::HitSensor* other);
23 bool canUpperPunch(al::HitSensor* self, al::HitSensor* other) const;
24 void updateFlyLimit();
25 bool judgeStart();
26 void updateMove();
27 bool isOnGround() const;
28 bool tryUpperPunchToCollision();
29 void updateFlyAction();
30
31 void exeFlyRiseToHighest();
32 void exeFlyRiseToTop();
33 void exeFlyTop();
34 void exeFall();
35 void exeFallFly();
36 void exeTrample();
37 void exeUpperPunch();
38
39 struct HackerStateWingFlyParam {
40 const char* actionFly = "Fly";
41 const char* actionFall = "Fall";
42 const char* actionTrample = nullptr;
43 const char* actionUpperPunch = nullptr;
44 f32 defaultAccel = 1.0f;
45 f32 swingAccel = 1.5f;
46 f32 defaultVelocityY = 15.0f;
47 f32 swingVelocityY = 23.0f;
48 f32 defaultFramerate = 1.6f;
49 f32 swingFramerate = 2.6f;
50 f32 yOvershootMax = 230.0f;
51 f32 gravity = 0.6f;
52 f32 turnAngle = 20.0f;
53 f32 flyStartLerpTime = 0.1f;
54 };
55
56 static_assert(sizeof(HackerStateWingFlyParam) == 0x48, "HackerStateWingFlyParam Size");
57
58private:
59 IUsePlayerHack** mHacker;
60 IUsePlayerCollision* mCollision;
61 HackerStateWingFlyParam mParam{};
62 s32 mFallTimeDelay = 0;
63 f32 mAccel = 0.0f;
64 f32 mVelocityY = 0.0f;
65 sead::Vector3f mFlyLimit = sead::Vector3f::zero;
66 bool mIsJudgeFall = false;
67 f32 mFallFrame = 0;
68};
69