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

Function SpawnCyborgSpark

TombEngine/Game/effects/spark.cpp:238–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236 }
237
238 void SpawnCyborgSpark(const Vector3& pos)
239 {
240 auto& spark = *GetFreeParticle();
241
242 int velSign = -1;
243 int randomInt = Random::GenerateInt();
244
245 spark.sR = -1;
246 spark.sG = -1;
247 spark.sB = -1;
248 spark.dR = -1;
249 spark.dG = (randomInt & 167) + 64;
250 spark.dB = 192 - spark.dG;
251 spark.on = 1;
252 spark.colFadeSpeed = 3;
253 spark.fadeToBlack = 5;
254 spark.life = 10;
255 spark.sLife = 10;
256 spark.blendMode = BlendMode::Additive;
257 spark.friction = 34;
258 spark.scalar = 2;
259 spark.x = (randomInt & 7) + pos.x - 3;
260 spark.y = ((randomInt >> 3) & 7) + pos.y - 3;
261 spark.z = ((randomInt >> 6) & 7) + pos.z - 3;
262 spark.xVel = (int)(((randomInt >> 2) & 0xFF) + velSign - 128);
263 spark.yVel = (int)(((randomInt >> 4) & 0xFF) + velSign - 128);
264 spark.zVel = (int)(((randomInt >> 6) & 0xFF) + velSign - 128);
265 spark.flags = SP_SCALE;
266 spark.size = ((randomInt >> 9) & 3) + 4;
267 spark.sSize = ((randomInt >> 9) & 3) + 4;
268 spark.dSize = ((randomInt >> 12) & 1) + 1;
269 spark.maxYvel = 0;
270 spark.gravity = 0;
271 }
272}

Callers 2

CyborgControlFunction · 0.85
SpawnElectricEffectFunction · 0.85

Calls 2

GetFreeParticleFunction · 0.85
GenerateIntFunction · 0.85

Tested by

no test coverage detected