MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / do_endsequence_fx

Function do_endsequence_fx

scripts/Merc3.cpp:2146–2200  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

2144
2145///////////////////////////////////////////////////////////////////////////////
2146void do_endsequence_fx(char fx_type, int handle) {
2147 uint16_t id;
2148 float time, size, speed, bloblife, blobint;
2149 int killflags = 0x60; // fireballs and breaks apart on death
2150
2151 // do fx based on type
2152 switch (fx_type) {
2153 case 0: // death+anim??0x200020 = fireball death and delayed death.
2154 Obj_Value(handle, VF_GET, OBJV_US_ID, &id);
2155 if ((rand() % 4) >= 2) {
2156 killflags |= 0x4; // sparklers when dying.
2157 } else {
2158 killflags |= 0x200000;
2159 }
2160 // killflags = 0x8000;
2161 // aObjKill(handle,2,1, killflags, 0.2f,0.7f);
2162 aObjDestroy(handle);
2163 break;
2164
2165 case 1: // spew
2166 case 2: // big spew
2167 case 3: // huge spew
2168 if (fx_type == 1) {
2169 bloblife = 4.0f;
2170 blobint = 0.15f;
2171 time = 10.0f;
2172 size = 12.0f;
2173 speed = 30.0f;
2174 } else if (fx_type == 2) {
2175 bloblife = 6.0f;
2176 blobint = 0.20f;
2177 time = 15.0f;
2178 size = 18.0f;
2179 speed = 30.0f;
2180 } else if (fx_type == 3) {
2181 bloblife = 6.0f;
2182 blobint = 0.20f;
2183 time = 15.0f;
2184 size = 22.0f;
2185 speed = 30.0f;
2186 }
2187
2188 aTurnOnSpew(handle, -1, 2, 0.0f, 0.0f, 0x10000, 0, bloblife, blobint, time, size, speed, 1, -1);
2189 break;
2190
2191 case 4: // spark!
2192 bloblife = 1.5f;
2193 blobint = 1.0f;
2194 time = 8.0f;
2195 size = 6.0f;
2196 speed = 40.0f;
2197 aTurnOnSpew(handle, -1, 15, 0.0f, 0.0f, 0x10000, 0, bloblife, blobint, time, size, speed, 1, -1);
2198 break;
2199 }
2200}
2201
2202/*
2203$$ACTION

Callers 1

cEndSequenceFrameFunction · 0.85

Calls 3

Obj_ValueFunction · 0.85
aObjDestroyFunction · 0.85
aTurnOnSpewFunction · 0.85

Tested by

no test coverage detected