djcev.com

//

Git Repos / fte_dogmode / qc / func / explobox.qc

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

Show explobox.qc

//==============================================================================
// func_explobox -- selections from Rubicon 2 qc by john fitzgibbons
//==============================================================================

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

// func_explobox
#ifdef SSQC
void() func_explobox_explode_silent;
void(vector dir) func_explobox_destroy;
// void() func_explobox_think;
void(entity e) func_explobox_init;
void() func_explobox;
#endif

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

/*QUAKED func_explobox (0 .5 .8) ? START_OFF 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

An exploding brush entity. Works just like misc_explobox.

Keys:

"health" Default 20

"dmg" default 100

*/
//----------------------------------------------------------------------
// class func_explobox: base_func
// {
#ifdef SSQC
//--------------------------------------------------------------
void() func_explobox_explode_silent =
{
self.takedamage = DAMAGE_NO;
self.origin = ((self.absmin + self.absmax) * 0.5);
t_radiusdamage2 (self, self, self.dmg, world);
write_explosion (self.origin);
// BecomeExplosion
spawn_base_explosion (self.origin);
remove (self);
};

//--------------------------------------------------------------
void(vector dir) func_explobox_destroy =
{
// for some reason, time + 0.2 doesn't work
self.think = func_explobox_explode_silent;
self.nextthink = 0.2;
};

//--------------------------------------------------------------
/*
void() func_explobox_think =
{
// sound (this, CHAN_VOICE, "weapons/r_exp3.wav",
// VOL_HIGH, ATTN_NORM);
func_explobox_explode_silent ();
};
*/

//--------------------------------------------------------------
void(entity e) func_explobox_init =
{
e.classname = "func_explobox";
e.classtype = CT_FUNC_EXPLOBOX;
base_func_init (e);

e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
setmodel (e, e.model);
precache_sound ("weapons/r_exp3.wav");

if (!e.health)
e.health = 20;

if (!e.dmg)
e.dmg = 100;

e.destroy = func_explobox_destroy;
e.takedamage = DAMAGE_AIM;
};

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

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

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

Log explobox.qc

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