;------------------------------------------------------------------------------
Object AmericaVehicleHumvee

  ; *** ART Parameters ***
  SelectPortrait         = SAHummer_L
  ButtonImage            = SAHummer
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaTOWMissile
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaHellfireDrone
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = AVH2
      Turret = Turret
      ShowSubObject = Turret
      HideSubObject = TurretUp01 Housecolor03 MuzzleFXUP01
      WeaponFireFXBone = PRIMARY Muzzle
      WeaponMuzzleFlash = PRIMARY MuzzleFX
    End

    ConditionState = REALLYDAMAGED
      Model = AVH2D
      Turret = Turret
      ShowSubObject = Turret
      HideSubObject = TurretUp01 Housecolor03 MuzzleFXUP01
      WeaponFireFXBone = PRIMARY Muzzle
      WeaponMuzzleFlash = PRIMARY MuzzleFX
    End

    ConditionState = WEAPONSET_PLAYER_UPGRADE
      Model = AVHUMMER
      Turret = TurretUp01
      HideSubObject = Turret MuzzleFX01
      ShowSubObject = TurretUp01 Housecolor03
      WeaponFireFXBone = PRIMARY MuzzleUp
      WeaponMuzzleFlash = PRIMARY MuzzleFXUp
      WeaponFireFXBone = SECONDARY WeaponB
      WeaponLaunchBone = SECONDARY WeaponB
      WeaponFireFXBone = TERTIARY WeaponB
      WeaponLaunchBone = TERTIARY WeaponB
    End

    ConditionState = REALLYDAMAGED WEAPONSET_PLAYER_UPGRADE
      Model = AVHUMMER_d
      Turret = TurretUp01
      HideSubObject = Turret MuzzleFX01
      ShowSubObject = TurretUp01 Housecolor03
      WeaponFireFXBone = PRIMARY MuzzleUp
      WeaponMuzzleFlash = PRIMARY MuzzleFXUp
      WeaponFireFXBone = SECONDARY WeaponB
      WeaponLaunchBone = SECONDARY WeaponB
      WeaponFireFXBone = TERTIARY WeaponB
      WeaponLaunchBone = TERTIARY WeaponB
    End

    TrackMarks = EXTireTrack.tga

    Dust = RocketBuggyDust
    DirtSpray = RocketBuggyDirtSpray
    PowerslideSpray = RocketBuggyDirtPowerSlide

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.
    LeftFrontTireBone = Tire01
    RightFrontTireBone = Tire02
    LeftRearTireBone = Tire03
    RightRearTireBone = Tire04
    TireRotationMultiplier = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition = 1.25   ; This speed is added to the rotation speed when powersliding.

  End

  ; ***DESIGN parameters ***
  DisplayName           = OBJECT:Humvee
  Side                  = America
  EditorSorting         = VEHICLE
  TransportSlotCount    = 2                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY HumveeGun
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE 
    Weapon = PRIMARY HumveeGun
    Weapon = SECONDARY HumveeMissileWeapon
    Weapon = TERTIARY HumveeMissileWeaponAir
    PreferredAgainst = TERTIARY     AIRCRAFT
  End
  ArmorSet
    Conditions      = None
    Armor           = HumveeArmor
    DamageFX        = TruckDamageFX
  End
  BuildCost       = 700
  BuildTime       = 10.0          ;in seconds    
  VisionRange     = 150
  ShroudClearingRange = 320
  Prerequisites
    Object = AmericaWarFactory
  End
  ExperienceValue = 50 50 100 150   ;Experience point value at each level
  ExperienceRequired = 0 100 150 300  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrusherLevel           = 1  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaVehicleHumveeCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = HumveeVoiceSelect
  VoiceMove = HumveeVoiceMove
  VoiceGuard = HumveeVoiceMove
  VoiceAttack = HumveeVoiceAttack
  VoiceAttackAir = HumveeVoiceAttackTOW
  SoundMoveStart = HumveeMoveStart
  SoundMoveStartDamaged = HumveeMoveStart
  ;SoundAmbient           = IdleVehicleLoop
  ;SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingVehicleLoop  ; only when not idle
   ;SoundAmbient           = IdleVehicleLoop
  SoundEnter = HumveeEnter
  SoundExit = HumveeExit

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    ;TurretMoveStart    = NoSound
    VoiceCreate         = HumveeVoiceCreate
    TurretMoveLoop      = TurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = HumveeVoiceCrush
  ; Required for the W3DTruckDraw module
    TruckLandingSound = RocketBuggyLand
    TruckPowerslideSound = RocketBuggyPowerslide
    VoiceUnload = HumveeVoiceUnload
    VoiceEnter = HumveeVoiceMove
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE TRANSPORT 

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 220.0
    InitialHealth   = 220.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 480
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = TransportAIUpdate ModuleTag_03
    Turret
      TurretTurnRate = 180
      RecenterTime = 5000   ; how long to wait during idle before recentering
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
    MoodAttackCheckRate        = 250
  End

  Locomotor = SET_NORMAL HumveeLocomotor

  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End

  Behavior = TransportContain  ModuleTag_05
    PassengersAllowedToFire = Yes
    Slots             = 5
;    EnterSound          = GarrisonEnter
;    ExitSound           = GarrisonExit
    DamagePercentToUnits = 100% ;10%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End

  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_07
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_14
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End

  Behavior = ProductionUpdate ModuleTag_08
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = WeaponSetUpgrade ModuleTag_09
    TriggeredBy = Upgrade_AmericaTOWMissile
  End
  Behavior = ExperienceScalarUpgrade ModuleTag_10
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = SlowDeathBehavior ModuleTag_11
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 25
    DestructionDelay = 1
    OCL = INITIAL  OCL_InitialHumveeDebris
    FX  = FINAL    FX_BattleMasterExplosionOneFinal
    OCL = FINAL    OCL_FinalHumveeDebris
  End

  Behavior = DestroyDie ModuleTag_12
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateCrateDie ModuleTag_CratesChange
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection01
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_16
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
  End

  Behavior = TransitionDamageFX ModuleTag_17
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 14.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 11.5     
  GeometryIsSmall = Yes
  Scale = 0.91 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;----------------------------------------------------------
Object AmericaVehicleTomahawk

  ; *** ART Parameters ***
  SelectPortrait         = SAM270_L
  ButtonImage            = SAM270
  
  UpgradeCameo1 = Upgrade_AmericaScoutDrone
  UpgradeCameo2 = Upgrade_AmericaBattleDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaHellfireDrone
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTankDraw ModuleTag_01
    OkToChangeModelColor = Yes
      
    ;ProjectileBoneFeedbackEnabledSlots = PRIMARY ; WeaponLaunchBone will be shown/hidden, not just used for firing offset

      DefaultConditionState
      Model = AVM270
      Turret = TURRET
      TurretPitch = TURRETEL
      WeaponFireFXBone = PRIMARY WeaponA
      WeaponLaunchBone = PRIMARY WeaponA
      WeaponFireFXBone = SECONDARY WeaponA
      WeaponLaunchBone = SECONDARY WeaponA
      ;WeaponHideShowBone = PRIMARY MISSILE
  End

    ConditionState = REALLYDAMAGED
      Model = AVM270d
    End
    AliasConditionState = RUBBLE

    TrackMarks           = EXTnkTrack.tga

  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:MRLS
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  BuildCost       = 1200
  BuildTime       = 20.0          ;in seconds    
  VisionRange     = 180
  ShroudClearingRange = 200
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End
  ExperienceValue = 50 50 100 150    ;Experience point value at each level
  ExperienceRequired = 0 200 400 800  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY MRLSRocketBarrage
    Weapon = SECONDARY MRLSRocketBarrageAir
  PreferredAgainst     = SECONDARY     AIRCRAFT
  End
  ArmorSet
    Conditions      = None
    Armor           = TruckArmor
    DamageFX        = TankDamageFX
  End
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaVehicleTomahawkCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = AvengerVoiceMove
  VoiceMove = AvengerVoiceMove
  VoiceGuard = AvengerVoiceMove
  VoiceAttack = AvengerVoicePaint
  SoundMoveStart = TomahawkMoveStart
  SoundMoveStartDamaged = TomahawkMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate = TomahawkVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = OverlordTankTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = TomahawkVoiceCrush
    VoiceEnter = AvengerVoiceMove
    VoiceBombard = AvengerVoicePaint
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE DONT_AUTO_CRUSH_INFANTRY CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 200.0
    InitialHealth   = 200.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 360
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 60   ; turn rate, in degrees per sec
      TurretPitchRate = 60
      FirePitch = 70  ; Instead of aiming pitchwise at the target, it will aim here
      AllowsPitch = Yes
      ControlledWeaponSlots = PRIMARY SECONDARY
    End
    AutoAcquireEnemiesWhenIdle = No NotWhileAttacking
  End
  Locomotor = SET_NORMAL TomahawkLocomotor

  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT    OCL_QuadCannonDeathEffect
    FX =  FINAL FX_AmericaVehicleTomahawkDeathExplosion
  End

  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_07
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_15
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End

  Behavior = ProductionUpdate ModuleTag_08
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_09
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = DestroyDie ModuleTag_10
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_11
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_12
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

;  Behavior = FXListDie
;    DeathTypes = ALL -CRUSHED -SPLATTED
;    DeathFX = FX_GenericTankDeathEffect
;  End
; Behavior = CreateObjectDie
;    DeathTypes = ALL -CRUSHED -SPLATTED
;    CreationList = OCL_GenericTankDeathEffect
;  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection02
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_13
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
  End
  
  Behavior = TransitionDamageFX ModuleTag_14
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End
  
  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.9
  Shadow = SHADOW_VOLUME 
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length   

End

;------------------------------------------------------------------------------
; Also known as the Ambulance
Object AmericaVehicleMedic

  ; *** ART Parameters ***
  SelectPortrait         = SAAmbulance_L
  ButtonImage            = SAAmbulance
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTruckDraw ModuleTag_01

    ConditionState = NONE
      Model = AVAmbulance
      Turret = Turret
      TurretPitch = TurretEL
      WeaponFireFXBone = PRIMARY WeaponA
      WeaponLaunchBone = PRIMARY WeaponA
    End
    ConditionState       = REALLYDAMAGED
      Model              = AVAmbulance_D
      Turret = Turret
      TurretPitch = TurretEL
      WeaponFireFXBone = PRIMARY WeaponA
      WeaponLaunchBone = PRIMARY WeaponA
    End      
    
    ConditionState       = RUBBLE
      Model              = AVAmbulance_D
    End      
    
    TrackMarks = EXTireTrack.tga
    OkToChangeModelColor = Yes

    Dust = RocketBuggyDust
    DirtSpray = RocketBuggyDirtSpray
    PowerslideSpray = RocketBuggyDirtPowerSlide

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.
    LeftFrontTireBone = Tire01
    RightFrontTireBone = Tire02
    LeftRearTireBone = Tire03
    RightRearTireBone = Tire04
    TireRotationMultiplier = 0.2        ; this * speed = rotation.
    PowerslideRotationAddition = 2.5    ; This speed is added to the rotation speed when powersliding.


  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:Medic
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 2                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet 
    ;*** Fully automated and driven by the CleanupHazardUpdate ***
    Conditions        = None 
    Weapon            = PRIMARY AmbulanceCleanHazardWeapon 
    AutoChooseSources = PRIMARY NONE
  End
  ArmorSet
    Conditions      = None
    Armor           = ToxinTruckArmor 
    DamageFX        = TruckDamageFX
  End
  BuildCost       = 625
  BuildTime       = 10.0          ;in seconds    
  VisionRange     = 100
  ShroudClearingRange = 400
  Prerequisites
    Object = AmericaBarracks
    Object = AmericaWarFactory
  End
  ExperienceValue    = 50 50 50 50 ;Experience point value at each level
  IsTrainable     = No
  CrusherLevel           = 1  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaVehicleAmbulanceCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect = AmbulanceVoiceSelect
  VoiceMove = AmbulanceVoiceMove
  VoiceGuard = AmbulanceVoiceMove
  VoiceAttack = AmbulanceVoiceDetox
  SoundMoveStart = HumveeMoveStart
  SoundMoveStartDamaged = HumveeMoveStart
  ;SoundAmbient           = IdleVehicleLoop
  ;SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingVehicleLoop  ; only when not idle
   ;SoundAmbient           = IdleVehicleLoop
  SoundEnter = HumveeEnter
  SoundExit = HumveeExit

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate          = AmbulanceVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = TurretMoveLoop
    ; Required for the W3DTruckDraw module
    TruckLandingSound = RocketBuggyLand
    TruckPowerslideSound = RocketBuggyPowerslide
    VoiceCrush          = AmbulanceVoiceCrush
    VoiceEnter = AmbulanceVoiceMove
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS VEHICLE SCORE TRANSPORT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 200.0
    InitialHealth   = 200.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 480
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = CleanupHazardUpdate ModuleTag_03
    WeaponSlot            = PRIMARY
    ScanRate              = 1000
    ScanRange             = 100.0 ;If this range exceeds the AmbulanceCleanHazardWeapon AttackRange, it'll move!
  End

  ;Can be ordered to clean up a larger area with the ability to move around at an extended range.
  Behavior = CleanupAreaPower ModuleTag_04
    SpecialPowerTemplate          = SpecialAbilityAmbulanceCleanupArea
    MaxMoveDistanceFromLocation   = 300.0 ;allows the unit to move around while cleaning up
    InitiateSound = AmbulanceVoiceDetox
  End

  Behavior = TransportAIUpdate ModuleTag_05
   AutoAcquireEnemiesWhenIdle = No  ;CleanupHazardUpdate handles this...
   Turret
      TurretTurnRate = 180
      TurretPitchRate = 180
      AllowsPitch = Yes
      MinPhysicalPitch = -20 ; If allows pitch, the lowest I can dip down to shoot.  defaults to 0 (horizontal)
      TurretFireAngleSweep = PRIMARY 25
      ControlledWeaponSlots = PRIMARY
    End
  End
  Locomotor = SET_NORMAL HumveeLocomotor

  Behavior = TransportContain ModuleTag_06
    Slots               = 4
    HealthRegen%PerSec  = 25
    DamagePercentToUnits = 10%
    AllowInsideKindOf   = INFANTRY
    AllowAlliesInside   = Yes
    AllowNeutralInside  = No
    AllowEnemiesInside  = No
    ExitDelay = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End

  Behavior = PhysicsBehavior ModuleTag_07
    Mass = 50.0
  End
  Behavior = SlowDeathBehavior ModuleTag_08
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay = 0
    FX  = FINAL FX_GenericTankDeathExplosion
    OCL = FINAL OCL_FinalAmbulanceDebris
  End

  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_10
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_19
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_11
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = DestroyDie ModuleTag_12
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection01
    ExemptStatus = HIJACKED
  End

  Behavior = FXListDie ModuleTag_15
    DeathTypes = ALL -CRUSHED -SPLATTED
    DeathFX = FX_GenericTankDeathEffect
  End

  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_17
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_18
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.

  End

  Behavior = AutoHealBehavior ModuleTag_22
    HealingAmount     = 4
    HealingDelay      = 1000 ; msec
    Radius            = 100.0f
    StartsActive      = Yes
    KindOf            = INFANTRY
  End
  Behavior = AutoHealBehavior ModuleTag_23
    HealingAmount     = 8
    HealingDelay      = 1000 ; msec
    Radius            = 100.0f
    StartsActive      = Yes
    KindOf            = VEHICLE
    ForbiddenKindOf   = AIRCRAFT
    SkipSelfForHealing = Yes
  End

  Geometry = BOX
  GeometryMajorRadius = 14.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 12.0  ; height set to allow clear clipping of projectile streams   
  GeometryIsSmall = Yes
  Scale = 0.91   
  Shadow = SHADOW_VOLUME 

End

