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

@ -22,7 +22,6 @@ Class Demolitionist : PlayerPawn
int dashlockst;
bool fullfuel;
bool sendtoground;
bool key_reentrant;
bool bInDefaultInventory;
bool oldsinglefirst;
@ -329,9 +328,8 @@ Class Demolitionist : PlayerPawn
tbox[1] = pos.y-(radius+8);
tbox[2] = pos.x-(radius+8);
tbox[3] = pos.x+(radius+8);
while ( bl.Next() )
foreach( l,p,f:bl )
{
Line l = bl.CurLine;
if ( !l ) continue;
if ( tbox[2] > l.bbox[3] ) continue;
if ( tbox[3] < l.bbox[2] ) continue;

View file

@ -83,10 +83,7 @@ extend Class Demolitionist
continue;
let item = Inventory(Spawn(rep));
SWWMHandler.KeyTagFix(item);
if ( item is 'SWWMKey' ) SWWMKey(item).propagated = true; // no anim
key_reentrant = true;
if ( !item.CallTryPickup(self) ) item.Destroy();
key_reentrant = false;
}
}
void CheatGive_Weapons()

View file

@ -64,6 +64,14 @@ extend Class Demolitionist
Super.RemoveInventory(item);
}
// skull keys, random chance of "alas poor yorick" line
private clearscope bool IsSkullKey( Inventory item )
{
String cname = item.GetClassName();
cname.MakeLower();
return (cname.IndexOf("skull") != -1);
}
override void AddInventory( Inventory item )
{
Super.AddInventory(item);
@ -91,7 +99,7 @@ extend Class Demolitionist
facegrin = true;
}
}
if ( (item is 'Key') && !key_reentrant && !deathmatch && !bInDefaultInventory )
if ( (item is 'Key') && !ingivecheat && !deathmatch && !bInDefaultInventory )
{
// score
int score = 100;
@ -99,29 +107,13 @@ extend Class Demolitionist
else Console.Printf(StringTable.Localize("$SWWM_FINDKEYREM"),player.GetUserName(),item.GetTag(),score);
SWWMCredits.Give(player,score);
if ( player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(100,self);
if ( !ingivecheat )
if ( !Random[DemoLines](0,5) && IsSkullKey(item) )
{
if ( !Random[DemoLines](0,5) &&
((item.GetClass() == 'RedSkull') || (item.GetClass() == 'YellowSkull')
|| (item.GetClass() == 'BlueSkull') || (item.GetClassName() == "PurpleSkull")) )
{
if ( !SWWMHandler.AddOneliner("skullget",2) )
SWWMHandler.AddOneliner("keyget",2);
}
else SWWMHandler.AddOneliner("keyget",2);
facegrin = true;
}
// share all keys in mp
for ( int i=0; i<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !players[i].mo || (i == PlayerNumber()) )
continue;
if ( players[i].mo is 'Demolitionist' ) Demolitionist(players[i].mo).key_reentrant = true;
let tkey = Inventory(Spawn(item.GetClass()));
SWWMHandler.KeyTagFix(tkey);
if ( !tkey.CallTryPickup(players[i].mo) ) tkey.Destroy();
if ( players[i].mo is 'Demolitionist' ) Demolitionist(players[i].mo).key_reentrant = false;
if ( !SWWMHandler.AddOneliner("skullget",2) )
SWWMHandler.AddOneliner("keyget",2);
}
else SWWMHandler.AddOneliner("keyget",2);
facegrin = true;
}
// add collectible to stats
if ( item is 'SWWMCollectible' )

View file

@ -13,7 +13,7 @@ Class SayaCollar : SWWMArmor
+INVENTORY.UNCLEARABLE;
// SWWMArmor flags are not needed as this overrides AbsorbDamage directly
}
override void AbsorbDamage( int damage, Name damageType, out int newdamage, Actor inflictor, Actor source, int flags )
override void AbsorbDamage( int damage, Name damageType, int &newdamage, Actor inflictor, Actor source, int flags )
{
if ( (damage <= 0) || (flags&(DMG_FORCED|DMG_NO_ARMOR)) ) return;
newdamage = damage;
@ -30,7 +30,7 @@ Class SayaCollar : SWWMArmor
}
// for friendly fire handling, jammed into here
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 )
{
int ff = swwm_friendlyfire;
if ( !source || (source == Owner) || (source.player == Owner.player) || !source.IsFriend(Owner) || !ff ) return;

View file

@ -6,9 +6,8 @@ extend Class Demolitionist
if ( player.cmd.buttons&BT_USER3 )
{
let bt = BlockThingsIterator.Create(self,800);
while ( bt.Next() )
foreach ( i,p,f:bt )
{
let i = bt.Thing;
if ( !i ) continue;
if ( !(i is 'Inventory') && !(i is 'Chancebox') && !(i is 'SWWMRespawnTimer') ) continue;
if ( (i is 'Inventory') && (i.bINVISIBLE || !i.bSPECIAL || Inventory(i).Owner) ) continue;
@ -55,9 +54,8 @@ extend Class Demolitionist
if ( (magitem_cnt < 8) && !swwm_usetopickup )
{
let bt = BlockThingsIterator.Create(self,500);
while ( bt.Next() )
foreach ( t,p,f:bt )
{
let t = bt.Thing;
if ( !t ) continue;
if ( !(t is 'Inventory') || !t.bSPECIAL || !t.bDROPPED || t.bINVISIBLE || Inventory(t).Owner || !SWWMUtility.SphereIntersect(t,pos,500) || !CheckSight(t,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) )
continue;
@ -366,7 +364,7 @@ extend Class Demolitionist
if ( isdashing ) dashboost = 0.;
mystats.stompcount++;
}
if ( lastvelz < -10 )
if ( lastvelz < landingspeed )
A_StartSound("demolitionist/runstop",CHAN_FOOTSTEP,CHANF_OVERLAP);
if ( (lastvelz < -gruntspeed) && (swwm_mutevoice < 4) && (health > 0) )
{
@ -571,10 +569,9 @@ extend Class Demolitionist
double maxmass = max(mass*spd/40.,200);
if ( raging ) maxmass *= 2;
let bt = BlockThingsIterator.Create(self,spd+radius+1024);
while ( bt.Next() )
foreach( a,p,f:bt )
{
if ( spd <= 0 ) break; // if something stopped us, no more iteration
let a = bt.Thing;
if ( !a || (a == self) || (!a.bSOLID && !a.bSHOOTABLE) || a.bTHRUACTORS || a.bCORPSE || !CanCollideWith(a,false) || !a.CanCollideWith(self,true) ) continue;
if ( !SWWMUtility.ExtrudeIntersect(self,a,dir*(spd+radius),8) ) continue;
if ( (a.pos.z <= a.floorz) && (a.height <= MaxStepHeight) ) continue;