;------------------------------------------------------------------------------
Object ChinaInfantryRedguard

  ; *** ART Parameters ***
  SelectPortrait         = SNRedGuard_L  
  ButtonImage            = SNRedGuard_L
  
  UpgradeCameo1 = Upgrade_Nationalism
  UpgradeCameo2 = Upgrade_InfantryCaptureBuilding
  UpgradeCameo3 = Upgrade_ChinaRifleUpgrade
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  Draw = W3DModelDraw ModuleTag_01

    OkToChangeModelColor = Yes

    ; this says "we don't use these condition states at all, so completely
    ; ignore them for purposes of matchmaking"... this is useful to help
    ; reduce the number of AliasConditionState clauses you must add in
    ; order to avoid ambiguity in some cases.
    IgnoreConditionStates = PREATTACK_A FIRING_A BETWEEN_FIRING_SHOTS_A RELOADING_A

    ; ------- Standing-Around Animations
 
    DefaultConditionState
      Model               = NICNSC_SKN
      IdleAnimation       = NICNSC_SKL.NICNSC_STA 0 35
      IdleAnimation       = NICNSC_SKL.NICNSC_IDA
      IdleAnimation       = NICNSC_SKL.NICNSC_IDB
      AnimationMode       = ONCE
      WeaponFireFXBone    = PRIMARY Muzzle
      WeaponMuzzleFlash   = PRIMARY MuzzleFX
      WeaponFireFXBone    = SECONDARY Muzzle
      WeaponMuzzleFlash   = SECONDARY MuzzleFX
      TransitionKey       = TRANS_Stand
    End

    ConditionState        = REALLYDAMAGED
      IdleAnimation       = NICNSC_SKL.NICNSC_STB
      AnimationMode       = ONCE
      TransitionKey       = TRANS_StandDamaged
    End

    ; ------- Machine Gun Animations

    ConditionState      = USING_WEAPON_A 
      Animation         = NICNSC_SKL.NICNSC_ATA
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Firing
    End

    ConditionState      = USING_WEAPON_A REALLYDAMAGED
      Animation         = NICNSC_SKL.NICNSC_ATC
      AnimationMode     = LOOP
      TransitionKey     = TRANS_FiringDamaged
    End

    ConditionState      = USING_WEAPON_B 
      Animation         = NICNSC_SKL.NICNSC_ATA
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Firing
    End

    ConditionState      = USING_WEAPON_B REALLYDAMAGED
      Animation         = NICNSC_SKL.NICNSC_ATC
      AnimationMode     = LOOP
      TransitionKey     = TRANS_FiringDamaged
    End
    
    ; ------- Firing-related Transitions

    TransitionState   = TRANS_Firing TRANS_FiringDamaged
      Animation       = NICNSC_SKL.NICNSC_AA2AC
      AnimationMode   = ONCE
    End

    TransitionState   = TRANS_Stand TRANS_Firing
      Animation       = NICNSC_SKL.NICNSC_SA2AA
      AnimationMode   = ONCE
    End

    TransitionState   = TRANS_Firing TRANS_Stand
      Animation       = NICNSC_SKL.NICNSC_AA2SA
      AnimationMode   = ONCE
    End

    TransitionState   = TRANS_StandDamaged TRANS_FiringDamaged
      Animation       = NICNSC_SKL.NICNSC_ATCST
      AnimationMode   = ONCE
    End

    TransitionState   = TRANS_FiringDamaged TRANS_StandDamaged
      Animation       = NICNSC_SKL.NICNSC_ATCED
      AnimationMode   = ONCE
    End


    ; ------------- Damage Transitions --------------------
    TransitionState = TRANS_StandDamaged TRANS_RunDamaged
      Animation       = NICNSC_SKL.NICNSC_AA2AC
      AnimationMode   = ONCE
      AnimationSpeedFactorRange = 2 2
    End
    TransitionState = TRANS_RunDamaged TRANS_StandDamaged 
      Animation       = NICNSC_SKL.NICNSC_AA2AC
      AnimationMode   = ONCE_BACKWARDS
      AnimationSpeedFactorRange = 2 2
      Flags           = START_FRAME_LAST
    End
    TransitionState = TRANS_Stand TRANS_StandDamaged 
      Animation       = NICNSC_SKL.NICNSC_AA2SA
      AnimationMode   = ONCE_BACKWARDS
      AnimationSpeedFactorRange = 4 5
      Flags           = START_FRAME_LAST
    End

    ; ------- Bayonet Animations

    ConditionState    = PREATTACK_C 
      Animation       = NICNSC_SKL.NICNSC_ATB1
      AnimationMode   = ONCE
      TransitionKey   = TRANS_Stab
    End
    AliasConditionState = PREATTACK_C MOVING
    AliasConditionState = PREATTACK_C FIRING_C
    AliasConditionState = PREATTACK_C BETWEEN_FIRING_SHOTS_C

    ConditionState      = FIRING_C
      Animation         = NICNSC_SKL.NICNSC_ATB2
      AnimationMode     = ONCE
      ; this is basically a trick: this guy has a nontrivial animation for firing,
      ; and a long recycle time between shots. we want him to finish his fire animation
      ; (unless he's ordered to do something else), so this is just a handy trick that
      ; says, "if the previous state had this transition key, allow it to finish before
      ; switching to us, if possible".
      WaitForStateToFinishIfPossible = TRANS_Stab
    End
    AliasConditionState = BETWEEN_FIRING_SHOTS_C
    AliasConditionState = RELOADING_C

    ; ------- Parachuting Animations

    ConditionState    = FREEFALL
      Animation       = NICNSC_SKL.NICNSC_POP
      AnimationMode   = MANUAL
      Flags           = START_FRAME_FIRST
      TransitionKey   = TRANS_Falling
    End
    AliasConditionState = FREEFALL REALLYDAMAGED
    AliasConditionState = FREEFALL DYING

    ConditionState    = PARACHUTING
      Animation       = NICNSC_SKL.NICNSC_PHG
      AnimationMode   = LOOP
      Flags           = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
      TransitionKey   = TRANS_Chute
    End
    AliasConditionState = PARACHUTING REALLYDAMAGED
    AliasConditionState = PARACHUTING DYING

    TransitionState   = TRANS_Falling TRANS_Chute
      Animation       = NICNSC_SKL.NICNSC_POP
      AnimationMode   = ONCE
      Flags           = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
    End

    TransitionState   = TRANS_Chute TRANS_Stand
      Animation       = NICNSC_SKL.NICNSC_PTD
      AnimationMode   = ONCE
    End

    ; ------- Movement Animations

    ConditionState      = MOVING
      Animation         = NICNSC_SKL.NICNSC_RNA 26
      AnimationMode     = LOOP
      Flags             = RANDOMSTART
      TransitionKey     = None
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = MOVING ATTACKING

    ConditionState = MOVING REALLYDAMAGED
      Animation         = NICNSC_SKL.NICNSC_RNB 28
      AnimationMode     = LOOP
      Flags             = RANDOMSTART
      TransitionKey     = TRANS_RunDamaged
      TransitionKey     = None
    End
    AliasConditionState = MOVING ATTACKING REALLYDAMAGED

    ; ------- Bldg-capture

    ConditionState      = UNPACKING
      Model             = NICNSC_F_SKN
      Animation         = NICNSC_F_SKL.NICNSC_F_FDP1
      AnimationMode     = ONCE
    End
    AliasConditionState = UNPACKING REALLYDAMAGED

    ConditionState      = RAISING_FLAG
      Model             = NICNSC_F_SKN
      Animation         = NICNSC_F_SKL.NICNSC_F_FDP2
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Raising
    End
    AliasConditionState = RAISING_FLAG REALLYDAMAGED

    ConditionState      = PACKING
      Model             = NICNSC_F_SKN
      Animation         = NICNSC_F_SKL.NICNSC_F_FDP1
      AnimationMode     = ONCE_BACKWARDS
      Flags             = START_FRAME_LAST
      TransitionKey     = TRANS_Packing
    End
    AliasConditionState = PACKING REALLYDAMAGED

    TransitionState     = TRANS_Raising TRANS_Packing
      Model             = NICNSC_F_SKN
      Animation         = NICNSC_F_SKL.NICNSC_F_FDP2
      AnimationMode     = ONCE_BACKWARDS
      Flags             = START_FRAME_LAST
    End

    ; ------- Dying Animations

    ConditionState      = DYING
      Animation         = NICNSC_SKL.NICNSC_DTA
      Animation         = NICNSC_SKL.NICNSC_DTB
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Dying
    End

    TransitionState     = TRANS_Dying TRANS_Flailing
      Animation         = NICNSC_SKL.NICNSC_ATDE1
      AnimationMode     = ONCE
    End

    ConditionState      = DYING EXPLODED_FLAILING
      Animation         = NICNSC_SKL.NICNSC_ATDE2
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Flailing
    End

    ConditionState      = DYING EXPLODED_BOUNCING
      Animation         = NICNSC_SKL.NICNSC_ATDE3
      AnimationMode     = ONCE
      TransitionKey     = None
    End

    ; ------- Misc Animations

    ConditionState      = SPECIAL_CHEERING
      Animation         = NICNSC_SKL.NICNSC_CHA
      AnimationMode     = LOOP
    End

  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:Redguard
  Side                = China
  EditorSorting       = INFANTRY
  TransportSlotCount  = 1                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY RedguardMachineGun
    Weapon              = TERTIARY   RedguardBayonet
    AutoChooseSources   = PRIMARY     FROM_PLAYER FROM_SCRIPT FROM_AI
    AutoChooseSources   = TERTIARY   NONE
  End
  WeaponSet
    Conditions = PLAYER_UPGRADE
    Weapon = PRIMARY RedguardMachineGunUpgraded
    Weapon = TERTIARY   RedguardBayonet
    AutoChooseSources   = PRIMARY     FROM_PLAYER FROM_SCRIPT FROM_AI
    AutoChooseSources   = TERTIARY   NONE
  End
  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End
  VisionRange = 100
  ShroudClearingRange = 200
  Prerequisites
    Object = ChinaBarracks
  End
  BuildCost     = 300
  BuildTime     = 10.0          ;in seconds      

  ExperienceValue = 5 5 10 20   ;Experience point value at each level
  ExperienceRequired = 0 20 40 80  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrushableLevel         = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet    = ChinaInfantryRedguardCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = RedGuardVoiceSelect
  VoiceMove = RedGuardVoiceMove
  VoiceGuard = RedGuardVoiceMove
  VoiceAttack = RedGuardVoiceAttack
  VoiceGroupSelect = BattleCrySound
  VoiceFear = RedGuardVoiceFear
  VoiceTaskComplete = RedGuardVoiceCaptureComplete
  UnitSpecificSounds
    VoiceMelee      = RedGuardVoiceAttackBayonet
    VoiceGarrison   = RedGuardVoiceGarrison
    VoiceCreate     = RedGuardVoiceCreate
    VoiceSubdue     = RedGuardVoiceSubdue
    VoiceEnter      = RedGuardVoiceMove
    VoiceEnterHostile = RedGuardVoiceMove
    VoiceGetHealed      = RedGuardVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY SCORE PARACHUTABLE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 120.0
    InitialHealth   = 120.0
  End

  Behavior = VeterancyGainCreate ModuleTag_03
    StartingLevel = VETERAN
    ScienceRequired = SCIENCE_RedGuardTraining
  End

  Behavior = AIUpdateInterface ModuleTag_04
    AutoAcquireEnemiesWhenIdle = Yes
  End

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

  Locomotor = SET_NORMAL RedguardLocomotor

  Behavior = HordeUpdate ModuleTag_06
    RubOffRadius = 60    ; if I am this close to a real hordesman, I will get to be an honorary hordesman
    UpdateRate = 1000    ; how often to recheck horde status (msec)
    Radius = 30          ; how close other units must be to us to count towards our horde-ness (~30 feet or so)
    KindOf = INFANTRY    ; what KindOf's must match to count towards horde-ness
    AlliesOnly = Yes     ; do we only count allies towards horde status? 
    ExactMatch = No      ; do we only count units of our exact same type towards horde status? (overrides kindof)
    Count = 5            ; how many units must be within Radius to grant us horde-ness
    Action = HORDE       ; when horde-ing, grant us the HORDE bonus
  End
  Behavior = PhysicsBehavior ModuleTag_07
    Mass = 5.0
  End

  Behavior = SquishCollide ModuleTag_10
    ;nothing
  End

; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA -LASERED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_RedGuardDie
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_RedGuardDie
    FX                  = INITIAL FX_BloodyPuddle3
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireChina
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_15
    PoisonDamageInterval = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration = 3000       ; ... for this long after last hit by poison damage
  End

  Behavior = SpecialAbility ModuleTag_16
    SpecialPowerTemplate      = SpecialAbilityRedGuardCaptureBuilding
    UpdateModuleStartsAttack  = Yes
    StartsPaused              = Yes
    InitiateSound         = RedGuardVoiceCapture
  End
  Behavior = SpecialAbilityUpdate ModuleTag_17
    SpecialPowerTemplate  = SpecialAbilityRedGuardCaptureBuilding
    StartAbilityRange  = 5.0
    UnpackTime            = 3000  ; (changing this will scale anim speed)
    PreparationTime       = 20000 ; time to complete hack once prepared (changing this will scale anim speed)
    PackTime              = 2000  ; (changing this will scale anim speed)
    DoCaptureFX           = Yes
    AwardXPForTriggering  = 4
    ;SkillPointsForTriggering = ???  -- Dustin, fill me out if you want different balance values.
  End

  Behavior = UnpauseSpecialPowerUpgrade ModuleTag_18
    SpecialPowerTemplate = SpecialAbilityRedGuardCaptureBuilding
    TriggeredBy = Upgrade_InfantryCaptureBuilding
  End

  Behavior = WeaponSetUpgrade ModuleTag_19
    TriggeredBy = Upgrade_ChinaRifleUpgrade
  End

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

  Geometry = CYLINDER
  GeometryMajorRadius = 7.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  Scale = 0.88 
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End

;------------------------------------------------------------------------------
Object ChinaInfantryBlackLotus

  ; *** ART Parameters ***
  SelectPortrait         = SNBlkLotus_L2
  ButtonImage            = SNBlkLotus2
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE
  
  Draw = W3DModelDraw ModuleTag_01

    OkToChangeModelColor = Yes
    
    ; --- idle
    DefaultConditionState
      Model             = NIHERO_SKN
      IdleAnimation     = NIHERO_SKL.NIHERO_STA 0 17
      IdleAnimation     = NIHERO_SKL.NIHero_IDA
      IdleAnimation     = NIHERO_SKL.NIHero_IDB
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Stand
    End

    ConditionState      = REALLYDAMAGED
      IdleAnimation     = NIHERO_SKL.NIHERO_ISTA 0 30
      IdleAnimation     = NIHERO_SKL.NIHero_IIDA
      AnimationMode     = ONCE
      TransitionKey     = TRANS_StandInjured
    End

    TransitionState     = TRANS_Stand TRANS_StandInjured
      Animation         = NIHero_SKL.NIHero_ISTAHIT
      AnimationMode     = ONCE
    End

    ; --- moving
    ConditionState      = MOVING
      Animation         = NIHero_SKL.NIHero_RNA
      AnimationMode     = LOOP
      Flags             = RANDOMSTART
      TransitionKey     = None
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = MOVING UNPACKING

    ConditionState      = MOVING REALLYDAMAGED
      Animation         = NIHero_SKL.NIHero_IRNA
      AnimationMode     = LOOP
      Flags             = RANDOMSTART
      TransitionKey     = None
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = MOVING UNPACKING REALLYDAMAGED

    ; --- packing states
    ConditionState      = UNPACKING
      ;Preparing to attack (unpacking gear)
      Animation         = NIHero_SKL.NIHero_ATA1
      AnimationMode     = ONCE
    End
    AliasConditionState = UNPACKING FIRING_A

    ConditionState      = FIRING_A
      ;Processing attack (hacking)
      Animation         = NIHero_SKL.NIHero_ATA2
      AnimationMode     = LOOP
      TransitionKey     = TRANS_FiringA
    End

    ConditionState      = PACKING
      ;Completing attack (packing gear)
      Animation         = NIHero_SKL.NIHero_ATA3
      AnimationMode     = ONCE
    End
    AliasConditionState = FIRING_A PACKING 

    TransitionState     = TRANS_FiringA TRANS_FiringAInjured
      Animation         = NIHero_SKL.NIHero_IATAHIT
      AnimationMode     = ONCE
    End

    ; --- injured-packing states
    ConditionState      = UNPACKING REALLYDAMAGED
      ;Preparing to attack (unpacking gear)
      Animation         = NIHero_SKL.NIHero_IATA1
      AnimationMode     = ONCE
    End
    AliasConditionState = UNPACKING FIRING_A REALLYDAMAGED

    ConditionState      = FIRING_A REALLYDAMAGED
      ;Processing attack (hacking)
      Animation         = NIHero_SKL.NIHero_IATA2
      AnimationMode     = LOOP
      TransitionKey     = TRANS_FiringAInjured
    End

    ConditionState      = PACKING REALLYDAMAGED
      ;Completing attack (packing gear)
      Animation         = NIHero_SKL.NIHero_IATA3
      AnimationMode     = ONCE
    End
    AliasConditionState = FIRING_A PACKING REALLYDAMAGED

    ; --- packing-dying states
; code doesn't really support this. Oh well.
;    ConditionState      = DYING RAISING_FLAG
;      Animation         = NIHero_SKL.NIHero_IDTA
;      Animation         = NIHero_SKL.NIHero_IDTB
;      AnimationMode     = ONCE
;    End
;    AliasConditionState = DYING RAISING_FLAG EXPLODED_FLAILING EXPLODED_BOUNCING

    ; --- normal-dying states
    ConditionState      = DYING
      Animation         = NIHero_SKL.NIHero_DTA
      Animation         = NIHero_SKL.NIHero_DTB
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Dying
    End

    TransitionState     = TRANS_Dying TRANS_Flailing
      Animation         = NIHero_SKL.NIHero_ADTF1
      AnimationMode     = ONCE
    End

    ConditionState      = DYING EXPLODED_FLAILING
      Animation         = NIHero_SKL.NIHero_ADTF2
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Flailing
    End

    ConditionState      = DYING EXPLODED_BOUNCING
      Animation         = NIHero_SKL.NIHero_ADTF3
      AnimationMode     = ONCE
      TransitionKey     = None
    End

    ; --- cheering states
    ConditionState      = SPECIAL_CHEERING
      Animation         = NIHERO_SKL.NIHERO_CHA
      AnimationMode     = ONCE
    End

    ConditionState      = SPECIAL_CHEERING REALLYDAMAGED
      Animation         = NIHERO_SKL.NIHERO_ICHA
      AnimationMode     = ONCE
    End

    ; --- falling states
    ConditionState      = FREEFALL
      Animation         = NIHero_SKL.NIHero_PFL
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Falling
    End
    AliasConditionState = FREEFALL REALLYDAMAGED
    AliasConditionState = FREEFALL DYING

    ConditionState      = PARACHUTING
      Animation         = NIHero_SKL.NIHero_PHG
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Chute
    End
    AliasConditionState = PARACHUTING REALLYDAMAGED
    AliasConditionState = PARACHUTING DYING

    TransitionState     = TRANS_Falling TRANS_Chute
      Animation         = NIHero_SKL.NIHero_POP
      AnimationMode     = ONCE
      Flags             = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
    End

    TransitionState     = TRANS_Chute TRANS_Stand
      Animation         = NIHero_SKL.NIHero_PTD
      AnimationMode     = ONCE
    End

    TransitionState     = TRANS_Chute TRANS_StandInjured
      Animation         = NIHero_SKL.NIHero_PTD
      AnimationMode     = ONCE
    End

  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:BlackLotus
  Side                = China
  EditorSorting       = INFANTRY
  TransportSlotCount  = 1                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions        = None 
    Weapon            = PRIMARY None
  End
  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End
  VisionRange         = 300
  ShroudClearingRange = 400
  Prerequisites
    Object = ChinaBarracks
    Object = ChinaPropagandaCenter
  End
  BuildCost             = 1500
  BuildTime             = 20.0          ;in seconds    
  MaxSimultaneousOfType = 1
  CommandSet            = ChinaInfantryBlackLotusCommandSet

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

  ; *** AUDIO Parameters ***
  VoiceSelect = BlackLotusVoiceSelect
  VoiceMove = BlackLotusVoiceMove
  VoiceAttack = NoSound ;BlackLotusVoiceAttack
  VoiceGuard = BlackLotusVoiceMove
  VoiceFear = BlackLotusVoiceFear
  VoiceTaskComplete = BlackLotusVoiceCaptureComplete
  SoundStealthOn = StealthOn
  SoundStealthOff = StealthOff
  
  UnitSpecificSounds
    VoiceCreate          = BlackLotusVoiceCreate
    VoiceGarrison = BlackLotusVoiceMove
    VoiceEnter = BlackLotusVoiceMove
    VoiceEnterHostile = BlackLotusVoiceMove
    VoiceStealCashComplete = BlackLotusVoiceCashComplete
    VoiceDisableVehicleComplete = BlackLotusVoiceDisableComplete
    VoiceCaptureBuildingComplete = BlackLotusVoiceCaptureComplete
    VoiceGetHealed      = BlackLotusVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS INFANTRY SCORE HERO CANNOT_RETALIATE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 200.0
    InitialHealth   = 200.0
  End

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

  Behavior = AIUpdateInterface ModuleTag_04
    AutoAcquireEnemiesWhenIdle = No
  End
  Locomotor = SET_NORMAL BlackLotusLocomotor
  Locomotor = SET_FREEFALL FreeFallLocomotor
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 5.0
  End
  Behavior = StealthUpdate ModuleTag_07
    StealthDelay                = 2500 ; msec
    StealthForbiddenConditions  = USING_ABILITY
    HintDetectableConditions    = USING_ABILITY
    InnateStealth               = Yes
    OrderIdleEnemiesToAttackMeUponReveal  = Yes
    EnemyDetectionEvaEvent      = EnemyBlackLotusDetected
    OwnDetectionEvaEvent        = OwnBlackLotusDetected
  End

  Behavior = StealthDetectorUpdate ModuleTag_44
    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 = SpecialAbility ModuleTag_08
    SpecialPowerTemplate = SpecialAbilityBlackLotusCaptureBuilding
    UpdateModuleStartsAttack = Yes
    InitiateSound         = BlackLotusVoiceHackBuilding
  End
  Behavior = SpecialAbilityUpdate ModuleTag_09
    SpecialPowerTemplate  = SpecialAbilityBlackLotusCaptureBuilding
    StartAbilityRange     = 150.0
    UnpackTime            = 6730 ;animation time is 6730 (changing this will scale anim speed)
    PackTime              = 2800 ;animation time is 5800 (changing this will scale anim speed)
    PreparationTime       = 6000 ;time to complete hack once prepared (unpacked)
    SpecialObject         = BinaryDataStream
    DoCaptureFX           = Yes
    PackSound             = BlackLotusPack
    UnpackSound           = BlackLotusUnpack
    TriggerSound          = BlackLotusTrigger
    PrepSoundLoop         = BlackLotusPrepLoop
    AwardXPForTriggering  = 20
    ;SkillPointsForTriggering = ???  -- Dustin, fill me out if you want different balance values.
  End
  Behavior = SpecialAbility ModuleTag_10
    SpecialPowerTemplate      = SpecialAbilityBlackLotusDisableVehicleHack
    UpdateModuleStartsAttack  = Yes
    InitiateSound           = BlackLotusVoiceHackVehicle
  End
  Behavior = SpecialAbilityUpdate ModuleTag_11
    SpecialPowerTemplate    = SpecialAbilityBlackLotusDisableVehicleHack
    StartAbilityRange       = 150.0
    UnpackTime              = 2000 ;6730 ;animation time is 6730 (changing this will scale anim speed)
    PackTime                = 1000 ;2800 ;animation time is 5800 (changing this will scale anim speed)
    PreparationTime         = 2000 ;time to complete hack once prepared (unpacked)
    EffectDuration          = 15000 ;duration vehicle is disabled  (30 seconds)
    DisableFXParticleSystem = DisabledEffectBinaryShower0
    SpecialObject           = BinaryDataStream
    PackSound               = BlackLotusPack
    UnpackSound             = BlackLotusUnpack
    TriggerSound            = BlackLotusTrigger
    PrepSoundLoop           = BlackLotusPrepLoop
    AwardXPForTriggering    = 0
    ;SkillPointsForTriggering = ???  -- Dustin, fill me out if you want different balance values.
  End
  Behavior = SpecialAbility ModuleTag_12
    SpecialPowerTemplate      = SpecialAbilityBlackLotusStealCashHack
    UpdateModuleStartsAttack  = Yes
    InitiateSound         = BlackLotusVoiceHackCash
  End
  Behavior = SpecialAbilityUpdate ModuleTag_13
    SpecialPowerTemplate  = SpecialAbilityBlackLotusStealCashHack
    StartAbilityRange     = 150.0
    UnpackTime            = 6730 ;animation time is 6730 (changing this will scale anim speed)
    PackTime              = 5800 ;animation time is 5800 (changing this will scale anim speed)
    PreparationTime       = 6000 ;time to complete hack once prepared (unpacked)
    EffectValue           = 1000 ;amount of cash stolen
    SpecialObject         = BinaryDataStream
    PackSound             = BlackLotusPack
    UnpackSound           = BlackLotusUnpack
    TriggerSound          = BlackLotusTrigger
    PrepSoundLoop         = BlackLotusPrepLoop
    AwardXPForTriggering  = 20
    ;SkillPointsForTriggering = ???  -- Dustin, fill me out if you want different balance values.
  End
 
  ;Hero units can't be squished!
  ;Behavior = SquishCollide ModuleTag_14
  ;  ;nothing
  ;End


; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_BlackLotusDie
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_BlackLotusDie
    FX                  = INITIAL FX_BloodyPuddle3
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireFemale
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinFemale
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinFemale
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinFemale
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_17
    PoisonDamageInterval  = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration        = 3000       ; ... for this long after last hit by poison damage
  End
 
  Geometry = CYLINDER
  GeometryMajorRadius = 10.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  Scale = 0.88
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End

;------------------------------------------------------------------------------
Object ChinaInfantryTankHunter

  ; *** ART Parameters ***
  SelectPortrait         = SNTankHunter_L
  ButtonImage            = SNTankHunter
  
  UpgradeCameo1 = Upgrade_Nationalism
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes
  
  
    DefaultConditionState
      Model             = NIMSST_SKN
      IdleAnimation     = NIMSST_SKL.NIMSST_STA 0 30
      IdleAnimation     = NIMSST_SKL.NIMSST_IDA
      IdleAnimation     = NIMSST_SKL.NIMSST_IDB
      AnimationMode     = ONCE
      AnimationSpeedFactorRange = 0.8 1.2
      TransitionKey     = TRANS_Stand
      WeaponMuzzleFlash = PRIMARY MuzzleFX
      WeaponFireFXBone  = PRIMARY Muzzle
      WeaponLaunchBone  = PRIMARY Muzzle
      WeaponLaunchBone  = SECONDARY Muzzle
    End
    AliasConditionState = REALLYDAMAGED

    ConditionState      = FIRING_A 
      Animation         = NIMSST_SKL.NIMSST_ATA 
      AnimationMode     = ONCE
      TransitionKey     = TRANS_START_FIRING
    End
    AliasConditionState = REALLYDAMAGED FIRING_A
    
    ConditionState      = BETWEEN_FIRING_SHOTS_A
      Animation         = NIMSST_SKL.NIMSST_STA
      AnimationMode     = ONCE
      ; this is basically a trick: this guy has a nontrivial animation for firing,
      ; and a long recycle time between shots. we want him to finish his fire animation
      ; (unless he's ordered to do something else), so this is just a handy trick that
      ; says, "if the previous state had this transition key, allow it to finish before
      ; switching to us, if possible".
      WaitForStateToFinishIfPossible = TRANS_START_FIRING
    End
    AliasConditionState = REALLYDAMAGED BETWEEN_FIRING_SHOTS_A

    ConditionState      = MOVING
      Animation         = NIMSST_SKL.NIMSST_RNA 20
      AnimationMode     = LOOP
      Flags             = RANDOMSTART
      TransitionKey     = None
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = REALLYDAMAGED MOVING
    AliasConditionState = MOVING ATTACKING
    AliasConditionState = MOVING ATTACKING REALLYDAMAGED

    ConditionState      = RELOADING_A
      Animation         = NIMSST_SKL.NIMSST_ATA 10
      AnimationMode     = ONCE
      ;WeaponLaunchBone = PRIMARY WeaponA
    End
    AliasConditionState = MOVING RELOADING_A
    AliasConditionState = REALLYDAMAGED MOVING RELOADING_A

    ConditionState      = DYING
      Animation         = NIMSST_SKL.NIMSST_DTA
      Animation         = NIMSST_SKL.NIMSST_DTB
      AnimationSpeedFactorRange = 0.9 1.25
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Dying
    End
    AliasConditionState = DYING RUBBLE

    TransitionState     = TRANS_Dying TRANS_Flailing
      Animation         = NIMSST_SKL.NIMSST_ADTD1
      AnimationMode     = ONCE
    End

    ConditionState      = DYING EXPLODED_FLAILING
      Animation         = NIMSST_SKL.NIMSST_ADTD2
      AnimationMode     = LOOP
      TransitionKey     = TRANS_Flailing
    End

    ConditionState      = DYING EXPLODED_BOUNCING
      Animation         = NIMSST_SKL.NIMSST_ADTD3
      AnimationMode     = ONCE
      TransitionKey     = None
    End

    ;PARACHUTING ANIMATIONS
    ConditionState      = FREEFALL
      Animation         = NIMSST_SKL.NIMSST_POP
      AnimationMode     = ONCE
      TransitionKey     = TRANS_Falling
    End
    AliasConditionState = FREEFALL REALLYDAMAGED
    AliasConditionState = FREEFALL DYING
    
    ConditionState      = PARACHUTING
      Animation         = NIMSST_SKL.NIMSST_PHG
      AnimationMode     = LOOP
      Flags             = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
      TransitionKey     = TRANS_Chute
    End
    AliasConditionState = PARACHUTING REALLYDAMAGED
    AliasConditionState = PARACHUTING DYING
    
   ; TransitionState     = TRANS_Falling TRANS_Chute
   ;   Animation         = NIMSST_SKL.NIMSST_POP
   ;   AnimationMode     = ONCE
   ;   Flags             = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
   ; End
    
    TransitionState     = TRANS_Chute TRANS_Stand
      Animation         = NIMSST_SKL.NIMSST_PDN
      AnimationMode     = ONCE
    End

  End


  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:TankHunter
  Side = China
  EditorSorting = INFANTRY
  TransportSlotCount = 1                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY ChinaInfantryTankHunterMissileLauncher
  End
  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End
  VisionRange = 150
  ShroudClearingRange = 400
  Prerequisites
    Object = ChinaBarracks
  End
  BuildCost = 300
  BuildTime = 5.0          ;in seconds    

  ExperienceValue = 20 20 40 60    ;Experience point value at each level
  ExperienceRequired = 0 100 200 400  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrushableLevel         = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = ChinaInfantryTankHunterCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = TankHunterVoiceSelect
  VoiceMove = TankHunterVoiceMove
  VoiceAttack = TankHunterVoiceAttack
  VoiceAttackAir = TankHunterVoiceAttack
  VoiceGuard = TankHunterVoiceMove
  VoiceFear = TankHunterVoiceFear
  UnitSpecificSounds
    VoiceCreate          = TankHunterVoiceCreate
    VoiceGarrison = TankHunterVoiceGarrison
    VoiceEnter = TankHunterVoiceMove
    VoiceEnterHostile = TankHunterVoiceMove
    VoiceGetHealed      = TankHunterVoiceMove
  End

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

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = AIUpdateInterface ModuleTag_03
    AutoAcquireEnemiesWhenIdle = Yes
  End
  Locomotor = SET_NORMAL MissileDefenderLocomotor
  Behavior = HordeUpdate ModuleTag_04
    UpdateRate = 1000    ; how often to recheck horde status (msec)
    RubOffRadius = 60    ; if I am this close to a real hordesman, I will get to be an honorary hordesman
    Radius = 30          ; how close other units must be to us to count towards our horde-ness (~30 feet or so)
    KindOf = INFANTRY    ; what KindOf's must match to count towards horde-ness
    AlliesOnly = Yes     ; do we only count allies towards horde status? 
    ExactMatch = No      ; do we only count units of our exact same type towards horde status? (overrides kindof)
    Count = 5            ; how many units must be within Radius to grant us horde-ness
    Action = HORDE       ; when horde-ing, grant us the HORDE bonus
  End
  Behavior = PhysicsBehavior ModuleTag_05
    Mass = 5.0
  End

  Behavior = SpecialAbility ModuleTag_07
    SpecialPowerTemplate = SpecialAbilityTankHunterTNTAttack
    UpdateModuleStartsAttack = Yes
    InitiateSound = TankHunterVoiceTNT
  End
  Behavior = SpecialAbilityUpdate ModuleTag_08
    SpecialPowerTemplate = SpecialAbilityTankHunterTNTAttack
    StartAbilityRange = 5.0
    PreparationTime = 0
    SpecialObject = TNTStickyBomb
    MaxSpecialObjects = 8
    SpecialObjectsPersistWhenOwnerDies = No ;Charges are removed instantly when owner dies (nobody can detonate).
    SpecialObjectsPersistent = Yes          ;Charges are persistent till lifetime expires or owner detonates them.
    UniqueSpecialObjectTargets = Yes        ;This prevents multiple charges placed on the same object.
    FleeRangeAfterCompletion = 100.0         ;Runs away after finishing ability
  End

 
  Behavior = SquishCollide ModuleTag_09
    ;nothing
  End


; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA -LASERED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_TankHunterDie
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_TankHunterDie
    FX                  = INITIAL FX_BloodyPuddle3
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireChina
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_12
    PoisonDamageInterval = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration = 3000       ; ... for this long after last hit by poison damage
  End
 
  Geometry = CYLINDER
  GeometryMajorRadius = 10.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  Scale = 0.88
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End



;------------------------------------------------------------------------------
Object ChinaInfantryHacker

  ; *** ART Parameters ***
  SelectPortrait         = SNHacker2_L
  ButtonImage            = SNHacker2
  
  ;UpgradeCameo1 = NONE
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  Draw = W3DModelDraw ModuleTag_01
    OkToChangeModelColor = Yes

    ;NORMAL STANDING
    DefaultConditionState
      Model = NIHCKR_SKN
      IdleAnimation = NIHCKR_SKL.NIHCKR_STA 0 25
      ;Regular spice animations
      IdleAnimation = NIHCKR_SKL.NIHCKR_IDA
      IdleAnimation = NIHCKR_SKL.NIHCKR_IDB
      AnimationMode = ONCE
      WeaponFireFXBone = PRIMARY Bone_SatCom
      TransitionKey = TRANS_Stand
    End
    AliasConditionState = REALLYDAMAGED

    ConditionState = MOVING
      Animation = NIHCKR_SKL.NIHCKR_RNA 14
      AnimationMode = LOOP
      Flags = RANDOMSTART
      TransitionKey = None
      ParticleSysBone   = None InfantryDustTrails
    End
    AliasConditionState = MOVING UNPACKING
    AliasConditionState = MOVING UNPACKING REALLYDAMAGED

    ConditionState = UNPACKING
      Animation = NIHCKR_SKL.NIHCKR_ATB1
      AnimationMode = ONCE
    End
    AliasConditionState = UNPACKING FIRING_A
    AliasConditionState = UNPACKING REALLYDAMAGED
    AliasConditionState = UNPACKING FIRING_A REALLYDAMAGED

    ;HACKING ATTACK
    ConditionState = FIRING_A
      Animation = NIHCKR_SKL.NIHCKR_ATB2
      AnimationMode = LOOP
      TransitionKey = TRANS_FiringA
    End
    AliasConditionState = FIRING_A REALLYDAMAGED

    ConditionState = PACKING
      Animation = NIHCKR_SKL.NIHCKR_ATB3
      AnimationMode = ONCE
    End
    AliasConditionState = PACKING FIRING_A
    AliasConditionState = PACKING REALLYDAMAGED
    AliasConditionState = PACKING FIRING_A REALLYDAMAGED



    TransitionState = TRANS_FiringA TRANS_Stand ; I was stopped by a stop command, so I get no proper PACKING state
      Animation = NIHCKR_SKL.NIHCKR_ATB3
      AnimationMode = ONCE
    End


    ConditionState = FREEFALL
      Animation = NIHCKR_SKL.NIHCKR_PFL
      AnimationMode = LOOP
      TransitionKey = TRANS_Falling
    End
    AliasConditionState = FREEFALL REALLYDAMAGED
    AliasConditionState = FREEFALL DYING

    ConditionState = PARACHUTING
      Animation = NIHCKR_SKL.NIHCKR_PHG
      AnimationMode = LOOP
      Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
      TransitionKey = TRANS_Chute
    End
    AliasConditionState = PARACHUTING REALLYDAMAGED
    AliasConditionState = PARACHUTING DYING


    ConditionState = DYING
      Animation = NIHCKR_SKL.NIHCKR_DTA
      Animation = NIHCKR_SKL.NIHCKR_DTB
      AnimationMode = ONCE
      TransitionKey = TRANS_Dying
    End

    TransitionState = TRANS_Dying TRANS_Flailing
      Animation = NIHCKR_SKL.NIHCKR_ADTG1
      AnimationMode = ONCE
    End

    ConditionState = DYING EXPLODED_FLAILING
      Animation = NIHCKR_SKL.NIHCKR_ADTG2
      AnimationMode = LOOP
      TransitionKey = TRANS_Flailing
    End

    ConditionState = DYING EXPLODED_BOUNCING
      Animation = NIHCKR_SKL.NIHCKR_ADTG3
      AnimationMode = ONCE
      TransitionKey = None
    End

    ConditionState = SPECIAL_CHEERING
      Animation = NIHCKR_SKL.NIHCKR_CHA
      AnimationMode = LOOP
    End

    TransitionState = TRANS_Falling TRANS_Chute
      Animation = NIHCKR_SKL.NIHCKR_POP
      AnimationMode = ONCE
      Flags = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
    End

    TransitionState = TRANS_Chute TRANS_Stand
      Animation = NIHCKR_SKL.NIHCKR_PTD
      AnimationMode = ONCE
    End

  End

  ; ***DESIGN parameters ***
  DisplayName      = OBJECT:Hacker
  Side = China
  EditorSorting = INFANTRY
  TransportSlotCount = 1                 ;how many "slots" we take in a transport (0 == not transportable)

  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End
  VisionRange = 150
  ShroudClearingRange = 300
  Prerequisites
    Object = ChinaBarracks
    Object = ChinaPropagandaCenter
  End
  BuildCost = 600
  BuildTime = 20.0          ;in seconds    
  ExperienceValue = 50 100 150 400    ;Experience point value at each level
  ExperienceRequired = 0 100 300 500  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience

  CrushableLevel         = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet      = ChinaInfantryHackerCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = HackerVoiceSelect
  VoiceMove = HackerVoiceMove
  VoiceAttack = NoSound
  VoiceGuard = HackerVoiceMove
  VoiceFear = HackerVoiceFear
  VoiceTaskComplete = HackerVoiceHackComplete
  UnitSpecificSounds
    VoiceGarrison = HackerVoiceGarrison
    VoiceCreate     = HackerVoiceCreate
    UnitPack        = HackerPack
    UnitUnpack      = HackerUnpack
    UnitCashPing    = HackerCashPing
    VoiceEnter = HackerVoiceMove
    VoiceEnterHostile = HackerVoiceMove
    VoiceGetHealed      = HackerVoiceMove
    VoiceHackInternet   = HackerVoiceModeInternet
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK CAN_CAST_REFLECTIONS INFANTRY SCORE IGNORES_SELECT_ALL MONEY_HACKER

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 100.0
    InitialHealth   = 100.0
  End

  Behavior = HackInternetAIUpdate ModuleTag_03
    UnpackTime          = 7300 ;animation time is 7300 (changing this will scale anim speed)
    PackTime            = 5133 ;animation time is 5133 (changing this will scale anim speed)
    CashUpdateDelay     = 2000
    CashUpdateDelayFast = 1800  ; Fast speed used inside a container (can only hack inside an Internet Center)
    RegularCashAmount   = 5
    VeteranCashAmount   = 6
    EliteCashAmount     = 8
    HeroicCashAmount    = 10
    XpPerCashUpdate     = 1
    PackUnpackVariationFactor = 0.5 ;Adds + or - 20% to pack and unpack time randomly.
  End
  Locomotor = SET_NORMAL BasicHumanLocomotor
 
  Behavior = SpecialAbility ModuleTag_04
    SpecialPowerTemplate = SpecialAbilityHackerDisableBuilding
    UpdateModuleStartsAttack = Yes
    InitiateSound         = HackerVoiceHack
  End

  Behavior = SpecialAbilityUpdate ModuleTag_05
    SpecialPowerTemplate = SpecialAbilityHackerDisableBuilding
    StartAbilityRange = 150.0
    UnpackTime      = 7300 ;animation time is 7300 (changing this will scale anim speed)
    PackTime        = 5133 ;animation time is 5133 (changing this will scale anim speed)
    PreparationTime = 3000

    ;PersistentPrepTime = 500 ; old setting
    PersistentPrepTime = 333 ; NOTE! This drives how often the disable effect gets triggered
                             ; This is also how often a new particle system effect is spawned
    EffectDuration = 2000
    SpecialObject = BinaryDataStream
    DisableFXParticleSystem = DisabledEffectBinaryShower0
    PackSound       = HackerPack
    UnpackSound     = HackerUnpack
    PrepSoundLoop   = HackerPrepLoop
    AwardXPForTriggering  = 0    ;Careful, this is persistant so it's a DoT xp gain!
    ;SkillPointsForTriggering = ???  -- Dustin, fill me out if you want different balance values.
  End


  Behavior = PhysicsBehavior ModuleTag_06
    Mass = 5.0
  End

  Behavior = SquishCollide ModuleTag_08
    ;nothing
  End


; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA -LASERED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_HackerDie
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_HackerDie
    FX                  = INITIAL FX_BloodyPuddle3
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireChina
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_11
    PoisonDamageInterval = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration = 3000       ; ... for this long after last hit by poison damage
  End
 
  Geometry = CYLINDER
  GeometryMajorRadius = 10.0
  GeometryMinorRadius = 10.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  Scale = 0.88
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End

;------------------------------------------------------------------------------
Object ChinaInfantryCO

  ; *** ART Parameters ***
  SelectPortrait         = SAChinaOfficer_L  
  ButtonImage            = SAChinaOfficer
  
  UpgradeCameo1 = ChinaSubliminalMessaging
  ;UpgradeCameo2 = NONE
  ;UpgradeCameo3 = NONE
  ;UpgradeCameo4 = NONE
  ;UpgradeCameo5 = NONE

  Draw = W3DModelDraw ModuleTag_01

    OkToChangeModelColor = Yes

    ;NORMAL STANDING
    DefaultConditionState
      Model = NIOFCR_SKN
      IdleAnimation = NIOFCR_SKL.NIOFCR_STA 0 21
      ;Regular spice animations
      IdleAnimation = NIOFCR_SKL.NIOFCR_IDA
      IdleAnimation = NIOFCR_SKL.NIOFCR_IDB
      AnimationMode = ONCE
      WeaponFireFXBone = PRIMARY Muzzle
      WeaponMuzzleFlash = PRIMARY MuzzleFX
      TransitionKey = TRANS_STAND
    End

    ConditionState    = MOVING
      Animation       = NIOFCR_SKL.NIOFCR_RNA
      AnimationMode   = LOOP
      ParticleSysBone     = None InfantryDustTrails
    End

    ; NORMAL ATTACK
    ;--------------------------------------------------------
    ; Drawing gun
    ConditionState  = PREATTACK_A
      Animation     = NIOFCR_SKL.NIOFCR_ATAST
      AnimationMode = ONCE
    End
    AliasConditionState = PREATTACK_A MOVING
    AliasConditionState = PREATTACK_A FIRING_A
    AliasConditionState = PREATTACK_A BETWEEN_FIRING_SHOTS_A

    ; Firing gun
    ConditionState  = FIRING_A
      Animation     = NIOFCR_SKL.NIOFCR_ATALP
      AnimationMode = LOOP
      TransitionKey = TRANS_FIRING_A
    End
    ConditionState  = BETWEEN_FIRING_SHOTS_A
      Animation     = NIOFCR_SKL.NIOFCR_ATALP
      AnimationMode = LOOP
      TransitionKey = TRANS_FIRING_A
    End
    AliasConditionState = RELOADING_A
    AliasConditionState = MOVING FIRING_A
    AliasConditionState = MOVING BETWEEN_FIRING_SHOTS_A
    AliasConditionState = MOVING RELOADING_A

    ; This transition allows him to put his gun away when he's finished attacking.
    TransitionState = TRANS_FIRING_A TRANS_STAND
      Animation     = NIOFCR_SKL.NIOFCR_ATAED
      AnimationMode = ONCE
    End
    ;--------------------------------------------------------

    ConditionState  = DYING
      Animation     = NIOFCR_SKL.NIOFCR_DTA
      Animation     = NIOFCR_SKL.NIOFCR_DTB
      AnimationMode = ONCE
      TransitionKey = TRANS_Dying
    End

    TransitionState = TRANS_Dying TRANS_Flailing
      Animation = NIOFCR_SKL.NIOFCR_ADTE1
      AnimationMode = ONCE
    End

    ConditionState = DYING EXPLODED_FLAILING
      Animation = NIOFCR_SKL.NIOFCR_ADTE2
      AnimationMode = LOOP
      TransitionKey = TRANS_Flailing
    End

    ConditionState = DYING EXPLODED_BOUNCING
      Animation = NIOFCR_SKL.NIOFCR_ADTE3
      AnimationMode = ONCE
      TransitionKey = None
    End

    ConditionState  = SPECIAL_CHEERING
      Animation     = NIOFCR_SKL.NIOFCR_CHA
      AnimationMode = LOOP
    End

    ;PARACHUTING ANIMATIONS

    ;@TODO - MISSING ANIMATION FILE
    ;ConditionState   = FREEFALL
    ;  Animation      = AIOFCR_SKL.AIOFCR_PFL
    ;  AnimationMode  = LOOP
    ;  TransitionKey  = TRANS_Falling
    ;End
    ;AliasConditionState = FREEFALL REALLYDAMAGED
    ;AliasConditionState = FREEFALL DYING
    ConditionState  = PARACHUTING
      Animation     = AIOFCR_SKL.AIOFCR_PHG
      AnimationMode = LOOP
      Flags         = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
      TransitionKey = TRANS_Chute

    End
    AliasConditionState = PARACHUTING REALLYDAMAGED
    AliasConditionState = PARACHUTING DYING
    TransitionState = TRANS_Falling TRANS_Chute
      Animation     = AIOFCR_SKL.AIOFCR_POP
      AnimationMode = ONCE
      Flags         = PRISTINE_BONE_POS_IN_FINAL_FRAME  ; our bone positions should come from the last frame, rather than the first
    End
    TransitionState = TRANS_Chute TRANS_Stand
      Animation     = AIOFCR_SKL.AIOFCR_PTD
      AnimationMode = ONCE
    End

  End

  ; ***DESIGN parameters ***
  DisplayName         = OBJECT:Officer
  Side                = China
  EditorSorting       = INFANTRY
  TransportSlotCount  = 1                 ;how many "slots" we take in a transport (0 == not transportable)
  WeaponSet
    Conditions = None 
    Weapon = PRIMARY AmericaOfficerMachineGun
  End
  ArmorSet
    Conditions      = None
    Armor           = HumanArmor
    DamageFX        = InfantryDamageFX
  End
  VisionRange = 100
  ShroudClearingRange = 200
  Prerequisites
    Object = ChinaPropagandaCenter
  End
  BuildCost     = 950
  BuildTime     = 15.0          ;in seconds      

  ExperienceValue = 5 5 10 20   ;Experience point value at each level
  ExperienceRequired = 0 20 40 80  ;Experience points needed to gain each level
  IsTrainable = Yes             ;Can gain experience
  CrushableLevel         = 0  ;What am I?:        0 = for infantry, 1 = for trees, 2 = general vehicles
  CommandSet    = OfficerCommandSet

  ; *** AUDIO Parameters ***
  VoiceSelect = RedGuardVoiceMove
  VoiceMove = RedGuardVoiceMove
  VoiceGuard = RedGuardVoiceMove
  VoiceAttack = RedGuardVoiceAttack
  VoiceGroupSelect = BattleCrySound
  VoiceFear = RedGuardVoiceFear
  VoiceTaskComplete = RedGuardVoiceCaptureComplete
  UnitSpecificSounds
    VoiceMelee      = RedGuardVoiceAttackBayonet
    VoiceGarrison   = RedGuardVoiceGarrison
    VoiceCreate     = RedGuardVoiceCreate
    VoiceSubdue     = RedGuardVoiceSubdue
    VoiceEnter      = RedGuardVoiceMove
    VoiceEnterHostile = RedGuardVoiceMove
    VoiceGetHealed      = RedGuardVoiceMove
  End

  ; *** ENGINEERING Parameters ***
  RadarPriority = UNIT
  KindOf = PRELOAD SELECTABLE CAN_ATTACK ATTACK_NEEDS_LINE_OF_SIGHT CAN_CAST_REFLECTIONS INFANTRY SCORE PARACHUTABLE

  Body = ActiveBody ModuleTag_02
    MaxHealth       = 120.0
    InitialHealth   = 120.0
  End

  Behavior = AIUpdateInterface ModuleTag_04
    AutoAcquireEnemiesWhenIdle = Yes
  End

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

  Locomotor = SET_NORMAL RedguardLocomotor

  Behavior = PhysicsBehavior ModuleTag_07
    Mass = 5.0
  End

  Behavior = SquishCollide ModuleTag_10
    ;nothing
  End

; --- begin Death modules ---
  Behavior = SlowDeathBehavior ModuleTag_Death01
    DeathTypes          = ALL -CRUSHED -SPLATTED -EXPLODED -BURNED -POISONED -POISONED_BETA -POISONED_GAMMA -LASERED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_RedGuardDie
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death02
    DeathTypes          = NONE +CRUSHED +SPLATTED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_GIDieCrushed
    FX                  = INITIAL FX_BloodyPuddle3
  End
  Behavior = SlowDeathBehavior ModuleTag_Death03
    DeathTypes          = NONE +EXPLODED
    SinkDelay           = 3000
    SinkRate            = 0.5     ; in Dist/Sec
    DestructionDelay    = 8000
    FX                  = INITIAL FX_RedGuardDie
    FX                  = INITIAL FX_BloodyPuddle3
    FlingForce          = 8
    FlingForceVariance  = 3
    FlingPitch          = 60
    FlingPitchVariance  = 10
  End
  Behavior = SlowDeathBehavior ModuleTag_Death04
    DeathTypes          = NONE +BURNED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByFireChina
    OCL                 = INITIAL OCL_FlamingInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death05
    DeathTypes          = NONE +POISONED
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantry
  End
  Behavior = SlowDeathBehavior ModuleTag_Death06 ; don't forget to give it a new, unique module tag
    DeathTypes          = NONE +POISONED_BETA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryBeta ;you'll have to create this OCL and make it use the blue guys instead of green ones
  End

  Behavior = SlowDeathBehavior ModuleTag_Death07
    DeathTypes          = NONE +POISONED_GAMMA
    DestructionDelay    = 0
    FX                  = INITIAL FX_DieByToxinChina
    OCL                 = INITIAL OCL_ToxicInfantryGamma
  End
; --- end Death modules ---

  Behavior = PoisonedBehavior ModuleTag_15
    PoisonDamageInterval = 100  ; Every this many msec I will retake the poison damage dealt me...
    PoisonDuration = 3000       ; ... for this long after last hit by poison damage
  End

  Behavior        = PropagandaTowerBehavior ModuleTag_16
    Radius                = 200.0
    DelayBetweenUpdates   = 1500 ; in milliseconds
    HealPercentEachSecond = 2%   ; get this % of max health every second 
    PulseFX               = FX_PropagandaTowerPropagandaPulse ;plays as often as DelayBetweenUpdates
    UpgradeRequired       = Upgrade_ChinaSubliminalMessaging
    UpgradedHealPercentEachSecond = 4%   ; get this % of max health every second 
    UpgradedPulseFX       = FX_PropagandaTowerSubliminalPulse ;plays as often as DelayBetweenUpdates
  End

  Behavior           = OCLSpecialPower ModuleTag_17
    SpecialPowerTemplate = SuperweaponInfernoStrike
    OCL                  = SUPERWEAPON_InfernoStrike
    CreateLocation       = CREATE_AT_EDGE_FARTHEST_FROM_TARGET
  End

  Behavior = VeterancyGainCreate ModuleTag_18
    StartingLevel = VETERAN
  End

  Geometry = CYLINDER
  GeometryMajorRadius = 7.0
  GeometryMinorRadius = 7.0
  GeometryHeight = 12.0
  GeometryIsSmall = Yes
  Shadow = SHADOW_DECAL
  ShadowSizeX = 14;
  ShadowSizeY = 14;
  Scale = 0.88
  ShadowTexture = ShadowI;
  BuildCompletion = APPEARS_AT_RALLY_POINT

End