actor SMGNotBaldThug : GenericHumanScum 
{
  scale 1.0
  obituary "%o underdestimated accuracy of SMG thug with fancy haircut"
  health 60
  radius 15
  height 54
  mass 100
  speed 10
  Damage 1
  Species "IMP"
+DONTHARMSPECIES
  painchance 175
  SeeSound "NotBaldSMG/See"
  PainSound "NotBaldSMG/pain"
  DeathSound "NotBaldSMG/Death"
  ActiveSound "NotBaldSMG/Active"
  Translation "192:207=48:79", "80:95=96:111", "4:4=99:99", "112:127=118:127"
  Tag "SMG Wide Thug"
  //+DROPOFF
  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.02, 0.02), 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:
    EG4a A 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUNotBaldSMG")
	 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")
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a AABBCCDD 3 A_Chase
    loop
  MissileCheck:
    TNT1 A 0
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 50, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 500)
	Goto SeeLoop
    CheckReload:
    TNT1 A 0 A_Jump (50, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    EG4a 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+1
	DodgeLeftF:
	    TNT1 A 0 A_FaceTarget
	    TNT1 A 0 ThrustThingZ (0, 15, 0, 0)
	    TNT1 A 0 A_Recoil (random (-8,-3))
	    EG4a AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck2")
		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))
	    EG4a AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (120, "MissileCheck2")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    EG4a AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		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)) 
	    EG4a AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		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)) 
	    EG4a AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (100, "MissileCheck2")
		Goto SeeLoop+1			
   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 ("SMGShotCounter", 30, "Reload")
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 500) 
    EG4a EF 6 A_FaceTarget
  MissileLoop:
    EG4a F 2 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 500)
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 BRIGHT A_CustomMissile ("SMGTracer",32,9,random (-6,6))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_Jump (2, "SeeLoop")
    EG4a F 2 A_MonsterRefire (40, "SeeLoop")
	goto MissileLoop+1
  Accuracy:
    TNT1 A 0
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a F 8 A_FaceTarget
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 Bright A_CustomMissile ("SMGTracer",32,9,random (-3,3))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a F 2 A_FaceTarget
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 Bright A_CustomMissile ("SMGTracer",32,9,random (-3,3))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a F 2 A_FaceTarget
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 Bright A_CustomMissile ("SMGTracer",32,9,random (-4,4))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a F 2 A_FaceTarget
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 Bright A_CustomMissile ("SMGTracer",32,9,random (-4,4))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_JumpIfInventory ("SMGShotCounter", 30, "Reload")
    EG4a F 8 A_FaceTarget
	TNT1 A 0 A_PlaySound ("MP5")
	TNT1 A 0 A_PlaySound ("MP5FF", 6, 0.5, 0)
	EG4a G 1 Bright A_CustomMissile ("SMGTracer",32,9,random (-4,4))
	TNT1 A 0 A_GiveInventory ("SMGShotCounter", 1)
	TNT1 A 0 A_FaceTarget
	EG4a F 3 A_MonsterRefire (40, "SeeLoop")
	Loop
  Reload:
    TNT1 A 0 A_JumpIfCloser (200, "Retreating")
    EG4a F 15 A_PlaySound ("SMGOUT")
	TNT1 A 0 A_TakeInventory ("SMGShotCounter", 30)
	EG4a E 35 A_PlaySound ("SMGIN")
	EG4a F 20 A_PlaySound ("SMGCOCK")
	TNT1 A 0 A_JumpIfCloser (150, "MissileCheck2")	
	Goto SeeLoop
  MissileCheck2:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile")
	Goto SeeLoop
  Retreating:
    TNT1 A 0 A_ChangeFlag ("FRIGHTENED", true) 
    EG4a ABCDABCDABCDABCDABCDABCDABCDABCD 2 A_Chase
	TNT1 A 0 A_CheckSight ("ReloadReady")	
 ReloadReady:
    TNT1 A 0 A_ChangeFlag ("FRIGHTENED", false)
	Goto ReloadBrave
 ReloadBrave:
    EG4a F 15 A_PlaySound ("SMGOUT")
	TNT1 A 0 A_TakeInventory ("SMGShotCounter", 30)
	EG4a E 34 A_PlaySound ("SMGIN")
	EG4a F 20 A_PlaySound ("SMGCOCK")
	TNT1 A 0 A_JumpIfCloser (150, "MissileCheck2")	
	Goto SeeLoop	
  Pain:
    EG4a H 3
    EG4a H 3 A_Pain
    goto SeeLoop
  Death:
    EG4a I 5 A_Scream
    EG4a J 5
    EG4a K 5 A_NoBlocking
    EG4a L 5
	EG4a M 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
    EG4a M -1
    stop
  Death.WEAK:
    EG4a N 5
    EG4a O 5 A_PlaySound("Baddy/pain")
    EG4a P 5 A_NoBlocking
    EG4a Q 5
    EG4a R -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    EG4a N 5 A_XScream
    EG4a O 5 
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop
   Raise:
    TNT1 A 0 
	TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	EG4A MLKJI 5
   Goto See   	
  Idle:
    EG4a AA 4 A_Wander
    EG4a A 0 A_Look
    EG4a BB 4 A_Wander
    EG4a A 0 A_Look
    EG4a CC 4 A_Wander
    EG4a A 0 A_Look
    EG4a DD 4 A_Wander
    EG4a A 0 A_Look
    loop
  }
}



	Actor SMGNotBaldThugSpawner : RandomSpawner
		{
		 DropItem SMGNotBaldThug
		 DropItem SMGNotBaldThugNavyPants
		 DropItem SMGNotBaldThugBrownPants
		 DropItem SMGNotBaldThugBlondeNavyShirtGreyPants
		 DropItem SMGNotBaldThugGrey
		 DropItem SMGNotBaldThugHakiBlackHakiPants 
		}


 Actor SMGNotBaldThugNavyPants : SMGNotBaldThug
	 {
	  Translation "192:207=64:79", "80:95=96:111", "4:4=100:100", "112:127=240:247"
	 }

 Actor SMGNotBaldThugBrownPants : SMGNotBaldThug
	 {
	  Translation "192:207=48:79", "80:95=96:111", "4:4=99:99", "112:127=64:79"
	 }

 Actor SMGNotBaldThugBlondeNavyShirtGreyPants : SMGNotBaldThug
	 {
	  Translation "192:207=48:63", "80:95=240:247", "4:4=240:247", "112:127=80:111"
	 }

Actor SMGNotBaldThugGrey : SMGNotBaldThug
	 {
	  Translation "192:207=236:239", "112:127=80:111"
	 }


Actor SMGNotBaldThugHakiBlackHakiPants : SMGNotBaldThug
	 {
	  Translation "192:207=5:8", "80:95=96:111", "4:4=99:99", "112:127=5:12"
	 }

