Bump ZScript ver to 4.14, address usage of deprecated actor flags (MISSILEMORE/MISSILEEVENMORE).

This commit is contained in:
Mari the Deer 2025-02-20 16:01:59 +01:00
commit bd55e2ad57
6 changed files with 39 additions and 32 deletions

View file

@ -33,9 +33,16 @@ Class MykradvoTendril : SWWMNonInteractiveActor
{
Vector3 nextpos, nextdir;
bool bDoSplit;
virtual bool IsBig()
{
return true;
}
void A_Trace()
{
tics = bMISSILEMORE?2:1;
tics = IsBig()?2:1;
let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
if ( !bSTANDSTILL )
{
@ -51,7 +58,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
foreach ( hit:t.hitlist )
{
if ( hit.hitactor.IsFriend(target) ) continue;
if ( (hit.hitactor == tracer) && bMISSILEMORE ) bMISSILEEVENMORE = true; // we split
if ( (hit.hitactor == tracer) && IsBig() ) bDoSplit = true; // we split
int dmg = (hit.hitactor.bBOSS||hit.hitactor.FindInventory("BossMarker"))?(GetMissileDamage(0,0)*4):max(hit.hitactor.Health,GetMissileDamage(0,0));
SWWMUtility.DoKnockback(hit.hitactor,-hit.x+(0,0,.5),((hit.hitactor.Health-dmg)<=0)?60000:8000);
let p = SWWMPuff.Setup(hit.hitlocation,hit.x,self,target,hit.hitactor);
@ -61,7 +68,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
}
}
nextpos = level.Vec3Offset(pos,x*speed);
if ( !bSTANDSTILL && (!tracer || !tracer.bSHOOTABLE || (tracer.Health <= 0) || ((tracer.bBOSS || tracer.FindInventory("BossMarker")) && !bMISSILEMORE)) )
if ( !bSTANDSTILL && (!tracer || !tracer.bSHOOTABLE || (tracer.Health <= 0) || ((tracer.bBOSS || tracer.FindInventory("BossMarker")) && !IsBig())) )
{
ReactionTime--;
if ( ReactionTime <= 0 )
@ -70,11 +77,11 @@ Class MykradvoTendril : SWWMNonInteractiveActor
return;
}
}
double a = FRandom[Mykradvo](0,360), s = FRandom[Mykradvo](0.,bSTANDSTILL?3.:bMISSILEMORE?.75:1.5);
double a = FRandom[Mykradvo](0,360), s = FRandom[Mykradvo](0.,bSTANDSTILL?3.:IsBig()?.75:1.5);
Vector3 dir = SWWMUtility.ConeSpread(x,y,z,a,s);
if ( tracer )
{
Vector3 destofs = bMISSILEMORE?tracer.Vec3Offset(0,0,tracer.Height/2.):tracer.Vec3Offset(FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-.1,1.1)*tracer.height);
Vector3 destofs = IsBig()?tracer.Vec3Offset(0,0,tracer.Height/2.):tracer.Vec3Offset(FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-1.2,1.2)*tracer.Radius,FRandom[Mykradvo](-.1,1.1)*tracer.height);
Vector3 dirto = level.Vec3Diff(nextpos,destofs);
double dist = dirto.length();
if ( dist > 1 )
@ -83,13 +90,13 @@ Class MykradvoTendril : SWWMNonInteractiveActor
dir = (dir+dirto*(clamp(1.-(dist/4000.),.25,1.)**1.5)).unit();
}
// early split
if ( dist < speed ) bMISSILEEVENMORE = true;
if ( dist < speed ) bDoSplit = true;
}
nextdir = dir;
}
void A_Spread()
{
if ( bMISSILEMORE && bMISSILEEVENMORE )
if ( IsBig() && bDoSplit )
{
// spread into sub-tendrils
let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
@ -112,7 +119,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
{
if ( !bSTANDSTILL )
{
int numpt = bMISSILEMORE?9:3;
int numpt = IsBig()?9:3;
let [x, y, z] = SWWMUtility.GetAxes(angle,pitch,roll);
for ( int i=0; i<numpt; i++ )
{
@ -122,7 +129,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
r.angle = atan2(sdir.y,sdir.x);
r.pitch = asin(-sdir.z);
r.target = target;
if ( bMISSILEMORE ) r.ReactionTime += Random[ExploS](0,4);
if ( IsBig() ) r.ReactionTime += Random[ExploS](0,4);
else r.ReactionTime -= Random[ExploS](0,4);
}
}
@ -137,7 +144,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
b.special2 = special2;
b.ReactionTime = ReactionTime;
if ( !bSTANDSTILL && !((special1+special2)%4) && !Random[Mykradvo](0,4) )
A_StartSound(bMISSILEMORE?"mykradvo/arc":"mykradvo/smallarc",CHAN_WEAPON,attenuation:(bMISSILEMORE?.5:1.5),pitch:FRandom[Mykradvo](.75,1.25));
A_StartSound(IsBig()?"mykradvo/arc":"mykradvo/smallarc",CHAN_WEAPON,attenuation:(IsBig()?.5:1.5),pitch:FRandom[Mykradvo](.75,1.25));
}
override void PostBeginPlay()
{
@ -152,7 +159,7 @@ Class MykradvoTendril : SWWMNonInteractiveActor
return;
}
if ( isFrozen() ) return;
A_FadeOut(bMISSILEMORE?.05:bSTANDSTILL?.2:.1);
A_FadeOut(IsBig()?.05:bSTANDSTILL?.2:.1);
if ( !CheckNoDelay() || (tics == -1) ) return;
if ( tics > 0 ) tics--;
while ( !tics )
@ -170,7 +177,6 @@ Class MykradvoTendril : SWWMNonInteractiveActor
Speed 64;
+INTERPOLATEANGLES;
+FOILINVUL;
+MISSILEMORE;
}
States
{
@ -226,12 +232,15 @@ Class MykradvoTendril : SWWMNonInteractiveActor
// sub seekers
Class MykradvoSmallTendril : MykradvoTendril
{
override bool IsBig()
{
return false;
}
Default
{
Speed 16;
DamageFunction 10;
ReactionTime 20;
-MISSILEMORE;
}
States
{

View file

@ -436,8 +436,8 @@ Class SWWMHans : Actor
Speed 12;
Monster;
MinMissileChance 160;
MissileChanceMult .5;
+BOSS;
+MISSILEMORE;
+FLOORCLIP;
+NORADIUSDMG;
+DONTMORPH;

View file

@ -64,7 +64,7 @@ Class Sparkster : SWWMWeapon
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
p.vel = dir*p.speed;
if ( invoker.doublestacc ) p.bMISSILEMORE = true;
if ( invoker.doublestacc ) p.MissileChanceMult = .5;
break;
case 1:
// beam
@ -84,7 +84,7 @@ Class Sparkster : SWWMWeapon
p.angle = atan2(dir.y,dir.x);
p.pitch = asin(-dir.z);
p.frame = 0;
if ( invoker.doublestacc ) p.bMISSILEMORE = true;
if ( invoker.doublestacc ) p.MissileChanceMult = .5;
break;
case 2:
// big spark
@ -107,7 +107,7 @@ Class Sparkster : SWWMWeapon
p.special1 = scnt;
if ( invoker.doublestacc )
{
p.bMISSILEMORE = true;
p.MissileChanceMult = .5;
p.ReactionTime -= 10;
}
break;

View file

@ -254,7 +254,7 @@ Class BigBiospark : Actor
if ( dist > 4. ) SWWMUtility.DoKnockback(t,-dirto,clamp(120.-dist,0.,120.)*100);
}
Health -= 3;
if ( bMISSILEMORE ) Health--;
if ( MissileChanceMult <= .5 ) Health--;
if ( Health <= 0 ) ExplodeMissile();
}
@ -429,7 +429,7 @@ Class BiosparkBall : Actor
A_StartSound("biospark/spark",CHAN_VOICE,CHANF_LOOP);
let h = Spawn("BiosparkHitbox",pos);
h.target = self;
if ( bMISSILEMORE ) A_SparkTick(); // potential for arcs to hit shooter if overloaded
if ( MissileChanceMult <= .5 ) A_SparkTick(); // potential for arcs to hit shooter if overloaded
}
void A_SparkTick()
{
@ -470,7 +470,7 @@ Class BiosparkBall : Actor
magvel *= 1.03;
if ( magvel > 50. ) magvel = 50.;
Vector3 dir = vel.unit();
if ( bMISSILEMORE )
if ( MissileChanceMult <= .5 )
dir = (dir+SWWMUtility.Vec3FromAngles(FRandom[Sparkster](0,360),FRandom[Sparkster](-90,90))*FRandom[Sparkster](.006,.012)).unit();
// check targets at an interval, to save on performance
if ( !(special2%5) )
@ -905,8 +905,7 @@ Class BiosparkComboImpact : SWWMNonInteractiveActor
s.target = target;
s.angle = ang;
s.pitch = pt;
s.bMISSILEMORE = true;
s.bMISSILEEVENMORE = true;
s.MissileChanceMult = .125;
}
}
Spawn("BiosparkExplLight2",pos);
@ -1089,9 +1088,9 @@ Class BiosparkBeam : SWWMNonInteractiveActor
dir = (dir+mul*dirto*(clamp(1.-(dist/500.),0.,1.)**4.)).unit();
}
}
if ( bMISSILEEVENMORE )
if ( MissileChanceMult <= .125 )
dir = (dir+SWWMUtility.Vec3FromAngles(FRandom[Sparkster](0,360),FRandom[Sparkster](-90,90))*FRandom[Sparkster](.8,.16)).unit();
else if ( bMISSILEMORE )
else if ( MissileChanceMult <= .5 )
dir = (dir+SWWMUtility.Vec3FromAngles(FRandom[Sparkster](0,360),FRandom[Sparkster](-90,90))*FRandom[Sparkster](.02,.04)).unit();
nextdir = dir;
}
@ -1107,7 +1106,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor
int numpt = Random[Sparkster](-1,3);
for ( int i=0; i<numpt; i++ )
{
let a = Spawn("BiosparkArc",level.Vec3Offset(pos,tdir*FRandom[Sparkster]((frame||bMISSILEMORE)?0:.3,1)));
let a = Spawn("BiosparkArc",level.Vec3Offset(pos,tdir*FRandom[Sparkster]((frame||(MissileChanceMult<=.5))?0:.3,1)));
a.angle = angle;
a.pitch = pitch;
a.target = target;
@ -1116,7 +1115,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor
numpt = Random[Sparkster](1,3);
for ( int i=0; i<numpt; i++ )
{
let a = Spawn("BiosparkArcSmall",level.Vec3Offset(pos,tdir*FRandom[Sparkster]((frame||bMISSILEMORE)?0:.3,1)));
let a = Spawn("BiosparkArcSmall",level.Vec3Offset(pos,tdir*FRandom[Sparkster]((frame||(MissileChanceMult<=.5))?0:.3,1)));
a.angle = angle;
a.pitch = pitch;
a.target = target;
@ -1148,8 +1147,7 @@ Class BiosparkBeam : SWWMNonInteractiveActor
b.pitch = asin(-nextdir.z);
b.target = target;
b.special1 = special1+1;
b.bMISSILEMORE = bMISSILEMORE;
b.bMISSILEEVENMORE = bMISSILEEVENMORE;
b.MissileChanceMult = MissileChanceMult;
}
void A_Fade()
@ -1572,7 +1570,7 @@ Class BiosparkCore : Actor
s.angle = atan2(dir.y,dir.x);
s.pitch = asin(-dir.z);
s.special1 = special1;
s.bMISSILEMORE = bMISSILEMORE;
s.MissileChanceMult = MissileChanceMult;
}
void A_SparkExplode()
{