mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-24 05:34:18 +00:00
Add info_pitworm_steam_lock and pitworm_gibshooter
This commit is contained in:
parent
29259ba417
commit
6f4dbd2484
@ -51,7 +51,6 @@ set (SVDLL_SOURCES
|
|||||||
gearbox/func_tank_of.cpp
|
gearbox/func_tank_of.cpp
|
||||||
# gearbox/gearbox_client.cpp
|
# gearbox/gearbox_client.cpp
|
||||||
gearbox/gearbox_effects.cpp
|
gearbox/gearbox_effects.cpp
|
||||||
gearbox/gearbox_subs.cpp
|
|
||||||
gearbox/gearbox_triggers.cpp
|
gearbox/gearbox_triggers.cpp
|
||||||
gearbox/gearbox_utils.cpp
|
gearbox/gearbox_utils.cpp
|
||||||
gearbox/generic_items.cpp
|
gearbox/generic_items.cpp
|
||||||
|
@ -22,47 +22,160 @@
|
|||||||
//=========================================================
|
//=========================================================
|
||||||
// CPitwormGibShooter
|
// CPitwormGibShooter
|
||||||
//=========================================================
|
//=========================================================
|
||||||
class CPitwormGibShooter : public CGibShooter
|
class CPitwormGib : public CBaseEntity
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
void Spawn();
|
||||||
void Precache(void);
|
void Precache();
|
||||||
|
void EXPORT GibFloat();
|
||||||
virtual CGib *CreateGib(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LINK_ENTITY_TO_CLASS(pitworm_gibshooter, CPitwormGibShooter);
|
LINK_ENTITY_TO_CLASS(pitworm_gib, CPitwormGib)
|
||||||
|
|
||||||
|
void CPitwormGib::Precache()
|
||||||
|
{
|
||||||
|
PRECACHE_MODEL("models/pit_worm_gibs.mdl");
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPitwormGib::Spawn()
|
||||||
|
{
|
||||||
|
Precache();
|
||||||
|
pev->movetype = MOVETYPE_BOUNCE;
|
||||||
|
pev->friction = 0.55; // deading the bounce a bit
|
||||||
|
|
||||||
|
pev->renderamt = 255;
|
||||||
|
pev->rendermode = kRenderNormal;
|
||||||
|
pev->renderfx = kRenderFxNone;
|
||||||
|
pev->solid = SOLID_NOT;
|
||||||
|
pev->classname = MAKE_STRING( "pitworm_gib" );
|
||||||
|
|
||||||
|
SET_MODEL( ENT( pev ), "models/pit_worm_gibs.mdl" );
|
||||||
|
UTIL_SetSize( pev, Vector( -8, -8, -4 ), Vector( 8, 8, 16 ) );
|
||||||
|
|
||||||
|
pev->nextthink = gpGlobals->time + 0.1;
|
||||||
|
SetThink(&CPitwormGib::GibFloat);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPitwormGib::GibFloat()
|
||||||
|
{
|
||||||
|
if (pev->waterlevel == 3)
|
||||||
|
{
|
||||||
|
pev->movetype = MOVETYPE_FLY;
|
||||||
|
pev->velocity = pev->velocity * 0.8;
|
||||||
|
pev->avelocity = pev->avelocity * 0.9;
|
||||||
|
pev->velocity.z += 8;
|
||||||
|
}
|
||||||
|
else if (pev->waterlevel)
|
||||||
|
{
|
||||||
|
pev->velocity.z -= 8;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pev->movetype = MOVETYPE_BOUNCE;
|
||||||
|
pev->velocity.z -= 8;
|
||||||
|
}
|
||||||
|
pev->nextthink = gpGlobals->time + 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CPitwormGibShooter : public CBaseDelay
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Spawn();
|
||||||
|
void Precache(void);
|
||||||
|
void KeyValue( KeyValueData *pkvd );
|
||||||
|
void EXPORT ShootThink( void );
|
||||||
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
|
|
||||||
|
CPitwormGib *CreateGib(void);
|
||||||
|
|
||||||
|
virtual int Save( CSave &save );
|
||||||
|
virtual int Restore( CRestore &restore );
|
||||||
|
static TYPEDESCRIPTION m_SaveData[];
|
||||||
|
|
||||||
|
int m_iGibModelIndex;
|
||||||
|
float m_flGibVelocity;
|
||||||
|
};
|
||||||
|
|
||||||
|
TYPEDESCRIPTION CPitwormGibShooter::m_SaveData[] =
|
||||||
|
{
|
||||||
|
DEFINE_FIELD( CPitwormGibShooter, m_flGibVelocity, FIELD_FLOAT ),
|
||||||
|
};
|
||||||
|
|
||||||
|
IMPLEMENT_SAVERESTORE( CPitwormGibShooter, CBaseDelay )
|
||||||
|
|
||||||
|
LINK_ENTITY_TO_CLASS(pitworm_gibshooter, CPitwormGibShooter)
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// Purpose:
|
|
||||||
//---------------------------------------------------------
|
|
||||||
void CPitwormGibShooter::Precache(void)
|
void CPitwormGibShooter::Precache(void)
|
||||||
{
|
{
|
||||||
m_iGibModelIndex = PRECACHE_MODEL("models/pit_worm_gibs.mdl");
|
m_iGibModelIndex = PRECACHE_MODEL("models/pit_worm_gibs.mdl");
|
||||||
|
UTIL_PrecacheOther("pitworm_gib");
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------
|
void CPitwormGibShooter::Spawn()
|
||||||
// Purpose:
|
{
|
||||||
//---------------------------------------------------------
|
Precache();
|
||||||
CGib *CPitwormGibShooter::CreateGib(void)
|
pev->solid = SOLID_NOT;
|
||||||
|
pev->effects = EF_NODRAW;
|
||||||
|
|
||||||
|
if( m_flDelay == 0 )
|
||||||
|
{
|
||||||
|
m_flDelay = 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetMovedir( pev );
|
||||||
|
pev->body = MODEL_FRAMES( m_iGibModelIndex );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPitwormGibShooter::KeyValue( KeyValueData *pkvd )
|
||||||
|
{
|
||||||
|
if( FStrEq( pkvd->szKeyName, "m_flVelocity" ) )
|
||||||
|
{
|
||||||
|
m_flGibVelocity = atof( pkvd->szValue );
|
||||||
|
pkvd->fHandled = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CBaseDelay::KeyValue( pkvd );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPitwormGibShooter::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
|
||||||
|
{
|
||||||
|
SetThink( &CPitwormGibShooter::ShootThink );
|
||||||
|
pev->nextthink = gpGlobals->time;
|
||||||
|
}
|
||||||
|
|
||||||
|
CPitwormGib *CPitwormGibShooter::CreateGib(void)
|
||||||
{
|
{
|
||||||
if (CVAR_GET_FLOAT("violence_hgibs") == 0)
|
if (CVAR_GET_FLOAT("violence_hgibs") == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
CGib *pGib = GetClassPtr((CGib *)NULL);
|
CPitwormGib *pGib = GetClassPtr((CPitwormGib *)NULL);
|
||||||
pGib->Spawn("models/pit_worm_gibs.mdl");
|
pGib->Spawn();
|
||||||
pGib->m_bloodColor = BLOOD_COLOR_RED;
|
|
||||||
|
|
||||||
if (pev->body <= 1)
|
if (pev->body <= 1)
|
||||||
{
|
{
|
||||||
ALERT(at_aiconsole, "PitwormGibShooter Body is <= 1!\n");
|
ALERT(at_aiconsole, "PitwormGibShooter Body is <= 1!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pGib->pev->body = RANDOM_LONG(1, pev->body - 1);// avoid throwing random amounts of the 0th gib. (skull).
|
pGib->pev->body = RANDOM_LONG(0, pev->body - 1);
|
||||||
|
|
||||||
return pGib;
|
return pGib;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPitwormGibShooter::ShootThink()
|
||||||
|
{
|
||||||
|
UTIL_MakeVectors(pev->angles);
|
||||||
|
CPitwormGib *pGib = CreateGib();
|
||||||
|
if (pGib)
|
||||||
|
{
|
||||||
|
pGib->pev->origin = pev->origin;
|
||||||
|
pGib->pev->velocity = gpGlobals->v_forward * m_flGibVelocity;
|
||||||
|
}
|
||||||
|
SetThink( &CBaseEntity::SUB_Remove );
|
||||||
|
pev->nextthink = gpGlobals->time + 0.1;
|
||||||
|
}
|
||||||
|
|
||||||
#include "displacerball.h"
|
#include "displacerball.h"
|
||||||
#include "shock.h"
|
#include "shock.h"
|
||||||
#include "sporegrenade.h"
|
#include "sporegrenade.h"
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
/***
|
|
||||||
*
|
|
||||||
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
|
|
||||||
*
|
|
||||||
* This product contains software technology licensed from Id
|
|
||||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Use, distribution, and modification of this source code and/or resulting
|
|
||||||
* object code is restricted to non-commercial enhancements to products from
|
|
||||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
||||||
* without written permission from Valve LLC.
|
|
||||||
*
|
|
||||||
****/
|
|
||||||
/*
|
|
||||||
|
|
||||||
===== gearbox_subs.cpp ========================================================
|
|
||||||
|
|
||||||
frequently used global functions
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "extdll.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "cbase.h"
|
|
||||||
#include "saverestore.h"
|
|
||||||
|
|
||||||
class CPitwormSteamLock : public CBaseEntity
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
LINK_ENTITY_TO_CLASS(info_pitworm_steam_lock, CBaseEntity);
|
|
@ -1374,3 +1374,29 @@ void CPitWorm::TrackEnemy()
|
|||||||
m_posDesired.z = m_flLevels[m_iLevel];
|
m_posDesired.z = m_flLevels[m_iLevel];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CPitWormSteamTrigger : public CBaseEntity
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void Spawn();
|
||||||
|
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||||
|
};
|
||||||
|
|
||||||
|
LINK_ENTITY_TO_CLASS(info_pitworm_steam_lock, CPitWormSteamTrigger)
|
||||||
|
|
||||||
|
void CPitWormSteamTrigger::Spawn()
|
||||||
|
{
|
||||||
|
pev->solid = SOLID_NOT;
|
||||||
|
pev->movetype = MOVETYPE_NONE;
|
||||||
|
pev->effects = EF_NODRAW;
|
||||||
|
UTIL_SetOrigin(pev, pev->origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPitWormSteamTrigger::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
|
||||||
|
{
|
||||||
|
CPitWorm* pWorm = (CPitWorm*)UTIL_FindEntityByClassname(0, "monster_pitworm_up");
|
||||||
|
if (pWorm)
|
||||||
|
{
|
||||||
|
pWorm->LockTopLevel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user