removed HL2DM TEAM_COMBINE / REBELS references so i can start working on dynamic teams crap clientside

This commit is contained in:
Dexter 2013-11-09 19:15:04 +00:00 committed by squeek
parent f0757e06f2
commit 0cff262bdd
6 changed files with 76 additions and 91 deletions

View file

@ -9,8 +9,9 @@
#include "c_team.h" #include "c_team.h"
#include "gamestringpool.h" #include "gamestringpool.h"
#ifdef HL2MP #ifdef FF
#include "ff_sh_gamerules.h" #include "ff_sh_gamerules.h"
#include "ff_sh_shareddefs.h"
#endif #endif
// memdbgon must be the last include file in a .cpp file!!! // memdbgon must be the last include file in a .cpp file!!!
@ -65,12 +66,16 @@ C_PlayerResource::C_PlayerResource()
m_Colors[i] = COLOR_GREY; m_Colors[i] = COLOR_GREY;
} }
#ifdef HL2MP #ifdef FF
m_Colors[TEAM_COMBINE] = COLOR_BLUE; // FF TODO
m_Colors[TEAM_REBELS] = COLOR_RED; m_Colors[FF_TEAM_ONE] = COLOR_RED;
m_Colors[TEAM_UNASSIGNED] = COLOR_YELLOW; m_Colors[FF_TEAM_TWO] = COLOR_GREEN;
m_Colors[FF_TEAM_THREE] = COLOR_BLUE;
m_Colors[FF_TEAM_FOUR] = COLOR_YELLOW;
m_Colors[FF_TEAM_FIVE] = COLOR_BLACK;
m_Colors[FF_TEAM_SIX] = COLOR_WHITE;
#endif #endif
g_PR = this; g_PR = this;
} }

View file

@ -104,12 +104,14 @@ Color CHudChat::GetClientColor( int clientIndex )
} }
else if( g_PR ) else if( g_PR )
{ {
switch ( g_PR->GetTeam( clientIndex ) ) // FF TODO:
{ return g_ColorYellow;
case TEAM_COMBINE : return g_ColorBlue; //switch ( g_PR->GetTeam( clientIndex ) )
case TEAM_REBELS : return g_ColorRed; //{
default : return g_ColorYellow; //case TEAM_COMBINE : return g_ColorBlue;
} //case TEAM_REBELS : return g_ColorRed;
//default : return g_ColorYellow;
//}
} }
return g_ColorYellow; return g_ColorYellow;

View file

