Actor CorruptedGI : GenericHumanScum    //Vietnam USMC
  { 
  scale 1.0
  obituary "%o became unfortunate victim of the Sacred War in the name of Democracy and Peace"
  health 195
  radius 15
  height 54
  mass 100
  speed 10
  Damage 2
  Species "KNIGHT"
+DONTHARMSPECIES
  painchance 200
  SeeSound "USN/See"
  PainSound "GTS/pain"
  DeathSound "GTS/Death"
  ActiveSound "USN/Active"
  dropitem "Chaingun", 1
  Tag "GI Rifle"
  MONSTER
  Species "USN"
  +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.04,0.04))	
	TNT1 A 0 A_SpawnItemEx ("HumanTrails", 0, 0, 0)
  Spawn2:
    ZZLY E 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUUSN")
	 Goto Spawn+2
  VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
  See:
    "####" A random(1,5)
    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", 30, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    ZZLY AABBCCDD 3 A_Chase
	TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    ZZLY 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))
	    ZZLY 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))
	    ZZLY 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
	    ZZLY 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)) 
	    ZZLY 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)) 
	    ZZLY 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 (169, "M67Check")
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop
  Missile:
    TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
    ZZLY E 7 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("TriShot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 950)
	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 ("AR155FF", 6, 0.5, 0)
	ZZLY F 2 BRIGHT A_CustomMissile ("AKTracer",42,0,random (-4,4))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	//TNT1 A 0 A_JumpIfInTargetLos ("DodgeCheck")
	TNT1 A 0
    ZZLY E 3 A_MonsterRefire (40, "SeeLoop")
	TNT1 A 0 A_Jump (3, "SeeLoop")
	goto MissileLoop
  Trishot:
    TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	ZZLY F 2 BRIGHT A_CustomMissile ("AKTracer",42,0,random (-1,0))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	ZZLY E 3 A_FaceTarget 
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	ZZLY F 2 BRIGHT A_CustomMissile ("AKTracer",42,0,random (-1,1))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	ZZLY E 3 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	ZZLY F 2 BRIGHT A_CustomMissile ("AKTracer",42,0,random (-2,2))
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1500)
	ZZLY E 3 A_MonsterRefire (40, "SeeLoop")
	Goto SeeLoop
  Accuracy:
    ZZLY E 7 A_FaceTarget
	TNT1 A 0 A_PlaySound ("USZRFL")
	TNT1 A 0 A_PlaySound ("AR155FF", 6, 0.5, 0)
	ZZLY F 2 BRIGHT A_CustomMissile ("AKTracer",42,0)
	TNT1 A 0 A_GiveInventory ("AKShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("AKShotCounter", 30, "Reload")
	TNT1 A 0 A_JumpIfTargetInLos ("TriShot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 950)
	Goto SeeLoop
  M67Check:
    TNT1 A 0 A_JumpIfTargetInLos ("M67", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 700, 300)
	Goto MissileCheck+2
  M67:
    //TNT1 A 0 A_Print ("Granata")
    ZZLY D 7 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GRNTOSS", CHAN_WEAPON)
	ZZLY E 3 A_CustomMissile ("M67Grenade", 42, 0, random (-3,3), CMF_OFFSETPITCH, random (8, 12))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 1)
	Goto SeeLoop
  Reload:
    ZZLY D 20 A_Playsound ("RIFOUT")
	TNT1 A 0 A_TakeInventory ("AKShotCounter", 30)
	ZZLY E 36 A_Playsound ("RIFIN")
	ZZLY D 16 A_Playsound ("RIFREAD")
	Goto SeeLoop
  Pain:
    ZZLY G 3
    ZZLY G 3 A_Pain
    goto SeeLoop
  Death:
  	//TNT1 A 0 A_Jump(20, "Suren")
    ZZLY H 5 A_Scream
    ZZLY I 5
    ZZLY J 5 A_NoBlocking
    ZZLY K 5
    ZZLY L -1
    stop
  Death.WEAK:
    ZZLY O 5
    ZZLY P 5 A_PlaySound("Baddy/pain")
    ZZLY Q 5 A_NoBlocking
    ZZLY R 5
    ZZLY S -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    PGIB A 4 A_XScream
    PGIB A 1 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
  Raise:
    TNT1 A 0 
    TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	ZZLY LKJIH 5
   Goto See	
  //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:
    ZZLY AA 4 A_Wander
    ZZLY A 0 A_Look
    ZZLY BB 4 A_Wander
    ZZLY A 0 A_Look
    ZZLY CC 4 A_Wander
    ZZLY A 0 A_Look
    ZZLY DD 4 A_Wander
    ZZLY A 0 A_Look
    loop
  }
  
 }
 
 
 
  Actor GrenadeCoolDown : Inventory
    {
	 Inventory.Maxamount 30
	}