;------------------------------------------------------------------------------
Object AmericaVehicleBattleDrone

  ; *** ART Parameters ***
  SelectPortrait         = SABattleDrone_L
  ButtonImage            = SABattleDrone
  
  UpgradeCameo1 = Upgrade_AmericaDroneArmor
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  ;MAIN CHASSIS
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes

    DefaultConditionState
      Model = AVBATTLEDR
      Animation = AVBATTLEDR.AVBATTLEDR
      AnimationMode = LOOP
      Turret = Turret01
      TurretPitch = TurretEL01
      WeaponMuzzleFlash = PRIMARY TurretFX01
      WeaponFireFXBone = PRIMARY Muzzle01
    End

    ConditionState = REALLYDAMAGED
      Model = AVBATTLEDR_D
      Animation = AVBATTLEDR_D.AVBATTLEDR_D
      AnimationMode = LOOP
    End
  End

  ;EXTENDING ARM (FOR REPAIRING)
  Draw = W3DModelDraw ModuleTag_02
    OkToChangeModelColor = Yes

    DefaultConditionState
      Model = AVBATTLEDR_A
    End

    ;Unloading the arm (before starting to repair)
    ConditionState = UNPACKING
      Animation = AVBATTLEDR_A1.AVBATTLEDR_A1
      AnimationMode = ONCE
    End

    ;Loading the arm (after reparing complete)
    ConditionState = PACKING
      Animation = AVBATTLEDR_A1.AVBATTLEDR_A1
      AnimationMode = ONCE_BACKWARDS
      Flags = START_FRAME_LAST
    End

    ;Repair extending animation 1 (using bogus condition states -- doesn't justify making a whole new set)
    ConditionState = FIRING_B
      Animation = AVBATTLEDR_A2.AVBATTLEDR_A2
      AnimationMode = ONCE
    End


    ;Repair retracting animation 1 (using bogus condition states -- doesn't justify making a whole new set)
    ConditionState = FIRING_C
      Animation = AVBATTLEDR_A2.AVBATTLEDR_A2
      AnimationMode = ONCE_BACKWARDS
      Flags = START_FRAME_LAST
    End

  End


  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:BattleDrone
  Side                = America
  EditorSorting       = VEHICLE
  TransportSlotCount  = 0                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions        = None 
    Weapon            = PRIMARY BattleDroneMachineGun
  End
  ArmorSet
    Conditions        = None
    Armor             = TankArmor
    DamageFX          = SmallTankDamageFX
  End

  BuildCost           = 200
  BuildTime           = 5.0          ;in seconds    
  VisionRange         = 150
  ShroudClearingRange = 150
  Prerequisites
    Object = AmericaWarFactory
  End
  ExperienceValue     = 10 10 10 10 ;Experience point value at each level
  IsTrainable         = No
  
  ; *** AUDIO Parameters ***
  VoiceSelect         = NoSound
  VoiceMove           = NoSound
  VoiceAttack         = NoSound
  SoundMoveStart      = NoSound
  UnitSpecificSounds
  ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    TurretMoveStart   = NoSound
    TurretMoveLoop    = TurretMoveLoop
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority       = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS VEHICLE SELECTABLE CAN_ATTACK DRONE NO_SELECT
  Body = ActiveBody ModuleTag_03
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = AIUpdateInterface ModuleTag_04
    Turret
      TurretTurnRate        = 360   // turn rate, in degrees per sec
      TurretPitchRate       = 360
      MinPhysicalPitch      = -75 ; If allows pitch, the lowest I can dip down to shoot.  defaults to 0 (horizontal)
      AllowsPitch           = Yes
      ControlledWeaponSlots = PRIMARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL BattleDroneLocomotor
  Locomotor = SET_PANIC BattleDronePanicLocomotor   ;used for repairing master (zippy)
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 50.0
    KillWhenRestingOnGround = Yes
    AllowBouncing = No
  End

  Behavior = MaxHealthUpgrade ModuleTag_06
    TriggeredBy   = Upgrade_AmericaDroneArmor
    AddMaxHealth  = 50.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = SlavedUpdate ModuleTag_07
    GuardMaxRange = 35      ;How far away from master I'm allowed when master is idle (doesn't wander)
    GuardWanderRange = 35   ;How far away I'm allowed to wander from master while guarding.
    AttackRange = 75        ;How far away from master I'm allowed when master is attacking a target.
    AttackWanderRange = 10  ;How far I'm allowed to wander from target.
    ScoutRange = 75         ;How far away from master I'm allowed when master is moving.
    ScoutWanderRange = 10   ;How far I'm allowed to wander from scout point.
    RepairRange = 8         ;How far I can zip around while repair (only moves when he stops welding)
    RepairMinAltitude = 18.0   ;My minimum repair hover altitude.
    RepairMaxAltitude = 24.0   ;My maximum repair hover altitude.
    RepairRatePerSecond = 5.0 ;How many health points can I repair per second.
    RepairWhenBelowHealth% = 60 ;How low should my master's health be (in %) before I should prioritize repairing.
    RepairMinReadyTime = 300
    RepairMaxReadyTime = 750
    RepairMinWeldTime = 250
    RepairMaxWeldTime = 500
    RepairWeldingSys = BlueSparks
    RepairWeldingFXBone = Muzzle02
    StayOnSameLayerAsMaster = Yes
  End

  Behavior = DestroyDie ModuleTag_08
    DeathTypes = ALL
  End
  Behavior                 = CreateObjectDie  ModuleTag_09
    DeathTypes = ALL
    CreationList      = OCL_AmericaBattleDroneExplode
  End
  
  Behavior                 = TransitionDamageFX ModuleTag_10
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleDroneDamageTransitionSmall
  End
  
  Behavior                 = FXListDie ModuleTag_11
    DeathTypes = ALL
    DeathFX           = FX_AmericaBattleDroneExplode
  End

  Behavior = UpgradeDie  ModuleTag_12
    ;This frees the object based upgrade for the producer object.
    DeathTypes = ALL
    UpgradeToRemove     = Upgrade_AmericaBattleDrone ModuleTag_13
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 5
  GeometryMinorRadius = 5
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length

End


;------------------------------------------------------------------------------
Object AmericaVehicleScoutDrone

  ; *** ART Parameters ***
  SelectPortrait         = SAScout_L
  ButtonImage            = SAScout
  
  UpgradeCameo1 = Upgrade_AmericaDroneArmor
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = AVScoutDr
      Animation = AVScoutDr.AVScoutDr
      AnimationMode = LOOP
    End

    ConditionState = REALLYDAMAGED
      Model = AVScoutDr_d
      Animation = AVScoutDr_d.AVScoutDr_d
      AnimationMode = LOOP
    End
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:ScoutDrone
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 0                 ;how many "slots" we take in a transport (0 == not transportable)
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = SmallTankDamageFX
  End
  BuildCost       = 100
  BuildTime       = 5.0          ;in seconds    
  VisionRange     = 150
  ShroudClearingRange = 500
  IsTrainable     = No  ;Can gain experience
  
  ; *** AUDIO Parameters ***
  VoiceSelect = NoSound
  VoiceMove = NoSound
  VoiceAttack = NoSound
  SoundMoveStart = NoSound

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    TurretMoveStart = NoSound
    TurretMoveLoop = TurretMoveLoop
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS VEHICLE SELECTABLE DRONE NO_SELECT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 60   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL DroneLocomotor
  Behavior = StealthDetectorUpdate ModuleTag_04
    DetectionRate   = 500   ; how often to rescan for stealthed things in my sight (msec)
    ;DetectionRange = ??? ;Dustin, enable this for independant balancing!
    CanDetectWhileGarrisoned  = No ;Garrisoned means being in a structure that you units can shoot out of.
    CanDetectWhileContained   = No ;Contained means being in a transport or tunnel network.
  End
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 50.0
    KillWhenRestingOnGround = Yes
    AllowBouncing = No
  End

  Behavior = SlavedUpdate ModuleTag_06
    GuardMaxRange = 35      ;How far away from master I'm allowed when master is idle (doesn't wander)
    GuardWanderRange = 35   ;How far away I'm allowed to wander from master while guarding.
    AttackRange = 75        ;How far away from master I'm allowed when master is attacking a target.
    AttackWanderRange = 10  ;How far I'm allowed to wander from target.
    ScoutRange = 75         ;How far away from master I'm allowed when master is moving.
    ScoutWanderRange = 10   ;How far I'm allowed to wander from scout point.
    DistToTargetToGrantRangeBonus = 20 ;How close I have to be to the master's target in order to grant master a range bonus.
    StayOnSameLayerAsMaster = Yes
  End

  Behavior = MaxHealthUpgrade ModuleTag_07
    TriggeredBy   = Upgrade_AmericaDroneArmor
    AddMaxHealth  = 50.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = DestroyDie ModuleTag_08
    DeathTypes = ALL
  End
  Behavior                 = CreateObjectDie ModuleTag_09
    DeathTypes = ALL
    CreationList      = OCL_AmericaScoutDroneExplode
  End
  Behavior                 = FXListDie ModuleTag_10
    DeathTypes = ALL
    DeathFX           = FX_AmericaScoutDroneExplode
  End
  
  Behavior                 = TransitionDamageFX ModuleTag_11
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleDroneDamageTransitionSmall
  End

  Behavior = UpgradeDie  ModuleTag_12
   ;This frees the object based upgrade for the producer object.
   DeathTypes = ALL
   UpgradeToRemove      = Upgrade_AmericaScoutDrone ModuleTag_13
  End


  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 5.0
  GeometryMinorRadius = 6.0
  GeometryHeight = 3.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaVehicleHellfireDrone

  ; *** ART Parameters ***
  SelectPortrait         = SAHellfire_L
  ButtonImage            = SAHellfire
  
  UpgradeCameo1 = Upgrade_AmericaDroneArmor
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes

    DefaultConditionState
      Model = AVHellDrone
      WeaponLaunchBone = PRIMARY WeaponA
    End

    ConditionState = REALLYDAMAGED
      Model = AVHellDrone_d
    End
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:HellfireDrone
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 0                 ;how many "slots" we take in a transport (0 == not transportable)
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = SmallTankDamageFX
  End
  BuildCost       = 500
  BuildTime       = 5.0          ;in seconds    
  VisionRange     = 100
  ShroudClearingRange = 500
  IsTrainable     = No  ;Can gain experience
  
  ; *** AUDIO Parameters ***
  VoiceSelect = NoSound
  VoiceMove = NoSound
  VoiceAttack = NoSound
  SoundMoveStart = NoSound

  WeaponSet
    Conditions = NONE 
    Weapon = PRIMARY HellfireMissileWeapon
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS VEHICLE SELECTABLE CAN_ATTACK DRONE NO_SELECT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate        = 360   // turn rate, in degrees per sec
      TurretPitchRate       = 360
      ControlledWeaponSlots = PRIMARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL HellfireDroneLocomotor
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 50.0
    KillWhenRestingOnGround = Yes
    AllowBouncing = No
  End
  Behavior = SlavedUpdate ModuleTag_06
    GuardMaxRange = 35      ;How far away from master I'm allowed when master is idle (doesn't wander)
    GuardWanderRange = 35   ;How far away I'm allowed to wander from master while guarding.
    AttackRange = 75        ;How far away from master I'm allowed when master is attacking a target.
    AttackWanderRange = 10  ;How far I'm allowed to wander from target.
    ScoutRange = 75         ;How far away from master I'm allowed when master is moving.
    ScoutWanderRange = 10   ;How far I'm allowed to wander from scout point.
    StayOnSameLayerAsMaster = Yes
  End

  Behavior = MaxHealthUpgrade ModuleTag_07
    TriggeredBy   = Upgrade_AmericaDroneArmor
    AddMaxHealth  = 50.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = DestroyDie ModuleTag_08
    DeathTypes = ALL
  End
  Behavior                 = CreateObjectDie ModuleTag_09
    DeathTypes = ALL
    CreationList      = OCL_AmericaScoutDroneExplode
  End
  Behavior                 = FXListDie ModuleTag_10
    DeathTypes = ALL
    DeathFX           = FX_AmericaScoutDroneExplode
  End
  
  Behavior                 = TransitionDamageFX ModuleTag_11
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleDroneDamageTransitionSmall
  End

  Behavior = UpgradeDie  ModuleTag_12
   ;This frees the object based upgrade for the producer object.
   DeathTypes = ALL
   UpgradeToRemove      = Upgrade_AmericaHellfireDrone ModuleTag_13
  End


  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 5.0
  GeometryMinorRadius = 6.0
  GeometryHeight = 3.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaVehicleSpyDrone

  ; *** ART Parameters ***
  SelectPortrait         = SAScout_L
  ButtonImage            = SAScout
  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ConditionState = NONE
      Model = AVSpyDrone
      Animation = AVSpyDrone.AVSpyDrone
      AnimationMode = LOOP
    End

; Damage state waiting for pristine's approval (or may just not need one)
;    ConditionState = REALLYDAMAGED
;      Model = AVSpyDrone_d
;      Animation = AVSpyDrone_d.AVSpyDrone_d
;      AnimationMode = LOOP
;    End
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:SpyDrone
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 0                 ;how many "slots" we take in a transport (0 == not transportable)
  ArmorSet
    Conditions      = None
    Armor           = AirplaneArmor
    DamageFX        = SmallTankDamageFX
  End
  VisionRange     = 250
  ShroudClearingRange = 0; Dynamic range below
  IsTrainable     = No 
  
  ; *** AUDIO Parameters ***
  VoiceSelect = NoSound
  VoiceMove = NoSound
  VoiceAttack = NoSound
  SoundMoveStart = NoSound

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    TurretMoveStart = NoSound
    TurretMoveLoop = TurretMoveLoop
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD CAN_CAST_REFLECTIONS VEHICLE SCORE DRONE SELECTABLE INERT NO_SELECT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 200.0
    InitialHealth   = 200.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = No
  End

  Locomotor = SET_NORMAL SpyDroneLocomtor

  Behavior = DynamicShroudClearingRangeUpdate ModuleTag_04
    FinalVision = 250.0 
    ChangeInterval = 50
    ShrinkDelay = 2000
    ShrinkTime = 1000
    GrowDelay = 0
    GrowTime = 1000
    GrowInterval = 10 ; Faster than most

    GridDecalTemplate
      Texture           = EXGrid
      Style             = SHADOW_ADDITIVE_DECAL
      OpacityMin        = 50%
      OpacityMax        = 100%
      OpacityThrobTime  = 500
      Color             = R:32 G:64 B:128 A:0 //dim blue, additive
    End

  End

  Behavior = StealthDetectorUpdate ModuleTag_05
    DetectionRate   = 500   ; how often to rescan for stealthed things in my sight (msec)
    ;DetectionRange = ??? ;Dustin, enable this for independant balancing!
    CanDetectWhileGarrisoned  = No ;Garrisoned means being in a structure that you units can shoot out of.
    CanDetectWhileContained   = No ;Contained means being in a transport or tunnel network.
  End
  Behavior = PhysicsBehavior ModuleTag_06
    Mass = 50.0
  End

  Behavior = DestroyDie ModuleTag_07
    DeathTypes = ALL
  End
  Behavior                 = CreateObjectDie ModuleTag_08
    DeathTypes = ALL
    CreationList      = OCL_AmericaScoutDroneExplode
  End
  Behavior = StealthUpdate ModuleTag_09
    StealthDelay                = 0 ; msec
    StealthForbiddenConditions  = NONE
    InnateStealth               = Yes
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
  End
  Behavior = MaxHealthUpgrade ModuleTag_10
    TriggeredBy   = Upgrade_AmericaDroneArmor
    AddMaxHealth  = 50.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 5.0
  GeometryMinorRadius = 6.0
  GeometryHeight = 3.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 89  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankCrusader

  ; *** ART Parameters ***
  SelectPortrait         = SAM601_L
  ButtonImage            = SAM601
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVM60
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End

    ConditionState       = REALLYDAMAGED
      Model              = AVM60d
    End
    ConditionState       = RUBBLE
      Model              = AVM60d
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName            = OBJECT:M60 Patton
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None 
    Weapon               = PRIMARY M60TankGun
    Weapon               = SECONDARY LightGenericTankMachineGun
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions           = PLAYER_UPGRADE
  ;  Armor                = UpgradedTankArmor
  ;  DamageFX             = TankDamageFX
  ;End
  BuildCost              = 950
  BuildTime              = 16.0          ;in seconds    
  VisionRange            = 150
  ShroudClearingRange = 280
  Prerequisites
    Object = AmericaWarFactory
  End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankCrusaderCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = CrusaderTankVoiceMove
  VoiceMove             = CrusaderTankVoiceMove
  VoiceGuard            = CrusaderTankVoiceMove
  VoiceAttack           = CrusaderTankVoiceAttack
  SoundMoveStart        = BattleMasterTankMoveStart
  SoundMoveStartDamaged = BattleMasterTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = CrusaderTankVoiceCreate
    VoiceEnter             = CrusaderTankVoiceMove
    TurretMoveStart     = NoSound
    TurretMoveLoop      = OverlordTankTurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = CrusaderTankVoiceCrush
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 535
    InitialHealth   = 535

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 135 ;90 Trying to be realistic  // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY
    End

    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL M60Locomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_CrusaderCatchFire
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_GenericTankDeathEffect
    FX  = MIDPOINT FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_M48TankDeathEffect
  End

  ; Catch fire, and explode death
   ;Behavior = SlowDeathBehavior ModuleTag_11
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 2000
    ;DestructionDelayVariance  = 300
    ;FX  = INITIAL  FX_CrusaderCatchFire
    ;OCL = FINAL    OCL_GenericTankDeathEffect  
    ;FX  = FINAL    FX_GenericTankDeathExplosion
  ;End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 0.88     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
