"Bullet Trail" effect implemented. Mainly for underwater bubbles, but also has the side effect of allowing hitscan weapons to activate shoot-through lines. SIGIL players rejoice.
Shock Rifle and Pulsegun beams can also do this now. Depleted armors remove themselves from inventory.
This commit is contained in:
parent
607dbe972f
commit
dd7f429335
7 changed files with 62 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ Class UTArmor : Armor
|
||||||
newdamage -= saved;
|
newdamage -= saved;
|
||||||
amount -= saved;
|
amount -= saved;
|
||||||
damage = newdamage;
|
damage = newdamage;
|
||||||
|
if ( (amount <= 0) ) DepleteOrDestroy();
|
||||||
}
|
}
|
||||||
if ( damage > 0 ) newdamage = ApplyDamageFactors(GetClass(),damageType,damage,damage);
|
if ( damage > 0 ) newdamage = ApplyDamageFactors(GetClass(),damageType,damage,damage);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,7 @@ Class Enforcer : UTWeapon
|
||||||
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
||||||
FLineTraceData d;
|
FLineTraceData d;
|
||||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,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));
|
||||||
if ( d.HitType == TRACE_HitActor )
|
if ( d.HitType == TRACE_HitActor )
|
||||||
{
|
{
|
||||||
int dmg = 17;
|
int dmg = 17;
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ Class Minigun : UTWeapon
|
||||||
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
Vector3 dir = (x2+y2*cos(a)*s+z2*sin(a)*s).unit();
|
||||||
FLineTraceData d;
|
FLineTraceData d;
|
||||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,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);
|
||||||
if ( d.HitType == TRACE_HitActor )
|
if ( d.HitType == TRACE_HitActor )
|
||||||
{
|
{
|
||||||
int dmg = Random[Minigun](9,18); // fun fact: the Minigun is one of the few weapons that has actual RNG damage in UT
|
int dmg = Random[Minigun](9,18); // fun fact: the Minigun is one of the few weapons that has actual RNG damage in UT
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,7 @@ Class PulseBoltLight : DynamicLight
|
||||||
Class PulseBoltTracer : LineTracer
|
Class PulseBoltTracer : LineTracer
|
||||||
{
|
{
|
||||||
Actor ignore;
|
Actor ignore;
|
||||||
|
Array<Line> ShootThroughList;
|
||||||
|
|
||||||
override ETraceStatus TraceCallback()
|
override ETraceStatus TraceCallback()
|
||||||
{
|
{
|
||||||
|
|
@ -239,6 +240,7 @@ Class PulseBoltTracer : LineTracer
|
||||||
{
|
{
|
||||||
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&Line.ML_BlockHitscan) )
|
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&Line.ML_BlockHitscan) )
|
||||||
return TRACE_Stop;
|
return TRACE_Stop;
|
||||||
|
ShootThroughList.Push(Results.HitLine);
|
||||||
return TRACE_Skip;
|
return TRACE_Skip;
|
||||||
}
|
}
|
||||||
return TRACE_Stop;
|
return TRACE_Stop;
|
||||||
|
|
@ -352,7 +354,10 @@ Class PulseBolt : Actor
|
||||||
}
|
}
|
||||||
void CheckBeam( Vector3 x )
|
void CheckBeam( Vector3 x )
|
||||||
{
|
{
|
||||||
|
t.ShootThroughList.Clear();
|
||||||
t.Trace(pos,cursector,x,beamsize,0);
|
t.Trace(pos,cursector,x,beamsize,0);
|
||||||
|
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
|
||||||
|
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
|
||||||
if ( t.Results.HitType != TRACE_HitNone )
|
if ( t.Results.HitType != TRACE_HitNone )
|
||||||
{
|
{
|
||||||
if ( t.Results.HitType == TRACE_HitActor )
|
if ( t.Results.HitType == TRACE_HitActor )
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ Class ShockAmmo2 : ShockAmmo
|
||||||
Class ShockBeamTracer : LineTracer
|
Class ShockBeamTracer : LineTracer
|
||||||
{
|
{
|
||||||
Actor owner, ignore, lasthit;
|
Actor owner, ignore, lasthit;
|
||||||
|
Array<Line> ShootThroughList;
|
||||||
|
|
||||||
override ETraceStatus TraceCallback()
|
override ETraceStatus TraceCallback()
|
||||||
{
|
{
|
||||||
|
|
@ -51,6 +52,7 @@ Class ShockBeamTracer : LineTracer
|
||||||
{
|
{
|
||||||
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) )
|
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) )
|
||||||
return TRACE_Stop;
|
return TRACE_Stop;
|
||||||
|
ShootThroughList.Push(Results.HitLine);
|
||||||
return TRACE_Skip;
|
return TRACE_Skip;
|
||||||
}
|
}
|
||||||
return TRACE_Stop;
|
return TRACE_Stop;
|
||||||
|
|
@ -304,7 +306,10 @@ Class ShockBeam : Actor
|
||||||
if ( !moving ) return;
|
if ( !moving ) return;
|
||||||
// step trace
|
// step trace
|
||||||
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||||
|
t.ShootThroughList.Clear();
|
||||||
t.Trace(pos,cursector,tracedir,1000,0);
|
t.Trace(pos,cursector,tracedir,1000,0);
|
||||||
|
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
|
||||||
|
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
|
||||||
totaldist += t.Results.Distance;
|
totaldist += t.Results.Distance;
|
||||||
// spawn particles
|
// spawn particles
|
||||||
for ( int i=0; i<t.Results.Distance; i+=80 )
|
for ( int i=0; i<t.Results.Distance; i+=80 )
|
||||||
|
|
@ -538,7 +543,10 @@ Class SuperShockBeam : Actor
|
||||||
if ( !moving ) return;
|
if ( !moving ) return;
|
||||||
// step trace
|
// step trace
|
||||||
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
tracedir = (cos(angle)*cos(pitch),sin(angle)*cos(pitch),-sin(pitch));
|
||||||
|
t.ShootThroughList.Clear();
|
||||||
t.Trace(pos,cursector,tracedir,2000,0);
|
t.Trace(pos,cursector,tracedir,2000,0);
|
||||||
|
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
|
||||||
|
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
|
||||||
totaldist += t.Results.Distance;
|
totaldist += t.Results.Distance;
|
||||||
// spawn particles
|
// spawn particles
|
||||||
for ( int i=0; i<t.Results.Distance; i+=80 )
|
for ( int i=0; i<t.Results.Distance; i+=80 )
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,9 @@ Class SniperRifle : UTWeapon
|
||||||
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
|
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
|
||||||
if ( !zoomed ) origin = level.Vec3Offset(origin,y*4-z*2);
|
if ( !zoomed ) origin = level.Vec3Offset(origin,y*4-z*2);
|
||||||
FLineTraceData d;
|
FLineTraceData d;
|
||||||
LineTrace(angle,10000,BulletSlope(),TRF_ABSPOSITION,origin.z,origin.x,origin.y,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,1);
|
||||||
if ( d.HitType == TRACE_HitActor )
|
if ( d.HitType == TRACE_HitActor )
|
||||||
{
|
{
|
||||||
int dmg = 45;
|
int dmg = 45;
|
||||||
|
|
|
||||||
|
|
@ -2280,6 +2280,49 @@ Class UTTeleParticle : UTMeshParticle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Follows a single line trail, spawns bubbles if underwater
|
||||||
|
// In addition, also activates shoot-through lines, since LineTrace can't do it
|
||||||
|
Class UTBulletTrail : LineTracer
|
||||||
|
{
|
||||||
|
Array<Line> ShootThroughList;
|
||||||
|
Actor ignoreme;
|
||||||
|
|
||||||
|
static play void DoTrail( Actor target, Vector3 pos, Vector3 dir, int dist, int bubblechance )
|
||||||
|
{
|
||||||
|
let t = new("UTBulletTrail");
|
||||||
|
t.ignoreme = target;
|
||||||
|
t.ShootThroughList.Clear();
|
||||||
|
t.Trace(pos,level.PointInSector(pos.xy),dir,dist,0);
|
||||||
|
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
|
||||||
|
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
|
||||||
|
for ( int i=5; i<t.Results.Distance; i+=10 )
|
||||||
|
{
|
||||||
|
if ( !Random[Boolet](0,bubblechance) ) continue;
|
||||||
|
let b = Actor.Spawn("UTBubble",level.Vec3Offset(pos,dir*i));
|
||||||
|
b.Scale *= FRandom[Boolet](0.4,0.6);
|
||||||
|
}
|
||||||
|
t.Destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
override ETraceStatus TraceCallback()
|
||||||
|
{
|
||||||
|
if ( Results.HitType == TRACE_HitActor )
|
||||||
|
{
|
||||||
|
if ( Results.HitActor == ignoreme ) return TRACE_Skip;
|
||||||
|
if ( Results.HitActor.bSHOOTABLE ) return TRACE_Stop;
|
||||||
|
return TRACE_Skip;
|
||||||
|
}
|
||||||
|
else if ( (Results.HitType == TRACE_HitWall) && (Results.Tier == TIER_Middle) )
|
||||||
|
{
|
||||||
|
if ( !Results.HitLine.sidedef[1] || (Results.HitLine.Flags&(Line.ML_BlockHitscan|Line.ML_BlockEverything)) )
|
||||||
|
return TRACE_Stop;
|
||||||
|
ShootThroughList.Push(Results.HitLine);
|
||||||
|
return TRACE_Skip;
|
||||||
|
}
|
||||||
|
return TRACE_Stop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Enum ESwingMode
|
Enum ESwingMode
|
||||||
{
|
{
|
||||||
SWING_Straight, // constant increment
|
SWING_Straight, // constant increment
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue