1 #using scripts\codescripts\struct;
3 #using scripts\shared\exploder_shared;
4 #using scripts\shared\fx_shared;
5 #using scripts\shared\sound_shared;
7 #insert scripts\shared\shared.gsh;
9 #using scripts\zm\_util;
39 function gunfireloopfx(fxId, fxPos, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax)
41 thread
gunfireloopfxthread (fxId, fxPos, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax);
44 function gunfireloopfxthread (fxId, fxPos, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax)
46 level endon (
"stop all gunfireloopfx");
49 if (betweenSetsMax < betweenSetsMin)
51 temp = betweenSetsMax;
52 betweenSetsMax = betweenSetsMin;
53 betweenSetsMin = temp;
56 betweenSetsBase = betweenSetsMin;
57 betweenSetsRange = betweenSetsMax - betweenSetsMin;
59 if (shotdelayMax < shotdelayMin)
62 shotdelayMax = shotdelayMin;
66 shotdelayBase = shotdelayMin;
67 shotdelayRange = shotdelayMax - shotdelayMin;
69 if (shotsMax < shotsMin)
77 shotsRange = shotsMax - shotsMin;
79 fxEnt = spawnFx( level._effect[fxId], fxPos );
82 shotnum = shotsBase + randomint (shotsRange);
83 for (i=0;i<shotnum;i++)
87 wait (shotdelayBase + randomfloat (shotdelayRange));
89 wait (betweenSetsBase + randomfloat(betweenSetsRange));
93 function gunfireloopfxVec(fxId, fxPos, fxPos2, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax)
95 thread
gunfireloopfxVecthread (fxId, fxPos, fxPos2, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax);
98 function gunfireloopfxVecthread (fxId, fxPos, fxPos2, shotsMin, shotsMax, shotdelayMin, shotdelayMax, betweenSetsMin, betweenSetsMax)
100 level endon (
"stop all gunfireloopfx");
103 if (betweenSetsMax < betweenSetsMin)
105 temp = betweenSetsMax;
106 betweenSetsMax = betweenSetsMin;
107 betweenSetsMin = temp;
110 betweenSetsBase = betweenSetsMin;
111 betweenSetsRange = betweenSetsMax - betweenSetsMin;
113 if (shotdelayMax < shotdelayMin)
116 shotdelayMax = shotdelayMin;
120 shotdelayBase = shotdelayMin;
121 shotdelayRange = shotdelayMax - shotdelayMin;
123 if (shotsMax < shotsMin)
130 shotsBase = shotsMin;
131 shotsRange = shotsMax - shotsMin;
133 fxPos2 = vectornormalize (fxPos2 - fxPos);
135 fxEnt = spawnFx ( level._effect[fxId], fxPos, fxPos2 );
139 shotnum = shotsBase + randomint (shotsRange);
140 for (i=0;i<int(shotnum/level.fxfireloopmod);i++)
143 delay =((shotdelayBase + randomfloat (shotdelayRange))*level.fxfireloopmod);
148 wait (shotdelayBase + randomfloat (shotdelayRange));
149 wait (betweenSetsBase + randomfloat(betweenSetsRange));
155 playfx (level._effect[
"mechanical explosion"], pos);