LeviLamina
Loading...
Searching...
No Matches
ProjectileComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/comprehensive/ParticleType.h"
7#include "mc/deps/core/math/Vec3.h"
8#include "mc/deps/shared_types/legacy/Difficulty.h"
9#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
10#include "mc/legacy/ActorUniqueID.h"
11#include "mc/world/actor/ActorDefinitionTrigger.h"
12#include "mc/world/actor/ActorType.h"
13#include "mc/world/actor/TempEPtr.h"
14#include "mc/world/actor/projectile/ProjectileAnchor.h"
15#include "mc/world/level/BlockPos.h"
16#include "mc/world/phys/HitResult.h"
17
18// auto generated forward declare list
19// clang-format off
20class Actor;
22class BaseGameVersion;
23class CompoundTag;
24class DataLoadHelper;
25class Level;
27class Vec2;
28// clang-format on
29
31public:
32 // ProjectileComponent inner types define
33 enum class EAxis : int {
34 None = -1,
35 X = 0,
36 Y = 1,
37 Z = 2,
38 };
39
40public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<1, 1, bool> mWasOnGround;
44 ::ll::TypedStorage<1, 1, bool> mNoPhysics;
45 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mOwnerId;
46 ::ll::TypedStorage<4, 12, ::Vec3> mThrownPos;
47 ::ll::TypedStorage<4, 12, ::Vec3> mApexPos;
48 ::ll::TypedStorage<1, 1, bool> mFoundApex;
49 ::ll::TypedStorage<4, 4, int> mLife;
50 ::ll::TypedStorage<4, 4, int> mTickCount;
51 ::ll::TypedStorage<4, 4, int> mFlightTime;
52 ::ll::TypedStorage<4, 4, int> mOnGroundTime;
53 ::ll::TypedStorage<4, 4, int> mShakeTime;
54 ::ll::TypedStorage<4, 12, ::BlockPos> mBlock;
55 ::ll::TypedStorage<4, 12, ::BlockPos> mStuckToBlockPos;
56 ::ll::TypedStorage<4, 12, ::Vec3> mCollisionPos;
57 ::ll::TypedStorage<4, 4, int> mEnchantPower;
58 ::ll::TypedStorage<4, 4, int> mEnchantImpaler;
59 ::ll::TypedStorage<8, 112, ::HitResult> mHitResult;
60 ::ll::TypedStorage<1, 1, uchar> mHitFacing;
61 ::ll::TypedStorage<1, 1, bool> mReflect;
62 ::ll::TypedStorage<4, 4, int> mReflectImmunityTicks;
63 ::ll::TypedStorage<4, 4, float> mPower;
64 ::ll::TypedStorage<4, 4, float> mDamage;
65 ::ll::TypedStorage<4, 12, ::Vec3> mOffset;
66 ::ll::TypedStorage<4, 4, ::ParticleType> mHitParticle;
67 ::ll::TypedStorage<4, 4, float> mGravity;
68 ::ll::TypedStorage<4, 4, float> mUpwardsAngleOffset;
69 ::ll::TypedStorage<8, 24, ::std::vector<::OnHitSubcomponent*>> mOnHitCommands;
70 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnHitEvent;
71 ::ll::TypedStorage<4, 4, float> mUncertaintyBase;
72 ::ll::TypedStorage<4, 4, float> mUncertaintyMultiplier;
73 ::ll::TypedStorage<4, 4, ::ActorType> mFilterType;
74 ::ll::TypedStorage<4, 4, float> mOnFireTime;
75 ::ll::TypedStorage<4, 4, int> mPotionEffect;
76 ::ll::TypedStorage<4, 4, float> mSplashRange;
77 ::ll::TypedStorage<1, 1, bool> mKnockback;
78 ::ll::TypedStorage<4, 4, float> mKnockbackForce;
79 ::ll::TypedStorage<1, 1, bool> mCatchFire;
80 ::ll::TypedStorage<1, 1, bool> mChanneling;
81 ::ll::TypedStorage<1, 1, bool> mIsSplash;
82 ::ll::TypedStorage<4, 4, float> mInertiaMod;
83 ::ll::TypedStorage<4, 4, float> mLiquidInertia;
84 ::ll::TypedStorage<1, 1, bool> mSemiRandomDiffDamage;
85 ::ll::TypedStorage<4, 4, ::ProjectileAnchor> mSpawnPosAnchor;
86 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mHitEntitySound;
87 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mHitGroundSound;
88 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mShootSound;
89 ::ll::TypedStorage<1, 1, bool> mIsDangerous;
90 ::ll::TypedStorage<1, 1, bool> mShootTarget;
91 ::ll::TypedStorage<1, 1, bool> mDamageOwner;
92 ::ll::TypedStorage<1, 1, bool> mReflectOnHurt;
93 ::ll::TypedStorage<1, 1, bool> mDestroyOnHurt;
94 ::ll::TypedStorage<1, 1, bool> mStopOnHurt;
95 ::ll::TypedStorage<1, 1, bool> mCritParticleOnHurt;
96 ::ll::TypedStorage<1, 1, bool> mHitWater;
97 ::ll::TypedStorage<1, 1, bool> mHitActor;
98 ::ll::TypedStorage<1, 1, bool> mMultipleHits;
99 ::ll::TypedStorage<4, 4, int> mPiercingEnchantLevel;
100 ::ll::TypedStorage<4, 4, int> mActorHitCount;
101 ::ll::TypedStorage<8, 24, ::std::vector<::ActorType>> mIgnoredEntities;
102 ::ll::TypedStorage<1, 1, bool> mHitNearestPassenger;
103 ::ll::TypedStorage<1, 1, bool> mIsHoming;
104 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingTargetID;
105 ::ll::TypedStorage<8, 40, ::TempEPtr<::Actor>> mTarget;
106 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mTargetID;
107 ::ll::TypedStorage<4, 12, ::Vec3> mTargetDelta;
108 ::ll::TypedStorage<4, 4, int> mFlightSteps;
109 ::ll::TypedStorage<4, 4, ::ProjectileComponent::EAxis> mCurrentMoveDirection;
110 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastReflectActor;
111 ::ll::TypedStorage<1, 1, bool> mShouldBounce;
112 ::ll::TypedStorage<4, 4, uint> mCurrentDelay;
113 ::ll::TypedStorage<1, 1, bool> mWaitingForServer;
114 ::ll::TypedStorage<1, 1, bool> mWaitingForServerHitGround;
115 ::ll::TypedStorage<8, 112, ::HitResult> mCachedHitResult;
116 ::ll::TypedStorage<1, 1, bool> mDelayOneFrame;
117 // NOLINTEND
118
119public:
120 // prevent constructor by default
121 ProjectileComponent& operator=(ProjectileComponent const&);
122
123public:
124 // member functions
125 // NOLINTBEGIN
126 MCAPI ProjectileComponent();
127
129
131
132 MCAPI ::std::tuple<::BlockPos, float>
133 _getInitialTargetParams(::Actor const& owner, ::TempEPtr<::Actor> target) const;
134
135 MCAPI void _handleLightningOnHit(::Actor& owner);
136
137 MCAPI void _selectNextMoveDirection(::Actor const& owner, ::ProjectileComponent::EAxis avoidAxis);
138
139 MCAPI bool _tryReflect(::Actor& owner, ::Level& level);
140
141 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
142
143 MCAPI float computeCollisionMargin(::BaseGameVersion const& baseGameVersion);
144
145 MCAPI ::HitResult getCachedHitResult() const;
146
147 MCAPI ::HitResult getHitResult() const;
148
149 MCAPI ::Vec3 getShooterAngle(::Actor& shooter) const;
150
151 MCAPI float getUncertainty(::SharedTypes::Legacy::Difficulty diff) const;
152
153 MCAPI void handleMovementGravity(::Actor& owner);
154
155 MCAPI void handleMovementHoming(::Actor& owner);
156
157 MCAPI void hurt(::Actor& owner, ::ActorDamageSource const& damageSource);
158
159 MCAPI void initFromDefinition(::Actor& owner);
160
161 MCAPI void lerpMotion(::Actor& owner, ::Vec3 const& delta);
162
163 MCAPI void onHit(::Actor& owner, ::HitResult const& res);
164
165 MCAPI ::ProjectileComponent& operator=(::ProjectileComponent&&);
166
167 MCAPI void readAdditionalSaveData(::Actor&, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
168
169 MCAPI void setHitResult(::HitResult result);
170
171 MCAPI void shoot(::Actor& owner, ::Actor& shooter);
172
173 MCAPI void
174 shoot(::Actor& owner, ::Vec3 const& dir, float pow, float uncertainty, ::Vec3 const& baseSpeed, ::Actor* target);
175
176 MCAPI ~ProjectileComponent();
177 // NOLINTEND
178
179public:
180 // static functions
181 // NOLINTBEGIN
182 MCAPI static ::Vec2 dampenShooterAngle(::Vec2 const& angle, float angleOffset, ::BaseGameVersion const& currVer);
183 // NOLINTEND
184
185public:
186 // constructor thunks
187 // NOLINTBEGIN
188 MCAPI void* $ctor();
189
190 MCAPI void* $ctor(::ProjectileComponent&&);
191
192 MCAPI void* $ctor(::ProjectileComponent const&);
193 // NOLINTEND
194
195public:
196 // destructor thunk
197 // NOLINTBEGIN
198 MCAPI void $dtor();
199 // NOLINTEND
200};
Definition ActorDamageSource.h:18
Definition Actor.h:103
Definition BaseGameVersion.h:8
Definition CompoundTag.h:13
Definition DataLoadHelper.h:20
Definition HitResult.h:19
Definition Level.h:239
Definition OnHitSubcomponent.h:12
Definition ProjectileComponent.h:30
Definition TempEPtr.h:6
Definition Vec2.h:5
Definition Vec3.h:10