4.10 support update (unfinished and untested).

This commit is contained in:
Mari the Deer 2022-12-05 02:10:56 +01:00
commit 8e952f412f
80 changed files with 2343 additions and 2356 deletions

View file

@ -13,10 +13,10 @@ extend Class SWWMWeapon
protected void BufferAmmo( Class<Ammo> type, int amount )
{
AmmoBuffer b;
for ( int i=0; i<BufferedAmmo.Size(); i++ )
foreach ( b:BufferedAmmo )
{
if ( BufferedAmmo[i].AmmoType != type ) continue;
BufferedAmmo[i].Amount += amount;
if ( b.AmmoType != type ) continue;
b.Amount += amount;
return;
}
b = new("AmmoBuffer");
@ -29,10 +29,10 @@ extend Class SWWMWeapon
protected void BufferMagAmmo( Class<MagAmmo> type, int amount )
{
AmmoBuffer b;
for ( int i=0; i<BufferedAmmo.Size(); i++ )
foreach ( b:BufferedAmmo )
{
if ( BufferedAmmo[i].MagAmmoType != type ) continue;
BufferedAmmo[i].Amount += amount;
if ( b.MagAmmoType != type ) continue;
b.Amount += amount;
return;
}
b = new("AmmoBuffer");
@ -81,10 +81,10 @@ extend Class SWWMWeapon
protected int CountBufferedAmmo( Class<Ammo> type )
{
int cnt = 0;
for ( int i=0; i<BufferedAmmo.Size(); i++ )
foreach ( b:BufferedAmmo )
{
if ( BufferedAmmo[i].AmmoType != type ) continue;
cnt += BufferedAmmo[i].amount;
if ( b.AmmoType != type ) continue;
cnt += b.amount;
}
return cnt;
}
@ -92,10 +92,10 @@ extend Class SWWMWeapon
protected int CountBufferedMagAmmo( Class<MagAmmo> type )
{
int cnt = 0;
for ( int i=0; i<BufferedAmmo.Size(); i++ )
foreach ( b:BufferedAmmo )
{
if ( BufferedAmmo[i].MagAmmoType != type ) continue;
cnt += BufferedAmmo[i].amount;
if ( b.MagAmmoType != type ) continue;
cnt += b.amount;
}
return cnt;
}

View file

@ -166,7 +166,7 @@ Class SWWMWeaponLight : DynamicLight
if ( target.player )
{
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(target.pitch,target.angle,target.roll);
[x, y, z] = SWWMUtility.GetAxes(target.angle,target.pitch,target.roll);
origin = level.Vec3Offset(target.Vec2OffsetZ(0,0,target.player.viewz),x*12);
SetOrigin(origin,true);
}

View file

@ -110,7 +110,7 @@ Class ParryField : SWWMNonInteractiveActor
return;
}
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(master.pitch,master.angle,master.roll);
[x, y, z] = SWWMUtility.GetAxes(master.angle,master.pitch,master.roll);
origin = level.Vec3Offset(master.Vec2OffsetZ(0,0,master.player.viewz),x*20);
SetOrigin(origin,false);
let raging = RagekitPower(master.FindInventory("RagekitPower"));
@ -301,14 +301,14 @@ Class MeleeTracer : LineTracer
|| (Results.HitActor == ignoreme)
|| Results.HitActor.FindInventory("ParriedBuff") ) return TRACE_Skip;
bool addme = true;
for ( int k=0; k<hits.Size(); k++ )
foreach ( hit:hits )
{
if ( hits[k].a != Results.HitActor ) continue;
if ( (hits[k].dir dot x) < (Results.HitVector dot x) )
if ( hit.a != Results.HitActor ) continue;
if ( (hit.dir dot x) < (Results.HitVector dot x) )
{
// closer to centerpoint
hits[k].dir = Results.HitVector;
hits[k].pos = Results.HitPos;
hit.dir = Results.HitVector;
hit.pos = Results.HitPos;
}
addme = false;
break;
@ -362,7 +362,7 @@ extend Class SWWMWeapon
action void A_Parry( int duration )
{
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*20-(0,0,20));
if ( invoker.pfield ) invoker.pfield.Destroy();
invoker.pfield = Spawn("ParryField",origin);
@ -376,7 +376,7 @@ extend Class SWWMWeapon
private action bool TryMelee( double spread, int dmg, String hitsound, double rangemul, double kickmul, int flags, Class<Actor> impactclass )
{
Vector3 x, y, z, dir;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = Vec2OffsetZ(0,0,player.viewz);
if ( !invoker.mt ) invoker.mt = new("MeleeTracer");
let mt = invoker.mt; // for convenience
@ -408,38 +408,38 @@ extend Class SWWMWeapon
int quakin = raging?8:2;
double diff = 0.;
bool hdoomgal = false;
for ( int i=0; i<mt.hits.Size(); i++ )
foreach ( hit:mt.hits )
{
if ( !mt.hits[i].a ) continue;
diff += deltaangle(self.angle,AngleTo(mt.hits[i].a));
SWWMUtility.DoKnockback(mt.hits[i].a,mt.hits[i].dir,dmg*2000*kickmul);
if ( !hit.a ) continue;
diff += deltaangle(self.angle,AngleTo(hit.a));
SWWMUtility.DoKnockback(hit.a,hit.dir,dmg*2000*kickmul);
// lol oops
if ( !mt.hits[i].a.bDORMANT ) mt.hits[i].a.DaggerAlert(self);
if ( !mt.hits[i].a.bNOBLOOD && !mt.hits[i].a.bDORMANT && (raging || !mt.hits[i].a.bINVULNERABLE) ) blooded = true;
if ( !hit.a.bDORMANT ) hit.a.DaggerAlert(self);
if ( !hit.a.bNOBLOOD && !hit.a.bDORMANT && (raging || !hit.a.bINVULNERABLE) ) blooded = true;
else bloodless = true;
if ( SWWMHDoomHandler.IsCuteGirl(mt.hits[i].a) ) hdoomgal = true;
let p = SWWMPuff.Setup(mt.hits[i].pos,mt.hits[i].dir,invoker,self,mt.hits[i].a);
int newdmg = mt.hits[i].a.DamageMobj(p,self,dmg,'Melee',flg);
if ( SWWMHDoomHandler.IsCuteGirl(hit.a) ) hdoomgal = true;
let p = SWWMPuff.Setup(hit.pos,hit.dir,invoker,self,hit.a);
int newdmg = hit.a.DamageMobj(p,self,dmg,'Melee',flg);
// things can instantly cease to exist after taking damage (wow)
if ( mt.hits[i].a )
if ( hit.a )
{
if ( mt.hits[i].a.player ) mt.hits[i].a.A_QuakeEx(quakin,quakin,quakin,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.125*quakin);
if ( (newdmg > 0) && !mt.hits[i].a.bNOBLOOD && !mt.hits[i].a.bDORMANT && (raging || !mt.hits[i].a.bINVULNERABLE) )
if ( hit.a.player ) hit.a.A_QuakeEx(quakin,quakin,quakin,6,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.125*quakin);
if ( (newdmg > 0) && !hit.a.bNOBLOOD && !hit.a.bDORMANT && (raging || !hit.a.bINVULNERABLE) )
{
mt.hits[i].a.TraceBleed(newdmg,invoker);
mt.hits[i].a.SpawnBlood(mt.hits[i].pos,atan2(mt.hits[i].dir.y,mt.hits[i].dir.x)+180,newdmg);
hit.a.TraceBleed(newdmg,invoker);
hit.a.SpawnBlood(hit.pos,atan2(hit.dir.y,hit.dir.x)+180,newdmg);
}
else if ( impactclass )
{
let p = Spawn(raging?(Class<Actor>)("BigPunchImpact"):impactclass,mt.hits[i].pos);
p.angle = atan2(mt.hits[i].dir.y,mt.hits[i].dir.x);
let p = Spawn(raging?(Class<Actor>)("BigPunchImpact"):impactclass,hit.pos);
p.angle = atan2(hit.dir.y,hit.dir.x);
}
if ( (flags&MELEE_HammerHit) && (mt.hits[i].a.Health <= mt.hits[i].a.GetGibHealth()) )
if ( (flags&MELEE_HammerHit) && (hit.a.Health <= hit.a.GetGibHealth()) )
SWWMUtility.AchievementProgressInc("dab",1,player);
}
if ( raging )
{
let ps = Spawn("BigPunchSplash",mt.hits[i].pos);
let ps = Spawn("BigPunchSplash",hit.pos);
ps.target = self;
ps.special1 = dmg;
}
@ -496,22 +496,22 @@ extend Class SWWMWeapon
ut.uses.Clear();
ut.Trace(origin,level.PointInSector(origin.xy),dir,DEFMELEERANGE*rangemul,0);
invoker.wallponch = true;
for ( int i=0; i<ut.uses.Size(); i++ )
foreach ( u:ut.uses )
{
if ( ut.uses[i].hitactor )
if ( u.hitactor )
{
// punching is not greeting/patting (that'd be weird)
if ( (ut.uses[i].hitactor == self) || (ut.uses[i].hitactor is 'Demolitionist')
|| (ut.uses[i].hitactor is 'HeadpatTracker')
|| (ut.uses[i].hitactor is 'FroggyChair') ) continue;
if ( ut.uses[i].hitactor.Used(self) ) break;
if ( (u.hitactor == self) || (u.hitactor is 'Demolitionist')
|| (u.hitactor is 'HeadpatTracker')
|| (u.hitactor is 'FroggyChair') ) continue;
if ( u.hitactor.Used(self) ) break;
}
else if ( ut.uses[i].hitline && UseLineTracer.TangibleLine(ut.uses[i]) )
else if ( u.hitline && UseLineTracer.TangibleLine(u) )
{
int locknum = SWWMUtility.GetLineLock(ut.uses[i].hitline);
int locknum = SWWMUtility.GetLineLock(u.hitline);
if ( !locknum || CheckKeys(locknum,false,true) )
ut.uses[i].hitline.RemoteActivate(self,ut.uses[i].hitside,SPAC_Use,ut.uses[i].pos);
if ( !(ut.uses[i].hitline.activation&SPAC_UseThrough) ) break;
u.hitline.RemoteActivate(self,u.hitside,SPAC_Use,u.pos);
if ( !(u.hitline.activation&SPAC_UseThrough) ) break;
}
}
invoker.wallponch = false;

View file

@ -68,9 +68,9 @@ Class Hellblazer : SWWMWeapon
invoker.spinskipped++;
Vector3 x, y, z, x2, y2, z2, dir, origin;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,bAlt?22000.:32000.);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3.5*y-5*z);
a = FRandom[Hellblazer](0,360);
s = FRandom[Hellblazer](0,bAlt?.02:.005);
@ -215,11 +215,10 @@ Class Hellblazer : SWWMWeapon
action void A_CheckLockOn()
{
if ( invoker.seekcnt > invoker.preload ) return;
Vector3 x, y, z, x2, y2, z2, dir;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*SWWMUtility.Vec3FromAngles(angle,pitch));
// try to catch target in cone of vision
[x2, y2, z2] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x, y, z, dir;
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Array<HHitList> hits;
hits.Clear();
int rings = 1;
@ -228,7 +227,7 @@ Class Hellblazer : SWWMWeapon
{
for ( int j=0; j<360; j+=(360/rings) )
{
dir = SWWMUtility.ConeSpread(x2,y2,z2,j,i);
dir = SWWMUtility.ConeSpread(x,y,z,j,i);
LineTrace(atan2(dir.y,dir.x),8000.,asin(-dir.z),TRF_ABSPOSITION,origin.z,origin.x,origin.y,d);
if ( d.HitType != TRACE_HitActor ) continue;
if ( (d.HitActor == invoker.seektarget[0])
@ -241,7 +240,7 @@ Class Hellblazer : SWWMWeapon
for ( int k=0; k<hits.Size(); k++ )
{
if ( hits[k].a != d.HitActor ) continue;
if ( (hits[k].dir dot x2) < (dir dot x2) )
if ( (hits[k].dir dot x) < (dir dot x) )
hits[k].dir = dir; // closer to centerpoint
addme = false;
break;
@ -258,7 +257,7 @@ Class Hellblazer : SWWMWeapon
double closestdot = -1;
for ( int i=0; i<hits.Size(); i++ )
{
double thisdot = (hits[i].dir dot x2);
double thisdot = (hits[i].dir dot x);
if ( thisdot < closestdot ) continue;
closest = i;
closestdot = thisdot;

View file

@ -75,14 +75,14 @@ Class Wallbuster : SWWMWeapon
int bustdmg = dmg;
BusterWall.Bust(t.Results,bustdmg,self,t.Results.HitVector,t.Results.HitPos.z);
}
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(self,0,SPAC_PCross);
t.ShootThroughList[i].Activate(self,0,SPAC_Impact);
l.Activate(self,0,SPAC_PCross);
l.Activate(self,0,SPAC_Impact);
}
for ( int i=0; i<t.WaterHitList.Size(); i++ )
foreach ( w:t.WaterHitList )
{
let b = Spawn("SmolInvisibleSplasher",t.WaterHitList[i].hitpos);
let b = Spawn("SmolInvisibleSplasher",w.hitpos);
b.target = self;
b.A_CheckTerrain();
}
@ -92,25 +92,25 @@ Class Wallbuster : SWWMWeapon
let b = Actor.Spawn("SWWMBubble",level.Vec3Offset(origin,dir*i));
b.Scale *= FRandom[Boolet](.1,.3);
}
for ( int i=0; i<t.HitList.Size(); i++ )
foreach( hit:t.HitList )
{
int realdmg = dmg?dmg:t.HitList[i].HitDamage;
let p = SWWMPuff.Setup(t.HitList[i].HitLocation,t.HitList[i].x,invoker,self,t.HitList[i].HitActor);
SWWMDamageAccumulator.Accumulate(t.HitList[i].HitActor,realdmg,p,self,'shot',false,DMG_INFLICTOR_IS_PUFF);
SWWMUtility.DoKnockback(t.HitList[i].HitActor,t.HitList[i].x+(0,0,0.025),mm*FRandom[Wallbuster](0.4,1.2));
if ( t.HitList[i].HitActor.bNOBLOOD || t.HitList[i].HitActor.bINVULNERABLE || t.HitList[i].HitActor.bDORMANT )
int realdmg = dmg?dmg:hit.HitDamage;
let p = SWWMPuff.Setup(hit.HitLocation,hit.x,invoker,self,hit.HitActor);
SWWMDamageAccumulator.Accumulate(hit.HitActor,realdmg,p,self,'shot',false,DMG_INFLICTOR_IS_PUFF);
SWWMUtility.DoKnockback(hit.HitActor,hit.x+(0,0,0.025),mm*FRandom[Wallbuster](0.4,1.2));
if ( hit.HitActor.bNOBLOOD || hit.HitActor.bINVULNERABLE || hit.HitActor.bDORMANT )
{
let p = Spawn(impact,t.HitList[i].HitLocation);
p.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180;
p.pitch = asin(t.HitList[i].x.z);
let p = Spawn(impact,hit.HitLocation);
p.angle = atan2(hit.x.y,hit.x.x)+180;
p.pitch = asin(hit.x.z);
p.target = self;
p.special1 = max(0,(bc-5)/4);
}
else
{
t.HitList[i].HitActor.TraceBleed(realdmg,self);
t.HitList[i].HitActor.SpawnBlood(t.HitList[i].HitLocation,atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180,realdmg);
t.HitList[i].HitActor.A_StartSound("spreadgun/pelletf",CHAN_DAMAGE,CHANF_OVERLAP,.4,4.);
hit.HitActor.TraceBleed(realdmg,self);
hit.HitActor.SpawnBlood(hit.HitLocation,atan2(hit.x.y,hit.x.x)+180,realdmg);
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) )
@ -195,8 +195,8 @@ Class Wallbuster : SWWMWeapon
}
Vector3 x, y, z, origin, x2, y2, z2, dir;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
int flashstr = 0;
int alertness = 0;
// second pass, play the fire effects
@ -376,7 +376,7 @@ Class Wallbuster : SWWMWeapon
if ( invoker.fired[invoker.rotation[5]*5+i] )
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-3*y-13*z);
let c = Spawn("RedShellCasing",origin);
c.angle = angle;

View file

@ -120,9 +120,9 @@ Class BusterWall : Thinker
private void SpawnDebrisPoly( bool initial = false )
{
for ( int i=0; i<polygrid.Size(); i++ ) for ( double z=boundsmin.z; z<boundsmax.z; z+=step.z )
foreach ( g:polygrid ) for ( double z=boundsmin.z; z<boundsmax.z; z+=step.z )
{
Vector3 spot = (polygrid[i].pos.x,polygrid[i].pos.y,z);
Vector3 spot = (g.pos.x,g.pos.y,z);
spot += (FRandom[Wallbuster](-step.x,step.x),FRandom[Wallbuster](-step.y,step.y),FRandom[Wallbuster](-step.z,step.z));
if ( !level.IsPointInLevel(spot) ) continue;
if ( (initial || !(busttics%2)) && !Random[Wallbuster](0,1) )
@ -291,9 +291,8 @@ Class BusterWall : Thinker
if ( bust.accdamage < 100 ) return false;
// estimate polyobject volume
Vector3 a = (32767,32767,32767), b = (-32768,-32768,-32768);
for ( int i=0; i<p.lines.Size(); i++ )
foreach ( l:p.Lines )
{
Line l = p.lines[i];
if ( l.v1.p.x < a.x ) a.x = l.v1.p.x;
if ( l.v2.p.x < a.x ) a.x = l.v2.p.x;
if ( l.v1.p.y < a.y ) a.y = l.v1.p.y;
@ -376,8 +375,8 @@ Class BusterWall : Thinker
bust.SpawnDebris(true);
// damnums
Vector3 bcenter = (bust.boundsmin+bust.boundsmax)*.5;
for ( int i=0; i<bust.acchits.Size(); i++ )
SWWMDamNum.Spawn(bust.acchits[i],level.Vec3Offset(bcenter,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.),'Wallbust');
foreach ( hit:bust.acchits )
SWWMDamNum.Spawn(hit,level.Vec3Offset(bcenter,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.),'Wallbust');
return true;
}
@ -406,18 +405,20 @@ Class BusterWall : Thinker
else if ( d.HitType == TRACE_HitCeiling )
{
// no busting the goat
for ( int i=0; i<hs.lines.Size(); i++ )
foreach ( l:hs.Lines )
{
if( IsIOSWall(hs.lines[i]) ) return false;
if( IsIOSWall(l) )
return false;
}
hp = 1;
}
else if ( d.HitType == TRACE_HitFloor )
{
// no busting the goat
for ( int i=0; i<hs.lines.Size(); i++ )
foreach ( l:hs.Lines )
{
if( IsIOSWall(hs.lines[i]) ) return false;
if( IsIOSWall(l) )
return false;
}
hp = 0;
}
@ -480,9 +481,8 @@ Class BusterWall : Thinker
if ( bust.accdamage < 100 ) return false;
// estimate sector volume
Vector2 a = (32767,32767), b = (-32768,-32768);
for ( int i=0; i<hs.lines.Size(); i++ )
foreach ( l:hs.Lines )
{
Line l = hs.lines[i];
if ( l.v1.p.x < a.x ) a.x = l.v1.p.x;
if ( l.v2.p.x < a.x ) a.x = l.v2.p.x;
if ( l.v1.p.y < a.y ) a.y = l.v1.p.y;
@ -537,9 +537,8 @@ Class BusterWall : Thinker
if ( !rubble.IsValid() ) rubble = TexMan.CheckForTexture("WASTE03");
if ( !rubble.IsValid() ) rubble = TexMan.CheckForTexture("textures/DefaultTexture.png"); // a fun little fallback should none of those exist
// activate all shoot/use specials (not locked) associated with this sector's two-sided lines
for ( int i=0; i<hs.Lines.Size(); i++ )
foreach ( l:hs.Lines )
{
Line l = hs.Lines[i];
int locknum = SWWMUtility.GetLineLock(l);
if ( locknum && (!instigator || !instigator.CheckKeys(locknum,false,true)) ) continue;
if ( !l.sidedef[1] ) continue;
@ -583,9 +582,8 @@ Class BusterWall : Thinker
hs.SetXScale(hp,1.);
hs.SetYScale(hp,1.);
hs.SetAngle(hp,0.);
for ( int i=0; i<hs.Lines.Size(); i++ )
foreach ( l:hs.Lines )
{
Line l = hs.Lines[i];
if ( !l.sidedef[1] )
{
if ( hp && !(l.flags&Line.ML_DONTPEGBOTTOM) )
@ -618,8 +616,8 @@ Class BusterWall : Thinker
}
// damnums
Vector3 bcenter = (bust.boundsmin+bust.boundsmax)*.5;
for ( int i=0; i<bust.acchits.Size(); i++ )
SWWMDamNum.Spawn(bust.acchits[i],level.Vec3Offset(bcenter,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.),'Wallbust');
foreach( hit:bust.acchits )
SWWMDamNum.Spawn(hit,level.Vec3Offset(bcenter,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.),'Wallbust');
return true;
}
}

View file

@ -96,9 +96,9 @@ Class Eviscerator : SWWMWeapon
A_AlertMonsters(swwm_uncapalert?0:4500);
Vector3 x, y, z, x2, y2, z2, dir, origin;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,25000.);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+4*y-5*z);
int trail = CVar.GetCVar('swwm_funtrails',player).GetInt();
if ( trail == 8 ) trail = Random[Eviscerator](1,7);
@ -171,9 +171,9 @@ Class Eviscerator : SWWMWeapon
A_AlertMonsters(swwm_uncapalert?0:4000);
Vector3 x, y, z, x2, y2, z2, dir, origin;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,32000.);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-5*z);
a = FRandom[Eviscerator](0,360);
s = FRandom[Eviscerator](0,invoker.extended?.003:.02);
@ -204,7 +204,7 @@ Class Eviscerator : SWWMWeapon
action void A_EvisceratorEject()
{
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*10-y*10-z*10);
let c = Spawn("EvisceratorCasing",origin);
c.angle = angle;
@ -217,7 +217,7 @@ Class Eviscerator : SWWMWeapon
action void A_EvisceratorCasingSmoke( Vector3 ofs )
{
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*ofs.x+y*ofs.y+z*ofs.z);
let s = Spawn("SWWMHalfSmoke",origin);
s.scale *= .2;

