CBeam logex

This commit is contained in:
Pinsplash 2024-04-11 07:32:56 -05:00
parent 4009854389
commit 2ac016513f
5 changed files with 58 additions and 5 deletions

View File

@ -33,7 +33,7 @@ public:
void Spawn( void ); void Spawn( void );
void Precache( void ); void Precache( void );
void Activate( void ); void Activate( void );
virtual void LogicExplode();
void StrikeThink( void ); void StrikeThink( void );
void UpdateThink( void ); void UpdateThink( void );
void RandomArea( void ); void RandomArea( void );
@ -760,3 +760,18 @@ void CEnvBeam::BeamUpdateVars( void )
SetBeamFlags( FBEAM_SHADEOUT ); 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();
}
}

View File

@ -246,5 +246,16 @@ void CEnvLaser::StrikeThink( void )
FireAtPoint( tr ); FireAtPoint( tr );
SetNextThink( gpGlobals->curtime ); 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();
}
}

View File

@ -26,7 +26,7 @@ public:
void Spawn( void ); void Spawn( void );
void Precache( void ); void Precache( void );
bool KeyValue( const char *szKeyName, const char *szValue ); bool KeyValue( const char *szKeyName, const char *szValue );
virtual void LogicExplode();
void TurnOn( void ); void TurnOn( void );
void TurnOff( void ); void TurnOff( void );
int IsOn( void ); int IsOn( void );

View File

@ -1199,3 +1199,30 @@ void CBeam::ComputeBounds( Vector& mins, Vector& maxs )
maxs -= vecAbsOrigin; maxs -= vecAbsOrigin;
} }
#endif #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();
}
}

View File

@ -56,7 +56,7 @@ public:
CBeam(); CBeam();
virtual void SetModel( const char *szModelName ); virtual void SetModel( const char *szModelName );
virtual void LogicExplode();
void Spawn( void ); void Spawn( void );
void Precache( void ); void Precache( void );
#if !defined( CLIENT_DLL ) #if !defined( CLIENT_DLL )