diff --git a/src/Lua/InbuiltModeScripts/juggernaut.lua b/src/Lua/InbuiltModeScripts/juggernaut.lua index 7fb83c2..d8bcadd 100644 --- a/src/Lua/InbuiltModeScripts/juggernaut.lua +++ b/src/Lua/InbuiltModeScripts/juggernaut.lua @@ -98,31 +98,32 @@ PTSR_AddHook("onparry", function(pmo, victim) end end) -/* + PTSR_AddHook("pfthink", function(pizza) if PTSR.gamemode ~= PTSR.gm_juggernaut then return end local count = PTSR_COUNT() - - if count.active > 1 then - if pizza.pizza_target == PTSR.juggernaut_crownholder then - pizza.pizza_target = nil + + if count.peppinos <= 1 then + pizza.pizza_target = PTSR.juggernaut_crownholder + else + if pizza.pizza_target ~= nil then + if pizza.pizza_target == PTSR.juggernaut_crownholder then + pizza.pizza_target = nil + end end end end) -*/ PTSR_AddHook("pfplayerfind", function(pizza, player) if PTSR.gamemode ~= PTSR.gm_juggernaut then return end local count = PTSR_COUNT() - - if count.active > 1 then + + if count.peppinos > 1 then if player.mo and player.mo.valid then if PTSR.juggernaut_crownholder == player.mo then return false end end - else - pizza.pizza_target = PTSR.juggernaut_crownholder end end) @@ -131,7 +132,7 @@ PTSR_AddHook("pfdamage", function(toucher, pizza) if PTSR.gamemode ~= PTSR.gm_juggernaut then return end local count = PTSR_COUNT() - if count.active > 1 then + if count.peppinos > 1 then if PTSR.juggernaut_crownholder == toucher then return true else @@ -140,16 +141,6 @@ PTSR_AddHook("pfdamage", function(toucher, pizza) end end) -/* -PTSR_AddHook("pfteleport", function(pizza) - if PTSR.gamemode ~= PTSR.gm_juggernaut then return end - - if PTSR.juggernaut_crownholder then - pizza.next_pfteleport = PTSR.juggernaut_crownholder - end -end) -*/ - local function JN_FindAndMakeNewJuggernaut() local player_range = {} diff --git a/src/Lua/main_game.lua b/src/Lua/main_game.lua index 013fb76..03f6298 100644 --- a/src/Lua/main_game.lua +++ b/src/Lua/main_game.lua @@ -309,6 +309,7 @@ rawset(_G, "PTSR_COUNT", do local activeCount = 0 local inactiveCount = 0 local pizzaCount = 0 + local peppinoCount = 0 for player in players.iterate if player.valid @@ -317,15 +318,19 @@ rawset(_G, "PTSR_COUNT", do end if player.ptsr.outofgame or player.spectator or player.ptsr.pizzaface or (player.playerstate == PST_DEAD and PTSR.pizzatime) inactiveCount = $+1 + else + peppinoCount = $+1 end end + activeCount = $+1 end return { inactive = inactiveCount, -- includes pizza faces active = activeCount, - pizzas = pizzaCount + pizzas = pizzaCount, + peppinos = peppinoCount, } end)