;USA Construction Dozer or USDozer
Object AmericaVehicleDozer

  ; *** ART Parameters ***
  SelectPortrait         = SACDozer_L
  ButtonImage            = SACDozer
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTruckDraw ModuleTag_01

    OkToChangeModelColor = Yes

    DefaultConditionState
      Model             = AVCONSTDOZ_A
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeLight
      WaitForStateToFinishIfPossible = TRANS_DIGGING
    End

    ConditionState = PREATTACK_A 
      Animation         = AVCONSTDOZ_A.AVCONSTDOZ_A
      AnimationMode     = ONCE
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      ParticleSysBone   = DIRTFX01 DozerDirtFall ;gush of dirt
      TransitionKey     = TRANS_DIGGING
    End

    ConditionState = MOVING
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      WaitForStateToFinishIfPossible = TRANS_DIGGING
    End

    ConditionState      = REALLYDAMAGED RUBBLE
      Model             = AVCONSTDOZ_AD
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      WaitForStateToFinishIfPossible = TRANS_DIGGING_DAMAGED
    End

    ConditionState = PREATTACK_A REALLYDAMAGED RUBBLE
      Model             = AVCONSTDOZ_AD
      Animation         = AVCONSTDOZ_AD.AVCONSTDOZ_AD
      AnimationMode     = ONCE
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      ParticleSysBone   = DIRTFX01 DozerDirtFall ;gush of dirt
      TransitionKey     = TRANS_DIGGING_DAMAGED
    End

    ConditionState      = MOVING REALLYDAMAGED RUBBLE
      Model             = AVCONSTDOZ_AD
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      WaitForStateToFinishIfPossible = TRANS_DIGGING_DAMAGED
    End


    TrackMarks            = EXTireTrack2.tga
    Dust                  = RocketBuggyDust
    DirtSpray             = RocketBuggyDirtSpray

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.

    LeftFrontTireBone     = TIRE01
    RightFrontTireBone    = TIRE02
    LeftRearTireBone      = TIRE03
    RightRearTireBone     = TIRE04

    TireRotationMultiplier      = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition  = 0   ; This vehicle doesn't powerslide.

  ParticlesAttachedToAnimatedBones = Yes 


  End



  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:Dozer
  Side                = America
  EditorSorting       = VEHICLE
  TransportSlotCount  = 5 ;how many "slots" we take in a transport (0 == not transportable)
  BuildCost           = 1000
  BuildTime           = 5.0 ; in seconds
  VisionRange         = 200
  ShroudClearingRange = 200

  WeaponSet
    Conditions = None 
    Weapon = PRIMARY None
  End
  WeaponSet
    Conditions = MINE_CLEARING_DETAIL 
    Weapon = PRIMARY DozerMineDisarmingWeapon
  End

  ArmorSet
    Conditions        = None
    Armor             = DozerArmor ;Special Explosion-Proof Armor
    DamageFX          = TankDamageFX
  End
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet          = AmericaDozerCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect         = DozerUSAVoiceSelect
  VoiceMove           = DozerUSAVoiceMove
  VoiceGuard          = DozerUSAVoiceMove
  VoiceTaskComplete   = DozerUSAVoiceBuildComplete
  SoundMoveStart      = DozerUSAMoveStart
  SoundMoveStartDamaged = DozerUSAMoveStart
  SoundAmbient           = IdleVehicleLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingVehicleLoop  ; only when not idle
   ;SoundAmbient           = IdleVehicleLoop
  UnitSpecificSounds
    VoiceCreate           = DozerUSAVoiceCreate
    VoiceNoBuild          = DozerUSAVoiceBuildNot
    VoiceCrush            = DozerUSAVoiceCrush
    VoiceRepair           = DozerUSAVoiceRepair
    VoiceDisarm           = DozerUSAVoiceClearMine
    TruckLandingSound     = NoSound
    TruckPowerslideSound  = NoSound
    VoiceEnter            = DozerUSAVoiceMove
    VoiceBuildResponse    = DozerUSAVoiceBuild
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority       = UNIT
  KindOf              = PRELOAD VEHICLE SCORE SELECTABLE CAN_CAST_REFLECTIONS DOZER
 
  Body                = ActiveBody ModuleTag_02
    MaxHealth         = 250.0
    InitialHealth     = 250.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 500
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = DozerAIUpdate ModuleTag_03
    RepairHealthPercentPerSecond = 2%    ; % of max health to repair each second
    BoredTime                    = 5000  ; in milliseconds
    BoredRange                   = 150   ; when bored, we look this far away to do something
    ; the only "enemies" that workers can acquire are mines, to be disarmed...
    AutoAcquireEnemiesWhenIdle   = Yes
  End

  Locomotor = SET_NORMAL AmericaVehicleDozerLocomotor

  Behavior            = PhysicsBehavior ModuleTag_04
    Mass              = 75.0
  End

  Behavior = StealthDetectorUpdate ModuleTag_05
    DetectionRate         = 500   ; how often to rescan for stealthed things in my sight (msec)
    ;DetectionRange       = ??? ;Dustin, enable this for independant balancing!
    CanDetectWhileGarrisoned  = No ;Garrisoned means being in a structure that you units can shoot out of.
    CanDetectWhileContained   = No ;Contained means being in a transport or tunnel network.
    ExtraRequiredKindOf   = MINE  ; we can only detect MINES, not other stealthed things
  End

  Behavior                 = TransitionDamageFX ModuleTag_06
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_07
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 100
    DestructionDelay = 1500
    DestructionDelayVariance = 600
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_AmericaDozerExplode  
    FX  = FINAL    FX_BattleMasterExplosionOneFinal
  End   

  Behavior = CreateCrateDie ModuleTag_CratesChange
    CrateData = SalvageCrateData
  End
  
  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

;;;;;;;;  ClientUpdate         = AnimatedParticleSysBoneClientUpdate ModuleTag_22
;;;;;;;;  End

  Behavior               = FXListDie ModuleTag_23
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX         = FX_CarCrush
  End

  Behavior = DestroyDie ModuleTag_24
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Geometry            = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight      = 15.0     
  GeometryIsSmall     = Yes
  Scale = 1.0
  Shadow              = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length    

End

;------------------------------------------------------------------------------
Object AmericaTankPaladin

  ; *** ART Parameters ***
  SelectPortrait         = SAM1A1Abrams_L
  ButtonImage            = SAM1A1Abrams
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  UpgradeCameo5 = Upgrade_AmericaHallfireDrone

  Draw = W3DTankDraw ModuleTag_01
    
    ExtraPublicBone = Laser 

    ConditionState        = NONE
      Model               = AVLeopard2
      Turret              = Turret
      ;Turret              = Turret02
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState        = REALLYDAMAGED
      Model               = AVLeopard2_D
      Turret              = Turret
      ;Turret              = Turret02
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState        = RUBBLE
      Model               = AVLeopard2_D
      Turret              = Turret
      ;Turret              = Turret02
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:M1A5Abrams
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
  Weapon               = PRIMARY PaladinTankGun
  Weapon               = SECONDARY HeavyGenericTankMachineGun
  ;Weapon               = TERTIARY HeavyGenericTankMachineGunAir
  PreferredAgainst     = SECONDARY     INFANTRY

  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions      = PLAYER_UPGRADE
  ;  Armor           = UpgradedTankArmor
  ;  DamageFX        = TankDamageFX
  ;End
  BuildCost       = 1300
  BuildTime       = 20.0          ;in seconds    
  VisionRange     = 250
  ShroudClearingRange = 320
  Prerequisites
    Object = AmericaWarFactory
    Science = SCIENCE_AbramsTank
  End

  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level

  IsTrainable     = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaTankPaladinCommandSet
    
  ; *** AUDIO Parameters ***
  VoiceSelect = PaladinTankVoiceMove
  VoiceMove = PaladinTankVoiceMove
  VoiceGuard = PaladinTankVoiceMove
  VoiceAttack = PaladinTankVoiceAttack
  SoundMoveStart = InfernoCannonMoveStart
  SoundMoveStartDamaged = InfernoCannonMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = PaladinTankVoiceCreate
    TurretMoveLoop = OverlordTankTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = PaladinTankVoiceCrush
    VoiceEnter = PaladinTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 700.0
    InitialHealth   = 700.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 1000
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 145 ;90   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY
    End
    ;AltTurret
      ;TurretTurnRate = 80
      ;ControlledWeaponSlots = SECONDARY
    ;End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL AbramsLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  
  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
;    ModifierBonusPerOverkillPercent = 30%  ; negative means less likely to pick this in the face of much damage, positive means more likely
    DestructionDelay = 500
    DestructionDelayVariance = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_AbramsTankDeathEffect
  End
  
  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_06
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_AbramsTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion 
  End

  Behavior = PointDefenseLaserUpdate ModuleTag_07
    WeaponTemplate        = PaladinPointDefenseLaser
    PrimaryTargetTypes    = BALLISTIC_MISSILE SMALL_MISSILE
    SecondaryTargetTypes  = INFANTRY 
    ScanRate              = 100
    ScanRange             = 120.0
    PredictTargetVelocityFactor = 3.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End 
  Behavior = ObjectCreationUpgrade ModuleTag_19
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End Upgrade_AmericaHallfireDrone

  Behavior = ProductionUpdate ModuleTag_10
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_11
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = DestroyDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_17
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.95     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
;Sentry Drone
Object AmericaVehicleSentryDrone

  ; *** ART Parameters ***
  SelectPortrait         = SAsentry_L
  ButtonImage            = SAsentry
  
  UpgradeCameo1 = Upgrade_AmericaSentryDroneGun
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  Draw = W3DTankDraw ModuleTag_01
    
    InitialRecoilSpeed   = 10
    MaxRecoilDistance    = 1.5
    RecoilSettleSpeed    = 3

    OkToChangeModelColor = Yes

    DefaultConditionState
      Model                           = AVSENTRY
      Animation                       = AVSENTRY.AVSENTRY
      AnimationMode                   = LOOP
      Turret                          = TURRET01
      HideSubObject                   = TURRETUP09  ;Hide controlled turret
      WeaponFireFXBone  = PRIMARY   TurretFX
      WeaponMuzzleFlash = PRIMARY   TurretFX
      WeaponRecoilBone  = PRIMARY   TurretUp
    End
    ConditionState                    = REALLYDAMAGED
      Turret                          = TURRET01
      Model                           = AVSENTRY_D
      Animation                       = AVSENTRY_D.AVSENTRY_D
      AnimationMode                   = LOOP
      HideSubObject                   = TURRETUP09      ;Hide controlled turret
    End
    ConditionState                    = RUBBLE
      Model                           = AVSENTRY_D1
      HideSubObject                   = TURRETUP09      ;Hide controlled turret
    End
    AliasConditionState = RUBBLE WEAPONSET_PLAYER_UPGRADE 
    
    ConditionState = WEAPONSET_PLAYER_UPGRADE
      Model                           = AVSENTRY
      Animation                       = AVSENTRY.AVSENTRY
      AnimationMode                   = LOOP
      ShowSubObject                   = TURRETUP09
    End

    ConditionState = WEAPONSET_PLAYER_UPGRADE REALLYDAMAGED
      Model                           = AVSENTRY_D
      Animation                       = AVSENTRY_D.AVSENTRY_D
      AnimationMode                   = LOOP
      ShowSubObject                   = TURRETUP09
    End

    TrackMarks           = EXTnkTrack.tga
    TreadDebrisLeft      = SentryDroneTrackDebrisDirtLeft
    TreadDebrisRight     = SentryDroneTrackDebrisDirtRight
    TreadAnimationRate   = 4.0  ; amount of tread texture to move per second
  End

  ; ***DESIGN parameters ***
  DisplayName        = OBJECT:SentryDrone
  Side               = America
  EditorSorting      = VEHICLE
  TransportSlotCount = 1                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY None
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE
    Weapon = PRIMARY SentryDroneGun
    Weapon = SECONDARY SentryDroneGunFake
    AutoChooseSources = SECONDARY FROM_SCRIPT FROM_AI DEFAULT_SWITCH_WEAPON
    AutoChooseSources = PRIMARY FROM_SCRIPT FROM_AI
  End
  ArmorSet
    Conditions      = None
    Armor           = SentryDroneArmor
    DamageFX        = TruckDamageFX
  End
  BuildCost       = 600
  BuildTime       = 10.0          ;in seconds    
  VisionRange     = 300
  ShroudClearingRange = 350
  Prerequisites
    Object = AmericaWarFactory
  End

  ExperienceValue = 50 50 100 150   ;Experience point value at each level
  ExperienceRequired = 0 100 150 300  ;Experience points needed to gain each level
  IsTrainable = No             ;Can gain experience
  CrusherLevel           = 0  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet    = GenericCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect           = SentryDroneVoiceSelect
  VoiceMove             = SentryDroneVoiceMove
  VoiceGuard            = SentryDroneVoiceMove
  VoiceAttack           = SentryDroneVoiceMove
  SoundMoveStart        = SentryDroneMoveStart
  SoundMoveStartDamaged = NoSound
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = NoSound
    TurretMoveStart     = NoSound
    TurretMoveLoop      = TurretMoveLoopLoud
    VoiceEnter          = NoSound
    Deploy              = NoSound
    Undeploy            = NoSound
  End
  Behavior = WeaponSetUpgrade ModuleTag_03
    TriggeredBy = Upgrade_AmericaSentryDroneGun
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE ATTACK_NEEDS_LINE_OF_SIGHT DRONE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 240.0
    InitialHealth   = 240.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 480
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = DeployStyleAIUpdate ModuleTag_04
    Turret
      TurretTurnRate        = 180
      TurretPitchRate       = 180
      FirePitch             = 0            ; Instead of aiming pitchwise at the target, it will aim here
      AllowsPitch           = No
      RecenterTime          = 1000         ; how long to wait during idle before recentering
      ControlledWeaponSlots = PRIMARY
      NaturalTurretAngle    = 0
      InitiallyDisabled     = No
      MinIdleScanInterval   = 250    ; in milliseconds
      MaxIdleScanInterval   = 250    ; in milliseconds
      MinIdleScanAngle      = 0       ; in degrees off the natural turret angle
      MaxIdleScanAngle      = 360     ; in degrees off the natural turret angle
    End
    AutoAcquireEnemiesWhenIdle = Yes Stealthed ; Means "Yes when idle, even if I am stealthed"
    PackTime = 1000
    UnpackTime = 1000
    TurretsFunctionOnlyWhenDeployed = Yes
    TurretsMustCenterBeforePacking = Yes
  End

  Locomotor = SET_NORMAL SentryLocomotor
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 40.0
  End
  Behavior = StealthUpdate ModuleTag_06
    StealthDelay                = 2000 ; msec
    StealthForbiddenConditions  = FIRING_PRIMARY MOVING
    HintDetectableConditions    = IS_FIRING_WEAPON 
    FriendlyOpacityMin          = 50.0%
    FriendlyOpacityMax          = 100.0%
    InnateStealth               = Yes
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
  End

  Behavior = SlowDeathBehavior ModuleTag_07
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_AmericaVehicleSentryDroneDie
    FX =  FINAL FX_AmericaVehicleTomahawkDeathExplosion
  End

  Behavior = DestroyDie ModuleTag_08
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_09
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateCrateDie ModuleTag_CratesChange
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = TransitionDamageFX ModuleTag_10
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_11
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End
  Behavior = StealthDetectorUpdate ModuleTag_12
    DetectionRate            = 900   ; how often to rescan for stealthed things in my sight (msec)
    DetectionRange           = 450 ;Dustin, enable this for independant balancing!
  End
  
  Behavior = CommandSetUpgrade ModuleTag_13
    CommandSet = AmericaVehicleSentryDroneCommandSet
    TriggeredBy = Upgrade_AmericaSentryDroneGun
  End

  Behavior = LockWeaponCreate ModuleTag_14
    SlotToLock = SECONDARY ; Prevents indeterminate state plus two unpickable weapons equaling no attack.
  End

  Geometry = BOX
  GeometryMajorRadius = 9.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 11.5     
  GeometryIsSmall = Yes
  Scale = 0.8 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length


End

