1.2 update, w/ GZDoom 4.9 stuff:

- Customizable player skins here too.
 - Integrated re-skin add-ons ("Old Sounds" is still separate).
 - The usual fixes and optimizations.
 - All weapons are now left-handed, where possible.
This commit is contained in:
Marisa the Magician 2022-11-06 00:02:46 +01:00
commit a21aa43f35
1485 changed files with 1157 additions and 380 deletions

View file

@ -290,27 +290,10 @@ Class ViewASMDSpark : ShockSpark
Class ASMDHitbox : ShockHitbox
{
override int DamageMobj( Actor inflictor, Actor source, int damage, Name mod, int flags, double angle )
{
if ( mod == 'jolted' )
return 0;
if ( !bAMBUSH )
{
bAMBUSH = true;
if ( target && target.InStateSequence(target.CurState,target.FindState("Spawn")) )
target.ExplodeMissile();
}
return 0;
}
override bool CanCollideWith( Actor other, bool passive )
{
return true;
}
Default
{
Radius 6;
Height 12;
+SHOOTABLE;
}
}
@ -359,7 +342,7 @@ Class ASMDBall : Actor
l.Args[3] = 120;
r = Spawn("ASMDBeamRing",pos);
}
Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 HitNormal = dt_Utility.Vec3FromAngle(angle,pitch);
if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
else if ( BlockingFloor )
{
@ -414,22 +397,22 @@ Class ASMDBall : Actor
switch (i)
{
case 0:
dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x,y,z,a,s);
break;
case 1:
dir = (y+x*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(y,x,z,a,s);
break;
case 2:
dir = (-x+y*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(-x,y,z,a,s);
break;
case 3:
dir = (-y+x*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(-y,x,z,a,s);
break;
case 4:
dir = (z+x*cos(a)*s+y*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(z,x,y,a,s);
break;
case 5:
dir = (-z+x*cos(a)*s+y*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(-z,x,y,a,s);
break;
}
let p = Spawn("ASMDSpark",level.Vec3Offset(pos,-vel));
@ -509,7 +492,7 @@ Class ASMDBeam : Actor
Super.Tick();
if ( isFrozen() || !moving ) return;
// step trace
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
tracedir = dt_Utility.Vec3FromAngle(angle,pitch);
t.ShootThroughList.Clear();
t.Trace(pos,cursector,tracedir,1000,0);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
@ -687,7 +670,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 = level.Vec3Offset(Vec2OffsetZ(0,0,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();
@ -696,7 +679,7 @@ Class ASMD : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewASMDSpark",origin);
ViewASMDSpark(s).ofs = (10,2.9,-2.5);
ViewASMDSpark(s).ofs = (10,-2.9,-2.5);
s.target = self;
ViewASMDSpark(s).vvel += (FRandom[ASMD](0.5,2.0),FRandom[ASMD](-1.5,1.5),FRandom[ASMD](-1.5,1.5));
}
@ -718,18 +701,18 @@ 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 = level.Vec3Offset(Vec2OffsetZ(0,0,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();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
ASMDBall(p).mult = mult-1;
int numpt = Random[ASMD](20,40);
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewASMDSpark",origin);
ViewASMDSpark(s).ofs = (10,2.9,-2.5);
ViewASMDSpark(s).ofs = (10,-2.9,-2.5);
s.target = self;
ViewASMDSpark(s).vvel += (FRandom[ASMD](0.5,2.0),FRandom[ASMD](-1.5,1.5),FRandom[ASMD](-1.5,1.5));
}

View file

@ -193,13 +193,13 @@ Class Automag : 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*x);
int ydir = slave?-1:1;
int ydir = slave?1:-1;
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);
if ( invoker.Amount > 1 ) s *= 1.6;
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
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);
UTBulletTrail.DoTrail(self,origin,dir,10000,int((invoker.Amount+alt)**2));
@ -551,7 +551,7 @@ Class Automag : UnrealWeapon
invoker.slavereload = (invoker.slaveactive&&(invoker.slaveclipcount<invoker.default.slaveclipcount)&&(invoker.Ammo1.Amount>0));
Vector3 x, y, z, origin;
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*4.-z*8.);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*8.);
let c = Spawn("AutomagMag",origin);
c.angle = angle;
c.pitch = pitch;
@ -587,7 +587,7 @@ Class Automag : UnrealWeapon
invoker.slavereload = false;
Vector3 x, y, z, origin;
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*8.);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*4.-z*8.);
let c = Spawn("AutomagMag",origin);
c.angle = angle;
c.pitch = pitch;

View file

@ -5,20 +5,14 @@ Class BCasing : UTCasing
BounceSound "automag/casing";
}
}
Class BCasing2 : UTCasing
{
Default
{
BounceSound "automag/casing";
}
}
Class Betamag : UnrealWeapon
{
bool SlaveActive, SlaveDown, SlaveAltFire, SlaveWhip, SlaveSpin;
int SlaveRefire;
double AltAccuracy;
int OldSkin;
override bool TryPickup( in out Actor toucher )
{
if ( !sting_proto ) return false; // not allowed
@ -27,6 +21,45 @@ Class Betamag : UnrealWeapon
override void Tick()
{
Super.Tick();
switch ( sting_altbetamag )
{
case 1:
if ( OldSkin != 1 )
{
A_ChangeModel("",1,"","",1,"models","Autom1_.png");
A_ChangeModel("",0,"","",0,"models","Autom1.png",CMDL_USESURFACESKIN);
A_ChangeModel("",2,"","",0,"models","Autom1.png",CMDL_USESURFACESKIN);
}
OldSkin = 1;
break;
case 2:
if ( OldSkin != 2 )
{
A_ChangeModel("",1,"","",1,"models","AutoHand1_.png");
A_ChangeModel("",0,"","",0,"models","AutoHand1.png",CMDL_USESURFACESKIN);
A_ChangeModel("",2,"","",0,"models","Autom1.png",CMDL_USESURFACESKIN);
}
OldSkin = 2;
break;
case 3:
if ( OldSkin != 3 )
{
A_ChangeModel("",1,"","",1,"models","Autom1_.png");
A_ChangeModel("",0,"","",0,"models","Autom1.png",CMDL_USESURFACESKIN);
A_ChangeModel("",2,"","",0,"models","AutoHand1.png",CMDL_USESURFACESKIN);
}
OldSkin = 2;
break;
case 0:
if ( OldSkin != 0 )
{
A_ChangeModel("",1,"","",1,"models","AutoHand1_.png");
A_ChangeModel("",0,"","",0,"models","AutoHand1.png",CMDL_USESURFACESKIN);
A_ChangeModel("",2,"","",0,"models","AutoHand1.png",CMDL_USESURFACESKIN);
}
OldSkin = 0;
break;
}
if ( sting_protomags && (MaxAmount <= 1) ) MaxAmount = 2;
else if ( !sting_protomags && (MaxAmount > 1) ) MaxAmount = 1;
if ( Owner && !sting_protomags && (Amount > 1) )
@ -233,13 +266,13 @@ 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*x);
int ydir = slave?-1:1;
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);
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_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
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);
UTBulletTrail.DoTrail(self,origin,dir,10000,int((invoker.Amount+alt)**2));
@ -294,7 +327,9 @@ Class Betamag : UnrealWeapon
s.alpha *= 0.5;
}
origin = level.Vec3Offset(origin,x*5+ydir*y*8-z*2);
let c = Spawn(slave?"BCasing2":"BCasing",origin);
let c = Spawn("BCasing",origin);
if ( !slave && ((invoker.OldSkin == 1) || (invoker.OldSkin == 3)) ) c.A_ChangeModel("",0,"","",0,"models","Autom1.png");
else if ( slave && ((invoker.OldSkin == 1) || (invoker.OldSkin == 2)) ) c.A_ChangeModel("",0,"","",0,"models","Autom1.png");
c.angle = angle;
c.pitch = pitch;
c.vel = x*FRandom[Junk](-1.5,1.5)+y*ydir*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);

View file

@ -334,7 +334,7 @@ Class BigGun : UnrealWeapon
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*5-z*1);
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
double a = FRandom[BigGun](0,360), s = FRandom[BigGun](0,bAlt?0.2:0.05);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
if ( !invoker.t ) invoker.t = new("BigTracer");
invoker.t.ignoreme = self;
invoker.t.hitlist.Clear();

View file

