Actor FreakKorpsPistolKrieger : GenericHumanScum 
{

   //----------------------------COMPLEX DOOM COMPATIBILITY DROPS------------------------

DropItem "HealthFlask" 40
DropItem "ArmorCharge" 40
DropItem "AmmoPack" 20
DropItem "HandGrenadeAmmo" 50 1
DropItem "MineAmmo" 25 1

Health 27
Monster
Radius 20
Height 56
Speed 10
PainChance 125
Monster
Species "Z"
+DOHARMSPECIES
seesound "FrenchNaziPistol/See"
painsound "FrenchNaziPistol/Pain"
deathsound "FNAZDE01"
activesound "FrenchNaziPistol/Active"
Tag "Freak Korps Pistol Krieger"
scale 1.0
Obituary "%o was shot by the Freak Korps krieger with a pistol."
//+DROPOFF
DropItem "Clip"
  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.08, 0.08), 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:	
	FNAZ T 10 A_Look
	loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUFrenchNaziPistol")
	 Goto Spawn+2
  VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
	See:
	 "####" A random(1,6)
	 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_Jump (170, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
	 FNAZ AABB 4 A_Chase
	 FNAZ CCDD 4 A_Chase  
	Loop
   MissileCheck:
	TNT1 A 0 A_JumpIfInventory ("GrenadeCoolDown", 1, 2)
	TNT1 A 0 A_Jump (88, "GranataCheck")
	TNT1 A 0 A_JumpIfTargetInLos ("Missile")
	Goto SeeLoop	
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck")
		TNT1 A 0 A_Jump (50, "DodgeRight")
		Goto SeeLoop+2
	DodgeLeftF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (-8,-3))
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck")
		Goto SeeLoop+2
    DodgeLeftB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (3,8))
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck")
		Goto SeeLoop+2
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck")
		Goto SeeLoop+2
	DodgeRightF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (-8,-3)) 
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck")
		Goto SeeLoop+2
	DodgeRightB:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil ( random (3,8)) 
	    FNAZ AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck")
		Goto SeeLoop+2			
 Missile:
	TNT1 A 0 A_TakeInventory ("GrenadeCooldown", 1)
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	FNAZ E 5 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("CloseQuarters", 0, JLOSF_DEADNOJUMP, 500)
	TNT1 A 0 A_JumpIfTargetInLOs ("LongRange", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1000)
	FNAZ E 9 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-2,2))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	FNAZ E 12 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-2,2))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	FNAZ E 12 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-2,2))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
   Goto SeeLoop
  CloseQuarters:
    FNAZ E 7 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-4,4))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	FNAZ E 7 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-4,4))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	FNAZ E 7 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-4,4))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
   Goto SeeLoop
 LongRange:
    FNAZ E 20 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	FNAZ F 2 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-1,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 9, "Reload")
	TNT1 A 0 A_MonsterRefire (40, "SeeLoop")
   Loop	
 GranataCheck:
	TNT1 A 0 A_JumpIfTargetInLos ("Granata", 0, JLOSF_DEADNOJUMP | JLOSF_CLOSENOJUMP, 700, 325)
 Goto MissileCheck
 Granata:
	TNT1 A 0
	FNAZ D 9 A_Playsound ("FNAZGR01")  
	FNAZ E 6 A_CustomMissile ("Deutschnade", 42, 0, random (-6,6), CMF_OFFSETPITCH, random (10, 14))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 5)	
 Goto SeeLoop		
 Reload:
    FNAZ D 19
	TNT1 A 0 A_PlaySound ("LPISOUT")
	TNT1 A 0 A_TakeInventory ("PistolShotCounter", 9)
	FNAZ E 25
	TNT1 A 0 A_PlaySound ("LPISIN")
	FNAZ D 14
	TNT1 A 0 A_PlaySound ("LPISREAD")
	FNAZ D 7 
	Goto SeeLoop
 Pain:
	FNAZ H 3
	FNAZ H 3 A_Pain
	Goto SeeLoop
 Death:
	FNAZ I 5 A_Scream
	FNAZ J 5 A_NoBlocking
	FNAZ K 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
	FNAZ L -1
	Stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    PGIB A 5 A_NoBlocking
    PGIB B 5 A_XScream 
    PGIB CD 5
    PGIB E -1
    Stop
  Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	FNAZ LKJIH 5
   Goto See	
    }
}	


	