actor BraveBydloPistol : 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 accidentally shot by law-abiding citizen because of self-defence"
  health 23
  radius 15
  height 54
  Species "Bydlo" //Zombieman
  Species "Z"
  +DOHARMSPECIES
  mass 100
  speed 9
  painchance 200
  SeeSound "BBydlo1/see"
  PainSound "BBydlo1/pain"
  DeathSound "BBydlo1/Death"
  ActiveSound "BBydlo1/active" 
  dropitem "Clip"
  Tag "Pistol Thug"
  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.08, 0.08), 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:
    GON1 T 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUBBydlo1")
	 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 (30, "MissileCheck")
    GON1 EF 10
SeeLoop:
    TNT1 A 0 A_JumpIfCloser (450, "CheckDodge")
	TNT1 A 0 A_Jump (100, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    GON3 AABBCCDD 3 A_Chase
	TNT1 A 0 A_CheckSight ("CheckReload")
    loop
CheckReload:
    TNT1 A 0 A_Jump (50, "CheckReload2")
 	Goto SeeLoop
CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	Goto SeeLoop
CheckDodge:
    TNT1 A 0 A_Jump (221, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
	Goto SeeLoop+1
    DodgeLeft:
	    TNT1 A 0 A_FaceTarget
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (20, "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))
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (20, "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))
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (20, "MissileCheck")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "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)) 
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "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)) 
	    GON3 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck")
		Goto SeeLoop+1
  MissileCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile")
    Goto SeeLoop+1
  Missile:
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
    GON1 FG 12 A_FaceTarget
	TNT1 A 0 A_Jump (100, "RapidFire", "4Fire")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-3,5))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
    GON1 GF 12
    goto SeeLoop
  RapidFire:
    GON1 G 8 A_FaceTarget
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-6,6))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
   Loop
  4Fire:
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-6,6))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON1 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-7,8))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON1 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-8,8))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON1 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON1 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-9,9))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	Goto SeeLoop
  Reload:
    GON1 F 12
	TNT1 A 0 A_PlaySound ("LPISOUT")
	TNT1 A 0 A_TakeInventory ("LightPistolShotCounter", 8)
	GON1 G 25
	TNT1 A 0 A_PlaySound ("LPISIN")
	GON1 F 15
	TNT1 A 0 A_PlaySound ("LPISREAD")
    TNT1 A 0 A_JumpIfCloser (450, "RapidFireCheck")
	Goto SeeLoop
  RapidFireCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("RapidFireCheck2")
   Goto SeeLoop 	
  RapidFireCheck2:	
    TNT1 A 0 A_Jump (88, "RapidFire")
	TNT1 A 0 A_Jump (150, "DodgeLeftB", "DodgeRightB")
	Goto SeeLoop
  Pain:
    GON3 H 3
    GON3 H 3 A_Pain
    goto SeeLoop
  Death:
	//TNT1 A 0 A_Jump(40, "Suren")
    GON1 J 5
    GON1 K 5 A_Scream
    GON1 L 5 A_NoBlocking
    GON1 M 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
    GON1 N -1
    stop
  Raise:
    TNT1 A 0 
    TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	GON1 NMLKJ 5
   Goto See	
  XDeath:
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    GON1 U 5
    GON1 V 5 A_XScream
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
  Suren:
    GOS1 A 5 A_PlaySound("Baddy/Surren")
    GOS1 B 5
    GOS1 C 5 A_NoBlocking
    GOS1 C 5 A_SpawnItem("Goon1wimp",0,0)
    stop
  Idle:
    GON3 AA 4 A_Wander
    GON3 A 0 A_Look
    GON3 BB 4 A_Wander
    GON3 A 0 A_Look
    GON3 CC 4 A_Wander
    GON3 A 0 A_Look
    GON3 DD 4 A_Wander
    GON3 A 0 A_Look
    loop
  }
}