@ -50,7 +50,7 @@ Class Bonesaw : UnrealWeapon
FLineTraceData d;
Vector3 x, y, z, origin;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),y*4-z*4);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),z*4);
LineTrace(angle,DEFMELEERANGE,slope,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
if ( d.HitType != TRACE_HitNone )
{
@ -91,7 +91,7 @@ Class Bonesaw : UnrealWeapon
invoker.special1++;
Vector3 x, y, z, origin;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15+y*4-z*4);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15-z*4);
if ( waterlevel >= 3 )
{
UTMainHandler.DoKnockback(self,x,5000);
@ -114,7 +114,7 @@ Class Bonesaw : UnrealWeapon
A_AlertMonsters();
Vector3 x, y, z, origin;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15+y*4-z*4);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15-z*4);
if ( waterlevel >= 3 )
{
UTMainHandler.DoKnockback(self,x,20000);

View file

@ -314,7 +314,7 @@ Class DispersionAmmo : Actor
{
a = FRandom[DPistol](0,360);
s = FRandom[ASMD](0,0.35);
dir = (-x+y*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(-x,y,z,a,s);
p = Spawn(invoker.BurstClass,level.Vec3Offset(pos,scale.x*(dir*16.+x*32.)));
p.A_SetScale(0.1*min(0.8+invoker.mult*0.75,1.5));
p.vel = vel*0.5+dir*FRandom[DPistol](3,8);
@ -322,7 +322,7 @@ Class DispersionAmmo : Actor
}
action void A_DispExpl()
{
UTMainHandler.DoKnockback(tracer,(cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)),6000);
UTMainHandler.DoKnockback(tracer,dt_Utility.Vec3FromAngle(angle,pitch),6000);
A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0);
A_SprayDecal("RazorBlast",20);
Spawn(invoker.LightClass,pos);
@ -335,7 +335,7 @@ Class DispersionAmmo : Actor
a.A_SetScale(0.2*min(0.8+invoker.mult*0.75,1.5));
ang = FRandom[DPistol](0,360);
pt = FRandom[DPistol](-90,90);
a.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[DPistol](6,16);
a.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[DPistol](6,16);
a.alpha *= 2.;
}
a = Spawn(invoker.ExploClass,pos);
@ -479,6 +479,30 @@ Class DispersionPistol : UnrealWeapon
double chargesize, count;
bool bCharging;
int MainUse, ChargeUse;
bool bOldSkin;
override void Tick()
{
Super.Tick();
if ( sting_olddpistol )
{
if ( !bOldSkin )
{
A_ChangeModel("",1,"","",1,"models/OldSkins","DPistol1_.png");
A_ChangeModel("",0,"","",1,"models/OldSkins","DPistol1.png",CMDL_USESURFACESKIN);
}
bOldSkin = true;
}
else
{
if ( bOldSkin )
{
A_ChangeModel("",1,"","",1,"models","DPistol1_.png");
A_ChangeModel("",0,"","",1,"models","DPistol1.png",CMDL_USESURFACESKIN);
}
bOldSkin = false;
}
}
override int, int, bool, bool GetClipAmount()
{
@ -551,18 +575,18 @@ 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 = level.Vec3Offset(Vec2OffsetZ(0,0,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();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
DispersionAmmo(p).mult = mult;
int numpt = Random[DPistol](10,20);
for ( int i=0; i<numpt; i++ )
{
let s = Spawn(part,origin);
ViewASMDSpark(s).ofs = (10,3,-3);
ViewASMDSpark(s).ofs = (10,-3,-3);
s.target = self;
ViewASMDSpark(s).vvel += (FRandom[ASMD](0.5,2.0),FRandom[ASMD](-1.5,1.5),FRandom[ASMD](-1.5,1.5));
}
@ -625,11 +649,11 @@ 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 = level.Vec3Offset(Vec2OffsetZ(0,0,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();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
p.bAMBUSH = true;
double scl = 0.5+invoker.chargesize*0.6;
@ -639,7 +663,7 @@ Class DispersionPistol : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn(part,origin);
ViewASMDSpark(s).ofs = (10,3,-3);
ViewASMDSpark(s).ofs = (10,-3,-3);
s.target = self;
ViewASMDSpark(s).vvel += (FRandom[ASMD](0.5,2.0),FRandom[ASMD](-1.5,1.5),FRandom[ASMD](-1.5,1.5));
}

View file

@ -139,7 +139,7 @@ Class UFireball : Actor
}
A_SprayDecal("SmallRocketBlast");
Scale *= FRandom[ExploS](0.6,0.9);
Vector3 dir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(angle,pitch);
int numpt = Random[ExploS](10,15);
if ( bAMBUSH ) numpt /= 3;
for ( int i=0; i<numpt; i++ )
@ -212,7 +212,7 @@ Class UFireball2 : UFireball
scale *= 2.;
A_Explode(GetMissileDamage(0,0),90);
UTMainHandler.DoBlast(self,90,12000);
Vector3 dir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(angle,pitch);
int numpt = Random[ExploS](10,15);
for ( int i=0; i<numpt; i++ )
{
@ -222,7 +222,7 @@ Class UFireball2 : UFireball
s.scale *= FRandom[ExploS](1.9,2.5);
s.SetShade(Color(1,1,1)*Random[ExploS](32,64));
}
Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 HitNormal = dir;
if ( BlockingLine )
{
HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
@ -369,13 +369,13 @@ Class FlameGun : UnrealWeapon
Vector3 x, y, z, x2, y2, z2, dir;
double a, s;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-3*y-z);
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
for ( int i=0; i<(bAlt?1:3); i++ )
{
a = FRandom[FlameGun](0,360);
s = FRandom[FlameGun](0,bAlt?0.:.06);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
let p = Spawn(bAlt?"UFireball2":"UFireball",origin);
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
@ -386,7 +386,7 @@ Class FlameGun : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("UTViewSpark",origin);
UTViewSpark(s).ofs = (10,3,-1);
UTViewSpark(s).ofs = (10,-3,-1);
UTViewSpark(s).vvel = (FRandom[FlameGun](3,12),FRandom[FlameGun](-2,2),FRandom[FFlameGun](-2,2));
s.target = self;
s.A_SetTranslation('FlamGSpark');
@ -394,7 +394,7 @@ Class FlameGun : UnrealWeapon
for ( int i=0; i<8; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,3,-1);
UTViewSmoke(s).ofs = (10,-3,-1);
UTViewSmoke(s).vvel = (FRandom[FlameGun](0,1.2),FRandom[FlameGun](-.3,.3),FRandom[FlameGun](-.3,.3));
s.target = self;
s.scale *= 1.6;

View file

@ -79,7 +79,7 @@ Class SMiniShell : FastProjectile
Scale *= FRandom[ExploS](1.4,1.8);
Scale.x *= RandomPick[ExploS](-1,1);
Scale.y *= RandomPick[ExploS](-1,1);
Vector3 dir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(angle,pitch);
int numpt = Random[ExploS](20,30);
for ( int i=0; i<numpt; i++ )
{
@ -207,15 +207,15 @@ 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*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;
int pos = bAlt?i:invoker.special1;
origin = level.Vec3Offset(origin,x*(!(pos%2)?-1.5:1.5)+y*(pos<2?1.5:-1.5));
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_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
vel -= dir*(player.onground?3:1.2);
vel.z += (player.onground?0.8:.1);
let p = Spawn("SMiniShell",origin);
@ -227,7 +227,7 @@ Class SMiniGun : UnrealWeapon
for ( int i=0; i<20; i++ )
{
let s = Spawn("UTStaticViewSmoke",origin);
UTViewSmoke(s).ofs = (10,2,-2);
UTViewSmoke(s).ofs = (10,-2,-2);
UTViewSmoke(s).vvel += (FRandom[SMini](-0.05,0.5),FRandom[SMini](-0.2,0.2),FRandom[SMini](-0.2,0.2));
s.target = self;
s.scale *= 1.8;

View file

@ -203,7 +203,7 @@ Class ImpalerBurstBolt : Actor
}
double a = FRandom[Impaler](0,360), s = FRandom[Impaler](0.,.8);
invoker.nextpos = level.Vec3Offset(t.Results.HitPos,normal);
invoker.nextdir = (dir+cos(a)*y*s+sin(a)*z*s).unit();
invoker.nextdir = dt_Utility.ConeSpread(dir,y,z,a,s);
}
action void A_Spread()
{
@ -458,7 +458,7 @@ Class ImpalerBolt : Actor
dirto /= distto;
distto = 1.-clamp(distto*0.1,0.,.9);
}
dir = (x+y*cos(a)*s+z*sin(a)*s+dirto*distto).unit();
dir = (dt_Utility.ConeSpread(x,y,z,a,s)+dirto*distto).unit();
dir = dir*.5+oldx*.5;
oldx = dir;
A_SetAngle(atan2(dir.y,dir.x));
@ -524,7 +524,7 @@ Class StarterImpalerBolt : ImpalerBolt
start = self;
flares[0] = Spawn("ImpalerFlare",pos);
flares[1] = Spawn("ImpalerFlare",pos);
oldx = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
oldx = dt_Utility.Vec3FromAngle(angle,pitch);
}
override void OnDestroy()
{
@ -548,7 +548,7 @@ Class StarterImpalerBolt : ImpalerBolt
if ( target.player )
{
[x, y, z] = dt_CoordUtil.GetAxes(target.pitch,target.angle,target.roll);
origin = level.Vec3Offset(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.5*z);
}
else origin = target.Vec3Offset(0,0,target.missileheight);
SetOrigin(origin,true);
@ -563,13 +563,13 @@ Class StarterImpalerBolt : ImpalerBolt
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_CoordUtil.GetAxes(target.pitch,target.angle,target.roll);
Vector3 dir = (x+cos(a)*y*s+sin(a)*z*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s);
dir = oldx*.5+dir*.5;
oldx = dir;
A_SetAngle(atan2(dir.y,dir.x));
A_SetPitch(asin(-dir.z));
hitlist.Clear();
CheckBeam((cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch)));
CheckBeam(dt_Utility.Vec3FromAngle(angle,pitch));
}
}
@ -618,7 +618,7 @@ Class ImpalerProjectile : Actor
let c = Spawn("ImpalerChunk",pos);
c.angle = ang;
c.pitch = pt;
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Impaler](3,9);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Impaler](3,9);
}
numpt = Random[Impaler](6,12);
for ( int i=0; i<numpt; i++ )
@ -626,7 +626,7 @@ Class ImpalerProjectile : Actor
ang = FRandom[Impaler](0,360);
pt = FRandom[Impaler](-90,90);
let c = Spawn("UTSmoke",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Impaler](.3,.8);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Impaler](.3,.8);
c.SetShade(Color(4,1,3)*Random[Impaler](48,63));
c.bBRIGHT = true;
c.alpha *= .5;
@ -688,7 +688,7 @@ Class ImpalerProjectile : Actor
ang = FRandom[Impaler](0,360);
pt = FRandom[Impaler](-90,90);
let c = Spawn("ImpalerSpark",pos);
c.vel = vel*0.5+(cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Impaler](.2,.8)*(special1/90.);
c.vel = vel*0.5+dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Impaler](.2,.8)*(special1/90.);
}
}
if ( special1 > 120 )
@ -703,7 +703,7 @@ Class ImpalerProjectile : Actor
c.bBRIGHT = true;
c.alpha *= min(1.,special1/350.);
c.scale *= min(2.,special1/350.);
c.vel = vel*0.5+(cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Impaler](.2,.8)*(special1/120.);
c.vel = vel*0.5+dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Impaler](.2,.8)*(special1/120.);
}
}
}
@ -794,12 +794,12 @@ Class Impaler : 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 = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2*y-2.5*z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.5*z);
Actor p = Spawn("ImpalerProjectile",origin);
p.angle = angle;
p.pitch = BulletSlope();
p.roll = FRandom[Impaler](0,360);
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
double mult = Amplifier.GetMult(self,100);
p.special1 = int(3*invoker.clipcount*mult+120*(mult-1.));
@ -807,7 +807,7 @@ Class Impaler : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewImpalerSpark",origin);
ViewImpalerSpark(s).ofs = (10,2,-2.5);
ViewImpalerSpark(s).ofs = (10,0,-2.5);
s.target = self;
s.scale *= 3.;
ViewImpalerSpark(s).vvel += (FRandom[Impaler](0.2,0.8),FRandom[Impaler](-0.5,0.5),FRandom[Impaler](-0.5,0.5));
@ -819,7 +819,7 @@ Class Impaler : UnrealWeapon
{
Vector3 x, y, z, origin;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x+2*y-2.5*z);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x-2.5*z);
invoker.beam = Spawn("StarterImpalerBolt",origin);
invoker.beam.angle = angle;
invoker.beam.pitch = BulletSlope();
@ -847,12 +847,12 @@ Class Impaler : UnrealWeapon
A_AlertMonsters();
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x+2*y-2.5*z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x-2.5*z);
int numpt = Random[Impaler](4,7);
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (15,2,-2.5);
UTViewSmoke(s).ofs = (15,0,-2.5);
s.scale *= 1.8;
s.target = self;
s.SetShade("602060");
@ -863,7 +863,7 @@ Class Impaler : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewImpalerSpark",origin);
ViewImpalerSpark(s).ofs = (15,2,-2.5);
ViewImpalerSpark(s).ofs = (15,0,-2.5);
s.target = self;
s.scale *= 3.;
ViewImpalerSpark(s).vvel += (FRandom[Impaler](0.2,0.8),FRandom[Impaler](-0.5,0.5),FRandom[Impaler](-0.5,0.5));
@ -896,7 +896,7 @@ Class Impaler : UnrealWeapon
FLineTraceData d;
Vector3 x, y, z, origin;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),y*4-z*4);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-z*4);
LineTrace(angle,DEFMELEERANGE*1.5,slope,TRF_ABSPOSITION,origin.z,origin.x,origin.y,data:d);
if ( d.HitType != TRACE_HitNone )
{

View file

@ -919,7 +919,7 @@ Class LightFlareThrown : BetaFlareThrown
a = FRandom[BFlare](0,360);
s = FRandom[BFlare](0,0.15);
let t = Spawn("LightFlareParticle",pos+x*4+z);
t.vel = (x+y*cos(a)*s+z*sin(a)*s).unit()*FRandom[BFlare](1,4);
t.vel = dt_Utility.ConeSpread(x,y,z,a,s)*FRandom[BFlare](1,4);
}
}
override void Tick()
@ -941,7 +941,7 @@ Class DarkFlareThrown : BetaFlareThrown
a = FRandom[BFlare](0,360);
s = FRandom[BFlare](0,0.5);
let t = Spawn("DarkFlareParticle",pos+x*4+z);
t.vel = (x+y*cos(a)*s+z*sin(a)*s).unit()*FRandom[BFlare](4,8);
t.vel = dt_Utility.ConeSpread(x,y,z,a,s)*FRandom[BFlare](4,8);
}
}
override void Tick()
@ -1201,7 +1201,7 @@ Class UFlashLight1 : DynamicLight
while ( bt.Next() )
{
if ( !bt.Thing || (Distance3D(bt.Thing) > args[LIGHT_INTENSITY]) ) continue;
Vector3 aimdir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 aimdir = dt_Utility.Vec3FromAngle(angle,pitch);
Vector3 reldir = Vec3To(bt.Thing).unit();
if ( (acos(aimdir dot reldir) < SpotOuterAngle+5) && bt.Thing.CheckSight(target) ) bt.Thing.LastHeard = target;
}
@ -1673,7 +1673,7 @@ Class MinigunSentry : Actor
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(pos,x*24+z*8);
double a = FRandom[Sentry](0,360), s = FRandom[Sentry](0,0.04);
Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s);
FLineTraceData d;
master.LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )
@ -1952,7 +1952,7 @@ Class SentryBoom : Actor
let f = Spawn("SentryFragment",Vec3Offset(FRandom[EFrag](-8,8),FRandom[EFrag](-8,8),FRandom[EFrag](4,40)));
ang = FRandom[EFrag](0,360);
pt = FRandom[EFrag](-90,90);
f.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[EFrag](8,15);
f.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[EFrag](8,15);
}
Scale.x *= RandomPick[EFrag](-1,1);
Scale.y *= RandomPick[EFrag](-1,1);
@ -2366,7 +2366,7 @@ Class SentryGun : Actor
while ( a = Actor(ti.Next()) )
{
if ( !IsEnemy(a) ) continue;
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 x = dt_Utility.Vec3FromAngle(angle,pitch);
Vector3 vecto = level.Vec3Diff(Vec3Offset(0,0,16),a.Vec3Offset(0,0,a.height/2));
double distto = vecto.length();
Vector3 dirto = vecto/distto;
@ -2415,7 +2415,7 @@ Class SentryGun : Actor
origin = level.Vec3Offset(pos,x*12+z*16);
double a = FRandom[Sentry](0,360), s = FRandom[Sentry](0,0.05);
Vector3 nx = target?Vec3To(target).unit():x;
Vector3 dir = (nx+y*cos(a)*s+z*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(nx,y,z,a,s);
FLineTraceData d;
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType == TRACE_HitActor )

View file

@ -136,12 +136,12 @@ Class OnFire : Thinker
{
let c = victim.Spawn("UFlameTrail",pos);
c.scale *= max(.3,mult*0.5);
c.vel = victim.vel*0.5+(cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[FlameT](.5,2.)*c.scale.x;
c.vel = victim.vel*0.5+dt_Utility.Vec3FromAngle(ang,pt)*FRandom[FlameT](.5,2.)*c.scale.x;
}
let s = victim.Spawn("UTSmoke",pos);
s.scale *= max(1.,1.6*mult);
s.alpha *= min(amount+30,100)*0.02;
s.vel = victim.vel*0.5+(cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[FlameT](.2,.6)*s.scale.x;
s.vel = victim.vel*0.5+dt_Utility.Vec3FromAngle(ang,pt)*FRandom[FlameT](.2,.6)*s.scale.x;
}
if ( (!sting_flametspread && !forcespread) || (amount <= 0) ) return;
// spread to nearby actors
@ -274,6 +274,10 @@ Class UFlame : Actor
OnFire.Apply(t,master,amt);
}
}
override bool CanCollideWith( Actor Other, bool passive )
{
return false;
}
Default
{
RenderStyle "Add";
@ -293,7 +297,7 @@ Class UFlame : Actor
+DROPOFF;
+NOBLOCKMONST;
+DONTSPLASH;
//+THRUIMPASSABLE; // gonna have to implement this
+MBFBOUNCER;
}
States
{
@ -740,7 +744,7 @@ Class UNapalmGlob : UNapalm
void SpawnSplash()
{
Vector3 ofs = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 ofs = dt_Utility.Vec3FromAngle(angle,pitch);
for ( int i=0; i<2; i++ )
{
if ( numsplash-- <= 0 ) return;
@ -752,7 +756,7 @@ Class UNapalmGlob : UNapalm
d.scale *= FRandom[FlameT](0.5,0.7);
d.angle = atan2(dir.y,dir.x);
d.pitch = -asin(dir.z);
d.vel = (cos(d.angle)*cos(d.pitch),sin(d.angle)*cos(d.pitch),-sin(d.pitch))*d.speed*FRandom[FlameT](0.3,0.5)*scale.x;
d.vel = dt_Utility.Vec3FromAngle(d.angle,d.pitch)*d.speed*FRandom[FlameT](0.3,0.5)*scale.x;
d.vel.z -= 2;
}
}
@ -764,7 +768,7 @@ Class UNapalmGlob : UNapalm
}
override void OnDestroy()
{
Vector3 ofs = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 ofs = dt_Utility.Vec3FromAngle(angle,pitch);
while ( numsplash > 0 ) SpawnSplash();
}
override void Tick()
@ -784,11 +788,16 @@ Class UNapalmSplash : UNapalm
}
}
// MODELDEF fuckery
Class UFlamethrowerAlt : Actor abstract {}
Class UFlamethrower : UnrealWeapon
{
bool bCharging;
double ChargeSize, Count;
bool bOldSkin;
override bool TryPickup( in out Actor toucher )
{
if ( !sting_proto ) return false; // not allowed
@ -797,6 +806,16 @@ Class UFlamethrower : UnrealWeapon
override void Tick()
{
Super.Tick();
if ( sting_altflamet )
{
if ( !bOldSkin ) A_ChangeModel("UFlamethrowerAlt");
bOldSkin = true;
}
else
{
if ( bOldSkin ) A_ChangeModel("UFlamethrower");
bOldSkin = false;
}
if ( sting_proto ) return;
if ( !Owner )
{
@ -867,30 +886,30 @@ Class UFlamethrower : UnrealWeapon
UTMainHandler.DoFlash(self,Color(32,255,128,0),1);
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),15*x+2.3*y-2.7*z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),15*x-2.3*y-2.7*z);
for ( int i=0; i<2; i++ )
{
double a = FRandom[FlameT](0,360), s = FRandom[FlameT](0,.05);
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
Actor p = Spawn("UFlame",origin);
if ( p.waterlevel > 0 )
{
p.Destroy();
s = FRandom[FlameT](0,.12);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
p = Spawn("UNapalmSplash",origin);
p.scale *= 0.2;
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
p.vel = vel*.5+(cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed*FRandom[FlameT](0.3,0.6);
p.vel = vel*.5+dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed*FRandom[FlameT](0.3,0.6);
p.vel.z -= 3;
p.target = self;
continue;
}
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
p.vel = vel*.1+(cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed*FRandom[FlameT](0.8,1.4);
p.vel = vel*.1+dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed*FRandom[FlameT](0.8,1.4);
p.master = self;
}
}
@ -954,17 +973,17 @@ Class UFlamethrower : UnrealWeapon
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_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2.3*y-2.7*z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2.3*y-2.7*z);
Actor p = Spawn("UNapalmGlob",origin);
p.A_SetScale(0.5+invoker.chargesize/3.5);
p.angle = angle;
p.pitch = BulletSlope();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
for ( int i=0; i<12; i++ )
{
let s = Spawn("UTViewSpark",origin);
UTViewSpark(s).ofs = (10,2.3,-2.7);
UTViewSpark(s).ofs = (10,-2.3,-2.7);
s.target = self;
UTViewSpark(s).vvel += (FRandom[FlameT](0.8,1.6),FRandom[FlameT](-0.5,0.5),FRandom[FlameT](-0.5,0.5));
}

View file

@ -160,10 +160,10 @@ Class OLSMP : UnrealWeapon
vel.z += (player.onground?.5:.15);
}
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
origin = level.Vec3Offset(origin,-z+y*4);
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();
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);
UTBulletTrail.DoTrail(self,origin,dir,10000,alt?6:4);
@ -212,15 +212,15 @@ Class OLSMP : UnrealWeapon
for ( int i=0; i<3; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,4,-1);
UTViewSmoke(s).ofs = (10,-4,-1);
s.target = self;
s.alpha *= 0.5;
}
origin = level.Vec3Offset(origin,x*8+y*6-z*2);
origin = level.Vec3Offset(origin,x*8-y*6-z*2);
let c = Spawn("UCasing",origin);
c.angle = angle;
c.pitch = pitch;
c.vel = x*FRandom[Junk](-1.5,1.5)+y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
c.vel = x*FRandom[Junk](-1.5,1.5)-y*FRandom[Junk](2,4)+z*FRandom[Junk](2,3);
}
override bool CheckAmmo( int fireMode, bool autoSwitch, bool requireAmmo, int ammocount )
{
@ -353,7 +353,7 @@ Class OLSMP : UnrealWeapon
UTPlayer(self).PlayReloading();
Vector3 x, y, z, origin;
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*4.-z*18.);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*4.-z*18.);
let c = Spawn("OLSMPMag",origin);
c.angle = angle;
c.pitch = pitch;

