Added item_suit and item_longjump... they do not do anything interesting yet. Decals: Added glass break decals upon impact Damage: Brush-entity radius damage should to work better now Also seperated the weapons table from generic weapon entry functions. This should make maintaining mods easier Fixed references from sv_clientslots to sv_playerslots. My brain gets confused between the Quake games at this point. I blame FTE Fixed sprite animation cycle length check. It attempted to play one more frame than any sprite ever has. Needs more heavy testing?
61 lines
1.2 KiB
C++
61 lines
1.2 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_suit:CBaseTrigger
|
|
{
|
|
void() item_suit;
|
|
|
|
virtual void() touch;
|
|
virtual void() Respawn;
|
|
};
|
|
|
|
void item_suit::touch(void)
|
|
{
|
|
if (other.classname == "player") {
|
|
player pl = (player)other;
|
|
if (pl.g_items & ITEM_SUIT) {
|
|
return;
|
|
}
|
|
sound(other, CHAN_ITEM, "fvox/bell.wav", 1, ATTN_NORM);
|
|
sound(other, CHAN_VOICE, "fvox/hev_logon.wav", 1, ATTN_NORM);
|
|
pl.g_items |= ITEM_SUIT;
|
|
|
|
CBaseTrigger::UseTargets();
|
|
|
|
if (cvar("sv_playerslots") == 1) {
|
|
remove(self);
|
|
} else {
|
|
Hide();
|
|
think = Respawn;
|
|
nextthink = time + 30.0f;
|
|
}
|
|
}
|
|
}
|
|
|
|
void item_suit::Respawn(void)
|
|
{
|
|
solid = SOLID_TRIGGER;
|
|
movetype = MOVETYPE_TOSS;
|
|
setsize(this, VEC_HULL_MIN, VEC_HULL_MAX);
|
|
setorigin(this, m_oldOrigin);
|
|
setmodel(this, m_oldModel);
|
|
|
|
think = __NULL__;
|
|
nextthink = -1;
|
|
sound(this, CHAN_ITEM, "items/suitchargeok1.wav", 1, ATTN_NORM, 150);
|
|
}
|
|
|
|
void item_suit::item_suit(void)
|
|
{
|
|
model = "models/w_suit.mdl";
|
|
precache_sound("items/suitchargeok1.wav");
|
|
precache_sound("fvox/hev_logon.wav");
|
|
precache_sound("fvox/bell.wav");
|
|
CBaseTrigger::CBaseTrigger();
|
|
Respawn();
|
|
}
|