mirror of
https://github.com/Pinsplash/halflife2chaos.git
synced 2024-10-29 23:32:38 +01:00
CBaseToggle logex
This commit is contained in:
parent
8947546a0e
commit
c6028a25f0
@ -1584,4 +1584,38 @@ void CMomentaryRotButton::Enable( void )
|
||||
void CMomentaryRotButton::Disable( void )
|
||||
{
|
||||
m_bDisabled = true;
|
||||
}
|
||||
void CBaseButton::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 5);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Lock", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("Unlock", this, this, variant, 0);
|
||||
case 2:
|
||||
AcceptInput("Press", this, this, variant, 0);
|
||||
case 3:
|
||||
AcceptInput("PressIn", this, this, variant, 0);
|
||||
case 4:
|
||||
AcceptInput("PressOut", this, this, variant, 0);
|
||||
case 5:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
||||
void CMomentaryRotButton::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
variant.SetFloat(RandomFloat(0, 1));
|
||||
AcceptInput("SetPosition", this, this, variant, 0);
|
||||
//skipped everything else cause they kinda sucked
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -23,7 +23,7 @@ public:
|
||||
void RotSpawn( void );
|
||||
bool KeyValue( const char *szKeyName, const char *szValue );
|
||||
int DrawDebugTextOverlays();
|
||||
|
||||
virtual void LogicExplode();
|
||||
protected:
|
||||
|
||||
void ButtonActivate( );
|
||||
@ -116,7 +116,7 @@ public:
|
||||
void OutputMovementComplete(void);
|
||||
void SetPositionMoveDone(void);
|
||||
void UpdateSelf( float value, bool bPlaySound );
|
||||
|
||||
virtual void LogicExplode();
|
||||
void PlaySound( void );
|
||||
void UpdateTarget( float value, CBaseEntity *pActivator );
|
||||
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
DECLARE_DATADESC();
|
||||
|
||||
CColorCorrectionVolume();
|
||||
|
||||
virtual void LogicExplode();
|
||||
void Spawn( void );
|
||||
bool KeyValue( const char *szKeyName, const char *szValue );
|
||||
int UpdateTransmitState();
|
||||
@ -234,3 +234,17 @@ void CColorCorrectionVolume::InputDisable( inputdata_t &inputdata )
|
||||
{
|
||||
m_bEnabled = false;
|
||||
}
|
||||
void CColorCorrectionVolume::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 2);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Enable", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("Disable", this, this, variant, 0);
|
||||
case 2:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -1431,3 +1431,23 @@ void CRotDoor::SetToggleState( int state )
|
||||
else
|
||||
SetLocalAngles( m_vecAngle1 );
|
||||
}
|
||||
void CBaseDoor::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 4);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
//skipped open and close
|
||||
case 0:
|
||||
AcceptInput("Toggle", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("Lock", this, this, variant, 0);
|
||||
case 2:
|
||||
AcceptInput("Unlock", this, this, variant, 0);
|
||||
case 3:
|
||||
variant.SetFloat(RandomFloat(m_flSpeed / 2, m_flSpeed * 2));
|
||||
AcceptInput("SetSpeed", this, this, variant, 0);
|
||||
case 4:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -51,7 +51,7 @@ public:
|
||||
DECLARE_CLASS( CBaseDoor, CBaseToggle );
|
||||
|
||||
DECLARE_SERVERCLASS();
|
||||
|
||||
virtual void LogicExplode();
|
||||
void Spawn( void );
|
||||
void Precache( void );
|
||||
bool CreateVPhysics();
|
||||
|
@ -394,3 +394,23 @@ int CFuncMoveLinear::DrawDebugTextOverlays(void)
|
||||
}
|
||||
return text_offset;
|
||||
}
|
||||
void CFuncMoveLinear::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 4);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Open", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("Close", this, this, variant, 0);
|
||||
case 2:
|
||||
variant.SetFloat(RandomFloat(0, 1));
|
||||
AcceptInput("SetPosition", this, this, variant, 0);
|
||||
case 3:
|
||||
variant.SetFloat(RandomFloat(m_flSpeed / 2, m_flSpeed * 2));
|
||||
AcceptInput("SetSpeed", this, this, variant, 0);
|
||||
case 4:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ public:
|
||||
void Precache( void );
|
||||
bool CreateVPhysics( void );
|
||||
bool ShouldSavePhysics( void );
|
||||
|
||||
virtual void LogicExplode();
|
||||
void MoveTo(Vector vPosition, float flSpeed);
|
||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||
void MoveDone( void );
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
virtual void Spawn( void );
|
||||
virtual void Activate( void );
|
||||
bool CreateVPhysics( void );
|
||||
|
||||
virtual void LogicExplode();
|
||||
virtual int BloodColor( void ) { return DONT_BLEED; }
|
||||
|
||||
#if defined( HL2_DLL )
|
||||
@ -253,3 +253,15 @@ void CGunTarget::InputToggle( inputdata_t &inputdata )
|
||||
Start();
|
||||
}
|
||||
}
|
||||
void CGunTarget::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Toggle", this, this, variant, 0);
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ public:
|
||||
bool KeyValue( const char *szKeyName, const char *szValue );
|
||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||
virtual int ObjectCaps( void ) { return (BaseClass::ObjectCaps() | FCAP_CONTINUOUS_USE); }
|
||||
|
||||
virtual void LogicExplode();
|
||||
private:
|
||||
void InputRecharge( inputdata_t &inputdata );
|
||||
|
||||
@ -775,3 +775,15 @@ void CNewRecharge::Off(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
void CRecharge::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Recharge", this, this, variant, 0);
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -26,7 +26,7 @@ public:
|
||||
|
||||
void Spawn( void );
|
||||
void MoveThink( void );
|
||||
|
||||
virtual void LogicExplode();
|
||||
// Inputs
|
||||
void InputInvertOn( inputdata_t &inputdata );
|
||||
void InputInvertOff( inputdata_t &inputdata );
|
||||
@ -234,4 +234,17 @@ void CLookDoor::MoveThink(void)
|
||||
// Move the door
|
||||
SetPosition( flMove );
|
||||
}
|
||||
|
||||
void CLookDoor::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 2);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("InvertOn", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("InvertOff", this, this, variant, 0);
|
||||
case 2:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -227,7 +227,7 @@ public:
|
||||
void Precache( void );
|
||||
bool CreateVPhysics();
|
||||
void Setup( void );
|
||||
|
||||
virtual void LogicExplode();
|
||||
virtual void Blocked( CBaseEntity *pOther );
|
||||
void PlatUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||
|
||||
@ -730,7 +730,7 @@ public:
|
||||
void Precache( void );
|
||||
void Activate( void );
|
||||
void OnRestore( void );
|
||||
|
||||
virtual void LogicExplode();
|
||||
void SetupTarget( void );
|
||||
void Blocked( CBaseEntity *pOther );
|
||||
void Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
|
||||
@ -3376,3 +3376,29 @@ void CFuncTrackAuto::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
|
||||
UpdateAutoTargets( m_targetState );
|
||||
}
|
||||
}
|
||||
void CFuncPlat::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
//skipped goup and godown
|
||||
case 0:
|
||||
AcceptInput("Toggle", this, this, variant, 0);
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
||||
void CFuncTrain::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
//skipped start and stop
|
||||
case 0:
|
||||
AcceptInput("Toggle", this, this, variant, 0);
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -992,7 +992,7 @@ class CTriggerLook : public CTriggerOnce
|
||||
{
|
||||
DECLARE_CLASS( CTriggerLook, CTriggerOnce );
|
||||
public:
|
||||
|
||||
virtual void LogicExplode();
|
||||
EHANDLE m_hLookTarget;
|
||||
float m_flFieldOfView;
|
||||
float m_flLookTime; // How long must I look for
|
||||
@ -4011,7 +4011,7 @@ class CTriggerImpact : public CTriggerMultiple
|
||||
DECLARE_CLASS( CTriggerImpact, CTriggerMultiple );
|
||||
public:
|
||||
DECLARE_DATADESC();
|
||||
|
||||
virtual void LogicExplode();
|
||||
float m_flMagnitude;
|
||||
float m_flNoise;
|
||||
float m_flViewkick;
|
||||
@ -4849,3 +4849,66 @@ bool IsTriggerClass(CBaseEntity *pEntity)
|
||||
|
||||
return false;
|
||||
}
|
||||
void CBaseTrigger::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 4);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
//skipped enable and disable
|
||||
case 0:
|
||||
AcceptInput("Toggle", this, this, variant, 0);
|
||||
case 1:
|
||||
AcceptInput("TouchTest", this, this, variant, 0);
|
||||
case 2:
|
||||
AcceptInput("StartTouch", this, this, variant, 0);
|
||||
case 3:
|
||||
AcceptInput("EndTouch", this, this, variant, 0);
|
||||
case 4:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
||||
void CTriggerHurt::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 1);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
variant.SetFloat(RandomFloat(m_flDamage / 2, m_flDamage * 2));
|
||||
AcceptInput("SetDamage", this, this, variant, 0);
|
||||
case 1:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
||||
void CTriggerLook::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 2);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
variant.SetFloat(RandomFloat(-1, 1));
|
||||
AcceptInput("FieldOfView", this, this, variant, 0);
|
||||
case 1:
|
||||
variant.SetFloat(RandomFloat(m_flLookTime / 2, m_flLookTime * 2));
|
||||
AcceptInput("LookTime", this, this, variant, 0);
|
||||
case 2:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
||||
void CTriggerImpact::LogicExplode()
|
||||
{
|
||||
int nRandom = RandomInt(0, 2);
|
||||
variant_t variant;
|
||||
switch (nRandom)
|
||||
{
|
||||
case 0:
|
||||
AcceptInput("Impact", this, this, variant, 0);
|
||||
case 1:
|
||||
variant.SetFloat(RandomFloat(m_flMagnitude / 2, m_flMagnitude * 2));
|
||||
AcceptInput("SetMagnitude", this, this, variant, 0);
|
||||
case 2:
|
||||
BaseClass::LogicExplode();
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ class CBaseTrigger : public CBaseToggle
|
||||
DECLARE_CLASS( CBaseTrigger, CBaseToggle );
|
||||
public:
|
||||
CBaseTrigger();
|
||||
|
||||
virtual void LogicExplode();
|
||||
void Activate( void );
|
||||
virtual void PostClientActive( void );
|
||||
void InitTrigger( void );
|
||||
@ -245,7 +245,7 @@ public:
|
||||
}
|
||||
|
||||
DECLARE_CLASS( CTriggerHurt, CBaseTrigger );
|
||||
|
||||
virtual void LogicExplode();
|
||||
void Spawn( void );
|
||||
void RadiationThink( void );
|
||||
void HurtThink( void );
|
||||
|
Loading…
Reference in New Issue
Block a user