View file

@ -58,7 +58,7 @@ Class PeaceTrail : Actor
Destroy();
return;
}
Vector3 dir = (cos(target.angle)*cos(target.pitch),sin(target.angle)*cos(target.pitch),-sin(target.pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(target.angle,target.pitch);
SetOrigin(level.Vec3Offset(target.pos,-dir*3),true);
}
States
@ -285,7 +285,7 @@ Class PeaceBarrel : Actor
let f = Spawn("PeaceFragment",Vec3Offset(FRandom[EFrag](-8,8),FRandom[EFrag](-8,8),FRandom[EFrag](4,12)));
ang = FRandom[EFrag](0,360);
pt = FRandom[EFrag](-90,90);
f.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[EFrag](4,20);
f.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[EFrag](4,20);
f.vel.z += 3.;
}
int numpt = Random[ExploS](20,35);
@ -440,7 +440,7 @@ Class Peacemaker : UnrealWeapon
p.special1 = invoker.special2;
p.angle = angle;
p.pitch = BulletSlope();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.vel.z += 2.;
p.target = self;
if ( weap.Ammo1.Amount <= 0 ) player.SetPSprite(PSP_WEAPON,invoker.FindState("EmptyIdle"));

View file

@ -248,7 +248,7 @@ Class QuadShot : 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*x+y*2-z*2);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-z*2);
[x2, y2, z2] = dt_CoordUtil.GetAxes(BulletSlope(),angle,roll);
double a, s;
Vector3 dir;
@ -265,7 +265,7 @@ Class QuadShot : UnrealWeapon
{
a = FRandom[Quadshot](0,360);
s = FRandom[Quadshot](0,0.09+0.05*spread);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
if ( !invoker.t ) invoker.t = new("QuadshotTracer");
invoker.t.ignoreme = self;
invoker.t.hitlist.Clear();
@ -285,7 +285,7 @@ Class QuadShot : UnrealWeapon
{
a = FRandom[Quadshot](0,360);
s = FRandom[Quadshot](0,0.08);
dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x2,y2,z2,a,s);
if ( !invoker.t ) invoker.t = new("QuadshotTracer");
invoker.t.ignoreme = self;
invoker.t.hitlist.Clear();
@ -307,7 +307,7 @@ Class QuadShot : UnrealWeapon
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("UTStaticViewSmoke",origin);
UTViewSmoke(s).ofs = (10,2,-2);
UTViewSmoke(s).ofs = (10,0,-2);
UTViewSmoke(s).vvel += (FRandom[Quadshot](-0.05,0.25),FRandom[Quadshot](-0.3,0.3),FRandom[Sniper](-0.3,0.3));
s.target = self;
s.scale *= 1.2;
@ -318,7 +318,7 @@ Class QuadShot : UnrealWeapon
{
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-x*4-y*8-z*8);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-x*4+y*8-z*8);
for ( int i=0; i<(4-invoker.clipcount); i++ )
{
let c = Spawn("QCasing",origin);

View file

@ -107,7 +107,7 @@ Class RazorBlade : Actor
dpitch = deltaangle(oldgpitch,target.pitch);
gangle += dangle;
gpitch += dpitch;
vel += (cos(gangle)*cos(gpitch),sin(gangle)*cos(gpitch),-sin(gpitch))*15./TICRATE;
vel += dt_Utility.Vec3FromAngle(gangle,gpitch)*15./TICRATE;
double spd = vel.length();
vel = vel*clamp(spd,10,15)/spd;
gvel = vel;
@ -124,7 +124,7 @@ Class RazorBlade : Actor
A_AlertMonsters();
A_SprayDecal("WallCrack",-20);
int numpt = Random[Ripper](5,10);
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 x = dt_Utility.Vec3FromAngle(angle,pitch);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (-x+(FRandom[Ripper](-.8,.8),FRandom[Ripper](-.8,.8),FRandom[Ripper](-.8,.8))).unit()*FRandom[Ripper](0.1,1.2);
@ -260,7 +260,7 @@ Class Razorjack : UnrealWeapon
else p.special1 = invoker.special1;
p.angle = angle;
p.pitch = BulletSlope();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
}
Default

