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
9 changes: 8 additions & 1 deletion game/bin/rebuild.fgd
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@

ForcedWeapon(integer) : "Forced Weapon" : -1 : "-1 = Do not force weapon"

Cyberspace(choices) : "Cyberspace Map?" : 0 =
[
0 : "No"
1 : "Yes"
]

spawnflags(flags) =
[
1 : "Hide Ammo" : 0
Expand All @@ -95,7 +101,8 @@
input FireDMPlayerWin(void) : "Trigger round win for the activator (Deathmatch only)"
input FireRoundTie(void) : "Trigger round tie"

output OnRoundEnd(void) : "Fires when a round ends"
output OnRoundEnd(integer) : "Fires when a round ends"
output OnDMRoundEnd(void) : "Fires when a DM round ends"
output OnRoundStart(void) : "Fires when a round starts"
output OnCompetitive(void) : "Fires when competitive mode is enabled"
]
Expand Down
8 changes: 8 additions & 0 deletions src/game/client/neo/game_controls/neo_classmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ void CNeoClassMenu::UpdateSkinImages(int classNumber, int overrideTeamNumber)
return;
}

if (NEORules()->IsCyberspace())
{
m_pSkin1_Button->SetButtonTexture(classNumber == NEO_CLASS_RECON ? (teamNumber == TEAM_JINRAI ? "vgui/cm/jinrai_dummy" : "vgui/cm/nsf_dummy") : "vgui/cm/none");
m_pSkin2_Button->SetButtonTexture(classNumber == NEO_CLASS_ASSAULT ? (teamNumber == TEAM_JINRAI ? "vgui/cm/jinrai_dummy" : "vgui/cm/nsf_dummy") : "vgui/cm/none");
m_pSkin3_Button->SetButtonTexture(classNumber == NEO_CLASS_SUPPORT ? (teamNumber == TEAM_JINRAI ? "vgui/cm/jinrai_dummy" : "vgui/cm/nsf_dummy") : "vgui/cm/none");
return;
}

m_pSkin1_Button->SetButtonTexture(playerModels[teamNumber * 9 + (classNumber * 3) + 0]);
m_pSkin2_Button->SetButtonTexture(playerModels[teamNumber * 9 + (classNumber * 3) + 1]);
m_pSkin3_Button->SetButtonTexture(playerModels[teamNumber * 9 + (classNumber * 3) + 2]);
Expand Down
11 changes: 1 addition & 10 deletions src/game/client/viewrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@
// Projective textures
#include "C_Env_Projected_Texture.h"

#ifdef NEO
// For removing screen overlays when in vision modes
#include "c_neo_player.h"
#endif

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

