gzdoom/wadsrc/static/zscript/shared/dynlights.txt

244 lines
3.2 KiB
Text
Raw Normal View History

2016-11-15 12:37:56 +00:00
class DynamicLight : Actor native
{
enum EArgs
{
LIGHT_RED = 0,
LIGHT_GREEN = 1,
LIGHT_BLUE = 2,
LIGHT_INTENSITY = 3,
LIGHT_SECONDARY_INTENSITY = 4,
LIGHT_SCALE = 3,
};
enum ELightType
{
PointLight,
PulseLight,
FlickerLight,
RandomFlickerLight,
SectorLight,
SpotLight,
ColorPulseLight,
ColorFlickerLight,
RandomColorFlickerLight
};
2016-11-15 12:37:56 +00:00
Default
{
Height 0;
Radius 0.1;
FloatBobPhase 0;
RenderRadius -1;
2016-11-15 12:37:56 +00:00
+NOBLOCKMAP
+NOGRAVITY
+FIXMAPTHINGPOS
+INVISIBLE
}
}
class PointLight : DynamicLight
{
Default
{
DynamicLight.Type "Point";
}
}
class PointLightPulse : PointLight
{
Default
{
DynamicLight.Type "Pulse";
}
}
class PointLightFlicker : PointLight
{
Default
{
DynamicLight.Type "Flicker";
}
}
class SectorPointLight : PointLight
{
Default
{
DynamicLight.Type "Sector";
}
}
class PointLightFlickerRandom : PointLight
{
Default
{
DynamicLight.Type "RandomFlicker";
}
}
// DYNAMICLIGHT.ADDITIVE and DYNAMICLIGHT.SUBTRACTIVE are used by the lights for additive and subtractive lights
2016-11-15 12:37:56 +00:00
class PointLightAdditive : PointLight
{
Default
{
+DYNAMICLIGHT.ADDITIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightPulseAdditive : PointLightPulse
{
Default
{
+DYNAMICLIGHT.ADDITIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightFlickerAdditive : PointLightFlicker
{
Default
{
+DYNAMICLIGHT.ADDITIVE
2016-11-15 12:37:56 +00:00
}
}
class SectorPointLightAdditive : SectorPointLight
{
Default
{
+DYNAMICLIGHT.ADDITIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightFlickerRandomAdditive :PointLightFlickerRandom
{
Default
{
+DYNAMICLIGHT.ADDITIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightSubtractive : PointLight
{
Default
{
+DYNAMICLIGHT.SUBTRACTIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightPulseSubtractive : PointLightPulse
{
Default
{
+DYNAMICLIGHT.SUBTRACTIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightFlickerSubtractive : PointLightFlicker
{
Default
{
+DYNAMICLIGHT.SUBTRACTIVE
2016-11-15 12:37:56 +00:00
}
}
class SectorPointLightSubtractive : SectorPointLight
{
Default
{
+DYNAMICLIGHT.SUBTRACTIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightFlickerRandomSubtractive : PointLightFlickerRandom
{
Default
{
+DYNAMICLIGHT.SUBTRACTIVE
2016-11-15 12:37:56 +00:00
}
}
class PointLightAttenuated : PointLight
2016-11-15 12:37:56 +00:00
{
Default
{
+DYNAMICLIGHT.ATTENUATE
2016-11-15 12:37:56 +00:00
}
}
class PointLightPulseAttenuated : PointLightPulse
2016-11-15 12:37:56 +00:00
{
Default
{
+DYNAMICLIGHT.ATTENUATE
2016-11-15 12:37:56 +00:00
}
}
class PointLightFlickerAttenuated : PointLightFlicker
2016-11-15 12:37:56 +00:00
{
Default
{
+DYNAMICLIGHT.ATTENUATE
2016-11-15 12:37:56 +00:00
}
}
class SectorPointLightAttenuated : SectorPointLight
{
Default
{
+DYNAMICLIGHT.ATTENUATE
}
}
class PointLightFlickerRandomAttenuated :PointLightFlickerRandom
{
Default
{
+DYNAMICLIGHT.ATTENUATE
}
}
class VavoomLight : DynamicLight
{
Default
{
DynamicLight.Type "Point";
}
override void BeginPlay ()
{
if (CurSector) AddZ(-CurSector.floorplane.ZatPoint(pos.XY), false); // z is absolute for Vavoom lights
Super.BeginPlay();
}
}
class VavoomLightWhite : VavoomLight
{
override void BeginPlay ()
{
args[LIGHT_INTENSITY] = args[0] * 4;
args[LIGHT_RED] = 128;
args[LIGHT_GREEN] = 128;
args[LIGHT_BLUE] = 128;
Super.BeginPlay();
}
}
class VavoomLightColor : VavoomLight
{
override void BeginPlay ()
{
int radius = args[0] * 4;
args[LIGHT_RED] = args[1] >> 1;
args[LIGHT_GREEN] = args[2] >> 1;
args[LIGHT_BLUE] = args[3] >> 1;
args[LIGHT_INTENSITY] = radius;
Super.BeginPlay();
}
}