Updates for GZDoom 4.12, part 1 (new functions, variables, flags, etc.).

This commit is contained in:
Mari the Deer 2024-04-22 14:34:22 +02:00
commit f38db38751
79 changed files with 349 additions and 183 deletions

View file

@ -885,7 +885,7 @@ Class SWWMDualWeaponGiver : Inventory
return false;
}
override bool TryPickup( in out Actor toucher )
override bool TryPickup( Actor &toucher )
{
if ( giveme[0].HasSwapWeapon(toucher) )
return false;

View file

@ -42,7 +42,7 @@ Class ParriedBuff : Inventory
s.SetShade(Color(4,2,1)*Random[Ponch](32,63));
}
}
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
override void ModifyDamage( int damage, Name damageType, int &newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
// increase blast damage (way too tiny normally for lost souls)
if ( Owner.bBLASTED && (damageType == 'Melee') && !inflictor && !source )
@ -66,7 +66,7 @@ Class ParryDamageChecker : Inventory
Inventory.MaxAmount 1;
}
override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags )
override void ModifyDamage( int damage, Name damageType, int &newdamage, bool passive, Actor inflictor, Actor source, int flags )
{
Inventory buff;
if ( inflictor && (buff=inflictor.FindInventory("ParriedBuff")) )

View file

@ -16,8 +16,8 @@ extend Class SWWMWeapon
Super.DoEffect();
// force custom crosshair
if ( swwm_precisecrosshair && (players[consoleplayer].Camera == players[consoleplayer].mo) && !(players[consoleplayer].cheats&CF_CHASECAM) )
crosshair = 99;
else crosshair = ShouldDrawCrosshair()?0:99;
crosshair = -1;
else crosshair = ShouldDrawCrosshair()?0:-1;
}
// where the trace is coming from relative to eyes

View file

@ -267,9 +267,8 @@ Class HellblazerMissile : Actor
}
// proximity check
let bt = BlockThingsIterator.Create(self,256);
while ( bt.Next() )
foreach ( t,p,v:bt )
{
let t = bt.Thing;
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || !SWWMUtility.SphereIntersect(t,level.Vec3Offset(pos,vel),bNOGRAVITY?50:90) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
deto++;
tracer = t;

View file

@ -273,7 +273,7 @@ Class EvisceratorChunk : Actor
A_HandleBounce();
lasthit = victim;
}
return 1;
return MHIT_PASS;
}
// with this we can guarantee that the chunk won't just keep on dealing damage
// this is something I wish Unreal's boulders did
@ -306,7 +306,7 @@ Class EvisceratorChunk : Actor
vel *= FRandom[Eviscerator](.8,.9); // reduce velocity as it rips
A_Gravity();
gravity = clamp(.35-vel.length()/200.,.15,.35);
return 1;
return MHIT_PASS;
}
// HACK
if ( !victim.bNOBLOOD && !victim.bDORMANT && !victim.bINVULNERABLE )
@ -321,7 +321,7 @@ Class EvisceratorChunk : Actor
A_HandleBounce();
lasthit = victim;
}
return 1;
return MHIT_PASS;
}
States
{

View file

@ -473,9 +473,8 @@ Class YnykronImpact : SWWMNonInteractiveActor
{
Vector2 disp = level.GetDisplacement(CurSector.PortalGroup,i);
bt = BlockThingsIterator.CreateFromPos(pos.x+disp.x,pos.y+disp.y,pos.z,rad,rad,false);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
if ( !t || !t.bSHOOTABLE || !SWWMUtility.SphereIntersect(t,pos,rad) || (!SWWMUtility.SphereIntersect(t,pos,100) && !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) ) continue;
if ( YnykronShot(master) && (YnykronShot(master).hitlist.Find(t) < YnykronShot(master).hitlist.Size()) )
continue;

View file

@ -193,9 +193,8 @@ Class BigBiospark : Actor
{
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,8000);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
double dist;
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || ((dist=Distance3DSquared(t)) > 64000000) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
Vector3 dirto = level.Vec3Diff(pos,t.Vec3Offset(0,0,t.height/2)).unit();
@ -231,9 +230,8 @@ Class BigBiospark : Actor
{
Vector2 disp = level.GetDisplacement(CurSector.PortalGroup,i);
bt = BlockThingsIterator.CreateFromPos(pos.x+disp.x,pos.y+disp.y,pos.z,120,120,false);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
if ( !t || !t.bSHOOTABLE || !SWWMUtility.SphereIntersect(t,pos,120) ) continue;
if ( hitlist.Find(t) >= hitlist.Size() )
hitlist.Push(t);
@ -479,9 +477,8 @@ Class BiosparkBall : Actor
{
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,8000);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
double dist;
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)) || ((dist=Distance3DSquared(t)) > 250000) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
Vector3 dirto = level.Vec3Diff(pos,t.Vec3Offset(0,0,t.height/2)).unit();
@ -512,9 +509,8 @@ Class BiosparkBall : Actor
}
// proximity check
let bt = BlockThingsIterator.Create(self,256);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
if ( !t || !t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain')) || (t.Health <= 0) || (target && t.IsFriend(target)) || !SWWMUtility.SphereIntersect(t,level.Vec3Offset(pos,vel),16) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
deto++;
break;
@ -1071,9 +1067,8 @@ Class BiosparkBeam : SWWMNonInteractiveActor
nextpos = t.Results.HitPos;
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,500);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
double dist;
if ( !t || (!(t is 'BiosparkHitbox') && (!t.bSHOOTABLE || (!t.bISMONSTER && !(t is 'BossBrain') && !t.player) || (t.Health <= 0) || (target && t.IsFriend(target)))) || ((dist=Distance3DSquared(t)) > 250000) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
Vector3 dirto = level.Vec3Diff(nextpos,t.Vec3Offset(0,0,t.height/2));
@ -1379,7 +1374,7 @@ Class BiosparkArc : SWWMNonInteractiveActor
{
double closest = double.infinity;
let bt = BlockThingsIterator.Create(self,1500);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
double dist;

View file

@ -246,9 +246,8 @@ Class ExplodiumMagHitbox : Actor
}
SetOrigin(target.Vec3Offset(0,0,-height*.5),false);
let bt = BlockThingsIterator.Create(self,256);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
if ( !t || (t == self) || !t.bSHOOTABLE || (t == target.target) || t.IsFriend(target.target) || !SWWMUtility.BoxIntersect(self,t) )
continue;
target.bKILLED = true;
@ -298,8 +297,8 @@ Class ExplodiumMagAttach : ExplodiumMagProj
override int SpecialMissileHit( Actor victim )
{
if ( victim is 'ExplodiumMagHitbox' ) return 1;
return -1;
if ( victim is 'ExplodiumMagHitbox' ) return MHIT_PASS;
return MHIT_DEFAULT;
}
override void Tick()
{