Expand Down Expand Up @@ -1246,12 +1241,8 @@ IMaterial *CViewRender::GetScreenOverlayMaterial( )
void CViewRender::PerformScreenOverlay( int x, int y, int w, int h )
{
VPROF("CViewRender::PerformScreenOverlay()");
#ifdef NEO
C_NEO_Player* pLocalPlayer = C_NEO_Player::GetLocalNEOPlayer();
if (m_ScreenOverlayMaterial && !pLocalPlayer->m_bInVision)
#else

if (m_ScreenOverlayMaterial)
#endif
{
tmZone( TELEMETRY_LEVEL0, TMZF_NONE, "%s", __FUNCTION__ );

Expand Down
30 changes: 8 additions & 22 deletions src/game/server/neo/neo_game_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ BEGIN_DATADESC(CNEOGameConfig)
DEFINE_KEYFIELD(m_ForcedClass, FIELD_INTEGER, "ForcedClass"),
DEFINE_KEYFIELD(m_ForcedSkin, FIELD_INTEGER, "ForcedSkin"),
DEFINE_KEYFIELD(m_ForcedWeapon, FIELD_INTEGER, "ForcedWeapon"),
DEFINE_KEYFIELD(m_Cyberspace, FIELD_BOOLEAN, "Cyberspace"),

DEFINE_INPUTFUNC(FIELD_INTEGER, "FireTeamWin", InputFireTeamWin),
DEFINE_INPUTFUNC(FIELD_VOID, "FireDMPlayerWin", InputFireDMPlayerWin),
DEFINE_INPUTFUNC(FIELD_VOID, "FireRoundTie", InputFireRoundTie),

DEFINE_OUTPUT(m_OnRoundEnd, "OnRoundEnd"),
DEFINE_OUTPUT(m_OnDMRoundEnd, "OnDMRoundEnd"),
DEFINE_OUTPUT(m_OnRoundStart, "OnRoundStart"),
DEFINE_OUTPUT(m_OnCompetitive, "OnCompetitive")
END_DATADESC()

CNEOGameConfig* CNEOGameConfig::s_pGameRulesToConfig = nullptr;
extern ConVar sv_neo_comp;

void CNEOGameConfig::Spawn()
{
BaseClass::Spawn();

s_pGameRulesToConfig = this;
if (sv_neo_comp.GetBool())
{
m_OnCompetitive.FireOutput(nullptr, this);
}
}

// Inputs
Expand Down Expand Up @@ -56,22 +59,5 @@ void CNEOGameConfig::InputFireDMPlayerWin(inputdata_t& inputData)

void CNEOGameConfig::InputFireRoundTie(inputdata_t& inputData)
{
NEORules()->SetWinningTeam(1, NEO_VICTORY_STALEMATE, false, true, true, false);
}

// Outputs

void CNEOGameConfig::OutputRoundEnd()
{
m_OnRoundEnd.FireOutput(NULL, this);
}

void CNEOGameConfig::OutputRoundStart()
{
m_OnRoundStart.FireOutput(NULL, this);
}

void CNEOGameConfig::OutputCompetitive()
{
m_OnCompetitive.FireOutput(NULL, this);
NEORules()->SetWinningTeam(TEAM_SPECTATOR, NEO_VICTORY_STALEMATE, false, true, true, false);
}
12 changes: 4 additions & 8 deletions src/game/server/neo/neo_game_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,23 @@ class CNEOGameConfig : public CLogicalEntity
DECLARE_DATADESC();

public:
void Spawn() override;
static CNEOGameConfig* s_pGameRulesToConfig;
virtual void Spawn() override;

int m_GameType = NEO_GAME_TYPE_TDM;
int m_HiddenHudElements = 0;
int m_ForcedTeam = -1;
int m_ForcedClass = -1;
int m_ForcedSkin = -1;
int m_ForcedWeapon = -1;
bool m_Cyberspace = false;

// Inputs
void InputFireTeamWin(inputdata_t& inputData);
void InputFireDMPlayerWin(inputdata_t& inputData);
void InputFireRoundTie(inputdata_t& inputData);

// Outputs
void OutputRoundEnd();
void OutputRoundStart();
void OutputCompetitive();

COutputEvent m_OnRoundEnd;
COutputInt m_OnRoundEnd;
COutputEvent m_OnDMRoundEnd;
COutputEvent m_OnRoundStart;
COutputEvent m_OnCompetitive;
};
21 changes: 19 additions & 2 deletions src/game/server/neo/neo_model_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ const char *weapons[NEO_WEP_MDL_ENUM_COUNT] {
#endif
};

const char *dummyModels [numClasses] {
"models/tutorial/dummy_small.mdl",
"models/tutorial/dummy_medium.mdl",
"models/tutorial/dummy_large.mdl",
};

const char *vipModel = "models/player/vip.mdl";
const char *vipModelDead = "models/player/vip_dead.mdl";
const char *vipSmacViewModel = "models/weapons/v_vip_smac.mdl";
Expand All @@ -374,12 +380,18 @@ const char *jgrModel = "models/player/jgr.mdl";

static inline void PrecachePlayerModels( void )
{
const int size = ARRAYSIZE(playerModels);
for (int i = 0; i < size; i++)
const int pmsize = ARRAYSIZE(playerModels);
for (int i = 0; i < pmsize; i++)
{
CBaseEntity::PrecacheModel(playerModels[i]);
}

const int dmsize = ARRAYSIZE(dummyModels);
for (int i = 0; i < dmsize; i++)
{
CBaseEntity::PrecacheModel(dummyModels[i]);
}

CBaseEntity::PrecacheModel(vipModel);
CBaseEntity::PrecacheModel(jgrModel);
}
Expand Down Expand Up @@ -554,6 +566,11 @@ const char *CNEOModelManager::GetPlayerModel(NeoSkin nSkin,
nClass = NEO_CLASS_ASSAULT;
}

if (NEORules()->IsCyberspace())
{
return dummyModels[nClass];
}

const int index =
(NEO_SKIN_ENUM_COUNT * numClasses * GetTeamArrOffset(iTeam))
+ (NEO_SKIN_ENUM_COUNT * nClass)
Expand Down
5 changes: 5 additions & 0 deletions src/game/server/neo/neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,11 @@ void CNEO_Player::SetPlayerTeamModel( void )
return;
}

if (NEORules()->IsCyberspace())
{
m_bAllowGibbing = false;
}