View file

@ -469,7 +469,7 @@ Class EvisceratorProj : Actor
Spawn("EvisceratorProjLight",pos);
Vector3 x, y, z;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
EvisceratorChunk p;
Vector3 spawnofs;
if ( BlockingMobj ) spawnofs = (0,0,0);

View file

@ -82,10 +82,8 @@ Class Ynykron : SWWMWeapon
A_StopSound(CHAN_WEAPONEXTRA2);
A_StartSound(invoker.inverted?"ynykron/altfire":"ynykron/fire",CHAN_WEAPON,CHANF_OVERLAP,1.,.2);
// global alert
int ns = level.Sectors.Size();
for ( int i=0; i<ns; i++ )
foreach ( s:level.Sectors )
{
Sector s = level.Sectors[i];
for ( Actor a=s.thinglist; a; a=a.snext )
a.LastHeard = self;
}
@ -100,7 +98,7 @@ Class Ynykron : SWWMWeapon
invoker.chargestate = CS_POSTFIRE;
invoker.clipcount = 0;
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),x*15+y*4-z);
Actor s;
if ( invoker.inverted ) s = Spawn("YnykronAltShot",origin);
@ -115,7 +113,7 @@ Class Ynykron : SWWMWeapon
action void A_Backblast()
{
Vector3 x, y, z, origin;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),-x*15+y*4-z);
int numpt = Random[Ynykron](10,20);
for ( int i=0; i<numpt; i++ )

