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

@ -56,7 +56,7 @@ Class MinigunTracer : Actor
return;
}
dir = dir.unit();
SetOrigin(Vec3Offset(dir.x*160,dir.y*160,dir.z*160),true);
SetOrigin(level.Vec3Offset(pos,dir*160),true);
angle = atan2(dir.y,dir.x);
pitch = asin(-dir.z);
roll += 60;
@ -103,7 +103,7 @@ Class Minigun : UTWeapon
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*2.0-z*2.0;
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*2-z*2);
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();
@ -155,7 +155,7 @@ Class Minigun : UTWeapon
}
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;
@ -169,37 +169,23 @@ Class Minigun : UTWeapon
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*8.0+y*5.0-z*5.0;
origin = level.Vec3Offset(origin,x*8+y*5-z*5);
let c = Spawn("UTCasing",origin);
c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
c.Scale *= 0.5;
}
action void A_MinigunRefire( statelabel flash = null, bool nounwind = false )
action void A_MinigunRefire()
{
Weapon weap = Weapon(invoker);
if ( !weap || !player ) return;
if ( weap.Ammo1.Amount <= 0 )
{
if ( nounwind ) return;
A_ClearRefire();
player.setpsprite(PSP_WEAPON,weap.FindState("Unwind"));
return;
}
if ( nounwind )
{
if ( player.cmd.buttons&BT_ALTATTACK )
{
weap.bAltFire = true;
flash = "AltFire";
}
else
{
weap.bAltFire = false;
flash = "Fire";
}
}
A_Refire(flash);
weap.bAltFire = !!(player.cmd.buttons&BT_ALTATTACK);
A_Refire("Hold");
}
Default
@ -237,141 +223,38 @@ Class Minigun : UTWeapon
A_WeaponReady();
}
Wait;
FireDummy:
TNT1 A 1
{
let weap = Weapon(invoker);
if ( !(player.cmd.buttons&(BT_ATTACK|BT_ALTATTACK)) || (weap.Ammo1.Amount <= 0) )
{
player.SetPSprite(PSP_WEAPON,invoker.FindState("Unwind"));
return ResolveState("Null");
}
return ResolveState(null);
}
Wait;
Fire:
AltFire:
MGNI A 3 { invoker.bcnt = 5; }
Hold:
MGNF A 1
{
A_PlaySound("minigun/fire",CHAN_WEAPON,1.0,true);
A_FireBullet();
}
MGNF B 0 A_MinigunRefire(1);
Goto Unwind;
MGNF B 1 A_FireBullet();
MGNF C 0 A_MinigunRefire(1);
Goto Unwind;
MGNF C 1 A_FireBullet();
MGNF D 0 A_MinigunRefire(1);
Goto Unwind;
MGNF D 1 A_FireBullet();
MGNF E 0 A_MinigunRefire(1);
Goto Unwind;
MGNF E 1 A_FireBullet();
MGNF F 0 A_MinigunRefire(1);
Goto Unwind;
MGNF F 1 A_FireBullet();
MGNF G 0 A_MinigunRefire(1);
Goto Unwind;
MGNF G 1 A_FireBullet();
MGNF H 0 A_MinigunRefire(1);
Goto Unwind;
MGNF H 1 A_FireBullet();
MGNF I 0 A_MinigunRefire(1);
Goto Unwind;
MGNF I 1 A_FireBullet();
MGNF J 0 A_MinigunRefire(1);
Goto Unwind;
MGNF J 1 A_FireBullet();
MGNF K 0 A_MinigunRefire(1);
Goto Unwind;
MGNF K 1 A_FireBullet();
MGNF L 0 A_MinigunRefire(1);
Goto Unwind;
MGNF L 1 A_FireBullet();
MGNF M 0 A_MinigunRefire(1);
Goto Unwind;
MGNF M 1 A_FireBullet();
MGNF N 0 A_MinigunRefire(1);
Goto Unwind;
MGNF N 1 A_FireBullet();
MGNF O 0 A_MinigunRefire(1);
Goto Unwind;
MGNF O 1 A_FireBullet();
MGNF P 0 A_MinigunRefire(1);
Goto Unwind;
MGNF P 1 A_FireBullet();
MGNF Q 0 A_MinigunRefire(1);
Goto Unwind;
MGNF Q 1 A_FireBullet();
MGNF R 0 A_MinigunRefire(1);
Goto Unwind;
MGNF R 1 A_FireBullet();
MGNF S 0 A_MinigunRefire(1);
Goto Unwind;
MGNF S 1 A_FireBullet();
MGNF A 0
{
if ( invoker.bAltFire ) A_MinigunRefire(1);
else A_MinigunRefire("Hold");
A_PlaySound("minigun/fire",CHAN_WEAPON,1.0,true);
A_Overlay(-9999,"FireDummy");
}
Goto Unwind;
MGNF ABCDEFGHIJKLMNOPQRS 1 A_FireBullet();
MGNF A 0 A_JumpIf(invoker.bAltFire,1);
Goto Hold+1;
AltHold:
MGNF A 1
{
A_PlaySound("minigun/altfire",CHAN_WEAPON,1.0,true);
A_FireBullet(true);
}
MGNF D 0 A_MinigunRefire(1);
Goto Unwind;
MGNF D 1 A_FireBullet(true);
MGNF G 0 A_MinigunRefire(1);
Goto Unwind;
MGNF G 1 A_FireBullet(true);
MGNF J 0 A_MinigunRefire(1);
Goto Unwind;
MGNF J 1 A_FireBullet(true);
MGNF M 0 A_MinigunRefire(1);
Goto Unwind;
MGNF M 1 A_FireBullet(true);
MGNF P 0 A_MinigunRefire(1);
Goto Unwind;
MGNF P 1 A_FireBullet(true);
MGNF S 0 A_MinigunRefire(1);
Goto Unwind;
MGNF S 1 A_FireBullet(true);
MGNF C 0 A_MinigunRefire(1);
Goto Unwind;
MGNF C 1 A_FireBullet(true);
MGNF F 0 A_MinigunRefire(1);
Goto Unwind;
MGNF F 1 A_FireBullet(true);
MGNF I 0 A_MinigunRefire(1);
Goto Unwind;
MGNF I 1 A_FireBullet(true);
MGNF L 0 A_MinigunRefire(1);
Goto Unwind;
MGNF L 1 A_FireBullet(true);
MGNF O 0 A_MinigunRefire(1);
Goto Unwind;
MGNF O 1 A_FireBullet(true);
MGNF R 0 A_MinigunRefire(1);
Goto Unwind;
MGNF R 1 A_FireBullet(true);
MGNF B 0 A_MinigunRefire(1);
Goto Unwind;
MGNF B 1 A_FireBullet(true);
MGNF E 0 A_MinigunRefire(1);
Goto Unwind;
MGNF E 1 A_FireBullet(true);
MGNF H 0 A_MinigunRefire(1);
Goto Unwind;
MGNF H 1 A_FireBullet(true);
MGNF K 0 A_MinigunRefire(1);
Goto Unwind;
MGNF K 1 A_FireBullet(true);
MGNF N 0 A_MinigunRefire(1);
Goto Unwind;
MGNF N 1 A_FireBullet(true);
MGNF Q 0 A_MinigunRefire(1);
Goto Unwind;
MGNF Q 1 A_FireBullet(true);
MGNF A 0 A_MinigunRefire("AltHold");
Goto Unwind;
MGNF B 0 A_PlaySound("minigun/altfire",CHAN_WEAPON,1.0,true);
MGNF ADGJMPSCFILORBEHKNQ 1 A_FireBullet(true);
Goto AltHold+1;
Unwind:
MGNU A 0 A_PlaySound("minigun/unwind",CHAN_WEAPON);
MGNU ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_MinigunRefire(null,true);
MGU2 ABCDEFGHIJKLM 1 A_MinigunRefire(null,true);
MGNU ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_MinigunRefire();
MGU2 ABCDEFGHIJKLM 1 A_MinigunRefire();
Goto Idle;
Deselect:
MGND A 1 A_StopSound(CHAN_WEAPON);
@ -379,25 +262,11 @@ Class Minigun : UTWeapon
MGND J 1 A_Lower(int.max);
Wait;
MuzzleFlash:
TNT1 A 0 A_Jump(256,1,2,3,4,5,6,7,8,9);
Stop;
MMUZ A 2 Bright;
Stop;
MMUZ B 2 Bright;
Stop;
MMUZ C 2 Bright;
Stop;
MMUZ D 2 Bright;
Stop;
MMUZ E 2 Bright;
Stop;
MMUZ F 2 Bright;
Stop;
MMUZ G 2 Bright;
Stop;
MMUZ H 2 Bright;
Stop;
MMUZ I 2 Bright;
MMUZ # 2 Bright
{
let psp = player.FindPSprite(OverlayID());
psp.frame = Random[Minigun](0,8);
}
Stop;
}
}