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

Function TriggerFlashSmoke

TombEngine/Game/effects/effects.cpp:1462–1514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1460}
1461
1462void TriggerFlashSmoke(int x, int y, int z, short roomNumber)
1463{
1464 auto* room = &g_Level.Rooms[roomNumber];
1465
1466 bool water = false;
1467 if (TestEnvironment(ENV_FLAG_WATER, room))
1468 {
1469 TriggerExplosionBubble(x, y, z, roomNumber);
1470 water = true;
1471 }
1472
1473 auto* spark = &SmokeSparks[GetFreeSmokeSpark()];
1474 spark->on = true;
1475 spark->sShade = 0;
1476 spark->dShade = -128;
1477 spark->colFadeSpeed = 4;
1478 spark->fadeToBlack = 16;
1479 spark->blendMode = BlendMode::Additive;
1480 spark->life = spark->sLife = (GetRandomControl() & 0xF) + 64;
1481 spark->position.x = (GetRandomControl() & 0x1F) + x - 16;
1482 spark->position.y = (GetRandomControl() & 0x1F) + y - 16;
1483 spark->position.z = (GetRandomControl() & 0x1F) + z - 16;
1484
1485 if (water)
1486 {
1487 spark->velocity.x = spark->velocity.y = GetRandomControl() & 0x3FF - 512;
1488 spark->velocity.z = (GetRandomControl() & 0x3FF) - 512;
1489 spark->friction = 68;
1490 }
1491 else
1492 {
1493 spark->velocity.x = 2 * (GetRandomControl() & 0x3FF) - 1024;
1494 spark->velocity.y = -512 - (GetRandomControl() & 0x3FF);
1495 spark->velocity.z = 2 * (GetRandomControl() & 0x3FF) - 1024;
1496 spark->friction = 85;
1497 }
1498
1499 if (TestEnvironment(ENV_FLAG_WIND, room))
1500 spark->flags = 272;
1501 else
1502 spark->flags = 16;
1503
1504 spark->rotAng = GetRandomControl() & 0xFFF;
1505 if (GetRandomControl() & 1)
1506 spark->rotAdd = -16 - (GetRandomControl() & 0xF);
1507 else
1508 spark->rotAdd = (GetRandomControl() & 0xF) + 16;
1509
1510 spark->maxYvel = 0;
1511 spark->gravity = 0;
1512 spark->sSize = spark->size = (GetRandomControl() & 0x1F) + 64;
1513 spark->dSize = 2 * (spark->sSize + 4);
1514}
1515
1516void TriggerFireFlame(int x, int y, int z, FlameType type, const Vector3& color1, const Vector3& color2)
1517{

Callers 2

ControlBodyPartFunction · 0.85
EmitFromProjectileFunction · 0.85

Calls 4

TestEnvironmentFunction · 0.85
TriggerExplosionBubbleFunction · 0.85
GetFreeSmokeSparkFunction · 0.85
GetRandomControlFunction · 0.85

Tested by

no test coverage detected