SetModel(model);
SetPlaybackRate(1.0f);
//ResetAnimation();
Expand Down
56 changes: 32 additions & 24 deletions src/game/shared/neo/neo_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules )
RecvPropInt(RECVINFO(m_iForcedClass)),
RecvPropInt(RECVINFO(m_iForcedSkin)),
RecvPropInt(RECVINFO(m_iForcedWeapon)),
RecvPropBool(RECVINFO(m_bCyberspaceLevel)),
RecvPropString(RECVINFO(m_szNeoJinraiClantag)),
RecvPropString(RECVINFO(m_szNeoNSFClantag)),
RecvPropInt(RECVINFO(m_iGhosterTeam)),
Expand All @@ -255,6 +256,7 @@ BEGIN_NETWORK_TABLE_NOBASE( CNEORules, DT_NEORules )
SendPropInt(SENDINFO(m_iForcedClass)),
SendPropInt(SENDINFO(m_iForcedSkin)),
SendPropInt(SENDINFO(m_iForcedWeapon)),
SendPropBool(SENDINFO(m_bCyberspaceLevel)),
SendPropString(SENDINFO(m_szNeoJinraiClantag)),
SendPropString(SENDINFO(m_szNeoNSFClantag)),
SendPropInt(SENDINFO(m_iGhosterTeam)),
Expand Down Expand Up @@ -500,6 +502,11 @@ static void CvarChanged_WeaponStay(IConVar* convar, const char* pOldVal, float f
wep = gEntList.NextEntByClass(wep);
}
}

static CNEOGameConfig *GetActiveGameConfig()
{
return static_cast<CNEOGameConfig*>(gEntList.FindEntityByClassname(nullptr, "neo_game_config"));
}
#endif

CNEORules::CNEORules()
Expand Down Expand Up @@ -530,6 +537,7 @@ CNEORules::CNEORules()
m_iForcedClass = -1;
m_iForcedSkin = -1;
m_iForcedWeapon = -1;
m_bCyberspaceLevel = false;

ResetMapSessionCommon();
ListenForGameEvent("round_start");
Expand Down Expand Up @@ -889,33 +897,28 @@ void CNEORules::CheckGameType()
} break;
default:
{
const auto pEntGameCfg = static_cast<CNEOGameConfig *>(gEntList.FindEntityByClassname(nullptr, "neo_game_config"));
m_nGameTypeSelected = (pEntGameCfg) ? pEntGameCfg->m_GameType : NEO_GAME_TYPE_CTG;
const auto pEntGameCfg = GetActiveGameConfig();
m_nGameTypeSelected = (pEntGameCfg) ? pEntGameCfg->m_GameType : NEO_GAME_TYPE_EMT;
} break;
}
m_bGamemodeTypeBeenInitialized = true;
iStaticInitOnCmd = iGamemodeEnforce;
iStaticInitOnRandAllow = iGamemodeRandAllow;

if (CNEOGameConfig::s_pGameRulesToConfig && sv_neo_comp.GetBool())
{
CNEOGameConfig::s_pGameRulesToConfig->OutputCompetitive();
}
}

void CNEORules::CheckHiddenHudElements()
void CNEORules::CheckGameConfig()
{
const auto pEntGameCfg = static_cast<CNEOGameConfig*>(gEntList.FindEntityByClassname(nullptr, "neo_game_config"));
CheckGameType();

const auto pEntGameCfg = GetActiveGameConfig();
m_iHiddenHudElements = (pEntGameCfg) ? pEntGameCfg->m_HiddenHudElements : 0;
}

void CNEORules::CheckPlayerForced()
{
const auto pEntGameCfg = static_cast<CNEOGameConfig*>(gEntList.FindEntityByClassname(nullptr, "neo_game_config"));
m_iForcedTeam = (pEntGameCfg) ? pEntGameCfg->m_ForcedTeam : -1;
m_iForcedClass = (pEntGameCfg) ? pEntGameCfg->m_ForcedClass : -1;
m_iForcedSkin = (pEntGameCfg) ? pEntGameCfg->m_ForcedSkin : -1;
m_iForcedWeapon = (pEntGameCfg) ? pEntGameCfg->m_ForcedWeapon : -1;

m_bCyberspaceLevel = (pEntGameCfg) ? pEntGameCfg->m_Cyberspace : false;
}
#endif