;------------------------------------------------------------------------------
Object AmericaTankAvengerLaserTurret ; Seperate turret object so it can attack independantly

  ; *** ART Parameters ***
  SelectPortrait         = SNPropSpeaker_L
  ButtonImage            = SNPropSpeaker
  
  UpgradeCameo1 = Upgrade_Nationalism
  UpgradeCameo2 = Upgrade_ChinaUraniumShells
  UpgradeCameo3 = Upgrade_ChinaNuclearTanks
  UpgradeCameo4 = NONE
  UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower
  
  Draw                    = W3DDependencyModelDraw ModuleTag_01
    OkToChangeModelColor  = Yes
    ExtraPublicBone = TurretFX01
    ExtraPublicBone = TurretFX02
    ExtraPublicBone = TURRET01
    ExtraPublicBone = TURRETEL
    ExtraPublicBone = TURRETEL01

    AttachToBoneInContainer = FIREPOINT01

    DefaultConditionState 
      Model         = AVAVNGER_G
      Turret              = TURRET01
      TurretPitch         = TURRETEL01
    End

    ConditionState = REALLYDAMAGED
      Model         = AVAVNGER_GD
      Turret              = TURRET01
      TurretPitch         = TURRETEL01
    End
  End

  PlacementViewAngle = -45

  ; ***DESIGN parameters ***
  Side             = America
  EditorSorting    = SYSTEM
  TransportSlotCount = 1
  
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY AvengerAirLaserOne
    Weapon = SECONDARY AvengerAirLaserTwo
  End

  ArmorSet
    Conditions     = None
    Armor          = InvulnerableAllArmor ; We can't be hurt on the field.  We share damage from the Avenger with his damage module
  End
  VisionRange     = 200

  ; *** AUDIO Parameters ***
  UnitSpecificSounds
   TurretMoveStart = NoSound
    TurretMoveLoop  = NukeCannonTurretMoveLoop
  End

  ; *** ENGINEERING Parameters ***
  KindOf            = PRELOAD PORTABLE_STRUCTURE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CLICK_THROUGH IGNORED_IN_GUI
    Body            = StructureBody ModuleTag_02
    MaxHealth       = 180.0
    InitialHealth   = 180.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      ControlledWeaponSlots = PRIMARY SECONDARY
      TurretTurnRate      = 180   // turn rate, in degrees per sec
      TurretPitchRate     = 180
      AllowsPitch         = Yes
      NaturalTurretPitch  = 45
    End
    AutoAcquireEnemiesWhenIdle = Yes 
    MoodAttackCheckRate = 500 ; default is 2000
  End

  Behavior             = DestroyDie ModuleTag_05
    ;<No Data>
  End

  Geometry            = BOX
  GeometryMajorRadius = 6.0
  GeometryMinorRadius = 6.0
  GeometryHeight      = 10.0
  GeometryIsSmall     = No
  Scale = 0.91      
  Shadow              = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankAvenger

  ; *** ART Parameters ***
  SelectPortrait         = SAAvenger2_L
  ButtonImage            = SAAvenger2
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor

  Draw = W3DOverlordTruckDraw ModuleTag_01
    OkToChangeModelColor  = Yes
    ExtraPublicBone = TurretFX03
    ExtraPublicBone = LazerSpot01
    ExtraPublicBone = LazerSpot02
    DefaultConditionState
      Model               = AVAVNGER
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
    End
    
    ConditionState        = REALLYDAMAGED
      Model               = AVAVNGER_D
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
    End
    
    ConditionState        = RUBBLE
      Model               = AVAVNGER_D1
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
    End
    
    Dust = RocketBuggyDust
    DirtSpray = RocketBuggyDirtSpray
    PowerslideSpray = RocketBuggyDirtPowerSlide

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.
    LeftFrontTireBone = Tire01
    RightFrontTireBone = Tire02
    LeftRearTireBone = Tire03
    RightRearTireBone = Tire04
    TireRotationMultiplier = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition = 0.0   ; This speed is added to the rotation speed when powersliding.
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:Avenger
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 2                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY AvengerTargetDesignator
    ;Weapon = SECONDARY Avenger2PaintWeapon
  End
  ArmorSet
    Conditions      = None
    Armor           = AntiAirVehicle
    DamageFX        = TankDamageFX
  End
  BuildCost       = 1800
  BuildTime       = 10.0          ;in seconds    
  VisionRange     = 150
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End

  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level

  IsTrainable     = Yes
  CrusherLevel           = 1  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaTankAvengerCommandSet
    
  ; *** AUDIO Parameters ***
  VoiceSelect = AvengerVoiceSelect
  VoiceMove = AvengerVoiceMove
  VoiceGuard = AvengerVoiceMove
  VoiceAttack = AvengerVoiceAttack
  VoiceAttackAir = AvengerVoiceAttack
  SoundMoveStart = HumveeMoveStart
  SoundMoveStartDamaged = HumveeMoveStart
  SoundAmbient           = IdleVehicleLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingVehicleLoop  ; only when not idle
   ;SoundAmbient           = IdleVehicleLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = AvengerVoiceCreate
    TurretMoveLoop = NukeCannonTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = NoSound
    VoiceEnter = AvengerVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE CANNOT_RETALIATE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 220.0
    InitialHealth   = 220.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 1000
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL AvengerLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  
  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
;    ModifierBonusPerOverkillPercent = 30%  ; negative means less likely to pick this in the face of much damage, positive means more likely
    DestructionDelay = 500
    DestructionDelayVariance = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_AvengerTankDeathEffect
  End
  
  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_06
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    FX  = FINAL    FX_GenericTankDeathExplosion 
    OCL = FINAL    OCL_AvengerTankDeathEffect
  End

  Behavior = PointDefenseLaserUpdate ModuleTag_Laser_One
    WeaponTemplate        = AvengerPointDefenseLaserOne
    PrimaryTargetTypes    = BALLISTIC_MISSILE SMALL_MISSILE
    ScanRate              = 0
    ScanRange             = 200.0
    PredictTargetVelocityFactor = 1.0
  End

;  Behavior = PointDefenseLaserUpdate ModuleTag_Laser_Two
;    WeaponTemplate        = AvengerPointDefenseLaserTwo
;    PrimaryTargetTypes    = BALLISTIC_MISSILE SMALL_MISSILE
;    ScanRate              = 100
;    ScanRange             = 200.0
;    PredictTargetVelocityFactor = 1.0
;  End

  Behavior = OverlordContain ModuleTag_OverlordContain
    Slots                 = 1
    DamagePercentToUnits  = 100%
    AllowInsideKindOf     = PORTABLE_STRUCTURE
    PassengersAllowedToFire = Yes
    PayloadTemplateName        = AmericaTankAvengerGattlingTurret
    ExperienceSinkForRider = Yes ; I get the Exp for things my turret friend kills
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End 
  Behavior = ObjectCreationUpgrade ModuleTag_19
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End

  Behavior = ProductionUpdate ModuleTag_10
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_11
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = DestroyDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection02
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_17
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = FlammableUpdate ModuleTag_22
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.91  
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankMicrowave

  ; *** ART Parameters ***
  SelectPortrait         = SAThunderBolt_L
  ButtonImage            = SAThunderBolt
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01

    ExtraPublicBone = WEAPON02 
    OkToChangeModelColor = Yes

    ConditionState  = NONE
      Model         = AVTHUNDRBLT
      ParticleSysBone = PROJECTORGLOW09 MicrowaveLenzflare 
      ParticleSysBone = NONE MicrowaveRotisserie
    End
    ConditionState  = USING_WEAPON_A USING_WEAPON_B USING_WEAPON_C
      Model         = AVTHUNDRBLT
    End
    ConditionState  = REALLYDAMAGED RUBBLE
      Model         = AVTHUNDRBLT_D
      ParticleSysBone = PROJECTORGLOW09 MicrowaveLenzflare 
      ParticleSysBone = NONE MicrowaveRotisserie
    End
    ConditionState  = REALLYDAMAGED RUBBLE USING_WEAPON_A USING_WEAPON_B USING_WEAPON_C
      Model         = AVTHUNDRBLT_D
    End
    
    TrackMarks              = EXTnkTrack.tga
    TreadAnimationRate      = 4.0  ; amount of tread texture to move per second
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:Microwave
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End

  WeaponSet
    Conditions          = None 
  ; Weapon              = PRIMARY   MicrowaveTankVehicleDisabler
    Weapon              = PRIMARY MicrowaveTankBuildingDisabler  ;SECONDARY MicrowaveTankBuildingDisabler
    Weapon              = SECONDARY MicrowaveTankBuildingClearer ;TERTIARY  MicrowaveTankBuildingClearer
    Weapon              = TERTIARY LightGenericTankMachineGun
  PreferredAgainst      = TERTIARY     INFANTRY
  End

  BuildCost              = 750
  BuildTime              = 10.0          ;in seconds    
  VisionRange            = 200
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankMicrowaveCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = MicrowaveTankVoiceSelect
  VoiceMove             = MicrowaveTankVoiceMove
  VoiceGuard            = MicrowaveTankVoiceMove
  VoiceAttack           = MicrowaveTankVoiceAttack
  SoundMoveStart        = MicrowaveTankMoveStart
  SoundMoveStartDamaged = MicrowaveTankMoveStart
  SoundAmbient           = IdleVehicleLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingVehicleLoop  ; only when not idle
   ;SoundAmbient           = IdleVehicleLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = MicrowaveTankVoiceCreate
    VoiceEnter             = MicrowaveTankVoiceMove
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = MicrowaveTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE CANNOT_RETALIATE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 410
    InitialHealth   = 410

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL CrusaderLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_MicrowaveTankDeath
    FX  = FINAL    FX_GenericTankDeathExplosion
  End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_MicrowaveTankDeath_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End
  Behavior = ExperienceScalarUpgrade ModuleTag_Upgrade01
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = ObjectCreationUpgrade ModuleTag_Upgrade02
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_Upgrade03
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_Upgrade04
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_Prod01
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Behavior = FireWeaponUpdate ModuleTag_22
    Weapon = MicrowaveTankEmitterWeapon
    ExclusiveWeaponDelay = 1000 ; If we fire a real weapon, we turn this module off for this long
  End

  Behavior = CommandButtonHuntUpdate  ModuleTag_24 ; allows use of command button hunt script with this unit. 
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 1.0    
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankHoverTank

  ; *** ART Parameters ***
  SelectPortrait         = SAHoverTank_L
  ButtonImage            = SAHoverTank
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01
    ConditionState = NONE
      Model = AVCrusader
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
      TransitionKey = TRANS_Drive
    End
    ConditionState = MOVING
      Model = AVCrusader
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      TransitionKey = TRANS_Drive
      ParticleSysBone = TreadFX01 QuadCannonDust
      ParticleSysBone = TreadFX02 QuadCannonDust
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = REALLYDAMAGED
      Model = AVCrusader_D
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      TransitionKey = TRANS_DriveDamaged
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    AliasConditionState = DAMAGED
    AliasConditionState = MOVING DAMAGED
    AliasConditionState = MOVING REALLYDAMAGED
    ConditionState = RUBBLE
      Model = AVCrusader_D
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE
      Model = AVCrusader_H
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      TransitionKey = TRANS_Hover
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE MOVING
      Model = AVCrusader_H
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      ParticleSysBone = TreadFX01 QuadCannonDust
      ParticleSysBone = TreadFX02 QuadCannonDust
      TransitionKey = TRANS_Hover
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    TransitionState = TRANS_Drive TRANS_Hover
      Model = AVCrusader_A
      HideSubObject = TurretFX01
      Animation = AVCRUSADER_A.AVCRUSADER_A
      AnimationMode = ONCE
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE REALLYDAMAGED
      Model = AVCrusader_D
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      TransitionKey = TRANS_HoverDamaged
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    AliasConditionState = WEAPONSET_PLAYER_UPGRADE DAMAGED
    AliasConditionState = WEAPONSET_PLAYER_UPGRADE MOVING DAMAGED
    AliasConditionState = WEAPONSET_PLAYER_UPGRADE MOVING REALLYDAMAGED
    ConditionState = WEAPONSET_PLAYER_UPGRADE RUBBLE
      Model = AVCrusader_H
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    TransitionState = TRANS_DriveDamaged TRANS_HoverDamaged
      Model = AVCrusader_A
      HideSubObject = TurretFX01
      Animation = AVCRUSADER_A.AVCRUSADER_A
      AnimationMode = ONCE
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE OVER_WATER
      Model = AVCrusader_H
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      ParticleSysBone = None AmphibWaveRest
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE OVER_WATER REALLYDAMAGED
      Model = AVCrusader_D
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      ParticleSysBone = None AmphibWaveRest
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE MOVING OVER_WATER
      Model = AVCrusader_H
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      ParticleSysBone = TreadFX01 AmphibWave
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = WEAPONSET_PLAYER_UPGRADE MOVING OVER_WATER REALLYDAMAGED
      Model = AVCrusader_D
      Turret = Turret
      WeaponFireFXBone = PRIMARY TurretMS
      WeaponRecoilBone = PRIMARY Barrel
      WeaponMuzzleFlash = PRIMARY TurretFX
      WeaponLaunchBone = PRIMARY TurretMS
      ParticleSysBone = TreadFX01 AmphibWave
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
   TrackMarks = EXTnkTrack.tga
   OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName            = OBJECT:HoverTank
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None 
    Weapon               = PRIMARY HoverCrusaderTankGun
    Weapon               = SECONDARY MediumGenericTankMachineGun
  PreferredAgainst     = SECONDARY     INFANTRY
  End
  WeaponSet
    Conditions           = PLAYER_UPGRADE 
    Weapon               = PRIMARY HoverCrusaderTankGun
    Weapon               = SECONDARY MediumGenericTankMachineGun
  PreferredAgainst     = SECONDARY     INFANTRY
  End
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End
  BuildCost              = 1000
  BuildTime              = 10.0          ;in seconds    
  VisionRange            = 150
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaStrategyCenter
    Object = AmericaAirfield
  End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankHoverCrusaderCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = PaladinTankVoiceMove
  VoiceMove             = CrusaderTankVoiceMove
  VoiceGuard            = CrusaderTankVoiceMove
  VoiceAttack           = CrusaderTankVoiceAttack
  SoundMoveStart        = PaladinTankMoveStart
  SoundMoveStartDamaged = PaladinTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = PaladinTankVoiceCreate
    VoiceEnter          = PaladinTankVoiceMove
    TurretMoveStart     = NoSound
    TurretMoveLoop      = NukeCannonTurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = PaladinTankVoiceCrush
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 500
    InitialHealth   = 500

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate       = 180 ;90   // turn rate, in degrees per sec
      ControlledWeaponSlots= PRIMARY SECONDARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  
  Locomotor = SET_NORMAL CrusaderLocomotor
  Locomotor = SET_NORMAL_UPGRADED HoverCrusaderLocomotor
  
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 35.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    ;OCL = MIDPOINT OCL_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_CrusaderTurret
  End

  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_11
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 2000
    DestructionDelayVariance  = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    ;OCL = FINAL    OCL_GenericTankDeathEffect  
    FX  = FINAL    FX_GenericTankDeathExplosion
  End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = WeaponSetUpgrade ModuleTag_23
    TriggeredBy = Upgrade_AmericaCrusaderHover
  End
  
  Behavior = LocomotorSetUpgrade ModuleTag_22
    TriggeredBy = Upgrade_AmericaCrusaderHover
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 1.05    
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankAdvCrusader

  ; *** ART Parameters ***
  SelectPortrait         = SACrusader_L
  ButtonImage            = SACrusader
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  UpgradeCameo5 = Upgrade_AmericaTOWMissile

  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVLeopart3
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState = WEAPONSET_PLAYER_UPGRADE
      Model = AVLeopart3
    End

    ConditionState       = REALLYDAMAGED
      Model              = AVLeopart3_D
    End
    
    ConditionState       = RUBBLE
      Model              = AVLeopart3_D
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:AdvCrusader
  Side             = America
  EditorSorting    = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY CrusaderTankGun
    Weapon               = SECONDARY HeavyGenericTankMachineGun
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE
    Weapon = PRIMARY CrusaderTankGun
    Weapon = SECONDARY TOWMissileWeapon
    Weapon               = TERTIARY HeavyGenericTankMachineGun
    PreferredAgainst     = TERTIARY     INFANTRY
  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  ArmorSet
    Conditions      = PLAYER_UPGRADE
    Armor           = UpgradedTankArmor
    DamageFX        = TankDamageFX
  End
  BuildCost       = 1200
  BuildTime       = 14.0          ;in seconds    
  VisionRange     = 250
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End

  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level

  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankAdvCrusaderCommandSet
    
  ; *** AUDIO Parameters ***
  VoiceSelect = CrusaderTankVoiceSelect
  VoiceMove = CrusaderTankVoiceMove
  VoiceGuard = CrusaderTankVoiceMove
  VoiceAttack = CrusaderTankVoiceAttack
  SoundMoveStart = CrusaderTankMoveStart
  SoundMoveStartDamaged = CrusaderTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = CrusaderTankVoiceCreate
    TurretMoveLoop = OverlordTankTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = CrusaderTankVoiceCrush
    VoiceEnter = CrusaderTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 600.0
    InitialHealth   = 600.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 1000
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 180 ;90   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL CrusaderLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  
  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
