Code: Select all
// caster_events.zs
class caster_EventHandler : EventHandler
{
Array<string> shadows;
Array<string> noshadows;
bool noshadow(string s)
{
if (noshadows.Size()==0)
{
noshadows.Push("Column");
noshadows.Push("BurningBarrel");
noshadows.Push("ExplosiveBarrel");
noshadows.Push("TechLamp");
noshadows.Push("TechLamp2");
noshadows.Push("TechPillar");
}
return (noshadows.Find(s) != noshadows.Size());
}
bool shadow(string s)
{
if (shadows.Size()==0)
{
shadows.Push("NonsolidMeat2");
shadows.Push("NonsolidMeat3");
shadows.Push("NonsolidMeat4");
shadows.Push("NonsolidMeat5");
shadows.Push("NonsolidTwitch");
shadows.Push("DoomPlayer");
}
return (shadows.Find(s) != shadows.Size());
}
override
void WorldThingSpawned(WorldEvent e)
{
string cn = e.thing.GetReplacee(e.thing.GetClassName()).GetClassName();
e.thing.bCastSpriteShadow = (e.thing.bSolid && CVar.GetCVar("cast_solid"))
|| (e.thing.bMissile && CVar.GetCVar("cast_missile"))
|| (e.thing.bCorpse && CVar.GetCVar("cast_corpse")) || shadow(cn) || !noshadow(cn);
}
}
Code: Select all
user bool cast_solid = true;
user bool cast_corpse = true;
user bool cast_missile = true;
Update 11/30/21
Spoiler: