//===========================================================================
//
// Imp
//
//===========================================================================
ACTOR Imp1 Replaces DoomImp
{
	Game Doom
	SpawnID 5
	Health 60
	Radius 20
	Height 56
	Mass 100
	Speed 8
	PainChance 200
	Monster
	+FLOORCLIP
	SeeSound "imp/sight"
	PainSound "imp/pain"
	DeathSound "imp/death"
	ActiveSound "imp/active"
	HitObituary "$OB_IMPHIT"
	Obituary "$OB_IMP"
	States
	{
	Spawn:
		TROO AB 10 A_Look
		Loop
	See:
		TROO AABBCCDD 3 A_Chase
		Loop
	Melee:
	Missile:
		TROO EF 8 A_FaceTarget
		TROO G 6 A_TroopAttack 
		Goto See
	Pain:
		TROO H 2
		TROO H 2 A_Pain
		Goto See

	Death:
		TROO I 1
		TNT1 A 0 A_CustomMissile("CeilingBloodChecker", 50,  0, random(0, 360), 2, random(60, 90))
		TNT1 A 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(45, 50))
		TROO I 0 A_Jump(192, "Death1", "Death2", "Death3", "Death4", "Death5")
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 40,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		TROO I 5
		TROO J 5 A_Scream
		TROO K 5 A_NoBlocking
		TROO L 5
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		TROO M -1
		Stop
	Death1://Leg
		TNT1 AAAA 0 A_CustomMissile("FlyingBloodParticleFast", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 0 A_CustomMissile("XDeathImpLeg", 10,  0, random(0, 360), 2, random(40, 50))
		TNT1 A 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		TR09 A 6 A_Scream
		TR09 B 6 A_NoBlocking
		TR09 C 6
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		TR09 D -1
		Stop
	Death2://Arm
		TNT1 AAA 0 A_CustomMissile("FlyingBloodParticleFast", 20,  0, random(0, 360), 2, random(0, 90))
		TNT1 A 0 A_CustomMissile("XDeathImpArm", 50,  0, random(0, 360), 2, random(40, 60))
		TNT1 A 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		TR08 A 6 A_Scream
		TR08 B 6 A_NoBlocking
		TR08 CD 6
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		TR08 E -1
		Stop
	Death3://Head
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 50,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleBig", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath2b", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath3b", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AAA 0 A_CustomMissile("GibHeadPiece", 55,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("GibTeeth", 55,  0, random(0, 360), 2, random(45, 50))
		TNT1 A 0 A_CustomMissile("GibEyeball", 55,  0, random(0, 360), 2, random(45, 50))
		TROH B 6 A_Scream
		TROH C 6 A_NoBlocking
		TROH D 6
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		TROH E -1
		Stop
	Death4://Guts
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 30,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleBig", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath2b", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath3b", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		IMPC A 6 A_Scream
		IMPC B 6 A_NoBlocking
		IMPC BCDEF 6
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		IMPC G -1
		Stop
	Death5://Heavy1
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 30,  0, random(0, 360), 2, random(0, 90))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleBig", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath2b", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeath3b", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeathImpArm", 50,  0, random(0, 360), 2, random(40, 60))
		TNT1 AA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		TROG A 6 A_Scream
		TROG B 6 A_NoBlocking
		TROG BCD 6
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		TROG E -1
		Stop
	XDeath:
		POSS M 4
		TNT1 AA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(45, 50))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 60,  0, random(0, 360), 2, random(0, 90))
		TNT1 AAAA 0 A_CustomMissile("FlyingBloodParticleBig", 50,  0, random(0, 360), 2, random(30, 90))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleBig", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("XDeathImpArm", 50,  0, random(0, 360), 2, random(40, 60))
		TNT1 AAA 0 A_CustomMissile("XDeath2", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AAA 0 A_CustomMissile("XDeath3", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AAA 0 A_CustomMissile("XDeath1b", 40,  0, random(0, 360), 2, random(10, 45))
		POSS N 5 A_XScream
		POSS O 5 A_NoBlocking
		POSS PQRST 5
		TNT1 A 0 A_CustomMissile("XDeath1", 20,  0, random(0, 360), 2, random(10, 45))
		POSS U -1
		Stop
	Death.Plasma:
		DPS1 A 0 A_Stop
		DPS1 A 0 A_XScream
		DPS1 A 0 A_NoBlocking
		TNT1 A 0 A_CustomMissile("XDeath2", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 A 0 A_CustomMissile("XDeath3", 50,  0, random(0, 360), 2, random(10, 45))
		TNT1 AA 0 A_CustomMissile("FlyingBloodParticleFast", 60,  0, random(0, 360), 2, random(0, 90))
		TNT1 AAA 0 A_CustomMissile("FlyingBloodParticleBig", 30,  0, random(0, 360), 2, random(10, 45))
		TNT1 A 0 A_CustomMissile("XDeath1", 40,  0, random(0, 360), 2, random(10, 45))
		DPS1 ABCDEFG 4
		TNT1 A 0 A_SpawnItem("SmokePillar")
		DPS1 H -1
		Stop
	Raise:
		TROO MLKJI 8
		Goto See
	}
}

//===========================================================================
//
// Imp fireball
//
//===========================================================================
ACTOR DoomImpBall2 Replaces DoomIMpBall
{
	Game Doom
	SpawnID 10
	Radius 2
	Height 2
	Speed 10
	FastSpeed 20
	Damage (random (8, 12))
	Projectile
	+RANDOMIZE
	SeeSound "imp/attack"
	DeathSound "imp/shotx"
	States
	{
	Spawn:
		PRJ1 AB 1 BRIGHT
		Loop
	Death:
		TNT1 A 0
		TNT1 A 0 A_SetScale(0.5, 0.5)
		TNT1 A 0 A_SpawnItem("ExplosionShrapnelSmall")
		EXPZ AABBCD 1 BRIGHT
		TNT1 A 0 A_SpawnItem("ExplSmokeSmall")
		Stop
	}
}
