Healthbar / Damnum backport from sidemods.

This commit is contained in:
Mari the Deer 2022-08-22 17:36:57 +02:00
commit b40d8d0633
1743 changed files with 683 additions and 869 deletions

View file

@ -11,12 +11,12 @@ extend Class SWWMHandler
// for displaying beam-type projectiles
Array<Actor> beams;
// legendary monster markers (for the "has mutated" message)
Array<Inventory> legtrack;
override void WorldThingRevived( WorldEvent e )
{
if ( profiling ) ProfileTick();
// reattach combat tracker
if ( !swwm_notrack && (e.Thing.bSHOOTABLE || e.Thing.bISMONSTER) && !(e.Thing is 'LampMoth') && !(e.Thing is 'CompanionLamp') )
SWWMCombatTracker.Spawn(self,e.Thing,true);
// reattach headpats
if ( SWWMUtility.IdentifyingDog(e.Thing) || SWWMUtility.IdentifyingCaco(e.Thing)
|| SWWMUtility.IdentifyingDrug(e.Thing) || SWWMUtility.IdentifyingDoubleBoi(e.Thing) )
@ -275,6 +275,9 @@ extend Class SWWMHandler
p.target = e.Thing;
p.SetStateLabel("Pickup");
}
// for notification
if ( e.Thing.GetClassName() == "LDLegendaryMonsterTransformed" )
legtrack.Push(Inventory(e.Thing));
}
if ( swwm_doomfall && e.Thing.bISMONSTER && !e.Thing.bBOSS )
e.Thing.bFALLDAMAGE = true;
@ -396,9 +399,6 @@ extend Class SWWMHandler
let hp = Actor.Spawn("HeadpatTracker",e.Thing.pos);
hp.target = e.Thing;
}
SWWMCombatTracker trk = null;
if ( !swwm_notrack && (e.Thing.bSHOOTABLE || e.Thing.bISMONSTER) && !(e.Thing is 'LampMoth') && !(e.Thing is 'CompanionLamp') )
trk = SWWMCombatTracker.Spawn(self,e.Thing);
if ( swwm_shadows && !(e.Thing is 'LampMoth') && (e.Thing.bSHOOTABLE || e.Thing.bISMONSTER || (e.Thing is 'Inventory') || (e.Thing is 'CompanionLamp')) && ((e.Thing is 'Demolitionist') || (e.Thing.SpawnState.sprite == e.Thing.GetSpriteIndex('XZW1'))) )
SWWMShadow.Track(e.Thing);
// Ynykron vortex optimization (faster than a thinker iterator)
@ -427,13 +427,7 @@ extend Class SWWMHandler
}
else if ( e.Thing.GetClass() == "LostSoul" )
e.Thing.bNOBLOOD = true;
VanillaBossSpawn(e,trk);
// inflation check
if ( trk )
{
trk.maxhealth = trk.lasthealth = e.Thing.Health;
trk.intp.Reset(trk.lasthealth);
}
VanillaBossSpawn(e);
if ( profiling ) ProfileTock(PT_WORLDTHINGSPAWNED);
}
}