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

Function SpawnRaygunSmoke

TombEngine/Objects/TR5/Entity/HeavyGuard.cpp:101–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 };
100
101 const void SpawnRaygunSmoke(const Vector3& pos, const EulerAngles& orient, float life)
102 {
103 auto& smoke = *GetFreeParticle();
104
105 float scale = (life * 12) * phd_cos(orient.x);
106
107 smoke.on = true;
108 smoke.blendMode = BlendMode::Additive;
109
110 smoke.x = pos.x;
111 smoke.y = pos.y;
112 smoke.z = pos.z;
113 smoke.xVel = Random::GenerateInt(-25, 25);
114 smoke.yVel = life * 3;
115 smoke.zVel = Random::GenerateInt(-25, 25);
116 smoke.sB = (Random::GenerateInt(128, 256) * life) / 16;
117 smoke.sR =
118 smoke.sG = smoke.sB - (smoke.sB / 4);
119 smoke.dR = 0;
120 smoke.dB = (Random::GenerateInt(32, 160) * life) / 16;
121 smoke.dG =
122 smoke.dB / 4;
123
124 smoke.colFadeSpeed = Random::GenerateInt(8, 12);
125 smoke.fadeToBlack = 8;
126 smoke.sLife =
127 smoke.life = Random::GenerateFloat(24.0f, 28.0f);
128
129 smoke.friction = 0;
130 smoke.rotAng = Random::GenerateAngle(0, ANGLE(22.5f));
131 smoke.rotAdd = Random::GenerateAngle(ANGLE(-0.35f), ANGLE(0.35f));
132 smoke.gravity = Random::GenerateAngle(ANGLE(0.175f), ANGLE(0.35f));
133 smoke.maxYvel = 0;
134 smoke.scalar = 1;
135 smoke.size =
136 smoke.sSize = scale;
137 smoke.dSize = 1;
138 smoke.flags = SP_SCALE | SP_DEF | SP_ROTATE | SP_EXPDEF;
139 }
140
141 const void FireHeavyGuardRaygun(ItemInfo& item, bool isRight, bool noLaser)
142 {

Callers 1

FireHeavyGuardRaygunFunction · 0.85

Calls 6

GetFreeParticleFunction · 0.85
phd_cosFunction · 0.85
GenerateIntFunction · 0.85
GenerateFloatFunction · 0.85
GenerateAngleFunction · 0.85
ANGLEFunction · 0.85

Tested by

no test coverage detected