ACTOR PoltergeistBarrel
{
	Health 20
	Radius 10
	Height 42
	Mass 45
	Speed 0
	Painchance 0
	Monster
	Damage 20
	DeathSound "world/barrelx"
	Tag "Explosive Barrel"
	Obituary "%o was killed by a poltergeist."
	+NOBLOOD
	+DONTMORPH
	+DONTSQUASH
	-NOGRAVITY
	-COUNTKILL
	States
	{
	Spawn:
		BAR1 AB 6 A_LookEx (LOF_NOSOUNDCHECK, 0, 192, 0, 360)
		Loop
	See:
	    BAR1 A 1 A_ChangeFlag("NOGRAVITY",1)
		BAR1 A 1 A_PlaySoundEx ("polt/see", "Auto")
		BAR1 ABAB 6
		BAR1 A 0 A_UnsetShootable
	    BAR1 AAB 3 ThrustThingZ (0, Random (30, 35), 0, 0)
		BAR1 BBA 3 ThrustThingZ (0, Random (-7, -9), 0, 0)
		BAR1 AAB 4 ThrustThingZ (0, Random (9, 7), 0, 0)
		BAR1 BBA 4 ThrustThingZ (0, Random (-7, -9), 0, 0)
		BAR1 AB 6 ThrustThingZ (0, Random (9, 7), 0, 0)
		//BAR1 AB 6 ThrustThingZ (0, Random (-7, -9), 0, 0)
		//BAR1 AB 6 ThrustThingZ (0, Random (9, 7), 0, 0)
		TNT1 A 0 ThrustThingZ (0, 0, 0, 0)
		BAR1 A 0 A_setShootable
		TNT1 A 0 A_PlaySoundEx ("polt/throw", "Auto")
		Goto Missile
	Missile:
		BAR1 A 0 A_Facetarget
	    TNT1 A 0 A_Changeflag("NOGRAVITY",0)
		TNT1 A 0 A_SpawnItemEx("Poltshot2",0,0,0, Random(40, 60),0,Random (-3, -6))
		TNT1 A 0 A_GiveInventory("PoltDeath", 1)
		TNT1 A 0 A_Die
		Stop
	Death:
	    TNT1 A 0 A_JumpIfInventory("PoltDeath", 1, "Poof")
		TNT1 A 0 A_NoBlocking
		BEXP A 5 Bright
		BEXP B 5 Bright A_Scream
		BEXP C 4 Bright
		TNT1 A 0 A_SetTranslucent(0.75,1)
		BEXP D 3 Bright A_Explode
		TNT1 A 0 A_SpawnItemEx("OrangeParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 AAA 0 A_CustomMissile ("Kaboom3", random(10,30), 0, random(0,360), 2, random(0,180))
		TNT1 AAA 0 A_CustomMissile ("SmokeFX2", random(10,30), 0, random(0,360), 2, random(0,180))
		TNT1 AAAA 0 A_SpawnItemEx("Debris",0,0,Random(20,40),Random(4,-4),Random(4,-4),Random(4,8),0,128)
		BEXP E 3 Bright A_Fall
		BEXP FG 3 Bright
		TNT1 A 0 A_SetTranslucent(1.0,0)
		BEXP H 500
		BEXP H 5 A_FadeOut(0.10)
		Goto Death+24
	Poof:
		TNT1 A 500
		Stop
	}
}

ACTOR Poltshot2
{
	Radius 10
	Height 42
	Speed 1
    FastSpeed 1
    Damage 5
    Projectile
	DeathSound "world/barrelx"
    +RANDOMIZE
	-FLOAT
	-NOGRAVITY
	States
	{
	Spawn:
		BAR1 AB 6
		Loop
  Death:
		BEXP A 5 Bright
		BEXP B 5 Bright A_Scream
		BEXP C 4 Bright
		TNT1 A 0 A_SetTranslucent(0.75,1)
		BEXP D 3 Bright A_Explode
		TNT1 A 0 A_SpawnItemEx("OrangeParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 AAA 0 A_CustomMissile ("Kaboom3", random(10,30), 0, random(0,360), 2, random(0,180))
		TNT1 AAA 0 A_CustomMissile ("SmokeFX2", random(10,30), 0, random(0,360), 2, random(0,180))
		TNT1 AAAA 0 A_SpawnItemEx("Debris",0,0,Random(20,40),Random(4,-4),Random(4,-4),Random(4,8),0,128)
		BEXP E 3 Bright A_Fall
		BEXP FG 3 Bright
		TNT1 A 0 A_SetTranslucent(1.0,0)
		TNT1 A 0 A_PlaySoundEx ("polt/laugh", "Auto")
		BEXP H 500
		BEXP H 5 A_FadeOut(0.10)
		Goto Death+22
	}
}

ACTOR PoltDeath : Inventory
{
  Inventory.MaxAmount 1
  Inventory.Amount 1
}