mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-20 16:32:30 +03:00
Flare Gun: Added two new convars to enable / disable flare projectiles sticking into walls and emitting light.
This commit is contained in:
parent
bdc1f6897d
commit
881d8112d7
@ -28,8 +28,10 @@
|
||||
// Custom convars for flaregun
|
||||
ConVar flaregun_primary_velocity("sv_flaregun_primary_velocity", "1500");
|
||||
ConVar flaregun_secondary_velocity("sv_flaregun_secondary_velocity", "500");
|
||||
ConVar flaregun_duration_seconds("sv_flaregun_lifetime_seconds", "10");
|
||||
ConVar flaregun_duration_seconds("sv_flaregun_lifetime_seconds", "30");
|
||||
ConVar flaregun_stop_velocity("sv_flaregun_stop_velocity", "128");
|
||||
ConVar flaregun_projectile_sticky("sv_flaregun_projectile_sticky", "0");
|
||||
ConVar flaregun_dynamic_lights("sv_flaregun_dynamic_lights", "1");
|
||||
|
||||
// Custom derived class for flare gun projectiles
|
||||
class CFlareGunProjectile : public CFlare
|
||||
@ -159,6 +161,7 @@ CFlareGunProjectile *CFlareGunProjectile::Create(Vector vecOrigin, QAngle vecAng
|
||||
pFlare->Spawn();
|
||||
pFlare->SetTouch(&CFlareGunProjectile::FlareGunProjectileTouch);
|
||||
pFlare->SetThink(&CFlare::FlareThink);
|
||||
pFlare->m_bLight = flaregun_dynamic_lights.GetBool();
|
||||
|
||||
//Start up the flare
|
||||
pFlare->Start(lifetime);
|
||||
@ -219,8 +222,8 @@ void CFlareGunProjectile::FlareGunProjectileTouch(CBaseEntity *pOther)
|
||||
trace_t tr;
|
||||
tr = CBaseEntity::GetTouchTrace();
|
||||
|
||||
//Only do this on the first bounce
|
||||
if (m_nBounces == 0)
|
||||
//Only do this on the first bounce if the convar is set
|
||||
if (flaregun_projectile_sticky.GetBool() && m_nBounces == 0)
|
||||
{
|
||||
const surfacedata_t *pdata = physprops->GetSurfaceData(tr.surface.surfaceProps);
|
||||
|
||||
|
48
sp/src/game/server/mod/weapon_pipe.cpp
Normal file
48
sp/src/game/server/mod/weapon_pipe.cpp
Normal file
@ -0,0 +1,48 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Crowbar - an old favorite
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include "cbase.h"
|
||||
#include "basehlcombatweapon.h"
|
||||
#include "player.h"
|
||||
#include "gamerules.h"
|
||||
#include "ammodef.h"
|
||||
#include "mathlib/mathlib.h"
|
||||
#include "in_buttons.h"
|
||||
#include "soundent.h"
|
||||
#include "basebludgeonweapon.h"
|
||||
#include "vstdlib/random.h"
|
||||
#include "npcevent.h"
|
||||
#include "ai_basenpc.h"
|
||||
#include "weapon_pipe.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CWeaponCrowbar
|
||||
//-----------------------------------------------------------------------------
|
||||
IMPLEMENT_SERVERCLASS_ST(CWeaponPipe, DT_WeaponPipe)
|
||||
END_SEND_TABLE()
|
||||
|
||||
LINK_ENTITY_TO_CLASS( weapon_pipe, CWeaponPipe );
|
||||
PRECACHE_WEAPON_REGISTER( CWeaponPipe );
|
||||
|
||||
acttable_t CWeaponPipe::m_acttable[] =
|
||||
{
|
||||
{ ACT_MELEE_ATTACK1, ACT_MELEE_ATTACK_SWING, true },
|
||||
{ ACT_IDLE, ACT_IDLE, false },
|
||||
{ ACT_IDLE_ANGRY, ACT_IDLE_ANGRY_MELEE, false },
|
||||
};
|
||||
|
||||
IMPLEMENT_ACTTABLE(CWeaponPipe);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CWeaponPipe::CWeaponPipe( void )
|
||||
{
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user