Skip to content

Commit

Permalink
pf player pull strength in overtime now gets multi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiskster committed Oct 10, 2024
1 parent f983912 commit bd1013f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Lua/HUD/hud_overtimemulti.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ local overtimemulti_hud = function(v, player)
local gm_metadata = PTSR.currentModeMetadata()
if gm_metadata.core_endurance then return end

local text = "PF SPEED: "

if gm_metadata.player_pizzaface then
text = "PF PULL STRENGTH: "
end

local speed = (PTSR.timeover_tics*CV_PTSR.overtime_speed.value)
local speedtext = L_FixedDecimal(FRACUNIT + speed,2)

local totics = PTSR.timeover_tics
local t = min(FixedDiv(totics, 5*TICRATE), FU)

local tw = v.stringWidth("PF SPEED: "..speedtext.."X", V_SNAPTOLEFT|V_SNAPTOTOP, "thin")*FU
local tw = v.stringWidth(text..speedtext.."X", V_SNAPTOLEFT|V_SNAPTOTOP, "thin")*FU

local y = 58*FU
local x = ease.outcubic(t, -tw, 16*FU)
Expand All @@ -47,7 +53,7 @@ local overtimemulti_hud = function(v, player)
local prog = min(FixedMul(limit, FixedDiv(speed, FU*2)), limit)

-- barfill(v, x, y, FU/3, prog, V_SNAPTOBOTTOM)
v.drawString(x, y, "PIZZA SPEED: "..speedtext.."X", V_SNAPTOTOP|V_SNAPTOLEFT|V_REDMAP|V_20TRANS, "thin-fixed")
v.drawString(x, y, text..speedtext.."X", V_SNAPTOTOP|V_SNAPTOLEFT|V_REDMAP|V_20TRANS, "thin-fixed")
end

customhud.SetupItem("PTSR_overtimemulti", ptsr_hudmodname, overtimemulti_hud, "game", 0)
4 changes: 4 additions & 0 deletions src/Lua/pizzaface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,10 @@ addHook("PlayerThink", function(player)
local zrange = 400*FU
searchBlockmap("objects", function(refmobj, foundmobj)
local strength = 3*FRACUNIT
local speed = FU + (PTSR.timeover_tics*CV_PTSR.overtime_speed.value)

strength = FixedMul(strength, speed)

if foundmobj and abs(pmo.z-foundmobj.z) < zrange
and foundmobj.valid and P_CheckSight(pmo, foundmobj) then
if (foundmobj.type == MT_PLAYER) and ((leveltime/2)%2) == 0 then
Expand Down

0 comments on commit bd1013f

Please sign in to comment.