Skip to content

Commit

Permalink
squish non-boss aliens when a MOVETYPE_PUSH entity hits them
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLubar committed Nov 16, 2024
1 parent 23a6b82 commit 7ab0c8c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/game/server/physics_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
#include "pushentity.h"
#include "igamemovement.h"

#ifdef INFESTED_DLL
#include "asw_alien_shover.h"
#include "asw_alien_jumper.h"
#include "asw_queen.h"
#endif

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

Expand All @@ -50,7 +56,13 @@ ConVar vprof_scope_entity_thinks( "vprof_scope_entity_thinks", "0" );
ConVar vprof_scope_entity_gamephys( "vprof_scope_entity_gamephys", "0" );

ConVar npc_vphysics ( "npc_vphysics","0");

#ifdef INFESTED_DLL
ConVar rd_interpenetrating_entities_warning( "rd_interpenetrating_entities_warning", "0" );
ConVar rd_pushables_damage_aliens( "rd_pushables_damage_aliens", "1", FCVAR_CHEAT );
ConVar rd_pushables_damage_aliens_per_tick( "rd_pushables_damage_aliens_per_tick", "10", FCVAR_CHEAT );
#endif

//-----------------------------------------------------------------------------
// helper method for trace hull as used by physics...
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -375,6 +387,16 @@ bool CPhysicsPushedEntities::SpeculativelyCheckPush( PhysicsPushedInfo_t &info,
}
}

#ifdef INFESTED_DLL
// doors hurt aliens except antlion guard, shieldbug, and queen
if ( rd_pushables_damage_aliens.GetBool() && pBlocker->m_takedamage == DAMAGE_YES && pBlocker->IsAlien() && ( !dynamic_cast<CASW_Alien_Shover *>( pBlocker ) || dynamic_cast< CASW_Alien_Jumper * >( pBlocker ) ) && !dynamic_cast<CASW_Queen *>( pBlocker ) )
{
CTakeDamageInfo crushinfo( m_rgPusher[0].m_pEntity, m_rgPusher[0].m_pEntity, rd_pushables_damage_aliens_per_tick.GetFloat(), DMG_CRUSH );
pBlocker->DispatchTraceAttack( crushinfo, vecAbsPush, &info.m_Trace );
ApplyMultiDamage();
}
#endif

pBlocker->SetAbsOrigin( org ); // restore origin...

DevMsg(2, "Blocked by player on train!\n");
Expand Down
1 change: 1 addition & 0 deletions src/game/server/swarm/asw_door.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ConVar asw_door_normal_health_base( "asw_door_normal_health_base", "1800", FCVAR
ConVar asw_door_normal_health_step( "asw_door_normal_health_step", "0", FCVAR_CHEAT | FCVAR_REPLICATED, "Increase/decrease in health for a non-reinforced door on for every mission difficulty above/below 5." );
ConVar asw_door_reinforced_health_base( "asw_door_reinforced_health_base", "2400", FCVAR_CHEAT, "Base health for a reinforced door on Normal." );
ConVar asw_door_reinforced_health_step( "asw_door_reinforced_health_step", "0", FCVAR_CHEAT, "Increase/decrease in health for a reinforced door on for every mission difficulty above/below 5." );
ConVar rd_door_force_closed( "rd_door_force_closed", "1", FCVAR_CHEAT );
extern ConVar asw_debug_marine_chatter;
extern ConVar asw_difficulty_alien_damage_step;

Expand Down

0 comments on commit 7ab0c8c

Please sign in to comment.