/*

Dynamic RGBW Lights

This section was written by Cyborg.
http://www.dukeland.com/tcp
cyborg@dukeland.com

*/

define LIGHT 1631
define LIGHT_FAR 8192
define LIGHT_NEAR 1024
define INTENSITY_FAR 2
define INTENSITY_NEAR 16
useractor notenemy LIGHT 0

cstat 706

ifcansee
{
ifpdistl LIGHT_FAR
{
ifspritepal 0
	{ 
	palfrom INTENSITY_FAR 64 64 64
	sizeto 64 64
	}
ifspritepal 1
	{
	palfrom INTENSITY_FAR 0 0 64
	sizeto 64 64
	}
	ifspritepal 2
	{ 
	palfrom INTENSITY_FAR 64 0 0
	sizeto 64 64
	}
	ifspritepal 8
	{ 
	palfrom INTENSITY_FAR 0 64 0
	sizeto 64 64
	}
}
else sizeat 1 1
ifpdistl LIGHT_NEAR
{
ifspritepal 0
	{ 
	palfrom INTENSITY_NEAR 64 64 64
	sizeto 64 64
	}
ifspritepal 1
	{
	palfrom INTENSITY_NEAR 0 0 64
	sizeto 64 64
	}
        ifspritepal 2
	{ 
	palfrom INTENSITY_NEAR 64 0 0
	sizeto 64 64
	}
	ifspritepal 8
	{ 
	palfrom INTENSITY_NEAR 0 64 0
	sizeto 64 64
	}
}
}
enda
