From fec0e03971039183b0987012e74cfb67e24a7e94 Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Sun, 3 Jun 2018 16:27:08 +0200 Subject: [PATCH] Reduced drain rate of Enhanced Shock Rifle. Block switching to Enhanced Shock Rifle when out of ammo. Reduced the minimum velocity for landing sounds, should help with repeated thumping when walking down stairs. --- zscript/shockrifle.zsc | 7 ++++++- zscript/utcommon.zsc | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/zscript/shockrifle.zsc b/zscript/shockrifle.zsc index 1714b06..ec2b6ce 100644 --- a/zscript/shockrifle.zsc +++ b/zscript/shockrifle.zsc @@ -1028,7 +1028,7 @@ Class EnhancedShockRifle : UTWeapon replaces InvulnerabilitySphere Super.Tick(); if ( !Owner ) return; ticcnt++; - if ( ticcnt < 35 ) return; + if ( ticcnt < 105 ) return; ticcnt = 0; DepleteAmmo(false,true,1); } @@ -1071,6 +1071,11 @@ Class EnhancedShockRifle : UTWeapon replaces InvulnerabilitySphere p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed; p.target = self; } + override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount ) + { + if ( (Owner.player.ReadyWeapon != self) && (Ammo1.Amount <= 0) ) return false; + return Super.CheckAmmo(fireMode,autoSwitch,requireAmmo,ammocount); + } Default { Tag "Enhanced Shock Rifle"; diff --git a/zscript/utcommon.zsc b/zscript/utcommon.zsc index 573a030..03d9469 100644 --- a/zscript/utcommon.zsc +++ b/zscript/utcommon.zsc @@ -175,10 +175,10 @@ Class UTPlayer : DoomPlayer if ( (waterlevel > 0) || GetFloorTerrain().IsLiquid ) A_PlaySound("ut/playerfootstepwet",CHAN_5,abs(vel.xy.length())*0.03); else A_PlaySound("ut/playerfootstep",CHAN_5,abs(vel.xy.length())*0.03); } - if ( player.onground && !bNoGravity && !lastground && (lastvelz < -2) && (lastvelz >= -8) ) + if ( player.onground && !bNoGravity && !lastground && (lastvelz < -4) && (lastvelz >= -8) ) { - if ( (waterlevel > 0) || GetFloorTerrain().IsLiquid ) A_PlaySound("ut/wetsplash",CHAN_AUTO,abs(lastvelz*0.0625)); - else A_PlaySound("*land",CHAN_AUTO,abs(lastvelz*0.0625)); + if ( (waterlevel > 0) || GetFloorTerrain().IsLiquid ) A_PlaySound("ut/wetsplash",CHAN_AUTO,abs(lastvelz*0.03)); + else A_PlaySound("*land",CHAN_AUTO,abs(lastvelz*0.03)); } lastground = player.onground; lastvelz = prevvelz;