Skip to content

Commit

Permalink
fix everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiskster committed Aug 10, 2024
1 parent 1dd620d commit d453c82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
33 changes: 12 additions & 21 deletions src/Lua/InbuiltModeScripts/juggernaut.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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 = {}

Expand Down
7 changes: 6 additions & 1 deletion src/Lua/main_game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit d453c82

Please sign in to comment.