Skip to content

Commit

Permalink
- All NPCs are now much more aware of spawnable props so that enemy N…
Browse files Browse the repository at this point in the history
…PCs will attack them upon encountering them, including if they are blocking the way to players

- Players can no longer collide with each other, thereby fixing any issues where players could get stuck inside other players when spawning and whatnot
- Support NPCs and deployed turrets no longer damage players' spawned props
- The RPG is now an equipment item rather than a primary weapon
- S.L.A.M. tripmines can no longer be set off by players, support NPCs, deployed turrets, or spawnable props
- Zombie and headcrab waves have now been combined into one zombie wave, where headcrabs have been re-added to all zombie types and have the possibility of releasing from their hosts
- NPCs that wield weapons (e.g. Combine soldiers and armed citizens) can no longer fire from insanely far distances, making them less effective overall
- Reworked the number of NPCs that spawn per wave based on more logical factors and additional play-testing (we used maths!), where players are now expected to progress further in the game overall (i.e. players will likely clear more waves per game now compared to the old system)
- Added a new weapon for the equipment slot: the vortex hopwire grenade
- Added challenge waves, where only one random type of NPC is spawned during the entire duration of the wave, that occur every 5 waves by default (this can be changed via ConVar by servers though)
- Fixed all known issues pertaining to contingency_overpass
- Fixed all known issues pertaining to contingency_bunker
- The maximum health of spawnable props is now shown on the prop spawning menu and the current health of a particular spawned prop is now shown when you put your crosshair over it
- There is now a 'teleport back to spawn' function that can be bound to a specific key ('m' by default), but it can only be used when you are truly stuck on something
- Players can no longer spawn props in ways that get them, other players or support NPCs directly stuck inside said props
- Fixed all known issues pertaining to contingency_factory
- Completely revamped contingency_ravine from scratch
- Added a concrete barrier to the prop spawning menu (costs 10 credits, has 200HP)

git-svn-id: svn://localhost/tmp/repo1/contingency-src@43 30810cc1-b6d0-431b-b769-74428ac0645e
  • Loading branch information
MadKowa authored and MadKowa committed Jan 7, 2012
1 parent 2ea89ef commit 3063ff8
Show file tree
Hide file tree
Showing 39 changed files with 2,888 additions and 367 deletions.
3 changes: 3 additions & 0 deletions src/game/client/client_hl2mp-2005.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ if exist "$(TargetDir)"client.pdb copy "$(TargetDir)"client.pdb "c:\program file
<ClCompile Include="..\shared\contingency\weapon_axe.cpp" />
<ClCompile Include="..\shared\contingency\weapon_deployableturret.cpp" />
<ClCompile Include="..\shared\contingency\weapon_healthkit.cpp" />
<ClCompile Include="..\shared\contingency\weapon_hopwire.cpp" />
<ClCompile Include="..\shared\contingency\weapon_nyangun.cpp" />
<ClCompile Include="..\shared\contingency\weapon_pistols.cpp" />
<ClCompile Include="..\shared\contingency\weapon_wrench.cpp" />
Expand Down Expand Up @@ -268,6 +269,7 @@ if exist "$(TargetDir)"client.pdb copy "$(TargetDir)"client.pdb "c:\program file
<ClCompile Include="contingency\c_contingency_spawnableprop.cpp" />
<ClCompile Include="contingency\c_npc_citizen17.cpp" />
<ClCompile Include="contingency\c_npc_contingency_turret.cpp" />
<ClCompile Include="contingency\c_weapon_hopwire.cpp" />
<ClCompile Include="contingency\hud_contingency_chat.cpp" />
<ClCompile Include="contingency\hud_contingency_credits.cpp" />
<ClCompile Include="contingency\hud_contingency_damageindicator.cpp" />
Expand Down Expand Up @@ -896,6 +898,7 @@ if exist "$(TargetDir)"client.pdb copy "$(TargetDir)"client.pdb "c:\program file
<ClInclude Include="..\shared\contingency\contingency_system_phase.h" />
<ClInclude Include="..\shared\contingency\contingency_system_propspawning.h" />
<ClInclude Include="..\shared\contingency\contingency_system_wave.h" />
<ClInclude Include="..\shared\contingency\weapon_hopwire.h" />
<ClInclude Include="achievement_notification_panel.h" />
<ClInclude Include="..\shared\achievement_saverestore.h" />
<ClInclude Include="..\shared\achievementmgr.h" />
Expand Down
15 changes: 12 additions & 3 deletions src/game/client/client_hl2mp-2005.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,6 @@
<ClCompile Include="c_basetempentity.cpp">
<Filter>Source Files\Temporary Entities</Filter>
</ClCompile>
<ClCompile Include="c_effects.cpp">
<Filter>Source Files\Temporary Entities</Filter>
</ClCompile>
<ClCompile Include="c_impact_effects.cpp">
<Filter>Source Files\Temporary Entities</Filter>
</ClCompile>
Expand Down Expand Up @@ -1644,6 +1641,15 @@
<ClCompile Include="contingency\creditslist.cpp">
<Filter>Source Files\Contingency\UI</Filter>
</ClCompile>
<ClCompile Include="c_effects.cpp">
<Filter>Source Files\Contingency\Modified Engine Files</Filter>
</ClCompile>
<ClCompile Include="..\shared\contingency\weapon_hopwire.cpp">
<Filter>Source Files\Contingency\Weapons</Filter>
</ClCompile>
<ClCompile Include="contingency\c_weapon_hopwire.cpp">
<Filter>Source Files\Contingency\Weapons</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="achievement_notification_panel.h">
Expand Down Expand Up @@ -3503,6 +3509,9 @@
<ClInclude Include="contingency\creditslist.h">
<Filter>Source Files\Contingency\UI</Filter>
</ClInclude>
<ClInclude Include="..\shared\contingency\weapon_hopwire.h">
<Filter>Source Files\Contingency\Weapons</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Library Include="..\..\lib\public\bitmap.lib">
Expand Down
60 changes: 44 additions & 16 deletions src/game/client/contingency/c_contingency_spawnableprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

