diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..41944d6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2018-2023 Marisa the Magician, UnSX Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Readme.md b/Readme.md index 04b9c9a..facb428 100644 --- a/Readme.md +++ b/Readme.md @@ -2,7 +2,7 @@ The Unreal 1 counterpart to Doom Tournament. Adds Unreal 1 weapons and items (including dummied out stuff and others). -This mod requires GZDoom 4.9 or later, and runs on top of Doom Tournament. Like it, it took four years for some things to finally be possible. I've come a long way in modding, for sure. +This mod requires GZDoom 4.11 or later, and runs on top of Doom Tournament. Like it, it took four years for some things to finally be possible. I've come a long way in modding, for sure. ## What's In @@ -81,4 +81,4 @@ This mod requires GZDoom 4.9 or later, and runs on top of Doom Tournament. Like - ASMD behavior described in the Unreal novels (green energy beam that bounces off mirrors and water). - Quadshot partial reload animations. - Skaarj Trooper player model. - - Return to Na Pali weapons and items. \ No newline at end of file + - Return to Na Pali weapons and items. diff --git a/modeldef.male2 b/modeldef.male2 index 828affd..981d9f2 100644 --- a/modeldef.male2 +++ b/modeldef.male2 @@ -5,7 +5,7 @@ Model "UPlayerMale2" SurfaceSkin 0 0 "Male2/Ash.png" SurfaceSkin 0 1 "GunPick1.png" Scale 0.2 0.2 0.2 - Offset 2.5 -7 21 + Offset 2.5 7 21 RollOffset -90 AngleOffset -90 IGNORETRANSLATION diff --git a/modeldef.male3 b/modeldef.male3 index 4d4d488..88d18c2 100644 --- a/modeldef.male3 +++ b/modeldef.male3 @@ -5,7 +5,7 @@ Model "UPlayerMale3" SurfaceSkin 0 0 "Male3/Dante.png" SurfaceSkin 0 1 "GunPick1.png" Scale 0.2 0.2 0.2 - Offset 2.5 -7 21 + Offset 2.5 7 21 RollOffset -90 AngleOffset -90 IGNORETRANSLATION diff --git a/models/Female2/FaceDimitra.png b/models/Female2/FaceDimitra.png index 537f45b..ed17926 100644 Binary files a/models/Female2/FaceDimitra.png and b/models/Female2/FaceDimitra.png differ diff --git a/models/Female2/FaceKatryn.png b/models/Female2/FaceKatryn.png index 74051cd..1de2865 100644 Binary files a/models/Female2/FaceKatryn.png and b/models/Female2/FaceKatryn.png differ diff --git a/models/Female2/FaceSonya.png b/models/Female2/FaceSonya.png index b986483..9a718e2 100644 Binary files a/models/Female2/FaceSonya.png and b/models/Female2/FaceSonya.png differ diff --git a/models/Female2_a.3d b/models/Female2_a.3d index ed44626..e5f2cd9 100644 Binary files a/models/Female2_a.3d and b/models/Female2_a.3d differ diff --git a/models/Female2_d.3d b/models/Female2_d.3d index 2511d7a..b60c7ea 100644 Binary files a/models/Female2_d.3d and b/models/Female2_d.3d differ diff --git a/models/Male2/FaceAsh.png b/models/Male2/FaceAsh.png index 7cb0261..3d1d3ef 100644 Binary files a/models/Male2/FaceAsh.png and b/models/Male2/FaceAsh.png differ diff --git a/models/Male2/FaceIvan.png b/models/Male2/FaceIvan.png index 150e171..c54d6d9 100644 Binary files a/models/Male2/FaceIvan.png and b/models/Male2/FaceIvan.png differ diff --git a/models/Male2/FaceKristoph.png b/models/Male2/FaceKristoph.png index be85c56..76a1766 100644 Binary files a/models/Male2/FaceKristoph.png and b/models/Male2/FaceKristoph.png differ diff --git a/models/Male2_a.3d b/models/Male2_a.3d index 5a537a3..3d0a825 100644 Binary files a/models/Male2_a.3d and b/models/Male2_a.3d differ diff --git a/models/Male2_d.3d b/models/Male2_d.3d index 918d177..99a3e3a 100644 Binary files a/models/Male2_d.3d and b/models/Male2_d.3d differ diff --git a/models/Male3/FaceBane.png b/models/Male3/FaceBane.png index 0442a5a..a81e646 100644 Binary files a/models/Male3/FaceBane.png and b/models/Male3/FaceBane.png differ diff --git a/models/Male3/FaceDante.png b/models/Male3/FaceDante.png index d5301ab..bf36872 100644 Binary files a/models/Male3/FaceDante.png and b/models/Male3/FaceDante.png differ diff --git a/models/Male3/FaceDregor.png b/models/Male3/FaceDregor.png index f3d0f13..a8ea3ab 100644 Binary files a/models/Male3/FaceDregor.png and b/models/Male3/FaceDregor.png differ diff --git a/models/Male3/FaceKrige.png b/models/Male3/FaceKrige.png index 59e796d..ff5674b 100644 Binary files a/models/Male3/FaceKrige.png and b/models/Male3/FaceKrige.png differ diff --git a/models/Male3_a.3d b/models/Male3_a.3d index e795299..c3a328a 100644 Binary files a/models/Male3_a.3d and b/models/Male3_a.3d differ diff --git a/models/Male3_d.3d b/models/Male3_d.3d index ad294e6..9f5d082 100644 Binary files a/models/Male3_d.3d and b/models/Male3_d.3d differ diff --git a/zscript.txt b/zscript.txt index a99932b..606d7f5 100644 --- a/zscript.txt +++ b/zscript.txt @@ -1,4 +1,14 @@ -version "4.10" +version "4.11" + +/* + Doomreal add-on codebase + + All code here is (C)2018-2023 Marisa the Magician, UnSX Team, and is + released under the terms of the MIT license (see LICENSE.txt). + + No proprietary code by Epic Games has been copied, with or without + modification, in the process of developing this project. +*/ #include "zscript/unrealcommon.zsc" #include "zscript/dispersionpistol.zsc" diff --git a/zscript/asmd.zsc b/zscript/asmd.zsc index c318065..57d0210 100644 --- a/zscript/asmd.zsc +++ b/zscript/asmd.zsc @@ -269,9 +269,7 @@ Class ViewASMDSpark : ShockSpark Destroy(); return; } - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(target.angle,target.pitch,target.roll); - Vector3 origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*ofs.x+y*ofs.y+z*ofs.z); + Vector3 origin = dt_Utility.GetFireOffset(target,ofs.x,ofs.y,ofs.z); SetOrigin(origin,true); bInvisible = (players[consoleplayer].camera != target); if ( isFrozen() ) return; @@ -670,9 +668,7 @@ Class ASMD : UnrealWeapon UTMainHandler.DoFlash(self,Color(80,64,32,255),1); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.9*y-2.5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-2.9,-2.5); Actor p = Spawn("ASMDBeam",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -701,9 +697,7 @@ Class ASMD : UnrealWeapon UTMainHandler.DoFlash(self,Color(80,64,32,255),1); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,8,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.9*y-2.5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-2.9,-2.5); Actor p = Spawn("ASMDBall",origin); p.angle = angle; p.pitch = BulletSlope(); diff --git a/zscript/automag.zsc b/zscript/automag.zsc index 3eac23a..819c796 100644 --- a/zscript/automag.zsc +++ b/zscript/automag.zsc @@ -191,14 +191,14 @@ Class Automag : UnrealWeapon A_OverlayRenderstyle(-2,STYLE_Add); } Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); + [x, y, z] = dt_Utility.GetPlayerAxes(self); int ydir = slave?1:-1; - if ( alt ) origin = level.Vec3Offset(origin,-z*3+ydir*y); - else origin = level.Vec3Offset(origin,-z+ydir*y*4); + Vector3 origin; + if ( alt ) origin = dt_Utility.GetFireOffset(self,10,ydir,-3); + else origin = dt_Utility.GetFireOffset(self,10,ydir*4,-1); double a = FRandom[Automag](0,360), s = FRandom[Automag](0,alt?invoker.altaccuracy:0.01); if ( invoker.Amount > 1 ) s *= 1.6; - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); @@ -352,7 +352,8 @@ Class Automag : UnrealWeapon invoker.slavedown = false; if ( !invoker.slaveactive && (CountInv("Automag") > 1) ) { - invoker.slavespin = invoker.slavereload = invoker.slaverefire = 0; + invoker.slavespin = invoker.slavereload = false; + invoker.slaverefire = 0; A_Overlay(2,"LeftReady"); } } @@ -550,8 +551,8 @@ Class Automag : UnrealWeapon UTPlayer(self).PlayReloading(); invoker.slavereload = (invoker.slaveactive&&(invoker.slaveclipcount0)); Vector3 x, y, z, origin; - [x,y,z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*8.); + [x,y,z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,4,-4,-8); let c = Spawn("AutomagMag",origin); c.angle = angle; c.pitch = pitch; @@ -564,7 +565,7 @@ Class Automag : UnrealWeapon { if ( invoker.slaveclipcount >= invoker.default.slaveclipcount ) { - invoker.slavereload = 0; + invoker.slavereload = false; return ResolveState("LeftIdle"); } invoker.slaveclipout = true; @@ -586,8 +587,8 @@ Class Automag : UnrealWeapon UTPlayer(self).PlayReloading(); invoker.slavereload = false; Vector3 x, y, z, origin; - [x,y,z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*4.-z*8.); + [x,y,z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,4,4,-8); let c = Spawn("AutomagMag",origin); c.angle = angle; c.pitch = pitch; diff --git a/zscript/betamag.zsc b/zscript/betamag.zsc index 14a46fb..314294f 100644 --- a/zscript/betamag.zsc +++ b/zscript/betamag.zsc @@ -264,14 +264,14 @@ Class Betamag : UnrealWeapon A_OverlayRenderstyle(-2,STYLE_Add); } Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); + [x, y, z] = dt_Utility.GetPlayerAxes(self); 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); + Vector3 origin; + if ( alt ) origin = dt_Utility.GetFireOffset(self,10,ydir*1.5,-2.5); + else origin = dt_Utility.GetFireOffset(self,10,ydir*2,-1.5); double a = FRandom[Betamag](0,360), s = FRandom[Betamag](0,alt?invoker.altaccuracy:0.); if ( invoker.Amount > 1 ) s = s*2.+FRandom[Betamag](0,0.01); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); @@ -409,7 +409,8 @@ Class Betamag : UnrealWeapon invoker.slavedown = false; if ( !invoker.slaveactive && (CountInv("Betamag") > 1) ) { - invoker.slavespin = invoker.slavewhip = invoker.slaverefire = 0; + invoker.slavespin = invoker.slavewhip = false; + invoker.slaverefire = 0; player.setpsprite(2,ResolveState("LeftReady")); } } @@ -445,7 +446,8 @@ Class Betamag : UnrealWeapon A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM); if ( !invoker.slaveactive && (CountInv("Betamag") > 1) ) { - invoker.slavespin = invoker.slavewhip = invoker.slaverefire = 0; + invoker.slavespin = invoker.slavewhip = false; + invoker.slaverefire = 0; player.setpsprite(2,ResolveState("LeftReady")); } } diff --git a/zscript/biggun.zsc b/zscript/biggun.zsc index dcd5623..c6b2feb 100644 --- a/zscript/biggun.zsc +++ b/zscript/biggun.zsc @@ -308,8 +308,8 @@ Class BigGun : UnrealWeapon action void A_Eject() { Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),4*x+y*12-z*4); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,4,12,-4); let c = Spawn("BigCasing",origin); c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](-1,2); } @@ -327,14 +327,13 @@ Class BigGun : UnrealWeapon invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(32,255,128,0),1); A_QuakeEx(2,2,2,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollintensity:0.12); - Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - vel -= x*(player.onground?9.5:2.5); + Vector3 x, y, z; + vel -= dt_Utility.GetPlayerViewDir(self)*(player.onground?9.5:2.5); vel.z += (player.onground?2.8:.25); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*5-z*1); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + Vector3 origin = dt_Utility.GetFireOffset(self,10,5,-1); + [x, y, z] = dt_Utility.GetPlayerAxesAutoAimed(self); double a = FRandom[BigGun](0,360), s = FRandom[BigGun](0,bAlt?0.2:0.05); - Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); + Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s); if ( !invoker.t ) invoker.t = new("BigTracer"); invoker.t.ignoreme = self; invoker.t.hitlist.Clear(); @@ -537,8 +536,8 @@ Class BigGun : UnrealWeapon BIGR X 2 { Vector3 x, y, z, origin; - [x,y,z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*5.-z*9.); + [x,y,z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,5,0,-9); let c = Spawn("BigMag",origin); c.angle = angle; c.pitch = pitch; diff --git a/zscript/bonesaw.zsc b/zscript/bonesaw.zsc index ca44da3..edc5681 100644 --- a/zscript/bonesaw.zsc +++ b/zscript/bonesaw.zsc @@ -48,9 +48,7 @@ Class Bonesaw : UnrealWeapon FTranslatedLineTarget t; double slope = AimLineAttack(angle,DEFMELEERANGE,t,0.,ALF_CHECK3D); FLineTraceData d; - Vector3 x, y, z, origin; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),z*4); + Vector3 origin = dt_Utility.GetFireOffset(self,0,0,4); LineTrace(angle,DEFMELEERANGE,slope,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d); if ( d.HitType != TRACE_HitNone ) { @@ -90,8 +88,8 @@ Class Bonesaw : UnrealWeapon { invoker.special1++; Vector3 x, y, z, origin; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15-z*4); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,15,0,-4); if ( waterlevel >= 3 ) { UTMainHandler.DoKnockback(self,x,5000); @@ -113,8 +111,8 @@ Class Bonesaw : UnrealWeapon invoker.FireEffect(); A_AlertMonsters(); Vector3 x, y, z, origin; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15-z*4); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,15,0,-4); if ( waterlevel >= 3 ) { UTMainHandler.DoKnockback(self,x,20000); diff --git a/zscript/dispersionpistol.zsc b/zscript/dispersionpistol.zsc index 355223e..a8ab6ee 100644 --- a/zscript/dispersionpistol.zsc +++ b/zscript/dispersionpistol.zsc @@ -574,9 +574,7 @@ Class DispersionPistol : UnrealWeapon A_OverlayRenderstyle(PSP_FLASH,STYLE_Add); if ( !Dampener.Active(self) ) A_AlertMonsters(gameinfo.gametype&GAME_Strife?120:0); A_QuakeEx(2,2,2,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-3*y-3*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-3,-3); Actor p = Spawn(proj,origin); p.angle = angle; p.pitch = BulletSlope(); @@ -648,9 +646,7 @@ Class DispersionPistol : UnrealWeapon if ( !Dampener.Active(self) ) A_AlertMonsters(gameinfo.gametype&GAME_Strife?120:0); int qs = int(1+invoker.chargesize*0.3); A_QuakeEx(qs,qs,qs,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-3*y-3*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-3,-3); Actor p = Spawn(proj,origin); p.angle = angle; p.pitch = BulletSlope(); diff --git a/zscript/flamegun.zsc b/zscript/flamegun.zsc index 0f27eca..b8354c9 100644 --- a/zscript/flamegun.zsc +++ b/zscript/flamegun.zsc @@ -367,16 +367,15 @@ Class FlameGun : UnrealWeapon if ( bAlt ) A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); else A_QuakeEx(1,1,1,2,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); if ( !Dampener.Active(self) ) A_AlertMonsters(); - Vector3 x, y, z, x2, y2, z2, dir; + Vector3 x, y, z, dir; double a, s; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-3*y-z); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-3,-1); + [x, y, z] = dt_Utility.GetPlayerAxesAutoAimed(self); for ( int i=0; i<(bAlt?1:3); i++ ) { a = FRandom[FlameGun](0,360); s = FRandom[FlameGun](0,bAlt?0.:.06); - dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); + dir = dt_Utility.ConeSpread(x,y,z,a,s); let p = Spawn(bAlt?"UFireball2":"UFireball",origin); p.angle = atan2(dir.y,dir.x); p.pitch = asin(-dir.z); diff --git a/zscript/gatling.zsc b/zscript/gatling.zsc index 30dab19..230d992 100644 --- a/zscript/gatling.zsc +++ b/zscript/gatling.zsc @@ -206,15 +206,15 @@ Class SMiniGun : UnrealWeapon invoker.special1 = (invoker.special1%4)+1; } Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-y*2-z*2); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-2,-2); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); for ( int i=0; i<(bAlt?4:1); i++ ) { if ( bAlt && !weap.DepleteAmmo(weap.bAltFire,true,1) ) break; int pos = bAlt?i:invoker.special1; origin = level.Vec3Offset(origin,x*(!(pos%2)?-1.5:1.5)+y*(pos<2?-1.5:1.5)); double a = FRandom[Minigun](0,360), s = FRandom[Minigun](0,bAlt?0.12:0.03); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); vel -= dir*(player.onground?3:1.2); vel.z += (player.onground?0.8:.1); diff --git a/zscript/impaler.zsc b/zscript/impaler.zsc index c5510fa..6ce7cb7 100644 --- a/zscript/impaler.zsc +++ b/zscript/impaler.zsc @@ -176,6 +176,8 @@ Class ImpalerBurstBolt : Actor t.hitlist[i].hitactor.DamageMobj(self,target,3,'Impaler',DMG_THRUSTLESS); } Vector3 normal = -t.Results.HitVector, dir = t.Results.HitVector; + double a = FRandom[Impaler](0,360), s = FRandom[Impaler](0.,.8); + invoker.nextdir = dt_Utility.ConeSpread(dir,y,z,a,s); if ( t.Results.HitType == TRACE_HitWall ) { normal = (t.Results.HitLine.delta.y,-t.Results.HitLine.delta.x,0).unit(); @@ -197,13 +199,10 @@ Class ImpalerBurstBolt : Actor } else { - // why the fuck - t.Results.HitPos = level.Vec3Offset(pos,x*10.125); - normal *= 0; + invoker.nextpos = t.Results.HitPos; + return; } - double a = FRandom[Impaler](0,360), s = FRandom[Impaler](0.,.8); invoker.nextpos = level.Vec3Offset(t.Results.HitPos,normal); - invoker.nextdir = dt_Utility.ConeSpread(dir,y,z,a,s); } action void A_Spread() { @@ -545,11 +544,7 @@ Class StarterImpalerBolt : ImpalerBolt } Vector3 x, y, z, origin; bRELATIVETOFLOOR = (target.pos.z <= target.floorz); // hack, but kinda works - if ( target.player ) - { - [x, y, z] = dt_Utility.GetAxes(target.angle,target.pitch,target.roll); - origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),15*x-2.5*z); - } + if ( target.player ) origin = dt_Utility.GetFireOffset(target,15,0,-2.5); else origin = target.Vec3Offset(0,0,target.missileheight); SetOrigin(origin,true); if ( !flares[0] ) flares[0] = Spawn("ImpalerFlare",pos); @@ -562,7 +557,7 @@ Class StarterImpalerBolt : ImpalerBolt flares[0].A_SetScale(0.01+cos(gametic*8)*0.002); flares[1].A_SetScale(0.02+cos(gametic*8)*0.004); double a = FRandom[Impaler](0,360), s = FRandom[Impaler](0.,.1); - [x, y, z] = dt_Utility.GetAxes(target.angle,target.pitch,target.roll); + [x, y, z] = dt_Utility.GetPlayerAxes(target); Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s); dir = oldx*.5+dir*.5; oldx = dir; @@ -793,9 +788,7 @@ Class Impaler : UnrealWeapon UTMainHandler.DoFlash(self,Color(16,224,64,255),1); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,0,-2.5); Actor p = Spawn("ImpalerProjectile",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -818,9 +811,7 @@ Class Impaler : UnrealWeapon } action void A_StartBeam() { - Vector3 x, y, z, origin; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x-2.5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,15,0,-2.5); invoker.beam = Spawn("StarterImpalerBolt",origin); invoker.beam.angle = angle; invoker.beam.pitch = BulletSlope(); @@ -846,9 +837,7 @@ Class Impaler : UnrealWeapon invoker.FireEffect(); UTMainHandler.DoFlash(self,Color(16,255,32,255),3); A_AlertMonsters(); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x-2.5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,15,0,-2.5); int numpt = Random[Impaler](4,7); for ( int i=0; i 0 ) { p.Destroy(); s = FRandom[FlameT](0,.12); - dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); + dir = dt_Utility.ConeSpread(x,y,z,a,s); p = Spawn("UNapalmSplash",origin); p.scale *= 0.2; p.angle = atan2(dir.y,dir.x); @@ -980,9 +979,7 @@ Class UFlamethrower : UnrealWeapon A_StartSound("flamet/altfire",CHAN_WEAPON,volume:Dampener.Active(self)?.1:1.,pitch:max(.5,1.2-invoker.chargesize/10.)); if ( self is 'UTPlayer' ) UTPlayer(self).PlayAttacking3(); A_QuakeEx(1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),5+int(1.2*invoker.chargesize),0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.chargesize); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.3*y-2.7*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-2.3,-2.7); Actor p = Spawn("UNapalmGlob",origin); p.A_SetScale(0.5+invoker.chargesize/3.5); p.angle = angle; diff --git a/zscript/olsmp.zsc b/zscript/olsmp.zsc index 42f0d15..17f3d4d 100644 --- a/zscript/olsmp.zsc +++ b/zscript/olsmp.zsc @@ -148,7 +148,7 @@ Class OLSMP : UnrealWeapon A_OverlayFlags(-2,PSPF_RENDERSTYLE|PSPF_FORCESTYLE,true); A_OverlayRenderstyle(-2,STYLE_Add); Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); + [x, y, z] = dt_Utility.GetPlayerAxes(self); if ( alt ) { vel -= x*(player.onground?2.:0.8); @@ -159,10 +159,9 @@ Class OLSMP : UnrealWeapon vel -= x*(player.onground?2.2:1.); vel.z += (player.onground?.5:.15); } - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); - origin = level.Vec3Offset(origin,-z-y*4); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-4,-1); double a = FRandom[Automag](0,360), s = FRandom[Automag](0,alt?(0.05+invoker.altaccuracy):0.05); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); @@ -352,8 +351,8 @@ Class OLSMP : UnrealWeapon if ( self is 'UTPlayer' ) UTPlayer(self).PlayReloading(); Vector3 x, y, z, origin; - [x,y,z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*18.); + [x,y,z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,4,-4,-18); let c = Spawn("OLSMPMag",origin); c.angle = angle; c.pitch = pitch; diff --git a/zscript/peacemaker.zsc b/zscript/peacemaker.zsc index 6b1ecb7..76848b4 100644 --- a/zscript/peacemaker.zsc +++ b/zscript/peacemaker.zsc @@ -435,9 +435,7 @@ Class Peacemaker : UnrealWeapon if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return; invoker.FireEffect(); A_StartSound("peace/throw",CHAN_WEAPON); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*5-z*3); + Vector3 origin = dt_Utility.GetFireOffset(self,10,5,-3); let p = Spawn("PeaceBarrel",origin); if ( bAlt ) p.bAMBUSH = true; p.special1 = invoker.special2; diff --git a/zscript/quadshot.zsc b/zscript/quadshot.zsc index bf70213..e400c8f 100644 --- a/zscript/quadshot.zsc +++ b/zscript/quadshot.zsc @@ -247,9 +247,9 @@ Class QuadShot : UnrealWeapon return; } Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-z*2); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,10,0,-2); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); double a, s; Vector3 dir; if ( bAlt ) @@ -317,8 +317,8 @@ Class QuadShot : UnrealWeapon action void A_DropShells() { Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-x*4+y*8-z*8); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,-4,8,-8); for ( int i=0; i<(4-invoker.clipcount); i++ ) { let c = Spawn("QCasing",origin); diff --git a/zscript/razorjack.zsc b/zscript/razorjack.zsc index 1b19d07..e1203be 100644 --- a/zscript/razorjack.zsc +++ b/zscript/razorjack.zsc @@ -246,11 +246,9 @@ Class Razorjack : UnrealWeapon UTMainHandler.DoFlash(self,Color(16,255,0,255),1); A_AlertMonsters(); A_QuakeEx(1,1,1,5,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.08); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = Vec2OffsetZ(0,0,player.viewz); - if ( bAlt ) origin = level.Vec3Offset(origin,x*10-y*4-z*5); - else origin = level.Vec3Offset(origin,x*10-z*9); + Vector3 origin; + if ( bAlt ) origin = dt_Utility.GetFireOffset(self,10,-4,-5); + else origin = dt_Utility.GetFireOffset(self,10,0,-9); Actor p; p = Spawn("RazorBlade",origin); if ( bAlt ) diff --git a/zscript/rifle.zsc b/zscript/rifle.zsc index 6f89f7d..d245bcb 100644 --- a/zscript/rifle.zsc +++ b/zscript/rifle.zsc @@ -135,11 +135,12 @@ Class URifle : UnrealWeapon let l = Spawn("SniperLight",pos); l.target = self; Vector3 x, y, z, x2, y2, z2, dir; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x); - if ( !zoomed ) origin = level.Vec3Offset(origin,-y*3-z*2); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin; + if ( zoomed ) origin = dt_Utility.GetFireOffset(self,10,0,0); + else origin = dt_Utility.GetFireOffset(self,10,-3,-2); FLineTraceData d; - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); if ( alt ) dir = dt_Utility.ConeSpread(x2,y2,z2,FRandom[Rifle](0,360),FRandom[Rifle](0.,.25)); else dir = x2; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); diff --git a/zscript/stinger.zsc b/zscript/stinger.zsc index 9513b5d..0f5bd5f 100644 --- a/zscript/stinger.zsc +++ b/zscript/stinger.zsc @@ -153,9 +153,7 @@ Class ViewStingerChunk : StingerChunk Destroy(); return; } - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(target.angle,target.pitch,target.roll); - Vector3 origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*ofs.x+y*ofs.y+z*ofs.z); + Vector3 origin = dt_Utility.GetFireOffset(target,ofs.x,ofs.y,ofs.z); SetOrigin(origin,true); bInvisible = (players[consoleplayer].camera != target); if ( isFrozen() ) return; @@ -597,9 +595,7 @@ Class Stinger : UnrealWeapon UTMainHandler.DoFlash(self,Color(16,0,64,255),1); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x-8*y-8*z); + Vector3 origin = dt_Utility.GetFireOffset(self,5,-8,-8); Actor p = Spawn("StingerProjectile",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -642,9 +638,8 @@ Class Stinger : UnrealWeapon if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(1,1,1,4,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x-8*y-8*z); - [x, y, z] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x, y, z] = dt_Utility.GetPlayerAxesAutoAimed(self); + Vector3 origin = dt_Utility.GetFireOffset(self,5,-8,-8); Actor p; double a, s; Vector3 dir; diff --git a/zscript/stunner.zsc b/zscript/stunner.zsc index 4d06891..9427f58 100644 --- a/zscript/stunner.zsc +++ b/zscript/stunner.zsc @@ -362,9 +362,7 @@ Class Stunner : UnrealWeapon invoker.FireEffect(); A_QuakeEx(1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),5+int(1.2*invoker.chargesize),0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.chargesize); A_Overlay(-2,"Null"); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*10-z*5); + Vector3 origin = dt_Utility.GetFireOffset(self,10,0,-5); let p = Spawn("StunProj",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -379,7 +377,7 @@ Class Stunner : UnrealWeapon if ( d.HitLocation.z >= (d.HitActor.pos.z+d.HitActor.height*0.81) ) dmg = d.HitActor.DamageMobj(invoker,self,dmg*2,'Decapitated',DMG_THRUSTLESS); else dmg = d.HitActor.DamageMobj(invoker,self,dmg,'impact',DMG_THRUSTLESS); - UTMainHandler.DoKnockback(d.HitActor,x,4000*invoker.chargesize); + UTMainHandler.DoKnockback(d.HitActor,d.HitDir,4000*invoker.chargesize); if ( d.HitActor.bNOBLOOD ) { let p = Spawn("StunnerImpact",d.HitLocation-d.HitDir*4); diff --git a/zscript/ubiorifle.zsc b/zscript/ubiorifle.zsc index 1daf92d..64b709a 100644 --- a/zscript/ubiorifle.zsc +++ b/zscript/ubiorifle.zsc @@ -656,10 +656,7 @@ Class UBioRifle : UnrealWeapon if ( !Dampener.Active(self) ) A_AlertMonsters(); if ( bAlt ) A_QuakeEx(1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),1+int(0.5*invoker.chargesize),5+int(1.2*invoker.chargesize),0,64,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05+0.01*invoker.chargesize); else A_QuakeEx(1,1,1,5,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05); - Vector3 x, y, z; - double a, s; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-4*y-5*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-4,-5); Actor p; if ( bAlt ) { diff --git a/zscript/ueightball.zsc b/zscript/ueightball.zsc index 86c8a94..6f66705 100644 --- a/zscript/ueightball.zsc +++ b/zscript/ueightball.zsc @@ -419,9 +419,9 @@ Class Eightball : UnrealWeapon A_QuakeEx(2+num,2+num,2+num,6+num,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1+num*0.05); Vector3 x, y, z, x2, y2, z2; double a, s; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*z); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,10,0,-2); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); Actor p; if ( weap.bAltFire ) { @@ -502,8 +502,8 @@ Class Eightball : UnrealWeapon while ( a = Actor(t.Next()) ) { if ( !a.bSHOOTABLE || (a.Health <= 0) || a.bKilled || !a.bIsMonster || a.bCorpse || (a == self) || isTeammate(a) || !CheckSight(a) ) continue; - Vector3 viewdir = dt_Utility.Vec3FromAngle(angle,pitch); - Vector3 reldir = level.Vec3Diff(Vec2OffsetZ(0,0,player.viewz),a.Vec2OffsetZ(0,0,a.pos.z+a.height*0.5)); + Vector3 viewdir = dt_Utility.GetPlayerViewDir(self); + Vector3 reldir = level.Vec3Diff(dt_Utility.GetPlayerEye(self),a.Vec2OffsetZ(0,0,a.pos.z+a.height*0.5)); double reldist = reldir.length(); if ( reldist > 2000 ) continue; if ( reldir.unit() dot viewdir < 0.99 ) continue; diff --git a/zscript/uflakcannon.zsc b/zscript/uflakcannon.zsc index 986ade5..0197161 100644 --- a/zscript/uflakcannon.zsc +++ b/zscript/uflakcannon.zsc @@ -203,9 +203,8 @@ Class UFlakCannon : UnrealWeapon A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.05); Vector3 x, y, z; double a, s; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-5*y-4*z); - [x, y, z] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-5,-4); + [x, y, z] = dt_Utility.GetPlayerAxesAutoAimed(self); Vector3 offsets[8]; // vanilla adds these to each chunk offsets[0] = (0,0,0); offsets[1] = -z; @@ -259,10 +258,7 @@ Class UFlakCannon : UnrealWeapon UTMainHandler.DoFlash(self,Color(32,255,96,0),1); if ( !Dampener.Active(self) ) A_AlertMonsters(); A_QuakeEx(2,2,2,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.1); - Vector3 x, y, z; - double a, s; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-5*y-4*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-5,-4); Actor p = Spawn("UFlakSlug",origin); p.angle = angle; p.pitch = BulletSlope(); @@ -345,8 +341,8 @@ Class UFlakCannon : UnrealWeapon FLKE S 4 { Vector3 x, y, z, origin; - [x,y,z] = dt_Utility.GetAxes(angle,pitch,roll); - origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*3.-z*8.); + [x,y,z] = dt_Utility.GetPlayerAxes(self); + origin = dt_Utility.GetFireOffset(self,4,-3,-8); let c = Spawn("UFlakMag",origin); c.angle = angle; c.pitch = pitch; diff --git a/zscript/uhealitems.zsc b/zscript/uhealitems.zsc index 6379c63..bed616c 100644 --- a/zscript/uhealitems.zsc +++ b/zscript/uhealitems.zsc @@ -206,14 +206,12 @@ Class Seeds : UnrealInventory override bool Use( bool pickup ) { if ( pickup ) return false; - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(Owner.angle,Owner.pitch,Owner.roll); - Vector3 origin = level.Vec3Offset(Owner.Vec2OffsetZ(0,0,Owner.player.viewz),x*10-z*8); + Vector3 origin = dt_Utility.GetFireOffset(self,10,0,-8); let a = Spawn("SeedProj",origin); a.target = Owner; a.angle = Owner.angle; a.pitch = Owner.pitch; - a.vel += x*a.speed; + a.vel += dt_Utility.Vec3FromAngle(a.angle,a.pitch)*a.speed; return true; } States diff --git a/zscript/uminigun.zsc b/zscript/uminigun.zsc index 10b261c..42f72e7 100644 --- a/zscript/uminigun.zsc +++ b/zscript/uminigun.zsc @@ -50,10 +50,10 @@ Class UMinigun : UnrealWeapon l.target = self; if ( !alt ) MinigunLight(l).cnt--; Vector3 x, y, z, x2, y2, z2; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-y*3-z*3); + [x, y, z] = dt_Utility.GetPlayerAxes(self); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-3,-3); double a = FRandom[Minigun](0,360), s = FRandom[Minigun](0,alt?0.05:0.02); - [x2, y2, z2] = dt_Utility.GetAxes(angle,BulletSlope(),roll); + [x2, y2, z2] = dt_Utility.GetPlayerAxesAutoAimed(self); Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s); FLineTraceData d; LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d); diff --git a/zscript/unrealcommon.zsc b/zscript/unrealcommon.zsc index 7a08888..f977c57 100644 --- a/zscript/unrealcommon.zsc +++ b/zscript/unrealcommon.zsc @@ -844,7 +844,7 @@ Class UnrealInventory : Inventory Vector2 hofs = RotateVector((dropper.radius,0),dropper.angle); SetOrigin(dropper.Vec3Offset(hofs.x,hofs.y,dropper.height*0.5),false); Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(dropper.angle,dropper.pitch,dropper.roll); + [x, y, z] = dt_Utility.GetPlayerAxes(dropper); vel = x*12.0; vel.z += 4.0; angle = dropper.angle; diff --git a/zscript/unrealhud.zsc b/zscript/unrealhud.zsc index d50d722..a4b8378 100644 --- a/zscript/unrealhud.zsc +++ b/zscript/unrealhud.zsc @@ -847,7 +847,8 @@ Class UnrealHUD : BaseStatusBar } lastwep = CPlayer.PendingWeapon; vtracer.ignore = CPlayer.mo; - vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,dt_Utility.Vec3FromAngle(CPlayer.mo.angle,CPlayer.mo.pitch),1000,0); + Vector3 origin = dt_Utility.GetPlayerEye(CPlayer.mo); + vtracer.trace(origin,level.PointInSector(origin.xy),dt_Utility.GetPlayerViewDir(CPlayer.mo),1000,0); if ( vtracer.Results.HitType != TRACE_HitActor ) return; lastseen = vtracer.Results.HitActor; lastseentic = gametic; diff --git a/zscript/utranslocator.zsc b/zscript/utranslocator.zsc index b316b5d..d5b55e3 100644 --- a/zscript/utranslocator.zsc +++ b/zscript/utranslocator.zsc @@ -157,9 +157,7 @@ Class UTranslocator : UnrealWeapon if ( !weap ) return; A_StartSound("telehand/throw",CHAN_WEAPON); invoker.FireEffect(); - Vector3 x, y, z; - [x, y, z] = dt_Utility.GetAxes(angle,pitch,roll); - Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-8*y-12*z); + Vector3 origin = dt_Utility.GetFireOffset(self,10,-8,-12); let p = Spawn("UTranslocatorModule",origin); p.target = self; p.angle = angle;