class Fire_Speed extends InstantFire;

var pawn P;
var xEmitter xEmitter_Speed[2];
var(PclVisuals) color mColorRange[2];

var float kleur1,kleur2,kleur3;
var float ClickTime;
var float minc,maxc;
var bool bBoost;

function setColor()
{
minc = 0.0;
maxc = 255.0;
kleur1 = RandRange(minc,maxc);
kleur2 = RandRange(minc,maxc);
kleur3 = RandRange(minc,maxc);
}

function timer()
{
 local int i;
             Car_R(Instigator).GearRatios[4] = Car_R(Instigator).oldratio;
             if(xEmitter_Speed[i] != none)
             {
              for(i=0;i<2;i++)
             {
             xEmitter_Speed[i].mRegen = false;
             xEmitter_Speed[i].Destroy();
             }
             }
             PlayerController(Instigator.Controller).DesiredFOV = 90;
             Car_R(instigator).Inventory.Destroy();
}

event ModeDoFire()
{
  local int i;
  local vector tempV, tempVInverse, temp2;
  local rotator rot;

  if (bBoost)
  {
   SetTimer(6,false);
   bBoost=false;

   PlayerController(Instigator.Controller).DesiredFOV = 130;
   setColor();

   for(i=0;i<2;i++)
   {
    if ( (xEmitter_Speed[i]==none ) && (Level.DetailMode != DM_Low) && (!Level.bDropDetail ))
    {
    xEmitter_Speed[i] = Spawn(class'Trail_Speed',Instigator,, Instigator.Location, Instigator.Rotation);
    xEmitter_Speed[i].mColorRange[0].R = kleur1;
    xEmitter_Speed[i].mColorRange[0].G = kleur2;
    xEmitter_Speed[i].mColorRange[0].B = kleur3;
    xEmitter_Speed[i].mColorRange[1].R = kleur1;
    xEmitter_Speed[i].mColorRange[1].G = kleur2;
    xEmitter_Speed[i].mColorRange[1].B = kleur3;
    }
    }
    if (xEmitter_Speed[0] != None && xEmitter_Speed[1] != none)
    {
    Car_R(Instigator).AttachToBone(xEmitter_Speed[0], 'RRWheel');
    Car_R(Instigator).AttachToBone(xEmitter_Speed[1], 'LRWheel');
    }
    //Car_R(Instigator).AttachToBone(xEmitter_Speed[2], 'RFWheel');
    //Car_R(Instigator).AttachToBone(xEmitter_Speed[3], 'FLWheel');
  }
  temp2 = vect(0,0,0);
  tempv = vector(Car_R(Instigator).GetViewRotation());

  tempVInverse = tempV * -1;
  tempV.X*=67500;
  tempV.Y*=67500;
  tempV.Z=0;

  rot.pitch=rotator(tempv).pitch;
  rot.yaw=rotator(tempv).yaw;
  rot.pitch+=49332;

  Car_R(Instigator).Kaddimpulse(tempV,temp2);
  Car_R(Instigator).GearRatios[4] = Car_R(Instigator).maxratio;
  Super.ModeDoFire();
  }

defaultproperties
{
     bBoost=True
     FireForce="Fire_Speed"
     AmmoClass=Class'R.Ammo_Speed'
     AmmoPerFire=1

}