View file

@ -481,9 +481,8 @@ Class YnykronImpact : SWWMNonInteractiveActor
}
qsort_candidates(candidates,0,candidates.Size()-1);
candidates.Resize(2);
for ( int i=0; i<candidates.Size(); i++ )
foreach ( t:candidates )
{
let t = candidates[i];
if ( !t ) continue;
Vector3 dirto = level.Vec3Diff(pos,t.Vec3Offset(0,0,t.Height/2));
double dist = dirto.length();
@ -616,22 +615,21 @@ Class YnykronBeam : SWWMNonInteractiveActor
void TraceOut()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
let t = new("YnykronTracer");
t.ignore = target;
t.ShootThroughList.Clear();
t.WaterHitList.Clear();
t.HitList.Clear();
t.Trace(pos,cursector,x,speed,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.WaterHitList.Size(); i++ )
foreach ( w:t.WaterHitList )
{
let b = Spawn("InvisibleSplasher",t.WaterHitList[i].hitpos);
let b = Spawn("InvisibleSplasher",w.hitpos);
b.target = target;
b.A_CheckTerrain();
}
@ -644,40 +642,40 @@ Class YnykronBeam : SWWMNonInteractiveActor
b.alpha *= .3;
b.vel += x*FRandom[Ynykron](-.2,.4);
}
for ( int i=0; i<t.HitList.Size(); i++ )
foreach ( hit:t.hitlist )
{
if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(t.HitList[i].hitactor) < YnykronShot(master).hitlist.Size()) )
if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(hit.hitactor) < YnykronShot(master).hitlist.Size()) )
continue;
if ( t.hitlist[i].hitactor is 'YnykronSingularityHitbox' )
if ( hit.hitactor is 'YnykronSingularityHitbox' )
{
// detonate it instantly
let s = YnykronSingularity(t.hitlist[i].hitactor.target);
let s = YnykronSingularity(hit.hitactor.target);
s.specialf2 = s.critmass;
let b = Spawn("YnykronImpact",t.hitlist[i].hitlocation);
let b = Spawn("YnykronImpact",hit.hitlocation);
b.target = target;
b.master = master;
b.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x);
b.pitch = asin(-t.HitList[i].x.z);
b.angle = atan2(hit.x.y,hit.x.x);
b.pitch = asin(-hit.x.z);
if ( YnykronShot(master) )
{
YnykronShot(master).hitlist.Push(t.hitlist[i].hitactor);
YnykronShot(master).hitlist.Push(hit.hitactor);
YnykronShot(master).blastcount++;
}
continue;
}
int trad = int(max(t.hitlist[i].hitactor.radius,t.hitlist[i].hitactor.height));
if ( t.hitlist[i].hitactor && YnykronShot(master) )
int trad = int(max(hit.hitactor.radius,hit.hitactor.height));
if ( hit.hitactor && YnykronShot(master) )
{
YnykronShot(master).hitlist.Push(t.hitlist[i].hitactor);
if ( t.hitlist[i].hitactor.bBOSS || t.hitlist[i].hitactor.FindInventory("BossMarker") ) YnykronShot(master).hitboss = true;
YnykronShot(master).hitlist.Push(hit.hitactor);
if ( hit.hitactor.bBOSS || hit.hitactor.FindInventory("BossMarker") ) YnykronShot(master).hitboss = true;
}
// spawn blast that will propagate
let b = Spawn("YnykronImpact",t.hitlist[i].hitlocation);
b.tracer = t.HitList[i].hitactor;
let b = Spawn("YnykronImpact",hit.hitlocation);
b.tracer = hit.hitactor;
b.target = target;
b.master = master;
b.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x);
b.pitch = asin(-t.HitList[i].x.z);
b.angle = atan2(hit.x.y,hit.x.x);
b.pitch = asin(-hit.x.z);
b.args[0] = trad;
if ( YnykronShot(master) )
YnykronShot(master).blastcount++;
@ -742,14 +740,14 @@ Class YnykronBeam : SWWMNonInteractiveActor
it.WaterHitList.Clear();
it.HitList.Clear();
it.Trace(t.Results.HitPos,level.PointInSector(t.Results.HitPos.xy),x,i,TRACE_HitSky);
for ( int i=0; i<it.ShootThroughList.Size(); i++ )
foreach ( l:it.ShootThroughList )
{
it.ShootThroughList[i].Activate(target,0,SPAC_PCross);
it.ShootThroughList[i].Activate(target,0,SPAC_Impact); // just in case
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact); // just in case
}
for ( int i=0; i<it.WaterHitList.Size(); i++ )
foreach ( w:it.WaterHitList )
{
let b = Spawn("InvisibleSplasher",it.WaterHitList[i].hitpos);
let b = Spawn("InvisibleSplasher",w.hitpos);
b.target = target;
b.A_CheckTerrain();
}
@ -763,23 +761,23 @@ Class YnykronBeam : SWWMNonInteractiveActor
b.alpha *= .3;
b.vel += x*FRandom[Ynykron](-.2,.4);
}
for ( int i=0; i<it.HitList.Size(); i++ )
foreach ( hit:it.hitlist )
{
if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(it.HitList[i].hitactor) < YnykronShot(master).hitlist.Size()) )
if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(hit.hitactor) < YnykronShot(master).hitlist.Size()) )
continue;
int trad = int(max(it.hitlist[i].hitactor.radius,it.hitlist[i].hitactor.height));
if ( it.hitlist[i].hitactor && YnykronShot(master) )
int trad = int(max(hit.hitactor.radius,hit.hitactor.height));
if ( hit.hitactor && YnykronShot(master) )
{
YnykronShot(master).hitlist.Push(it.hitlist[i].hitactor);
if ( it.hitlist[i].hitactor.bBOSS || it.hitlist[i].hitactor.FindInventory("BossMarker") ) YnykronShot(master).hitboss = true;
YnykronShot(master).hitlist.Push(hit.hitactor);
if ( hit.hitactor.bBOSS || hit.hitactor.FindInventory("BossMarker") ) YnykronShot(master).hitboss = true;
}
// spawn blast that will propagate
let b = Spawn("YnykronImpact",it.hitlist[i].hitlocation);
b.tracer = it.hitlist[i].hitactor;
let b = Spawn("YnykronImpact",hit.hitlocation);
b.tracer = hit.hitactor;
b.target = target;
b.master = master;
b.angle = atan2(it.HitList[i].x.y,it.HitList[i].x.x);
b.pitch = asin(-it.HitList[i].x.z);
b.angle = atan2(hit.x.y,hit.x.x);
b.pitch = asin(-hit.x.z);
b.args[0] = trad;
if ( YnykronShot(master) )
YnykronShot(master).blastcount++;
@ -810,8 +808,7 @@ Class YnykronBeam : SWWMNonInteractiveActor
void SpreadOut()
{
if ( nospread ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
// propagate
let next = Spawn("YnykronBeam",level.Vec3Offset(pos,x*speed));
next.angle = atan2(x.y,x.x);
@ -1049,7 +1046,7 @@ Class YnykronShot : SWWMNonInteractiveActor
int rings = 1;
Vector3 x, y, z, dir;
double a, s;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
for ( double i=0; i<.04; i+=.006 )
{
for ( int j=0; j<360; j+=(360/rings) )
@ -1365,21 +1362,21 @@ Class YnykronVoidBeam : SWWMNonInteractiveActor
Destroy();
return;
}
Vector3 x = swwm_CoordUtil.GetAxes(pitch,angle,0);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
if ( !t ) t = new("YnykronTracer");
t.ShootThroughList.Clear();
t.WaterHitList.Clear();
t.HitList.Clear();
t.Trace(pos,cursector,x,16*scale.x,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.HitList.Size(); i++ )
foreach ( hit:t.hitlist )
{
// yoink
SWWMUtility.DoKnockback(t.HitList[i].HitActor,-t.HitList[i].x,80000*scale.x*alpha);
SWWMUtility.DoKnockback(hit.HitActor,-hit.x,80000*scale.x*alpha);
}
spreadtimer++;
if ( (t.Results.HitType != TRACE_HitNone) || (segnum > maxlen) || (spreadtimer < stamina) )
@ -1491,20 +1488,20 @@ Class YnykronLightningArc : SWWMNonInteractiveActor
let t = new("CandyBeamTracer");
t.hitlist.Clear();
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
t.ShootThroughList.Clear();
t.Trace(pos,CurSector,x,speed,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.hitlist.Size(); i++ )
foreach ( hit:t.hitlist )
{
if ( !t.hitlist[i].hitactor ) continue;
SWWMUtility.DoKnockback(t.hitlist[i].hitactor,-t.hitlist[i].x,GetMissileDamage(0,0)*1000);
let p = SWWMPuff.Setup(t.hitlist[i].hitlocation,t.hitlist[i].x,self,target,t.hitlist[i].hitactor);
t.hitlist[i].hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Electric',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( !hit.hitactor ) continue;
SWWMUtility.DoKnockback(hit.hitactor,-hit.x,GetMissileDamage(0,0)*1000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
hit.hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Electric',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
}
Vector3 normal = -t.Results.HitVector, dir = t.Results.HitVector;
if ( t.Results.HitType != TRACE_HitNone )
@ -1580,7 +1577,7 @@ Class YnykronLightningArc : SWWMNonInteractiveActor
{
let r = Spawn("YnykronLightningArcSub",level.Vec3Offset(pos,tdir*FRandom[Ynykron](0,1)));
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
double a = FRandom[Ynykron](0,360), s = FRandom[Sparkster](0.,1.);
Vector3 sdir = SWWMUtility.ConeSpread(x,y,z,a,s);
r.angle = atan2(sdir.y,sdir.x);
@ -1690,7 +1687,7 @@ Class YnykronCloud : SWWMNonInteractiveActor
Scale.y *= RandomPick[ExploS](-1,1);
if ( master ) Scale *= master.scale.x;
// orbit axes
[gx, gy, gz] = swwm_CoordUtil.GetAxes(FRandom[ExploS](-90,90),FRandom[ExploS](0,360),FRandom[ExploS](-90,90));
[gx, gy, gz] = SWWMUtility.GetAxes(FRandom[ExploS](0,360),FRandom[ExploS](-90,90),FRandom[ExploS](-90,90));
specialf1 = FRandom[ExploS](200,400);
scale *= specialf1/200.;
specialf2 = FRandom[ExploS](3.,8.)*RandomPick[ExploS](-1,1);
@ -2234,9 +2231,8 @@ Class YnykronSingularity : SWWMNonInteractiveActor
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( hnd )
{
for ( int i=0; i<hnd.SuckableActors.Size(); i++ )
foreach ( a:hnd.SuckableActors )
{
let a = hnd.SuckableActors[i];
if ( !a ) continue;
if ( a.bDORMANT || (a.Health <= 0) || (a == self) || !SWWMUtility.SphereIntersect(a,pos,20000.*scale.x) || !CheckSight(a,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) )
continue;
@ -2494,21 +2490,20 @@ Class YnykronAltBeam : SWWMNonInteractiveActor
void TraceOut()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
let t = new("YnykronAltTracer");
t.ignore = target;
t.ShootThroughList.Clear();
t.WaterHitList.Clear();
t.Trace(pos,cursector,x,speed,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.WaterHitList.Size(); i++ )
foreach ( w:t.WaterHitList )
{
let b = Spawn("InvisibleSplasher",t.WaterHitList[i].hitpos);
let b = Spawn("InvisibleSplasher",w.hitpos);
b.target = target;
b.A_CheckTerrain();
}
@ -2575,8 +2570,7 @@ Class YnykronAltBeam : SWWMNonInteractiveActor
void SpreadOut()
{
if ( nospread ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
// propagate
let next = Spawn("YnykronAltBeam",level.Vec3Offset(pos,x*speed));
next.angle = atan2(x.y,x.x);

View file

@ -97,7 +97,7 @@ Class DeepImpact : SWWMWeapon
A_StartSound("deepimpact/dryfire",CHAN_WEAPON,CHANF_OVERLAP,.5);
A_AlertMonsters(swwm_uncapalert?0:70);
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2*y-3*z);
int numpt = Random[Impact](5,7);
for ( int i=0; i<numpt; i++ )
@ -121,7 +121,7 @@ Class DeepImpact : SWWMWeapon
A_PlayerFire();
invoker.clipcount = max(0,invoker.clipcount-3);
Vector3 x, y, z, dir;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,2000.);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2*y-3*z);
DeepTracer t = new("DeepTracer");
@ -144,25 +144,25 @@ Class DeepImpact : SWWMWeapon
t.hitposz.Clear();
t.Trace(origin,level.PointInSector(origin.xy),dir,250-i*150,0);
SWWMBulletTrail.DoTrail(self,origin,dir,250-i*150,0);
for ( int i=0; i<t.hitlist.Size(); i++ )
for ( int k=0; k<t.hitlist.Size(); k++ )
{
int inl = -1;
for ( int k=0; k<list.Size(); k++ )
for ( int l=0; l<list.Size(); l++ )
{
if ( list[k].a != t.hitlist[i] ) continue;
inl = k;
if ( list[l].a != t.hitlist[k] ) continue;
inl = l;
break;
}
if ( inl == -1 )
{
THitList l = new("THitList");
l.a = t.hitlist[i];
l.a = t.hitlist[k];
inl = list.Push(l);
}
list[inl].nhits++;
list[inl].avgdir += dir;
list[inl].avgdist += t.hitdist[i];
list[inl].avgpos += (t.hitposx[i],t.hitposy[i],t.hitposz[i]);
list[inl].avgdist += t.hitdist[k];
list[inl].avgpos += (t.hitposx[k],t.hitposy[k],t.hitposz[k]);
}
if ( t.Results.HitType == TRACE_HitWall )
{
@ -198,16 +198,16 @@ Class DeepImpact : SWWMWeapon
if ( (pos.z > floorz) && TestMobjZ() ) wnorm *= 2.4;
SWWMUtility.DoKnockback(self,wnorm.unit(),wnorm.length()*5000000.);
}
for ( int i=0; i<list.Size(); i++ )
foreach ( l:list )
{
if ( !list[i].a ) continue;
Vector3 avgdir = list[i].avgdir/list[i].nhits;
double avgdist = list[i].avgdist/list[i].nhits;
Vector3 avgpos = list[i].avgpos/list[i].nhits;
if ( !l.a ) continue;
Vector3 avgdir = l.avgdir/l.nhits;
double avgdist = l.avgdist/l.nhits;
Vector3 avgpos = l.avgpos/l.nhits;
double dmg = 5000.*(1.-clamp(avgdist/250.,0.,1.));
SWWMUtility.DoKnockback(list[i].a,avgdir,dmg*35.);
let p = SWWMPuff.Setup(avgpos,avgdir,invoker,self,list[i].a);
list[i].a.DamageMobj(p,self,int(dmg/250.),'Push',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
SWWMUtility.DoKnockback(l.a,avgdir,dmg*35.);
let p = SWWMPuff.Setup(avgpos,avgdir,invoker,self,l.a);
l.a.DamageMobj(p,self,int(dmg/250.),'Push',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
}
let ti = ThinkerIterator.Create("Actor");
Actor m;
@ -266,11 +266,11 @@ Class DeepImpact : SWWMWeapon
A_PlayerFire();
invoker.clipcount = 0;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,42000.);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2*y-3*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.002);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
let p = Spawn("AirBullet",origin);
p.target = self;

View file

@ -142,7 +142,7 @@ Class Spreadgun : SWWMWeapon
return;
}
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-10*z);
let c = Spawn(invoker.wasgold?"GoldShellCasing":"RedShellCasing",origin);
c.angle = angle;
@ -159,14 +159,14 @@ Class Spreadgun : SWWMWeapon
int bustdmg = dmg;
BusterWall.Bust(t.Results,bustdmg,self,t.Results.HitVector,t.Results.HitPos.z);
}
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(self,0,SPAC_PCross);
t.ShootThroughList[i].Activate(self,0,SPAC_Impact);
l.Activate(self,0,SPAC_PCross);
l.Activate(self,0,SPAC_Impact);
}
for ( int i=0; i<t.WaterHitList.Size(); i++ )
foreach ( w:t.WaterHitList )
{
let b = Spawn("SmolInvisibleSplasher",t.WaterHitList[i].hitpos);
let b = Spawn("SmolInvisibleSplasher",w.hitpos);
b.target = self;
b.A_CheckTerrain();
}
@ -176,24 +176,24 @@ Class Spreadgun : SWWMWeapon
let b = Actor.Spawn("SWWMBubble",level.Vec3Offset(origin,dir*i));
b.Scale *= FRandom[Boolet](.1,.3);
}
for ( int i=0; i<t.HitList.Size(); i++ )
foreach( hit:t.HitList )
{
int realdmg = dmg?dmg:t.HitList[i].HitDamage;
let p = SWWMPuff.Setup(t.HitList[i].HitLocation,t.HitList[i].x,invoker,self,t.HitList[i].HitActor);
SWWMDamageAccumulator.Accumulate(t.HitList[i].HitActor,realdmg,p,self,'shot',false,DMG_INFLICTOR_IS_PUFF);
SWWMUtility.DoKnockback(t.HitList[i].HitActor,t.HitList[i].x+(0,0,0.025),mm*FRandom[Spreadgun](0.4,1.2));
if ( t.HitList[i].HitActor.bNOBLOOD || t.HitList[i].HitActor.bDORMANT || t.HitList[i].HitActor.bINVULNERABLE )
int realdmg = dmg?dmg:hit.HitDamage;
let p = SWWMPuff.Setup(hit.HitLocation,hit.x,invoker,self,hit.HitActor);
SWWMDamageAccumulator.Accumulate(hit.HitActor,realdmg,p,self,'shot',false,DMG_INFLICTOR_IS_PUFF);
SWWMUtility.DoKnockback(hit.HitActor,hit.x+(0,0,0.025),mm*FRandom[Spreadgun](0.4,1.2));
if ( hit.HitActor.bNOBLOOD || hit.HitActor.bDORMANT || hit.HitActor.bINVULNERABLE )
{
let p = Spawn(impact,t.HitList[i].HitLocation);
p.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180;
p.pitch = asin(t.HitList[i].x.z);
let p = Spawn(impact,hit.HitLocation);
p.angle = atan2(hit.x.y,hit.x.x)+180;
p.pitch = asin(hit.x.z);
p.target = self;
}
else
{
t.HitList[i].HitActor.TraceBleed(realdmg,self);
t.HitList[i].HitActor.SpawnBlood(t.HitList[i].HitLocation,atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180,realdmg);
t.HitList[i].HitActor.A_StartSound("spreadgun/pelletf",CHAN_DAMAGE,CHANF_OVERLAP,.4,4.);
hit.HitActor.TraceBleed(realdmg,self);
hit.HitActor.SpawnBlood(hit.HitLocation,atan2(hit.x.y,hit.x.x)+180,realdmg);
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) )
@ -250,10 +250,10 @@ Class Spreadgun : SWWMWeapon
}
A_PlayerFire();
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+2*y-2*z);
Vector3 x2, y2, z2;
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
double a, s;
Vector3 dir;
if ( invoker.goldload )

