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:
parent
cd72ee9688
commit
fb96c7523e
27 changed files with 445 additions and 777 deletions
|
|
@ -178,7 +178,6 @@ Class Enforcer : UTWeapon
|
|||
int ClipCount, SlaveClipCount;
|
||||
bool SlaveActive, SlaveDown, SlaveReload, SlaveAltFire;
|
||||
int SlaveRefire;
|
||||
transient ui Font usmf;
|
||||
double AltAccuracy;
|
||||
|
||||
property ClipCount : ClipCount;
|
||||
|
|
@ -297,12 +296,12 @@ Class Enforcer : UTWeapon
|
|||
if ( slave )
|
||||
{
|
||||
invoker.slaveclipcount--;
|
||||
if ( !flak_enforcerreload && (invoker.slaveclipcount <=0) ) invoker.slaveclipcount = (weap.Ammo1.Amount>0)?Min(20,weap.Ammo1.Amount):20;
|
||||
if ( !flak_enforcerreload && (invoker.slaveclipcount <=0) ) invoker.slaveclipcount = Min(invoker.default.slaveclipcount,weap.Ammo1.Amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
invoker.clipcount--;
|
||||
if ( !flak_enforcerreload && (invoker.clipcount <=0) ) invoker.clipcount = (weap.Ammo1.Amount>0)?Min(20,weap.Ammo1.Amount):20;
|
||||
if ( !flak_enforcerreload && (invoker.clipcount <=0) ) invoker.clipcount = Min(invoker.default.clipcount,weap.Ammo1.Amount);
|
||||
}
|
||||
invoker.FireEffect();
|
||||
UTMainHandler.DoFlash(self,Color(32,255,128,0),1);
|
||||
|
|
@ -327,10 +326,10 @@ Class Enforcer : UTWeapon
|
|||
}
|
||||
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;
|
||||
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[Enforcer](0,360), s = FRandom[Enforcer](0,alt?invoker.altaccuracy:0.004);
|
||||
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
|
||||
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
||||
|
|
@ -386,7 +385,7 @@ Class Enforcer : UTWeapon
|
|||
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("UTCasing",origin);
|
||||
c.vel = x*FRandom[Junk](-1.5,1.5)+y*ydir*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
|
||||
}
|
||||
|
|
@ -406,7 +405,14 @@ Class Enforcer : UTWeapon
|
|||
override void OwnerDied()
|
||||
{
|
||||
Super.OwnerDied();
|
||||
slaverefire = 0;
|
||||
slavereload = slaverefire = 0;
|
||||
if ( Owner.player.ReadyWeapon != self ) return;
|
||||
let psp = Owner.player.FindPSprite(2);
|
||||
if ( psp )
|
||||
{
|
||||
slaveactive = false;
|
||||
Owner.player.SetPSprite(2,ResolveState("LeftDeselect"));
|
||||
}
|
||||
}
|
||||
|
||||
Default
|
||||
|
|
@ -442,7 +448,10 @@ Class Enforcer : UTWeapon
|
|||
{
|
||||
invoker.slavedown = false;
|
||||
if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) )
|
||||
{
|
||||
invoker.slavereload = invoker.slaverefire = 0;
|
||||
A_Overlay(2,"LeftReady");
|
||||
}
|
||||
}
|
||||
ENFS ABCDEFGHIJKLMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE);
|
||||
Idle:
|
||||
|
|
@ -471,22 +480,21 @@ Class Enforcer : UTWeapon
|
|||
Dummy:
|
||||
TNT1 A 1
|
||||
{
|
||||
if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) A_Overlay(PSP_WEAPON,"Reload");
|
||||
else if ( flak_enforcerreload && ((invoker.clipcount < min(20,invoker.Ammo1.Amount)) || (invoker.slaveclipcount < min(20,invoker.Ammo1.Amount))) ) A_WeaponReady(WRF_ALLOWRELOAD);
|
||||
if ( (invoker.clipcount <= 0) && (invoker.Ammo1.Amount > 0) ) player.SetPSprite(PSP_WEAPON,ResolveState("Reload"));
|
||||
else if ( flak_enforcerreload && ((invoker.clipcount < min(invoker.default.clipcount,invoker.Ammo1.Amount)) || (invoker.slaveclipcount < min(invoker.default.slaveclipcount,invoker.Ammo1.Amount))) ) A_WeaponReady(WRF_ALLOWRELOAD);
|
||||
else A_WeaponReady();
|
||||
if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) ) A_Overlay(2,"LeftReady");
|
||||
if ( !invoker.slaveactive && (CountInv("Enforcer") > 1) )
|
||||
{
|
||||
invoker.slavereload = invoker.slaverefire = 0;
|
||||
A_Overlay(2,"LeftReady");
|
||||
}
|
||||
}
|
||||
Wait;
|
||||
LeftDummy:
|
||||
TNT1 A 1
|
||||
{
|
||||
if ( health <= 0 )
|
||||
{
|
||||
invoker.slaveactive = false;
|
||||
A_Overlay(2,"LeftDeselect");
|
||||
}
|
||||
else if ( flak_enforcerreload && invoker.slavereload ) A_Overlay(2,"LeftReload");
|
||||
else if ( invoker.slavedown ) A_Overlay(2,"LeftDeselect");
|
||||
if ( flak_enforcerreload && invoker.slavereload ) player.SetPSprite(2,ResolveState("LeftReload"));
|
||||
else if ( invoker.slavedown ) player.SetPSprite(2,ResolveState("LeftDeselect"));
|
||||
else A_LeftWeaponReady();
|
||||
}
|
||||
Wait;
|
||||
|
|
@ -543,50 +551,68 @@ Class Enforcer : UTWeapon
|
|||
Reload:
|
||||
ENFR A 0
|
||||
{
|
||||
invoker.slavereload = ((player.cmd.buttons&BT_RELOAD)&&invoker.slaveactive&&(invoker.slaveclipcount < min(20,invoker.Ammo1.Amount)))||(invoker.slaveclipcount <= 0);
|
||||
return A_JumpIf(invoker.clipcount>=min(20,invoker.Ammo1.Amount),"Idle");
|
||||
if ( invoker.clipcount >= invoker.default.clipcount )
|
||||
{
|
||||
invoker.slavereload = (invoker.slaveactive&&(invoker.slaveclipcount<min(invoker.default.slaveclipcount,invoker.Ammo1.Amount)));
|
||||
return ResolveState("Idle");
|
||||
}
|
||||
return ResolveState(null);
|
||||
}
|
||||
ENFR A 0
|
||||
{
|
||||
invoker.clipcount = Min(20,invoker.Ammo1.Amount);
|
||||
invoker.clipcount = 0;
|
||||
A_Overlay(-9999,null);
|
||||
A_WeaponOffset(0,32); // fix sudden psprite lowering
|
||||
A_PlaySound("enforcer/click",CHAN_WEAPON);
|
||||
}
|
||||
ENFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
|
||||
ENR2 AB 1;
|
||||
ENR2 B 30
|
||||
{
|
||||
invoker.clipcount = min(invoker.default.clipcount,invoker.Ammo1.Amount);
|
||||
A_PlaySound("enforcer/reload",CHAN_WEAPON);
|
||||
if ( self is 'UTPlayer' )
|
||||
UTPlayer(self).PlayReloading();
|
||||
invoker.slavereload = (invoker.slaveactive&&(invoker.slaveclipcount<min(invoker.default.slaveclipcount,invoker.Ammo1.Amount)));
|
||||
}
|
||||
ENFS A 0 A_PlaySound("enforcer/select",CHAN_WEAPON);
|
||||
Goto Ready;
|
||||
LeftReload:
|
||||
2NFR A 0
|
||||
{
|
||||
invoker.slaveclipcount = Min(20,invoker.Ammo1.Amount);
|
||||
invoker.slavereload = false;
|
||||
if ( invoker.slaveclipcount >= invoker.default.slaveclipcount )
|
||||
{
|
||||
invoker.slavereload = 0;
|
||||
return ResolveState("LeftIdle");
|
||||
}
|
||||
invoker.slaveclipcount = 0;
|
||||
A_Overlay(-9998,null);
|
||||
A_PlaySound("enforcer/click",CHAN_6);
|
||||
return ResolveState(null);
|
||||
}
|
||||
2NFR ABCDEFGHIJKLMNOPQRSTUVWXYZ 1;
|
||||
2NR2 AB 1;
|
||||
2NR2 B 30
|
||||
{
|
||||
invoker.slaveclipcount = min(invoker.default.slaveclipcount,invoker.Ammo1.Amount);
|
||||
A_PlaySound("enforcer/reload",CHAN_6);
|
||||
if ( self is 'UTPlayer' )
|
||||
UTPlayer(self).PlayReloading();
|
||||
invoker.slavereload = false;
|
||||
}
|
||||
2NFS A 0 A_PlaySound("enforcer/select",CHAN_6);
|
||||
Goto LeftReady;
|
||||
Deselect:
|
||||
ENFI A 1 { invoker.slavedown = true; }
|
||||
ENFD A 0 A_Overlay(-9999,null);
|
||||
ENFD A 0 A_JumpIf(invoker.slaveactive,"Deselect");
|
||||
ENFD A 0
|
||||
{
|
||||
A_Overlay(-9999,null);
|
||||
invoker.slavedown = true;
|
||||
}
|
||||
ENFD ABDEGHJK 1;
|
||||
ENFD L 1 A_Lower(int.max);
|
||||
ENFD L 1
|
||||
{
|
||||
if ( !player.FindPSprite(2) )
|
||||
A_Lower(int.max);
|
||||
}
|
||||
Wait;
|
||||
LeftDeselect:
|
||||
2NFD A 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue