//test vaccume gun//
//HAHA!////////////
//////////////////
//explosion//////
datablock ParticleData(vaccume_trailParticle)
{
    dragCoefficient = 3;
    gravityCoefficient = -0.01;
    windCoefficient = 0;
    inheritedVelFactor = 1;
    constantAcceleration = -2;
    lifetimeMS = 3467;
    lifetimeVarianceMS = 1000;
    useInvAlpha = 0;
    spinRandomMin = -200;
    spinRandomMax = 750;
    textureName = "particleTest";
    times[0] = 0;
    times[1] = 0.5;
    times[2] = 1;
    colors[0] = "0.000000 0.000000 1.000000 0.200000";
    colors[1] = "0.000000 0.232000 0.000000 0.200000";
    colors[2] = "0.000000 0.248000 0.000000 0.000000";
    sizes[0] = 7;
    sizes[1] = 2.93548;
    sizes[2] = 0.903226;
};

datablock ParticleEmitterData(vaccume_trailEmitter)
{
    ejectionPeriodMS = 6;
    periodVarianceMS = 0;
    ejectionVelocity = 10;
    velocityVariance = 1;
    ejectionOffset =   10;
    thetaMin = 85;
    thetaMax = 85;
    phiReferenceVel = 360;
    phiVariance = 360;
    overrideAdvances = 0;
    orientParticles= 0;
    orientOnVelocity = 1;
    particles = "vaccume_trailParticle";
};

datablock ShockwaveData(suctionShockwave)
{
   width = 6.0;
   numSegments = 32;
   numVertSegments = 6;
   velocity = 10;
   acceleration = 20.0;
   lifetimeMS = 900;
   height = 3.0;
   verticalCurve = 2;
   is2D = false;

   texture[0] = "special/shockwave5";
   texture[1] = "special/gradient";
   texWrap = 6.0;

   times[0] = 0.0;
   times[1] = 0.5;
   times[2] = 1.0;

   colors[0] = "0 0 1 1";
   colors[1] = ".5 .5 1 .5";
   colors[2] = "0.4 0.4 1.0 0.0";

   mapToTerrain = false;
   orientToNormal = true;
   renderBottom = true;
};


datablock ExplosionData(vaccumeimplosion)
{
   soundProfile   = plasmaExplosionSound;

   shockwave = suctionShockwave;
   shockwaveOnTerrain = false;


   emitter[0] = vaccume_trailemitter;

};
//projectile////
datablock LinearFlareProjectileData(vaccume)
{
   projectileShapeName = "plasmabolt.dts";
   scale               = "2.0 2.0 2.0";
   faceViewer          = true;
   directDamage        = 0.0;
   hasDamageRadius     = true;
   indirectDamage      = 0;
   damageRadius        = 16;
   kickbackstrength    = -6000.0;

   explosion           = "vaccumeimplosion";
   splash              = PlasmaSplash;

   dryVelocity       = 350;
   wetVelocity       = 350;
   velInheritFactor  = 0.3;
   fizzleTimeMS      = 0;
   lifetimeMS        = 32;
   explodeOnDeath    = true;
   reflectOnWaterImpactAngle = 0.0;
   explodeOnWaterImpact      = true;
   deflectionOnWaterImpact   = 0.0;
   fizzleUnderwaterMS        = -1;

   //activateDelayMS = 100;
   activateDelayMS = -1;

   size[0]           = 0.2;
   size[1]           = 0.5;
   size[2]           = 0.1;


   numFlares         = 35;
   flareColor        = "1 0.75 0.25";
   flareModTexture   = "flaremod";
   flareBaseTexture  = "flarebase";

	sound        = PlasmaProjectileSound;
   fireSound    = PlasmaFireSound;
   wetFireSound = PlasmaFireWetSound;

   hasLight    = true;
   lightRadius = 8.0;
   lightColor  = "0 0 1";
};


//weapon///


datablock ShapeBaseImageData(vaccumegunImage)
{
   className = WeaponImage;
   shapeFile = "weapon_targeting.dts";
   item      = vaccumegun;
   usesenergy = true;

   projectile = vaccume;
   projectileType = linearflareprojectile;

   emap = true;



   //--------------------------------------
   stateName[0]             = "Activate";
   stateSequence[0]         = "Activate";
   stateSound[0]            = ChaingunSwitchSound;
   stateAllowImageChange[0] = false;
   //
   stateTimeoutValue[0]        = 0.5;
   stateTransitionOnTimeout[0] = "Ready";
   stateTransitionOnNoAmmo[0]  = "NoAmmo";

   //--------------------------------------
   stateName[1]       = "Ready";
   //
   stateTransitionOnTriggerDown[1] = "Spinup";
   stateTransitionOnNoAmmo[1]      = "NoAmmo";

   //--------------------------------------
   stateName[2]               = "NoAmmo";
   stateTransitionOnAmmo[2]   = "Ready";
   stateTransitionOnTriggerDown[2] = "DryFire";

   //--------------------------------------
   stateName[3]         = "Spinup";
   stateSound[3]        = TargetingLaserPaintSound;
   //
   stateTimeoutValue[3]          = 0.5;
   stateWaitForTimeout[3]        = false;
   stateTransitionOnTimeout[3]   = "Fire";
   stateTransitionOnTriggerUp[3] = "Spindown";

   //--------------------------------------
   stateName[4]             = "Fire";
   stateSequence[4]            = "Fire";
   stateSequenceRandomFlash[4] = true;
   stateSound[4]            = PlasmaFireSound;
   //stateRecoil[4]           = LightRecoil;
   stateAllowImageChange[4] = false;
   stateScript[4]           = "onFire";
   stateFire[4]             = true;
   //
   stateTimeoutValue[4]          = 0.05;
   stateTransitionOnTimeout[4]   = "Fire";
   stateTransitionOnTriggerUp[4] = "Spindown";
   stateTransitionOnNoAmmo[4]    = "EmptySpindown";

   //--------------------------------------
   stateName[5]       = "Spindown";
   stateSound[5]      = ChaingunSpinDownSound;
   //
   stateTimeoutValue[5]            = 1.0;
   stateWaitForTimeout[5]          = true;
   stateTransitionOnTimeout[5]     = "Ready";
   stateTransitionOnTriggerDown[5] = "Spinup";

   //--------------------------------------
   stateName[6]       = "EmptySpindown";
   stateSound[6]      = ChaingunSpinDownSound;
   //
   stateTimeoutValue[6]        = 0.5;
   stateTransitionOnTimeout[6] = "NoAmmo";

   //--------------------------------------
   stateName[7]       = "DryFire";
   stateSound[7]      = ChaingunDryFireSound;
   stateTimeoutValue[7]        = 0.5;
   stateTransitionOnTimeout[7] = "NoAmmo";
};

//item//
datablock ItemData(vaccumegun)
{
   className    = Weapon;
   catagory     = "Spawn Items";
   shapeFile    = "weapon_targeting.dts";
   image        = vaccumegunImage;
   mass         = 1;
   elasticity   = 0.2;
   friction     = 0.6;
   pickupRadius = 2;
   pickUpName   = "a Vaccume Gun";

   computeCRC = true;
   emap = true;
};
vaccume.kickbackstrength = -6000;

function Vaccumegunimage::onMount(%this,%obj,%slot)
{
   Parent::onMount(%this, %obj, %slot);
   CommandToClient(%obj.client, 'BottomPrint', "You are now using the Doom Vaccume Gun", 4, 2 );
   %obj.mountImage(vaccumegunimage, 0);
}
