     Actor TerFieldCommander : GenericHumanScum 
       {
	   
   //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------
  
  DropItem "Stimkit" 60
DropItem "ArmorCharge" 60
DropItem "AmmoPack" 40
DropItem "HandGrenadeAmmo" 100 1
DropItem "MineAmmo" 50 1
DropItem "WeaponUpgradeBox" 30	   
	   
  scale 1.0
  obituary "%o was killed by the Terrorist Field Commander"
  health 250
  radius 15
  height 54
  mass 100
  speed 14
  Species "Arch"
  Species "Squad"
  +NODROPOFF
  +DONTHARMSPECIES
  +THRUSPECIES
  painchance 10
  SeeSound "FieldCommander/See"
  PainSound "Ster/pain"
  DeathSound "Ster/Death"
  ActiveSound "FieldCommander/Active"
  dropitem "ClipBox", 15
  Translation "148:148=32:32", "149:149=32:32", "150:150=32:32", "151:152=32:33", "153:153=33:33", "154:155=33:34", "156:156=34:34", "157:157=34:34", "158:159=34:35", "160:160=35:35", "161:162=35:36", "163:163=36:36", "164:165=36:37"
  Tag "Terrorist Field Commander"
  MONSTER
  +FLOORCLIP
  States
       {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("STFUCheck") == 1, "STFU")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult ("VanJumpCheck") == 1, "VanJump")
	TNT1 A 0 A_SetScale (scaleX+frandom(-0.02, 0.02), scaleY+frandom(-0.08,0.08))
	TNT1 A 0 A_SpawnItemEx ("AlaWRITER", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION, 69)	
   Spawn2:	
    ALIB S 10 A_Look
    loop
   STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUArab")
	 Goto Spawn+2
   VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
  KabeemCheck:
    TNT1 A 0 
    TNT1 A 0 A_JumpIfCloser (115, "Kabeem")
   Goto SeeLoop	
  Kabeem:	
    ALIB H 30 A_PlaySound ("ALBASHAH")
	TNT1 A 0 A_CustomMissile ("AllaExplosion", 32, 0)
	TNT1 A 0 DamageThing (999)
   Goto XDeath		
  See:
    "####" A random(1,4)
    TNT1 A 0 A_Jump (70, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
	TNT1 A 0 A_Jump (180, "MissileCheck")
  SeeLoop:
    TNT1 A 0 A_CheckSight ("CheckReload")
    TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    ALIB AABBCCDD 2 A_Chase
	TNT1 A 0 A_JumpIfHealthLower (20, "KabeemCheck") 
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	Goto SeeLoop+1
  DodgeCheck:
	TNT1 A 0
	TNT1 A 0 A_Jump (256, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		TNT1 A 0 A_Jump (50, "DodgeRight")
		Goto SeeLoop+1
	DodgeLeftF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (-8,-3))
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
    DodgeLeftB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (3,8))
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRightF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (-8,-3)) 
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRightB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (3,8)) 
	    EK1B AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
  MissileCheck:
	TNT1 A 0 A_JumpIfInventory ("GrenadeCoolDown", 1, 2)
    TNT1 A 0 A_Jump (175, "40mmCheck") 
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop
  Missile:
    ALIB E 9 A_FaceTarget
	TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
	TNT1 A 0 A_JumpIfTargetInLos ("TriShot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 750) 
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1500)
  MissileLoop:
    TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9,random (-1,1))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_GiveInventory ("AccuracyCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	TNT1 A 0 A_JumpIfInventory ("AccuracyCounter", 5, "MissileDodge") 
    ALIB E 2 A_MonsterRefire (40, "SeeLoop")
	goto MissileLoop
  MissileDodge:
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9,random (-1,1))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	ALIB E 2 A_MonsterRefire (40, "SeeLoop")
	TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck", 5, JLOSF_DEADNOJUMP, 650, 0)
	Loop
  Trishot:
    TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9, 0)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	ALIB E 2 A_FaceTarget 
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9, 0)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	ALIB E 2 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9,random (-1,1))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	TNT1 A 0 A_Jump (120, "Command40mm")
	ALIB E 2 A_MonsterRefire (40, "SeeLoop")
	Goto SeeLoop
  Accuracy:
    ALIB E 4 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("HR155FF", 6, 0.5, 0)
	ALIB F 1 BRIGHT A_CustomMissile ("HRTracer",42,9)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 15, "Reload")
	ALIB E 2 A_MonsterRefire (40, "SeeLoop")
	TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck", 5, JLOSF_DEADNOJUMP, 1500, 0)
	Loop
  40mmCheck:
	TNT1 A 0
    TNT1 A 0 A_JumpIfTargetInLos ("40mm", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 1200, 560)
	Goto MissileCheck+1
  40mm:
    EK1B E 10 A_FaceTarget
	TNT1 A 0 A_Jump (120, "Command40mm")
	TNT1 A 0 A_PlaySound ("GLFIR", CHAN_WEAPON)
	EK1B F 4 BRIGHT A_CustomMissile ("Grenade40mm", 32, 0, random (-3,3), CMF_OFFSETPITCH, random (10, 16))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 3)
	TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck", 5, JLOSF_DEADNOJUMP, 1200, 0)
	Goto SeeLoop
  Command40mm:
	TNT1 A 0
	TNT1 A 0 A_PlaySound ("FieldCommander/Command", CHAN_VOICE, 1.0, false, 0.2)
	TNT1 A 0 A_RadiusGive ("OrderToFire", 1650, RGF_MONSTERS, 1)
	EK1B E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GLFIR", CHAN_WEAPON)
	EK1B F 4 BRIGHT A_CustomMissile ("Grenade40mm", 32, 9, random (-3,3), CMF_OFFSETPITCH, random (10, 16))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 3)
	TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck", 5, JLOSF_DEADNOJUMP, 1200, 0)
	Goto SeeLoop
  Reload:
    EK1B D 15 A_Playsound ("HRIFOUT")
	TNT1 A 0 A_TakeInventory ("AKShotCounter", 15)
	ALIB E 35 A_Playsound ("HRIFIN")
	EK1B D 8
	Goto SeeLoop
  Pain:
    ALIB H 3
    ALIB H 3 A_Pain
    goto SeeLoop
  Death:
  	//TNT1 A 0 A_Jump(20, "Suren")
    ALIB I 5 A_Scream
    ALIB J 5
    ALIB K 5 A_NoBlocking
    ALIB L 5 A_Playsound ("FallingBodyGear", CHAN_BODY)
    ALIB M -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_XScream
    ALIB UV 6 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
  //Suren:
    RSS1 A 5 A_PlaySound("Baddy/Surren")
    RSS1 B 5 
    RSS1 C 5 A_NoBlocking
    RSS1 C 5 A_SpawnItem("Russ1wimp",0,0)
    stop
  Idle:
    ALIB AA 4 A_Wander
    ALIB A 0 A_Look
    ALIB BB 4 A_Wander
    ALIB A 0 A_Look
    ALIB CC 4 A_Wander
    ALIB A 0 A_Look
    ALIB DD 4 A_Wander
    ALIB A 0 A_Look
    loop
  }
	   
	   
	   }
	   
	   
	   
	Actor OrderToFire : Inventory
		{
		
		}