Make hitscan treat skies as walls (the full unreal-like experience).
Also, fix incorrect bounce behavior of candy beams and biospark arcs.
This commit is contained in:
parent
56a8969e2f
commit
b8313f1def
15 changed files with 45 additions and 85 deletions
|
|
@ -113,7 +113,7 @@ Class Wallbuster : SWWMWeapon
|
|||
hit.HitActor.A_StartSound("spreadgun/pelletf",CHAN_DAMAGE,CHANF_OVERLAP,.4,4.);
|
||||
}
|
||||
}
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HasHitSky) && (t.Results.HitType != TRACE_HitActor) )
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HitActor) )
|
||||
{
|
||||
Vector3 hitnormal = SWWMUtility.GetLineTracerHitNormal(t.Results);
|
||||
let p = Spawn(impact,t.Results.HitPos+hitnormal*4);
|
||||
|
|
@ -271,7 +271,7 @@ Class Wallbuster : SWWMWeapon
|
|||
st.hitlist.Clear();
|
||||
st.shootthroughlist.Clear();
|
||||
st.waterhitlist.Clear();
|
||||
st.Trace(origin,level.PointInSector(origin.xy),dir,8000.,TRACE_HitSky,ignore:self);
|
||||
st.Trace(origin,level.PointInSector(origin.xy),dir,8000.,0,ignore:self);
|
||||
ProcessTraceHit(st,origin,dir,individualdmg,7000,bc:5+howmany/6,(howmany>1));
|
||||
}
|
||||
for ( int i=0; i<(16-howmany/2); i++ )
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ Class YnykronVoidBeam : SWWMNonInteractiveActor
|
|||
t.ShootThroughList.Clear();
|
||||
t.WaterHitList.Clear();
|
||||
t.HitList.Clear();
|
||||
t.Trace(pos,cursector,x,16*scale.x,TRACE_HitSky);
|
||||
t.Trace(pos,cursector,x,16*scale.x,0);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -379,7 +379,7 @@ Class YnykronLightningArc : SWWMNonInteractiveActor
|
|||
t.hitlist.Clear();
|
||||
let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
|
||||
t.ShootThroughList.Clear();
|
||||
t.Trace(pos,CurSector,x,speed,TRACE_HitSky);
|
||||
t.Trace(pos,CurSector,x,speed,0);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -395,15 +395,12 @@ Class YnykronLightningArc : SWWMNonInteractiveActor
|
|||
Vector3 normal = SWWMUtility.GetLineTracerHitNormal(t.Results), dir = t.Results.HitVector;
|
||||
if ( t.Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
if ( t.Results.HitType != TRACE_HasHitSky )
|
||||
{
|
||||
if ( t.Results.HitType == TRACE_HitWall ) t.Results.HitLine.RemoteActivate(target,t.Results.Side,SPAC_Impact,t.Results.HitPos);
|
||||
let s = Spawn("YnykronLightningImpact",level.Vec3Offset(t.Results.HitPos,normal*8));
|
||||
s.target = target;
|
||||
s.angle = atan2(normal.y,normal.x);
|
||||
s.pitch = asin(-normal.z);
|
||||
if ( swwm_omnibust ) BusterWall.Bust(t.Results,GetMissileDamage(0,0),target,t.Results.HitVector,t.Results.HitPos.z);
|
||||
}
|
||||
if ( t.Results.HitType == TRACE_HitWall ) t.Results.HitLine.RemoteActivate(target,t.Results.Side,SPAC_Impact,t.Results.HitPos);
|
||||
let s = Spawn("YnykronLightningImpact",level.Vec3Offset(t.Results.HitPos,normal*8));
|
||||
s.target = target;
|
||||
s.angle = atan2(normal.y,normal.x);
|
||||
s.pitch = asin(-normal.z);
|
||||
if ( swwm_omnibust ) BusterWall.Bust(t.Results,GetMissileDamage(0,0),target,t.Results.HitVector,t.Results.HitPos.z);
|
||||
nextpos = t.Results.HitPos;
|
||||
bAMBUSH = true;
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
|
|
@ -1335,7 +1332,7 @@ Class YnykronAltBeam : SWWMNonInteractiveActor
|
|||
let t = new("YnykronAltTracer");
|
||||
t.ShootThroughList.Clear();
|
||||
t.WaterHitList.Clear();
|
||||
t.Trace(pos,cursector,x,speed,TRACE_HitSky,ignore:target);
|
||||
t.Trace(pos,cursector,x,speed,0,ignore:target);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -1356,13 +1353,6 @@ Class YnykronAltBeam : SWWMNonInteractiveActor
|
|||
b.A_SetRenderStyle(b.alpha*.3,STYLE_Subtract);
|
||||
b.vel += x*FRandom[Ynykron](-.2,.4);
|
||||
}
|
||||
if ( t.Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
// goodbye
|
||||
nospread = true;
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
return;
|
||||
}
|
||||
if ( t.Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
// hit something
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ Class YnykronBeam : SWWMNonInteractiveActor
|
|||
t.ShootThroughList.Clear();
|
||||
t.WaterHitList.Clear();
|
||||
t.HitList.Clear();
|
||||
t.Trace(pos,cursector,x,speed,TRACE_HitSky,ignore:target);
|
||||
t.Trace(pos,cursector,x,speed,0,ignore:target);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -676,13 +676,6 @@ Class YnykronBeam : SWWMNonInteractiveActor
|
|||
if ( YnykronShot(master) )
|
||||
YnykronShot(master).blastcount++;
|
||||
}
|
||||
if ( t.Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
// goodbye
|
||||
nospread = true;
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
return;
|
||||
}
|
||||
if ( t.Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
// hit something
|
||||
|
|
@ -719,7 +712,7 @@ Class YnykronBeam : SWWMNonInteractiveActor
|
|||
it.ShootThroughList.Clear();
|
||||
it.WaterHitList.Clear();
|
||||
it.HitList.Clear();
|
||||
it.Trace(t.Results.HitPos,level.PointInSector(t.Results.HitPos.xy),x,i,TRACE_HitSky,ignore:target);
|
||||
it.Trace(t.Results.HitPos,level.PointInSector(t.Results.HitPos.xy),x,i,0,ignore:target);
|
||||
foreach ( l:it.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -929,7 +922,7 @@ Class DelayedWallBeam : SWWMNonInteractiveActor
|
|||
YnykronShot(master).blastcount++;
|
||||
// trace back to get the proper "exit surface" so we can trigger lines if needed
|
||||
let at = new("AuxiliarySilverBulletTracer");
|
||||
at.Trace(pos,CurSector,-x,2.,TRACE_NoSky,ignoreallactors:true);
|
||||
at.Trace(pos,CurSector,-x,2.,0,ignoreallactors:true);
|
||||
if ( at.Results.HitType == TRACE_HitWall )
|
||||
{
|
||||
if ( at.Results.HitLine.sidedef[1] )
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ Class Spreadgun : SWWMWeapon
|
|||
hit.HitActor.A_StartSound("spreadgun/pelletf",CHAN_DAMAGE,CHANF_OVERLAP,.4,4.);
|
||||
}
|
||||
}
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HasHitSky) && (t.Results.HitType != TRACE_HitActor) )
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HitActor) )
|
||||
{
|
||||
Vector3 hitnormal = SWWMUtility.GetLineTracerHitNormal(t.Results);
|
||||
let p = Spawn(impact,t.Results.HitPos+hitnormal*4);
|
||||
|
|
@ -244,7 +244,7 @@ Class Spreadgun : SWWMWeapon
|
|||
s = FRandom[Spreadgun](0,.01);
|
||||
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
||||
FLineTraceData d;
|
||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION|TRF_NOSKY,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);
|
||||
SWWMBulletTrail.DoTrail(self,origin,dir,10000,2,true);
|
||||
if ( d.HitType != TRACE_HitNone )
|
||||
{
|
||||
|
|
@ -294,7 +294,7 @@ Class Spreadgun : SWWMWeapon
|
|||
st.hitlist.Clear();
|
||||
st.shootthroughlist.Clear();
|
||||
st.waterhitlist.Clear();
|
||||
st.Trace(origin,level.PointInSector(origin.xy),dir,8000.,TRACE_HitSky,ignore:self);
|
||||
st.Trace(origin,level.PointInSector(origin.xy),dir,8000.,0,ignore:self);
|
||||
ProcessTraceHit(st,origin,dir,10,7000,bc:5);
|
||||
}
|
||||
for ( int i=0; i<16; i++ )
|
||||
|
|
|
|||
|
|
@ -1007,7 +1007,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor
|
|||
t.hitlist.Clear();
|
||||
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
|
||||
t.ShootThroughList.Clear();
|
||||
t.Trace(pos,CurSector,x,speed,TRACE_HitSky,ignore:target);
|
||||
t.Trace(pos,CurSector,x,speed,0,ignore:target);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -1041,12 +1041,6 @@ Class BiosparkBeam : SWWMNonInteractiveActor
|
|||
}
|
||||
Vector3 normal = SWWMUtility.GetLineTracerHitNormal(t.Results), dir = t.Results.HitVector;
|
||||
if ( t.Results.HitType == TRACE_HitWall ) t.Results.HitLine.RemoteActivate(target,t.Results.Side,SPAC_Impact,t.Results.HitPos);
|
||||
if ( t.Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
bAMBUSH = true;
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
return;
|
||||
}
|
||||
if ( t.Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
let s = Spawn("BiosparkBeamImpact",t.Results.HitPos+normal*8.);
|
||||
|
|
@ -1328,7 +1322,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
|
|||
t.hitlist.Clear();
|
||||
let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
|
||||
t.ShootThroughList.Clear();
|
||||
t.Trace(pos,CurSector,x,speed,TRACE_HitSky);
|
||||
t.Trace(pos,CurSector,x,speed,0);
|
||||
foreach ( l:t.ShootThroughList )
|
||||
{
|
||||
l.Activate(target,0,SPAC_PCross);
|
||||
|
|
@ -1345,16 +1339,11 @@ Class BiosparkArc : SWWMNonInteractiveActor
|
|||
}
|
||||
Vector3 normal = SWWMUtility.GetLineTracerHitNormal(t.Results), dir = t.Results.HitVector;
|
||||
if ( t.Results.HitType == TRACE_HitWall ) t.Results.HitLine.RemoteActivate(target,t.Results.Side,SPAC_Impact,t.Results.HitPos);
|
||||
if ( t.Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
bAMBUSH = true;
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
return;
|
||||
}
|
||||
if ( t.Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
nextpos = level.Vec3Offset(t.Results.HitPos,normal); // offset by normal so next segment doesn't spawn inside walls
|
||||
dir = dir-(2.*normal*(dir dot normal)); // bounce direction
|
||||
}
|
||||
else nextpos = t.Results.HitPos;
|
||||
double a = FRandom[Sparkster](0,360), s = FRandom[Sparkster](0.,.8);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ Class ExplodiumGun : SWWMWeapon
|
|||
let [x2, y2, z2] = SWWMUtility.GetPlayerAxesAutoAimed(self);
|
||||
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
||||
FLineTraceData d;
|
||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION|TRF_NOSKY,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);
|
||||
SWWMBulletTrail.DoTrail(self,origin,dir,10000,2);
|
||||
if ( d.HitType == TRACE_HitActor )
|
||||
{
|
||||
|
|
@ -674,7 +674,7 @@ Class DualExplodiumGun : SWWMWeapon
|
|||
let [x2, y2, z2] = SWWMUtility.GetPlayerAxesAutoAimed(self);
|
||||
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
||||
FLineTraceData d;
|
||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION|TRF_NOSKY,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);
|
||||
SWWMBulletTrail.DoTrail(self,origin,dir,10000,2);
|
||||
if ( d.HitType == TRACE_HitActor )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ Class CandyGun : SWWMWeapon
|
|||
let [x2, y2, z2] = SWWMUtility.GetPlayerAxesAutoAimed(self);
|
||||
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
|
||||
FLineTraceData d;
|
||||
LineTrace(atan2(dir.y,dir.x),10000,asin(-dir.z),TRF_ABSPOSITION|TRF_NOSKY,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);
|
||||
SWWMBulletTrail.DoTrail(self,origin,dir,10000,2);
|
||||
if ( d.HitType == TRACE_HitActor )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ Class CandyBeam : SWWMNonInteractiveActor
|
|||
{
|
||||
speed = t.Results.Distance; // shortens in minimap
|
||||
nextpos = level.Vec3Offset(t.Results.HitPos,normal); // offset by normal so next segment doesn't spawn inside walls
|
||||
dir = dir-(2.*normal*(dir dot normal)); // bounce direction
|
||||
}
|
||||
else nextpos = t.Results.HitPos;
|
||||
double a = FRandom[Candy](0,360), s = FRandom[Candy](0.,.8);
|
||||
|
|
|
|||
|
|
@ -76,11 +76,6 @@ Class SilverBulletTracer : SpreadgunTracer
|
|||
}
|
||||
return TRACE_Skip;
|
||||
}
|
||||
else if ( Results.HitType == TRACE_HasHitSky )
|
||||
{
|
||||
fullstop = true;
|
||||
return TRACE_Stop;
|
||||
}
|
||||
else if ( Results.HitType != TRACE_HitNone )
|
||||
{
|
||||
if ( Results.HitType == TRACE_HitWall )
|
||||
|
|
@ -353,7 +348,7 @@ Class SilverBullet : SWWMWeapon
|
|||
BusterWall.Bust(faketracer.Results,wp.penetration,self,wp.BustDir,wp.HitPos.z);
|
||||
}
|
||||
}
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HasHitSky) && (t.Results.HitType != TRACE_HitActor) )
|
||||
if ( (t.Results.HitType != TRACE_HitNone) && (t.Results.HitType != TRACE_HitActor) )
|
||||
{
|
||||
Vector3 hitnormal = SWWMUtility.GetLineTracerHitNormal(t.Results);
|
||||
let p = Spawn("SilverImpact",t.Results.HitPos+hitnormal*4);
|
||||
|
|
@ -496,7 +491,7 @@ Class SilverBullet : SWWMWeapon
|
|||
do
|
||||
{
|
||||
sst.fullstop = true;
|
||||
sst.Trace(norigin,level.PointInSector(norigin.xy),x2,maxdist,TRACE_HitSky,ignore:self);
|
||||
sst.Trace(norigin,level.PointInSector(norigin.xy),x2,maxdist,0,ignore:self);
|
||||
maxdist -= (sst.exitpoint-norigin).length();
|
||||
norigin = sst.exitpoint;
|
||||
x2 = sst.Results.HitVector;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue