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

Function TriggerAttackSpark

TombEngine/Game/effects/spark.cpp:202–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 }
201
202 void TriggerAttackSpark(const Vector3& basePos, const Vector3& color)
203 {
204 auto& spark = *GetFreeParticle();
205
206 auto sphere = BoundingSphere(basePos, BLOCK(1));
207 auto pos = Random::GeneratePointInSphere(sphere);
208 auto vel = (basePos - pos) * 8;
209
210 spark.on = true;
211 spark.sR = 0;
212 spark.sG = 0;
213 spark.sB = 0;
214 spark.dR = color.x;
215 spark.dG = color.y;
216 spark.dB = color.z;
217 spark.life = 16;
218 spark.sLife = 16;
219 spark.colFadeSpeed = 4;
220 spark.blendMode = BlendMode::Additive;
221 spark.fadeToBlack = 4;
222 spark.x = (int)round(pos.x);
223 spark.y = (int)round(pos.y);
224 spark.z = (int)round(pos.z);
225 spark.xVel = (int)round(vel.x);
226 spark.yVel = (int)round(vel.y);
227 spark.zVel = (int)round(vel.z);
228 spark.friction = 34;
229 spark.maxYvel = 0;
230 spark.gravity = 0;
231 spark.scalar = 2;
232 spark.dSize =
233 spark.sSize =
234 spark.size = Random::GenerateInt(44, 48);
235 spark.flags = SP_NONE;
236 }
237
238 void SpawnCyborgSpark(const Vector3& pos)
239 {

Callers 4

RomanStatueControlFunction · 0.85
DoHarpyEffectsFunction · 0.85
SethAttackFunction · 0.85
WraithTrapControlFunction · 0.85

Calls 3

GetFreeParticleFunction · 0.85
GeneratePointInSphereFunction · 0.85
GenerateIntFunction · 0.85

Tested by

no test coverage detected