//--------------------------------------------------------------------------
// Flash Light
// Item that just lights up the dark
//--------------------------------------------------------------------------

//--------------------------------------
// Projectile
//--------------------------------------
datablock TargetProjectileData(BasicLightBeam)
{
   directDamage        	= 0.0;
   hasDamageRadius     	= false;
   indirectDamage      	= 0.0;
   damageRadius        	= 0.0;
   velInheritFactor    	= 1.0;

   maxRifleRange       	= 120;
   beamColor           	= "1.0 1.0 0.75";
								
   startBeamWidth	= 0.0;
   pulseBeamWidth 	= 0.0;
   beamFlareAngle 	= 0.0;
   minFlareSize        	= 0.0;
   maxFlareSize        	= 0.0;
   pulseSpeed          	= 0.0;
   pulseLength         	= 0.0;

   textureName[0]      	= "special/nonlingradient";
   textureName[1]      	= "special/ELFBeam";
   textureName[2]      	= "special/ELFLightning";
   textureName[3]      	= "special/droplet";

   hasLight    = true;
   lightRadius = 6.5;
   lightColor  = "1.0 1.0 0.75 0.4";

   beacon = false;
};

//--------------------------------------
// Rifle and item...
//--------------------------------------
datablock ItemData(FlashLight)
{
   className    = Weapon;
   catagory     = "Spawn Items";

   shapeFile    = "weapon_targeting.dts";

   image        = FlashLightImage;
   mass         = 1;

   elasticity   = 0.2;
   friction     = 0.6;

   pickupRadius = 2;
   pickUpName = "a flashlight";

   computeCRC = true;
};

datablock ShapeBaseImageData(FlashLightImage)
{
   className = WeaponImage;

   shapeFile = "weapon_targeting.dts";

   item = TargetingLaser;
   offset = "0 0 0";

   projectile = BasicLightBeam;
   projectileType = TargetProjectile;
   deleteLastProjectile = true;

   usesEnergy = true;
   minEnergy = 1;

   stateName[0]                     = "Activate";
   stateSequence[0]                 = "Activate";
   stateSound[0]                    = TargetingLaserSwitchSound;
   stateTimeoutValue[0]             = 0.5;
   stateTransitionOnTimeout[0]      = "ActivateReady";

   stateName[1]                     = "ActivateReady";
   stateTransitionOnAmmo[1]         = "Ready";
   stateTransitionOnNoAmmo[1]       = "NoAmmo";

   stateName[2]                     = "Ready";
   stateTransitionOnNoAmmo[2]       = "NoAmmo";
   stateTransitionOnTriggerDown[2]  = "Fire";

   stateName[3]                     = "Fire";
   stateEnergyDrain[3]              = 1;
   stateFire[3]                     = true;
   stateAllowImageChange[3]         = false;
   stateScript[3]                   = "onFire";
   stateTransitionOnTriggerUp[3]    = "Deconstruction";
   stateTransitionOnNoAmmo[3]       = "Deconstruction";

   stateName[4]                     = "NoAmmo";
   stateTransitionOnAmmo[4]         = "Ready";

   stateName[5]                     = "Deconstruction";
   stateScript[5]                   = "deconstruct";
   stateTransitionOnTimeout[5]      = "Ready";
};