MCPcopy Create free account
hub / github.com/TurningWheel/Barony / createParticleDropRising

Function createParticleDropRising

src/magic/actmagic.cpp:10371–10405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10369}
10370
10371void createParticleDropRising(Entity* parent, int sprite, double scale)
10372{
10373 if ( !parent )
10374 {
10375 return;
10376 }
10377
10378 for ( int c = 0; c < 50; c++ )
10379 {
10380 // shoot drops to the sky
10381 Entity* entity = newEntity(sprite, 1, map.entities, nullptr); //Particle entity.
10382 entity->sizex = 1;
10383 entity->sizey = 1;
10384 entity->x = parent->x - 4 + local_rng.rand() % 9;
10385 entity->y = parent->y - 4 + local_rng.rand() % 9;
10386 entity->z = 7.5 + local_rng.rand() % 50;
10387 entity->vel_z = -1;
10388 //entity->yaw = (local_rng.rand() % 360) * PI / 180.0;
10389 entity->particleDuration = 10 + local_rng.rand() % 50;
10390 entity->scalex *= scale;
10391 entity->scaley *= scale;
10392 entity->scalez *= scale;
10393 entity->behavior = &actParticleDot;
10394 entity->flags[PASSABLE] = true;
10395 entity->flags[NOUPDATE] = true;
10396 entity->flags[UNCLICKABLE] = true;
10397 entity->lightBonus = vec4(*cvar_magic_fx_light_bonus, *cvar_magic_fx_light_bonus,
10398 *cvar_magic_fx_light_bonus, 0.f);
10399 if ( multiplayer != CLIENT )
10400 {
10401 entity_uids--;
10402 }
10403 entity->setUID(-3);
10404 }
10405}
10406
10407Entity* createParticleTimer(Entity* parent, int duration, int sprite)
10408{

Callers 15

actDeathGhostFunction · 0.85
actPlayerFunction · 0.85
actMonsterFunction · 0.85
item_PotionWaterFunction · 0.85
actSinkFunction · 0.85
lichIceAnimateFunction · 0.85
lichIceCreateCannonMethod · 0.85
lichFireAnimateFunction · 0.85
applyLockpickMethod · 0.85
applyOrbMethod · 0.85
effectTimesMethod · 0.85
handleEffectsMethod · 0.85

Calls 4

newEntityFunction · 0.85
vec4Class · 0.85
randMethod · 0.80
setUIDMethod · 0.80

Tested by

no test coverage detected