View file

@ -39,7 +39,7 @@ Class Sparkster : SWWMWeapon
}
else invoker.clipcount = max(0,invoker.clipcount-1);
Vector3 x, y, z, x2, y2, z2, dir;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+4.5*y-5*z);
double a, s;
Actor p;
@ -56,7 +56,7 @@ Class Sparkster : SWWMWeapon
A_PlayerFire();
a = FRandom[Spread](0,360);
s = FRandom[Spread](0,.007);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
p = Spawn("BiosparkBall",origin);
p.target = self;
@ -76,7 +76,7 @@ Class Sparkster : SWWMWeapon
A_PlayerFire();
a = FRandom[Spread](0,360);
s = FRandom[Spread](0,.003);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
p = Spawn("BiosparkBeam",origin);
p.target = self;
@ -95,7 +95,7 @@ Class Sparkster : SWWMWeapon
SWWMUtility.DoKnockback(self,-x,2500.);
a = FRandom[Spread](0,360);
s = FRandom[Spread](0,.012);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
p = Spawn("BiosparkCore",origin);
p.target = self;
@ -117,7 +117,7 @@ Class Sparkster : SWWMWeapon
{
if ( swwm_nomagdrop ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-10*z);
let c = Spawn("SparksterMag",origin);
c.angle = angle;

View file

@ -80,7 +80,7 @@ Class BigOrbiter : SWWMNonInteractiveActor
anglevel = FRandom[Sparkster](5,10);
pitchvel = FRandom[Sparkster](5,10);
speed = FRandom[Sparkster](20,40);
Vector3 x = swwm_CoordUtil.GetAxes(pitch,angle,0);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
SetOrigin(level.Vec3Offset(target.pos,x*speed+(0,0,target.height/2)),false);
SetState(FindState("Spawn")+Random[Sparkster](0,9));
}
@ -99,7 +99,7 @@ Class BigOrbiter : SWWMNonInteractiveActor
if ( isFrozen() ) return;
angle += anglevel;
pitch += pitchvel;
Vector3 x = swwm_CoordUtil.GetAxes(pitch,angle,0);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
SetOrigin(level.Vec3Offset(target.pos,x*speed+(0,0,target.height/2)),true);
if ( tics > 0 ) tics--;
if ( !SetState(CurState.NextState) )
@ -1022,39 +1022,39 @@ Class BiosparkBeam : SWWMNonInteractiveActor
let t = new("BiosparkTracer");
t.hitlist.Clear();
t.ignoreme = target;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
t.ShootThroughList.Clear();
t.Trace(pos,CurSector,x,speed,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
foreach ( hit:t.hitlist )
for ( int i=0; i<t.hitlist.Size(); i++ )
{
if ( !t.hitlist[i].hitactor ) continue;
if ( (t.hitlist[i].hitactor is 'BiosparkHitbox') && t.hitlist[i].hitactor.target )
if ( !hit.hitactor ) continue;
if ( (hit.hitactor is 'BiosparkHitbox') && hit.hitactor.target )
{
let s = Spawn("BiosparkComboImpact",t.hitlist[i].hitactor.pos);
let s = Spawn("BiosparkComboImpact",hit.hitactor.pos);
s.target = target;
s.angle = atan2(t.hitlist[i].x.y,t.hitlist[i].x.x);
s.pitch = asin(-t.hitlist[i].x.z);
if ( (t.hitlist[i].hitactor is 'BigBiosparkHitbox') )
s.angle = atan2(hit.x.y,hit.x.x);
s.pitch = asin(-hit.x.z);
if ( (hit.hitactor is 'BigBiosparkHitbox') )
{
s.bAMBUSH = true;
s.Args[0] = t.hitlist[i].hitactor.target.special1;
s.Args[0] = hit.hitactor.target.special1;
}
t.hitlist[i].hitactor.target.Destroy();
hit.hitactor.target.Destroy();
if ( target ) SWWMUtility.AchievementProgressInc("shock",1,target.player);
}
else
{
SWWMUtility.DoKnockback(t.hitlist[i].hitactor,t.hitlist[i].x,15000);
let p = SWWMPuff.Setup(t.hitlist[i].hitlocation,t.hitlist[i].x,self,target,t.hitlist[i].hitactor);
t.hitlist[i].hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( t.hitlist[i].hitactor && t.hitlist[i].hitactor.bISMONSTER && !Random[Sparkster](0,3) )
t.hitlist[i].hitactor.Howl();
SWWMUtility.DoKnockback(hit.hitactor,hit.x,15000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
hit.hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( hit.hitactor && hit.hitactor.bISMONSTER && !Random[Sparkster](0,3) )
hit.hitactor.Howl();
}
}
Vector3 normal = -t.Results.HitVector, dir = t.Results.HitVector;
@ -1186,28 +1186,27 @@ Class BiosparkBeam : SWWMNonInteractiveActor
let t = new("BiosparkTracer");
t.hitlist.Clear();
t.ignoreme = target;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
Vector3 x = SWWMUtility.Vec3FromAngles(angle,pitch);
t.ShootThroughList.Clear();
t.Trace(pos,CurSector,x,speed,0);
for ( int i=0; i<t.hitlist.Size(); i++ )
foreach ( hit:t.hitlist )
{
if ( !t.hitlist[i].hitactor ) continue;
if ( (t.hitlist[i].hitactor is 'BiosparkHitbox') && t.hitlist[i].hitactor.target )
if ( !hit.hitactor ) continue;
if ( (hit.hitactor is 'BiosparkHitbox') && hit.hitactor.target )
{
let s = Spawn("BiosparkComboImpact",t.hitlist[i].hitactor.pos);
let s = Spawn("BiosparkComboImpact",hit.hitactor.pos);
s.target = target;
s.angle = atan2(t.hitlist[i].x.y,t.hitlist[i].x.x);
s.pitch = asin(-t.hitlist[i].x.z);
t.hitlist[i].hitactor.target.Destroy();
s.angle = atan2(hit.x.y,hit.x.x);
s.pitch = asin(-hit.x.z);
hit.hitactor.target.Destroy();
}
else
{
SWWMUtility.DoKnockback(t.hitlist[i].hitactor,t.hitlist[i].x,15000);
let p = SWWMPuff.Setup(t.hitlist[i].hitlocation,t.hitlist[i].x,self,target,t.hitlist[i].hitactor);
t.hitlist[i].hitactor.DamageMobj(p,target,int(GetMissileDamage(0,0)*alpha),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( t.hitlist[i].hitactor && t.hitlist[i].hitactor.bISMONSTER && !Random[Sparkster](0,3) )
t.hitlist[i].hitactor.Howl();
SWWMUtility.DoKnockback(hit.hitactor,hit.x,15000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
hit.hitactor.DamageMobj(p,target,int(GetMissileDamage(0,0)*alpha),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( hit.hitactor && hit.hitactor.bISMONSTER && !Random[Sparkster](0,3) )
hit.hitactor.Howl();
}
}
}
@ -1363,22 +1362,22 @@ Class BiosparkArc : SWWMNonInteractiveActor
let t = new("CandyBeamTracer");
t.hitlist.Clear();
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
t.ShootThroughList.Clear();
t.Trace(pos,CurSector,x,speed,TRACE_HitSky);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.hitlist.Size(); i++ )
foreach( hit:t.hitlist )
{
if ( !t.hitlist[i].hitactor ) continue;
SWWMUtility.DoKnockback(t.hitlist[i].hitactor,-t.hitlist[i].x,GetMissileDamage(0,0)*1000);
let p = SWWMPuff.Setup(t.hitlist[i].hitlocation,t.hitlist[i].x,self,target,t.hitlist[i].hitactor);
t.hitlist[i].hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( t.hitlist[i].hitactor && t.hitlist[i].hitactor.bISMONSTER && !Random[Sparkster](0,3) )
t.hitlist[i].hitactor.Howl();
if ( !hit.hitactor ) continue;
SWWMUtility.DoKnockback(hit.hitactor,-hit.x,GetMissileDamage(0,0)*1000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
hit.hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Biospark',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( hit.hitactor && hit.hitactor.bISMONSTER && !Random[Sparkster](0,3) )
hit.hitactor.Howl();
}
Vector3 normal = -t.Results.HitVector, dir = t.Results.HitVector;
if ( t.Results.HitType == TRACE_HitWall )
@ -1455,7 +1454,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
if ( (extra > 1) && !Random[Sparkster](0,3) )
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
for ( int i=0; i<extra; i++ )
{
let r = Spawn("BiosparkArc",level.Vec3Offset(pos,tdir*FRandom[Sparkster](0,1)));

View file

@ -85,11 +85,11 @@ Class ExplodiumGun : SWWMWeapon
A_AlertMonsters(swwm_uncapalert?0:5000);
A_PlayerFire();
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,4000.);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-2*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.002);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
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);
@ -171,10 +171,10 @@ Class ExplodiumGun : SWWMWeapon
let weap = Weapon(invoker);
if ( !weap ) return;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-3*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.005);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
let p = Spawn("ExplodiumMagProj",origin);
p.special1 = invoker.special1;
@ -196,7 +196,7 @@ Class ExplodiumGun : SWWMWeapon
invoker.deadeyecnt = 0;
if ( swwm_nomagdrop ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-10*z);
let c = Spawn("ExplodiumMag",origin);
c.angle = angle;
@ -208,7 +208,7 @@ Class ExplodiumGun : SWWMWeapon
action void A_DropCasing()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+8*y-10*z);
let c = Spawn("ExplodiumCasing",origin);
c.angle = angle;
@ -622,11 +622,11 @@ Class DualExplodiumGun : SWWMWeapon
A_AlertMonsters(swwm_uncapalert?0:5000);
A_PlayerFire();
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,4000.);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3.5*side*y-2*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.002);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
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);
@ -707,7 +707,7 @@ Class DualExplodiumGun : SWWMWeapon
ExplodiumGun(invoker.SisterWeapon).deadeyecnt = 0;
if ( swwm_nomagdrop ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*side*y-10*z);
let c = Spawn("ExplodiumMag",origin);
c.angle = angle;
@ -719,7 +719,7 @@ Class DualExplodiumGun : SWWMWeapon
action void A_DropCasing( int side = 1 )
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+8*side*y-10*z);
let c = Spawn("ExplodiumCasing",origin);
c.angle = angle;

