From 640231d920610f695885ccadf6bc131e45e38369 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sat, 20 Jul 2019 14:05:59 +0200 Subject: [PATCH] Changed double tap dodge behavior when jumping is disallowed. Added NOTELEPORT flag to many actors that might need it. --- zscript/biorifle.zsc | 1 + zscript/chainsaw.zsc | 1 + zscript/eightball.zsc | 1 + zscript/enforcer.zsc | 2 ++ zscript/flakcannon.zsc | 2 ++ zscript/impacthammer.zsc | 1 + zscript/minigun.zsc | 1 + zscript/pulsegun.zsc | 3 +++ zscript/shockrifle.zsc | 7 +++++++ zscript/translocator.zsc | 2 ++ zscript/utcommon.zsc | 31 +++++++++++++++++++++++++------ zscript/utgore.zsc | 2 ++ zscript/warheadlauncher.zsc | 4 ++++ 13 files changed, 52 insertions(+), 6 deletions(-) diff --git a/zscript/biorifle.zsc b/zscript/biorifle.zsc index c209851..2c14cfa 100644 --- a/zscript/biorifle.zsc +++ b/zscript/biorifle.zsc @@ -91,6 +91,7 @@ Class BioHitbox : Actor +NOCLIP; +DONTSPLASH; +NOBLOOD; + +NOTELEPORT; } override void PostBeginPlay() { diff --git a/zscript/chainsaw.zsc b/zscript/chainsaw.zsc index ba6b7ec..7577b33 100644 --- a/zscript/chainsaw.zsc +++ b/zscript/chainsaw.zsc @@ -7,6 +7,7 @@ Class SawImpact : Actor +NOGRAVITY; +NOCLIP; +DONTSPLASH; + +NOTELEPORT; } override void PostBeginPlay() { diff --git a/zscript/eightball.zsc b/zscript/eightball.zsc index 2aa3a03..f47b3df 100644 --- a/zscript/eightball.zsc +++ b/zscript/eightball.zsc @@ -67,6 +67,7 @@ Class UTRocketTrail : Actor +NOGRAVITY; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; Scale 0.7; } override void PostBeginPlay() diff --git a/zscript/enforcer.zsc b/zscript/enforcer.zsc index 5f05fb8..7053e2d 100644 --- a/zscript/enforcer.zsc +++ b/zscript/enforcer.zsc @@ -47,6 +47,7 @@ Class BulletImpact : Actor +NOGRAVITY; +NOCLIP; +DONTSPLASH; + +NOTELEPORT; Scale 0.25; } override void PostBeginPlay() @@ -102,6 +103,7 @@ Class UTCasing : Actor +THRUACTORS; +USEBOUNCESTATE; +INTERPOLATEANGLES; + +NOTELEPORT; Mass 1; Gravity 0.35; BounceType "Hexen"; diff --git a/zscript/flakcannon.zsc b/zscript/flakcannon.zsc index b1642c6..6699f61 100644 --- a/zscript/flakcannon.zsc +++ b/zscript/flakcannon.zsc @@ -74,6 +74,7 @@ Class ChunkTrail : Actor +NOGRAVITY; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; Scale 0.2; } override void PostBeginPlay() @@ -364,6 +365,7 @@ Class SlugSmoke : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void PostBeginPlay() { diff --git a/zscript/impacthammer.zsc b/zscript/impacthammer.zsc index f3cfe2f..d3727c1 100644 --- a/zscript/impacthammer.zsc +++ b/zscript/impacthammer.zsc @@ -7,6 +7,7 @@ Class HammerImpact : Actor +NOGRAVITY; +NOCLIP; +DONTSPLASH; + +NOTELEPORT; } override void PostBeginPlay() { diff --git a/zscript/minigun.zsc b/zscript/minigun.zsc index fc22f02..defbbf8 100644 --- a/zscript/minigun.zsc +++ b/zscript/minigun.zsc @@ -43,6 +43,7 @@ Class MinigunTracer : Actor +NOGRAVITY; +DONTSPLASH; +INTERPOLATEANGLES; + +NOTELEPORT; } override void Tick() { diff --git a/zscript/pulsegun.zsc b/zscript/pulsegun.zsc index 7b04517..255f5dc 100644 --- a/zscript/pulsegun.zsc +++ b/zscript/pulsegun.zsc @@ -289,6 +289,7 @@ Class PulseBoltCap : Actor +NOCLIP; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; Scale 0.3; } States @@ -327,6 +328,7 @@ Class PulseBoltHit : Actor +NOCLIP; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; Scale 0.3; } States @@ -490,6 +492,7 @@ Class PulseBolt : Actor +NOCLIP; +DONTSPLASH; +INTERPOLATEANGLES; + +NOTELEPORT; } States { diff --git a/zscript/shockrifle.zsc b/zscript/shockrifle.zsc index 69d5838..8546195 100644 --- a/zscript/shockrifle.zsc +++ b/zscript/shockrifle.zsc @@ -68,6 +68,7 @@ Class ShockRifleWave : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void Tick() { @@ -95,6 +96,7 @@ Class SuperShockRifleWave : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void Tick() { @@ -123,6 +125,7 @@ Class ShockBeamRing : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void Tick() { @@ -150,6 +153,7 @@ Class SuperShockBeamRing : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void Tick() { @@ -283,6 +287,7 @@ Class ShockBeam : Actor +FORCEXYBILLBOARD; +FORCERADIUSDMG; +NODAMAGETHRUST; + +NOTELEPORT; } override void PostBeginPlay() { @@ -510,6 +515,7 @@ Class SuperShockBeam : Actor +FORCERADIUSDMG; +EXTREMEDEATH; +NODAMAGETHRUST; + +NOTELEPORT; } override void PostBeginPlay() { @@ -812,6 +818,7 @@ Class ShockHitbox : Actor +NOGRAVITY; +NOCLIP; +DONTSPLASH; + +NOTELEPORT; } override void Tick() { diff --git a/zscript/translocator.zsc b/zscript/translocator.zsc index ca6baaa..4201941 100644 --- a/zscript/translocator.zsc +++ b/zscript/translocator.zsc @@ -9,6 +9,7 @@ Class ModuleHitbox : Actor +NOCLIP; +DONTSPLASH; +NOBLOOD; + +NOTELEPORT; } override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle ) { @@ -100,6 +101,7 @@ Class TranslocatorGlow : Actor +NOGRAVITY; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; RenderStyle "AddShaded"; StencilColor "FFFFFF"; Scale 0.5; diff --git a/zscript/utcommon.zsc b/zscript/utcommon.zsc index 2d12af7..f0f22ac 100644 --- a/zscript/utcommon.zsc +++ b/zscript/utcommon.zsc @@ -11,6 +11,8 @@ Class UTPlayer : DoomPlayer int last_tap_fm, last_tap_sm; int last_jump_held; + int tempslide; + int dolltype, voicetype; Property DollType : dolltype; @@ -240,6 +242,11 @@ Class UTPlayer : DoomPlayer } else forcefootstep = true; } + if ( tempslide ) + { + tempslide = max(0,tempslide-1); + if ( !tempslide ) forcefootstep = true; + } if ( forcefootstep || ((abs(sin(ang)) >= 1.0) && player.onground && lastground && (player.jumptics == 0) && (player.cmd.forwardmove || player.cmd.sidemove) && (waterlevel < 2)) ) { double vol = abs(vel.xy.length())*0.03; @@ -321,11 +328,20 @@ Class UTPlayer : DoomPlayer last_sm = sm; if ( !bNoGravity && player.onground && (waterlevel < 2) ) { - if ( flak_tapdodge && (dodge.length() > 0) ) + if ( flak_tapdodge && (dodge.length() > 0) && !tempslide ) { - if ( flak_doomspeed ) vel += dodge.unit()*(groundspeed_doomish*1.5)/TICRATE; - else vel += dodge.unit()*(groundspeed*1.5)/TICRATE; - vel.z += dodgez/TICRATE; + if ( level.IsJumpingAllowed() ) + { + if ( flak_doomspeed ) vel += dodge.unit()*(groundspeed_doomish*1.5)/TICRATE; + else vel += dodge.unit()*(groundspeed*1.5)/TICRATE; + vel.z += dodgez/TICRATE; + } + else + { + if ( flak_doomspeed ) vel += dodge.unit()*(groundspeed_doomish*2.0)/TICRATE; + else vel += dodge.unit()*(groundspeed*2.0)/TICRATE; + tempslide = 8; + } bOnMobj = false; if ( !(player.cheats&CF_PREDICTING) ) A_PlaySound("*jump",CHAN_BODY); @@ -339,12 +355,13 @@ Class UTPlayer : DoomPlayer } else { - if ( flak_nowalkdrop ) + if ( flak_nowalkdrop && !tempslide ) bNODROPOFF = ((acceleration.length() > double.epsilon) && (cmd.buttons&BT_SPEED)); // Hook in Unreal physics Vector2 dir = (0,0); if ( vel.xy.length() > double.epsilon ) dir = vel.xy.unit(); double doomfriction = clamp(GetFriction()/ORIG_FRICTION,0.0,1.0); + if ( tempslide ) friction *= 0; if ( acceleration.length() <= double.epsilon ) { Vector2 oldvel = vel.xy; @@ -369,7 +386,8 @@ Class UTPlayer : DoomPlayer if ( acceleration.length() <= double.epsilon ) PlayIdle(); else PlayRunning(); } - player.vel = vel.xy; + if ( tempslide ) player.vel *= 0; + else player.vel = vel.xy; } } else if ( !bNoGravity && (waterlevel < 2) ) @@ -1348,6 +1366,7 @@ Class ShredCorpseHitbox : Actor -SOLID; +DONTSPLASH; +SHOOTABLE; + +NOTELEPORT; Health int.max; } override void PostBeginPlay() diff --git a/zscript/utgore.zsc b/zscript/utgore.zsc index 6fb73ed..cb533f4 100644 --- a/zscript/utgore.zsc +++ b/zscript/utgore.zsc @@ -268,6 +268,7 @@ Class UTGibber : Actor { +NOCLIP; +NOGRAVITY; + +NOTELEPORT; Radius 32; Height 16; } @@ -301,6 +302,7 @@ Class UTGib : Actor +MISSILE; +THRUACTORS; +USEBOUNCESTATE; + +NOTELEPORT; } override void PostBeginPlay() { diff --git a/zscript/warheadlauncher.zsc b/zscript/warheadlauncher.zsc index 4c90b0d..cda8a72 100644 --- a/zscript/warheadlauncher.zsc +++ b/zscript/warheadlauncher.zsc @@ -38,6 +38,7 @@ Class ShockWave : Actor +NOBLOCKMAP; +NOGRAVITY; +DONTSPLASH; + +NOTELEPORT; } override void PostBeginPlay() { @@ -94,6 +95,7 @@ Class WarheadSubExplosion : Actor +NOCLIP; +DONTSPLASH; +FORCEXYBILLBOARD; + +NOTELEPORT; } override void PostBeginPlay() { @@ -119,6 +121,7 @@ Class WarheadHitbox : Actor +NOCLIP; +DONTSPLASH; +NOBLOOD; + +NOTELEPORT; } override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle ) { @@ -207,6 +210,7 @@ Class WarheadTrail : Actor +FORCEXYBILLBOARD; +ROLLSPRITE; +ROLLCENTER; + +NOTELEPORT; Scale 0.2; }