Actor CartelBaldRecruit : GenericHumanScum  
{
//$Category HFE - ASSHOLES/ZM
//$Title CartelBaldRecruit
//$Sprite EZ4A


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

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


Health 28
Monster
Radius 20
Height 56
Speed 11
PainChance 170
Monster
Species "Z"
+DOHARMSPECIES
MinMissileChance 90
seesound "Cartel/See"
painsound "GTS/Pain"
deathsound "GTS/Death"
activesound "Cartel/Active"
Tag "Cartel Recruit with a pistol"
Translation "112:127=120:127", "192:207=64:79"
scale 1.0
Obituary "%o became the first victim of the Cartel Bald Recruit."
//+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 ("CartelWRITER", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION, 69)
  Spawn2:	
	EZ4A T 10 A_Look
	loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUCartel")
	 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")
	 EZ4A AABB 3 A_Chase
	 EZ4A CCDD 3 A_Chase  
	Loop
   MissileCheck:
    TNT1 A 0
	TNT1 A 0 A_JumpIfInventory ("GrenadeCoolDown", 1, 2)
    TNT1 A 0 A_Jump (105, "PipeBombCheck")
	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", 10, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    EZ4A 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))
	    EZ4A 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))
	    EZ4A 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
	    EZ4A 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)) 
	    EZ4A 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)) 
	    EZ4A 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_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	EZ4A EF 12 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("RapidFire", 0, JLOSF_DEADNOJUMP, 650)
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 4 BRIGHT A_CustomMissile ("APistolTracer",45,0)
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 5 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 4 BRIGHT A_CustomMissile ("APistolTracer",45,0)
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 3 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 4 BRIGHT A_CustomMissile ("APistolTracer",45,0,random (-1,1))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	goto SeeLoop
 RapidFire:
    TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
    EZ4A G 1 Bright A_CustomMissile ("APistolTracer",45)
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 2 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 1 Bright A_CustomMissile ("APistolTracer",45,0)
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 2 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 1 Bright A_CustomMissile ("APistolTracer",45,0,random (-2,2))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 2 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 1 Bright A_CustomMissile ("APistolTracer",45,0,random (-4,4))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
	EZ4A F 2 A_FaceTarget
	TNT1 A 0 A_JumpIfInventory ("PistolShotCounter", 10, "Reload")
	TNT1 A 0 A_PlaySound ("BYPFR")
	TNT1 A 0 A_PlaySound ("BYPFRF", 6, 0.5, 0)
	EZ4A G 1 Bright A_CustomMissile ("APistolTracer",45,0,random (-5,5))
	TNT1 A 0 A_GiveInventory ("PistolShotCounter", 1)
   Goto SeeLoop
 PipeBombCheck:
	TNT1 A 0
    TNT1 A 0 A_JumpIfTargetInLos ("PipeBomb", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 700, 300)
	Goto MissileCheck+2
  PipeBomb:
    EZ4A E 12 A_FaceTarget
	TNT1 A 0 A_PlaySound ("GRNTOSS", CHAN_WEAPON)
	EZ4A F 3 A_CustomMissile ("PipeBomb", 42, 0, random (-3,3), CMF_OFFSETPITCH, random (9, 14))
	TNT1 A 0 A_GiveInventory ("GrenadeCoolDown", 2)
	Goto SeeLoop  
 Reload:
    EZ4A F 10
	TNT1 A 0 A_PlaySound ("LPISOUT")
	TNT1 A 0 A_TakeInventory ("PistolShotCounter", 10)
	TNT1 A 0 A_PlaySound ("LPISIN")
	EZ4A E 30
	TNT1 A 0 A_PlaySound ("LPISREAD")
	EZ4A F 12
	TNT1 A 0 A_JumpIfCloser (350, "RapidFireCheck")
	Goto SeeLoop
 RapidFireCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("RapidFire")
	Goto SeeLoop
 MissileCheck2:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile")
	Goto SeeLoop
 Pain:
	EZ4A H 3
	EZ4A H 3 A_Pain
	Goto SeeLoop
 Death:
	EZ4A I 5 A_Scream
	EZ4A J 5 A_NoBlocking
	EZ4A K 5
	EZ4A L 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
	EZ4A M -1
	Stop
  Raise:
    TNT1 A 0 
    TNT1 A 0 A_SpawnItemEx ("NanoResEffect", 0, 0, 15, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
	EZ4A MLKJI 5
   Goto See	
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    EZ4A U 5
    EZ4A V 5 A_XScream
    PGIB A 5 A_NoBlocking
    PGIB BCD 5
    PGIB E -1
    Stop	
    }
}	


	Actor CartelBaldRecruitSpawner : RandomSpawner 
		{
		 DropItem CartelBaldRecruit
		 DropItem CartelBaldRecruitHaki
		 DropItem CartelBaldRecruitBrown
		 DropItem CartelBaldRecruitGreyBlack
		 DropItem CartelBaldRecruitYellowBrown
		 DropItem CartelBaldRecruitGreyBrown
		 DropItem CartelBaldRecruitHakiGreen
		 DropItem CartelBaldRecruitBlackGrey
		 DropItem CartelBaldRecruitBlackGreen
		}
		
		
		
		
		
	Actor CartelBaldRecruitHaki : CartelBaldRecruit 
		{
		 Translation "112:127=7:12", "192:207=7:12"
		}

	Actor CartelBaldRecruitBrown : CartelBaldRecruit
		{
		 Translation "112:127=64:79", "192:207=64:79"
		}
		
	Actor CartelBaldRecruitGreyBlack : CartelBaldRecruit
		{
		 Translation "112:127=80:111", "192:207=5:8"
		}
		
	Actor CartelBaldRecruitYellowBrown : CartelBaldRecruit
		{
		 Translation "112:127=160:167", "192:207=64:79"
		}	
		
	Actor CartelBaldRecruitGreyBrown : CartelBaldRecruit
		{
		 Translation "112:127=80:111", "192:207=144:151"
		}
		
	Actor CartelBaldRecruitHakiGreen : CartelBaldRecruit
		{
		 Translation "112:127=7:12", "192:207=121:127"
		}
		
	Actor CartelBaldRecruitBlackGrey : CartelBaldRecruit
		{
		 Translation "112:127=5:8", "192:207=96:111"
		}
		
	
	Actor CartelBaldRecruitBlackGreen : CartelBaldRecruit
		{
		 Translation "112:127=5:8", "192:207=121:127"
		}
		
		
		
	

	