Beta 3. Not a lot of really noticeable changes, just more polishing.

- Made Rifle scope shader toggleable, and tweaked its visuals a bit.
- Various adjustments to vector math (using portal-aware functions).
- Adjusted the penetration mechanics of the Quadshot, should be able to better go through multiple targets now.
- Fixed incorrect state jump after zoomed rifle altfire.
- Reduced the range of the Detector (2048 → 512), it was too massive.
- [flak_m] Fixed the issue where some looping weapon sounds would get stuck if the player died or dropped the weapon.
- Corrected Gun Lore description of Flamethrower altfire.
This commit is contained in:
Marisa the Magician 2019-09-28 20:59:00 +02:00
commit 80f472bb62
25 changed files with 118 additions and 102 deletions

View file

@ -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();

View file

@ -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);
}

View file

@ -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()
{

View file

@ -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();

View file

@ -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();

View file

@ -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;

View file

@ -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 )
{

View file

@ -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);

View file

@ -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()

View file

@ -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);
}

View file

@ -51,6 +51,7 @@ Class QCasing : UCasing
Class QuadshotTracer : LineTracer
{
Actor ignoreme;
Array<HitListEntry> 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; i<t.HitList.Size(); i++ )
{
int dmg = 11;
FlakAccumulator.Accumulate(t.Results.HitActor,dmg,invoker,self,'shot');
FlakAccumulator.Accumulate(t.HitList[i].HitActor,dmg,invoker,self,'shot');
double mm = 2400;
UTMainHandler.DoKnockback(t.Results.HitActor,t.Results.HitVector+(0,0,0.025),mm*FRandom[Quadshot](0.4,1.2));
if ( t.Results.HitActor.bNOBLOOD )
UTMainHandler.DoKnockback(t.HitList[i].HitActor,t.HitList[i].x+(0,0,0.025),mm*FRandom[Quadshot](0.4,1.2));
if ( t.HitList[i].HitActor.bNOBLOOD )
{
let p = Spawn("BulletImpact",t.Results.HitPos);
let p = Spawn("BulletImpact",t.HitList[i].HitLocation);
p.scale *= FRandom[Quadshot](0.2,0.4);
p.angle = atan2(t.Results.HitVector.y,t.Results.HitVector.x)+180;
p.pitch = asin(t.Results.HitVector.z);
p.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180;
p.pitch = asin(t.HitList[i].x.z);
}
else
{
t.Results.HitActor.TraceBleed(dmg,self);
t.Results.HitActor.SpawnBlood(t.Results.HitPos,atan2(t.Results.HitVector.y,t.Results.HitVector.x)+180,dmg);
t.HitList[i].HitActor.TraceBleed(dmg,self);
t.HitList[i].HitActor.SpawnBlood(t.HitList[i].HitLocation,atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180,dmg);
}
}
else if ( t.Results.HitType != TRACE_HitNone )
if ( t.Results.HitType != TRACE_HitNone )
{
Vector3 hitnormal = -t.Results.HitVector;
if ( t.Results.HitType == TRACE_HitFloor )
@ -174,6 +183,7 @@ Class QuadShot : UnrealWeapon
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
if ( !invoker.t ) invoker.t = new("QuadshotTracer");
invoker.t.ignoreme = self;
invoker.t.hitlist.Clear();
invoker.t.Trace(origin,CurSector,dir,10000,0);
ProcessTraceHit(invoker.t);
}
@ -194,6 +204,7 @@ Class QuadShot : UnrealWeapon
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
if ( !invoker.t ) invoker.t = new("QuadshotTracer");
invoker.t.ignoreme = self;
invoker.t.hitlist.Clear();
invoker.t.Trace(origin,CurSector,dir,10000,0);
ProcessTraceHit(invoker.t);
}

View file

