Actor CorruptFiend : Bullfiend
{
Monster
Health 300
Reactiontime 25
Speed 6
BloodColor Black
Painchance "Mine", 128
Painchance 40
+FloorClip
+MissileMore
+DontHurtSpecies
+DontHarmSpecies
+DONTHARMCLASS
Species "Fiends"
Damagefactor "Acid", 8.0
Damagefactor "Poison", 0.0
//No Infighting
DamageFactor "SoulToxic", 0.0
DamageFactor "Cacolich", 0.0
DropItem "LifeEssence", 180, 5
DropItem "HEMArmorBonusMax5", 180
SeeSound "CorruptFiendSee"
ActiveSound "CorruptFiendSee"
PainSound "CorruptFiendPain"
Obituary "%o was forced to decay by a Necro Fiend's Toxic Gale."
HitObituary "%o was eaten alive by a Necro Fiend."
Tag "Necro Fiend"
States
	{
	Spawn:
		SAR5 A 10 A_Look
		Loop
	See:
		SAR5 AAAA 1 A_Chase("","")
		SAR5 A 1 A_Chase
		SAR5 BBBB 1 A_Chase("","")
		SAR5 B 1 A_Chase
		TNT1 A 0 A_SpawnItemEx("HumanishStep2",0,0,2,0,0,-20)
		SAR5 CCCC 1 A_Chase("","")
		SAR5 C 1 A_Chase
		SAR5 DDDD 1 A_Chase("","")
		SAR5 D 1 A_Chase
		TNT1 A 0 A_SpawnItemEx("HumanishStep2",0,0,2,0,0,-20)
		TNT1 A 0 HEALTHING(7)
		Loop
	Melee:
		SAR5 EF 3 A_FaceTarget
		SAR5 G 1 A_MeleeAttack
		SAR5 G 3 A_FaceTarget
		GoTo See
	Missile:
		SAR5 EEGGE 2 A_FaceTarget
		SAR5 F 2 
		TNT1 A 0 A_CustomMissile("CorruptShot",32,0,0)
		SAR5 FE 5 A_FaceTarget
		TNT1 A 0 A_Jump(136,"See")
		Loop
	Pain:
		TNT1 A 0
		SAR5 H 4 A_Pain
		TNT1 A 0 A_Jump(130,"Missile")
		GoTo See
	Death: 
		SAR5 I 5
		SAR5 J 5 A_Scream
		SAR5 K 4
		SAR5 L 4 A_NoBlocking     
		SAR5 M 4 A_SpawnItem("BodyCrash",0,0,0,0)
		SAR5 N 63000 CanRaise
		Stop
	XDeath:
		SAR5 I 3
		SA5X A 3 A_XScream
		SA5X B 3 A_SpawnItemEx("BlackGibbedGenerator",0,0,0,0,0,0,0,128,0)
		SA5X C 3 A_NoBlocking
		SA5X D 3 A_SpawnItem("BodyCrash",0,0,0,0)
		SA5X EFG 3
		SA5X H 63000 CanRaise
		Stop
	Raise:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("VileHealEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		SAR5 NMLKJI 5
		Goto See
	}
}

Actor SwampBlood : Blood
{
Scale 0.45
Renderstyle Translucent
Alpha 0.9
Gravity 0.02
-NOGRAVITY
+THRUACTORS
+ClientSideOnly
States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,random(18,30),0,0)
		TNT1 A 0 ThrustThing(random(0,360),random(0,4),0,0)
		TNT1 A 0 A_TakeInventory("Tic",999999)
	Fly:
		BLER G 1 A_SpawnItemEx("SwampBloodTrail",0,0,0)
		TNT1 A 0 A_CheckFloor("Land")
		BLER H 1 A_SpawnItemEx("SwampBloodTrail",0,0,0)
		TNT1 A 0 A_CheckFloor("Land")
		BLER I 1 A_SpawnItemEx("SwampBloodTrail",0,0,0)
		TNT1 A 0 A_CheckFloor("Land")
		BLER J 1 A_SpawnItemEx("SwampBloodTrail",0,0,0)
		TNT1 A 0 A_CheckFloor("Land")
		TNT1 A 0 A_JumpIfInventory("Tic",525,"Land")
		TNT1 A 0 A_GiveInventory("Tic",1)
		Loop
	Land:
		BLER GHIJJJJJJJJ 1 A_FadeOut(0.1,1)
		Stop
	}
}

Actor SwampBloodTrail
{
Renderstyle Translucent
Alpha 0.9
+ClientSideOnly
+Nogravity
Scale 0.13
States
	{
	Spawn:
		BLER G 1
		BLER GHIJ 1 A_FadeOut(0.1,1)
		Wait
	}
}

Actor SwampBigBlood : SwampBloodTrail
{
Projectile
Scale 1.8
+Ripper
+NoExplodeFloor
+BloodLessImpact
States
	{
	Spawn:
		BLER GHIJGHIJ 3 A_FadeOut(0.05,1)
		Wait
	}
}

Actor SwampNoThrustBlood : SwampBigBlood
{
Height 1
Radius 1
BounceCount 12
Scale 1.0
+NoGravity
+NoExplodeFloor
+HexenBounce
States
	{
	Spawn:
		BLER GHIJ 1
		BLER GHIJ 1 A_FadeOut(0.1,1)
		Wait
	}
}

Actor CorruptShot
{
Projectile
Height 5
Radius 5
Renderstyle Translucent
Alpha 0.8
Speed 25
Scale 1.5
Damage (0)
+Ripper
+BloodlessImpact
+DontHurtSpecies
+DontHarmSpecies
Species "Fiends"
Damagetype "Poison"
SeeSound "Gale/Shot"
DeathSound "Gale/Explode"
Obituary "%o was defiled by a Corrupt Fiend's toxic gale."
States
	{
	Spawn:
		BZGB AAAAAAAA 1 A_SpawnItemEx("SwampNoThrustBlood",random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(150,250))
		TNT1 A 0 A_Explode(4,120,0)
		BZGB BBBBBBBB 1 A_SpawnItemEx("SwampNoThrustBlood",random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(-5,5),random(150,250))
		TNT1 A 0 A_Explode(4,120,0)
		Loop
	Death:
		TNT1 A 0
		BZGB C 1
		TNT1 A 0 A_Explode(15,200,0)
		TNT1 AAAA 0 A_SpawnItemEx("SwampBigBlood",0,0,0,random(-5,5),random(-5,5),random(-5,5),random(0,360))
		TNT1 AAAAAAAAA 0 A_SpawnItemEx("SwampNoThrustBlood",0,0,0,random(-15,5),random(-15,15),random(-15,15),random(0,360))
		BZGB CCDDEE 2 A_FadeOut(0.1,1)
		Stop
	}
}