Expand All @@ -935,9 +938,7 @@ bool CNEORules::CheckShouldNotThink()
void CNEORules::Think(void)
{
#ifdef GAME_DLL
CheckHiddenHudElements();
CheckGameType();
CheckPlayerForced();
CheckGameConfig();
if (CheckShouldNotThink())
{
return;
Expand Down Expand Up @@ -1548,9 +1549,9 @@ void CNEORules::SetWinningDMPlayer(CNEO_Player *pWinner)
return;
}

if (CNEOGameConfig::s_pGameRulesToConfig)
if (auto pEntGameCfg = GetActiveGameConfig())
{
CNEOGameConfig::s_pGameRulesToConfig->OutputRoundEnd();
pEntGameCfg->m_OnDMRoundEnd.FireOutput(pWinner, pEntGameCfg);
}

SetRoundStatus(NeoRoundStatus::PostRound);
Expand Down Expand Up @@ -2858,9 +2859,11 @@ void CNEORules::CleanUpMap()

ResetGhostCapPoints();

if (CNEOGameConfig::s_pGameRulesToConfig && sv_neo_comp.GetBool())
// OnCompetitive needs to fire every time the map resets, along with all the entities, props, etc.
auto pEntGameCfg = GetActiveGameConfig();
if (pEntGameCfg && sv_neo_comp.GetBool())
{
CNEOGameConfig::s_pGameRulesToConfig->OutputCompetitive();
pEntGameCfg->m_OnCompetitive.FireOutput(nullptr, pEntGameCfg);
}
}

Expand Down Expand Up @@ -3332,9 +3335,9 @@ void CNEORules::SetWinningTeam(int team, int iWinReason, bool bForceMapReset, bo
return;
}

if (CNEOGameConfig::s_pGameRulesToConfig)
if (auto pEntGameCfg = GetActiveGameConfig())
{
CNEOGameConfig::s_pGameRulesToConfig->OutputRoundEnd();
pEntGameCfg->m_OnRoundEnd.Set(team, nullptr, pEntGameCfg);
}

if (bForceMapReset)
Expand Down Expand Up @@ -4154,9 +4157,9 @@ void CNEORules::SetRoundStatus(NeoRoundStatus status)
{
UTIL_CenterPrintAll("- GO! GO! GO! -\n");

if (CNEOGameConfig::s_pGameRulesToConfig)
if (auto pEntGameCfg = GetActiveGameConfig())
{
CNEOGameConfig::s_pGameRulesToConfig->OutputRoundStart();
pEntGameCfg->m_OnRoundStart.FireOutput(nullptr, pEntGameCfg);
}
}
#endif
Expand Down Expand Up @@ -4214,6 +4217,11 @@ int CNEORules::GetForcedWeapon(void)
return m_iForcedWeapon;
}

bool CNEORules::IsCyberspace()
{
return m_bCyberspaceLevel;
}

inline const char* CNEORules::GetGameTypeName(void)
{
return NEO_GAME_TYPE_SETTINGS[GetGameType()].gameTypeName;
Expand Down
5 changes: 3 additions & 2 deletions src/game/shared/neo/neo_gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class CNEORules : public CHL2MPRules, public CGameEventListener
int GetForcedClass();
int GetForcedSkin();
int GetForcedWeapon();
bool IsCyberspace();
virtual const char* GetGameTypeName(void) OVERRIDE;
bool CanChangeTeamClassLoadoutWhenAlive();
bool CanRespawnAnyTime();
Expand Down Expand Up @@ -302,8 +303,7 @@ class CNEORules : public CHL2MPRules, public CGameEventListener
bool ReadyUpPlayerIsReady(CNEO_Player *pNeoPlayer) const;

void CheckGameType();
void CheckHiddenHudElements();
void CheckPlayerForced();
void CheckGameConfig();
void StartNextRound();

virtual const char* GetChatFormat(bool bTeamOnly, CBasePlayer* pPlayer) OVERRIDE;
Expand Down Expand Up @@ -439,6 +439,7 @@ class CNEORules : public CHL2MPRules, public CGameEventListener
CNetworkVar(int, m_iForcedClass);
CNetworkVar(int, m_iForcedSkin);
CNetworkVar(int, m_iForcedWeapon);
CNetworkVar(bool, m_bCyberspaceLevel);
CNetworkVar(int, m_nGameTypeSelected);
CNetworkVar(int, m_iRoundNumber);
CNetworkString(m_szNeoJinraiClantag, NEO_MAX_CLANTAG_LENGTH);
Expand Down
6 changes: 6 additions & 0 deletions src/game/shared/neo/weapons/weapon_neobasecombatweapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ void CNEOBaseCombatWeapon::Spawn()

#ifdef GAME_DLL
AddSpawnFlags(SF_NORESPAWN);

if (NEORules()->IsCyberspace())
{
SetRenderMode(kRenderTransTexture);
m_nRenderFX = kRenderFxDistort;
}
#else
SetNextClientThink(gpGlobals->curtime + TICK_INTERVAL);
#endif // GAME_DLL
Expand Down