mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-27 23:25:41 +03:00
127 lines
2.5 KiB
C++
127 lines
2.5 KiB
C++
#include "precompiled.h"
|
|
|
|
/*
|
|
* Globals initialization
|
|
*/
|
|
#ifndef HOOK_GAMEDLL
|
|
|
|
TYPEDESCRIPTION CAirtank::m_SaveData[] =
|
|
{
|
|
DEFINE_FIELD(CAirtank, m_state, FIELD_INTEGER)
|
|
};
|
|
|
|
#else
|
|
|
|
TYPEDESCRIPTION IMPL_CLASS(CAirtank, m_SaveData)[1];
|
|
|
|
#endif // HOOK_GAMEDLL
|
|
|
|
/* <5329> ../cstrike/dlls/airtank.cpp:41 */
|
|
LINK_ENTITY_TO_CLASS(item_airtank, CAirtank);
|
|
|
|
/* <5211> ../cstrike/dlls/airtank.cpp:47 */
|
|
IMPLEMENT_SAVERESTORE(CAirtank, CGrenade);
|
|
|
|
/* <50dd> ../cstrike/dlls/airtank.cpp:50 */
|
|
void CAirtank::__MAKE_VHOOK(Spawn)(void)
|
|
{
|
|
Precache();
|
|
|
|
// motor
|
|
pev->movetype = MOVETYPE_FLY;
|
|
pev->solid = SOLID_BBOX;
|
|
|
|
SET_MODEL(ENT(pev), "models/w_oxygen.mdl");
|
|
UTIL_SetSize(pev, Vector(-16, -16, 0), Vector(16, 16, 36));
|
|
UTIL_SetOrigin(pev, pev->origin);
|
|
|
|
SetTouch(&CAirtank::TankTouch);
|
|
SetThink(&CAirtank::TankThink);
|
|
|
|
pev->flags |= FL_MONSTER;
|
|
pev->takedamage = DAMAGE_YES;
|
|
pev->health = 20;
|
|
pev->dmg = 50;
|
|
m_state = 1;
|
|
}
|
|
|
|
/* <4fef> ../cstrike/dlls/airtank.cpp:71 */
|
|
void CAirtank::__MAKE_VHOOK(Precache)(void)
|
|
{
|
|
PRECACHE_MODEL("models/w_oxygen.mdl");
|
|
PRECACHE_SOUND("doors/aliendoor3.wav");
|
|
}
|
|
|
|
/* <503d> ../cstrike/dlls/airtank.cpp:78 */
|
|
void CAirtank::__MAKE_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
|
|
{
|
|
pev->owner = ENT(pevAttacker);
|
|
|
|
// UNDONE: this should make a big bubble cloud, not an explosion
|
|
Explode(pev->origin, Vector(0, 0, -1));
|
|
}
|
|
|
|
/* <5016> ../cstrike/dlls/airtank.cpp:88 */
|
|
void CAirtank::TankThink(void)
|
|
{
|
|
// Fire trigger
|
|
m_state = 1;
|
|
SUB_UseTargets(this, USE_TOGGLE, 0);
|
|
}
|
|
|
|
/* <525d> ../cstrike/dlls/airtank.cpp:96 */
|
|
void CAirtank::TankTouch(CBaseEntity *pOther)
|
|
{
|
|
if (!pOther->IsPlayer())
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!m_state)
|
|
{
|
|
// "no oxygen" sound
|
|
EMIT_SOUND(ENT(pev), CHAN_BODY, "player/pl_swim2.wav", VOL_NORM, ATTN_NORM);
|
|
return;
|
|
}
|
|
|
|
// give player 12 more seconds of air
|
|
pOther->pev->air_finished = gpGlobals->time + 12;
|
|
|
|
// suit recharge sound
|
|
EMIT_SOUND(ENT(pev), CHAN_VOICE, "doors/aliendoor3.wav", VOL_NORM, ATTN_NORM);
|
|
|
|
// recharge airtank in 30 seconds
|
|
pev->nextthink = gpGlobals->time + 30;
|
|
m_state = 0;
|
|
SUB_UseTargets(this, USE_TOGGLE, 1);
|
|
}
|
|
|
|
#ifdef HOOK_GAMEDLL
|
|
|
|
void CAirtank::Spawn(void)
|
|
{
|
|
Spawn_();
|
|
}
|
|
|
|
void CAirtank::Precache(void)
|
|
{
|
|
Precache_();
|
|
}
|
|
|
|
int CAirtank::Save(CSave &save)
|
|
{
|
|
return Save_(save);
|
|
}
|
|
|
|
int CAirtank::Restore(CRestore &restore)
|
|
{
|
|
return Restore_(restore);
|
|
}
|
|
|
|
void CAirtank::Killed(entvars_t *pevAttacker, int iGib)
|
|
{
|
|
Killed_(pevAttacker, iGib);
|
|
}
|
|
|
|
#endif // HOOK_GAMEDLL
|