View file

@ -63,7 +63,7 @@ Class URifle : UnrealWeapon
{
Super.DetachFromOwner();
PlayerInfo p = players[consoleplayer];
if ( p.Camera == Owner ) Shader.SetEnabled(p,"URifleScope",false);
if ( p.Camera == Owner ) PPShader.SetEnabled("URifleScope",false);
bLightOn = false;
if ( lt[0] ) lt[0].Destroy();
if ( lt[1] ) lt[1].Destroy();
@ -71,8 +71,8 @@ Class URifle : UnrealWeapon
override void RenderOverlay( RenderEvent e )
{
PlayerInfo p = players[consoleplayer];
if ( (p.Camera != Owner) || (sniperzoom <= 1.) ) Shader.SetEnabled(p,"URifleScope",false);
else Shader.SetEnabled(p,"URifleScope",CVar.GetCVar('sting_zoomshader',p).GetBool());
if ( (p.Camera != Owner) || (sniperzoom <= 1.) ) PPShader.SetEnabled("URifleScope",false);
else PPShader.SetEnabled("URifleScope",sting_zoomshader);
}
override void DoEffect()
{
@ -137,11 +137,11 @@ Class URifle : UnrealWeapon
Vector3 x, y, z;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
if ( !zoomed ) origin = level.Vec3Offset(origin,y*3-z*2);
if ( !zoomed ) origin = level.Vec3Offset(origin,-y*3-z*2);
FLineTraceData d;
double pt = BulletSlope();
LineTrace(angle,10000,pt,TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
UTBulletTrail.DoTrail(self,origin,(cos(angle)*cos(pt),sin(angle)*cos(pt),-sin(pt)),10000,alt?3:1);
UTBulletTrail.DoTrail(self,origin,dt_Utility.Vec3FromAngle(angle,pt),10000,alt?3:1);
if ( d.HitType == TRACE_HitActor )
{
int dmg = 45;
@ -195,13 +195,13 @@ Class URifle : UnrealWeapon
for ( int i=0; i<24; i++ )
{
let s = Spawn("UTStaticViewSmoke",origin);
UTViewSmoke(s).ofs = (10,3,-2);
UTViewSmoke(s).ofs = (10,-3,-2);
UTViewSmoke(s).vvel += (FRandom[Sniper](-0.05,0.15),FRandom[Sniper](-1.2,1.2),FRandom[Sniper](-0.1,0.1));
s.target = self;
s.scale *= 1.8;
s.alpha *= 0.3;
}
origin = level.Vec3Offset(origin,x*4+y*6-z*10);
origin = level.Vec3Offset(origin,x*4-y*6-z*10);
let c = Spawn("UCasing",origin);
c.scale *= 1.25;
c.angle = angle;

View file

@ -1,5 +1,21 @@
Class StingerAmmo : Ammo
{
bool bOldSkin;
void A_CheckSkin()
{
if ( sting_oldtarydium )
{
if ( !bOldSkin ) A_ChangeModel("",0,"","",0,"models/OldSkins","JTaryPick1_.png");
bOldSkin = true;
}
else
{
if ( bOldSkin ) A_ChangeModel("",0,"","",0,"models","JTaryPick1_.png");
bOldSkin = false;
}
}
Default
{
Tag "$T_STINGERAMMO";
@ -18,8 +34,8 @@ Class StingerAmmo : Ammo
States
{
Spawn:
SAMO A -1;
Stop;
SAMO A 1 A_CheckSkin();
Wait;
}
}
@ -34,8 +50,8 @@ Class StingerAmmo2 : StingerAmmo
States
{
Spawn:
SAMO B -1;
Stop;
SAMO B 1 A_CheckSkin();
Wait;
}
}
@ -192,7 +208,7 @@ Class TarydiumExplosion : Actor
ang = FRandom[Stinger](0,360);
pt = FRandom[Stinger](-90,90);
let c = Spawn("UTSmoke",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](2,7);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](2,7);
c.SetShade(Color(1,3,4)*Random[Stinger](24,63));
c.scale *= 3.;
}
@ -204,7 +220,7 @@ Class TarydiumExplosion : Actor
let c = Spawn("StingerChunk",pos);
c.angle = ang;
c.pitch = pt;
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](6,12);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](6,12);
}
numpt = Random[Stinger](10,20)*min(4,special1/40);
for ( int i=0; i<numpt; i++ )
@ -212,7 +228,7 @@ Class TarydiumExplosion : Actor
ang = FRandom[Stinger](0,360);
pt = FRandom[Stinger](-90,90);
let c = Spawn("UTChip",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](6,12);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](6,12);
c.scale *= FRandom[Stinger](0.9,1.5);
}
}
@ -339,7 +355,7 @@ Class TarydiumDebuff : Thinker
ang = FRandom[Stinger](0,360);
pt = FRandom[Stinger](-90,90);
let c = victim.Spawn("UTSmoke",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](0.3,0.8);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](0.3,0.8);
c.SetShade(Color(1,3,4)*Random[Stinger](24,63));
c.scale *= 3.;
c.alpha *= 0.35;
@ -374,6 +390,22 @@ Class TarydiumDebuff : Thinker
Class StingerProjectile : Actor
{
bool bOldSkin;
void A_CheckSkin()
{
if ( sting_oldtarydium )
{
if ( !bOldSkin ) A_ChangeModel("",0,"","",0,"models/OldSkins","JTaryPick1_.png");
bOldSkin = true;
}
else
{
if ( bOldSkin ) A_ChangeModel("",0,"","",0,"models","JTaryPick1_.png");
bOldSkin = false;
}
}
Vector3 oldvel;
Default
{
@ -433,7 +465,7 @@ Class StingerProjectile : Actor
c.scale *= 0.5;
c.angle = ang;
c.pitch = pt;
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](3,9);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](3,9);
}
numpt = Random[Stinger](2,5);
for ( int i=0; i<numpt; i++ )
@ -441,7 +473,7 @@ Class StingerProjectile : Actor
ang = FRandom[Stinger](0,360);
pt = FRandom[Stinger](-90,90);
let c = Spawn("UTSmoke",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](0.3,0.8);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](0.3,0.8);
c.SetShade(Color(1,3,4)*Random[Stinger](48,63));
c.alpha *= 0.35;
}
@ -477,7 +509,7 @@ Class StingerProjectile : Actor
let c = Spawn("StingerChunk",pos);
c.angle = ang;
c.pitch = pt;
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](3,9);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](3,9);
}
numpt = Random[Stinger](6,12);
for ( int i=0; i<numpt; i++ )
@ -485,7 +517,7 @@ Class StingerProjectile : Actor
ang = FRandom[Stinger](0,360);
pt = FRandom[Stinger](-90,90);
let c = Spawn("UTSmoke",pos);
c.vel = (cos(ang)*cos(pt),sin(ang)*cos(pt),-sin(pt))*FRandom[Stinger](0.3,0.8);
c.vel = dt_Utility.Vec3FromAngle(ang,pt)*FRandom[Stinger](0.3,0.8);
c.SetShade(Color(1,3,4)*Random[Stinger](48,63));
c.alpha *= 0.5;
}
@ -495,6 +527,7 @@ Class StingerProjectile : Actor
Spawn:
TPRJ A 1 Bright
{
A_CheckSkin();
if ( waterlevel > 0 )
Spawn("UTBubble",pos);
}
@ -563,19 +596,19 @@ 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 = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x+8*y-8*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();
p.roll = FRandom[Stinger](0,360);
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
int numpt = Random[Stinger](5,9);
double ang;
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewStingerChunk",origin);
ViewStingerChunk(s).ofs = (8,2,-2);
ViewStingerChunk(s).ofs = (8,-2,-2);
ang = FRandom[Stinger](0,360);
ViewStingerChunk(s).vvel = (FRandom[Stinger](0.2,1.2),0,0)+(0,cos(ang),sin(ang))*FRandom[Stinger](0.3,0.9);
s.target = self;
@ -583,7 +616,7 @@ Class Stinger : UnrealWeapon
for ( int i=0; i<12; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (16,4,-4);
UTViewSmoke(s).ofs = (16,-4,-4);
ang = FRandom[Stinger](0,360);
UTViewSmoke(s).vvel = (FRandom[Stinger](0,0.4),0,0)+(0,cos(ang),sin(ang))*FRandom[Stinger](0.2,0.5);
s.target = self;
@ -607,7 +640,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 = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),5*x+8*y-8*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;
@ -618,19 +651,19 @@ Class Stinger : UnrealWeapon
if ( !weap.DepleteAmmo(weap.bAltFire,true,1) ) return;
a = FRandom[Stinger](0,360);
s = FRandom[Stinger](0,(i>0)?.08:0.); // first shot always accurate
dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
dir = dt_Utility.ConeSpread(x,y,z,a,s);
p = Spawn("StingerProjectile",origin);
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
p.roll = FRandom[Stinger](0,360);
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
int numpt = Random[Stinger](5,9);
double ang;
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("ViewStingerChunk",origin);
ViewStingerChunk(s).ofs = (8,2,-2);
ViewStingerChunk(s).ofs = (8,-2,-2);
ang = FRandom[Stinger](0,360);
ViewStingerChunk(s).vvel = (FRandom[Stinger](0.2,1.2),0,0)+(0,cos(ang),sin(ang))*FRandom[Stinger](0.3,0.9);
s.target = self;
@ -638,7 +671,7 @@ Class Stinger : UnrealWeapon
for ( int i=0; i<12; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (16,4,-4);
UTViewSmoke(s).ofs = (16,-4,-4);
ang = FRandom[Stinger](0,360);
UTViewSmoke(s).vvel = (FRandom[Stinger](0,0.4),0,0)+(0,cos(ang),sin(ang))*FRandom[Stinger](0.2,0.5);
s.target = self;

View file

@ -126,7 +126,7 @@ Class StunProj : Actor
return;
}
// step trace
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
tracedir = dt_Utility.Vec3FromAngle(angle,pitch);
t.ShootThroughList.Clear();
t.Trace(pos,cursector,tracedir,500,0);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
@ -212,7 +212,7 @@ Class StunProj : Actor
A_QuakeEx(1,1,1,3,0,250,"",QF_RELATIVE|QF_SCALEDOWN,falloff:120,rollintensity:0.2);
A_StartSound("stun/hit",CHAN_VOICE,pitch:FRandom[Stunner](1.5,1.9)-0.08*specialf1);
A_AlertMonsters(gameinfo.gametype&GAME_Strife?100:0);
Vector3 dir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(angle,pitch);
int numpt = Random[ExploS](10,15);
for ( int i=0; i<numpt; i++ )
{
@ -272,7 +272,7 @@ Class StunnerImpact : Actor
Super.PostBeginPlay();
A_SprayDecal("WallCrack",20);
int numpt = Random[Stunner](10,20);
Vector3 x = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 x = dt_Utility.Vec3FromAngle(angle,pitch);
for ( int i=0; i<numpt; i++ )
{
Vector3 pvel = (-x+(FRandom[Stunner](-.8,.8),FRandom[Stunner](-.8,.8),FRandom[Stunner](-.8,.8))).unit()*FRandom[Stunner](0.1,1.2);

View file

@ -546,7 +546,7 @@ Class UBioGlob : UBioGel
void SpawnSplash()
{
Vector3 ofs = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 ofs = dt_Utility.Vec3FromAngle(angle,pitch);
for ( int i=0; i<2; i++ )
{
if ( numsplash-- <= 0 ) return;
@ -558,7 +558,7 @@ Class UBioGlob : UBioGel
d.scale *= FRandom[GES](0.5,0.7);
d.angle = atan2(dir.y,dir.x);
d.pitch = -asin(dir.z);
d.vel = (cos(d.angle)*cos(d.pitch),sin(d.angle)*cos(d.pitch),-sin(d.pitch))*d.speed*FRandom[GES](0.4,0.6);
d.vel = dt_Utility.Vec3FromAngle(d.angle,d.pitch)*d.speed*FRandom[GES](0.4,0.6);
d.vel.z -= 2;
}
}
@ -590,6 +590,39 @@ Class UBioRifle : UnrealWeapon
{
double chargesize, count;
bool bCharging;
int OldSkin;
override void Tick()
{
Super.Tick();
switch ( sting_oldbrifle )
{
case 1:
if ( OldSkin != 1 )
{
A_ChangeModel("",1,"","",1,"models/OldSkins","JBRifle1_.png");
A_ChangeModel("",0,"","",0,"models/OldSkins","JBrifle1.png",CMDL_USESURFACESKIN);
}
OldSkin = 1;
break;
case 2:
if ( OldSkin != 2 )
{
A_ChangeModel("",1,"","",1,"models/OldSkins","Jnapalm1_.png");
A_ChangeModel("",0,"","",0,"models/OldSkins","Jnapalm1.png",CMDL_USESURFACESKIN);
}
OldSkin = 2;
break;
case 0:
if ( OldSkin != 0 )
{
A_ChangeModel("",1,"","",1,"models","JBRifle1_.png");
A_ChangeModel("",0,"","",0,"models","JBrifle1.png",CMDL_USESURFACESKIN);
}
OldSkin = 0;
break;
}
}
override int, int, bool, bool GetClipAmount()
{
@ -617,7 +650,7 @@ Class UBioRifle : UnrealWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+4*y-5*z);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-4*y-5*z);
Actor p;
if ( bAlt )
{
@ -627,12 +660,12 @@ Class UBioRifle : UnrealWeapon
else p = Spawn("UBioGel",origin);
p.angle = angle;
p.pitch = BulletSlope();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
for ( int i=0; i<12; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,4,-5);
UTViewSmoke(s).ofs = (10,-4,-5);
s.scale *= 2.0;
s.target = self;
if ( Random[GES](0,1) ) s.SetShade("40FF60");

View file

@ -156,7 +156,7 @@ Class URocket : Actor
}
if ( !invoker.ringex ) return;
Actor r = Spawn("ASMDSBeamRing",pos);
Vector3 HitNormal = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
Vector3 HitNormal = dt_Utility.Vec3FromAngle(angle,pitch);
if ( BlockingLine ) HitNormal = (-BlockingLine.delta.y,BlockingLine.delta.x,0).unit();
else if ( BlockingFloor )
{
@ -428,8 +428,8 @@ 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",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
Vector3 dir = dt_Utility.ConeSpread(x2,y2,z2,a,s*0.004);
p = Spawn("UGrenade",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,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;
@ -438,7 +438,7 @@ Class Eightball : UnrealWeapon
else if ( num <= 1 )
{
// single rocket
p = Spawn("URocket",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
p = Spawn("URocket",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,s)));
p.vel = x2*p.speed;
p.target = self;
p.tracer = invoker.LockedTarget;
@ -451,7 +451,7 @@ Class Eightball : UnrealWeapon
s = (num>1)?6:0;
for ( int i=0; i<num; i++ )
{
p = Spawn("URocket",level.Vec3Offset(origin,cos(a)*y*s+sin(a)*z*s));
p = Spawn("URocket",level.Vec3Offset(origin,dt_Utility.CircleOffset(y,z,a,s)));
p.vel = x2*p.speed;
p.target = self;
p.tracer = invoker.LockedTarget;
@ -500,7 +500,7 @@ 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 = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
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));
double reldist = reldir.length();
if ( reldist > 2000 ) continue;

View file

@ -145,10 +145,10 @@ Class UFlakSlug : FlakSlug
p.bHITOWNER = true;
a = FRandom[Flak](0,360);
s = FRandom[Flak](0,0.1);
Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s);
p.angle = atan2(dir.y,dir.x);
p.pitch = -asin(dir.z);
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*(p.speed+FRandom[Flak](-3,3));
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*(p.speed+FRandom[Flak](-3,3));
p.target = target;
}
int numpt = Random[Flak](8,12);
@ -204,7 +204,7 @@ Class UFlakCannon : UnrealWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+5*y-4*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);
@ -221,24 +221,24 @@ Class UFlakCannon : UnrealWeapon
p = Spawn("UFlakChunk",level.Vec3Offset(origin,offsets[i]));
a = FRandom[Flak](0,360);
s = FRandom[Flak](0,0.1);
Vector3 dir = (x+y*cos(a)*s+z*sin(a)*s).unit();
Vector3 dir = dt_Utility.ConeSpread(x,y,z,a,s);
p.angle = atan2(dir.y,dir.x);
p.pitch = -asin(dir.z);
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*(p.speed+FRandom[Flak](-3,3));
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*(p.speed+FRandom[Flak](-3,3));
p.target = self;
}
int numpt = Random[Flak](20,30);
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("UTViewSpark",origin);
UTViewSpark(s).ofs = (10,5,-4);
UTViewSpark(s).ofs = (10,-5,-4);
UTViewSpark(s).vvel = (FRandom[Flak](3,12),FRandom[Flak](-4,4),FRandom[Flak](-4,4));
s.target = self;
}
for ( int i=0; i<10; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,5,-4);
UTViewSmoke(s).ofs = (10,-5,-4);
UTViewSmoke(s).vvel = (FRandom[Flak](0,1.2),FRandom[Flak](-.4,.4),FRandom[Flak](-.4,.4));
s.target = self;
s.scale *= 1.6;
@ -262,24 +262,24 @@ Class UFlakCannon : UnrealWeapon
Vector3 x, y, z;
double a, s;
[x, y, z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+5*y-4*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();
p.vel = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch))*p.speed;
p.vel = dt_Utility.Vec3FromAngle(p.angle,p.pitch)*p.speed;
p.target = self;
int numpt = Random[Flak](10,15);
for ( int i=0; i<numpt; i++ )
{
let s = Spawn("UTViewSpark",origin);
UTViewSpark(s).ofs = (10,5,-4);
UTViewSpark(s).ofs = (10,-5,-4);
UTViewSpark(s).vvel = (FRandom[Flak](3,12),FRandom[Flak](-4,4),FRandom[Flak](-4,4));
s.target = self;
}
for ( int i=0; i<8; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,5,-4);
UTViewSmoke(s).ofs = (10,-5,-4);
UTViewSmoke(s).vvel = (FRandom[Flak](0,1.2),FRandom[Flak](-.8,.8),FRandom[Flak](-.8,.8));
s.target = self;
s.scale *= 1.6;
@ -346,7 +346,7 @@ Class UFlakCannon : UnrealWeapon
{
Vector3 x, y, z, origin;
[x,y,z] = dt_CoordUtil.GetAxes(pitch,angle,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.+y*3.-z*8.);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*4.-y*3.-z*8.);
let c = Spawn("UFlakMag",origin);
c.angle = angle;
c.pitch = pitch;

