   Actor ShotgunGI : GenericHumanScum 
       {
  //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------
 	   
	DropItem "HealthFlask" 40
	DropItem "ArmorCharge" 40
	DropItem "AmmoPack" 20
	DropItem "HandGrenadeAmmo" 50 1
	DropItem "MineAmmo" 25 1	   
	   
  Health 45
  Radius 20
  Height 56
  Mass 100
    Species "Z"
  +DOHARMSPECIES
  Speed 8
  PainChance 170
  Monster
  +FLOORCLIP
  Tag "Shotgun GI"
  Translation "112:127=152:159"	
  Species "Shotgunner"
  SeeSound "USN/See"
  PainSound "GTS/pain"
  DeathSound "GTS/death"
  ActiveSound "USN/active"
  Obituary "%o was mistaken with a communist gook by completely sane and competent shotgun GI"
  DropItem "Shotgun"
  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:
    RAS2 A 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 ("ShotgunShotCounter", 6, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    RAS2 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 ("ShotgunShotCounter", 6, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    RAS2 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))
	    RAS2 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))
	    RAS2 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
	    RAS2 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)) 
	    RAS2 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)) 
	    RAS2 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 (150, "M67Check")
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 30, JLOSF_DEADNOJUMP)
	Goto SeeLoop	
  Missile:
	TNT1 A 0 A_TakeInventory ("GrenadecoolDown", 1)
    TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload") 
    RAS2 E 15 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1200)
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 42, 4, random (-4,3))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    RAS2 F 10 Bright 
    RAS2 E 10
    Goto SeeLoop
  Accuracy:
    RAS2 E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 42, 4, random (-2,2))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    RAS2 F 10 Bright 
    RAS2 E 10
    Goto SeeLoop
  RageShot:
	RAS2 E 10 A_FaceTarget
  RageShotLoop:
	RAS2 E 10 A_FaceTarget 	
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 42, 4, random (-6,-3))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    RAS2 F 7 Bright 
    RAS2 E 3
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 8, "Reload")
    Loop
  M67Check:
    TNT1 A 0 A_JumpIfTargetInLos ("M67", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 700, 300)
	Goto MissileCheck+2
  M67:
    //TNT1 A 0 A_Print ("Granata")
    RAS2 E 5 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GRNTOSS", CHAN_WEAPON)
	RAS2 D 3 A_CustomMissile ("M67Grenade", 42, 0, random (-5,5), CMF_OFFSETPITCH, random (8, 12))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 1)
	Goto SeeLoop		
  Reload:
    RAS2 DE 5 A_PlaySound ("SHOTLOD")
	RAS2 DE 5 A_PlaySound ("SHOTLOD") 
	RAS2 DE 5 A_PlaySound ("SHOTLOD")
	RAS2 DE 5 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 8)
	RAS2 DE 5 A_PlaySound ("SHOTLOD")
	RAS2 DE 5 A_PlaySound ("SHOTLOD")
	RAS2 DE 5 A_PlaySound ("SHOTLOD") 
	RAS2 DE 5 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_Playsound ("SHOTPUMP")
	Goto SeeLoop
  Pain:
    RAS2 G 3
    RAS2 G 3 A_Pain
	TNT1 A 0 A_Jump (74, "RageShot")
    Goto SeeLoop
  Death:
    RAS2 H 5
    RAS2 I 5 A_Scream
    RAS2 J 5 A_NoBlocking
    RAS2 K 5 A_Playsound ("FallingBodyGear", CHAN_BODY)
    RAS2 L -1
    Stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    SPOS M 5
	SPOS N 5 A_XScream
	SPOS Q 2 A_NoBlocking
	SPOS RST 5
	SPOS U -1
	Stop
  Raise:
    TNT1 A 0 
    TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    RAS2 L 5
    RAS2 KJIH 5
    Goto See
     }

}

	Actor ShotgunGISpawner : RandomSpawner
		{
		 DropItem ShotgunGI
		 DropItem ShotgunGIDarkGreen
		 DropItem ShotgunGISwamp
		}
	   
	   

Actor ShotgunGIDarkGreen : ShotgunGI 
  {
   Translation "112:127=123:127"
  }

Actor ShotgunGISwamp : ShotgunGI 
  {
   Translation "112:127=9:12"	 
  }			