djcev.com

//

Git Repos / fte_dogmode / qc / misc / explobox.qc

Last update to this file was on 2025-08-13 at 05:20.

Show explobox.qc

//==============================================================================
// misc_explobox
//==============================================================================

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

// base_explobox
#ifdef CSQC
void(float isnew) base_explobox_netreceive;
float() base_explobox_predraw;
#endif
#ifdef SSQC
void(vector dir) base_explobox_destroy;
#endif
#if defined(CSQC) || defined(SSQC)
void(entity e) base_explobox_init;
#endif
#ifdef SSQC
strip void() base_explobox;
#endif

// misc_explobox
#if defined(CSQC) || defined(SSQC)
void(entity e) misc_explobox_init;
#endif
#ifdef SSQC
void() misc_explobox;
#endif

// misc_explobox2
#if defined(CSQC) || defined(SSQC)
void(entity e) misc_explobox2_init;
#endif
#ifdef SSQC
void() misc_explobox2;
#endif

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

//----------------------------------------------------------------------
// class base_explobox: base_mapentity
// {
#ifdef CSQC
//--------------------------------------------------------------
void(float isnew) base_explobox_netreceive =
{
local float netflags = base_entity_netreceive (isnew);

if (isnew && !(self.predraw))
{
if (self.classtype == CT_MISC_EXPLOBOX)
misc_explobox_init (self);
else if (self.classtype == CT_MISC_EXPLOBOX2)
misc_explobox2_init (self);
}
else
{
if (netflags & NETFLAG_BASE_ENTITY_MODEL)
{
setmodelindex (self, self.modelindex);

if (self.modelindex)
self.drawmask = DRAWMASK_NORMAL;
else
self.drawmask = DRAWMASK_NONE;
}

if (netflags & NETFLAG_BASE_ENTITY_SOLID)
{
if (self.solid)
setsize (self, self.mins, self.maxs);
else
setsize (self, '0 0 0', '0 0 0');

if (!(netflags & NETFLAG_BASE_ENTITY_ORIGIN))
setorigin (self, self.origin);
}

if (netflags & NETFLAG_BASE_ENTITY_ORIGIN)
setorigin (self, self.origin);
}
};

//--------------------------------------------------------------
float() base_explobox_predraw =
{
addentity (self);
return PREDRAW_NEXT;
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
void(vector dir) base_explobox_destroy =
{
self.takedamage = DAMAGE_NO;
self.classname = "explo_box";
// did say self.owner
t_radiusdamage2 (self, self, 160, world);
SOUND (self, snd_weapon_rocket_explosion)
particle (self.origin, '0 0 0', 75, 255);

self.origin_z = self.origin_z + 32;

// BecomeExplosion
spawn_base_explosion (self.origin);
remove (self);
};
#endif

#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_explobox_init =
{
#ifdef CSQC
// setmodelindex will take care of size (mins & maxs) -- CEV
e.drawmask = DRAWMASK_NORMAL;
e.predraw = base_explobox_predraw;
setmodelindex (e, e.modelindex);
setorigin (e, e.origin);
#endif

#ifdef SSQC
e.th_destroy = base_explobox_destroy;
e.SendEntity = base_entity_netsend;
e.SendFlags = NETFLAG_BASE_ENTITY_FULLSEND;
#endif

base_mapentity_init (e);
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
void() base_explobox =
{
base_explobox_init (self);
};
#endif
// };

/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64) 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
{
model("maps/b_explob.bsp");
}
Explosive box
*/
//----------------------------------------------------------------------
// class misc_explobox: base_explobox
// {
#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_explobox_init =
{
e.classname = "misc_explobox";
e.classtype = CT_MISC_EXPLOBOX;

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;

#ifdef SSQC
precache_model ("maps/b_explob.bsp");
setmodel (e, "maps/b_explob.bsp");
precache_sound (snd_weapon_rocket_explosion.wav);
e.health = 20;
e.takedamage = DAMAGE_AIM;

e.origin_z = e.origin_z + 2;
local float oldz = e.origin_z;
droptofloor ();
if (oldz - e.origin_z > 250)
{
dprint (sprintf("misc_explobox_init: item fell out "
"of level at %v\n", e.origin));
remove (e);
}
#endif

base_explobox_init (e);
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
void() misc_explobox =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

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

/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64) 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
{
model("maps/b_exbox2.bsp");
}
Smaller explosive box
*/
//----------------------------------------------------------------------
// class misc_explobox2: base_explobox
// {
#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) misc_explobox2_init =
{
e.classname = "misc_explobox2";
e.classtype = CT_MISC_EXPLOBOX2;

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;

#ifdef SSQC
precache_model2 ("maps/b_exbox2.bsp");
setmodel (e, "maps/b_exbox2.bsp");
precache_sound (snd_weapon_rocket_explosion.wav);
e.health = 20;
e.takedamage = DAMAGE_AIM;

e.origin_z = e.origin_z + 2;
local float oldz = e.origin_z;
droptofloor ();
if (oldz - e.origin_z > 250)
{
dprint (sprintf("misc_explobox2_init: item fell out "
"of level at %v\n", e.origin));
remove (e);
}
#endif

base_explobox_init (e);
};
#endif

#ifdef SSQC
//--------------------------------------------------------------
void() misc_explobox2 =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

misc_explobox2_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.