View file

@ -51,10 +51,10 @@ 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 = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+y*3-z*3);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),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();
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);
UTBulletTrail.DoTrail(self,origin,dir,10000,alt?5:3);
@ -112,13 +112,13 @@ Class UMinigun : UnrealWeapon
for ( int i=0; i<2; i++ )
{
let s = Spawn("UTViewSmoke",origin);
UTViewSmoke(s).ofs = (10,3,-3);
UTViewSmoke(s).ofs = (10,-3,-3);
s.scale *= 1.5;
s.alpha *= 0.6;
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 = level.Vec3Offset(origin,x*4+y*3-z*12);
origin = level.Vec3Offset(origin,x*4-y*3-z*12);
let c = Spawn("UCasing",origin);
c.angle = angle;
c.pitch = pitch;

View file

@ -304,6 +304,15 @@ Class UPlayer : UTPlayer
if ( boot ) A_StartSound("u1/bootfootstep",CHAN_FOOTSTEP,CHANF_OVERLAP,min(1.,vol*2));
else A_StartSound("ut/playerfootstep",CHAN_FOOTSTEP,CHANF_OVERLAP,vol);
}
override void A_SetPlayerSkin()
{
A_ChangeModel("",0,"","",1,"models","GunPick1.png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
A_ChangeModel("",0,"","",1,"models","GunPick1ice.png",CMDL_USESURFACESKIN,-1);
}
}
Class UFemaleArmGibber : UTGibber
@ -318,19 +327,22 @@ Class UFemaleArmGibber : UTGibber
if ( !firstgib )
{
firstgib = true;
Actor a = Spawn("UTFemaleArm",Vec3Offset(-14*sin(angle),14*cos(angle),36));
Vector3 pofs = (0,14,36);
pofs.xy = RotateVector(pofs.xy,angle);
Actor a = Spawn("UTFemaleArm",level.Vec3Offset(pos,pofs));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
dir = dt_Utility.Vec3FromAngle(ang,pt);
a.vel = rvel*0.6+dir*FRandom[Blod](3.0,6.0);
}
for ( int i=0; i<gibsize; i++ )
{
Vector3 box = (FRandom[Blod](-4,4),FRandom[Blod](12,18),FRandom[Blod](32,40));
let a = Spawn("UTBloodPuff",Vec3Offset(box.x*cos(angle)-box.y*sin(angle),box.x*sin(angle)+box.y*cos(angle),box.z));
box.xy = RotateVector(box.xy,angle);
let a = Spawn("UTBloodPuff",level.Vec3Offset(pos,box));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
dir = dt_Utility.Vec3FromAngle(ang,pt);
a.vel = rvel*0.2+dir*FRandom[Blod](1.5,3.0);
}
A_CountDown();
@ -458,6 +470,17 @@ Class UPlayerFemale1 : UPlayerFemale
UTPlayer.VoiceType VOICE_FemaleTwo;
-NOMENU;
}
override void A_SetPlayerSkin()
{
Super.A_SetPlayerSkin();
String skin = player?CVar.GetCVar('sting_female1skin',player).GetString():"Gina";
A_ChangeModel("",0,"","",0,"models/Female1",skin..".png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
Super.SetFreezeSkin();
A_ChangeModel("",0,"","",0,"models/Female1","Ice.png",CMDL_USESURFACESKIN,-1);
}
States
{
See:
@ -473,6 +496,17 @@ Class UPlayerFemale2 : UPlayerFemale
Player.DisplayName "$N_FEMALE2";
-NOMENU;
}
override void A_SetPlayerSkin()
{
Super.A_SetPlayerSkin();
String skin = player?CVar.GetCVar('sting_female2skin',player).GetString():"Sonya";
A_ChangeModel("",0,"","",0,"models/Female2",skin..".png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
Super.SetFreezeSkin();
A_ChangeModel("",0,"","",0,"models/Female2","Ice.png",CMDL_USESURFACESKIN,-1);
}
States
{
See:
@ -498,20 +532,23 @@ Class UMaleTorsoGibber : UTGibber
firstgib = true;
for ( int i=0; i<7; i++ )
{
Actor a = Spawn(parts[i],Vec3Offset(-partofsy[i]*sin(angle),partofsy[i]*cos(angle),partofsz[i]));
Vector3 pofs = (0,partofsy[i],partofsz[i]);
pofs.xy = RotateVector(pofs.xy,angle);
Actor a = Spawn(parts[i],level.Vec3Offset(pos,pofs));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
dir = dt_Utility.Vec3FromAngle(ang,pt);
a.vel = rvel*0.6+dir*FRandom[Blod](3.0,6.0);
}
}
for ( int i=0; i<gibsize; i++ )
{
Vector3 box = (FRandom[Blod](-15,15),FRandom[Blod](15,15),FRandom[Blod](30,50));
let a = Spawn("UTBloodPuff",Vec3Offset(box.x*cos(angle)-box.y*sin(angle),box.x*sin(angle)+box.y*cos(angle),box.z));
box.xy = RotateVector(box.xy,angle);
let a = Spawn("UTBloodPuff",level.Vec3Offset(pos,box));
ang = FRandom[Blod](0,360);
pt = FRandom[Blod](-90,90);
dir = (cos(pt)*cos(ang),cos(pt)*sin(ang),sin(-pt));
dir = dt_Utility.Vec3FromAngle(ang,pt);
a.vel = rvel*0.2+dir*FRandom[Blod](1.5,3.0);
}
A_CountDown();
@ -603,6 +640,17 @@ Class UPlayerMale1 : UPlayerMale
else A_StartSound("ut/playerfootstep",CHAN_FOOTSTEP,CHANF_OVERLAP,vol);
}
}
override void A_SetPlayerSkin()
{
Super.A_SetPlayerSkin();
String skin = player?CVar.GetCVar('sting_male1skin',player).GetString():"Kurgan";
A_ChangeModel("",0,"","",0,"models/Male1",skin..".png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
Super.SetFreezeSkin();
A_ChangeModel("",0,"","",0,"models/Male1","Ice.png",CMDL_USESURFACESKIN,-1);
}
Default
{
Player.DisplayName "$N_MALE1";
@ -623,6 +671,17 @@ Class UPlayerMale2 : UPlayerMale
Player.DisplayName "$N_MALE2";
-NOMENU;
}
override void A_SetPlayerSkin()
{
Super.A_SetPlayerSkin();
String skin = player?CVar.GetCVar('sting_male1skin',player).GetString():"Ash";
A_ChangeModel("",0,"","",0,"models/Male2",skin..".png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
Super.SetFreezeSkin();
A_ChangeModel("",0,"","",0,"models/Male2","Ice.png",CMDL_USESURFACESKIN,-1);
}
States
{
See:
@ -639,6 +698,17 @@ Class UPlayerMale3 : UPlayerMale
UTPlayer.VoiceType VOICE_MaleTwo;
-NOMENU;
}
override void A_SetPlayerSkin()
{
Super.A_SetPlayerSkin();
String skin = player?CVar.GetCVar('sting_male1skin',player).GetString():"Dante";
A_ChangeModel("",0,"","",0,"models/Male3",skin..".png",CMDL_USESURFACESKIN,-1);
}
override void SetFreezeSkin()
{
Super.SetFreezeSkin();
A_ChangeModel("",0,"","",0,"models/Male3","Ice.png",CMDL_USESURFACESKIN,-1);
}
States
{
See:
@ -860,9 +930,6 @@ Class UnrealStaticHandler : StaticEventHandler
ui void StartMenu()
{
CVar protomenu = CVar.GetCVar('sting_introtype',players[consoleplayer]);
if ( !protomenu ) return; // this can happen
int proto = protomenu.GetInt();
tex[0] = TexMan.CheckForTexture("graphics/UnLogo0.png",TexMan.Type_Any);
tex[1] = TexMan.CheckForTexture("graphics/UnLogo1.png",TexMan.Type_Any);
tex[2] = TexMan.CheckForTexture("graphics/UnLogo3.png",TexMan.Type_Any);
@ -871,19 +938,26 @@ Class UnrealStaticHandler : StaticEventHandler
tex[5] = TexMan.CheckForTexture("graphics/97Bg.png",TexMan.Type_Any);
tex[6] = TexMan.CheckForTexture("graphics/96Bg.png",TexMan.Type_Any);
tex[7] = TexMan.CheckForTexture("graphics/95Bg.png",TexMan.Type_Any);
if ( gamestate == GS_TITLELEVEL ) StartMenuMusic();
cur = clamp(sting_introtype,0,3);
}
clearscope void StartMenuMusic()
{
int proto = sting_introtype;
if ( proto > 3 ) S_ChangeMusic("music/Unreal_Extended.it");
else if ( proto == 3 ) S_ChangeMusic("music/Unreal.it");
else if ( proto == 2 ) S_ChangeMusic("music/isotox96.s3m");
else if ( proto == 1 ) S_ChangeMusic("music/Unreal2.it");
else S_ChangeMusic("music/FlyBy.it");
cur = clamp(proto,0,3);
}
override void OnRegister()
override void WorldLoaded( WorldEvent e )
{
// remove the UT static handler
let hnd = UTStaticHandler(StaticEventHandler.Find("UTStaticHandler"));
if ( hnd ) hnd.Destroy();
if ( gamestate == GS_TITLELEVEL ) StartMenuMusic();
}
override void ConsoleProcess( ConsoleEvent e )
@ -895,7 +969,6 @@ Class UnrealStaticHandler : StaticEventHandler
override void PostUiTick()
{
if ( gamestate != GS_TITLELEVEL ) return;
if ( gametic <= 0 ) StartMenu();
if ( musplaying.Name != lastmusic )
{
mtics = 0;
@ -907,6 +980,7 @@ Class UnrealStaticHandler : StaticEventHandler
override void RenderUnderlay( RenderEvent e )
{
if ( gamestate != GS_TITLELEVEL ) return;
if ( tex[0].IsNull() ) StartMenu();
double ar = Screen.GetAspectRatio();
Vector2 tsize = TexMan.GetScaledSize(tex[cur+4]);
double sar = tsize.x/tsize.y;
@ -925,14 +999,6 @@ Class UnrealStaticHandler : StaticEventHandler
double alf = clamp(((mtics+e.FracTic)/Thinker.TICRATE)-8,0.,1.);
Screen.DrawTexture(tex[cur],false,(vsize.x-tsize.x)/2,(vsize.y-tsize.y)/2,DTA_VirtualWidthF,vsize.x,DTA_VirtualHeightF,vsize.y,DTA_KeepRatio,true,DTA_Alpha,alf);
}
override void RenderOverlay( RenderEvent e )
{
// we have to stand in for the UT handler on this function
// although it doesn't make much sense yet
if ( players[consoleplayer].camera.player && players[consoleplayer].camera.player.ReadyWeapon && (players[consoleplayer].camera.player.ReadyWeapon is 'UTWeapon') )
UTWeapon(players[consoleplayer].camera.player.ReadyWeapon).RenderOverlay(e);
}
}
Class AmmoUsedInSlot

View file

@ -34,6 +34,9 @@ Class UnrealHUD : BaseStatusBar
String MidPrintStr;
int MidPrintTic;
bool MidPrintLarge;
Weapon lastwep;
String ntagstr;
int ntagtic;
// 0.83 HUD stuff
Array<String> OldAmmo;
@ -139,10 +142,9 @@ Class UnrealHUD : BaseStatusBar
{
Super.Draw(state,TicFrac);
FracTic = TicFrac;
HudMode = CVar.GetCVar('sting_hudmode',players[consoleplayer]).GetInt();
scalev.x = scalev.y = CVar.GetCVar('hud_scale',players[consoleplayer]).GetInt();
if ( scalev.x < 0 ) scalev.x = scalev.y = max(1,min(Screen.GetWidth()/640.,Screen.GetHeight()/480.)); // the typical behavior is scaling to 640x400 but we're expecting 4:3 here
else if ( scalev.x == 0 )
HudMode = sting_hudmode;
scalev.x = scalev.y = hud_scale;
if ( scalev.x <= 0 )
{
scalev.x = CleanXFac_1;
scalev.y = CleanYFac_1;
@ -825,8 +827,25 @@ Class UnrealHUD : BaseStatusBar
Console.Printf(StringTable.Localize("$M_ISELECT"),CPlayer.mo.InvSel.GetTag());
CPlayer.inventorytics = 0;
}
// part of gross hackery to override nametag display
if ( CPlayer.PendingWeapon && (CPlayer.PendingWeapon != WP_NOCHANGE) && (CPlayer.PendingWeapon != lastwep) )
{
// make sure to avoid instantly overriding the current pickup message
if ( (displaynametags&2) && (CPlayer == players[consoleplayer]) && (PickupMsgTic != gametic+50) )
{
ntagstr = CPlayer.PendingWeapon.GetTag();
ntagtic = gametic+50;
}
}
lastwep = CPlayer.PendingWeapon;
// make sure vanilla nametags don't display
DetachMessageID(0x5745504e); // WEPN
DetachMessageID(0x53494e56); // SINV
// also try with different endianness, just in case
DetachMessageID(0x4e504557); // WEPN
DetachMessageID(0x564e4953); // SINV
vtracer.ignore = CPlayer.mo;
vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,(cos(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),sin(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),-sin(CPlayer.mo.pitch)),1000,0);
vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,dt_Utility.Vec3FromAngle(CPlayer.mo.angle,CPlayer.mo.pitch),1000,0);
if ( vtracer.Results.HitType != TRACE_HitActor ) return;
lastseen = vtracer.Results.HitActor;
lastseentic = gametic;
@ -918,10 +937,17 @@ Class UnrealHUD : BaseStatusBar
if ( PickupMsgTic > gametic )
{
xpos = (Screen.GetWidth()-WhiteFont.StringWidth(PickupMsg)*CleanXFac_1)/2;
if ( state == HUD_Statusbar ) ypos = GetTopOfStatusBar()-21*CleanYFac_1;
if ( state == HUD_Statusbar ) ypos = GetTopOfStatusBar()-31*CleanYFac_1;
else ypos = Screen.GetHeight()-41*CleanYFac_1;
Screen.DrawText(WhiteFont,Font.CR_WHITE,xpos,ypos,PickupMsg,DTA_CleanNoMove_1,true,DTA_Alpha,clamp((PickupMsgTic-gametic+fractic)*0.05,0,1),DTA_LegacyRenderStyle,STYLE_Add);
}
if ( ntagtic > gametic )
{
xpos = (Screen.GetWidth()-WhiteFont.StringWidth(ntagstr)*CleanXFac_1)/2;
if ( state == HUD_Statusbar ) ypos = GetTopOfStatusBar()-15*CleanYFac_1;
else ypos = Screen.GetHeight()-25*CleanYFac_1;
Screen.DrawText(WhiteFont,Font.CR_WHITE,xpos,ypos,ntagstr,DTA_CleanNoMove_1,true,DTA_Alpha,clamp((ntagtic-gametic+fractic)*0.05,0,1),DTA_LegacyRenderStyle,STYLE_Add);
}
// draw messages
xpos = 4*CleanXFac_1;
ypos = 4*CleanYFac_1;

View file

@ -143,6 +143,64 @@ Class OptionMenuItemHudType : OptionMenuItem
return -1;
}
}
Class OptionMenuItemUFacePreview : OptionMenuItem
{
String texpath[5];
TextureID talkface[5];
CVar mCVar[5];
OptionMenuItemUFacePreview Init( String dummy )
{
Super.Init(dummy,'None',true);
mCVar[0] = CVar.FindCVar('sting_female1skin');
mCVar[1] = CVar.FindCVar('sting_female2skin');
mCVar[2] = CVar.FindCVar('sting_male1skin');
mCVar[3] = CVar.FindCVar('sting_male2skin');
mCVar[4] = CVar.FindCVar('sting_male3skin');
return self;
}
override int Draw( OptionMenuDescriptor desc, int y, int indent, bool selected )
{
int x = Screen.GetWidth()/2-176*CleanXFac_1;
for ( int i=0; i<5; i++ )
{
String path;
switch ( i )
{
default:
case 0:
path = "models/Female1/Face"..mCVar[0].GetString()..".png";
break;
case 1:
path = "models/Female2/Face"..mCVar[1].GetString()..".png";
break;
case 2:
path = "models/Male1/Face"..mCVar[2].GetString()..".png";
break;
case 3:
path = "models/Male2/Face"..mCVar[3].GetString()..".png";
break;
case 4:
path = "models/Male3/Face"..mCVar[4].GetString()..".png";
break;
}
if ( (texpath[i] != path) || talkface[i].IsNull() )
{
texpath[i] = path;
talkface[i] = TexMan.CheckForTexture(path,TexMan.Type_Any);
}
Screen.DrawTexture(talkface[i],false,x,y-8*CleanYFac_1,DTA_CleanNoMove_1,true);
x += 72*CleanXFac_1;
}
return -1;
}
override bool Selectable()
{
return false;
}
}
// because I can't change the font or color in mapinfo
Class GreenMessageBox : MessageBoxMenu
@ -239,7 +297,7 @@ Class TranslatorMenu : GenericMenu
trns = UTranslator(players[consoleplayer].mo.FindInventory('UTranslator'));
mfnt = Font.GetFont('UMedFont');
pfnt = Font.GetFont('UOldTinyFont');
ext = CVar.GetCVar('sting_transext',players[consoleplayer]);
ext = CVar.FindCVar('sting_transext');
if ( !trns || !trns.Owner || (trns.Owner.Health <= 0) )
{
// don't do anything, will get killed in the next tick

View file

@ -432,8 +432,9 @@ Class MotionDetector : UnrealInventory
{
Vector2 absofs = level.Vec2Diff(Owner.pos.xy,nearscan[i].pos.xy);
absofs *= (96./1024.);
absofs.y *= -1;
double ang = Owner.angle-90;
Vector2 relofs = (absofs.x*cos(ang)+absofs.y*sin(ang),-absofs.y*cos(ang)+absofs.x*sin(ang));
Vector2 relofs = RotateVector(absofs,ang);
if ( max(abs(relofs.x),abs(relofs.y)) > 48. ) continue;
// this is a long line, but it's not the longest I've ever seen
// oh I have seen things... php code that would make you want to stab your eyes with forks...

View file

@ -163,7 +163,7 @@ Class UTranslocator : UnrealWeapon
p.angle = angle;
p.pitch = BulletSlope();
p.A_SetSize(radius);
Vector3 dir = (cos(p.angle)*cos(p.pitch),sin(p.angle)*cos(p.pitch),-sin(p.pitch));
Vector3 dir = dt_Utility.Vec3FromAngle(p.angle,p.pitch);
dir.z += 0.35*(1-abs(dir.z));
p.vel = dir*p.speed;
invoker.module = p;