Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions src/game/client/c_baseanimating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ IMPLEMENT_CLIENTCLASS_DT(C_BaseAnimating, DT_BaseAnimating, CBaseAnimating)

RecvPropFloat( RECVINFO( m_fadeMinDist ) ),
RecvPropFloat( RECVINFO( m_fadeMaxDist ) ),
RecvPropFloat( RECVINFO( m_flFadeScale ) ),
RecvPropFloat( RECVINFO( m_flFadeScale ) ),
#ifdef NEO
RecvPropBool( RECVINFO( m_bIsGib ) ),
#endif // NEO

END_RECV_TABLE()

Expand Down Expand Up @@ -382,6 +385,35 @@ void C_ClientRagdoll::OnRestore( void )
RagdollMoved();
}

#ifdef NEO
extern ConVar glow_outline_effect_enable;
int C_ClientRagdoll::DrawModel(int flags)
{
#ifdef GLOWS_ENABLE
auto pTargetPlayer = glow_outline_effect_enable.GetBool() ? C_NEO_Player::GetLocalNEOPlayer() : C_NEO_Player::GetVisionTargetNEOPlayer();
#else
auto pTargetPlayer = C_NEO_Player::GetVisionTargetNEOPlayer();
#endif // GLOWS_ENABLE
if (!pTargetPlayer)
{
Assert(false);
return BaseClass::DrawModel(flags);
}

const bool inThermalVision = pTargetPlayer ? (pTargetPlayer->IsInVision() && pTargetPlayer->GetClass() == NEO_CLASS_SUPPORT) : false;
if (inThermalVision)
{
IMaterial* pass = materials->FindMaterial("dev/thermal_ragdoll_model", TEXTURE_GROUP_MODEL);
modelrender->ForcedMaterialOverride(pass);
const int ret = BaseClass::DrawModel(flags);
modelrender->ForcedMaterialOverride(nullptr);
return ret;
}

return BaseClass::DrawModel(flags);
}

#endif // NEO
void C_ClientRagdoll::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
{
VPROF( "C_ClientRagdoll::ImpactTrace" );
Expand Down Expand Up @@ -749,6 +781,9 @@ C_BaseAnimating::C_BaseAnimating() :
Q_memset(&m_mouth, 0, sizeof(m_mouth));
m_flCycle = 0;
m_flOldCycle = 0;
#ifdef NEO
m_flNeoCreateTime = gpGlobals->curtime;
#endif // NEO
}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -3244,7 +3279,6 @@ int C_BaseAnimating::DrawModel( int flags )
#endif // GLOWS_ENABLE

const bool inMotionVision = pTargetPlayer->IsInVision() && pTargetPlayer->GetClass() == NEO_CLASS_ASSAULT;

auto rootMoveParent = GetRootMoveParent();
Vector vel;
if (IsRagdoll())
Expand All @@ -3271,6 +3305,15 @@ int C_BaseAnimating::DrawModel( int flags )
modelrender->ForcedMaterialOverride(pass);
}
}

const bool inThermalVision = pTargetPlayer->IsInVision() && pTargetPlayer->GetClass() == NEO_CLASS_SUPPORT;
if (m_bIsGib && inThermalVision)
{
IMaterial* pass = materials->FindMaterial("dev/thermal_base_animating_model", TEXTURE_GROUP_MODEL);
Assert(!IsErrorMaterial(pass));
modelrender->ForcedMaterialOverride(pass);
}

#endif // NEO

if ( flags & ( STUDIO_NO_OVERRIDE_FOR_ATTACH ) )
Expand Down
9 changes: 9 additions & 0 deletions src/game/client/c_baseanimating.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,12 @@ class C_BaseAnimating : public C_BaseEntity, private IModelLoadCallback
float m_flOldCycle;
bool m_bNoModelParticles;

#ifdef NEO
bool m_bIsGib;
public:
float m_flNeoCreateTime;
#endif // NEO

private:
float m_flOldModelScale;
int m_nOldSequence;
Expand Down Expand Up @@ -680,6 +686,9 @@ class C_ClientRagdoll : public C_BaseAnimating, public IPVSNotify
virtual void OnRestore();
virtual int ObjectCaps( void ) { return BaseClass::ObjectCaps() | FCAP_SAVE_NON_NETWORKABLE; }
virtual IPVSNotify* GetPVSNotifyInterface() { return this; }
#ifdef NEO
virtual int DrawModel(int flags) override;
#endif neo

void HandleAnimatedFriction( void );
virtual void SUB_Remove( void );
Expand Down
27 changes: 27 additions & 0 deletions src/game/client/c_impact_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
newParticle.m_bHighlightInThermals = true;
#endif // NEO

AddSimpleParticle( &newParticle, g_Mat_DustPuff[0] );
}
Expand Down Expand Up @@ -425,6 +428,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
newParticle.m_bHighlightInThermals = true;
#endif // NEO

