diff --git a/src/server/dispenser.qc b/src/server/dispenser.qc index d6e21fb..51a4d39 100644 --- a/src/server/dispenser.qc +++ b/src/server/dispenser.qc @@ -44,8 +44,18 @@ TFCDispenser:NSSurfacePropEntity virtual int(void) GrabRockets; virtual int(void) GrabCells; virtual int(void) GrabArmor; + + virtual void(void) Death; }; +void +TFCDispenser::Death(void) +{ + env_message_single(real_owner, "#Dispenser_destroyed"); + FX_Explosion(origin); + Destroy(); +} + int TFCDispenser::GrabShells(void) { @@ -245,6 +255,8 @@ TFCDispenser::TFCDispenser(void) SetSolid(SOLID_BBOX); SetMovetype(MOVETYPE_NONE); SetSize([-16,-16,0], [16,16,48]); + SetHealth(150); + SetTakedamage(DAMAGE_YES); } void diff --git a/src/server/info_areadef.qc b/src/server/info_areadef.qc new file mode 100644 index 0000000..7776009 --- /dev/null +++ b/src/server/info_areadef.qc @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Marco Cawthorne + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/*QUAKED info_areadef (0 0 0.8) (-16 -16 -36) (16 16 36) + +TEAM FORTRESS (1996) ENTITY + +Describes an area's bounds and description/name. + +-------- KEYS -------- +"targetname" : Name +"areaname" : Name of the specified area +"mins" : Mins of the area's bounding box +"maxs" : Maxs of the area's bounding box +*/ + +class +info_areadef:NSPointTrigger +{ + string m_strDescription; + vector m_vecMins; + vector m_vecMaxs; + + void(void) info_areadef; + + virtual void(void) Respawn; + virtual void(string,string) SpawnKey; +}; + +void +info_areadef::SpawnKey(string strKey, string strValue) +{ + switch (strKey) { + case "areaname": + m_strDescription = strValue; + break; + case "mins": + m_vecMins = stov(strValue); + break; + case "maxs": + m_vecMaxs = stov(strValue); + break; + default: + super::SpawnKey(strKey, strValue); + } +} + +void +info_areadef::Respawn(void) +{ + /* set up our volume */ + SetSolid(SOLID_TRIGGER); + SetMovetype(MOVETYPE_NONE); + SetOrigin(GetSpawnOrigin()); + SetSize(m_vecMins, m_vecMaxs); +} + +void +info_areadef::info_areadef(void) +{ + +} \ No newline at end of file diff --git a/src/server/progs.src b/src/server/progs.src index 8b40094..e1e79a6 100644 --- a/src/server/progs.src +++ b/src/server/progs.src @@ -34,6 +34,7 @@ vox.qc info_player_teamspawn.qc item_tfgoal.qc info_tfgoal.qc +info_areadef.qc gamerules.qc client.qc