actor CartelFancyShotgunner : GenericHumanScum
{

   //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------
 	   
	DropItem "HealthFlask" 40
	DropItem "ArmorCharge" 40
	DropItem "AmmoPack" 20
	DropItem "HandGrenadeAmmo" 50 1
	DropItem "MineAmmo" 25 1
  
  scale 1.0
  obituary "%o shouldn't interrupt the business of the cool-ass cartel shotgunner"
  health 45
  radius 15
  height 54
  mass 100
  speed 12
    Species "Z"
  +DOHARMSPECIES
  painchance 135
  Translation "112:127=5:12", "192:207=7:12"
  SeeSound "Cartel/see"
  PainSound "GTS/pain"
  DeathSound "GTS/Death"
  ActiveSound "Cartel/Active" 
  dropitem "Shotgun"
  Tag "Cartel fancy shotgunner"
  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.03, 0.03), scaleY+frandom(-0.08,0.08))
	TNT1 A 0 A_SpawnItemEx ("HumanTrails", 0, 0, 0)
  Spawn2:
    ES8A T 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUCartel")
	 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", 9, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    ES8A AABBCCDD 3 A_Chase
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 9, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    ES8A 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))
	    ES8A 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))
	    ES8A 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
	    ES8A 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)) 
	    ES8A 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)) 
	    ES8A AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	FallBackSlight:
 	    ES8A AABB 2 A_Recoil (1)
		ES8A B 2 
		ES8A CCDD 2 A_Recoil (1)
		ES8A D 1
		ES8A AABB 2 A_Recoil (1)
		ES8A B 2 
		ES8A CCDD 2 A_Recoil (1)
	   Goto MissileCheck
	Evading:
	    ES8A AABBCCDDAABBCCDDAABBCCDDAABBCCDDAABBCCDD 2 A_Wander
  MissileCheck:
    TNT1 A 0 A_JumpIfInventory ("GrenadeCoolDown", 1, 2)
    TNT1 A 0 A_Jump (185, "PipeBombCheck")
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop		
  Missile:
    TNT1 A 0
	TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
    TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 9, "Reload")
    ES8A EF 11 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 950)
	TNT1 A 0 A_JumpIfTargetInLos ("TripleShot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 949, 345) 
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 9, random (-4,4))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	ES8A G 4 BRIGHT A_FaceTarget 
    ES8A FE 6 A_FaceTarget
	TNT1 A 0 A_JumpIfCloser (320, "FallBackSlight")
    goto SeeLoop
  Accuracy:
    ES8A E 18 A_FaceTarget
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 9, random (-2,2))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    ES8A G 5 Bright A_FaceTarget 
    ES8A F 6 A_JumpIfInventory ("ShotgunShotCounter", 9, "Reload")
	TNT1 A 0 A_JumpIfInTargetLos ("Evading", 0, JLOSF_DEADNOJUMP | JLOSF_CLOSENOJUMP, 0, 950)
	ES8A E 3 A_MonsterRefire (40, "SeeLoop")
   Loop
  TripleShot:
	ES8A F 6 A_FaceTarget
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 9, random (-3,3))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	ES8A G 4 BRIGHT A_FaceTarget 
    ES8A F 6 A_JumpIfInventory ("ShotgunShotCounter", 9, "Reload")
	ES8A F 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", 32, 9, random (-4,4))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	ES8A G 4 BRIGHT A_FaceTarget
	ES8A F 6 A_JumpIfInventory ("ShotgunShotCounter", 9, "Reload")
	ES8A F 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", 32, 9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	ES8A G 4 BRIGHT A_FaceTarget
    ES8A FE 5 A_FaceTarget
	Goto SeeLoop
  PipeBombCheck:
	TNT1 A 0
    TNT1 A 0 A_JumpIfTargetInLos ("PipeBomb", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 685, 420)
	Goto MissileCheck+2
  PipeBomb:
    ES8A DE 9 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GRNTOSS", CHAN_WEAPON)
	ES8A F 3 A_CustomMissile ("PipeBomb", 42, 0, random (-4,4), CMF_OFFSETPITCH, random (16, 19))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 2)
	TNT1 A 0 A_Jump (125, "ChaseShot") 
	Goto SeeLoop
  ChaseShot:
    ES8A EF 9 A_FaceTarget 
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 9, random (-5,5))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	ES8A G 4 BRIGHT 
    ES8A FE 4 A_FaceTarget
	Goto SeeLoop
  Reload:
    ES8A DE 9 A_PlaySound ("SHOTLOD") 
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 9)
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	ES8A DE 9 A_PlaySound ("SHOTLOD") 
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	ES8A DE 9 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_Playsound ("SHOTPUMP")
	Goto SeeLoop	
  Pain:
    ES8A H 3
    ES8A H 3 A_Pain
    goto SeeLoop
  Death:
    ES8A I 5  A_Scream
    ES8A J 5 A_NoBlocking
    ES8A K 5 
    ES8A L 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
    ES8A M -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    ES8A U 5
    ES8A V 5 A_XScream
    PGIB A 5 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)
	ES8A MLKJI 5
   Goto See	
  //Suren:
    MOS1 A 5 A_PlaySound("Baddy/Surren")
    MOS1 B 5 
    MOS1 C 5 A_NoBlocking
    MOS1 C 5 A_SpawnItem("Mook1wimp",0,0)
    stop
  Idle:
    ES8A AA 4 A_Wander
    ES8A A 0 A_Look
    ES8A BB 4 A_Wander
    ES8A A 0 A_Look
    ES8A CC 4 A_Wander
    ES8A A 0 A_Look
    ES8A DD 4 A_Wander
    ES8A A 0 A_Look
    loop
  }
}



	Actor CartelFancyShotgunnerSpawner : RandomSpawner
		{
		 DropItem CartelFancyShotgunner
		}
		
		
	Actor CartelFancyShotgunnerNavyPants : CartelFancyShotgunner
		{
		 Translation "192:207=240:247"
		}
		
	
	Actor CartelFancyShotgunnerYellowNavyPants : CartelFancyShotgunner
		{
		 Translation "112:127=160:167", "192:207=240:247"
		}
		
	
	Actor CartelFancyShotgunnerOrangeGreyPants : CartelFancyShotgunner
		{
		 Translation "112:127=208:239", "192:207=92:111"
		}
		
		
	Actor CartelFancyShotgunnerHakiBrownPants : CartelFancyShotgunner
		{
		 Translation "112:127=5:12", "192:207=64:79"
		}
		
	
	Actor CartelFancyShotgunnerBlackPants : CartelFancyShotgunner
		{
		 Translation "192:207=5:8"
		}
		
		
		