LeviLamina
Loading...
Searching...
No Matches
RamAttackGoal.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec2.h"
7#include "mc/deps/core/math/Vec3.h"
8#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
9#include "mc/deps/shared_types/shared_types/FloatRange.h"
10#include "mc/legacy/ActorUniqueID.h"
11#include "mc/world/actor/ai/goal/BaseGoal.h"
12#include "mc/world/level/Tick.h"
13
14// auto generated forward declare list
15// clang-format off
16class Actor;
18class BlockPos;
19class BlockSource;
21class Mob;
24class Path;
25namespace RamAttackGoalUtils { class RamGoalItemDropperInterface; }
26// clang-format on
27
28class RamAttackGoal : public ::BaseGoal {
29public:
30 // RamAttackGoal inner types declare
31 // clang-format off
32 struct AttackPos;
33 // clang-format on
34
35 // RamAttackGoal inner types define
36 enum class Direction : int {
37 North = 0,
38 South = 1,
39 West = 2,
40 East = 3,
41 };
42
43 enum class State : int {
44 TakeAttackPos = 0,
45 TurnToTarget = 1,
46 VerifyTargetStillInPosition = 2,
47 WaitOneSec = 3,
48 Charge = 4,
49 KnockAfterCharge = 5,
50 Done = 6,
51 };
52
53 struct AttackPos {
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<4, 12, ::Vec3> mPosition;
58 ::ll::TypedStorage<4, 4, float> mDistance;
59 ::ll::TypedStorage<1, 1, bool> mCheckX;
60 ::ll::TypedStorage<4, 4, ::RamAttackGoal::Direction> mDirection;
61 ::ll::TypedStorage<1, 1, bool> mHasChargePos;
62 // NOLINTEND
63 };
64
65public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
69 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Path>> mPath;
70 ::ll::TypedStorage<4, 12, ::Vec3> mPrepareChargePos;
71 ::ll::TypedStorage<4, 12, ::Vec3> mTargetPos;
72 ::ll::TypedStorage<4, 8, ::Vec2> mRamDirection;
73 ::ll::TypedStorage<8, 8, ::Tick> mWaitBeforeChargeTimer;
74 ::ll::TypedStorage<8, 8, ::Tick> mChargeTimeoutTimer;
75 ::ll::TypedStorage<8, 8, ::Tick> mKnockAfterChargeTimeoutTimer;
76 ::ll::TypedStorage<8, 8, ::Tick> mRamRetryTimeout;
77 ::ll::TypedStorage<4, 4, ::RamAttackGoal::State> mState;
78 ::ll::TypedStorage<8, 24, ::std::vector<::RamAttackGoal::AttackPos>> mAttackPosVector;
79 ::ll::TypedStorage<4, 4, int> mRamDistance;
80 ::ll::TypedStorage<4, 4, int> mMinRamDistance;
81 ::ll::TypedStorage<4, 4, float> mKnockbackForce;
82 ::ll::TypedStorage<4, 4, float> mKnockbackHeight;
83 ::ll::TypedStorage<4, 4, float> mBabyKnockbackModifier;
84 ::ll::TypedStorage<4, 4, float> mRunSpeed;
85 ::ll::TypedStorage<4, 4, float> mRamSpeed;
86 ::ll::TypedStorage<8, 24, ::std::vector<::ActorDefinitionTrigger>> mOnStartTriggers;
87 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mPreRamSound;
88 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mRamImpactSound;
89 ::ll::TypedStorage<4, 8, ::SharedTypes::FloatRange> mCooldownTime;
90 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mTargetId;
91 ::ll::TypedStorage<1, 1, bool> mHasKnockbacked;
92 ::ll::TypedStorage<8, 8, ::Tick> mCooldownTimeout;
93 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RamAttackGoalUtils::RamGoalItemDropperInterface>> mRamGoalItemDropper;
94 // NOLINTEND
95
96public:
97 // prevent constructor by default
98 RamAttackGoal& operator=(RamAttackGoal const&);
99 RamAttackGoal(RamAttackGoal const&);
100 RamAttackGoal();
101
102public:
103 // virtual functions
104 // NOLINTBEGIN
105 virtual void start() /*override*/;
106
107 virtual void stop() /*override*/;
108
109 virtual bool canUse() /*override*/;
110
111 virtual bool canContinueToUse() /*override*/;
112
113 virtual void tick() /*override*/;
114
115 virtual void appendDebugInfo(::std::string& str) const /*override*/;
116 // NOLINTEND
117
118public:
119 // member functions
120 // NOLINTBEGIN
121 MCAPI explicit RamAttackGoal(::Mob& mob);
122
123 MCAPI bool _hasChargePath();
124
125 MCAPI bool _initiateRamAttack();
126
127 MCAPI bool _pathablePos(::BlockSource const& region, ::BlockPos blockPos);
128
129 MCAPI void _resetCooldown();
130
131 MCAPI bool _setupAttackPosVector();
132
133 MCAPI bool _takeAttackPos(::NavigationComponent& navigation, ::LookControlComponent& lookControl, ::Actor& target);
134
135 MCAPI void _tryKnockbackTarget();
136
137 MCAPI bool _turnToTarget(::MoveControlComponent& moveControl) const;
138
139 MCAPI bool _verifyTargetStillInPositionAndPrepareForRamAttack();
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor(::Mob& mob);
146 // NOLINTEND
147
148public:
149 // virtual function thunks
150 // NOLINTBEGIN
151 MCAPI void $start();
152
153 MCAPI void $stop();
154
155 MCAPI bool $canUse();
156
157 MCAPI bool $canContinueToUse();
158
159 MCAPI void $tick();
160
161 MCAPI void $appendDebugInfo(::std::string& str) const;
162
163
164 // NOLINTEND
165
166public:
167 // vftables
168 // NOLINTBEGIN
169 MCNAPI static void** $vftable();
170 // NOLINTEND
171};
Definition ActorDefinitionTrigger.h:16
Definition Actor.h:125
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition LookControlComponent.h:16
Definition Mob.h:57
Definition MoveControlComponent.h:16
Definition NavigationComponent.h:22
Definition Path.h:16
Definition RamGoalItemDropperInterface.h:12
static MCAPI void ** $vftable()
Definition RamAttackGoal.h:53