@ -55,9 +55,9 @@ Class URifle : UnrealWeapon
{
if ( sniperzoom <= 1. ) return;
if ( reticle.IsNull() ) reticle = TexMan.CheckForTexture("UReticle",Texman.Type_Any);
Screen.DrawTexture(reticle,false,300,300,DTA_VirtualWidth,600,DTA_VirtualHeight,600,DTA_LegacyRenderStyle,STYLE_Stencil,DTA_FillColor,Color(0,0,0));
Screen.DrawTexture(reticle,false,320,320,DTA_VirtualWidth,640,DTA_VirtualHeight,640,DTA_LegacyRenderStyle,STYLE_Stencil,DTA_FillColor,Color(255,0,0));
if ( !zfont ) zfont = Font.GetFont('UTFont40');
Screen.DrawText(zfont,Font.CR_UNTRANSLATED,700,700,String.Format("X%.1f",sniperzoom),DTA_VirtualWidth,1280,DTA_VirtualHeight,960,DTA_LegacyRenderStyle,STYLE_Stencil,DTA_FillColor,Color(0,0,0));
Screen.DrawText(zfont,Font.CR_UNTRANSLATED,700,700,String.Format("X%.1f",sniperzoom),DTA_VirtualWidth,1280,DTA_VirtualHeight,960,DTA_LegacyRenderStyle,STYLE_Stencil,DTA_FillColor,Color(255,0,0));
}
override void DetachFromOwner()
{
@ -72,7 +72,7 @@ Class URifle : UnrealWeapon
{
PlayerInfo p = players[consoleplayer];
if ( (p.Camera != Owner) || (sniperzoom <= 1.) ) Shader.SetEnabled(p,"URifleScope",false);
else Shader.SetEnabled(p,"URifleScope",true);
else Shader.SetEnabled(p,"URifleScope",CVar.GetCVar('sting_zoomshader',p).GetBool());
}
override void DoEffect()
{
@ -143,8 +143,8 @@ Class URifle : UnrealWeapon
l.target = self;
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = Vec2OffsetZ(0,0,player.viewz)+10.0*x;
if ( !zoomed ) origin = origin+y*3.0-z*2.0;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
if ( !zoomed ) origin = level.Vec3Offset(origin,y*3-z*2);
FLineTraceData d;
LineTrace(angle,10000,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
@ -206,7 +206,7 @@ Class URifle : UnrealWeapon
s.scale *= 1.8;
s.alpha *= 0.3;
}
origin += x*4.0+y*6.0-z*10.0;
origin = level.Vec3Offset(origin,x*4+y*6-z*10);
let c = Spawn("UCasing",origin);
c.scale *= 1.25;
c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
@ -292,7 +292,7 @@ Class URifle : UnrealWeapon
TNT1 A 7 A_RifleFire(true,true);
ZoomedAltFireEnd:
TNT1 A 6;
Goto Idle;
Goto ZoomedIdle;
Reload:
SRFI A 0 A_JumpIf(invoker.sniperzoom>1.0,"ZoomedReload");
SRFI A 8 A_ToggleLight();

View file

@ -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;

View file

@ -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<num; i++ )
{
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;
@ -436,7 +436,7 @@ Class Eightball : UnrealWeapon
s = -range*0.5;
for ( int i=0; i<num; i++ )
{
p = Spawn("URocket",origin+sin(s)*y);
p = Spawn("URocket",level.Vec3Offset(origin,sin(s)*y));
p.vel = (x2+sin(s)*y2).unit()*p.speed;
p.target = self;
p.tracer = invoker.LockedTarget;

View file

@ -201,7 +201,7 @@ Class UFlakCannon : 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.0*x+5.0*y-4.0*z;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+5*y-4*z);
[x, y, z] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 offsets[8]; // vanilla adds these to each chunk
offsets[0] = (0,0,0);
@ -260,7 +260,7 @@ Class UFlakCannon : 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.0*x+5.0*y-4.0*z;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+5*y-4*z);
Actor p = Spawn("UFlakSlug",origin);
p.angle = angle;
p.pitch = BulletSlope();

View file

@ -185,7 +185,7 @@ Class Seeds : 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("SeedProj",origin);
a.target = Owner;
a.angle = Owner.angle;

View file

@ -59,7 +59,7 @@ Class UMinigun : UnrealWeapon
if ( !alt ) MinigunLight(l).cnt--;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = pos+(0,0,player.viewheight)+10.0*x+y*3.0-z*3.0;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewheight),10*x+y*3-z*3);
double a = FRandom[Minigun](0,360), s = FRandom[Minigun](0,alt?0.05:0.02);
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
@ -111,7 +111,7 @@ Class UMinigun : UnrealWeapon
}
if ( !Random[Minigun](0,1) )
{
let t = Spawn("MinigunTracer",origin+x*20.0);
let t = Spawn("MinigunTracer",level.Vec3Offset(origin,x*20));
t.angle = atan2(dir.y,dir.x);
t.pitch = asin(-dir.z);
MinigunTracer(t).dest = d.HitLocation;
@ -125,7 +125,7 @@ Class UMinigun : UnrealWeapon
UTViewSmoke(s).vvel += (FRandom[Minigun](0.2,0.8),FRandom[Minigun](-0.3,0.3),FRandom[Minigun](-0.3,0.3));
s.target = self;
}
origin += x*4.0+y*3.0-z*12.0;
origin = level.Vec3Offset(origin,x*4+y*3-z*12);
let c = Spawn("UCasing",origin);
c.vel = x*FRandom[Junk](-1.5,1.5)-y*FRandom[Junk](2,4)+z*FRandom[Junk](-2,1);
}

View file

@ -360,7 +360,7 @@ Class MotionDetector : UnrealInventory
for ( int i=0; i<nearscan.Size(); i++ )
{
Vector2 absofs = level.Vec2Diff(Owner.pos.xy,nearscan[i].pos.xy);
absofs *= (96./2048.);
absofs *= (96./512.);
double ang = Owner.angle-90;
Vector2 relofs = (absofs.x*cos(ang)+absofs.y*sin(ang),-absofs.y*cos(ang)+absofs.x*sin(ang));
if ( max(abs(relofs.x),abs(relofs.y)) > 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;

View file

@ -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;