IMPLEMENT_CLIENTCLASS_DT( C_Contingency_SpawnableProp, DT_Contingency_SpawnableProp, CContingency_SpawnableProp )
RecvPropEHandle( RECVINFO(m_hSpawnerPlayer) ),
RecvPropBool( RECVINFO(m_bIsFrozen) ),
END_RECV_TABLE()

CUtlVector<C_Contingency_SpawnableProp*> m_SpawnablePropList = NULL;
Expand All @@ -30,25 +29,54 @@ const char* C_Contingency_SpawnableProp::GetOwnerDisplay( void )
{
C_Contingency_Player *pPlayer = ToContingencyPlayer( GetSpawnerPlayer() );
if ( !pPlayer )
return "Orphaned Prop";

if ( pPlayer == C_Contingency_Player::GetLocalContingencyPlayer() )
return "Your Prop";

char szOwnerDisplay[256];
Q_snprintf( szOwnerDisplay, sizeof(szOwnerDisplay), "%s's Prop", pPlayer->GetPlayerName() );
return szOwnerDisplay;
}

const char* C_Contingency_SpawnableProp::GetHealthCondition( void )
{
if ( m_iHealth <= 0 )
return "DESTROYED";

float ratio = ((float)m_iHealth) / ((float)m_iMaxHealth);
if ( (ratio <= 1.00) && (ratio >= 0.00) )
{
if ( m_bIsFrozen )
return "Orphaned Prop";
else
return "Orphaned Prop (Unfrozen)";
if ( ratio >= 0.75 )
return "Structurally Sound";
else if ( ratio >= 0.50 )
return "Damaged";
else if ( ratio >= 0.25 )
return "Severely Damaged";
else if ( ratio < 0.25 )
return "Critically Damaged";
}

if ( pPlayer == C_Contingency_Player::GetLocalContingencyPlayer() )
return "Condition Unknown";
}

Color C_Contingency_SpawnableProp::GetHealthConditionColor( void )
{
if ( m_iHealth <= 0 )
return Color( 204, 0, 0, 255 ); // dark(er) red

float ratio = ((float)m_iHealth) / ((float)m_iMaxHealth);
if ( (ratio <= 1.00) && (ratio >= 0.00) )
{
if ( m_bIsFrozen )
return "Your Prop";
else
return "Your Prop (Unfrozen)";
if ( ratio >= 0.75 )
return Color( 0, 255, 0, 255 ); // green
else if ( ratio >= 0.50 )
return Color( 255, 204, 0, 255 ); // yellow
else if ( ratio >= 0.25 )
return Color( 255, 153, 0, 255 ); // orange
else if ( ratio < 0.25 )
return Color( 255, 0, 0, 255 ); // red
}

char szOwnerDisplay[256];
if ( m_bIsFrozen )
Q_snprintf( szOwnerDisplay, sizeof(szOwnerDisplay), "%s's Prop", pPlayer->GetPlayerName() );
else
Q_snprintf( szOwnerDisplay, sizeof(szOwnerDisplay), "%s's Prop (Unfrozen)", pPlayer->GetPlayerName() );
return szOwnerDisplay;
return Color( 255, 255, 255, 255 ); // white
}
13 changes: 5 additions & 8 deletions src/game/client/contingency/c_contingency_spawnableprop.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,25 @@
#define C_CONTINGENCY_SPAWNABLEPROP_H
#pragma once

#include "cbase.h"
#include "c_physicsprop.h"
#include "c_ai_basenpc.h"

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

class C_Contingency_SpawnableProp : public C_PhysicsProp
class C_Contingency_SpawnableProp : public C_AI_BaseNPC
{
public:
DECLARE_CLASS( C_Contingency_SpawnableProp, C_PhysicsProp );
DECLARE_CLASS( C_Contingency_SpawnableProp, C_AI_BaseNPC );
DECLARE_CLIENTCLASS();

C_Contingency_SpawnableProp();
virtual ~C_Contingency_SpawnableProp();

const char* GetOwnerDisplay( void );
const char* GetHealthCondition( void );
Color GetHealthConditionColor( void );

CBasePlayer *GetSpawnerPlayer( void ) { return m_hSpawnerPlayer; }

private:
CHandle<CBasePlayer> m_hSpawnerPlayer;
bool m_bIsFrozen;

C_Contingency_SpawnableProp( const C_Contingency_SpawnableProp & ); // not defined, not accessible
};
Expand Down
Loading

0 comments on commit 3063ff8

Please sign in to comment.