View file

@ -132,11 +132,11 @@ Class CandyGun : SWWMWeapon
A_AlertMonsters(swwm_uncapalert?0:9000);
A_PlayerFire();
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
SWWMUtility.DoKnockback(self,-x,18000.);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+3*y-2*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.005);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
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);
@ -210,10 +210,10 @@ Class CandyGun : SWWMWeapon
let weap = Weapon(invoker);
if ( !weap ) return;
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-3*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.01);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
let p = Spawn("CandyMagProj",origin);
p.special1 = invoker.special1;
@ -236,10 +236,10 @@ Class CandyGun : SWWMWeapon
weap.Ammo2.Amount = max(0,weap.Ammo2.Amount-1);
}
Vector3 x, y, z, x2, y2, z2;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-3*z);
double a = FRandom[Spread](0,360), s = FRandom[Spread](0,.015);
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
Vector3 dir = SWWMUtility.ConeSpread(x2,y2,z2,a,s);
let p = Spawn("CandyGunProj",origin);
p.special1 = invoker.clipcount+invoker.chambered;
@ -257,7 +257,7 @@ Class CandyGun : SWWMWeapon
{
if ( swwm_nomagdrop ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x-2*y-10*z);
let c = Spawn("CandyMag",origin);
c.angle = angle;
@ -309,7 +309,7 @@ Class CandyGun : SWWMWeapon
action void A_DropCasing()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+8*y-10*z);
let c = Spawn("CandyCasing",origin);
c.special1 = special1;

