actor IntellectShotgunner : 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 outsmarted by bald wise guy"
  health 30
  radius 15
  height 54
  mass 100
  speed 8
    Species "Z"
  +DOHARMSPECIES
  painchance 200
  SeeSound "Intellect/see"
  PainSound "Intellect/pain"
  DeathSound "Intellect/Death"
  ActiveSound "Intellect/Active" 
  dropitem "Shotgun"
  Tag "Shotgun Smart Bald Bastard"
  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.03, 0.03), scaleY+frandom(-0.08,0.08))
	TNT1 A 0 A_SpawnItemEx ("HumanTrails", 0, 0, 0)
  Spawn2:
    MOK1 T 10 A_Look
    loop
  STFU:
     TNT1 A 0
	 TNT1 A 0 ACS_NamedExecute ("STFUIntellect")
	 Goto Spawn+2
  VanJump:
	 TNT1 A 0
	 TNT1 A 0  NODELAY ACS_NamedExecuteAlways ("VanillaHeights")
	Goto Spawn+3	 
  See:
    "####" A random(1,5)
	 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_JumpIfInventory ("ShotgunShotCounter", 8, "Reload")
	TNT1 A 0 A_Jump (199, "DodgeLeft", "DodgeRight", "DodgeLeftF", "DodgeLeftB", "DodgeRightF", "DodgeRightB")
    MOK1 AABBCCDD 3 A_Chase
	TNT1 A 0 A_CheckSight ("SurpriseCheck")
    loop
  CheckReload:
    TNT1 A 0 A_Jump (150, "CheckReload2")
 	Goto SeeLoop+1
  CheckReload2:
    TNT1 A 0 A_JumpIfInventory ("ShotgunShotCounter", 8, "Reload")
	Goto SeeLoop+1
  DodgeLeft:
        TNT1 A 0 A_FaceTarget
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "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))
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "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))
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+192, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
	DodgeRight:
	    TNT1 A 0 A_FaceTarget
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "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)) 
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "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)) 
	    MOK1 AABBCCDD 2 ThrustThing(angle*256/360+64, 1, 0, 0)
		TNT1 A 0 A_Jump (228, "MissileCheck")
		Goto SeeLoop+1
  MissileCheck:
    TNT1 A 0 A_JumpIfTargetInLos ("Missile", 0, JLOSF_DEADNOJUMP)
	Goto SeeLoop		
  Missile:
    MOK1 EF 14 A_FaceTarget
	TNT1 A 0 A_JumpIfTargetInLos ("Accuracy", 0, JLOSF_CLOSENOJUMP | JLOSF_DEADNOJUMP, 0, 1200)
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 0, random (-7,7))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
	MOK1 G 6 BRIGHT 
    MOK1 FE 6
    goto SeeLoop
  Accuracy:
    MOK1 E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound ("BSHFR")
	TNT1 A 0 A_PlaySound ("BSHFRF", 6, 0.5, 0)
	TNT1 AAAAAAAA 0 A_CustomMissile ("ShotgunTracer", 32, 0, random (-4,4))
	TNT1 A 0 A_GiveInventory ("ShotgunShotCounter", 1)
    MOK1 F 10 Bright 
    MOK1 E 10
    Goto SeeLoop
  Ambush:
    TNT1 A 0 A_Playsound ("PP11AC14")
	MOK1 F 14 A_FaceTarget
    Goto MissileCheck	
  SurpriseCheck:
    TNT1 A 0 A_Jump (100, "Surprise")
	Goto SeeLoop
  Surprise:
    TNT1 A 0 A_JumpIfTargetInLos ("Ambush", 30, JLOSF_DEADNOJUMP)
	TNT1 A 0 A_Jump (45, "SeeLoop")
    MOK1 F 7
	Loop
  Reload:
    MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_TakeInventory ("ShotgunShotCounter", 8)
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	MOK1 DE 8 A_PlaySound ("SHOTLOD")
	TNT1 A 0 A_PlaySound ("SHOTPUMP")
	Goto SeeLoop	
  Pain:
    MOK1 H 3
    MOK1 H 3 A_Pain
    goto SeeLoop
  Death:
  	//TNT1 A 0 A_Jump(40, "Suren")
    MOK1 I 5  A_Scream
    MOK1 J 5
    MOK1 K 5 A_NoBlocking
    MOK1 L 5 A_Playsound ("FallingBodyLight", CHAN_BODY)
    MOK1 M -1
    stop
  //Death.WEAK:
    MOK1 N 5
    MOK1 O 5 A_PlaySound("Baddy/pain")
    MOK1 P 5 A_NoBlocking
    MOK1 Q 5
    MOK1 R -1
    stop
  XDeath:
    TNT1 A 0
    TNT1 A 0 A_SpawnItemEx ("VgavnonahCore", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    MOK1 U 5
    MOK1 V 5 A_XScream
    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)
	MOK1 MLKJI 5
   Goto See	
  //Suren:
    MOS1 A 5 A_PlaySound("Baddy/Surren")
    MOS1 B 5 
    MOS1 C 5 A_NoBlocking
    MOS1 C 5 A_SpawnItem("Mook1wimp",0,0)
    stop
  Idle:
    MOK1 AA 4 A_Wander
    MOK1 A 0 A_Look
    MOK1 BB 4 A_Wander
    MOK1 A 0 A_Look
    MOK1 CC 4 A_Wander
    MOK1 A 0 A_Look
    MOK1 DD 4 A_Wander
    MOK1 A 0 A_Look
    loop
  }
}


	Actor IntellectShotgunnerSpawner : RandomSpawner 
		{
		 DropItem IntellectShotgunner
		 DropItem IntellectShotgunnerGrey
		 DropItem IntellectShotgunnerBlue
		 DropItem IntellectShotgunnerRed
		 }


Actor IntellectShotgunnerGrey : IntellectShotgunner
{
Translation "112:127=96:111"
}

Actor IntellectShotgunnerBlue : IntellectShotgunner
{
Translation "112:127=196:207"
}

Actor IntellectShotgunnerRed : IntellectShotgunner
{
Translation "192:207=96:105","240:246=106:111","112:127=180:191"
}