nuclide/Source/gs-entbase/server/item_food.cpp
Marco Hladik 7c15bed7bb Flashlight: Add the HUD indicator in the 'valve' base
Rewolf: Preparing initial work
Effects: Added Gib-Human effect
CBaseEntity: Make sure things that are hidden can't be damaged by default. E.g. func_breakables that are hidden
func_door_rotating: Minor tweak saving us a few bytes
item_food/sodacan: Make bounding box bigger, fix classname check to apply to "player", not "Player" (TW leftover)
Damage_Radius: Fix how damage radius checks for brush based entities.

Scientist Hunt specific stuff:
- impulse 103 test cvar added to destroy everything around the map
- scientists can be gibbed
- scientists scream when falling
- new cvar sh_scialert that spawn scientists alerted
- new cvar sh_scispeed that is mirrored from the original mod
- new cvar sh_scimax that will limit the amount of scientists spawned by the shdata system
- new cvar sh_sciyaw that will randomize the spawn yaw angle when there's no other specified
2019-03-09 15:50:11 +01:00

61 lines
1.1 KiB
C++

/***
*
* Copyright (c) 2016-2019 Marco 'eukara' Hladik. All rights reserved.
*
* See the file LICENSE attached with the sources for usage details.
*
****/
class item_food
{
int m_iIsCan;
void() item_food;
virtual void() Setup;
virtual void() Touch;
};
void item_food :: Touch ( void )
{
if ( other.classname != "player" ) {
return;
}
if ( owner != __NULL__ ) {
env_beverage bevOwner = (env_beverage)owner;
bevOwner.m_iReady = TRUE;
}
Damage_Apply(other, this, -1, other.origin, FALSE);
solid = SOLID_NOT;
remove( this );
}
void item_food :: Setup ( void )
{
solid = SOLID_TRIGGER;
setsize( this, '-16 -16 -16', '16 16 16' );
touch = Touch;
if ( m_iIsCan ) {
sound( this, CHAN_ITEM, "weapons/g_bounce3.wav", 1.0f, ATTN_NORM );
}
}
void item_food :: item_food ( void )
{
// TODO: differentiate between item_sodacan and item_food
m_iIsCan = 1;
solid = SOLID_NOT;
movetype = MOVETYPE_TOSS;
if ( m_iIsCan ) {
setmodel( this, "models/can.mdl" );
}
setsize( this, '0 0 0', '0 0 0' );
think = Setup;
nextthink = time + 1.0f;
}
CLASSEXPORT( item_sodacan, item_food )