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