actor CorruptCopShotgunner : 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 was shotgunned down, killed, murdered and eventually arrested by the Police Brutality Enjoyer"
  health 35
  radius 15
  height 54
  mass 100
  speed 10
    Species "Z"
  +DOHARMSPECIES
  painchance 150
  SeeSound "PBEnjoyer/see"
  PainSound "PBENPA01"
  DeathSound "Manhunt/Death"
  ActiveSound "PBEnjoyer/Active" 
  dropitem "Shotgun"
  Tag "police Brutality Enjoyer"
  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:
    PBEN A 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUPBEnjoyer")
	 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", 7, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    PBEN AABBCCDD 3 A_Chase
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 7, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    PBEN 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))
	    PBEN 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))
	    PBEN 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
	    PBEN 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)) 
	    PBEN 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)) 
	    PBEN 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_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop
  MissileAmbush:
    PBEN EE 4 A_FaceTarget	
  Missile:
    PBEN E 11 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	TNT1 A 0 A_JumpIfTargetInLos ("CloseQuarters", 0, JLOSF_DEADNOJUMP, 550)
	TNT1 A 0 A_Jump (175, "MissileLeft", "MissileRight")
	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)
    PBEN F 6 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	Goto SeeLoop
  MissileLeft:
    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 (-10,-5))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    PBEN F 6 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	Goto SeeLoop
  MissileRight:
    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,10))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    PBEN F 6 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	Goto SeeLoop	
  CloseQuarters:
    TNT1 A 0 A_JumpIfCloser (250, "MissileRetreat")
    PBEN E 5 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)
    PBEN F 6 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	Goto SeeLoop
 MissileRetreat:
    PBEN AABBCCDDAABBCCDD 2 A_Recoil (1)
	PBEN E 5 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), CMF_OFFSETPITCH, random (-3,3))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    PBEN F 6 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 7, "Reload") 
	Goto SeeLoop
  Reload:
    PBEN DE 6 A_Playsound ("SHOTLOD")
	PBEN DE 6 A_Playsound ("SHOTLOD")
	PBEN DE 6 A_Playsound ("SHOTLOD")
	PBEN DE 6 A_Playsound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 7)
	PBEN DE 6 A_Playsound ("SHOTLOD")
	PBEN DE 6 A_Playsound ("SHOTLOD")
	PBEN DE 6 A_Playsound ("SHOTLOD")
	TNT1 A 0 A_PlaySound ("SHOTPUMP")
	Goto SeeLoop	
  Pain:
    PBEN G 3
    PBEN G 3 A_Pain
    goto SeeLoop
  Death:
    PBEN I 5  A_Scream
    PBEN J 5 A_NoBlocking
    PBEN K 5 A_Playsound ("FallingBodyGear", CHAN_BODY)
    PBEN L -1 
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    PGIB A 4
    PGIB B 4 A_XScream
    PGIB C 4 A_NoBlocking
    PGIB D 3
    PGIB E -1
    Stop
  Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	PBEN LKJI 5
   Goto See	
  Idle:
    PBEN AA 4 A_Wander
    PBEN A 0 A_Look
    PBEN BB 4 A_Wander
    PBEN A 0 A_Look
    PBEN CC 4 A_Wander
    PBEN A 0 A_Look
    PBEN DD 4 A_Wander
    PBEN A 0 A_Look
    loop
  }
}

	