Actor CommonBandit : GenericHumanScum  //Origin of species, heh-he 
{
Monster
Health 46
Radius 20
Height 56
Speed 11
PainChance 200
Monster
Species "IMP"
+DONTHARMSPECIES
seesound "Band/Alert"
attacksound "weapons/pistol"
painsound "Band/Pain"
deathsound "Band/Death"
activesound "Band/Active"
Translation "112:127=64:79"
Tag "Pistol Bandit"
scale 1.0
Obituary "%o MASLEENY POIMAL."
//+DROPOFF
DropItem "Clip", 2
  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:	
	TUG1 T 10 A_Look
	loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUBand")
	 Goto Spawn+2
   VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
	See:
	 "####" A random(1,4)
	 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")
	 TUG1 AABB 4 A_Chase
	 TUG1 CCDD 4 A_Chase  
	Loop
   MissileCheck:
    TNT1 A 0 A_JumpIfInTargetLos ("DodgeChoice", 50, 0, 0, 0)
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 50, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1150)
	Goto SeeLoop
  DodgeChoice:
    TNT1 A 0 A_Jump (190, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeRightF", "DodgeRightB")
	Goto MissileCheck+1	
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck2")
		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))
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck2")
		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))
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck2")
		Goto SeeLoop+2
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		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)) 
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		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)) 
	    TUG1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		Goto SeeLoop+2		
 Retreat:
    TNT1 A 0 A_Changeflag ("FRIGHTENED", 1)
	TNT1 A 0 A_Changeflag ("MissileMore", 1)
	TNT1 A 0 A_Changeflag ("MissileEvenMore", 1)
	Goto SeeLoop+1	
 Missile:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TUG1 EF 4 A_FaceTarget
	TNT1 A 0 A_JumpIfCloser (420, "RapidFire")
	TNT1 A 0 A_JumpIfTargetInLOS ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1400)
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 8 BRIGHT A_CustomMissile ("CMBTracer",45,0,random (-2,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TUG1 F 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 8 BRIGHT A_CustomMissile ("CMBTracer",45,0,random (-2,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TUG1 F 8 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 8 BRIGHT A_CustomMissile ("CMBTracer",45,0,random (-2,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	goto SeeLoop
 RapidFire:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
    TUG1 G 5 Bright A_CustomMissile ("CMBTracer",45,0,random (-2,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TUG1 F 5 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 5 Bright A_CustomMissile ("CMBTracer",45,0,random (-1,3))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TUG1 F 5 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 5 Bright A_CustomMissile ("CMBTracer",45,0,random (-2,4))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	TUG1 F 5 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 5 Bright A_CustomMissile ("CMBTracer",45,0,random (-6,9))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	Goto SeeLoop
 Accuracy:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 11, "Reload")
    TUG1 EF 12
	TNT1 A 0 A_PlaySound ("BPFIR")
	TNT1 A 0 A_PlaySound ("BPFIRF", 6, 0.5, 0)
	TUG1 G 8 Bright A_CustomMissile ("CMBTracer",45)
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	Goto SeeLoop
 Reload:
    TNT1 A 0 A_JumpIfInTargetLos ("Retreating", 0, JLOSF_CLOSENOJUMP, 0, 1200)
    TUG1 F 14 A_PlaySound ("GlokRel1")
	TNT1 A 0 A_TakeInventory ("PistolShotCounter", 11)
	TUG1 E 40 A_PlaySound ("GlokRel2")
	TUG1 F 14 A_PlaySound ("GlokRel3")
	TNT1 A 0 A_JumpIfCloser (350, "RapidFireCheck")
	Goto SeeLoop
 RapidFireCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("RapidFire")
	Goto SeeLoop
 Retreating:
    TNT1 A 0 A_ChangeFlag ("FRIGHTENED", true) 
    TUG1 AABBCCDD 2 A_Chase
	TNT1 A 0 A_CheckSight ("ReloadReady")
	Loop
 ReloadReady:
    TNT1 A 0 A_ChangeFlag ("FRIGHTENED", false)
	Goto Reload
 Techka:
    TUG1 H 1 DamageThing (1)
	Goto SeeLoop+2
 MissileCheck2:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile")
	Goto SeeLoop
 Pain:
	TUG1 H 3
	TUG1 H 3 A_Pain
	Goto SeeLoop
 Death:
	TUG1 H 3
	TUG1 I 5 A_Scream
	TUG1 J 5 A_NoBlocking
	TUG1 K 5
	TUG1 L 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
	TUG1 M -1
	Stop
  Raise:
    TNT1 A 0 
    TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    TUG1 MLKJIH 5
   Goto See 	
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    TUG1 U 5
    TUG1 V 5 A_XScream
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop	
    }
}	

Actor CMBTracer 
{
Projectile
Damage (5) 
+FORCEXYBILLBOARD
+DONTSPLASH
+BLOODSPLATTER 
+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 PistolShotCounter : Inventory
{
Inventory.maxamount 38
} 


	ACTOR CommonBanditSpawner : RandomSpawner 
		{
		 DropItem CommonBandit
		 DropItem CommonBanditgrey
		 DropItem CommonBanditnavy
		 DropItem CommonBandittan
		 DropItem CommonBanditred
		 DropItem CommonBanditblack
		}


actor CommonBanditgrey : CommonBandit 
{
Translation "192:207=64:75","240:246=76:79","112:127=96:111"
}

actor CommonBanditnavy : CommonBandit 
{
Translation "192:207=64:75","240:246=76:79","112:127=240:247"
}

actor CommonBandittan: CommonBandit 
{
Translation "192:207=96:105","240:246=106:111","112:127=64:79"
}

actor CommonBanditred: CommonBandit 
{
Translation "192:207=96:105","240:246=106:111","112:127=180:191"
}

actor CommonBanditblack : CommonBandit 
{
Translation "192:207=5:7","240:246=8:8","112:127=96:111"
}
	