MCPcopy Create free account
hub / github.com/crossuo/crossuo / Update

Method Update

src/GameObjects/GameEffect.cpp:61–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void CGameEffect::Update(CGameObject *parent)
62{
63 if (EffectType != EF_MOVING)
64 {
65 if (Duration < g_Ticks)
66 {
67 if (parent != nullptr)
68 {
69 parent->RemoveEffect(this);
70 }
71 else
72 {
73 g_EffectManager.RemoveEffect(this);
74 }
75 }
76 else if (LastChangeFrameTime < g_Ticks)
77 {
78 LastChangeFrameTime = g_Ticks + Speed;
79
80 if (EffectType == EF_LIGHTING)
81 {
82 AnimIndex++;
83
84 if (AnimIndex >= 10)
85 {
86 if (parent != nullptr)
87 {
88 parent->RemoveEffect(this);
89 }
90 else
91 {
92 g_EffectManager.RemoveEffect(this);
93 }
94 }
95 }
96 else
97 {
98 CalculateCurrentGraphic();
99 }
100 }
101 }
102 else if (LastChangeFrameTime < g_Ticks)
103 {
104 LastChangeFrameTime = g_Ticks + Speed;
105
106 CalculateCurrentGraphic();
107 }
108}
109
110uint16_t CGameEffect::CalculateCurrentGraphic()
111{

Callers 1

UpdateEffectsMethod · 0.45

Calls 1

RemoveEffectMethod · 0.45

Tested by

no test coverage detected