;    ModifierBonusPerOverkillPercent = 30%  ; negative means less likely to pick this in the face of much damage, positive means more likely
    DestructionDelay = 500
    DestructionDelayVariance = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_AdvCrusaderDeathEffect;OCL_CrusaderTankDeathEffect
  End
  
  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_06
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_AdvCrusaderDeathEffect;OCL_CrusaderTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion 
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End 

  Behavior = ProductionUpdate ModuleTag_10
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_11
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = DestroyDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End
  Behavior = EjectPilotDie ModuleTag_17
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = WeaponSetUpgrade ModuleTag_18
    TriggeredBy = Upgrade_AmericaTOWMissile
  End

  Behavior = ArmorUpgrade ModuleTag_19
    TriggeredBy = Upgrade_AmericaCompositeArmor
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 1.05    
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
;China Supply Truck
Object AmericaVehicleSupplyTruck

  ; *** ART Parameters ***
  
  SelectPortrait         = SAPowTruck
  ButtonImage            = SAPowTruck_L
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes
    
    DefaultConditionState
      Model           = avsupplytk
      HideSubObject   = Cargo01
    End
    
    ConditionState    = REALLYDAMAGED
      Model           = avsupplytk_d
    End
    
    ConditionState    = RUBBLE
      Model           = avsupplytk_d
    End
    
    ConditionState    = CARRYING
      ShowSubObject   = Cargo01
    End
    
    ConditionState    = REALLYDAMAGED CARRYING
      Model           = avsupplytk_d
      ShowSubObject   = Cargo01
    End
    
    ConditionState    = RUBBLE CARRYING
      Model           = avsupplytk_d
      ShowSubObject   = Cargo01
    End
    
    TrackMarks              = EXTireTrack.tga

    LeftFrontTireBone           = Tire01
    RightFrontTireBone          = Tire02
    MidLeftFrontTireBone        = Tire03
    MidRightFrontTireBone       = Tire04
    MidLeftRearTireBone         = Tire05
    MidRightRearTireBone        = Tire06
    LeftRearTireBone            = Tire07
    RightRearTireBone           = Tire08
    TireRotationMultiplier      = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition  = 2.5   ; This speed is added to the rotation speed when powersliding.

    Dust                    = RocketBuggyDust
    DirtSpray               = RocketBuggyDirtSpray
    PowerslideSpray         = RocketBuggyDirtPowerSlide

  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:SupplyTruck
  Side                = America
  EditorSorting       = VEHICLE
  TransportSlotCount  = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  BuildCost           = 700
  BuildTime           = 10.0      ;in seconds
  VisionRange         = 150
  ShroudClearingRange = 300
  ArmorSet
    Conditions      = None
    Armor           = TruckArmor
    DamageFX        = TankDamageFX
  End
  CrusherLevel            = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel          = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet              = ChinaSupplyTruckCommandSet
  ; *** AUDIO Parameters ***
  VoiceSelect     = ChinookVoiceSelect
  VoiceMove       = ChinookVoiceMove
  VoiceAttack     = ChinookVoiceAttack
  ;SoundAmbient    = ChinookAmbientLoop
  SoundAmbientRubble    = NoSound
  SoundEnter      = HumveeEnter
  SoundExit       = HumveeExit
  UnitSpecificSounds
    VoiceCreate         = ChinookVoiceCreate
    VoiceSupply         = ChinookVoiceSupply
    VoiceUnload         = ChinookVoiceUnload
    VoiceCombatDrop     = ChinookVoiceCombatDrop
    VoiceClearBuilding  = RangerVoiceClearBuilding ;Special combat drop that clears buildings!
    VoiceGarrison       = ChinookVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  ;@todo lorenzen removed the CAN_ATTACK from the chinasupplytruck... ok?
  KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS VEHICLE HARVESTER SCORE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 300.0
    InitialHealth   = 300.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 600
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = SupplyTruckAIUpdate ModuleTag_03
    MaxBoxes = 7
    SupplyCenterActionDelay = 500     ; ms for whole thing (one transaction)
    SupplyWarehouseActionDelay = 1000 ; ms per box (many small transactions)
    SupplyWarehouseScanDistance = 700 ;350 ; Max distance to look for a warehouse, or we go home.  (Direct dock command on warehouse overrides, and no max on Center Scan)
    SuppliesDepletedVoice = ChinookVoiceSuppliesDepleted
  End
  Locomotor = SET_NORMAL SupplyTruckLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 5.0
  End

  ExperienceValue    = 50 50 50 50 ;Experience point value at each level

  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay = 200
    DestructionDelayVariance = 100
    FX  = FINAL    FX_SupplyTruckExplosionOneFinal
    OCL = FINAL    OCL_ChinaSupplyTruckDeathEffect
  End
    
  Behavior = FXListDie ModuleTag_06
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  
  Behavior = CreateObjectDie ModuleTag_07
    DeathTypes = NONE +CRUSHED +SPLATTED
    ;CreationList = OCL_ChinaSupplyTruck_CrushEffect
  End

  Behavior                       = TransitionDamageFX ModuleTag_08
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1         = Loc: X:0 Y:0 Z:0 FXList:FX_NukeCannonDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_10
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  ; A crushing defeat
  Behavior = DestroyDie ModuleTag_11
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior        = CreateCrateDie ModuleTag_12
    CrateData     = SalvageCrateData
  End

  Geometry = BOX
  GeometryMajorRadius = 17.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 14.0
  Scale = 1.0     
  GeometryIsSmall = No
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length    

End

;------------------------------------------------------------------------------
;China Supply Truck
Object AmericaVehiclePTVTruck

  ; *** ART Parameters ***
  
  SelectPortrait         = SAST_L
  ButtonImage            = SAST
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTruckDraw ModuleTag_01
    OkToChangeModelColor = Yes
    
    DefaultConditionState
      Model           = AVST
      HideSubObject   = Cargo01
    End
    
    ConditionState    = REALLYDAMAGED
      Model           = AVSTD
    End
    
    ConditionState    = RUBBLE
      Model           = AVSTD
    End
    
    ConditionState    = CARRYING
      ShowSubObject   = Cargo01
    End
    
    ConditionState    = REALLYDAMAGED CARRYING
      Model           = AVSTD
      ShowSubObject   = Cargo01
    End
    
    ConditionState    = RUBBLE CARRYING
      Model           = AVSTD
      ShowSubObject   = Cargo01
    End
    
    TrackMarks              = EXTireTrack.tga

    LeftFrontTireBone           = Tire01
    RightFrontTireBone          = Tire02
    MidLeftRearTireBone         = Tire03
    MidRightRearTireBone        = Tire04
    LeftRearTireBone            = Tire05
    RightRearTireBone           = Tire06
    TireRotationMultiplier      = 0.2   ; this * speed = rotation.
    PowerslideRotationAddition  = 2.5   ; This speed is added to the rotation speed when powersliding.

    Dust                    = RocketBuggyDust
    DirtSpray               = RocketBuggyDirtSpray
    PowerslideSpray         = RocketBuggyDirtPowerSlide

  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:PTVTruck
  Side                = America
  EditorSorting       = VEHICLE
  TransportSlotCount  = 4                 ;how many "slots" we take in a transport (0 == not transportable)
  BuildCost           = 900
  BuildTime           = 10.0      ;in seconds
  VisionRange         = 150
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaCommandCenter
    Object = AmericaBarracks
  End
  ArmorSet
    Conditions      = None
    Armor           = TruckArmor
    DamageFX        = TankDamageFX
  End
  CrusherLevel            = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel          = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet              = AmericaVehiclePTVTruckCommandSet
  ; *** AUDIO Parameters ***
  VoiceSelect     = ChinookVoiceSelect
  VoiceMove       = ChinookVoiceMove
  VoiceAttack     = ChinookVoiceAttack
  ;SoundAmbient    = ChinookAmbientLoop
  SoundAmbientRubble    = NoSound
  SoundMoveStart = HumveeMoveStart
  SoundMoveStartDamaged = HumveeMoveStart
  SoundEnter      = HumveeEnter
  SoundExit       = HumveeExit
  UnitSpecificSounds
    VoiceCreate         = ChinookVoiceCreate
    VoiceSupply         = ChinookVoiceSupply
    VoiceUnload         = ChinookVoiceUnload
    VoiceCombatDrop     = ChinookVoiceCombatDrop
    VoiceClearBuilding  = RangerVoiceClearBuilding ;Special combat drop that clears buildings!
    VoiceGarrison       = ChinookVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  ;@todo lorenzen removed the CAN_ATTACK from the chinasupplytruck... ok?
  KindOf = PRELOAD SELECTABLE CAN_CAST_REFLECTIONS VEHICLE HARVESTER SCORE TRANSPORT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 300.0
    InitialHealth   = 300.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 600
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End
  Behavior = SupplyTruckAIUpdate ModuleTag_03
    MaxBoxes = 4
    SupplyCenterActionDelay = 500     ; ms for whole thing (one transaction)
    SupplyWarehouseActionDelay = 1000 ; ms per box (many small transactions)
    SupplyWarehouseScanDistance = 700 ;350 ; Max distance to look for a warehouse, or we go home.  (Direct dock command on warehouse overrides, and no max on Center Scan)
    SuppliesDepletedVoice = ChinookVoiceSuppliesDepleted
  End
  Locomotor = SET_NORMAL SupplyTruckLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 5.0
  End

  ExperienceValue    = 50 50 50 50 ;Experience point value at each level

Behavior = TransportContain ModuleTag_160
    Slots                 = 8
    InitialPayload        = AmericaInfantrySESoldier 4
    ScatterNearbyOnExit   = Yes
    HealthRegen%PerSec    = 3
    DamagePercentToUnits  = 25%
    AllowInsideKindOf     = INFANTRY
    ExitDelay         = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End

  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay = 200
    DestructionDelayVariance = 100
    FX  = FINAL    FX_SupplyTruckExplosionOneFinal
    OCL = FINAL    OCL_ChinaSupplyTruckDeathEffect
  End
    
  Behavior = FXListDie ModuleTag_06
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  
  Behavior = CreateObjectDie ModuleTag_07
    DeathTypes = NONE +CRUSHED +SPLATTED
    ;CreationList = OCL_ChinaSupplyTruck_CrushEffect
  End

  Behavior                       = TransitionDamageFX ModuleTag_08
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1         = Loc: X:0 Y:0 Z:0 FXList:FX_NukeCannonDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_10
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  ; A crushing defeat
  Behavior = DestroyDie ModuleTag_11
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior        = CreateCrateDie ModuleTag_12
    CrateData     = SalvageCrateData
  End

  Geometry = BOX
  GeometryMajorRadius = 17.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 14.0     
  GeometryIsSmall = No
  Scale = 0.95 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length    

End

;------------------------------------------------------------------------------
Object AmericaTankM48A1 ;now used by GLA

  ; *** ART Parameters ***
  SelectPortrait         = SAM48A1_L
  ButtonImage            = SAM48A1
  
  ;UpgradeCameo1 = Upgrade_AmericaBattleDrone
  ;UpgradeCameo2 = Upgrade_AmericaScoutDrone
  ;UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  ;UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  ;UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01

    DefaultConditionState
      Model               = AVM48
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState = REALLYDAMAGED
      Model              = AVM48d
    End
    ConditionState       = RUBBLE
      Model              = AVM48d
    End

    TrackMarks           = EXTnkTrack.tga
    OkToChangeModelColor = Yes
    TreadAnimationRate = 2.0;  amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
  End

  ; ***DESIGN parameters ***
  DisplayName            = OBJECT:M48A1 Patton
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None 
    Weapon               = PRIMARY M48TankGun
    Weapon               = SECONDARY LightGenericTankMachineGun
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions           = PLAYER_UPGRADE
  ;  Armor                = UpgradedTankArmor
  ;  DamageFX             = TankDamageFX
  ;End
  BuildCost              = 1100
  BuildTime              = 10.0          ;in seconds    
  VisionRange            = 190
  ShroudClearingRange = 300
  ;Prerequisites
    ;Object = GLAPalace
    ;Object = GLAChopShop
  ;End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankCrusaderCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = CrusaderTankVoiceMove
  VoiceMove             = CrusaderTankVoiceMove
  VoiceGuard            = CrusaderTankVoiceMove
  VoiceAttack           = CrusaderTankVoiceAttack
  SoundMoveStart        = BattleMasterTankMoveStart
  SoundMoveStartDamaged = BattleMasterTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = CrusaderTankVoiceCreate
    VoiceEnter             = CrusaderTankVoiceMove
    TurretMoveStart     = NoSound
    TurretMoveLoop      = OverlordTankTurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = CrusaderTankVoiceCrush
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 540
    InitialHealth   = 540

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate       = 110 ;90 Trying to be realistic  // turn rate, in degrees per sec
      ControlledWeaponSlots= PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL M60Locomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_CrusaderCatchFire
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_GenericTankDeathEffect
    FX  = MIDPOINT FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_M48TankDeathEffect
  End

  ; Catch fire, and explode death
  ;Behavior = SlowDeathBehavior ModuleTag_11
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 2000
    ;DestructionDelayVariance  = 300
    ;FX  = INITIAL  FX_CrusaderCatchFire
    ;OCL = FINAL    OCL_GenericTankDeathEffect  
    ;FX  = FINAL    FX_GenericTankDeathExplosion
  ;End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  ;Behavior = EjectPilotDie ModuleTag_17
    ;GroundCreationList = OCL_EjectPilotOnGround
    ;AirCreationList = OCL_EjectPilotViaParachute
    ;ExemptStatus = HIJACKED
    ;VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  ;End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_GLATankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 0.88     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankM60

  ; *** ART Parameters ***
  SelectPortrait         = SAM601_L
  ButtonImage            = SAM601
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVM60
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End

    ConditionState       = REALLYDAMAGED
      Model              = AVM60d
    End
    ConditionState       = RUBBLE
      Model              = AVM60d
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName            = OBJECT:M60 Patton
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None 
    Weapon               = PRIMARY M60TankGun
    Weapon               = SECONDARY MediumGenericTankMachineGun
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions           = PLAYER_UPGRADE
  ;  Armor                = UpgradedTankArmor
  ;  DamageFX             = TankDamageFX
  ;End
  BuildCost              = 950
  BuildTime              = 16.0          ;in seconds    
  VisionRange            = 190
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankCrusaderCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = CrusaderTankVoiceMove
  VoiceMove             = CrusaderTankVoiceMove
  VoiceGuard            = CrusaderTankVoiceMove
  VoiceAttack           = CrusaderTankVoiceAttack
  SoundMoveStart        = BattleMasterTankMoveStart
  SoundMoveStartDamaged = BattleMasterTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = CrusaderTankVoiceCreate
    VoiceEnter             = CrusaderTankVoiceMove
    TurretMoveStart     = NoSound
    TurretMoveLoop      = OverlordTankTurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = CrusaderTankVoiceCrush
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 600
    InitialHealth   = 600

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate       = 140 ;90 Trying to be realistic  // turn rate, in degrees per sec
      ControlledWeaponSlots= PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL M60Locomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_CrusaderCatchFire
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_GenericTankDeathEffect
    FX  = MIDPOINT FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_M48TankDeathEffect
  End

  ; Catch fire, and explode death
   ;Behavior = SlowDeathBehavior ModuleTag_11
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 2000
    ;DestructionDelayVariance  = 300
    ;FX  = INITIAL  FX_CrusaderCatchFire
    ;OCL = FINAL    OCL_GenericTankDeathEffect  
    ;FX  = FINAL    FX_GenericTankDeathExplosion
  ;End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection01 OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 0.88     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankBradley

  ; *** ART Parameters ***
  SelectPortrait         = SACBradley_L
  ButtonImage            = SACBradley
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  UpgradeCameo5 = Upgrade_AmericaTOWMissile

  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVBradley1
      Animation           = AVBradley1.AVBradley1
      AnimationMode       = ONCE
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY Muzzlefx
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY Muzzlefx
      ;WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = TERTIARY TurretMS
      WeaponLaunchBone = TERTIARY TurretMS
    End
    ConditionState        = REALLYDAMAGED
      Model               = AVBradley1d
      Animation           = AVBradley1d.AVBradley1d
      AnimationMode       = ONCE
      ;Turret              = Turret
      ;WeaponFireFXBone    = PRIMARY TurretMS
      ;WeaponRecoilBone    = PRIMARY Barrel
      ;WeaponMuzzleFlash   = PRIMARY Muzzlefx
      ;WeaponLaunchBone = PRIMARY TurretMS
      ;WeaponFireFXBone    = TERTIARY TurretMS
      ;WeaponLaunchBone = TERTIARY TurretMS
    End
    ConditionState       = RUBBLE
      Model              = AVBradley1d
      IdleAnimation       = AVBradley1d.AVBradley1d 
      AnimationMode       = ONCE   
      ;Turret              = Turret
      ;WeaponFireFXBone    = PRIMARY TurretMS
      ;WeaponRecoilBone    = PRIMARY Barrel
      ;WeaponMuzzleFlash   = PRIMARY Muzzlefx
      ;WeaponLaunchBone = PRIMARY TurretMS
      ;WeaponFireFXBone    = TERTIARY TurretMS
      ;WeaponLaunchBone = TERTIARY TurretMS
    End
    ConditionState        = MOVING
          Model               = AVBradley1t
          Animation           = AVBradley1t.AVBradley1t
          AnimationMode       = ONCE
    End
    ConditionState        = MOVING REALLYDAMAGED
          Model               = AVBradley1dt
          Animation           = AVBradley1dt.AVBradley1dt
          AnimationMode       = ONCE
          ;Turret              = Turret
          ;WeaponFireFXBone    = PRIMARY TurretMS
          ;WeaponRecoilBone    = PRIMARY Barrel
          ;WeaponMuzzleFlash   = PRIMARY Muzzlefx
          ;WeaponLaunchBone = PRIMARY TurretMS
          ;WeaponFireFXBone    = TERTIARY TurretMS
          ;WeaponLaunchBone = TERTIARY TurretMS
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:Bradley
  Side             = America
  EditorSorting    = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon               = PRIMARY BradleyTankGun
    Weapon               = SECONDARY LightGenericTankMachineGun
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE
    Weapon               = PRIMARY BradleyTankGun
    Weapon               = SECONDARY LightGenericTankMachineGun
    Weapon               = TERTIARY  BradleyTOWMissileWeapon
    PreferredAgainst     = SECONDARY     INFANTRY
  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  ArmorSet
    Conditions      = PLAYER_UPGRADE
    Armor           = UpgradedTankArmor
    DamageFX        = TankDamageFX
  End
  BuildCost       = 1000
  BuildTime       = 16.0          ;in seconds    
  VisionRange     = 250
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End

  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level

  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankBradleyCommandSet
    
  ; *** AUDIO Parameters ***
  VoiceSelect = PaladinTankVoiceMove
  VoiceMove = PaladinTankVoiceMove
  VoiceGuard = PaladinTankVoiceMove
  VoiceAttack = PaladinTankVoiceAttack
  SoundMoveStart = PaladinTankMoveStart
  SoundMoveStartDamaged = PaladinTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  SoundEnter      = HumveeEnter
  SoundExit       = HumveeExit
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = PaladinTankVoiceCreate
    TurretMoveLoop = NukeCannonTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = PaladinTankVoiceCrush
    VoiceEnter = PaladinTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE TRANSPORT
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 520.0
    InitialHealth   = 520.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 1000
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 130 ;90   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
    End
    ;AltTurret
      ;TurretTurnRate = 0
      ;ControlledWeaponSlots = TERTIARY
    ;End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL M3BradleyLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End

  Behavior = TransportContain  ModuleTag_05
    PassengersAllowedToFire = No
    Slots             = 6
    ;EnterSound          = GarrisonEnter
    ;ExitSound           = GarrisonExit
    ScatterNearbyOnExit   = Yes
    DamagePercentToUnits = 100% ;10%
    AllowInsideKindOf  = INFANTRY
    ExitDelay = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End
  
  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_06
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
;    ModifierBonusPerOverkillPercent = 30%  ; negative means less likely to pick this in the face of much damage, positive means more likely
    DestructionDelay = 500
    DestructionDelayVariance = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    ;OCL = FINAL    OCL_ChinaTankBattleMasterDebris
    OCL = FINAL    OCL_MicrowaveTankDeath
  End
  
  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_07
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_MicrowaveTankDeath
    FX  = FINAL    FX_GenericTankDeathExplosion 
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End 

  Behavior = ProductionUpdate ModuleTag_10
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_11
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = DestroyDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End
  Behavior = EjectPilotDie ModuleTag_17
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = WeaponSetUpgrade ModuleTag_18
    TriggeredBy = Upgrade_AmericaTOWMissile
  End

  Behavior = ArmorUpgrade ModuleTag_19
    TriggeredBy = Upgrade_AmericaCompositeArmor
  End

  Behavior = FlammableUpdate ModuleTag_20
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.93     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End


