ACTOR NakedShotgunner : GenericHumanScum 
{

  //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------
 	   
	DropItem "HealthFlask" 40
	DropItem "ArmorCharge" 40
	DropItem "AmmoPack" 20
	DropItem "HandGrenadeAmmo" 50 1
	DropItem "MineAmmo" 25 1
 
  Health 28
  Radius 20
  Height 56
  Mass 100
  Speed 12
  PainChance 150
    Species "Z"
  +DOHARMSPECIES
  Translation "112:127=48:76", "192:207=122:127"
  Monster
  +FLOORCLIP
  Species "Shotgunner"
  SeeSound "NakedShotgunner/See"
  Tag "Naked Shotgunner"
  PainSound "NakedShotgunner/pain"
  DeathSound "NakedShotgunner/death"
  ActiveSound "NakedShotgunner/active"
  Obituary "%o was amusing Naked Shotgunner's bycepses too much"
  //+DROPOFF
  +JUMPDOWN
  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.03, 0.03), scaleY+frandom(-0.08,0.08))
	TNT1 A 0 A_SpawnItemEx ("HumanTrails", 0, 0, 0)
	TNT1 A 0 A_SpawnItemEx ("BydloWRITER", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION, 69)
  Spawn2:
    NAKS A 10 A_Look
    Loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUNakedShotgunner")
	 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")
    NAKS AABBCCDD 3 A_Chase
    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
	    NAKS 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))
	    NAKS 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))
	    NAKS 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
	    NAKS 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)) 
	    NAKS 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)) 
	    NAKS 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	
  Missile:
    TNT1 A 0 A_TakeInventory ("ArtCoolDown", 1)
    TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS E 9 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ArtCoolDown", 1, 2)
	TNT1 A 0 A_Jump (100, "RageAttack")
    TNT1 A 0 A_JumpIfTargetInLos ("CloseQuarters", 0, JLOSF_DEADNOJUMP, 500)
	TNT1 A 0 A_JumpIfTargetInLos ("LongRange", 0, JLOSF_DEADNOJUMP | JLOSF_CLOSENOJUMP, 0, 1000)
	NAKS 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 (-6,6))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
    NAKS E 9 A_FaceTarget
	NAKS E 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 (-4,4))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
    NAKS E 5 A_FaceTarget
	Goto SeeLoop
  CloseQuarters:
    NAKS 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 (-6,6))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
    NAKS E 5 A_FaceTarget
   Goto SeeLoop
  RageAttack:
    NAKS E 5 A_FaceTarget
	TNT1 A 0 A_Jump (185, 2)
	TNT1 A 0 A_PlaySound ("NakedShotgunner/Attack", CHAN_VOICE)
	TNT1 A 0 A_JumpIfTargetInLos ("PipeBomb", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 685, 420)
	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)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
    NAKS E 17 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)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
	NAKS E 17 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)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
	NAKS E 17 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 (-6,6))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
	NAKS E 17 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 (-7,7))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
	NAKS E 17 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 (-8,8))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("ArtCoolDown", 4) 
   Goto SeeLoop
  LongRange:
    NAKS E 45 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)
	TNT1 A 0 A_JumpIfInventory ("ShotgunShoTCounter", 6, "Reload")
    NAKS F 6 Bright A_FaceTarget
    NAKS E 5 A_FaceTarget
	TNT1 A 0 A_MonsterRefire (40, "SeeLoop")
   Loop
  PipeBomb:
    NAKS DE 9 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GRNTOSS", CHAN_WEAPON)
	NAKS E 3 A_CustomMissile ("PipeBomb", 42, 0, random (-8,8), CMF_OFFSETPITCH, random (16, 19))
	TNT1 A 0 A_GiveInventory ("ArtCoolDown", 4) 
	Goto SeeLoop
  Reload:
    NAKS DE 9 A_Playsound ("SHOTLOD")
	NAKS DE 9 A_Playsound ("SHOTLOD")
	NAKS DE 9 A_Playsound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 6)
	NAKS DE 9 A_Playsound ("SHOTLOD")
	NAKS DE 9 A_Playsound ("SHOTLOD")
	NAKS DE 9 A_Playsound ("SHOTLOD")
	TNT1 A 0 A_PlaySound ("SHOTPUMP")
	Goto SeeLoop
  Pain:
    NAKS H 3
    NAKS H 3 A_Pain
    Goto SeeLoop
  Death:
    NAKS I 5
    NAKS J 5 A_Scream
    NAKS K 5 A_NoBlocking
	NAKS L 0 
    NAKS M 5 A_PlaySound ("FallingBodyLight")
    NAKS N 8
	NAKS O -1
    Stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    PGIB A 5
	PGIB B 5 A_XScream
	PGIB C 2 A_NoBlocking
	PGIB D 5
	PGIB E -1
	Stop
  Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    NAKS L 5
    NAKS ONMLKJIH 5
    Goto See
  }
}



	Actor NakedShotgunnerSpawner : RandomSpawner
		{
		 DropItem NakedShotgunner
		 DropItem NakedShotgunnerGrey
		 DropItem NakedShotgunnerHaki
		}
		
	
	Actor NakedShotgunnerGrey : NakedShotgunner
		{
		 Translation "112:127=48:76", "192:207=96:111"
		}
		
		
	Actor NakedShotgunnerHaki : NakedShotgunner
		{
		 Translation "112:127=48:76", "192:207=9:12"
		}