View file

@ -98,20 +98,20 @@ Class CandyBeam : SWWMNonInteractiveActor
let t = new("CandyBeamTracer");
t.hitlist.Clear();
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
t.ShootThroughList.Clear();
t.Trace(pos,CurSector,x,speed,0);
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(target,0,SPAC_PCross);
t.ShootThroughList[i].Activate(target,0,SPAC_Impact);
l.Activate(target,0,SPAC_PCross);
l.Activate(target,0,SPAC_Impact);
}
for ( int i=0; i<t.hitlist.Size(); i++ )
foreach( hit:t.hitlist )
{
if ( !t.hitlist[i].hitactor ) continue;
SWWMUtility.DoKnockback(t.hitlist[i].hitactor,t.hitlist[i].x,12000);
let p = SWWMPuff.Setup(t.hitlist[i].hitlocation,t.hitlist[i].x,self,target,t.hitlist[i].hitactor);
t.hitlist[i].hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Candy',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( !hit.hitactor ) continue;
SWWMUtility.DoKnockback(hit.hitactor,hit.x,12000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
hit.hitactor.DamageMobj(p,target,GetMissileDamage(0,0),'Candy',DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
}
Vector3 normal = -t.Results.HitVector, dir = t.Results.HitVector;
if ( t.Results.HitType == TRACE_HitWall )

View file

@ -32,7 +32,6 @@ Class SilverBulletTracer : SpreadgunTracer
bool pastwall, fullstop;
Array<WallPenetrate> WallPenetrateList;
Vector3 exitpoint;
transient Array<F3DFloor> ffloors; // needs to be done like this because HAHA SCOPE
override ETraceStatus TraceCallback()
{
@ -100,11 +99,12 @@ Class SilverBulletTracer : SpreadgunTracer
// double-check if we're piercing through a 3D floor (yes this is a thing that happens, oh boy)
Sector s = level.PointInSector(ofs.xy);
bool stop3d = false;
for ( int j=0; j<ffloors.Size(); j++ )
for ( int j=0; j<s.Get3DFloorCount(); j++ )
{
if ( ffloors[j].target != s ) continue;
double minz = ffloors[j].bottom.ZAtPoint(ofs.xy);
double maxz = ffloors[j].top.ZAtPoint(ofs.xy);
let ff = s.Get3DFloor(j);
if ( !(ff.flags&(F3DFloor.FF_EXISTS|F3DFloor.FF_SOLID)) ) continue;
double minz = ff.bottom.ZAtPoint(ofs.xy);
double maxz = ff.top.ZAtPoint(ofs.xy);
if ( (ofs.z < minz) || (ofs.z > maxz) ) continue;
stop3d = true;
break;
@ -287,72 +287,72 @@ Class SilverBullet : SWWMWeapon
action void ProcessTraceHit( SilverBulletTracer t, Vector3 origin, Vector3 dir )
{
for ( int i=0; i<t.ShootThroughList.Size(); i++ )
foreach ( l:t.ShootThroughList )
{
t.ShootThroughList[i].Activate(self,0,SPAC_Impact);
t.ShootThroughList[i].Activate(self,0,SPAC_PCross);
l.Activate(self,0,SPAC_Impact);
l.Activate(self,0,SPAC_PCross);
}
for ( int i=0; i<t.WaterHitList.Size(); i++ )
foreach ( w:t.WaterHitList )
{
let b = Spawn("InvisibleSplasher",t.WaterHitList[i].hitpos);
let b = Spawn("InvisibleSplasher",w.hitpos);
b.target = self;
b.A_CheckTerrain();
}
for ( int i=0; i<t.HitList.Size(); i++ )
foreach( hit:t.HitList )
{
if ( !t.HitList[i].HitActor ) continue;
SWWMUtility.DoKnockback(t.HitList[i].HitActor,t.HitList[i].x+(0,0,0.025),t.Hitlist[i].HitDamage*20.*FRandom[SilverBullet](.8,1.2));
let p = SWWMPuff.Setup(t.HitList[i].HitLocation,t.HitList[i].x,invoker,self,t.HitList[i].HitActor);
int dmg = t.HitList[i].HitActor.DamageMobj(p,self,t.Hitlist[i].HitDamage,'Sniped',DMG_FOILINVUL|DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( t.HitList[i].HitActor && (t.HitList[i].HitActor.Health <= 0) && (t.HitList[i].HitActor.bIsMonster || t.HitList[i].HitActor.player) && t.HitList[i].HitActor.IsHostile(self) )
if ( !hit.HitActor ) continue;
SWWMUtility.DoKnockback(hit.HitActor,hit.x+(0,0,0.025),hit.HitDamage*20.*FRandom[SilverBullet](.8,1.2));
let p = SWWMPuff.Setup(hit.HitLocation,hit.x,invoker,self,hit.HitActor);
int dmg = hit.HitActor.DamageMobj(p,self,hit.HitDamage,'Sniped',DMG_FOILINVUL|DMG_THRUSTLESS|DMG_INFLICTOR_IS_PUFF);
if ( hit.HitActor && (hit.HitActor.Health <= 0) && (hit.HitActor.bIsMonster || hit.HitActor.player) && hit.HitActor.IsHostile(self) )
{
invoker.nkills++;
SWWMUtility.AchievementProgress("conga",invoker.nkills,player);
if ( t.Hitlist[i].pastwall ) SWWMUtility.AchievementProgressInc("thruwall",1,player);
if ( hit.pastwall ) SWWMUtility.AchievementProgressInc("thruwall",1,player);
}
if ( (dmg > 0) && t.HitList[i].HitActor && !t.HitList[i].HitActor.bNOBLOOD && !t.HitList[i].HitActor.bDORMANT )
if ( (dmg > 0) && hit.HitActor && !hit.HitActor.bNOBLOOD && !hit.HitActor.bDORMANT )
{
t.HitList[i].HitActor.TraceBleed(dmg,self);
t.HitList[i].HitActor.SpawnBlood(t.HitList[i].HitLocation,atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180,dmg);
t.HitList[i].HitActor.A_StartSound("silverbullet/flesh",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.);
let p = Spawn("SilverImpact",t.HitList[i].HitLocation);
hit.HitActor.TraceBleed(dmg,self);
hit.HitActor.SpawnBlood(hit.HitLocation,atan2(hit.x.y,hit.x.x)+180,dmg);
hit.HitActor.A_StartSound("silverbullet/flesh",CHAN_DAMAGE,CHANF_OVERLAP,1.,2.);
let p = Spawn("SilverImpact",hit.HitLocation);
p.special1 = 1;
p.target = self;
p.master = invoker;
p.bAMBUSH = t.HitList[i].pastwall;
p.bAMBUSH = hit.pastwall;
}
else
{
let p = Spawn("SilverImpact",t.HitList[i].HitLocation);
p.angle = atan2(t.HitList[i].x.y,t.HitList[i].x.x)+180;
p.pitch = asin(t.HitList[i].x.z);
let p = Spawn("SilverImpact",hit.HitLocation);
p.angle = atan2(hit.x.y,hit.x.x)+180;
p.pitch = asin(hit.x.z);
p.target = self;
p.master = invoker;
p.bAMBUSH = t.HitList[i].pastwall;
p.bAMBUSH = hit.pastwall;
}
}
LineTracer faketracer = new("LineTracer");
for ( int i=0; i<t.WallPenetrateList.Size(); i++ )
foreach ( wp:t.WallPenetrateList )
{
Vector3 hitpos = t.WallPenetrateList[i].hitpos;
Vector3 hitnormal = t.WallPenetrateList[i].hitnormal;
Vector3 hitpos = wp.hitpos;
Vector3 hitnormal = wp.hitnormal;
let p = Spawn("SilverImpact",hitpos+hitnormal*4);
p.angle = atan2(hitnormal.y,hitnormal.x);
p.pitch = asin(-hitnormal.z);
p.target = self;
p.master = invoker;
p.bAMBUSH = t.WallPenetrateList[i].pastwall;
if ( t.WallPenetrateList[i].hittype == TRACE_HitWall )
t.WallPenetrateList[i].hitline.Activate(self,t.WallPenetrateList[i].hitside,SPAC_Impact);
p.bAMBUSH = wp.pastwall;
if ( wp.hittype == TRACE_HitWall )
wp.hitline.Activate(self,wp.hitside,SPAC_Impact);
if ( swwm_omnibust )
{
faketracer.Results.HitType = t.WallPenetrateList[i].HitType;
faketracer.Results.HitSector = t.WallPenetrateList[i].HitSector;
faketracer.Results.HitLine = t.WallPenetrateList[i].HitLine;
faketracer.Results.ffloor = t.WallPenetrateList[i].HitFFloor;
faketracer.Results.Side = t.WallPenetrateList[i].HitSide;
faketracer.Results.Tier = t.WallPenetrateList[i].HitTier;
BusterWall.Bust(faketracer.Results,t.WallPenetrateList[i].penetration,self,t.WallPenetrateList[i].BustDir,t.WallPenetrateList[i].HitPos.z);
faketracer.Results.HitType = wp.HitType;
faketracer.Results.HitSector = wp.HitSector;
faketracer.Results.HitLine = wp.HitLine;
faketracer.Results.ffloor = wp.HitFFloor;
faketracer.Results.Side = wp.HitSide;
faketracer.Results.Tier = wp.HitTier;
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) )
@ -496,11 +496,11 @@ Class SilverBullet : SWWMWeapon
A_PlayerFire();
SWWMHandler.DoFlash(self,Color(110,255,192,80),8);
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = Vec2OffsetZ(0,0,player.viewz);
if ( !invoker.zoomed ) origin = level.Vec3Offset(origin,10*x+1*y-1*z);
Vector3 x2, y2, z2;
[x2, y2, z2] = swwm_CoordUtil.GetAxes(BulletSlope(),angle,roll);
[x2, y2, z2] = SWWMUtility.GetAxes(angle,BulletSlope(),roll);
SilverBulletTracer sst = new("SilverBulletTracer");
sst.ignoreme = self;
sst.penetration = invoker.proneme?1200.:1000.;
@ -508,17 +508,6 @@ Class SilverBullet : SWWMWeapon
sst.shootthroughlist.Clear();
sst.waterhitlist.Clear();
sst.wallpenetratelist.Clear();
sst.ffloors.Clear();
for ( int i=0; i<level.Sectors.Size(); i++ )
{
Sector s = level.Sectors[i];
for ( int j=0; j<s.Get3DFloorCount(); j++ )
{
F3DFloor ff = s.Get3DFloor(j);
if ( ff.flags&(F3DFloor.FF_EXISTS|F3DFloor.FF_SOLID) )
sst.ffloors.Push(ff);
}
}
sst.pastwall = false;
Vector3 norigin = origin;
double maxdist = 20000.;
@ -566,7 +555,7 @@ Class SilverBullet : SWWMWeapon
action void A_DropCasing()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+10*y-8*z);
let c = Spawn("SilverBulletCasing",origin);
c.angle = angle;
@ -577,7 +566,7 @@ Class SilverBullet : SWWMWeapon
action void A_DropBullet()
{
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),10*x+10*y-8*z);
MagAmmo ma = MagAmmo(FindInventory("SilverBullets"));
if ( !ma )
@ -607,8 +596,8 @@ Class SilverBullet : SWWMWeapon
}
else return;
invoker.wastecycle = 0;
if ( (s.silveregg > 2) && (s.silveregg%2) && player == players[consoleplayer] )
Console.MidPrint(null,"swwmsilverbulleteasteregg"..((s.silveregg-1)/2));
if ( (s.silveregg > 2) && (s.silveregg%2) && (player == players[consoleplayer]) )
EventHandler.SendInterfaceEvent(consoleplayer,"swwmsetdialogue",SWWMDLG_WASTE1+(((s.silveregg-1)/2)-1));
}
action void A_DropMag()
{
@ -627,7 +616,7 @@ Class SilverBullet : SWWMWeapon
invoker.ClipCount = 0;
if ( swwm_nomagdrop ) return;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
Vector3 origin = level.Vec3Offset(Vec2OffsetZ(0,0,player.viewz),6*x-15*z);
let c = Spawn("SilverBulletMag",origin);
c.angle = angle;
@ -639,7 +628,7 @@ Class SilverBullet : SWWMWeapon
{
invoker.specialf1 -= .06;
Vector3 x, y, z;
[x, y, z] = swwm_CoordUtil.GetAxes(pitch,angle,roll);
[x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
vel += x*min(1.,invoker.specialf1)*(600./Mass);
A_OverlayAlpha(PSP_WEAPON+1,clamp(invoker.specialf1*3.,0.,1.));
if ( Random[SilverBullet](0,int(invoker.specialf1*2)) )