-- By notwait on the SRB2MB -- Ask me for modifying, Maintain only in my absence local S_mancount = CV_RegisterVar({"mj_manualcounter", 1, CV_SAVE, CV_YesNo}) local S_losstimermode = CV_RegisterVar({"mj_losstimermode", 1, CV_SAVE, {Secs = 0, Tics = 1}}) local function losstimer(p) if S_losstimermode.value == 0 then return tostring(G_TicsToSeconds(p.losstime)).."."..tostring(G_TicsToMilliseconds(p.losstime)) elseif S_losstimermode.value == 1 then return tostring(p.losstime) -- all time values are in tics end end addHook("TouchSpecial", function(mo, tm) local p = nil if tm.player then p = tm.player else return end p.checkpointpwshield = p.powers[pw_shield] p.checkpointmap = gamemap end, MT_STARPOST) addHook("PlayerSpawn", function(p) p.oldpfjumped = 0 -- if p.checkpointpwshield then if p.checkpointmap == gamemap then -- If we are on the same map as the checkpoint p.powers[pw_shield] = p.checkpointpwshield P_SpawnShieldOrb(p) else p.checkpointpwshield = 0 p.checkpointmap = nil end end -- i should shorten this variable name if p.jumpcount == nil then p.jumpcount = 0 end end) addHook("PlayerThink", function(p) if (p.pflags & PF_JUMPED and not p.oldpfjumped) and not S_mancount.value then p.jumpcount = $1 + 1 end p.oldpfjumped = p.pflags & PF_JUMPED if (p.cmd.buttons & BT_CUSTOM1) and not (p.lastbuttons & BT_CUSTOM1) then p.jumpcount = $1 - (1 - S_mancount.value*2) end -- press C1 to remove 1 jump if (p.cmd.buttons & BT_CUSTOM2) and not (p.lastbuttons & BT_CUSTOM2) then p.jumpcount = 0 end -- press C2 to remove jump end) hud.add(function (v, p) v.drawString(320-12+8, 200-12-8, "LOSST: " .. losstimer(p), V_SNAPTORIGHT|V_SNAPTOBOTTOM, "right") v.drawString(320-12+8, 200-12, "JUMPS: " .. tostring(p.jumpcount), V_SNAPTORIGHT|V_SNAPTOBOTTOM, "right") end)