Skip to content

Commit

Permalink
ok parry works
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiskster committed Nov 18, 2023
1 parent 00b038e commit 37c68e8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/Lua/Hooks/LineTriggerSystem.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ addHook("MobjLineCollide", function(mobj, line)

-- Sign at start check.
if ((line.backsector and line.backsector == PTSR.endsector)
or (line.frontsector and line.frontsector == PTSR.endsector)) and not player.exiting then
or (line.frontsector and line.frontsector == PTSR.endsector)) and not player.exiting and not player.spectator
and player.mo and player.mo.valid then

if player.pizzaface then
PTSR.StartNewLap(mobj)
Expand Down
10 changes: 5 additions & 5 deletions src/Lua/Hooks/PlayerThinks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ addHook("PlayerThink", function(player)

player.pre_parry = true
if player.pre_parry_counter then
if player.pre_parry_counter > maxpptime - 5 then
if player.pre_parry_counter > maxpptime - 4 then
player.pre_parry_counter = 0
S_StartSound(player.mo, sfx_pzprry)
L_SpeedCap(player.mo, 15*FRACUNIT)
Expand All @@ -225,15 +225,15 @@ addHook("PlayerThink", function(player)
parry.fuse = 5

local range = 1200*FRACUNIT -- higher blockmap range so it doesnt look choppy
local real_range = 200*FRACUNIT
local real_range = 400*FRACUNIT
searchBlockmap("objects", function(refmobj, foundmobj)
if R_PointToDist2(foundmobj.x, foundmobj.y, pmo.x, pmo.y) < real_range
and abs(foundmobj.z-pmo.z) < 120*FRACUNIT then
and abs(foundmobj.z-pmo.z) < 200*FRACUNIT then
if foundmobj.type == MT_PIZZA_ENEMY then
local anglefromplayer = R_PointToAngle2(foundmobj.x, foundmobj.y, pmo.x, pmo.y)
print("parried")

foundmobj.pfstunmomentum = true
foundmobj.pfstuntime = 3*TICRATE
foundmobj.pfstuntime = 2*TICRATE
P_SetObjectMomZ(foundmobj, 10*FRACUNIT)
P_InstaThrust(foundmobj, anglefromplayer - ANGLE_180, 20*FRACUNIT)
else
Expand Down
4 changes: 2 additions & 2 deletions src/Lua/consolethings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ CV_PTSR.aitpstuntime = CV_RegisterVar({

CV_PTSR.aispeed = CV_RegisterVar({
name = "PTSR_aispeed",
defaultvalue = "6",
defaultvalue = "30",
flags = CV_NETVAR|CV_FLOAT,
PossibleValue = {MIN = 0, MAX = 500*FRACUNIT},
})

CV_PTSR.aispeedcap = CV_RegisterVar({
name = "PTSR_aispeedcap",
defaultvalue = "27",
defaultvalue = "35",
flags = CV_NETVAR|CV_FLOAT,
PossibleValue = {MIN = 0, MAX = 500*FRACUNIT},
})
Expand Down
2 changes: 1 addition & 1 deletion src/Lua/main_game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ end
PTSR.StartNewLap = function(mobj)
local player = mobj.player

if not player.pizzaface then
if not player.pizzaface and not player.spectator and player.playerstate ~= PST_DEAD then
PTSR.LapTP(player, true)

S_StartSound(nil, sfx_lap2, player)
Expand Down
9 changes: 6 additions & 3 deletions src/Lua/pizzaface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ mobjinfo[MT_PIZZA_ENEMY] = {
spawnstate = S_PIZZAFACE,
spawnhealth = 1000,
deathstate = S_NULL,
radius = 20*FU,
height = 64*FU,
radius = 18*FU,
height = 48*FU,
flags = MF_NOCLIP|MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_SPECIAL
}

Expand Down Expand Up @@ -135,7 +135,10 @@ addHook("MobjThinker", function(mobj)
if not PTSR.pizzatime then return end
if mobj.pfstuntime then
mobj.pfstuntime = $ - 1
L_SpeedCap(mobj, 0) -- Freeze! You peasant food!
if not mobj.pfstunmomentum then
L_SpeedCap(mobj, 0) -- Freeze! You peasant food!
end

if not mobj.pfstuntime then -- If we just got to 0
if not PTSR.showtime // hiiii adding onto this for showtime
PTSR.showtime = true
Expand Down

0 comments on commit 37c68e8

Please sign in to comment.