MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / ShockwaveRingControl

Function ShockwaveRingControl

TombEngine/Objects/Effects/Boss.cpp:108–132  ·  view source on GitHub ↗

NOTE: Ring and explosion wave rotate and scale by default.

Source from the content-addressed store, hash-verified

106
107 // NOTE: Ring and explosion wave rotate and scale by default.
108 void ShockwaveRingControl(int itemNumber)
109 {
110 auto& item = g_Level.Items[itemNumber];
111
112 // Entity life.
113 if (item.ItemFlags[0] > 0)
114 item.ItemFlags[0]--;
115
116 if (item.ItemFlags[0] <= 0)
117 {
118 auto colorEnd = Vector4(item.Model.Color.x - 0.1f, item.Model.Color.y - 0.1f, item.Model.Color.z - 0.1f, item.Model.Color.w);
119 item.Model.Color = Vector4::Lerp(item.Model.Color, colorEnd, 0.35f);
120
121 if (item.Model.Color.x <= 0.0f &&
122 item.Model.Color.y <= 0.0f &&
123 item.Model.Color.z <= 0.0f)
124 {
125 RemoveActiveItem(itemNumber);
126 KillItem(itemNumber);
127 }
128 }
129
130 item.Model.Mutators[0].Scale += Vector3::One;
131 UpdateItemRoom(itemNumber);
132 }
133
134 void ShockwaveExplosionControl(int itemNumber)
135 {

Callers

nothing calls this directly

Calls 5

LerpFunction · 0.85
RemoveActiveItemFunction · 0.85
KillItemFunction · 0.85
UpdateItemRoomFunction · 0.85
Vector4Function · 0.50

Tested by

no test coverage detected