/*
CREDITS:
Sprites - Rogue Ent. (Strife)
Sounds - Blizzard (Starcraft 2)
*/

ACTOR HunterSeekerPickup : CustomInventory
{
   Tag "Hunter Seeker"
   Scale 0.5
   Inventory.Amount 1
   Inventory.MaxAmount 1
   Inventory.PickupSound "hunterseeker/pickup"
   Inventory.UseSound "hunterseeker/deploy"
   Inventory.PickupMessage "You got the hunter-seeker companion!"
   Inventory.Icon ARTIHUNT
   +INVBAR
   +FLOORCLIP
   States
   {
   Spawn:
      SEKR A 1
      Loop
   Use:
      TNT1 A 34
      TNT1 A 1 A_FireCustomMissile("HunterSeekerSpawner",0,0,0,15)
      Stop
   } 
}

ACTOR HunterSeekerSpawner
{
   Speed 50
   Radius 12
   Height 27
   +NOTARGET
   +NOGRAVITY
   States
   {
   Spawn:
      TNT1 A 0
      TNT1 A 1 A_SpawnItemEx("HunterSeeker",0,0,5)   
      Stop
   } 
}

actor HunterSeeker
{
  obituary "%o was exploded in face by hunter-seeker companion."
  health 4000
  Radius 12
  Height 27
  mass 4000
  speed 20
  painchance 32
  seesound ""
  painsound "hunterseeker/pain"
  deathsound ""
  activesound ""
  attacksound ""
  MONSTER
  Scale 0.5
  DamageFactor "Nope", 0
  +FLOAT
  +FLOATBOB
  +NOGRAVITY
  +FRIENDLY
  +NOBLOOD
  +LOOKALLAROUND
  +NORADIUSDMG
  MeleeRange 48
  states
  {
  Spawn:
    SEKR A 0
    SEKR A 0 A_PlaySound("hunterseeker/loop",5,0.5,1)
    SEKR A 10 A_Look
    Loop
  See:
    SEKR A 0 A_ChangeFlag("Reflective",0)
    SEKR A 0 A_ChangeVelocity (frandom(-2.4, 2.4), frandom(-2.4, 2.4), frandom(-1.75, 1.75), 0)
    SEKR A 1 A_Chase
    Loop
  Melee:
    SEKR B 0
    SEKR B 0 A_Stop
    SEKR B 0 A_PlaySound("HunterSeeker/Fuu",0,0.6)
    SEKR B 0 A_ChangeFlag("Reflective",1)
    SEKR B 4 A_FaceTarget
    SEKR C 30 A_FaceTarget
    SEKR B 0 A_CustomMissile("HunterBoom", 0, 0, 0, 0, 0) 
    SEKR CB 4
    SEKR B 0 A_ChangeFlag("Reflective",0)
    Goto Spawn
  Pain:
    SEKR D 0 A_ChangeFlag("Reflective",1)
    SEKR D 5 A_Pain
    SEKR D 0 A_ChangeFlag("Reflective",0)
    Goto Spawn
  Death:
    TNT1 A 0 A_StopSound(5)
    TNT1 A 0 A_Scream
    SEKR DE 4
    TNT1 A 1 A_SpawnItemEx("HunterSeekerCorpse",0,0,1)
    Stop
  }
}

ACTOR HunterBoom
{
	+NOINTERACTION
	+NOGRAVITY
	+FORCERADIUSDMG
	DamageType Nope
	States
	{
	Spawn:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("Weapons/PushkaExp")
	TNT1 A 0 A_Explode(100,164,0,1)
	TNT1 A 1 A_SpawnItemEx("CaberExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,256,0)
	TNT1 AAAAA 2 A_Explode(25,192,0)
	Stop
	}
}

ACTOR HunterSeekerCorpse
{
	Projectile
	Radius 12
	Height 27
	-NOGRAVITY
	DamageType "Nope"
	Gravity 3
	Scale 0.5
	States
	{
	Spawn:
	SEKR F 1
	Loop
	Death:
	TNT1 A 0 A_PlaySound("Weapons/PushkaExp")
	TNT1 A 0 A_Explode(100,164,0,1)
	SEKR F 1 A_SpawnItemEx("CaberExplode",0,0,0,0,0,0,0,128,0)
	TNT1 A 0 A_Explode(100,256,0)
	SEKR FFFGG 2 A_Explode(25,192,0)
	SEKR G -1
	Stop
	}
}
