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 struct FactorCalculationData {
36 public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<4, 4, int> mPaddingDuration;
40 ::ll::TypedStorage<4, 4, float> mFactorStart;
41 ::ll::TypedStorage<4, 4, float> mFactorTarget;
42 ::ll::TypedStorage<4, 4, float> mFactorCurrent;
43 ::ll::TypedStorage<8, 64, ::std::function<void(::MobEffect::FactorCalculationData&, ::EffectDuration)>>
44 mUpdateFn;
45 ::ll::TypedStorage<4, 4, int> mTicksActive;
46 ::ll::TypedStorage<4, 4, float> mFactorPreviousFrame;
47 ::ll::TypedStorage<1, 1, bool> mHadEffectLastTick;
48 ::ll::TypedStorage<1, 1, bool> mHadApplied;
49 // NOLINTEND
50
51 public:
52 // prevent constructor by default
53 FactorCalculationData(FactorCalculationData const&);
54 FactorCalculationData();
55
56 public:
57 // member functions
58 // NOLINTBEGIN
59 MCAPI ::MobEffect::FactorCalculationData& operator=(::MobEffect::FactorCalculationData const&);
60
61 MCAPI ::std::unique_ptr<::CompoundTag> save() const;
62
63 MCAPI ~FactorCalculationData();
64 // NOLINTEND
65
66 public:
67 // static functions
68 // NOLINTBEGIN
69 MCAPI static ::MobEffect::FactorCalculationData load(::CompoundTag const* tag);
70 // NOLINTEND
71
72 public:
73 // destructor thunk
74 // NOLINTBEGIN
75 MCFOLD void $dtor();
76 // NOLINTEND
77 };
78
79 using AttributeBuffPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeBuff>>;
80
81 using AttributeModPair = ::std::pair<::Attribute const*, ::std::shared_ptr<::AttributeModifier>>;
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 virtual ~MobEffect();
117
118 virtual void applyEffects(::Actor& target, ::EffectDuration durationTicks, int amplification) const;
119
120 virtual void removeEffects(::BaseAttributeMap& attributeMapToRemoveFrom);
121
122 virtual void onEffectExpired(::Actor&) const;
123
124 virtual void onActorDied(::Actor&, int) const;
125
126 virtual void onActorHurt(::Actor&, int, ::ActorDamageSource const&, float) const;
127
128 virtual void
129 applyInstantaneousEffect(::Actor* source, ::Actor* owner, ::Actor* target, int amplification, float scale) const;
130
131 virtual bool isInstantaneous() const;
132
133 virtual float getAttributeModifierValue(int amplifier, ::AttributeModifier const& modifier) const;
134 // NOLINTEND
135
136public:
137 // member functions
138 // NOLINTBEGIN
139 MCAPI MobEffect(
140 uint id,
141 ::std::string const& resourceName,
142 ::std::string const& locName,
143 bool isHarmful,
144 int color,
145 int icon,
146 ::std::string const& iconName,
147 bool drawParticles
148 );
149
150 MCAPI ::InstantaneousAttributeBuff
151 _createInstantBuff(::AttributeBuff const& baseBuff, int amplification, float scale) const;
152
153 MCAPI ::TemporalAttributeBuff
154 _createTemporalBuff(::AttributeBuff const& baseBuff, ::EffectDuration duration, int amplification) const;
155
156 MCAPI void _setParticleEffectIds(char const* particleEffectId, char const* particleEffectAmbientId);
157
158 MCAPI void addAttributeBuff(::Attribute const& attribute, ::std::shared_ptr<::AttributeBuff> buff);
159
160 MCAPI void addAttributeModifier(::Attribute const& attribute, ::std::shared_ptr<::AttributeModifier> modifier);
161
162 MCAPI void applyModsAndBuffs(
163 ::BaseAttributeMap& attributeMapToRemoveFrom,
164 ::EffectDuration durationTicks,
165 int amplification
166 ) const;
167
168 MCAPI_C ::std::string const& getIconName() const;
169
170 MCAPI void setDurationAmplifier(::std::shared_ptr<::Amplifier> amplifier);
171
172 MCAPI ::MobEffect& setFactorCalculationData(::MobEffect::FactorCalculationData const& factorCalculationData);
173
174 MCAPI void setValueAmplifier(::std::shared_ptr<::Amplifier> amplifier);
175
176 MCAPI void updateModsAndBuffs(
177 ::BaseAttributeMap& attributeMapToRemoveFrom,
178 ::EffectDuration durationTicks,
179 int amplification
180 ) const;
181 // NOLINTEND
182
183public:
184 // static functions
185 // NOLINTBEGIN
186 MCAPI static void
187 darknessEffectFactorUpdate(::MobEffect::FactorCalculationData& factorCalculationData, ::EffectDuration duration);
188
189 MCAPI_C static ::MobEffect* getById(uint effectId);
190
191 MCAPI static ::MobEffect* getByName(::std::string const& name);
192
193 MCAPI static ::MobEffect::FactorCalculationData getDarknessEffectFactorCalculationData();
194
195 MCAPI static void initEffects(::BaseGameVersion const& baseGameVersion, ::Experiments const& experiments);
196 // NOLINTEND
197
198public:
199 // static variables
200 // NOLINTBEGIN
201 MCAPI static ::MobEffect*& ABSORPTION();
202
203 MCAPI static ::MobEffect*& BAD_OMEN();
204
205 MCAPI static ::MobEffect*& BLINDNESS();
206
207 MCAPI static ::MobEffect*& CONDUIT_POWER();
208
209 MCAPI static ::MobEffect*& CONFUSION();
210
211 MCAPI static ::MobEffect*& DAMAGE_BOOST();
212
213 MCAPI static ::MobEffect*& DAMAGE_RESISTANCE();
214
215 MCAPI static ::MobEffect*& DARKNESS();
216
217 MCAPI static ::mce::Color const& DEFAULT_COLOR();
218
219 MCAPI static ::MobEffect*& DIG_SLOWDOWN();
220
221 MCAPI static ::MobEffect*& DIG_SPEED();
222
223 MCAPI static ::MobEffect*& EMPTY_EFFECT();
224
225 MCAPI static ::MobEffect*& FATAL_POISON();
226
227 MCAPI static ::MobEffect*& FIRE_RESISTANCE();
228
229 MCAPI static ::MobEffect*& HARM();
230
231 MCAPI static ::MobEffect*& HEAL();
232
233 MCAPI static ::MobEffect*& HEALTH_BOOST();
234
235 MCAPI static ::MobEffect*& HERO_OF_THE_VILLAGE();
236
237 MCAPI static ::MobEffect*& HUNGER();
238
239 MCAPI static ::MobEffect*& INFESTED();
240
241 MCAPI static ::MobEffect*& INVISIBILITY();
242
243 MCAPI static ::MobEffect*& JUMP();
244
245 MCAPI static ::MobEffect*& LEVITATION();
246
247 MCAPI static ::MobEffect*& MOVEMENT_SLOWDOWN();
248
249 MCAPI static ::MobEffect*& MOVEMENT_SPEED();
250
251 MCAPI static ::MobEffect*& NIGHT_VISION();
252
253 MCAPI static ::MobEffect*& OOZING();
254
255 MCAPI static ::MobEffect*& POISON();
256
257 MCAPI static ::MobEffect*& RAID_OMEN();
258
259 MCAPI static ::MobEffect*& REGENERATION();
260
261 MCAPI static ::MobEffect*& SATURATION();
262
263 MCAPI static ::MobEffect*& SLOW_FALLING();
264
265 MCAPI static ::MobEffect*& TRIAL_OMEN();
266
267 MCAPI static ::MobEffect*& WATER_BREATHING();
268
269 MCAPI static ::MobEffect*& WEAKNESS();
270
271 MCAPI static ::MobEffect*& WEAVING();
272
273 MCAPI static ::MobEffect*& WIND_CHARGED();
274
275 MCAPI static ::MobEffect*& WITHER();
276
277 MCAPI static ::std::add_lvalue_reference_t<::std::unique_ptr<::MobEffect>[]> mMobEffects();
278 // NOLINTEND
279
280public:
281 // constructor thunks
282 // NOLINTBEGIN
283 MCAPI void* $ctor(
284 uint id,
285 ::std::string const& resourceName,
286 ::std::string const& locName,
287 bool isHarmful,
288 int color,
289 int icon,
290 ::std::string const& iconName,
291 bool drawParticles
292 );
293 // NOLINTEND
294
295public:
296 // destructor thunk
297 // NOLINTBEGIN
298 MCAPI void $dtor();
299 // NOLINTEND
300
301public:
302 // virtual function thunks
303 // NOLINTBEGIN
304 MCAPI void $applyEffects(::Actor& target, ::EffectDuration durationTicks, int amplification) const;
305
306 MCAPI void $removeEffects(::BaseAttributeMap& attributeMapToRemoveFrom);
307
308 MCFOLD void $onEffectExpired(::Actor&) const;
309
310 MCFOLD void $onActorDied(::Actor&, int) const;
311
312 MCFOLD void $onActorHurt(::Actor&, int, ::ActorDamageSource const&, float) const;
313
314 MCAPI void
315 $applyInstantaneousEffect(::Actor* source, ::Actor* owner, ::Actor* target, int amplification, float scale) const;
316
317 MCFOLD bool $isInstantaneous() const;
318
319 MCAPI float $getAttributeModifierValue(int amplifier, ::AttributeModifier const& modifier) const;
320
321
322 // NOLINTEND
323
324public:
325 // vftables
326 // NOLINTBEGIN
327 MCAPI static void** $vftable();
328 // NOLINTEND
329};
Definition ActorDamageSource.h:18
Definition Actor.h:105
Definition Amplifier.h:5
Definition AttributeBuff.h:14
Definition AttributeModifier.h:10
Definition Attribute.h:9
Definition BaseAttributeMap.h:19
Definition BaseGameVersion.h:8
Definition CompoundTag.h:23
Definition Experiments.h:14
Definition InstantaneousAttributeBuff.h:9
Definition TemporalAttributeBuff.h:14
Definition EffectDuration.h:5
Definition MobEffect.h:35