--hi-- local ignoresprings = false local ignoreroll = false local strength = 32 COM_AddCommand("ca_ignoresprings", function(p, bool) if bool == string.lower("true") or bool == string.lower("on") or bool == string.lower("yes") then print("air drag will no longer apply to springs") ignoresprings = true elseif bool == string.lower("false") or bool == string.lower("off") or bool == string.lower("no") then print("air drag will now apply to springs") ignoresprings = false else CONS_Printf(p, "determines whether or not air drag applies while in the spring state") CONS_Printf(p, "currently set to "..tostring(ignoresprings)) end end) COM_AddCommand("ca_ignoreroll", function(p, bool) if bool == string.lower("true") or bool == string.lower("on") or bool == string.lower("yes") then print("air drag will no longer apply while rolling") ignoreroll = true elseif bool == string.lower("false") or bool == string.lower("off") or bool == string.lower("no") then print("air drag will now apply while rolling") ignoreroll = false else CONS_Printf(p, "determines whether or not air drag applies while rolling") CONS_Printf(p, "currently set to "..tostring(ignoreroll)) end end) COM_AddCommand("ca_strength", function(p,num) num = tonumber(num) if num == nil then CONS_Printf(p, "determines how strong the air drag is, currently set to "..strength) elseif num >= 0 and num % 1 == 0 then num = tonumber(num) strength = num CONS_Printf(p, "air drag strength set to "..strength) elseif num < 0 then CONS_Printf(p, "value must be greater than 1") end end) addHook("PlayerThink", function(p) local dragcond = p.normalspeed --speed needed to start dragging the player if p.mo.eflags & MFE_UNDERWATER then --halve dragcond if underwater dragcond = p.normalspeed/2 end if p.mo and p.mo.valid and not P_IsObjectOnGround(p.mo) and p.mo.momz > 0 and p.speed > dragcond + (1*FU) if (ignoresprings == true and p.mo.state == S_PLAY_SPRING) then return end if (ignoreroll == true and p.pflags & PF_SPINNING) then return end P_Thrust(p.mo, R_PointToAngle2(p.mo.momx,p.mo.momy,p.mo.momx*2,p.mo.momy*2), -strength*FU/32) end end)