From 0c263ccea57d34aa97fc1c3810c1abe228be0c75 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 3 Feb 2015 04:13:48 +0000 Subject: [PATCH] Added option to prevent being picked as a boss zombie. Accessible by option menu checkbox or "zs_nobosspick 1" --- gamemodes/zombiesurvival/gamemode/cl_options.lua | 1 + gamemodes/zombiesurvival/gamemode/init.lua | 5 +++-- gamemodes/zombiesurvival/gamemode/vgui/poptions.lua | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_options.lua b/gamemodes/zombiesurvival/gamemode/cl_options.lua index ca79170..b00070e 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_options.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_options.lua @@ -33,6 +33,7 @@ end) CreateClientConVar("zs_noredeem", "0", true, true) CreateClientConVar("zs_alwaysvolunteer", "0", true, true) +CreateClientConVar("zs_nobosspick", "0", true, true) GM.SuicideOnChangeClass = CreateClientConVar("zs_suicideonchange", "1", true, false):GetBool() cvars.AddChangeCallback("zs_suicideonchange", function(cvar, oldvalue, newvalue) diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index 8b7d691..2fd774d 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -838,11 +838,12 @@ function GM:SpawnBossZombie(bossplayer, silent) livingbosses = livingbosses + 1 if livingbosses >= 3 then return end else - table.insert(zombies, ent) + if ent:GetInfo("zs_nobosspick") == "0" then + table.insert(zombies, ent) + end end end table.sort(zombies, BossZombieSort) - bossplayer = zombies[1] end diff --git a/gamemodes/zombiesurvival/gamemode/vgui/poptions.lua b/gamemodes/zombiesurvival/gamemode/vgui/poptions.lua index b8a1054..fcff255 100644 --- a/gamemodes/zombiesurvival/gamemode/vgui/poptions.lua +++ b/gamemodes/zombiesurvival/gamemode/vgui/poptions.lua @@ -129,6 +129,12 @@ function MakepOptions() check:SetConVar("zs_alwaysvolunteer") check:SizeToContents() list:AddItem(check) + + local check = vgui.Create("DCheckBoxLabel", Window) + check:SetText("Prevent being picked as a boss zombie") + check:SetConVar("zs_nobosspick") + check:SizeToContents() + list:AddItem(check) local check = vgui.Create("DCheckBoxLabel", Window) check:SetText("Automatic suicide when changing classes")