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

Function TriggerAttackFlame

TombEngine/Game/effects/effects.cpp:1944–1981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1942}
1943
1944void TriggerAttackFlame(const Vector3i& pos, const Vector3& color, int scale)
1945{
1946 auto& spark = *GetFreeParticle();
1947
1948 spark.on = true;
1949 spark.sR = 0;
1950 spark.sG = 0;
1951 spark.sB = 0;
1952 spark.dR = color.x;
1953 spark.dG = color.y;
1954 spark.dB = color.z;
1955 spark.fadeToBlack = 8;
1956 spark.colFadeSpeed = Random::GenerateInt(4, 8);
1957 spark.blendMode = BlendMode::Additive;
1958 spark.life = Random::GenerateInt(20, 28);
1959 spark.sLife = spark.life;
1960 spark.x = pos.x + Random::GenerateInt(-8, 8);
1961 spark.y = pos.y;
1962 spark.z = pos.z + Random::GenerateInt(-8, 8);
1963 spark.xVel = Random::GenerateInt(-128, 128);
1964 spark.yVel = 0;
1965 spark.zVel = Random::GenerateInt(-128, 128);
1966 spark.friction = 5;
1967 spark.flags = SP_EXPDEF | SP_DEF | SP_SCALE;
1968 spark.rotAng = Random::GenerateInt(0, 4096); // NOTE: Effect angles use [0, 4096] range.
1969
1970 if (TestProbability(1 / 2.0f))
1971 spark.rotAdd = -32 - (GetRandomControl() & 0x1F);
1972 else
1973 spark.rotAdd = (GetRandomControl() & 0x1F) + 32;
1974
1975 spark.maxYvel = 0;
1976 spark.gravity = Random::GenerateInt(16, 48);
1977 spark.scalar = 2;
1978 spark.size = Random::GenerateInt(0, 16) + scale;
1979 spark.sSize = spark.size;
1980 spark.dSize = spark.size / 4;
1981}
1982
1983void SpawnCreatureGunEffect(const ItemInfo& item, const CreatureMuzzleFlashInfo& muzzleFlash)
1984{

Callers 2

DoHarpyEffectsFunction · 0.85
SethAttackFunction · 0.85

Calls 4

GetFreeParticleFunction · 0.85
GenerateIntFunction · 0.85
TestProbabilityFunction · 0.85
GetRandomControlFunction · 0.85

Tested by

no test coverage detected