Skip to content

Commit

Permalink
Merged in ez2/feature/vortigaunt-all-blasts-boogie (pull request mapb…
Browse files Browse the repository at this point in the history
…ase-source#170)

Allowed regular vortigaunt blasts to initiate ragdoll boogie + fixed potential issues with the dispel boogie
  • Loading branch information
1upD committed Aug 8, 2021
2 parents 28ad1b4 + 3e83a4b commit 7eca1c6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 9 deletions.
13 changes: 12 additions & 1 deletion sp/src/game/server/basecombatcharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ BEGIN_DATADESC( CBaseCombatCharacter )
DEFINE_INPUT( m_bForceServerRagdoll, FIELD_BOOLEAN, "SetForceServerRagdoll" ),
#else
DEFINE_FIELD( m_bForceServerRagdoll, FIELD_BOOLEAN ),
#endif
#ifdef EZ
DEFINE_FIELD( m_hDeathRagdoll, FIELD_EHANDLE ),
#endif
DEFINE_FIELD( m_bPreventWeaponPickup, FIELD_BOOLEAN ),

Expand Down Expand Up @@ -1726,6 +1729,9 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
// with their vehicle - for more dramatic death/collisions
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, info2, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
FixupBurningServerRagdoll( pRagdoll );
#ifdef EZ
m_hDeathRagdoll = pRagdoll;
#endif
RemoveDeferred();
return true;
}
Expand All @@ -1740,6 +1746,9 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
{
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_DEBRIS );
FixupBurningServerRagdoll( pRagdoll );
#ifdef EZ
m_hDeathRagdoll = pRagdoll;
#endif
RemoveDeferred();
return true;
}
Expand All @@ -1761,7 +1770,9 @@ bool CBaseCombatCharacter::BecomeRagdoll( const CTakeDamageInfo &info, const Vec
//FIXME: This is fairly leafy to be here, but time is short!
CBaseEntity *pRagdoll = CreateServerRagdoll( this, m_nForceBone, newinfo, COLLISION_GROUP_INTERACTIVE_DEBRIS, true );
FixupBurningServerRagdoll( pRagdoll );
#ifndef EZ
#ifdef EZ
m_hDeathRagdoll = pRagdoll;
#else
PhysSetEntityGameFlags( pRagdoll, FVPHYSICS_NO_SELF_COLLISIONS );
#endif
RemoveDeferred();
Expand Down
4 changes: 4 additions & 0 deletions sp/src/game/server/basecombatcharacter.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ class CBaseCombatCharacter : public CBaseFlex

bool m_bForceServerRagdoll;

#ifdef EZ
EHANDLE m_hDeathRagdoll;
#endif

// Pickup prevention
bool IsAllowedToPickupWeapons( void ) { return !m_bPreventWeaponPickup; }
void SetPreventWeaponPickup( bool bPrevent ) { m_bPreventWeaponPickup = bPrevent; }
Expand Down
33 changes: 25 additions & 8 deletions sp/src/game/server/hl2/npc_vortigaunt_episodic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2758,6 +2758,20 @@ void CNPC_Vortigaunt::ZapBeam( int nHand )

// Send the damage to the recipient
pEntity->DispatchTraceAttack( dmgInfo, vecAim, &tr );

#ifdef EZ
ApplyMultiDamage();

if (pEntity->IsCombatCharacter() && pEntity->m_lifeState != LIFE_ALIVE)
{
CBaseCombatCharacter *pBCC = pEntity->MyCombatCharacterPointer();
if (!pBCC->IsEFlagSet( EFL_NO_MEGAPHYSCANNON_RAGDOLL ) && pBCC->m_hDeathRagdoll)
{
CRagdollBoogie::Create( pBCC->m_hDeathRagdoll, 200, gpGlobals->curtime, 4.0f, SF_RAGDOLL_BOOGIE_ELECTRICAL, &g_vecVortBoogieColor );
//pBCC->BecomeRagdollBoogie( this, dmgInfo.GetDamageForce(), 4.0f, SF_RAGDOLL_BOOGIE_ELECTRICAL, &g_vecVortBoogieColor );
}
}
#endif
}

// Create a cover for the end of the beam
Expand Down Expand Up @@ -3376,15 +3390,18 @@ void CNPC_Vortigaunt::DispelAntlions( const Vector &vecOrigin, float flRadius, b
// gib nearby antlions, knock over distant ones.
if ( flDist < 128 )
{
if ( pNPC->CanBecomeServerRagdoll() && !pNPC->IsEFlagSet( EFL_NO_MEGAPHYSCANNON_RAGDOLL ) && pNPC->m_iHealth - flDamage <= 0.0f)
{
pNPC->BecomeRagdollBoogie( this, vecDir, 5.0f, SF_RAGDOLL_BOOGIE_ELECTRICAL, &g_vecVortBoogieColor );
}
else
vecDir[2] += 400.0f * flFalloff;
CTakeDamageInfo dmgInfo( this, this, vecDir, pNPC->GetAbsOrigin(), flDamage, DMG_SHOCK );
pNPC->TakeDamage( dmgInfo );

if (pEntity->IsCombatCharacter() && pEntity->m_lifeState != LIFE_ALIVE)
{
vecDir[2] += 400.0f * flFalloff;
CTakeDamageInfo dmgInfo( this, this, vecDir, pNPC->GetAbsOrigin(), flDamage, DMG_SHOCK );
pNPC->TakeDamage( dmgInfo );
CBaseCombatCharacter *pBCC = pEntity->MyCombatCharacterPointer();
if (!pBCC->IsEFlagSet( EFL_NO_MEGAPHYSCANNON_RAGDOLL ) && pBCC->m_hDeathRagdoll)
{
CRagdollBoogie::Create( pBCC->m_hDeathRagdoll, 200, gpGlobals->curtime, 5.0f, SF_RAGDOLL_BOOGIE_ELECTRICAL, &g_vecVortBoogieColor );
//pBCC->BecomeRagdollBoogie( this, dmgInfo.GetDamageForce(), 4.0f, SF_RAGDOLL_BOOGIE_ELECTRICAL, &g_vecVortBoogieColor );
}
}
}
}
Expand Down

0 comments on commit 7eca1c6

Please sign in to comment.