// Disabling should not instantly destroy all particles but let them fade out on their own.

//-----------------------------------------------------------
// Generic exhaust flame.
//-----------------------------------------------------------
class XS_Exhaust extends XS_Emitter;

#exec OBJ LOAD FILE="..\Textures\AW-2004Particles.utx"

var(Size)       float           Size;
var(Thrust)     float           MinThrust;

/** Thrust: Set the exhaust's size. */
simulated function SetSize(float NewSize)
{
    Size = NewSize;

    if(Emitters[0] != none)
    {
        Emitters[0].StartSizeRange.X *= Size;
    }
  // meowcat edit -> trying to access the emitters[1] variable was spamming the UT2004.log file
 //   if(Emitters[1] != none)
 //   {
 //       Emitters[1].StartSizeRange.X *= Size;
 //       Emitters[1].StartVelocityRange.X *= Size;
 //   }
}

/** Thrust: Set the exhaust's thrust. */
simulated function SetThrust(float Thrust)
{
    if(Thrust < MinThrust)
    {
        Thrust = 0;
    }

    UpdateEmitters(Thrust);
}

simulated function UpdateEmitters(float Thrust)
{
    if(Emitters[0] != none){
        Emitters[0].StartSizeRange.X = default.Emitters[0].StartSizeRange.X * Size * Thrust;
        Emitters[0].StartVelocityRange.X = default.Emitters[0].StartVelocityRange.X * Size * Thrust;
    }

//    if(Emitters[1] != none) // meowcat edit -> trying to access the emitters[1] variable was spamming the UT2004.log file
//       Emitters[1].StartSizeRange.X = default.Emitters[1].StartSizeRange.X * Size * Thrust;

//    if(Thrust >= 0.8 && Emitters[1] != none)
//    {
 //       Emitters[1].StartSizeRange.X *= 2;
 //   }
}

defaultproperties
{
     Size=1.000000
     MinThrust=0.010000
     Begin Object Class=SpriteEmitter Name=SE0
         UseAbsoluteTimeForSizeScale=true
         UseColorScale=True
         UseSizeScale=True
         UseRegularSizeScale=False
         UniformSize=True
         UseRandomSubdivision=True
         ColorScale(1)=(RelativeTime=0.125000,Color=(B=255,G=50,R=50))
         ColorScale(2)=(RelativeTime=0.400000,Color=(B=255,G=50,R=50))
         ColorScale(3)=(RelativeTime=1.000000)
         CoordinateSystem=PTCS_Relative
         MaxParticles=30
         StartSpinRange=(X=(Max=1.000000))
         SizeScale(0)=(RelativeSize=0.400000)
         SizeScale(1)=(RelativeTime=0.400000,RelativeSize=0.10000)
         StartSizeRange=(X=(Min=10.000000,Max=10.000000))
         ParticlesPerSecond=100.000000
         InitialParticlesPerSecond=100.000000
         Texture=Texture'AW-2004Particles.Weapons.SmokePanels1'
         TextureUSubdivisions=4
         TextureVSubdivisions=4
         LifetimeRange=(Min=0.200000,Max=0.200000)
         StartVelocityRange=(X=(Min=300.000000,Max=300.000000))
     End Object
     Emitters(0)=SpriteEmitter'SciFiPelican.XS_Exhaust.SE0'

     AutoDestroy=True
     CullDistance=20000.000000
     bNoDelete=False
     AmbientGlow=140
     bHardAttach=True
     RemoteRole=ROLE_None
}