;------------------------------------------------------------------------------
Object AmericaTankM88

  ; *** ART Parameters ***
  SelectPortrait         = SACM88_L
  ButtonImage            = SACM88
  
  ;UpgradeCameo1 = Upgrade_AmericaBattleDrone
  ;UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVM88
      Animation           = AVM88.AVM88
      AnimationMode       = ONCE
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY Barrel
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY Barrel
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY TurretMS
      WeaponLaunchBone = SECONDARY TurretMS
    End

    ConditionState = PREATTACK_A
      Model             = AVM88t
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      ParticleSysBone   = DIRTFX01 DozerDirtFall ;gush of dirt
      TransitionKey     = TRANS_DIGGING_DAMAGED
    End

    ConditionState        = REALLYDAMAGED
      Model               = AVM88dt
      Animation           = AVM88dt.AVM88dt
      AnimationMode       = ONCE
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY Muzzlefx
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY TurretMS
      WeaponLaunchBone = SECONDARY TurretMS
    End
    ConditionState       = RUBBLE
      Model              = AVAVM88dt
      IdleAnimation       = AVM88dt.AVM88dt
      AnimationMode       = ONCE   
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY Muzzlefx
      WeaponLaunchBone = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY TurretMS
      WeaponLaunchBone = SECONDARY TurretMS
    End

    ConditionState = PREATTACK_A REALLYDAMAGED RUBBLE
      Model             = AVM88dt
      ParticleSysBone   = EXHAUSTFX01 DozerSmokeHeavy
      ParticleSysBone   = DIRTFX01 DozerDirtFall ;gush of dirt
      TransitionKey     = TRANS_DIGGING_DAMAGED
    End

    ConditionState        = MOVING
          Model               = AVM88t
          Animation           = AVM88t.AVM88t
          AnimationMode       = ONCE
    End
    ConditionState        = MOVING REALLYDAMAGED
          Model               = AVM88dt
          Animation           = AVM88dt.AVM88dt
          AnimationMode       = ONCE
          ;Turret              = Turret
          ;WeaponFireFXBone    = PRIMARY TurretMS
          ;WeaponRecoilBone    = PRIMARY Barrel
          ;WeaponMuzzleFlash   = PRIMARY Muzzlefx
          ;WeaponLaunchBone = PRIMARY TurretMS
          ;WeaponFireFXBone    = SECONDARY TurretMS
          ;WeaponLaunchBone = SECONDARY TurretMS
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:M88
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None
  End
  WeaponSet
    Conditions = MINE_CLEARING_DETAIL 
    Weapon = PRIMARY DozerMineDisarmingWeapon
  End

  ArmorSet
    Conditions        = None
    Armor             = DozerArmor ;Special Explosion-Proof Armor
    DamageFX          = TankDamageFX
  End

  BuildCost              = 1100
  BuildTime              = 10.0          ;in seconds
  VisionRange            = 150
  ShroudClearingRange = 300
  ExperienceValue = 50 50 100 150   ;Experience point value at each level
  ExperienceRequired = 0 100 150 300  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaTankM88CommandSet

  ;Prerequisites
    ;Object = AmericaCommandCenter
  ;End

 ; *** AUDIO Parameters ***
  VoiceSelect         = DozerUSAVoiceRepair
  VoiceMove           = DozerUSAVoiceMove
  VoiceGuard          = DozerUSAVoiceMove
  VoiceTaskComplete   = DozerUSAVoiceBuildComplete
  SoundMoveStart      = DozerUSAMoveStart
  SoundMoveStartDamaged = DozerUSAMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    VoiceCreate           = DozerUSAVoiceCreate
    VoiceNoBuild          = DozerUSAVoiceBuildNot
    VoiceCrush            = DozerUSAVoiceCrush
    VoiceRepair           = DozerUSAVoiceRepair
    VoiceDisarm           = DozerUSAVoiceClearMine
    TruckLandingSound     = NoSound
    TruckPowerslideSound  = NoSound
    VoiceEnter            = DozerUSAVoiceMove
    VoiceBuildResponse    = DozerUSAVoiceBuild
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority       = UNIT
  KindOf              = PRELOAD VEHICLE SCORE SELECTABLE CAN_CAST_REFLECTIONS ;DOZER
 
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 200
    InitialHealth   = 200
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate       = 180 ;60   // turn rate, in degrees per sec
      ControlledWeaponSlots= PRIMARY 
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL CrusaderLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End
   
  Behavior = ObjectCreationUpgrade ModuleTag_05
      UpgradeObject = OCL_AmericanBattleDrone
      TriggeredBy   = Upgrade_AmericaBattleDrone
      ConflictsWith = Upgrade_AmericaScoutDrone
  End

  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone
  End
  
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1 ; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  ;Behavior = SlowDeathBehavior ModuleTag_10
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 500
    ;DestructionDelayVariance  = 100
    ;FX  = INITIAL  FX_GenericTankDeathEffect
    ;OCL = MIDPOINT OCL_GenericTankDeathEffect
    ;OCL = FINAL OCL_MicrowaveTankDeath
  ;End

  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_11
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 2000
    DestructionDelayVariance  = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = INITIAL OCL_MicrowaveTankDeath
    FX  = FINAL    FX_GenericTankDeathExplosion
  End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior = StealthDetectorUpdate ModuleTag_120
    DetectionRate            = 900   ; how often to rescan for stealthed things in my sight (msec)
    DetectionRange           = 175 ;Dustin, enable this for independant balancing!
  End

  Behavior = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End
  
  Behavior = AutoHealBehavior ModuleTag_22
          HealingAmount     = 10
          HealingDelay      = 1000 ; msec
          Radius            = 300.0f
          StartsActive      = Yes
          KindOf            = VEHICLE
  End
  
  ;Behavior = DozerAIUpdate ModuleTag_23
    ;RepairHealthPercentPerSecond = 2%    ; % of max health to repair each second
    ;BoredTime                    = 5000  ; in milliseconds
    ;BoredRange                   = 150   ; when bored, we look this far away to do something
     ;the only "enemies" that workers can acquire are mines, to be disarmed...
    ;AutoAcquireEnemiesWhenIdle   = Yes
  ;End
  
  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 1.02     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object AmericaTankLTVP

  ; *** ART Parameters ***
  SelectPortrait         = SAAmtrack_L
  ButtonImage            = SAAmtrack
  
  ;UpgradeCameo1 = Upgrade_GLAJunkRepair
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTruckDraw ModuleTag_010
    OkToChangeModelColor = Yes
    ConditionState = NONE
      Model = AVLTVP
      Turret = Turret
      WeaponFireFXBone = PRIMARY MuzzleFX
      WeaponLaunchBone = PRIMARY MuzzleFX
      ;note, the IRSonar particle system is added in StealthDetectorUpdate.cpp, not here
    End
   ConditionState = OVER_WATER
    Model = AVLTVPw
    Turret = Turret
    WeaponFireFXBone = PRIMARY MuzzleFX
    WeaponLaunchBone = PRIMARY MuzzleFX
    ParticleSysBone = TreadFX01 AmphibWaveRest
    End
    
   ConditionState = MOVING OVER_WATER
        Model = AVLTVPw
        Turret = Turret
        WeaponFireFXBone = PRIMARY MuzzleFX
        WeaponLaunchBone = PRIMARY MuzzleFX
        ParticleSysBone = Mist01 AmphibMist
        ParticleSysBone = Mist02 AmphibMist
        ParticleSysBone = Mist03 AmphibMistSide
        ParticleSysBone = Mist04 AmphibMistSide
        ParticleSysBone = TreadFX01 AmphibWave
        ParticleSysBone = TreadFX02 AmphibWave
    End
    
    ConditionState = MOVING
        Model = AVLTVP
        Turret = Turret
        WeaponFireFXBone = PRIMARY MuzzleFX
        WeaponLaunchBone = PRIMARY Muzzle
    End
    
     ConditionState = MOVING REALLYDAMAGED RUBBLE
        Model = AVLTVPd
        Turret = Turret
        WeaponFireFXBone = PRIMARY MuzzleFX
        WeaponLaunchBone = PRIMARY MuzzleFX
      End
    
    ConditionState       = MOVING OVER_WATER REALLYDAMAGED RUBBLE
        Model            = AVLTVPdw
        Turret           = Turret
        WeaponFireFXBone = PRIMARY MuzzleFX
        WeaponLaunchBone = PRIMARY MuzzleFX
        ParticleSysBone = Mist01 AmphibMist
        ParticleSysBone = Mist02 AmphibMist
        ParticleSysBone = Mist03 AmphibMistSide
        ParticleSysBone = Mist04 AmphibMistSide
        ParticleSysBone = TreadFX01 AmphibWave
        ParticleSysBone = TreadFX02 AmphibWave
    End
    
   
    
    ConditionState       = OVER_WATER REALLYDAMAGED RUBBLE
        Model            = AVLTVPdw
        Turret           = Turret
        WeaponFireFXBone = PRIMARY MuzzleFX
        WeaponLaunchBone = PRIMARY MuzzleFX
        ParticleSysBone = TreadFX01 AmphibWaveRest
    End
    
     ConditionState       = REALLYDAMAGED RUBBLE ; THIS IS VERY IMPORTANT... DO NOT REMOVE 'RUBBLE' 
                                                ; @todo find out why a non-animating model like this has such trouble matching
                                                ; reallydamaged against moving against rubble, etc.
      Model              = AVLTVPd
      Turret             = Turret
      WeaponFireFXBone   = PRIMARY MuzzleFX
      WeaponLaunchBone   = PRIMARY MuzzleFX
    End

    TrackMarks = EXTnkTrack.tga

    Dust = RocketBuggyDust
    DirtSpray = RocketBuggyDirtSpray
    ; PowerslideSpray = RocketBuggyDirtPowerSlide doesn't powerslide

    ; These parameters are only used if the model has a separate suspension, 
    ; and the locomotor has HasSuspension = Yes.
    ;LeftFrontTireBone     = Wheel01
    ;RightFrontTireBone    = Wheel08
    ;LeftRearTireBone      = Wheel03
    ;RightRearTireBone     = Wheel05
    ;MidLeftFrontTireBone  = Wheel02
    ;MidRightFrontTireBone = Wheel07
    ;MidLeftRearTireBone   = Wheel04
    ;MidRightRearTireBone  = Wheel06

    ;TireRotationMultiplier      = 0.2   ; this * speed = rotation.
    ;PowerslideRotationAddition  = 0   ; This vehicle doesn't powerslide.

  End


  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:LTVP
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 4                 ;Just enough to fit into a Chinook.
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY LTVPMachineGun
  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  BuildCost       = 1000
  BuildTime       = 19.0          ;in seconds    
  VisionRange     = 195           ;Needs to see farther and match it's weapon range -- else troop crawlers will get slaughtered against tanks!
  ShroudClearingRange = 400
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet = AmericaVehicleLTVPCommandSet

  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaBarracks
  End

; *** AUDIO Parameters ***
  VoiceSelect = PaladinTankVoiceMove
  VoiceMove = PaladinTankVoiceMove
  VoiceGuard = PaladinTankVoiceMove
  VoiceAttack = PaladinTankVoiceAttack
  SoundMoveStart = PaladinTankMoveStart
  SoundMoveStartDamaged = PaladinTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  SoundEnter = HumveeEnter
  SoundExit = HumveeExit

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = PaladinTankVoiceCreate
    ;TurretMoveLoop = NONE
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = PaladinTankVoiceCrush
    VoiceEnter = PaladinTankVoiceMove
    VoiceUnload = PaladinTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority       = UNIT
  KindOf              = PRELOAD VEHICLE SCORE SELECTABLE ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS TRANSPORT ;DOZER
 
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 260.0
   InitialHealth   = 260.0
  End
    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    ;SubdualDamageCap = 480
    ;SubdualDamageHealRate = 500
    ;SubdualDamageHealAmount = 50
  ;End
  Behavior = StealthDetectorUpdate ModuleTag_030
    DetectionRate             = 900   ; how often to rescan for stealthed things in my sight (msec)
    ;DetectionRange           = ??? ;Dustin, enable this for independant balancing!
    CanDetectWhileGarrisoned  = No ;Garrisoned means being in a structure that you units can shoot out of.
    CanDetectWhileContained   = No ;Contained means being in a transport or tunnel network.
    PingSound                 = IRPing
    LoudPingSound             = IRPingLoud
    IRParticleSysName         = IRDetectSonar
  ;;;  IRBrightParticleSysName   = IRDetectSonarBright
  ;;;  IRGridParticleSysName     = IRDetectGrid
  ;;;  IRBeaconParticleSysName   = IRLenzflare
    IRParticleSysBone         = IRFX
  End

