Git Repos / fte_dogmode / qc / misc / explobox.qc
Last update to this file was on 2024-07-03 at 07:20.
Show explobox.qc
//==============================================================================
// misc_explobox
//==============================================================================
//======================================================================
// constants
//======================================================================
#if defined(CSQC) || defined(SSQC)
enumflags
{
MISC_EXPLOBOX_NET_ORIGIN, // origin has changed
MISC_EXPLOBOX_NET_MODEL // model has changed
};
#endif
//======================================================================
// forward declarations
//======================================================================
// base_explobox
#ifdef CSQC
void(float isnew) base_explobox_netreceive;
#endif
#ifdef SSQC
float(entity to, float netflags) base_explobox_netsend;
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 = ReadFloat ();
if (netflags & MISC_EXPLOBOX_NET_ORIGIN)
{
self.origin_x = ReadCoord ();
self.origin_y = ReadCoord ();
self.origin_z = ReadCoord ();
}
if (netflags & MISC_EXPLOBOX_NET_MODEL)
self.modelindex = ReadFloat ();
if (isnew)
if (self.classtype == CT_MISC_EXPLOBOX)
misc_explobox_init (self);
else if (self.classtype == CT_MISC_EXPLOBOX2)
misc_explobox2_init (self);
};
#endif
#ifdef SSQC
//--------------------------------------------------------------
float(entity to, float netflags) base_explobox_netsend =
{
WriteShort (MSG_ENTITY, self.classtype);
WriteFloat (MSG_ENTITY, netflags);
if (netflags & MISC_EXPLOBOX_NET_ORIGIN)
{
WriteCoord (MSG_ENTITY, self.origin_x);
WriteCoord (MSG_ENTITY, self.origin_y);
WriteCoord (MSG_ENTITY, self.origin_z);
}
if (netflags & MISC_EXPLOBOX_NET_MODEL)
WriteFloat (MSG_ENTITY, self.modelindex);
return TRUE;
};
//--------------------------------------------------------------
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",
VOL_HIGH, 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);
};
#endif
#if defined(CSQC) || defined(SSQC)
//--------------------------------------------------------------
void(entity e) base_explobox_init =
{
#ifdef SSQC
e.destroy = base_explobox_destroy;
#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;
base_explobox_init (e);
e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
#ifdef CSQC
// setmodelindex will take care of size (mins & maxs) -- CEV
e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
setmodelindex (e, e.modelindex);
setorigin (e, e.origin);
e.drawmask = DRAWMASK_NORMAL;
#endif
#ifdef SSQC
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);
}
e.SendEntity = base_explobox_netsend;
e.SendFlags = e.SendFlags | MISC_EXPLOBOX_NET_ORIGIN |
MISC_EXPLOBOX_NET_MODEL;
#endif
};
#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;
base_explobox_init (e);
e.solid = SOLID_BBOX;
e.movetype = MOVETYPE_NONE;
#ifdef CSQC
e.solid = SOLID_BSP;
e.movetype = MOVETYPE_PUSH;
setmodelindex (e, e.modelindex);
setorigin (e, e.origin);
e.drawmask = DRAWMASK_NORMAL;
#endif
#ifdef SSQC
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);
}
e.SendEntity = base_explobox_netsend;
e.SendFlags = e.SendFlags | MISC_EXPLOBOX_NET_ORIGIN |
MISC_EXPLOBOX_NET_MODEL;
#endif
};
#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
Date | Commit Message | Author | + | - |
---|---|---|---|---|
2024-07-03 | pmove changes and fixes, improved climbing | cev | +1 | -1 |
2024-06-15 | Major update, committing as-is, will have bugs | cev | +123 | -1 |
2024-04-12 | Moveable gibs, heads, some bugfixes | cev | +2 | -2 |
2024-03-24 | 2nd pass refactor, rework QC class structure | cev | +101 | -52 |
2024-02-18 | Client/player, projectiles, entrypoints refactor | cev | +9 | -6 |
2024-01-31 | Class based monster refactor & start projectiles | cev | +3 | -1 |
2024-01-09 | Continue OO / Class-based refactor | cev | +18 | -22 |
2023-12-09 | Start OO / class-based refactor, work on items | cev | +76 | -61 |
2023-12-02 | More refactoring & moving, begin adding mdls & snd | cev | +93 |
Return to the top of this page or return to the overview of this repo.