// grenade (thrown by hand) script
// ------------------------------------------------------------------------
datablock EffectProfile(FlareBurnEffect)
{
   effectname = "weapons/plasma_rifle_projectile"; //Cantspel: had to change the other sound file didnt excist
   minDistance = 2.5;
   maxDistance = 2.5;
};

datablock AudioProfile(FlareGrenadeBurnSound)
{
   filename = "fx/weapons/plasma_rifle_projectile.wav"; //Cantspel: had to change the other sound file didnt excist
   description = ProjectileLooping3d;
   preload = true;
   effect = FlareBurnEffect; //Cantspel: added to make the sound actualy work
};

datablock AudioProfile(FlareGrenadeExplosionSound)
{
   filename = "fx/weapons/grenade_flare_burn.wav";
   description = CloseLooping3d;
   preload = true;
};

//--------------------------------------------------------------------------
// Particle effects
//--------------------------------------
datablock ParticleData(FlareParticle)
{
   dragCoeffiecient     = 0.0;
   gravityCoefficient   = 0.15;
   inheritedVelFactor   = 0.5;

   lifetimeMS           = 1800;
   lifetimeVarianceMS   = 200;

   textureName          = "special/flareSpark";

   colors[0]     = "1.0 1.0 1.0 1.0";
   colors[1]     = "1.0 1.0 1.0 1.0";
   colors[2]     = "1.0 1.0 1.0 0.0";

   sizes[0]      = 0.6;
   sizes[1]      = 0.3;
   sizes[2]      = 0.1;

   times[0]      = 0.0;
   times[1]      = 0.5;
   times[2]      = 1.0;

};

datablock ParticleEmitterData(FlareEmitter)
{
   ejectionPeriodMS = 10;
   periodVarianceMS = 0;

   ejectionVelocity = 1.0;
   velocityVariance = 0.0;

   thetaMin         = 0.0;
   thetaMax         = 90.0;

   orientParticles  = true;
   orientOnVelocity = false;

   particles = "FlareParticle";
};

//--------------------------------------------------------------------------
// Explosion - Flare Grenade
//--------------------------------------
datablock ExplosionData(FlareGrenadeExplosion)
{
   explosionShape = "energy_explosion.dts";
   soundProfile   = FlareGrenadeExplosionSound;
   faceViewer           = true;
   explosionScale = "0.1 0.1 0.1";
};

//--------------------------------------------------------------------------
// Projectile - Flare Grenade
//--------------------------------------
datablock FlareProjectileData(FlareGrenadeProj)
{
   projectileShapeName = "grenade_projectile.dts";
   emitterDelay        = -1;
   directDamage        = 0.0;
   hasDamageRadius     = false;
   kickBackStrength    = 1500;
   useLensFlare        = false; //Cantspel- lookes extreamly stupid "true"

   sound 			   = FlareGrenadeBurnSound; //Cantspel: See it had sound in the first place...
   explosion           = FlareGrenadeExplosion;
   velInheritFactor    = 0.5;

   texture[0]          = "special/flare3";
   texture[1]          = "special/LensFlare/flare00";
   size                = 4.0;

   baseEmitter         = FlareEmitter;

   grenadeElasticity = 0.35;
   grenadeFriction   = 0.2;
   armingDelayMS     = 8000; //Cantspel- longer lifetime was 6000
   muzzleVelocity    = 15.0;
   drag = 0.1;
   gravityMod = 0.15;
   lifetimeMS        = 8000; //Cantspel- Added to incress flare life time

   hasLight    = true; //Cantspel-its a flare... it should have light.
   lightRadius = 100.0; //Cantspel-big ass light radius
   lightColor  = "1.0 0.4 0.0 0.5"; //orange red color
};

datablock ItemData(FlareGrenadeThrown)
{
   shapeFile = "grenade.dts";
   mass = 0.7;
   elasticity = 0.2;
   friction = 1;
   pickupRadius = 2;
   maxDamage = 0.4;

   sticky = false;
   gravityMod = 0.15;
   maxVelocity = 13; //Cantspel-slightly incressed was 10

   computeCRC = true;

};

datablock ItemData(FlareGrenade)
{
   className = HandInventory;
   catagory = "Handheld";
   shapeFile = "grenade.dts";
   mass = 0.7;
   elasticity = 0.2;
   friction = 1;
   pickupRadius = 2;
   thrownItem = FlareGrenadeThrown;
	pickUpName = "some flare grenades";
	isGrenade = true;

   computeCRC = true;

};

//------------------------------------------------------------------------------
// Functions:
//------------------------------------------------------------------------------
function FlareGrenadeThrown::onCollision( %data, %obj, %col )
{
   // Do nothing...
}
   