;OBSOLETE
;  Behavior = AIUpdateInterface ModuleTag_04
;    Turret
;      ControlledWeaponSlots = PRIMARY
;    End
;  End
  Behavior = AssaultTransportAIUpdate ModuleTag_NewAI
    MembersGetHealedAtLifeRatio = 0.5
  End
  
  Behavior = AIUpdateInterface ModuleTag_01
      Turret
        TurretTurnRate        = 150
        TurretPitchRate       = 90
        AllowsPitch           = Yes
        NaturalTurretPitch    = 1  
        GroundUnitPitch       = 40
        MinPhysicalPitch      = -20
        RecenterTime = 2000   ; how long to wait during idle before recentering
        ControlledWeaponSlots = PRIMARY ;SECONDARY
    End
      AutoAcquireEnemiesWhenIdle = Yes
  End

  Locomotor = SET_NORMAL CrusaderLocomotor LTVPAmphibiousLocomotor
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 50.0
  End

  Behavior = TransportContain ModuleTag_06
    Slots                 = 8
    ;InitialPayload        = No Data
    ScatterNearbyOnExit   = Yes
    HealthRegen%PerSec    = 10
    DamagePercentToUnits  = 10%
    AllowInsideKindOf     = INFANTRY
    ExitDelay         = 250
    NumberOfExitPaths = 3 ; Defaults to 1.  Set 0 to not use ExitStart/ExitEnd, set higher than 1 to use ExitStart01-nn/ExitEnd01-nn
    GoAggressiveOnExit = Yes ; AI Will tell people to set their mood to Aggressive on exiting
  End

  Behavior = SlowDeathBehavior ModuleTag_07
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay = 1
    FX  = FINAL    FX_SupplyTruckExplosionOneFinal
    OCL = FINAL    OCL_LTVPFinalDeathDebris
  End

  Behavior                 = TransitionDamageFX ModuleTag_08
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_NukeCannonDamageTransition
  End

  Behavior = DestroyDie ModuleTag_09
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_10
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_11
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateCrateDie ModuleTag_12
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_13
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection01
    ExemptStatus = HIJACKED
  End
  
  ;Behavior = AutoHealBehavior ModuleTag_21
    ;HealingAmount     = 6
    ;HealingDelay      = 1000 ; msec
    ;Radius            = 300.0f
    ;StartsActive      = Yes
    ;KindOf            = INFANTRY
  ;End

  Behavior = FlammableUpdate ModuleTag_22
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 22.0
  GeometryMinorRadius = 9.0
  GeometryHeight = 13.0     
  GeometryIsSmall = No
  Scale = 0.97 
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length    

End

;------------------------------------------------------------------------------
Object AmericaTankAvengerGattlingTurret ; Seperate turret object so it can attack independantly

  ; *** ART Parameters ***
  SelectPortrait         = SNGatTower_L
  ButtonImage            = SAFSV
  
  UpgradeCameo1 = Upgrade_Nationalism
  UpgradeCameo2 = Upgrade_ChinaUraniumShells
  UpgradeCameo3 = Upgrade_ChinaNuclearTanks
  ;UpgradeCameo4 = NONE
  UpgradeCameo5 = Upgrade_ChinaOverlordPropagandaTower
  
  Draw                    = W3DDependencyModelDraw ModuleTag_01
    OkToChangeModelColor  = Yes
    AttachToBoneInContainer = FIREPOINT01

    DefaultConditionState
      Model               = FSV
      Turret              = TURRET01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
    End
    ConditionState        = CONTINUOUS_FIRE_SLOW
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      Turret              = TURRET01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
      AnimationSpeedFactorRange = 0.1 0.1 ;set this state to animate  s l o w l y
    End
     ConditionState       = CONTINUOUS_FIRE_MEAN
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      Turret              = TURRET01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
      AnimationSpeedFactorRange = 0.2 0.2 ;set this state to animate  medium-fast
    End
    ConditionState        = CONTINUOUS_FIRE_FAST
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      Turret              = TURRET01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
      AnimationSpeedFactorRange = 0.3 0.3 ;set this state to animate  vryfst
      ParticleSysBone    = Muzzle01 GattlingMuzzleSmoke
      ParticleSysBone    = Muzzle02 GattlingMuzzleSmoke
    End

    ConditionState        = REALLYDAMAGED 
      Model               = FSV
      Turret              = TURRET01
      TurretPitch         = TURRETEL
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
      ParticleSysBone     = Smoke01 SmokeFactionMedium
      ParticleSysBone     = Smoke02 SmokeFactionMedium
      ParticleSysBone     = Smoke03 SmokeFactionMedium
      ParticleSysBone     = SparkM01 SparksMedium
      ParticleSysBone     = SparkM02 SparksMedium
    End
    ConditionState        = CONTINUOUS_FIRE_SLOW REALLYDAMAGED 
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      AnimationSpeedFactorRange = 0.1 0.1 ;set this state to animate  s l o w l y
    End
     ConditionState       = CONTINUOUS_FIRE_MEAN REALLYDAMAGED 
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      AnimationSpeedFactorRange = 0.2 0.2 ;set this state to animate  medium-fast
    End
    ConditionState        = CONTINUOUS_FIRE_FAST REALLYDAMAGED 
      Model               = FSV
      Animation           = FSV.FSV
      AnimationMode       = LOOP
      AnimationSpeedFactorRange = 0.3 0.3 ;set this state to animate  vryfst
      ParticleSysBone    = Muzzle01 GattlingMuzzleSmoke
      ParticleSysBone    = Muzzle02 GattlingMuzzleSmoke
    End

  End

 PlacementViewAngle = -45

  ; ***DESIGN parameters ***
  Side             = America
  EditorSorting    = SYSTEM
  TransportSlotCount = 1
  
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY Avenger2PaintWeapon
    Weapon = SECONDARY GattlingBuildingGunAir
  End

  ArmorSet
    Conditions     = None
    Armor          = InvulnerableAllArmor ; We can't be hurt on the field.  We share damage from the Avenger with his damage module
  End
  VisionRange     = 300

  ; *** AUDIO Parameters ***
  UnitSpecificSounds
   TurretMoveStart = NoSound
    TurretMoveLoop  = NukeCannonTurretMoveLoop
 End

  ; *** ENGINEERING Parameters ***
 KindOf            = PRELOAD PORTABLE_STRUCTURE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CLICK_THROUGH IGNORED_IN_GUI
    Body            = StructureBody ModuleTag_02
    MaxHealth       = 180.0
    InitialHealth   = 180.0
 End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      ControlledWeaponSlots = PRIMARY SECONDARY
      TurretTurnRate      = 180   // turn rate, in degrees per sec
      TurretPitchRate     = 180
      AllowsPitch         = Yes
      NaturalTurretPitch  = 45
    End
    AutoAcquireEnemiesWhenIdle = Yes 
    MoodAttackCheckRate = 500 ; default is 2000
  End

  Behavior             = DestroyDie ModuleTag_05
    ;<No Data>
  End

  Geometry            = BOX
  GeometryMajorRadius = 6.0
  GeometryMinorRadius = 6.0
  GeometryHeight      = 10.0
  GeometryIsSmall     = No
  Scale = 0.91      
  Shadow              = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End


;------------------------------------------------------------------------------
Object AmericaTankM1A5Abrams

  ; *** ART Parameters ***
  SelectPortrait         = SAM1A1Abrams_L
  ButtonImage            = SAM1A1Abrams
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  UpgradeCameo5 = Upgrade_AmericaHallfireDrone

  Draw = W3DTankDraw ModuleTag_01
    
    ExtraPublicBone = Laser 

    ConditionState        = NONE
      Model               = AVLeopard2
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState        = REALLYDAMAGED
      Model               = AVLeopard2_D
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState        = RUBBLE
      Model               = AVLeopard2_D
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:M1A5Abrams
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY PaladinTankGun
  Weapon               = SECONDARY HeavyGenericTankMachineGun
  PreferredAgainst     = SECONDARY     INFANTRY

  End
  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions      = PLAYER_UPGRADE
  ;  Armor           = UpgradedTankArmor
  ;  DamageFX        = TankDamageFX
  ;End
  BuildCost       = 1300
  BuildTime       = 20.0          ;in seconds    
  VisionRange     = 250
  ShroudClearingRange = 320
  Prerequisites
    Object = AmericaWarFactory
    Science = SCIENCE_AbramsTank
End

  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level

  IsTrainable     = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaTankPaladinCommandSet
    
  ; *** AUDIO Parameters ***
  VoiceSelect = PaladinTankVoiceMove
  VoiceMove = PaladinTankVoiceMove
  VoiceGuard = PaladinTankVoiceMove
  VoiceAttack = PaladinTankVoiceAttack
  SoundMoveStart = InfernoCannonMoveStart
  SoundMoveStartDamaged = InfernoCannonMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = PaladinTankVoiceCreate
    TurretMoveLoop = OverlordTankTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = PaladinTankVoiceCrush
    VoiceEnter = PaladinTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 700.0
    InitialHealth   = 700.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 1000
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 160 ;90   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY
    End
    ;AltTurret
    ;  TurretTurnRate = 80;
    ;  ControlledWeaponSlots = SECONDARY
    ;End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL AbramsLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  
  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
;    ModifierBonusPerOverkillPercent = 30%  ; negative means less likely to pick this in the face of much damage, positive means more likely
    DestructionDelay = 500
    DestructionDelayVariance = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_AbramsTankDeathEffect
  End
  
  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_06
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_AbramsTankDeathEffect
    FX  = FINAL    FX_GenericTankDeathExplosion 
  End

  Behavior = PointDefenseLaserUpdate ModuleTag_07
    WeaponTemplate        = PaladinPointDefenseLaser
    PrimaryTargetTypes    = BALLISTIC_MISSILE SMALL_MISSILE
    SecondaryTargetTypes  = INFANTRY 
    ScanRate              = 100
    ScanRange             = 120.0
    PredictTargetVelocityFactor = 3.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_08
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_09
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End 
  Behavior = ObjectCreationUpgrade ModuleTag_19
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End Upgrade_AmericaHallfireDrone

  Behavior = ProductionUpdate ModuleTag_10
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_11
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = FXListDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End
  Behavior = CreateObjectDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End
  Behavior = DestroyDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
  End
  Behavior = CreateCrateDie ModuleTag_16
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End
  Behavior = EjectPilotDie ModuleTag_17
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.95     
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;----------------------------------------------------------
Object AmericaVehicleMRLS

  ; *** ART Parameters ***
  SelectPortrait         = SAM270_L
  ButtonImage            = SAM270
  
  UpgradeCameo1 = Upgrade_AmericaScoutDrone
  UpgradeCameo2 = Upgrade_AmericaBattleDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaHellfireDrone
  ;UpgradeCameo5 = NONE
  
  Draw = W3DTankDraw ModuleTag_01
    OkToChangeModelColor = Yes
      
    ;ProjectileBoneFeedbackEnabledSlots = PRIMARY ; WeaponLaunchBone will be shown/hidden, not just used for firing offset

      DefaultConditionState
      Model = AVM270
      Turret = TURRET
      TurretPitch = TURRETEL
      WeaponFireFXBone = PRIMARY WeaponA
      WeaponLaunchBone = PRIMARY WeaponA
      WeaponFireFXBone = SECONDARY WeaponA
      WeaponLaunchBone = SECONDARY WeaponA
      ;WeaponHideShowBone = PRIMARY MISSILE
  End

    ConditionState = REALLYDAMAGED
      Model = AVM270d
    End
    AliasConditionState = RUBBLE

    TrackMarks           = EXTnkTrack.tga

  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:MRLS
  Side = America
  EditorSorting   = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  BuildCost       = 1200
  BuildTime       = 20.0          ;in seconds    
  VisionRange     = 180
  ShroudClearingRange = 200
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End
  ExperienceValue = 50 50 100 150    ;Experience point value at each level
  ExperienceRequired = 0 200 400 800  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY MRLSRocketBarrage
    Weapon = SECONDARY MRLSRocketBarrageAir
  PreferredAgainst     = SECONDARY     AIRCRAFT
  End
  ArmorSet
    Conditions      = None
    Armor           = TruckArmor
    DamageFX        = TankDamageFX
  End
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaVehicleTomahawkCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = AvengerVoiceMove
  VoiceMove = AvengerVoiceMove
  VoiceGuard = AvengerVoiceMove
  VoiceAttack = AvengerVoicePaint
  SoundMoveStart = TomahawkMoveStart
  SoundMoveStartDamaged = TomahawkMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate = TomahawkVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = OverlordTankTurretMoveLoop
    SoundEject = PilotSoundEject
    VoiceEject = PilotVoiceEject
    VoiceCrush = TomahawkVoiceCrush
    VoiceEnter = AvengerVoiceMove
    VoiceBombard = AvengerVoicePaint
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE DONT_AUTO_CRUSH_INFANTRY CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 200.0
    InitialHealth   = 200.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 360
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate = 60   ; turn rate, in degrees per sec
      TurretPitchRate = 60
      FirePitch = 70  ; Instead of aiming pitchwise at the target, it will aim here
      AllowsPitch = Yes
      ControlledWeaponSlots = PRIMARY SECONDARY
    End
    AutoAcquireEnemiesWhenIdle = No NotWhileAttacking
  End
  Locomotor = SET_NORMAL TomahawkLocomotor

  Behavior = PhysicsBehavior ModuleTag_04
    Mass = 50.0
  End
  Behavior = SlowDeathBehavior ModuleTag_05
    DeathTypes = ALL -CRUSHED -SPLATTED
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT    OCL_QuadCannonDeathEffect
    FX =  FINAL FX_AmericaVehicleTomahawkDeathExplosion
  End

  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_07
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_15
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End

  Behavior = ProductionUpdate ModuleTag_08
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_09
    TriggeredBy = Upgrade_AmericaAdvancedTraining
    AddXPScalar = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = DestroyDie ModuleTag_10
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Behavior = FXListDie ModuleTag_11
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_12
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

;  Behavior = FXListDie
;    DeathTypes = ALL -CRUSHED -SPLATTED
;    DeathFX = FX_GenericTankDeathEffect
;  End
; Behavior = CreateObjectDie
;    DeathTypes = ALL -CRUSHED -SPLATTED
;    CreationList = OCL_GenericTankDeathEffect
;  End
  Behavior = EjectPilotDie ModuleTag_13
    DeathTypes = ALL -CRUSHED -SPLATTED
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericanRangerEjection02
    ExemptStatus = HIJACKED
  End
  
  Behavior = TransitionDamageFX ModuleTag_14
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End
  
  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 10.0     
  GeometryIsSmall = Yes
  Scale = 0.9
  Shadow = SHADOW_VOLUME 
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length   

End

;------------------------------------------------------------------------------
Object AmericaVehicleM109Howitzer

  ; *** ART Parameters ***
  SelectPortrait         = SAM109_L
  ButtonImage            = SAM109
  
  UpgradeCameo1 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw                    = W3DTankDraw ModuleTag_01
    OkToChangeModelColor  = Yes
    ConditionState        = NONE
      Model               = M109
      Turret              = Turret
      TurretPitch         = TurretEL
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretMS
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    ConditionState        = RUBBLE REALLYDAMAGED
      Model               = M109d
      Turret              = Turret
      TurretPitch         = TurretEL
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretMS
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY BarrelFX
      WeaponLaunchBone    = SECONDARY BarrelFX
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    
    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
  End

  ; ***DESIGN parameters ***
  DisplayName        = OBJECT:M109Howitzer
  Side               = America
  EditorSorting      = VEHICLE
  TransportSlotCount = 3                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions       = None 
    Weapon           = PRIMARY GenericHowitzerGun
    Weapon           = TERTIARY MediumGenericTankMachineGunAir
  End

  ArmorSet
    Conditions      = None
    Armor           = TankArmor
    DamageFX        = TankDamageFX
  End
  BuildCost          = 1100
  BuildTime          = 15.0          ;in seconds    
  VisionRange        = 220
  ShroudClearingRange = 310
  Prerequisites
    Object           = AmericaWarFactory
  End

  ExperienceValue = 50 50 100 150    ;Experience point value at each level
  ExperienceRequired = 0 100 200 400  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = AmericaVehicleM109HowitzerCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect       = CrusaderTankVoiceMove
  VoiceMove         = CrusaderTankVoiceMove
  VoiceGuard        = CrusaderTankVoiceMove
  VoiceAttack       = CrusaderTankVoiceAttack
  SoundMoveStart = InfernoCannonMoveStart
  SoundMoveStartDamaged = InfernoCannonMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate     = TomahawkVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop  = OverlordTankTurretMoveLoop
    VoiceCrush          = CrusaderTankVoiceCrush
    VoiceEnter         = CrusaderTankVoiceMove
  End


  ; *** ENGINEERING Parameters ***
  RadarPriority     = UNIT
  KindOf            = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body              = ActiveBody ModuleTag_02
    MaxHealth       = 130.0
    InitialHealth   = 130.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 240
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End


  ;Behavior = PointDefenseLaserUpdate ModuleTag_070
    ;WeaponTemplate        = PaladinPointDefenseLaser
    ;PrimaryTargetTypes    = BALLISTIC_MISSILE SMALL_MISSILE
    ;SecondaryTargetTypes  = INFANTRY 
    ;ScanRate              = 100
    ;ScanRange             = 120.0
    ;PredictTargetVelocityFactor = 3.0
  ;End

  ;Behavior = ObjectCreationUpgrade ModuleTag_071
    ;UpgradeObject = OCL_AmericanBattleDrone
    ;TriggeredBy   = Upgrade_AmericaBattleDrone
    ;ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  ;End
  Behavior = ObjectCreationUpgrade ModuleTag_072
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ProductionUpdate ModuleTag_073
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_074
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End

  Behavior = AIUpdateInterface ModuleTag_04
    Turret
      TurretTurnRate = 100
      TurretPitchRate = 100
      AllowsPitch = Yes
      FirePitch = 45
      ControlledWeaponSlots = PRIMARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = No NotWhileAttacking
  End
  Locomotor = SET_NORMAL M60Locomotor
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 50.0
  End

  ; A crushing defeat
  Behavior               = FXListDie ModuleTag_06
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX         = FX_CarCrush
  End
  Behavior               = CreateObjectDie ModuleTag_07
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList    = OCL_CrusaderTank_CrushEffect
  End
  Behavior = SlowDeathBehavior ModuleTag_08
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier = 50
    DestructionDelay = 2000
    DestructionDelayVariance = 300
    FX  = INITIAL  FX_CrusaderCatchFire  
    FX  = FINAL    FX_GenericTankDeathExplosion 
    OCL = FINAL    OCL_InfernoCannonDeathEffect
  End

  Behavior = EjectPilotDie ModuleTag_09
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior                 = TransitionDamageFX ModuleTag_10
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:-7 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior         = CreateCrateDie ModuleTag_11
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End


  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Behavior = DestroyDie ModuleTag_22
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  Geometry            = BOX
  GeometryMajorRadius = 15.0
  GeometryMinorRadius = 10.0
  GeometryHeight      = 15.0     
  GeometryIsSmall     = Yes
  Scale = 0.95 
  Shadow              = SHADOW_VOLUME 
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length   