@ -12,6 +12,7 @@
#include "c_playerresource.h" #include "c_playerresource.h"
#include "ff_cl_player.h" #include "ff_cl_player.h"
#include "ff_sh_gamerules.h" #include "ff_sh_gamerules.h"
#include "ff_sh_shareddefs.h"
#include <KeyValues.h> #include <KeyValues.h>
@ -335,8 +336,9 @@ void CHL2MPClientScoreBoardDialog::InitScoreboardSections()
if ( FFRules()->IsTeamplay() ) if ( FFRules()->IsTeamplay() )
{ {
// add the team sections // add the team sections
AddSection( TYPE_TEAM, TEAM_COMBINE ); // FF TODO: how do into dynamic teams
AddSection( TYPE_TEAM, TEAM_REBELS ); AddSection( TYPE_TEAM, FF_TEAM_ONE );
AddSection( TYPE_TEAM, FF_TEAM_TWO );
} }
else else
{ {
@ -495,16 +497,18 @@ void CHL2MPClientScoreBoardDialog::AddSection(int teamType, int teamNumber)
int CHL2MPClientScoreBoardDialog::GetSectionFromTeamNumber( int teamNumber ) int CHL2MPClientScoreBoardDialog::GetSectionFromTeamNumber( int teamNumber )
{ {
// FF hacked in, need to do proper scoreboard
switch ( teamNumber ) switch ( teamNumber )
{ {
case TEAM_COMBINE: case FF_TEAM_ONE:
return SCORESECTION_COMBINE; return SCORESECTION_COMBINE;
case TEAM_REBELS: case FF_TEAM_TWO:
return SCORESECTION_REBELS; return SCORESECTION_REBELS;
case TEAM_SPECTATOR: case TEAM_SPECTATOR:
return SCORESECTION_SPECTATOR; return SCORESECTION_SPECTATOR;
default: case FF_TEAM_UNASSIGNED:
return SCORESECTION_FREEFORALL; return SCORESECTION_FREEFORALL;
} }
return SCORESECTION_FREEFORALL; return SCORESECTION_FREEFORALL;
} }

View file

@ -343,7 +343,7 @@ void CFF_SV_Player::SetPlayerTeamModel( void )
if ( modelIndex == -1 || ValidatePlayerModel( szModelName ) == false ) if ( modelIndex == -1 || ValidatePlayerModel( szModelName ) == false )
{ {
szModelName = "models/Combine_Soldier.mdl"; szModelName = "models/Combine_Soldier.mdl";
m_iModelType = TEAM_COMBINE; m_iModelType = FF_TEAM_ONE;
char szReturnString[512]; char szReturnString[512];
@ -351,6 +351,16 @@ void CFF_SV_Player::SetPlayerTeamModel( void )
engine->ClientCommand ( edict(), szReturnString ); engine->ClientCommand ( edict(), szReturnString );
} }
if ( Q_stristr( szModelName, "models/human") )
{
int nHeads = ARRAYSIZE( g_ppszRandomCombineModels );
g_iLastCitizenModel = ( g_iLastCitizenModel + 1 ) % nHeads;
szModelName = g_ppszRandomCitizenModels[g_iLastCombineModel];
}
m_iModelType = FF_TEAM_ONE;
/* FF TODO: team & class model crap here
if ( GetTeamNumber() == TEAM_COMBINE ) if ( GetTeamNumber() == TEAM_COMBINE )
{ {
if ( Q_stristr( szModelName, "models/human") ) if ( Q_stristr( szModelName, "models/human") )
@ -374,7 +384,7 @@ void CFF_SV_Player::SetPlayerTeamModel( void )
} }
m_iModelType = TEAM_REBELS; m_iModelType = TEAM_REBELS;
} }*/
SetModel( szModelName ); SetModel( szModelName );
SetupPlayerSoundsByModel( szModelName ); SetupPlayerSoundsByModel( szModelName );
@ -403,55 +413,15 @@ void CFF_SV_Player::SetPlayerModel( void )
szModelName = pszCurrentModelName; szModelName = pszCurrentModelName;
} }
// FF TODO: team models and stuff
int nHeads = ARRAYSIZE( g_ppszRandomCitizenModels );
if ( GetTeamNumber() == TEAM_COMBINE ) g_iLastCitizenModel = ( g_iLastCitizenModel + 1 ) % nHeads;
{ szModelName = g_ppszRandomCitizenModels[g_iLastCitizenModel];
int nHeads = ARRAYSIZE( g_ppszRandomCombineModels );
g_iLastCombineModel = ( g_iLastCombineModel + 1 ) % nHeads;
szModelName = g_ppszRandomCombineModels[g_iLastCombineModel];
m_iModelType = TEAM_COMBINE;
}
else if ( GetTeamNumber() == TEAM_REBELS )
{
int nHeads = ARRAYSIZE( g_ppszRandomCitizenModels );
g_iLastCitizenModel = ( g_iLastCitizenModel + 1 ) % nHeads;
szModelName = g_ppszRandomCitizenModels[g_iLastCitizenModel];
m_iModelType = TEAM_REBELS;
}
else
{
if ( Q_strlen( szModelName ) == 0 )
{
szModelName = g_ppszRandomCitizenModels[0];
}
if ( Q_stristr( szModelName, "models/human") )
{
m_iModelType = TEAM_REBELS;
}
else
{
m_iModelType = TEAM_COMBINE;
}
}
int modelIndex = modelinfo->GetModelIndex( szModelName );
if ( modelIndex == -1 )
{
szModelName = "models/Combine_Soldier.mdl";
m_iModelType = TEAM_COMBINE;
char szReturnString[512];
Q_snprintf( szReturnString, sizeof (szReturnString ), "cl_playermodel %s\n", szModelName );
engine->ClientCommand ( edict(), szReturnString );
}
m_iModelType = FF_TEAM_ONE;
SetModel( szModelName ); SetModel( szModelName );
SetupPlayerSoundsByModel( szModelName ); SetupPlayerSoundsByModel( szModelName );
@ -623,8 +593,8 @@ bool CFF_SV_Player::WantsLagCompensationOnEntity( const CBasePlayer *pPlayer, co
Activity CFF_SV_Player::TranslateTeamActivity( Activity ActToTranslate ) Activity CFF_SV_Player::TranslateTeamActivity( Activity ActToTranslate )
{ {
if ( m_iModelType == TEAM_COMBINE ) //if ( m_iModelType == TEAM_COMBINE )
return ActToTranslate; // return ActToTranslate;
if ( ActToTranslate == ACT_RUN ) if ( ActToTranslate == ACT_RUN )
return ACT_RUN_AIM_AGITATED; return ACT_RUN_AIM_AGITATED;

View file

@ -362,14 +362,15 @@ void CFF_SH_Rules::Think( void )
} }
// float flTimeLimit = mp_timelimit.GetFloat() * 60; // float flTimeLimit = mp_timelimit.GetFloat() * 60;
float flFragLimit = fraglimit.GetFloat();
if ( GetMapRemainingTime() < 0 ) if ( GetMapRemainingTime() < 0 )
{ {
GoToIntermission(); GoToIntermission();
return; return;
} }
// FF TODO: removed fraglimit checking by team crap
/*float flFragLimit = fraglimit.GetFloat();
if ( flFragLimit ) if ( flFragLimit )
{ {
if( IsTeamplay() == true ) if( IsTeamplay() == true )
@ -397,7 +398,7 @@ void CFF_SH_Rules::Think( void )
} }
} }
} }
} }*/
if ( gpGlobals->curtime > m_tmNextPeriodicThink ) if ( gpGlobals->curtime > m_tmNextPeriodicThink )
{ {
@ -835,7 +836,17 @@ void CFF_SH_Rules::ClientSettingsChanged( CBasePlayer *pPlayer )
return; return;
} }
if (FFRules()->IsTeamplay() == false ) // FF TODO: HL2DM had some thing where it would change your team based on model , just removed
pFFPlayer->SetPlayerModel();
const char *pszCurrentModelName = modelinfo->GetModelName( pFFPlayer->GetModel() );
char szReturnString[128];
Q_snprintf( szReturnString, sizeof( szReturnString ), "Your player model is: %s\n", pszCurrentModelName );
ClientPrint( pFFPlayer, HUD_PRINTTALK, szReturnString );
/*
if ( FFRules()->IsTeamplay() == false )
{ {
pFFPlayer->SetPlayerModel(); pFFPlayer->SetPlayerModel();
@ -856,7 +867,7 @@ void CFF_SH_Rules::ClientSettingsChanged( CBasePlayer *pPlayer )
{ {
pFFPlayer->ChangeTeam( TEAM_COMBINE ); pFFPlayer->ChangeTeam( TEAM_COMBINE );
} }
} }*/
} }
if ( sv_report_client_settings.GetInt() == 1 ) if ( sv_report_client_settings.GetInt() == 1 )
{ {
@ -870,6 +881,7 @@ void CFF_SH_Rules::ClientSettingsChanged( CBasePlayer *pPlayer )
int CFF_SH_Rules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget ) int CFF_SH_Rules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget )
{ {
// FF TODO: expose to lua?
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
// half life multiplay has a simple concept of Player Relationships. // half life multiplay has a simple concept of Player Relationships.
// you are either on another player's team, or you are not. // you are either on another player's team, or you are not.
@ -887,6 +899,7 @@ int CFF_SH_Rules::PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget
const char *CFF_SH_Rules::GetGameDescription( void ) const char *CFF_SH_Rules::GetGameDescription( void )
{ {
// FF TODO: expose to lua
if ( IsTeamplay() ) if ( IsTeamplay() )
return "Team Deathmatch"; return "Team Deathmatch";
@ -1008,7 +1021,7 @@ CAmmoDef *GetAmmoDef()
int count = 1; int count = 1;
count = clamp( count, 1, 16 ); count = clamp( count, 1, 16 );
int iTeam = TEAM_COMBINE; int iTeam = FF_TEAM_ONE; // FF hack: put in first team
// Look at -frozen. // Look at -frozen.
bool bFrozen = false; bool bFrozen = false;
@ -1078,20 +1091,17 @@ void CFF_SH_Rules::RestartGame()
} }
// Respawn entities (glass, doors, etc..) // Respawn entities (glass, doors, etc..)
for ( int idx = 0; idx < g_Teams.Count(); idx++ )
CTeam *pRebels = GetGlobalTeam( TEAM_REBELS );
CTeam *pCombine = GetGlobalTeam( TEAM_COMBINE );
if ( pRebels )
{ {
pRebels->SetScore( 0 ); if ( !g_Teams[idx] )
} continue;
int iTeamNum = g_Teams[idx]->GetTeamNumber( );
if ( iTeamNum == FF_TEAM_UNASSIGNED || iTeamNum == FF_TEAM_SPECTATE )
continue;
if ( pCombine ) g_Teams[idx]->SetScore( 0 );
{
pCombine->SetScore( 0 );
} }
m_flIntermissionEndTime = 0; m_flIntermissionEndTime = 0;
m_flRestartGameTime = 0.0; m_flRestartGameTime = 0.0;
m_bCompleteReset = false; m_bCompleteReset = false;

View file

@ -26,12 +26,6 @@
#define VEC_CROUCH_TRACE_MIN FFRules()->GetFFViewVectors()->m_vCrouchTraceMin #define VEC_CROUCH_TRACE_MIN FFRules()->GetFFViewVectors()->m_vCrouchTraceMin
#define VEC_CROUCH_TRACE_MAX FFRules()->GetFFViewVectors()->m_vCrouchTraceMax #define VEC_CROUCH_TRACE_MAX FFRules()->GetFFViewVectors()->m_vCrouchTraceMax
enum
{
TEAM_COMBINE = 2,
TEAM_REBELS,
};
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
#define CFF_SH_Rules CFF_CL_Rules #define CFF_SH_Rules CFF_CL_Rules