djcev.com

//

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

Last update to this file was on 2024-04-12 at 18:56.

Show explobox.qc

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

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

// base_explobox
void(vector dir) base_explobox_destroy;
void(entity e) base_explobox_init;
strip void() base_explobox;

// misc_explobox
void(entity e) misc_explobox_init;
void() misc_explobox;

// misc_explobox2
void(entity e) misc_explobox2_init;
void() misc_explobox2;

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

//----------------------------------------------------------------------
// class base_explobox: base_mapentity
// {
//--------------------------------------------------------------
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, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
particle (self.origin, '0 0 0', 75, 255);

self.origin_z = self.origin_z + 32;

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

//--------------------------------------------------------------
void(entity e) base_explobox_init =
{
e.destroy = base_explobox_destroy;
base_mapentity_init (e);
};

//--------------------------------------------------------------
void() base_explobox =
{
base_explobox_init (self);
};
// };

/*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
// {
//--------------------------------------------------------------
void(entity e) misc_explobox_init =
{
e.classname = "misc_explobox";
e.classtype = CT_MISC_EXPLOBOX;

base_explobox_init (e);

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
precache_model ("maps/b_explob.bsp");
setmodel (e, "maps/b_explob.bsp");
precache_sound ("weapons/r_exp3.wav");
e.health = 20;
e.takedamage = DAMAGE_AIM;
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten
// TODO CEV
// e.touch = monster_touch;

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);
}
};

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

misc_explobox_init (self);
};
// };

/*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
// {
//--------------------------------------------------------------
void(entity e) misc_explobox2_init =
{
e.classname = "misc_explobox2";
e.classtype = CT_MISC_EXPLOBOX2;

base_explobox_init (e);

e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
precache_model2 ("maps/b_exbox2.bsp");
setmodel (e, "maps/b_exbox2.bsp");
precache_sound ("weapons/r_exp3.wav");
e.health = 20;
e.takedamage = DAMAGE_AIM;
// 1998-09-16 Sliding/not-jumping on monsters/boxes/players
// fix by Maddes/Kryten
// TODO CEV
// e.touch = monster_touch;

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);
}
};

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

misc_explobox2_init (self);
};
// };

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.