ACTOR NaziArmoredShotgunner : GenericHumanScum 
{

  //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------
 	   
	DropItem "HealthFlask" 40
	DropItem "ArmorCharge" 40
	DropItem "AmmoPack" 20
	DropItem "HandGrenadeAmmo" 50 1
	DropItem "MineAmmo" 25 1

  Health 50
  Radius 20
  Height 56
  Mass 100
  Speed 10
  PainChance 142
  +DOHARMSPECIES
  Monster
  +FLOORCLIP
  Species "Z"
  SeeSound "NaziArmoredShotgunner/See"
  Tag "Nazi Armored Shotgunner"
  PainSound "ExShotgunNazi/pain"
  DeathSound "TELEFONMAST/Death"
  ActiveSound "NaziArmoredShotgunner/active"
  Obituary "%o was no match for the armor und firepower of neo-nazi shotgunner"
  Translation "73:79=107:111"
  //+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 ("SiegWRITER", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION, 69)
  Spawn2:
    WBWS A 10 A_Look
    Loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUNaziArmoredShotgunner")
	 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")
    WBWS 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
	    WBWS 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))
	    WBWS 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))
	    WBWS 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
	    WBWS 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)) 
	    WBWS 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)) 
	    WBWS 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 (199, "GranataCheck")
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP )
	Goto SeeLoop	
  Missile:
    TNT1 A 0 A_TakeInventory ("GrenadeCoolDown", 1)
    TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload") 
    WBWS E 12 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 850)
	TNT1 A 0 A_JumpIfTargetInLos ("Trishot", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 849, 485)
	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)
    WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
    WBWS E 3 A_FaceTarget 
    Goto SeeLoop
  Trishot:
    WBWS E 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 (-2,2))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
	WBWS 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 (-3,3))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
	WBWS 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)
	WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
	Goto SeeLoop
  Accuracy:
    WBWS E 16 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 (-1,1))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
    WBWS E 3 A_FaceTarget
	WBWS E 16 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)
    WBWS F 3 Bright A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 6, "Reload")
    WBWS E 3 A_FaceTarget
	TNT1 A 0 A_MonsterRefire (40, "SeeLoop")
    Loop
   GranataCheck:
	TNT1 A 0 A_JumpIfTargetInLos ("Granata", 0, JLOSF_DEADNOJUMP | JLOSF_CLOSENOJUMP, 700, 325)
 Goto SeeLoop
 Granata:
	TNT1 A 0
	WBWS D 8 Bright A_FaceTarget
	WBWS E 4 Bright A_CustomMissile ("Deutschnade", 42, 0, random (-4,4), CMF_OFFSETPITCH, random (10, 15))
	WBWS D 5 Bright A_FaceTarget
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 5)	
 Goto SeeLoop		
  Reload:
    WBWS DE 5 A_PlaySound ("SHOTLOD")
	WBWS DE 5 A_PlaySound ("SHOTLOD")
	WBWS DE 5 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 6)
	WBWS DE 5 A_PlaySound ("SHOTLOD")
	WBWS DE 5 A_PlaySound ("SHOTLOD")
	WBWS DE 5 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_PlaySound ("SHOTPUMP")
	Goto SeeLoop
  Pain:
    WBWS G 3
    WBWS G 3 A_Pain
    Goto SeeLoop
  Death:
    WBWS H 5 A_NoBlocking
    WBWS I 5 A_Scream
    WBWS J 5 
    WBWS K 5 A_Playsound ("FallingBodyGear", CHAN_BODY)
    WBWS 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 A_XScream
	SPOS N 5
	SPOS O 2 A_NoBlocking
	SPOS PQST 5
	SPOS U -1
	Stop
  Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    WBWS L 5
    WBWS KJIH 5
    Goto See
  }
}


