LeviLamina
Loading...
Searching...
No Matches
MobEffect.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Color.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
14class Amplifier;
15class Attribute;
16class AttributeBuff;
19class BaseGameVersion;
20class CompoundTag;
21class Experiments;
24struct EffectDuration;
25// clang-format on
26
27class MobEffect {
28public:
29 // MobEffect inner types declare
30 // clang-format off
32 // clang-format on
33
34 // MobEffect inner types define
35 using AttributeBuffPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeBuff>>;
36
37 using AttributeModPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeModifier>>;
38
40 public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<4, 4, int> mPaddingDuration;
44 ::ll::TypedStorage<4, 4, float> mFactorStart;
45 ::ll::TypedStorage<4, 4, float> mFactorTarget;
46 ::ll::TypedStorage<4, 4, float> mFactorCurrent;
47 ::ll::TypedStorage<8, 64, ::std::function<void(::MobEffect::FactorCalculationData&, ::EffectDuration)>>
48 mUpdateFn;
49 ::ll::TypedStorage<4, 4, int> mTicksActive;
50 ::ll::TypedStorage<4, 4, float> mFactorPreviousFrame;
51 ::ll::TypedStorage<1, 1, bool> mHadEffectLastTick;
52 ::ll::TypedStorage<1, 1, bool> mHadApplied;
53 // NOLINTEND
54
55 public:
56 // prevent constructor by default
59
60 public:
61 // member functions
62 // NOLINTBEGIN
63 MCNAPI ::MobEffect::FactorCalculationData& operator=(::MobEffect::FactorCalculationData const&);
64
65 MCNAPI ::std::unique_ptr<::CompoundTag> save() const;
66
68 // NOLINTEND
69
70 public:
71 // static functions
72 // NOLINTBEGIN
73 MCNAPI static ::MobEffect::FactorCalculationData load(::CompoundTag const* tag);
74 // NOLINTEND
75
76 public:
77 // destructor thunk
78 // NOLINTBEGIN
79 MCNAPI void $dtor();
80 // NOLINTEND
81 };
82
83public:
84 // member variables
85 // NOLINTBEGIN
86 ::ll::TypedStorage<4, 4, uint const> mId;
87 ::ll::TypedStorage<1, 1, bool> mIsHarmful;
88 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
89 ::ll::TypedStorage<8, 48, ::HashedString> mParticleEffectId;
90 ::ll::TypedStorage<8, 48, ::HashedString> mParticleEffectAmbientId;
91 ::ll::TypedStorage<8, 32, ::std::string> mDescriptionId;
92 ::ll::TypedStorage<4, 4, int> mIcon;
93 ::ll::TypedStorage<4, 4, float> mDurationModifier;
94 ::ll::TypedStorage<1, 1, bool> mIsDisabled;
95 ::ll::TypedStorage<8, 32, ::std::string> mResourceName;
96 ::ll::TypedStorage<8, 32, ::std::string> mIconName;
97 ::ll::TypedStorage<1, 1, bool> mEffectVisible;
98 ::ll::TypedStorage<4, 8, ::std::optional<::SharedTypes::Legacy::LevelSoundEvent>> mOnApplySound;
99 ::ll::TypedStorage<8, 48, ::HashedString> mComponentName;
100 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Amplifier>> mValueAmplifier;
101 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::Amplifier>> mDurationAmplifier;
102 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeBuff>>>>
103 mAttributeBuffs;
104 ::ll::TypedStorage<8, 24, ::std::vector<::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeModifier>>>>
105 mAttributeModifiers;
106 ::ll::TypedStorage<8, 96, ::MobEffect::FactorCalculationData> mFactorCalculationData;
107 // NOLINTEND
108
109public:
110 // prevent constructor by default
111 MobEffect();
112
113public:
114 // virtual functions
115 // NOLINTBEGIN
116 // vIndex: 0
117 virtual ~MobEffect();
118
119 // vIndex: 1
120 virtual void applyEffects(::Actor& target, ::EffectDuration durationTicks, int amplification) const;
121
122 // vIndex: 2
123 virtual void removeEffects(::BaseAttributeMap& attributeMapToRemoveFrom);
124
125 // vIndex: 3
126 virtual void onEffectExpired(::Actor&) const;
127
128 // vIndex: 4
129 virtual void onActorDied(::Actor&, int) const;
130
131 // vIndex: 5
132 virtual void onActorHurt(::Actor&, int, ::ActorDamageSource const&, float) const;
133
134 // vIndex: 6
135 virtual void
136 applyInstantaneousEffect(::Actor* source, ::Actor* owner, ::Actor* target, int amplification, float scale) const;
137
138 // vIndex: 7
139 virtual bool isInstantaneous() const;
140
141 // vIndex: 8
142 virtual float getAttributeModifierValue(int amplifier, ::AttributeModifier const& modifier) const;
143 // NOLINTEND
144
145public:
146 // member functions
147 // NOLINTBEGIN
148 MCAPI MobEffect(
149 uint id,
150 ::std::string const& resourceName,
151 ::std::string const& locName,
152 bool isHarmful,
153 int color,
154 int icon,
155 ::std::string const& iconName,
156 bool drawParticles
157 );
158
159 MCAPI ::InstantaneousAttributeBuff
160 _createInstantBuff(::AttributeBuff const& baseBuff, int amplification, float scale) const;
161
162 MCAPI ::TemporalAttributeBuff
163 _createTemporalBuff(::AttributeBuff const& baseBuff, ::EffectDuration duration, int amplification) const;
164
165 MCAPI void _setParticleEffectIds(char const* particleEffectId, char const* particleEffectAmbientId);
166
167 MCAPI void addAttributeBuff(::Attribute const& attribute, ::std::shared_ptr<::AttributeBuff> buff);
168
169 MCAPI void addAttributeModifier(::Attribute const& attribute, ::std::shared_ptr<::AttributeModifier> modifier);
170
171 MCAPI void applyModsAndBuffs(
172 ::BaseAttributeMap& attributeMapToRemoveFrom,
173 ::EffectDuration durationTicks,
174 int amplification
175 ) const;
176
177 MCAPI void setDurationAmplifier(::std::shared_ptr<::Amplifier> amplifier);
178
179 MCAPI ::MobEffect& setFactorCalculationData(::MobEffect::FactorCalculationData const& factorCalculationData);
180
181 MCAPI ::MobEffect& setOnApplySound(::SharedTypes::Legacy::LevelSoundEvent onApplySound);
182
183 MCAPI void setValueAmplifier(::std::shared_ptr<::Amplifier> amplifier);
184
185 MCAPI void updateModsAndBuffs(
186 ::BaseAttributeMap& attributeMapToRemoveFrom,
187 ::EffectDuration durationTicks,
188 int amplification
189 ) const;
190 // NOLINTEND
191
192public:
193 // static functions
194 // NOLINTBEGIN
195 MCAPI static void
196 darknessEffectFactorUpdate(::MobEffect::FactorCalculationData& factorCalculationData, ::EffectDuration duration);
197
198 MCAPI static ::MobEffect* getByName(::std::string const& name);
199
200 MCAPI static ::MobEffect::FactorCalculationData getDarknessEffectFactorCalculationData();
201
202 MCAPI static void initEffects(::BaseGameVersion const& baseGameVersion, ::Experiments const& experiments);
203 // NOLINTEND
204
205public:
206 // static variables
207 // NOLINTBEGIN
208 MCAPI static ::MobEffect*& ABSORPTION();
209
210 MCAPI static ::MobEffect*& BAD_OMEN();
211
212 MCAPI static ::MobEffect*& BLINDNESS();
213
214 MCAPI static ::MobEffect*& CONDUIT_POWER();
215
216 MCAPI static ::MobEffect*& CONFUSION();
217
218 MCAPI static ::MobEffect*& DAMAGE_BOOST();
219
220 MCAPI static ::MobEffect*& DAMAGE_RESISTANCE();
221
222 MCAPI static ::MobEffect*& DARKNESS();
223
224 MCAPI static ::mce::Color const& DEFAULT_COLOR();
225
226 MCAPI static ::MobEffect*& DIG_SLOWDOWN();
227
228 MCAPI static ::MobEffect*& DIG_SPEED();
229
230 MCAPI static ::MobEffect*& EMPTY_EFFECT();
231
232 MCAPI static ::MobEffect*& FATAL_POISON();
233
234 MCAPI static ::MobEffect*& FIRE_RESISTANCE();
235
236 MCAPI static ::MobEffect*& HARM();
237
238 MCAPI static ::MobEffect*& HEAL();
239
240 MCAPI static ::MobEffect*& HEALTH_BOOST();
241
242 MCAPI static ::MobEffect*& HERO_OF_THE_VILLAGE();
243
244 MCAPI static ::MobEffect*& HUNGER();
245
246 MCAPI static ::MobEffect*& INFESTED();
247
248 MCAPI static ::MobEffect*& INVISIBILITY();
249
250 MCAPI static ::MobEffect*& JUMP();
251
252 MCAPI static ::MobEffect*& LEVITATION();
253
254 MCAPI static ::MobEffect*& MOVEMENT_SLOWDOWN();
255
256 MCAPI static ::MobEffect*& MOVEMENT_SPEED();
257
258 MCAPI static ::MobEffect*& NIGHT_VISION();
259
260 MCAPI static ::MobEffect*& OOZING();
261
262 MCAPI static ::MobEffect*& POISON();
263
264 MCAPI static ::MobEffect*& RAID_OMEN();
265
266 MCAPI static ::MobEffect*& REGENERATION();
267
268 MCAPI static ::MobEffect*& SATURATION();
269
270 MCAPI static ::MobEffect*& SLOW_FALLING();
271
272 MCAPI static ::MobEffect*& TRIAL_OMEN();
273
274 MCAPI static ::MobEffect*& WATER_BREATHING();
275
276 MCAPI static ::MobEffect*& WEAKNESS();
277
278 MCAPI static ::MobEffect*& WEAVING();
279
280 MCAPI static ::MobEffect*& WIND_CHARGED();
281
282 MCAPI static ::MobEffect*& WITHER();
283
284 MCAPI static ::std::add_lvalue_reference_t<::std::unique_ptr<::MobEffect>[]> mMobEffects();
285 // NOLINTEND
286
287public:
288 // constructor thunks
289 // NOLINTBEGIN
290 MCAPI void* $ctor(
291 uint id,
292 ::std::string const& resourceName,
293 ::std::string const& locName,
294 bool isHarmful,
295 int color,
296 int icon,
297 ::std::string const& iconName,
298 bool drawParticles
299 );
300 // NOLINTEND
301
302public:
303 // destructor thunk
304 // NOLINTBEGIN
305 MCAPI void $dtor();
306 // NOLINTEND
307
308public:
309 // virtual function thunks
310 // NOLINTBEGIN
311 MCAPI void $applyEffects(::Actor& target, ::EffectDuration durationTicks, int amplification) const;
312
313 MCAPI void $removeEffects(::BaseAttributeMap& attributeMapToRemoveFrom);
314
315 MCFOLD void $onEffectExpired(::Actor&) const;
316
317 MCFOLD void $onActorDied(::Actor&, int) const;
318
319 MCFOLD void $onActorHurt(::Actor&, int, ::ActorDamageSource const&, float) const;
320
321 MCAPI void
322 $applyInstantaneousEffect(::Actor* source, ::Actor* owner, ::Actor* target, int amplification, float scale) const;
323
324 MCFOLD bool $isInstantaneous() const;
325
326 MCAPI float $getAttributeModifierValue(int amplifier, ::AttributeModifier const& modifier) const;
327 // NOLINTEND
328
329public:
330 // vftables
331 // NOLINTBEGIN
332 MCNAPI static void** $vftable();
333 // NOLINTEND
334};
Definition ActorDamageSource.h:18
Definition Actor.h:103
Definition Amplifier.h:5
Definition AttributeBuff.h:14
Definition AttributeModifier.h:10
Definition Attribute.h:9
Definition BaseAttributeMap.h:16
Definition BaseGameVersion.h:8
Definition CompoundTag.h:13
Definition Experiments.h:14
Definition InstantaneousAttributeBuff.h:9
Definition MobEffect.h:27
static MCAPI void ** $vftable()
Definition TemporalAttributeBuff.h:14
Definition EffectDuration.h:5
Definition MobEffect.h:39
MCAPI ::std::unique_ptr<::CompoundTag > save() const
static MCAPI ::MobEffect::FactorCalculationData load(::CompoundTag const *tag)
MCAPI::MobEffect::FactorCalculationData & operator=(::MobEffect::FactorCalculationData const &)