//Energy Supply Script

// This script is hereby released under GPL v. 2 or later by Wolfe Games, 2008
// All contents were created by Wolfe Games.

// This Include is absolutely VITAL.  
// You must call it FIRST.  PERIOD.
// Don't say I didn't warn you ;-)
#include "STANDARD_COMMANDS_WORLDBUILDER.h"


//Explode Points
piece center, explode_point01, explode_point02, explode_point03, explode_point04, explode_point05, explode_point06, explode_point07, explode_point08;

piece base, body, spine01, spine02, spine03, spine04, spine05, spine06, spine07, spine08, spine09, light, fire;

#define CHICKEN_FLAMER_HIT_FX 1024+10
#define SMALLBUILDING_DUST_FX 1024+11

lua_CreateLightMe(arg) { return (0); }
lua_DestroyLightMe(arg) { return (0); }

lights()
{
	var randomWait;
	randomWait = rand(60,120);
	while(TRUE)
	{
		randomWait = rand(60,120);
		emit-sfx CHICKEN_FLAMER_HIT_FX from fire;
		call-script lua_CreateLightMe(light, 255, randomWait, 0, randomWait);		
		sleep randomWait;		
	}
}

Create()
{
	var RandomTurn;
	RandomTurn = rand(0,359);
	turn base to y-axis <1>*RandomTurn now;	
	start-script lights();
}

Killed(a,b)
{
	emit-sfx SMALLBUILDING_DUST_FX from base;
	explode spine01 type FALL;	
	explode spine03 type FALL;
	explode spine04 type FALL;
	explode spine06 type FALL;
	explode spine07 type FALL;
	explode spine08 type FALL;				
	emit-sfx SMALLBUILDING_DUST_FX from base;
	return (0);
}