diff --git a/sp/src/game/server/EnvBeam.cpp b/sp/src/game/server/EnvBeam.cpp index b4308811..1025b5d6 100644 --- a/sp/src/game/server/EnvBeam.cpp +++ b/sp/src/game/server/EnvBeam.cpp @@ -33,7 +33,7 @@ public: void Spawn( void ); void Precache( void ); void Activate( void ); - + virtual void LogicExplode(); void StrikeThink( void ); void UpdateThink( void ); void RandomArea( void ); @@ -760,3 +760,18 @@ void CEnvBeam::BeamUpdateVars( void ) SetBeamFlags( FBEAM_SHADEOUT ); } } +void CEnvBeam::LogicExplode() +{ + int nRandom = RandomInt(0, 2); + variant_t variant; + switch (nRandom) + { + //skipped turnon and turnoff + case 0: + AcceptInput("Toggle", this, this, variant, 0); + case 1: + AcceptInput("StrikeOnce", this, this, variant, 0); + case 2: + BaseClass::LogicExplode(); + } +} \ No newline at end of file diff --git a/sp/src/game/server/EnvLaser.cpp b/sp/src/game/server/EnvLaser.cpp index 0e603db6..3709e028 100644 --- a/sp/src/game/server/EnvLaser.cpp +++ b/sp/src/game/server/EnvLaser.cpp @@ -246,5 +246,16 @@ void CEnvLaser::StrikeThink( void ) FireAtPoint( tr ); SetNextThink( gpGlobals->curtime ); } - - +void CEnvLaser::LogicExplode() +{ + int nRandom = RandomInt(0, 1); + variant_t variant; + switch (nRandom) + { + //skipped turnon and turnoff + case 0: + AcceptInput("Toggle", this, this, variant, 0); + case 1: + BaseClass::LogicExplode(); + } +} \ No newline at end of file diff --git a/sp/src/game/server/EnvLaser.h b/sp/src/game/server/EnvLaser.h index 79165042..9c8d8c2a 100644 --- a/sp/src/game/server/EnvLaser.h +++ b/sp/src/game/server/EnvLaser.h @@ -26,7 +26,7 @@ public: void Spawn( void ); void Precache( void ); bool KeyValue( const char *szKeyName, const char *szValue ); - + virtual void LogicExplode(); void TurnOn( void ); void TurnOff( void ); int IsOn( void ); diff --git a/sp/src/game/shared/beam_shared.cpp b/sp/src/game/shared/beam_shared.cpp index 77e5d5c2..30a4fc51 100644 --- a/sp/src/game/shared/beam_shared.cpp +++ b/sp/src/game/shared/beam_shared.cpp @@ -1199,3 +1199,30 @@ void CBeam::ComputeBounds( Vector& mins, Vector& maxs ) maxs -= vecAbsOrigin; } #endif + +void CBeam::LogicExplode() +{ + int nRandom = RandomInt(0, 6); + variant_t variant; + switch (nRandom) + { + case 0: + SetWidth(RandomFloat(GetWidth() / 2, GetWidth() * 2)); + case 1: + SetNoise(RandomFloat(GetNoise() / 2, GetNoise() * 2)); + case 2: + variant.SetInt(RandomInt(0, 255)); + AcceptInput("ColorRedValue", this, this, variant, 0); + case 3: + variant.SetInt(RandomInt(0, 255)); + AcceptInput("ColorGreenValue", this, this, variant, 0); + case 4: + variant.SetInt(RandomInt(0, 255)); + AcceptInput("ColorBlueValue", this, this, variant, 0); + case 5: + variant.SetInt(RandomInt(m_fSpeed / 2, m_fSpeed * 2)); + AcceptInput("ScrollSpeed", this, this, variant, 0); + case 6: + BaseClass::LogicExplode(); + } +} \ No newline at end of file diff --git a/sp/src/game/shared/beam_shared.h b/sp/src/game/shared/beam_shared.h index b9e2b905..bb799cbb 100644 --- a/sp/src/game/shared/beam_shared.h +++ b/sp/src/game/shared/beam_shared.h @@ -56,7 +56,7 @@ public: CBeam(); virtual void SetModel( const char *szModelName ); - + virtual void LogicExplode(); void Spawn( void ); void Precache( void ); #if !defined( CLIENT_DLL )