// TE_LIGHTNING2 replacement, (c) 2005 TimeServ
// If you steal this GPLed code you will be violating several international laws
// as well as several laws of physics.
r_part tlightningflash
{
	spawntime 0.1
	spawnchance 0.1
	die 0.25
	type beam
	alpha 1
	step 80
	scale 14
	scaledelta -52
	rgb 255 255 255
	spawnmode distball
	spawnorg 16
	spawnparam1 0.5
	averageout
	nospreadfirst
	blend add
}

r_part tlightningglow
{
	step 50
	scale 35
	scalefactor 1
	alpha 1
	die 0
	rgb 1 1 8
	blend add
	assoc tlightningflash
}

r_part tlightningfade
{
	spawntime 0.05
	die 0.2
	type beam
	alpha 2
	step 96
	scale 1.5
	rgb 16 16 64
	spawnmode distball
	spawnorg 9
	spawnparam1 0.9
	blend add
	averageout
	nospreadfirst
	assoc tlightningglow
}

r_part te_lightning2
{
	die 0
	type beam
	alpha 2
	step 96
	scale 4
	rgb 196 196 255
	spawnmode distball
	spawnorg 9
	spawnparam1 0.9
	blend add
	averageout
	nospreadfirst
	assoc tlightningfade
}

r_part lbolttrail
{
	die 0.5
	type beam
	alpha 2
	step 32
	scale 1
	rgb 196 196 255
	rgbdelta -512 -512 -128
	spawnmode distball
	spawnorg 5
	spawnvel 4
	spawnparam1 0.5
	blend add
}

r_part lbolt
{
	die 0.5
	count 1
	spawnmode circle
	spawnvel 2000
	spawnorg 1
	emit lbolttrail
	emitinterval -1
}

r_part lemit
{
	die 0.1
	count 1
	spawnchance 1
	emit lbolt
	emitinterval 100
	spawnchance 0.1
	cliptype lemit
	clipcount 1
	clipbounce 0
}

r_part lflash
{
	die 0.1
	texture "particles/lflash"
	count 1
	alpha 1
	scale 100
	scalefactor 1
	scaledelta -500
	rgb 255 255 255
	blend add
	assoc lemit
}

r_part te_lightning2_end
{
	die 0.3
	alpha 1
	count 8
	scale 2
	rgb 128 128 255
	rgbrand 63 63 0
	rgbrandsync 1
	spawnvel 100
	spawnorg 5
	blend add
	assoc lflash
}