AddSimpleParticle( &newParticle, g_Mat_BloodPuff[0] );
}
Expand Down Expand Up @@ -459,6 +465,9 @@ void FX_DebrisFlecks( const Vector& origin, trace_t *tr, char materialType, int
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
newParticle.m_bHighlightInThermals = true;
#endif // NEO

AddSimpleParticle( &newParticle, g_Mat_DustPuff[0] );

Expand Down Expand Up @@ -569,6 +578,9 @@ void FX_GlassImpact( const Vector &pos, const Vector &normal )
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
newParticle.m_bHighlightInThermals = true;
#endif // NEO

AddSimpleParticle( &newParticle, g_Mat_BloodPuff[0] );
}
Expand Down Expand Up @@ -602,6 +614,9 @@ void FX_GlassImpact( const Vector &pos, const Vector &normal )
newParticle.m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
newParticle.m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
newParticle.m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
newParticle.m_bHighlightInThermals = true;
#endif // NEO

AddSimpleParticle( &newParticle, g_Mat_DustPuff[0] );
}
Expand Down Expand Up @@ -743,6 +758,9 @@ void FX_AntlionImpact( const Vector &pos, trace_t *trace )
pParticle->m_uchColor[0] = MIN( 1.0f, color[0]*colorRamp )*255.0f;
pParticle->m_uchColor[1] = MIN( 1.0f, color[1]*colorRamp )*255.0f;
pParticle->m_uchColor[2] = MIN( 1.0f, color[2]*colorRamp )*255.0f;
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}


Expand Down Expand Up @@ -1140,6 +1158,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, float flScale )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -8.0f, 8.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}

Expand Down Expand Up @@ -1178,6 +1199,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, float flScale )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -2.0f, 2.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}

Expand Down Expand Up @@ -1222,6 +1246,9 @@ void FX_DustImpact( const Vector &origin, trace_t *tr, float flScale )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -16.0f, 16.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/game/client/fx_blood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns
tParticle->m_flDieTime = random->RandomFloat( 0.5f, 1.0f );

FloatToColor32( tParticle->m_color, color[0], color[1], color[2], 1.0f );
#ifdef NEO
tParticle->m_bHighlightInThermals = true;
#endif // NEO
}

//
Expand Down Expand Up @@ -193,6 +196,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns
tParticle->m_flDieTime = random->RandomFloat( 0.5f, 1.0f );

FloatToColor32( tParticle->m_color, color[0], color[1], color[2], 1.0f );
#ifdef NEO
tParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}

Expand Down Expand Up @@ -249,6 +255,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = 0.0f;
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
}
Expand Down Expand Up @@ -294,6 +303,9 @@ void FX_BloodSpray( const Vector &origin, const Vector &normal, float scale, uns

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = 0.0f;
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
}
Expand Down Expand Up @@ -379,6 +391,9 @@ void FX_BloodBulletImpact( const Vector &origin, const Vector &normal, float sca

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = 0.0f;
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}

// Cache the material if we haven't already
Expand Down Expand Up @@ -415,6 +430,9 @@ void FX_BloodBulletImpact( const Vector &origin, const Vector &normal, float sca

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = 0.0f;
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}

Expand Down Expand Up @@ -464,6 +482,9 @@ void FX_BloodBulletImpact( const Vector &origin, const Vector &normal, float sca
tParticle->m_flDieTime = random->RandomFloat( 0.25f, 0.5f );

FloatToColor32( tParticle->m_color, color[0], color[1], color[2], 1.0f );
#ifdef NEO
tParticle->m_bHighlightInThermals = true;
#endif // NEO
}

// TODO: Play a sound?
Expand Down
18 changes: 18 additions & 0 deletions src/game/client/fx_explosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ void C_BaseExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -2.0f, 2.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}

Expand Down Expand Up @@ -371,6 +374,9 @@ void C_BaseExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -8.0f, 8.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
#endif // !_XBOX
Expand Down Expand Up @@ -439,6 +445,9 @@ void C_BaseExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -8.0f, 8.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
#endif
Expand Down Expand Up @@ -505,6 +514,9 @@ void C_BaseExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -8.0f, 8.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
#endif // !_XBOX
Expand Down Expand Up @@ -569,6 +581,9 @@ void C_BaseExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -16.0f, 16.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
}
Expand Down Expand Up @@ -1429,6 +1444,9 @@ void C_MegaBombExplosionEffect::CreateCore( void )

pParticle->m_flRoll = random->RandomInt( 0, 360 );
pParticle->m_flRollDelta = random->RandomFloat( -16.0f, 16.0f );
#ifdef NEO
pParticle->m_bHighlightInThermals = true;
#endif // NEO
}
}
}
Expand Down
Loading