djcev.com

//

Git Repos / fte_dogmode / qc / misc / particlespray.qc

Last update to this file was on 2024-06-15 at 19:50.

Show particlespray.qc

//==============================================================================
// misc_particlespray -- Particle Sprayer
// this is from Custents not Rubicon2 -- dumptruck_ds
// renamed from func to misc
//==============================================================================

//======================================================================
// fields
//======================================================================

#ifdef SSQC
.float endtime;
.float duration;
#endif

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
// misc_particlespray
void() misc_particlespray_think;
void() misc_particlespray_use;
void(entity e) misc_particlespray_init;
void() misc_particlespray;
#endif

//------------------------------------------------------------------------------

/*QUAKED misc_particlespray (0 .5 .8) (-8 -8 -8) (8 8 8) X X X X X X X X NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
Shoots particles either when triggered, or contiuously when not triggered by anything.
"color" is the palette color of the particles

"count" is the number of particles to make each time

"delay" is the delay between each triggering

"noise" is the name of the wav file to play when triggered

"movedir" is the vector distance that the particles will travel before disappearing. (in x y z)

"duration" is the amount of time that the it will continue to release particles so that it can release a long stream of particles with only one triggering.
*/
//----------------------------------------------------------------------
// class misc_particlespray: base_mapentity
// {
#ifdef SSQC
//--------------------------------------------------------------
void() misc_particlespray_think =
{
particle (self.origin, self.movedir, self.color, self.count);

if (!self.targetname || self.endtime > time)
self.nextthink = time + self.delay;

if (self.noise != "")
sound (self, CHAN_AUTO, self.noise,
VOL_HIGH, ATTN_NORM);
else
sound (self, CHAN_AUTO, "misc/null.wav",
VOL_HIGH, ATTN_NORM);
};

//--------------------------------------------------------------
void() misc_particlespray_use =
{
if (self.targetname != __NULL__ && self.targetname != "")
return;

self.endtime = time + self.duration;
misc_particlespray_think ();
};

//--------------------------------------------------------------
void(entity e) misc_particlespray_init =
{
e.classname = "particlespray";
e.classtype = CT_MISC_PARTICLESPRAY;
base_mapentity_init (e);

if (!e.color)
e.color = 47;

if (e.count <= 0)
e.count = 15;

if (e.delay <= 0)
e.delay = 0.1;

if (e.noise != "")
precache_sound (e.noise);
precache_sound ("misc/null.wav");

e.think = misc_particlespray_think;

if (!e.targetname)
e.nextthink = time + 0.1 + e.delay;
else
e.use = misc_particlespray_use;
};

//--------------------------------------------------------------
void() misc_particlespray =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

misc_particlespray_init (self);
};
#endif
// };

Return to the top of this page or return to the overview of this repo.

Log particlespray.qc

Date Commit Message Author + -
2024-06-15 Major update, committing as-is, will have bugs cev +10 -2
2024-03-24 2nd pass refactor, rework QC class structure cev +58 -44
2024-01-31 Class based monster refactor & start projectiles cev +2 -2
2024-01-09 Continue OO / Class-based refactor cev +29 -15
2023-12-09 Start OO / class-based refactor, work on items cev +56 -56
2023-11-27 Code reorg, minor movement changes, misc cev +76  

Return to the top of this page or return to the overview of this repo.