actor BraveBydloPistol2 : GenericHumanScum
{
  scale 1.0
  obituary "%o was shot by pistol hooligan"
  health 25
  radius 15
  height 54
  mass 100
  speed 9
  Damage 1
  Species "Bydlo"
  +DOHARMSPECIES
  painchance 200
  SeeSound "BBydlo2/see"
  AttackSound "grunt/attack"
  ActiveSound "BBydlo2/Active"
  PainSound "BBydlo2/pain"
  DeathSound "BBydlo2/Death"
  dropitem "Clip"
  Tag "DumbassWithAPistol"
  MONSTER
  //+DROPOFF
  +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.08, 0.08), scaleY+frandom(-0.08,0.08)) 
	TNT1 A 0 A_SpawnItemEx ("BydloWRITER", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION, 69)
	TNT1 A 0 A_SpawnItemEx ("HumanTrails", 0, 0, 0)
  Spawn2:
    GON2 T 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUBBydlo2")
	 Goto Spawn+2
  VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
  See:
    TNT1 A 0 A_Jump (170, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
	TNT1 A 0 A_Jump (130, "MissileCheck")
    GON2 EF 10
  SeeLoop:
    TNT1 A 0 A_Jump (100, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    GON4 AABBCCDD 3 A_Chase
	TNT1 A 0 A_CheckSight ("CheckReload")
    loop
   CheckReload:
    TNT1 A 0 A_Jump (30, "CheckReload2")
 	Goto SeeLoop
   CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	Goto SeeLoop
   DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (20, "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))
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (80, "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))
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (90, "MissileCheck")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (80, "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)) 
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (80, "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)) 
	    GON4 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (80, "MissileCheck")
		Goto SeeLoop+1
  MissileCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
    Goto SeeLoop+1		
  Missile:
    GON2 FG 5 A_FaceTarget
    TNT1 A 0 A_Jump (100, "RapidFire", "4Fire")
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-6,6))
    GON2 GF 5
    goto SeeLoop
   RapidFire:
    GON2 G 8 A_FaceTarget
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-6,6))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	Loop
  4Fire:
    TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-6,6))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON2 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-7,8))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON2 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-8,8))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	GON2 G 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("LightPistolShotCounter", 8, "Reload")
	TNT1 A 0 A_Playsound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	GON2 H 6 BRIGHT A_CustomMissile ("LightPistolTracer",45,0,random (-9,9))
	TNT1 A 0 A_GiveInventory ("LightPistolShotCounter", 1)
	Goto SeeLoop	
  Reload:
    GON2 F 9
	TNT1 A 0 A_TakeInventory ("LightPistolShotCounter", 8)
	GON2 G 20
	GON2 F 15
	TNT1 A 0 A_JumpIfCloser (450, "RapidFireCheck")
	Goto SeeLoop
  RapidFireCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("RapidFireCheck2")
   Goto SeeLoop 	
  RapidFireCheck2:	
    TNT1 A 0 A_Jump (88, "RapidFire")
	TNT1 A 0 A_Jump (150, "DodgeLeftB", "DodgeRightB")
	Goto SeeLoop
  Pain:
    GON4 H 3
    GON4 H 3 A_Pain
    goto SeeLoop
  Death:
  	//TNT1 A 0 A_Jump(20, "Suren")
    GON2 J 5
    GON2 K 5 A_Scream
    GON2 L 5 A_NoBlocking
    GON2 M 5
	GON2 N 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
    GON2 O -1
    stop
  Death.WEAK:
    GON2 P 5
    GON2 Q 5 A_PlaySound("Baddy/pain")
    GON2 R 5 A_NoBlocking
    GON2 S 5
    GON2 W -1
    stop
  Suren:
    GOS2 A 5 A_PlaySound("Baddy/Surren")
    GOS2 B 5
    GOS2 C 5 A_NoBlocking
    GOS2 C 5 A_SpawnItem("Goon2wimp",0,0)
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    GON2 U 5
    GON2 V 5 A_XScream
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
  Idle:
    GON4 AA 4 A_Wander
    GON4 A 0 A_Look
    GON4 BB 4 A_Wander
    GON4 A 0 A_Look
    GON4 CC 4 A_Wander
    GON4 A 0 A_Look
    GON4 DD 4 A_Wander
    GON4 A 0 A_Look
    loop
  }
}


Actor BraveBydloPistolSpawner : RandomSpawner 
	{
	 DropItem BraveBydloPistol
	 DropItem BraveBydloPistol2
	 DropItem BraveBydloPistol2Blue
	 DropItem BraveBydloPistol2Grey
	 DropItem BraveBydloPistol2Navy
	 DropItem BraveBydloPistol2Brown
	 DropItem BraveBydloPistol2Red
	 DropItem BraveBydloPistol2Yellow
	 DropItem BraveBydloPistol2Orange
	 DropItem BraveBydloPistol2White
	}



Actor BraveBydloPistol2Blue : BraveBydloPistol2 
{
Translation "112:127=196:207"
}

Actor BraveBydloPistol2Grey : BraveBydloPistol2 
{
Translation "112:127=96:111"
}

Actor BraveBydloPistol2Navy : BraveBydloPistol2 
{
Translation "112:127=240:247"
}

Actor BraveBydloPistol2Brown : BraveBydloPistol2 
{
Translation "112:127=64:79"
}

Actor BraveBydloPistol2Red : BraveBydloPistol2 
{
Translation "112:127=180:191"
}

Actor BraveBydloPistol2Yellow : BraveBydloPistol2 
 {
 Translation "112:127=160:167"
 }


Actor BraveBydloPistol2Orange : BraveBydloPistol2 
 {
   Translation "112:127=208:223"
 }


 Actor BraveBydloPistol2White : BraveBydloPistol2 
  {
  Translation "112:127=80:95"
  }

Actor LightPistolTracer 
{
Projectile
Damage (2)
Species "Bydlo"
+FORCEXYBILLBOARD
+DOHARMSPECIES
+BLOODSPLATTER
+SKYEXPLODE
+DONTSPLASH 
+NOEXTREMEDEATH
radius 2
height 2
speed 20
renderstyle Add
alpha 0.9
scale .15
 States
     {
	  Spawn:
	    TNT1 A 0
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("PotentialProjectileHider", 0,0,0)
	  Spawn2:
	    TRAC A 1 Bright A_PlaySound ("Bullet/Fly", 0, 1.0, true)
		Loop
	  Crash:	
	  Death:
	    TNT1 A 0
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("ProjectileIsDead", 0,0,0)
	    TNT1 A 0 A_Playsound ("Bullet/Impact")
		TNT1 A 0 A_Jump (100, "D2")
		FX57 CDEFGHI 1 BRIGHT
		Stop
	  D2:
	    FX58 CDEFGHI 1 BRIGHT
		Stop
	  XDeath:
	    TNT1 A 0
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("ProjectileIsDead", 0,0,0) 
		TNT1 A 1
		Stop	
	 }
}

Actor LightPistolShotCounter : Inventory
{
Inventory.maxamount 100
}

