info_areadef: Add primitive entity.

dispenser: add Death() method
This commit is contained in:
Marco Cawthorne 2022-07-10 11:24:40 -07:00
parent 22b968c6e6
commit d375315027
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
3 changed files with 88 additions and 0 deletions

View File

@ -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

View File

@ -0,0 +1,75 @@
/*
* Copyright (c) 2022 Marco Cawthorne <marco@icculus.org>
*
* 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)
{
}

View File

@ -34,6 +34,7 @@ vox.qc
info_player_teamspawn.qc
item_tfgoal.qc
info_tfgoal.qc
info_areadef.qc
gamerules.qc
client.qc