Portal awareness adjustments to various vector operations.

Got rid of the deprecated Matrix4.GetAxes method. Next step is to get rid of more stuff by migrating to libeye.
Mirrored Translocator model so it shows the actually detailed side. At some point in UT's development it got flipped around for some reason.
Weapon code cleanup (most noticeable on states).
Backported scope shader from Doomreal.
Added optional "dummied out" Sniper zoom sounds from a dubious source.
This commit is contained in:
Marisa the Magician 2019-09-28 17:14:55 +02:00
commit fb96c7523e
27 changed files with 445 additions and 777 deletions

View file

@ -65,10 +65,9 @@ Class UTChainsaw : UTWeapon
double sawcnt;
double ammocharge;
override void Tick()
override void DoEffect()
{
Super.Tick();
if ( !Owner ) return;
if ( flak_sawammo )
{
AmmoType1 = "ChainsawAmmo";
@ -127,41 +126,52 @@ Class UTChainsaw : UTWeapon
A_QuakeEx(2,2,2,2,0,1,"",QF_RELATIVE,rollIntensity:0.15);
UTMainHandler.DoSwing(self,(FRandom[Chainsaw](-1,1),FRandom[Chainsaw](-1,1)),0.6,-0.2,2,SWING_Spring);
invoker.sawcnt += 1./TICRATE;
if ( invoker.sawcnt < 0.15 ) return;
invoker.sawcnt = 0;
invoker.FireEffect();
A_AlertMonsters();
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x-4.0*z;
FLineTraceData d;
LineTrace(angle,90,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
if ( invoker.sawcnt > 0.15 )
{
int dmg = 20;
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'slashed',DMG_USEANGLE,atan2(d.HitDir.y,d.HitDir.x));
d.HitActor.vel -= x*(500/d.HitActor.mass);
vel += x*(100/mass);
if ( d.HitActor.player ) d.HitActor.A_QuakeEx(5,5,5,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.25);
if ( d.HitActor.bNOBLOOD )
invoker.sawcnt = 0;
invoker.FireEffect();
A_AlertMonsters();
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-4*z);
FLineTraceData d;
LineTrace(angle,90,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
{
int dmg = 20;
dmg = d.HitActor.DamageMobj(invoker,self,dmg,'slashed',DMG_USEANGLE,atan2(d.HitDir.y,d.HitDir.x));
d.HitActor.vel -= x*(500/d.HitActor.mass);
vel += x*(100/mass);
if ( d.HitActor.player ) d.HitActor.A_QuakeEx(5,5,5,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN,rollIntensity:0.25);
if ( d.HitActor.bNOBLOOD )
{
let p = Spawn("SawImpact",d.HitLocation-d.HitDir*4);
p.angle = atan2(d.HitDir.y,d.HitDir.x);
p.pitch = asin(-d.HitDir.z);
}
else
{
d.HitActor.TraceBleed(dmg,invoker);
d.HitActor.SpawnBlood(d.HitLocation,atan2(d.HitDir.y,d.HitDir.x)+180,dmg);
}
}
else if ( d.HitType != TRACE_HitNone )
{
let p = Spawn("SawImpact",d.HitLocation-d.HitDir*4);
p.angle = atan2(d.HitDir.y,d.HitDir.x);
p.pitch = asin(-d.HitDir.z);
}
else
{
d.HitActor.TraceBleed(dmg,invoker);
d.HitActor.SpawnBlood(d.HitLocation,atan2(d.HitDir.y,d.HitDir.x)+180,dmg);
if ( d.HitType == TRACE_HitWall ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation-d.HitDir*4);
}
}
else if ( d.HitType != TRACE_HitNone )
bool quitout = false;
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
{
let p = Spawn("SawImpact",d.HitLocation-d.HitDir*4);
p.angle = atan2(d.HitDir.y,d.HitDir.x);
p.pitch = asin(-d.HitDir.z);
if ( d.HitType == TRACE_HitWall ) d.HitLine.RemoteActivate(self,d.LineSide,SPAC_Impact,d.HitLocation-d.HitDir*4);
A_StopSound(CHAN_6);
A_PlaySound("chainsaw/lower",CHAN_WEAPON);
quitout = true;
}
else if ( !(player.cmd.buttons&BT_ATTACK) ) quitout = true;
if ( quitout ) player.SetPSprite(PSP_WEAPON,ResolveState("Release"));
}
action void A_SawSwipe( bool initial = false )
{
@ -172,7 +182,7 @@ Class UTChainsaw : UTWeapon
A_AlertMonsters();
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = (pos.x,pos.y,player.viewz)+10.0*x-2.0*z;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*z);
FLineTraceData d;
double ang = (angle-60)+120*invoker.sawcnt;
LineTrace(ang,90,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
@ -226,7 +236,7 @@ Class UTChainsaw : UTWeapon
if ( bAlt || Random[Chainsaw](0,2) ) return;
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = (pos.x,pos.y,player.viewz)+5.0*x+1.0*y-3.0*z;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x+y-3*z);
for ( int i=0; i<5; i++ )
{
let s = Spawn("UTViewSmoke",origin);
@ -238,21 +248,6 @@ Class UTChainsaw : UTWeapon
UTViewSmoke(s).vvel += (0,-0.2,0);
}
}
action state A_SawRefire( statelabel flash = null )
{
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
{
A_ClearRefire();
A_StopSound(CHAN_6);
A_PlaySound("chainsaw/lower",CHAN_WEAPON);
return ResolveState("Release");
}
else
{
A_Refire(flash);
return ResolveState(null);
}
}
Default
{
Tag "$T_CHAINSAW";
@ -326,45 +321,10 @@ Class UTChainsaw : UTWeapon
Fire:
CSWJ A 1 A_PlaySound("chainsaw/fire",CHAN_6,looping:true);
CSWJ BCDEF 1 A_Vibrate();
Goto Hold;
Hold:
CSWJ G 1 A_SawHit();
CSWJ H 0 A_SawRefire(1);
Goto Release;
CSWJ H 1 A_SawHit();
CSWJ I 0 A_SawRefire(1);
Goto Release;
CSWJ I 1 A_SawHit();
CSWJ J 0 A_SawRefire(1);
Goto Release;
CSWJ J 1 A_SawHit();
CSWJ K 0 A_SawRefire(1);
Goto Release;
CSWJ K 1 A_SawHit();
CSWJ L 0 A_SawRefire(1);
Goto Release;
CSWJ L 1 A_SawHit();
CSWJ M 0 A_SawRefire(1);
Goto Release;
CSWJ M 1 A_SawHit();
CSWJ N 0 A_SawRefire(1);
Goto Release;
CSWJ N 1 A_SawHit();
CSWJ O 0 A_SawRefire(1);
Goto Release;
CSWJ O 1 A_SawHit();
CSWJ P 0 A_SawRefire(1);
Goto Release;
CSWJ P 1 A_SawHit();
CSWJ Q 0 A_SawRefire(1);
Goto Release;
CSWJ Q 1 A_SawHit();
CSWJ R 0 A_SawRefire(1);
Goto Release;
CSWJ R 1 A_SawHit();
CSWJ S 0 A_SawRefire(1);
Goto Release;
CSWJ S 1 A_SawHit();
CSWJ G 0 A_SawRefire("Hold");
CSWJ GHIJKLMNOPQRS 1 A_SawHit();
Loop;
Release:
CSWJ FEDCBA 1 A_Vibrate();
Goto Idle;