
gamevar numwalls 0 0
gamevar wallpoint 0 0
gamevar currwall 0 0

gamevar angvar1 0 0
gamevar angvar2 0 0
gamevar intensity 0 2
gamevar flicker 0 2

gamevar area 0 0
gamevar ONCE 0 0

gamevar WALLTEMP 0 0
gamevar WALLX 0 0
gamevar WALLY 0 0
gamevar WALLZ1 0 0
gamevar WALLZ2 0 0
gamevar X 0 0
gamevar Y 0 0
gamevar SMALLX 0 0
gamevar BIGX 0 0
gamevar SMALLY 0 0
gamevar BIGY 0 0


state paltoRGB
switch pal
case 0 case 3 case 12 case 13 case 5
setvar xvel 255 setvar yvel 255 setvar zvel 255 break
case 1 setvar xvel 0 setvar yvel 0 setvar zvel 255 break
case 2 setvar xvel 255 setvar yvel 0 setvar zvel 0 break
case 4 setvar xvel 0 setvar yvel 0 setvar zvel 0 break
case 6 setvar xvel 0 setvar yvel 192 setvar zvel 0 break
case 7 setvar xvel 160 setvar yvel 160 setvar zvel 0 break
case 8 setvar xvel 0 setvar yvel 255 setvar zvel 0 break
case 10 setvar xvel 128 setvar yvel 0 setvar zvel 0 break
case 14 setvar xvel 0 setvar yvel 128 setvar zvel 0 break
case 17 setvar xvel 128 setvar yvel 0 setvar zvel 128 break
case 23 setvar xvel 192 setvar yvel 192 setvar zvel 0 break
case 25 setvar xvel 192 setvar yvel 192 setvar zvel 255 break
default setvar xvel 128 setvar yvel 128 setvar zvel 255 break
endswitch

setactor[RETURN].xvel xvel // R value
setactor[RETURN].yvel yvel // G value
setactor[RETURN].zvel zvel // B value
ends

state genericlightsettings
ifactor APLAYER
{
	getplayer[THISACTOR].posz digz
	setactor[RETURN].z digz
}
setactor[RETURN].cstat tempd // 0=high priority, 2=lower, 512=lowest
setactor[RETURN].hitag intensity // light radius
setactor[RETURN].xrepeat 2
setactor[RETURN].yrepeat 2
setactorvar[RETURN].myspawner THISACTOR
getactor[THISACTOR].picnum picnum
setactorvar[RETURN].mtype picnum
setactor[RETURN].picnum SECTOREFFECTOR
changespritestat RETURN 3
ends

state spawnpointlight
espawn SMALLSMOKE
setactor[RETURN].lotag 49 // 49 is point light, 50 is spotlight
setactorvar[RETURN].lotag 49
state paltoRGB
state genericlightsettings
ends

state spawnspotlight
espawn SMALLSMOKE
setactor[RETURN].lotag 50 // 49 is point light, 50 is spotlight
setactorvar[RETURN].lotag 50
state paltoRGB
state genericlightsettings
setactor[RETURN].shade shade // this controls the width of the spotlight
setactor[RETURN].extra M // this controls the horiz of the spotlight
ends