@@ -879,6 +879,19 @@ void ZR_RespawnAll()
879
879
}
880
880
}
881
881
882
+ static bool g_bNemesisMode = false ;
883
+ CON_COMMAND_F (zr_nemesis_mode, " Whether to enable Nemesis mode (CTs die but do not swap teams when stabbed)" , FCVAR_LINKED_CONCOMMAND | FCVAR_SPONLY)
884
+ {
885
+ if (args.ArgC () < 2 )
886
+ {
887
+ Msg (" zr_nemesis_mode %b\n " , g_bNemesisMode);
888
+ return ;
889
+ }
890
+ g_bNemesisMode = V_StringToBool (args[1 ], false );
891
+ if (g_bEnableZR && !g_bNemesisMode && g_bRespawnEnabled)
892
+ ZR_RespawnAll (); // Respawn all dead CTs that hadn't swapped teams
893
+ }
894
+
882
895
void ToggleRespawn (bool force = false , bool value = false )
883
896
{
884
897
if ((!force && !g_bRespawnEnabled) || (force && value))
@@ -969,7 +982,7 @@ void ZR_OnRoundStart(IGameEvent* pEvent)
969
982
void ZR_OnPlayerSpawn (CCSPlayerController* pController)
970
983
{
971
984
// delay infection a bit
972
- bool bInfect = g_ZRRoundState == EZRRoundState::POST_INFECTION;
985
+ bool bInfect = g_ZRRoundState == EZRRoundState::POST_INFECTION && (!g_bNemesisMode || pController-> m_iTeamNum == CS_TEAM_T) ;
973
986
974
987
// We're infecting this guy with a delay, disable all damage as they have 100 hp until then
975
988
// also set team immediately in case the spawn teleport is team filtered
@@ -1369,7 +1382,10 @@ bool ZR_Hook_OnTakeDamage_Alive(CTakeDamageInfo *pInfo, CCSPlayerPawn *pVictimPa
1369
1382
const char *pszAbilityClass = pInfo->m_hAbility .Get () ? pInfo->m_hAbility .Get ()->GetClassname () : " " ;
1370
1383
if (pAttackerPawn->m_iTeamNum () == CS_TEAM_T && pVictimPawn->m_iTeamNum () == CS_TEAM_CT && !V_strncmp (pszAbilityClass, " weapon_knife" , 12 ))
1371
1384
{
1372
- ZR_Infect (pAttackerController, pVictimController, false );
1385
+ if (g_bNemesisMode)
1386
+ pVictimPawn->m_iHealth (0 );
1387
+ else
1388
+ ZR_Infect (pAttackerController, pVictimController, false );
1373
1389
return true ; // nullify the damage
1374
1390
}
1375
1391
@@ -1527,7 +1543,8 @@ void ZR_OnPlayerDeath(IGameEvent* pEvent)
1527
1543
new CTimer (g_flRespawnDelay < 0 .0f ? 2 .0f : g_flRespawnDelay, false , false , [handle]()
1528
1544
{
1529
1545
CCSPlayerController* pController = (CCSPlayerController*)handle.Get ();
1530
- if (!pController || !g_bRespawnEnabled || pController->m_iTeamNum < CS_TEAM_T)
1546
+ if (!pController || !g_bRespawnEnabled || pController->m_iTeamNum < CS_TEAM_T ||
1547
+ (g_bNemesisMode && pController->m_iTeamNum == CS_TEAM_CT && g_ZRRoundState == EZRRoundState::POST_INFECTION))
1531
1548
return -1 .0f ;
1532
1549
pController->Respawn ();
1533
1550
return -1 .0f ;
@@ -1572,6 +1589,10 @@ bool ZR_CheckTeamWinConditions(int iTeamNum)
1572
1589
if (g_ZRRoundState == EZRRoundState::ROUND_END || (iTeamNum == CS_TEAM_CT && g_bRespawnEnabled) || (iTeamNum != CS_TEAM_T && iTeamNum != CS_TEAM_CT))
1573
1590
return false ;
1574
1591
1592
+ ConVar* cvar = g_pCVar->GetConVar (g_pCVar->FindConVar (" mp_respawn_on_death_ct" ));
1593
+ if (iTeamNum == CS_TEAM_T && g_bNemesisMode && *(bool *)&cvar->values )
1594
+ return false ;
1595
+
1575
1596
// check the opposite team
1576
1597
if (ZR_IsTeamAlive (iTeamNum == CS_TEAM_CT ? CS_TEAM_T : CS_TEAM_CT))
1577
1598
return false ;
0 commit comments