End

;------------------------------------------------------------------------------
Object AmericaTankM55 ;Reinforcement Pad only

  ; *** ART Parameters ***
  SelectPortrait         = SAM55Sheridan_L
  ButtonImage            = SAM55Sheridan
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaHellfireDrone
  UpgradeCameo4 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo5 = Upgrade_AmericaCompositeArmor
  
  Draw = W3DTankDraw ModuleTag_01
    DefaultConditionState
      Model               = AVM55
      Turret              = Turret
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End

    ConditionState       = REALLYDAMAGED
      Model              = AVM55d
    End
    ConditionState       = RUBBLE
      Model              = AVM55d
    End

    TrackMarks           = EXTnkTrack.tga
    TreadAnimationRate      = 2.0  ; amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
    OkToChangeModelColor = Yes
  End

  ; ***DESIGN parameters ***
  DisplayName            = OBJECT:M55Sheridan
  Side                   = America
  EditorSorting          = VEHICLE
  TransportSlotCount     = 3
  WeaponSet
    Conditions           = None 
    Weapon               = PRIMARY ScorpionTankGun
    Weapon               = SECONDARY LightGenericTankMachineGun
  End
  ArmorSet
    Conditions           = None
    Armor                = TankArmor
    DamageFX             = TankDamageFX
  End
  ;ArmorSet
  ;  Conditions           = PLAYER_UPGRADE
  ;  Armor                = UpgradedTankArmor
  ;  DamageFX             = TankDamageFX
  ;End
  BuildCost              = 825
  BuildTime              = 15.0          ;in seconds    
  VisionRange            = 195
  ShroudClearingRange = 300
  Prerequisites
    Object = AmericaWarFactory
    Object = AmericaStrategyCenter
  End
  ExperienceValue        = 100 100 200 400 ;Experience point value at each level
  ExperienceRequired     = 0 200 300 600 ;Experience points needed to gain each level
  IsTrainable            = Yes  ;Can gain experience
  CrusherLevel           = 2  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 2  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet             = AmericaTankCrusaderCommandSet
  
  ; *** AUDIO Parameters ***
  VoiceSelect           = CrusaderTankVoiceMove
  VoiceMove             = CrusaderTankVoiceMove
  VoiceGuard            = CrusaderTankVoiceMove
  VoiceAttack           = CrusaderTankVoiceAttack
  SoundMoveStart        = BattleMasterTankMoveStart
  SoundMoveStartDamaged = BattleMasterTankMoveStart
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop
  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate         = CrusaderTankVoiceCreate
    VoiceEnter             = CrusaderTankVoiceMove
    TurretMoveStart     = NoSound
    TurretMoveLoop      = OverlordTankTurretMoveLoop
    SoundEject          = PilotSoundEject
    VoiceEject          = PilotVoiceEject
    VoiceCrush          = CrusaderTankVoiceCrush
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority          = UNIT
  KindOf                 = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE
  
  Body                   = ActiveBody ModuleTag_02
    MaxHealth       = 430
    InitialHealth   = 430

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 960
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = AIUpdateInterface ModuleTag_03
    Turret
      TurretTurnRate       = 180 ;90 Trying to be realistic  // turn rate, in degrees per sec
      ControlledWeaponSlots= PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor            = SET_NORMAL M3BradleyLocomotor
  Behavior = PhysicsBehavior ModuleTag_04
    Mass                 = 50.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_05
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_06
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_20
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_07
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_08
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_09
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Turret fly off death
  Behavior = SlowDeathBehavior ModuleTag_10
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 500
    DestructionDelayVariance  = 100
    FX  = INITIAL  FX_GenericTankDeathEffect
    OCL = MIDPOINT OCL_GenericTankDeathEffect
    FX  = MIDPOINT    FX_GenericTankDeathExplosion
    OCL = FINAL    OCL_ChinaTankBattleMasterDebris
  End

  ; Catch fire, and explode death
   ;Behavior = SlowDeathBehavior ModuleTag_11
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 2000
    ;DestructionDelayVariance  = 300
    ;FX  = INITIAL  FX_CrusaderCatchFire
    ;OCL = FINAL    OCL_GenericTankDeathEffect  
    ;FX  = FINAL    FX_GenericTankDeathExplosion
  ;End

  Behavior                 = TransitionDamageFX ModuleTag_12
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmallLightSmokeColumn
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_BattleMasterDamageTransition
  End

  Behavior = DestroyDie ModuleTag_13
    DeathTypes = NONE +CRUSHED +SPLATTED
  End

  ; A crushing defeat
  Behavior = FXListDie ModuleTag_14
    DeathTypes = NONE +CRUSHED +SPLATTED
    DeathFX = FX_CarCrush
  End

  Behavior = CreateObjectDie ModuleTag_15
    DeathTypes = NONE +CRUSHED +SPLATTED
    CreationList = OCL_CrusaderTank_CrushEffect
  End

  Behavior                    = CreateCrateDie ModuleTag_CratesChange
   CrateData             = SalvageCrateData
   ;CrateData             = EliteTankCrateData
   ;CrateData             = HeroicTankCrateData
  End

  Behavior = EjectPilotDie ModuleTag_17
    GroundCreationList = OCL_EjectPilotOnGround
    AirCreationList = OCL_EjectPilotViaParachute
    ExemptStatus = HIJACKED
    VeterancyLevels =  ALL -REGULAR ;only vet+ gives pilot
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = MaxHealthUpgrade ModuleTag_18
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  Behavior = FlammableUpdate ModuleTag_21
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry               = BOX
  GeometryMajorRadius    = 15.0
  GeometryMinorRadius    = 10.0
  GeometryHeight         = 10.0     
  GeometryIsSmall        = Yes
  Scale = 0.98    
  Shadow = SHADOW_VOLUME
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End

;------------------------------------------------------------------------------
Object SupW_AmericaTankMammoth

  ; *** ART Parameters ***
  SelectPortrait         = SAMammothTank
  ButtonImage            = SAMammothTank
  
  UpgradeCameo1 = Upgrade_AmericaBattleDrone
  UpgradeCameo2 = Upgrade_AmericaScoutDrone
  UpgradeCameo3 = Upgrade_AmericaAdvancedTraining
  UpgradeCameo4 = Upgrade_AmericaCompositeArmor
  UpgradeCameo5 = Upgrade_AmericaHellfireDrone
  
  
  Draw = W3DTankDraw ModuleTag_01
    ConditionState        = NONE
      Model               = v_gdi_mammth
      Animation           = v_gdi_mammth.v_gdi_mammth
      AnimationMode       = LOOP
      Turret              = TURRET
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End
    ConditionState        = REALLYDAMAGED
      Model               = v_gdi_mammth
      Animation           = v_gdi_mammth.v_gdi_mammth
      AnimationMode       = LOOP
      Turret              = TURRET
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End

    ConditionState        = RUBBLE
      Model               = v_gdi_mammth
      Turret              = TURRET
      WeaponFireFXBone    = PRIMARY TurretMS
      WeaponRecoilBone    = PRIMARY Barrel
      WeaponMuzzleFlash   = PRIMARY TurretFX
      WeaponLaunchBone    = PRIMARY TurretMS
      WeaponFireFXBone    = SECONDARY MuzzleUp
      WeaponMuzzleFlash   = SECONDARY MuzzleFXUp
      WeaponFireFXBone    = SECONDARY WeaponB
      WeaponLaunchBone    = SECONDARY TurretMS
    End

    TrackMarks           = EXTnkTrack.tga
    OkToChangeModelColor = Yes
    TreadAnimationRate = 2.0;  amount of tread texture to move per second
    TreadDriveSpeedFraction = 0.3  ; fraction of locomotor speed below which treads stop moving.
    TreadPivotSpeedFraction = 0.6  ; fraction of locomotor speed below which we allow pivoting.
  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:MammothTank
  Side                = AmericaSuperWeaponGeneral
  EditorSorting       = VEHICLE
  TransportSlotCount  = 4                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions        = None 
    Weapon            = PRIMARY MammothTankGun
    Weapon            = SECONDARY MammothTankRocketBarrage
    Weapon            = TERTIARY LightGenericTankMachineGun
  End
  ;WeaponSet
    ;Conditions        = PLAYER_UPGRADE
    ;Weapon            = PRIMARY MammothTankGun
    ;Weapon            = SECONDARY MammothTankRocketBarrage
    ;Weapon            = TERTIARY LightGenericTankMachineGun
  ;End
  ArmorSet
    Conditions        = None
    Armor             = TankArmor
    DamageFX          = TankDamageFX
  End
  BuildCost       = 2000
  BuildTime       = 20.0          ;in seconds    
  VisionRange     = 170
  ShroudClearingRange = 230
  Prerequisites
    Object = SupW_AmericaWarFactory
    Object = SupW_AmericaStrategyCenter
  End

  ExperienceValue = 200 200 400 600   ;Experience point value at each level
  ExperienceRequired = 0 400 600 1200  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrusherLevel           = 3  ;What can I crush?: 1 = infantry, 2 = trees, 3 = vehicles
  CrushableLevel         = 3  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet = AmericaTankCrusaderCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = PaladinTankVoiceMove
  SoundMoveStart = OverlordTankMoveStart
  SoundMoveStartDamaged = OverlordTankMoveStart
  VoiceMove = PaladinTankVoiceMove
  VoiceGuard = PaladinTankVoiceMove
  VoiceAttack = PaladinTankVoiceAttack
  SoundAmbient           = IdleTankLoop
  SoundAmbientRubble     = NoSound
   ;SoundMoveLoop          = MovingTankLoop  ; only when not idle
   ;SoundAmbient           = IdleTankLoop

  UnitSpecificSounds
    ; These have the syntax of SomeNameSomewhereInCode = SomeNameSomewhereInLookupINIs
    VoiceCreate          = PaladinTankVoiceCreate
    TurretMoveStart = NoSound
    TurretMoveLoop = OverlordTankTurretMoveLoop
    VoiceCrush = PaladinTankVoiceCrush
    VoiceEnter = PaladinTankVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS VEHICLE SCORE HUGE_VEHICLE
  
  Body = ActiveBody ModuleTag_02
    MaxHealth       = 1550.0
    InitialHealth   = 1550.0

    ; Subdual damage "Subdues" you (reaction defined by BodyModule) when it passes your max health.
    ; The cap limits how extra-subdued you can be, and the other numbers detemine how fast it drains away on its own.
    SubdualDamageCap = 2200
    SubdualDamageHealRate = 500
    SubdualDamageHealAmount = 50
  End

  Behavior = TransportAIUpdate ModuleTag_03
    Turret
      TurretTurnRate = 100 ;30   // turn rate, in degrees per sec
      ControlledWeaponSlots = PRIMARY SECONDARY TERTIARY
    End
    AutoAcquireEnemiesWhenIdle = Yes
  End

  Locomotor = SET_NORMAL MammothTankLocomotor

  Behavior = PhysicsBehavior ModuleTag_14
    Mass = 500.0
  End

  Behavior = ObjectCreationUpgrade ModuleTag_15
    UpgradeObject = OCL_AmericanBattleDrone
    TriggeredBy   = Upgrade_AmericaBattleDrone
    ConflictsWith = Upgrade_AmericaScoutDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_16
    UpgradeObject = OCL_AmericanScoutDrone
    TriggeredBy   = Upgrade_AmericaScoutDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaHellfireDrone
  End
  Behavior = ObjectCreationUpgrade ModuleTag_17
    UpgradeObject = OCL_AmericanHellfireDrone
    TriggeredBy   = Upgrade_AmericaHellfireDrone
    ConflictsWith = Upgrade_AmericaBattleDrone Upgrade_AmericaScoutDrone
  End
  Behavior = ProductionUpdate ModuleTag_18
    MaxQueueEntries = 1; So you can't build multiple upgrades in the same frame
  End

  Behavior = ExperienceScalarUpgrade ModuleTag_19
    TriggeredBy   = Upgrade_AmericaAdvancedTraining
    AddXPScalar   = 1.0 ;Increases experience gained by an additional 100%
  End
  Behavior = MaxHealthUpgrade ModuleTag_20
    TriggeredBy   = Upgrade_AmericaCompositeArmor
    AddMaxHealth  = 100.0
    ChangeType    = ADD_CURRENT_HEALTH_TOO   ;Choices are PRESERVE_RATIO, ADD_CURRENT_HEALTH_TOO, and SAME_CURRENTHEALTH
  End

  ; Smoke for a bit then explode
;  Behavior = SlowDeathBehavior
;;    ProbabilityModifier = 25
;    DestructionDelay = 1500
;    DestructionDelayVariance = 500
;    FX  = INITIAL   FX_OverlordSmoke
;    OCL = FINAL     OCL_ChinaTankOverlordDebris
;    FX  = FINAL     FX_GenericTankDeathExplosion
;  End

  ; Turret fly off death
  ;Behavior = SlowDeathBehavior ModuleTag_21
    ;DeathTypes = ALL -CRUSHED -SPLATTED
    ;ProbabilityModifier  = 50
    ;DestructionDelay  = 500
    ;DestructionDelayVariance  = 100
    ;FX  = INITIAL  FX_GenericTankDeathEffect
    ;OCL = MIDPOINT OCL_GenericTankDeathEffect
    ;FX  = FINAL    FX_GenericTankDeathExplosion
    ;OCL = FINAL    OCL_CrusaderTurret
  ;End

  ; Catch fire, and explode death
  Behavior = SlowDeathBehavior ModuleTag_22
    DeathTypes = ALL -CRUSHED -SPLATTED
    ProbabilityModifier  = 50
    DestructionDelay  = 2000
    DestructionDelayVariance  = 300
    FX  = INITIAL  FX_CrusaderCatchFire
    OCL = FINAL    OCL_GenericTankDeathEffect  
    FX  = FINAL    FX_GenericTankDeathExplosion
  End

  ; Just explode death
  Behavior = SlowDeathBehavior ModuleTag_23
    ProbabilityModifier = 25
    DestructionDelay = 200
    DestructionDelayVariance = 100
    OCL = FINAL    OCL_GenericTankDeathEffect  
    FX  = FINAL    FX_GenericTankDeathExplosion
  End
  Behavior = CreateCrateDie ModuleTag_24
    CrateData = SalvageCrateData
    ;CrateData = EliteTankCrateData
    ;CrateData = HeroicTankCrateData
  End

  Behavior = CreateObjectDie ModuleTag_150
    DeathTypes = ALL -CRUSHED -SPLATTED
    CreationList = OCL_AmericaTankCrewEjection
    ExemptStatus = HIJACKED
  End

  Behavior = TransitionDamageFX ModuleTag_25
    ReallyDamagedParticleSystem1 = Bone:Smoke RandomBone:Yes PSys:SmokeSmallContinuous01
    ReallyDamagedFXList1 = Loc: X:0 Y:0 Z:0 FXList:FX_OverlordDamageTransition
  End

  Behavior = FlammableUpdate ModuleTag_26
    AflameDuration = 5000         ; If I catch fire, I'll burn for this long...
    AflameDamageAmount = 3       ; taking this much damage...
    AflameDamageDelay = 500       ; this often.
  End

  Geometry = BOX
  GeometryMajorRadius = 26.0
  GeometryMinorRadius = 13.0
  GeometryHeight = 15.0     
  GeometryIsSmall = No
  Scale = 2.0
  Shadow = SHADOW_VOLUME     
  ShadowSizeX = 45  ; minimum elevation angle above horizon. Used to limit shadow length

End