1#ifndef FS_RUNEEFFECTS_H
2#define FS_RUNEEFFECTS_H
3
4struct RuneEffectLayer
5{
6 RuneEffectLayer() = default;
7
8 RuneEffectLayer(std::string texture, uint16_t effectId,
9 float offsetX, float offsetY,
10 float speed, float scale, float opacity, std::string color,
11 float flicker, float colorShift, int32_t drawOrder, bool behind) :
12 texture(std::move(texture)), effectId(effectId),
13 offsetX(offsetX), offsetY(offsetY),
14 speed(speed), scale(scale), opacity(opacity), color(std::move(color)),
15 flicker(flicker), colorShift(colorShift), drawOrder(drawOrder), behind(behind) {}
16
17 std::string texture;
18 uint16_t effectId = 0;
19 float offsetX = 0.0f;
20 float offsetY = 0.0f;
21 float speed = 0.5f;
22 float scale = 1.0f;
23 float opacity = 0.8f;
24 std::string color = "#ffffff";
25 float flicker = 0.0f;
26 float colorShift = 0.0f;
27 int32_t drawOrder = 0;
28 bool behind = true;
29};
30
31struct RuneEffect
32{
33 RuneEffect(uint8_t id, std::string name, std::string image,
34 uint16_t effectId,
35 float speed, float scale, float opacity, std::string color,
36 std::string layer, float glow, float colorShift, float noise,
37 float scanlines, float flicker,
38 int32_t bonusLoot, int32_t bonusDamage, int32_t bonusSpeed, int32_t bonusXp,
39 int32_t damageInterval, int32_t damageDelay,
40 bool premium) :
41 name(std::move(name)), image(std::move(image)), color(std::move(color)),
42 layer(std::move(layer)),
43 speed(speed), scale(scale), opacity(opacity),
44 glow(glow), colorShift(colorShift), noise(noise),
45 scanlines(scanlines), flicker(flicker),
46 bonusLoot(bonusLoot), bonusDamage(bonusDamage),
47 bonusSpeed(bonusSpeed), bonusXp(bonusXp),
48 damageInterval(damageInterval > 0 ? damageInterval : 2000),
49 damageDelay(damageDelay > 0 ? damageDelay : 200),
50 id(id), effectId(effectId), premium(premium) {}
51
52 std::string name;
53 std::string image;
54 std::string color;
55 std::string layer;
56 float speed;
57 float scale;
58 float opacity;
59 float glow;
60 float colorShift;
61 float noise;
62 float scanlines;
63 float flicker;
64 int32_t bonusLoot;
65 int32_t bonusDamage;
66 int32_t bonusSpeed;
67 int32_t bonusXp;
68 int32_t damageInterval;
69 int32_t damageDelay;
70 uint8_t id;
71 uint16_t effectId;
72 bool premium;
73
74 // Multi-layer support
75 std::vector<RuneEffectLayer> layers;
76
77 bool hasLayers() const { return !layers.empty(); }
78};
79
80class RuneEffects
81{
82 public:
83 bool reload();
84 bool loadFromXml();
85 RuneEffect* getRuneEffectByID(uint8_t id);
86 RuneEffect* getRuneEffectByName(const std::string& name);
87
88 const std::vector<RuneEffect>& getRuneEffects() const {
89 return runeEffects;
90 }
91
92 private:
93 std::vector<RuneEffect> runeEffects;
94};
95
96#endif
97