diff --git a/GunLore.md b/GunLore.md index 920f8be..bebf91c 100644 --- a/GunLore.md +++ b/GunLore.md @@ -15,8 +15,7 @@ until the end of time. ## Automag -A very reliable gunpowder-based firearm, chambered in 9mm. Magazine feeds off -two 10-round clips in tandem. +A very reliable gunpowder-based firearm, chambered in 9mm. Mag holds 20 shots. Primary fire: The typical. Hold for automatic fire. @@ -205,11 +204,8 @@ space on the destination, as this process will cancel itself otherwise. Apparently, living matter sometimes doesn't seem to trigger the safeguard, and the device will happily teleport you into the guts of whatever critter is in the way, resulting in a gory shower, and a very traumatic experience for -first-timers. - -You can use the secondary fire while both modules are still in your posession, -however all this will do is allow you to show others what you think of them -making fun of your "fanny pack". Reload also does this. +first-timers. If you don't have a module out, you'll just flip the bird at +whatever's in front of you. Reload also does this. ## Protomag @@ -237,14 +233,12 @@ A serious man once said "double the gun, double your fun", so clearly, doubling what already has been doubled would make things even more fun, right? This four-barrel beast of a gun is not to be underestimated. -Primary fire: Shoots the first barrel, pump afterwards to rotate to the next -barrel. Moderate damage, short spread. +Primary fire: Shoots one barrel. Moderate damage, short spread. Secondary fire: Shoots all loaded barrels at once. Deadly if fully loaded, but the spread is much wider. -Has to be reloaded after four shots. A skilled user may be able to reload -faster by putting in more than one shell at a time. +Make sure to have some cover ready while reloading, because it takes some time. ## Peacemaker @@ -264,13 +258,13 @@ A powerful energy weapon that uses enriched Tarydium crystals. Wielded by members of the Krall Dark Angel clan. Primary fire: Releases the currently held crystal, upon contact with any -solid object or surface it will explode violently. +solid object or surface it will explode spectacularly (depends on charge). Secondary fire: Redirects the energy contained within the crystal into an unstable beam of energy that arcs between any living creatures in front of the user. -Reload: Loads a new crystal onto the weapon, or unloads the currently held one. +Reload: Manually switches between projectile and melee mode. If no crystal is loaded, both fire modes will be replaced with a stab. @@ -283,9 +277,9 @@ Primary fire: Ejects a stream of fire up to a range of 40ft. Built-in cooling prevents the weapon from overheating, so you can keep spraying for as long as you want. -Secondary fire: Charges up and shoots a blob of unignited napalm. It will stick -to anything it touches, and ignite immediately when in contact with fire or -explosives. +Secondary fire: Charges up and shoots an ignited blob of napalm. On impact with +any surface it will splash little bits of itself around. Anyone who touches the +stuff will immediately catch on fire. The weapon is completely useless if the user or target are underwater. diff --git a/cvarinfo.txt b/cvarinfo.txt index 459a488..4c2e437 100644 --- a/cvarinfo.txt +++ b/cvarinfo.txt @@ -86,4 +86,5 @@ server bool sting_razoraim = false; // razorjack alt follows aim instead of server bool sting_biosplash = false; // biorifle alt splashes like in ut server bool sting_flametspread = false; // targets on fire spread the flames // to anyone nearby (may be op) -server bool sting_impself = false; // disable impaler beam self-hit \ No newline at end of file +server bool sting_impself = false; // disable impaler beam self-hit +user bool sting_zoomshader = true; // rifle scope shader diff --git a/gldefs.txt b/gldefs.txt index 3f4c4dc..56bdb89 100644 --- a/gldefs.txt +++ b/gldefs.txt @@ -851,4 +851,4 @@ HardwareShader PostProcess scene { Name "URifleScope" Shader "shaders/glsl/URifleScope.fp" 330 -} \ No newline at end of file +} diff --git a/language.txt b/language.txt index 4947f88..8f3100e 100644 --- a/language.txt +++ b/language.txt @@ -243,6 +243,7 @@ STING_NOPSTART = "Players don't start up with an Automag"; STING_OLSMP = "Enable SMP 7243 from Oldskool Amp'd"; STING_MSENTRY = "Enable new Minigun Sentry"; STING_DUBIOUS = "Enable Demolisher, Razorclaw and Autocannon"; +STING_ZSHADER = "Enable Rifle scope shader"; STING_QOPTS = "Convenience features"; STING_AUTOSCUBA = "Automatic SCUBA Gear toggling"; STING_RAZORAIM = "Razorjack altfire follows the crosshair"; @@ -481,6 +482,7 @@ STING_NOPSTART = "Los jugadores no empiezan la partida con un Automag"; STING_OLSMP = "Habilitar SMP 7243 de Oldskool Amp'd"; STING_MSENTRY = "Habilitar nueva Torreta"; STING_DUBIOUS = "Habilitar Demoledor, Garra y Autocañón"; +STING_ZSHADER = "Habilitar shader de mira de Rifle"; STING_QOPTS = "Características de comodidad"; STING_AUTOSCUBA = "Uso automático de Kit de Buceo"; STING_RAZORAIM = "El fuego alt. del Razorjack sigue el punto de mira"; diff --git a/menudef.txt b/menudef.txt index 756cdb0..bb2a8b3 100644 --- a/menudef.txt +++ b/menudef.txt @@ -45,6 +45,7 @@ OptionMenu "UnrealOptionMenu" Option "$STING_OLSMP", "sting_olsmp", "YesNo" Option "$STING_MSENTRY", "sting_msentry", "YesNo" Option "$STING_DUBIOUS", "sting_dubious", "YesNo" + Option "$STING_ZSHADER", "sting_zoomshader", "YesNo" StaticText " " StaticText "$STING_QOPTS", "Gold" Option "$STING_AUTOSCUBA", "sting_autoscuba", "YesNo" diff --git a/shaders/glsl/URifleScope.fp b/shaders/glsl/URifleScope.fp index 709278d..3461d33 100644 --- a/shaders/glsl/URifleScope.fp +++ b/shaders/glsl/URifleScope.fp @@ -1,12 +1,14 @@ void main() { vec2 uv = TexCoord.st; - vec2 p = vec2(0.5)-uv; + vec3 base = texture(InputTexture,uv).rgb; + vec2 p = vec2(.5)-uv; vec2 sz = textureSize(InputTexture,0); if ( sz.x > sz.y ) p.x *= sz.x/sz.y; else p.y *= sz.y/sz.x; vec3 col = texture(InputTexture,uv+p*pow(length(p),8.)*40.).rgb; - col = max(col.r,max(col.g,col.b))*vec3(1.,0.2,.1); - col *= 1.-clamp(pow(length(p)*2.,16.),0.,1.); - FragColor = vec4(col,1.0); + col = (max(col.r,max(col.g,col.b))+.02)*.98*vec3(1.,.2,.1); + float fade = 1.-clamp(pow(length(p)*2.,16.),0.,1.); + col *= fade; + FragColor = vec4(mix(base*.1,col,vec3(fade)),1.); } diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index 85ec468..cd68ec0 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -270,8 +270,8 @@ Class ViewASMDSpark : ShockSpark } Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(target.pitch,target.angle,target.roll); - Vector3 origin = x*ofs.x+y*ofs.y+z*ofs.z+(0,0,target.player.viewz); - SetOrigin(target.Vec2OffsetZ(origin.x,origin.y,origin.z),true); + Vector3 origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*ofs.x+y*ofs.y+z*ofs.z); + SetOrigin(origin,true); bInvisible = (players[consoleplayer].camera != target); if ( isFrozen() ) return; ofs += vvel; @@ -691,7 +691,7 @@ Class ASMD : UnrealWeapon A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+2.9*y-2.5*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.9*y-2.5*z); Actor p = Spawn("ASMDBeam",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -723,7 +723,7 @@ Class ASMD : UnrealWeapon A_QuakeEx(1,1,1,8,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+2.9*y-2.5*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.9*y-2.5*z); Actor p = Spawn("ASMDBall",origin); p.angle = angle; p.pitch = BulletSlope(); diff --git a/zscript/automag.zsc b/zscript/automag.zsc index 760e77d..64fe301 100644 --- a/zscript/automag.zsc +++ b/zscript/automag.zsc @@ -177,10 +177,10 @@ Class Automag : UnrealWeapon } Vector3 x, y, z, x2, y2, z2; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+10.0*x; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); int ydir = slave?-1:1; - if ( alt ) origin = origin-z*3.0+ydir*y*1.0; - else origin = origin-z*1.0+ydir*y*4.0; + if ( alt ) origin = level.Vec3Offset(origin,-z*3+ydir*y); + else origin = level.Vec3Offset(origin,-z+ydir*y*4); double a = FRandom[Automag](0,360), s = FRandom[Automag](0,alt?invoker.altaccuracy:0.01); [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); @@ -236,7 +236,7 @@ Class Automag : UnrealWeapon s.target = self; s.alpha *= 0.5; } - origin += x*8.0+ydir*y*6.0-z*2.0; + origin = level.Vec3Offset(origin,x*8+ydir*y*6-z*2); let c = Spawn("UCasing",origin); c.vel = x*FRandom[Junk](-1.5,1.5)+y*ydir*FRandom[Junk](2,4)+z*FRandom[Junk](2,3); } diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index d4670bd..30208d4 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -168,10 +168,10 @@ Class Betamag : UnrealWeapon } Vector3 x, y, z, x2, y2, z2; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10.0*x); + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); int ydir = slave?-1:1; if ( alt ) origin = level.Vec3Offset(origin,-z*2.5+ydir*y*1.5); - else origin = level.Vec3Offset(origin,-z*1.5+ydir*y*2.0); + else origin = level.Vec3Offset(origin,-z*1.5+ydir*y*2); double a = FRandom[Betamag](0,360), s = FRandom[Betamag](0,alt?invoker.altaccuracy:0.01); [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); @@ -227,7 +227,7 @@ Class Betamag : UnrealWeapon s.target = self; s.alpha *= 0.5; } - origin = level.Vec3Offset(origin,x*5.0+ydir*y*8.0-z*2.0); + origin = level.Vec3Offset(origin,x*5+ydir*y*8-z*2); let c = Spawn(slave?"BCasing2":"BCasing",origin); c.vel = x*FRandom[Junk](-1.5,1.5)+y*ydir*FRandom[Junk](2,4)+z*FRandom[Junk](2,3); } @@ -241,17 +241,27 @@ Class Betamag : UnrealWeapon Super.Travelled(); slaveactive = false; } + override void DetachFromOwner() + { + Owner.A_StopSound(CHAN_ITEM); + Owner.A_StopSound(CHAN_6); + Owner.A_StopSound(CHAN_7); + Super.DetachFromOwner(); + } override void OwnerDied() { - Super.OwnerDied(); slavespin = slavewhip = slaverefire = 0; - if ( Owner.player.ReadyWeapon != self ) return; + if ( !Owner.player || (Owner.player.ReadyWeapon != self) ) return; + Owner.A_StopSound(CHAN_ITEM); + Owner.A_StopSound(CHAN_6); + Owner.A_StopSound(CHAN_7); let psp = Owner.player.FindPSprite(2); if ( psp ) { slaveactive = false; Owner.player.SetPSprite(2,ResolveState("LeftDeselect")); } + Super.OwnerDied(); } override void DoEffect() { diff --git a/zscript/dispersionpistol.zsc b/zscript/dispersionpistol.zsc index d335d3e..1b8d861 100644 --- a/zscript/dispersionpistol.zsc +++ b/zscript/dispersionpistol.zsc @@ -544,7 +544,7 @@ Class DispersionPistol : UnrealWeapon A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+3*y-3*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-3*z); Actor p = Spawn(proj,origin); p.angle = angle; p.pitch = BulletSlope(); @@ -616,7 +616,7 @@ Class DispersionPistol : UnrealWeapon A_QuakeEx(qs,qs,qs,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+3*y-3*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-3*z); Actor p = Spawn(proj,origin); p.angle = angle; p.pitch = BulletSlope(); diff --git a/zscript/flamegun.zsc b/zscript/flamegun.zsc index fac3ed7..660c559 100644 --- a/zscript/flamegun.zsc +++ b/zscript/flamegun.zsc @@ -314,7 +314,7 @@ Class FlameGun : UnrealWeapon Vector3 x, y, z; double a, s; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x+3*y-z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-z); Actor p = Spawn(bAlt?"UFireball2":"UFireball",origin); p.angle = angle; p.pitch = BulletSlope(); diff --git a/zscript/gatling.zsc b/zscript/gatling.zsc index ad4c027..00255f6 100644 --- a/zscript/gatling.zsc +++ b/zscript/gatling.zsc @@ -210,7 +210,7 @@ Class SMiniGun : UnrealWeapon } Vector3 x, y, z, x2, y2, z2; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10.0*x+y*2-z*2); + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*2-z*2); for ( int i=0; i<(bAlt?4:1); i++ ) { if ( bAlt && !weap.DepleteAmmo(weap.bAltFire,true,1) ) break; diff --git a/zscript/impaler.zsc b/zscript/impaler.zsc index 03fd463..539d12f 100644 --- a/zscript/impaler.zsc +++ b/zscript/impaler.zsc @@ -489,7 +489,7 @@ Class StarterImpalerBolt : ImpalerBolt if ( target.player ) { [x, y, z] = dt_CoordUtil.GetAxes(target.pitch,target.angle,target.roll); - origin = target.Vec2OffsetZ(0,0,target.player.viewz)+15*x+2*y-2.5*z; + origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),15*x+2*y-2.5*z); } else origin = target.Vec3Offset(0,0,target.missileheight); SetOrigin(origin,true); @@ -770,8 +770,8 @@ Class Impaler : UnrealWeapon } override void OwnerDied() { - Super.OwnerDied(); if ( beam ) beam.Destroy(); + Super.OwnerDied(); } override void DetachFromOwner() { @@ -780,8 +780,8 @@ Class Impaler : UnrealWeapon } override void OnDestroy() { - Super.OnDestroy(); if ( beam ) beam.Destroy(); + Super.OnDestroy(); } private action bool TryHit( double angle, int dmg ) { diff --git a/zscript/miscitems.zsc b/zscript/miscitems.zsc index b861ae2..694172d 100644 --- a/zscript/miscitems.zsc +++ b/zscript/miscitems.zsc @@ -289,8 +289,7 @@ Class VoiceBox : UnrealInventory if ( pickup || bActive ) return false; Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll); - Vector3 origin = Owner.Vec2OffsetZ(0,0,Owner.player.viewz); - origin = level.Vec3Offset(origin,x*20.-z*8.); + Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*20-z*8); box = Spawn("VoiceBoxActive",origin); box.ReactionTime = Charge; box.vel = x*9.; @@ -489,7 +488,7 @@ Class Flare : UnrealInventory if ( pickup ) return false; Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll); - Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*10.-z*8.); + Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*10-z*8); let a = Spawn("FlareThrown",origin); a.target = Owner; a.angle = Owner.angle; @@ -764,7 +763,7 @@ Class BetaFlare : UnrealInventory if ( pickup || bActive || (charge < defaultcharge) ) return false; Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(Owner.pitch,Owner.angle,Owner.roll); - Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*10.-z*8.); + Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*10-z*8); let a = Spawn(ThrownClass,origin); a.target = Owner; a.angle = Owner.angle; @@ -1127,7 +1126,7 @@ Class Forcefield : UnrealInventory Vector3 origin = Owner.Vec2OffsetZ(0,0,Owner.player.viewz); FLineTraceData d; Owner.LineTrace(Owner.angle,90,Owner.pitch,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d); - if ( d.HitType != TRACE_HitNone ) origin = d.HitLocation-d.HitDir*(GetDefaultByType("ForceFieldEffect").radius+8); + if ( d.HitType != TRACE_HitNone ) origin = level.Vec3Offset(d.HitLocation,-d.HitDir*(GetDefaultByType("ForceFieldEffect").radius+8)); else origin = d.HitLocation; Owner.LineTrace(0,GetDefaultByType("ForceFieldEffect").height/2,90,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d); origin = d.HitLocation; @@ -1270,7 +1269,7 @@ Class UFlashLight1 : DynamicLight Destroy(); return; } - if ( target.player ) SetOrigin((target.pos.x,target.pos.y,target.player.viewz),true); + if ( target.player ) SetOrigin(target.Vec2OffsetZ(0,0,target.player.viewz),true); else SetOrigin(target.vec3Offset(0,0,target.height*0.75),true); A_SetAngle(target.angle,SPF_INTERPOLATE); A_SetPitch(target.pitch,SPF_INTERPOLATE); @@ -1548,9 +1547,9 @@ Class SentryItem : UnrealInventory normal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit(); if ( !d.LineSide ) normal *= -1; } - origin = d.HitLocation+normal*20; + origin = level.Vec3Offset(d.HitLocation,normal*20); } - else origin = d.HitLocation-d.HitDir*20; + else origin = level.Vec3Offset(d.HitLocation,-d.HitDir*20); Owner.LineTrace(0,56,90,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d); origin = d.HitLocation; let a = Spawn("MinigunSentryBase",origin); @@ -2275,9 +2274,9 @@ Class SentryGunItem : UnrealInventory normal = (-d.HitLine.delta.y,d.HitLine.delta.x,0).unit(); if ( !d.LineSide ) normal *= -1; } - origin = d.HitLocation+normal*20; + origin = level.Vec3Offset(d.HitLocation,normal*20); } - else origin = d.HitLocation-d.HitDir*20; + else origin = level.Vec3Offset(d.HitLocation,-d.HitDir*20); Owner.LineTrace(0,56,90,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d); origin = d.HitLocation; let a = Spawn("SentryGun",origin); diff --git a/zscript/napalm.zsc b/zscript/napalm.zsc index a9fd572..563d3fa 100644 --- a/zscript/napalm.zsc +++ b/zscript/napalm.zsc @@ -764,16 +764,16 @@ Class UFlamethrower : UnrealWeapon { return bCharging?min(5,int(chargesize+0.1)):-1, -1, false, false; } - override Inventory CreateTossable( int amt ) + override void DetachFromOwner() { - if ( Owner.player && (Owner.player.ReadyWeapon == self) ) - Owner.A_PlaySound("flamet/down",CHAN_6,Dampener.Active(self)?.1:1.); - return Super.CreateTossable(amt); + Owner.A_StopSound(CHAN_6); + A_PlaySound("flamet/down",CHAN_6); + Super.DetachFromOwner(); } override void OwnerDied() { if ( Owner.player && (Owner.player.ReadyWeapon == self) ) - Owner.A_PlaySound("flamet/down",CHAN_6,Dampener.Active(self)?.1:1.); + Owner.A_StopSound(CHAN_6); Super.OwnerDied(); } override void DoEffect() diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index f76a8f5..f19e880 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -72,10 +72,6 @@ Class OLSMP : UnrealWeapon { return ClipCount, -1, (ClipCount<35), false; } - override void PlayUpSound( Actor origin ) - { - origin.A_PlaySound(upsound,CHAN_WEAPON,Dampener.Active(origin)?.1:1.,pitch:0.8); - } override bool TryPickup( in out Actor toucher ) { if ( !sting_olsmp ) return false; // not allowed @@ -157,8 +153,8 @@ Class OLSMP : UnrealWeapon vel -= x*(player.onground?2.2:1.); vel.z += (player.onground?.5:.15); } - Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+10.0*x; - origin = origin-z*1.0+y*4.0; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); + origin = level.Vec3Offset(origin,-z+y*4); double a = FRandom[Automag](0,360), s = FRandom[Automag](0,alt?(0.05+invoker.altaccuracy):0.05); [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit(); @@ -213,7 +209,7 @@ Class OLSMP : UnrealWeapon s.target = self; s.alpha *= 0.5; } - origin += x*8.0+y*6.0-z*2.0; + origin = level.Vec3Offset(origin,x*8+y*6-z*2); let c = Spawn("UCasing",origin); c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3); } diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index 08aa7a3..c26c572 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -51,6 +51,7 @@ Class QCasing : UCasing Class QuadshotTracer : LineTracer { Actor ignoreme; + Array hitlist; override ETraceStatus TraceCallback() { @@ -63,9 +64,17 @@ Class QuadshotTracer : LineTracer // getgibhealth isn't clearscope, fuck int gibhealth = -int(Results.HitActor.GetSpawnHealth()*gameinfo.gibfactor); if ( Results.HitActor.GibHealth != int.min ) gibhealth = -abs(Results.HitActor.GibHealth); - // go through actors that are already gibbed + // if gibbed, go through without dealing more damage if ( Results.HitActor.health-amt <= gibhealth ) return TRACE_Skip; - return TRACE_Stop; + let ent = new("HitListEntry"); + ent.hitactor = Results.HitActor; + ent.hitlocation = Results.HitPos; + ent.x = Results.HitVector; + hitlist.Push(ent); + // go right on through if dead + if ( Results.HitActor.health-amt <= 0 ) return TRACE_Skip; + // stap + return TRACE_Abort; } return TRACE_Skip; } @@ -92,28 +101,28 @@ Class QuadShot : UnrealWeapon return ClipOut?-1:ClipCount, -1, (ClipCount<2), false; } - action void ProcessTraceHit( Linetracer t ) + action void ProcessTraceHit( QuadshotTracer t ) { - if ( t.Results.HitType == TRACE_HitActor ) + for ( int i=0; i1.0,"ZoomedReload"); SRFI A 8 A_ToggleLight(); diff --git a/zscript/stinger.zsc b/zscript/stinger.zsc index 21efc61..b927a8b 100644 --- a/zscript/stinger.zsc +++ b/zscript/stinger.zsc @@ -137,8 +137,8 @@ Class ViewStingerChunk : StingerChunk } Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(target.pitch,target.angle,target.roll); - Vector3 origin = x*ofs.x+y*ofs.y+z*ofs.z+(0,0,target.player.viewz); - SetOrigin(target.Vec2OffsetZ(origin.x,origin.y,origin.z),true); + Vector3 origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*ofs.x+y*ofs.y+z*ofs.z); + SetOrigin(origin,true); bInvisible = (players[consoleplayer].camera != target); if ( isFrozen() ) return; ofs += vvel; @@ -549,7 +549,7 @@ Class Stinger : UnrealWeapon A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+5.0*x+8.0*y-8.0*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x+8*y-8*z); Actor p = Spawn("StingerProjectile",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -594,7 +594,7 @@ Class Stinger : UnrealWeapon A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+5.0*x+8.0*y-8.0*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x+8*y-8*z); [x, y, z] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); Actor p; double a, s; diff --git a/zscript/ueightball.zsc b/zscript/ueightball.zsc index 2de13c8..f8b19e6 100644 --- a/zscript/ueightball.zsc +++ b/zscript/ueightball.zsc @@ -388,7 +388,7 @@ Class Eightball : UnrealWeapon Vector3 x, y, z, x2, y2, z2; double a, s; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10*x-2*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*z); [x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll); Actor p; if ( weap.bAltFire ) @@ -399,7 +399,7 @@ Class Eightball : UnrealWeapon a = FRandom[Eightball](0,360); s = FRandom[Eightball](0,(num>1)?12:0); Vector3 dir = (x2+cos(a)*y2*s*0.004+sin(a)*z2*s*0.004).unit(); - p = Spawn("UGrenade",origin+cos(a)*y*s+sin(a)*z*s); + p = Spawn("UGrenade",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s)); p.vel = x*(vel dot x)*0.4 + dir*p.speed*FRandom[Eightball](1.0,1.2); p.vel.z += 3.5; p.target = self; @@ -408,7 +408,7 @@ Class Eightball : UnrealWeapon else if ( num <= 1 ) { // single rocket - p = Spawn("URocket",origin+cos(a)*y*s+sin(a)*z*s); + p = Spawn("URocket",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s)); p.vel = x2*p.speed; p.target = self; p.tracer = invoker.LockedTarget; @@ -421,7 +421,7 @@ Class Eightball : UnrealWeapon s = (num>1)?6:0; for ( int i=0; i 48. ) continue; @@ -389,7 +389,7 @@ Class MotionDetector : UnrealInventory else if ( !bActive && tracer ) tracer.Destroy(); if ( !bActive ) return; nearscan.Clear(); - let bi = BlockThingsIterator.Create(Owner,2048); + let bi = BlockThingsIterator.Create(Owner,512); while ( bi.Next() ) { if ( !bi.Thing || (bi.Thing == Owner) || !bi.Thing.bISMONSTER || bi.Thing.Health <= 0 ) continue; diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index 158c11d..7581fa8 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -156,7 +156,7 @@ Class UTranslocator : UnrealWeapon UTMainHandler.DoSwing(self,(FRandom[Translocator](0.2,-0.4),FRandom[Translocator](0.2,-0.7)),2,-0.3,3,SWING_Spring,2,3); Vector3 x, y, z; [x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll); - Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x-8.0*y-12.0*z; + Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-8*y-12*z); let p = Spawn("UTranslocatorModule",origin); p.target = self; p.angle = angle;