ACTOR BloodDemonClone : HalfMechanicalEnemy
{ 
    Health 250 
    Speed 12 
    Height 56
    Radius 30
    Mass 400
    PainChance 180
    REACTIONTIME 8 
    MONSTER
    +FLOORCLIP
	+DONTBLAST
    SeeSound "blooddemon/sight"
    PainSound "blooddemon/pain"
    DeathSound "blooddemon/death"
    ActiveSound "blooddemon/active"
    //MeleeSound "blooddemon/melee"
    HitObituary "%o Was chewed up and spat out by a Mech-demon." 
	Species "Demon"
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	Tag "Blood Demon"
	+DONTHURTSPECIES
	+USEKILLSCRIPTS
    States 
    { 
    Spawn: 
		TNT1 A 0
		TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_BLOODDEMON, DND_ENERGY_WEAKNESS)
	Idle:
       SRG2 AB 10 A_Look
       Loop 
    See: 
       SRG2 A 0 A_PlaySound("blooddemon/walk")
       SRG2 AABB 2 Fast A_Chase
       SRG2 C 0 A_PlaySound("blooddemon/walk")
       SRG2 CCDD 2 Fast A_Chase
       Loop 
    Melee: 
	   SRG2 E 0 A_PlaySound("blooddemon/melee")
       SRG2 EF 8 Fast A_FaceTarget
       SRG2 G 8 Fast A_CustomMeleeAttack(5 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
       Goto See 
    Pain: 
       SRG2 H 2 Fast
       SRG2 H 2 Fast A_Pain
       Goto See
    Death: 
       SRG2 I 8 
	   TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
       SRG2 I 0 A_FaceTarget
       SRG2 J 0 A_SpawnItemEx("BloodDemonArm", 10, 0, 32, 0, 8, 0, 0, 128)
       SRG2 J 8 A_Scream
	   TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
	GaveSoul:
       SRG2 K 4 
       SRG2 L 4 A_NoBlocking
       SRG2 M 4 
       SRG2 N -1 
       Stop
	  GiveSoul:
	  Death.BookOfTheDead:
		SRG2 K 1
		TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
		TNT1 A 0 A_GiveToTarget("Souls", 1)  
	  Goto GaveSoul
    Raise: 
	   TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
       SRG2 NMLKJI 5 
       Goto See 
    } 
}

ACTOR BloodDemonArm
{
	Radius 8
	Height 8
	Speed 8
	+DOOMBOUNCE
	+DROPOFF
	+Missile
	+CLIENTSIDEONLY
      States
	{
	Spawn:
         SG2A ABCDEFGH 2
         Loop
	Death:
	 SG2A I -1
	 Loop
	}
}

Actor Bloodfiend : Demon2x
{
  Health 160
  PainChance 140
  Speed 12
  Radius 30
  Height 56
  Mass 450
  Monster
  +FloorClip
  +LongMeleeRange
  +DontHurtSpecies
  +USEKILLSCRIPTS
  Obituary "%o died from the toxic blood of a bloodfiend."
  HitObituary "%o was eaten by a bloodfiend."
  SeeSound "Monster/sg2sit"
  AttackSound "Monster/sg2atk"
  PainSound "demon/Pain"
  DeathSound "demon/Death"
  ActiveSound "demon/sg2act"
  DamageFactor "Demon", 0.0
  DamageFactor "DemonPoison_EarthGolem", 0.0
  DamageFactor "DemonFire", 0.0
  DamageFactor "DemonMagic", 0.0
  DropItem "SpinePickup"
  Tag "Blood Fiend"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_BLOODFIEND)
Idle:
    SAR2 AB 10 A_Look
    Loop
  See:
    SAR2 AABBCCDD 2 Fast A_Chase
    Loop
  Melee:
    SAR2 EF 8 Fast A_FaceTarget
    SAR2 G 8 Fast A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    Goto See
  Missile:
    SAR2 GF 8 Fast A_FaceTarget
    SAR2 E 0 A_PlaySound("Weapons/bloodf")
    SAR2 E 0 A_CustomMissile("Bloodshot",22,0,-1,0,0)
    SAR2 E 8 Fast A_CustomMissile("Bloodshot",22,0,1,0,0)
    Goto See
  Pain:
    SAR2 H 2 Fast
    SAR2 H 2 Fast A_Pain
    Goto See
  Death:
    SAR2 I 8
	TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
    SAR2 J 8 A_Scream
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
  GaveSoul:
    SAR2 K 4
    SAR2 L 4 A_NoBlocking
    SAR2 M 4
    SAR2 N -1
    Stop
  Death.BookOfTheDead:
  GiveSoul:
    SAR2 K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul	
  XDeath:
    SAR2 O 5
	TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
    SAR2 P 5 A_XScream
    SAR2 Q 5 A_NoBlocking
    SAR2 RSTUV 5
    SAR2 W -1
    Stop
  Raise:
	TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
    SAR2 NMLKJI 5
    Goto See
  }
}

Actor Bloodshot
{
  Radius 3
  Height 3
  Speed 20
  Damage (2 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
  DamageType "Demon"
  Projectile
  RenderStyle Translucent
  Alpha 0.80
  +ThruGhost
  +DONTBLAST
  DeathSound "weapons/bloodx"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
  SpawnLoop:
    FBLD A 2 Bright A_CStaffMissileSlither
    FBLD A 0 A_SpawnItemEx("Bloodtrail",0,0,0,0,0,0,128)
    FBLD B 2 Bright A_CStaffMissileSlither
    FBLD B 0 A_SpawnItemEx("Bloodtrail",0,0,0,0,0,0,128)
    Loop
  Death:
	TNT1 A 0 A_SpawnDebris("NashGore_FlyingBlood")
    FBLD CDE 3 Bright
    Stop
  }
}

Actor Bloodtrail
{
  Radius 1
  Height 1
  Projectile
  +DONTBLAST
  RenderStyle Translucent
  Alpha 0.67
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 A 3
    FBLD FGH 3 BRIGHT
    Stop
  }
}

ACTOR CyberFiend : HalfMechanicalEnemy
{ 
    Health 300
    Speed 10 
    Height 56
    Radius 30
    Mass 400
    PainChance 125
    MONSTER
    +FLOORCLIP +MISSILEMORE +MISSILEEVENMORE
	+DONTBLAST
    SeeSound "CyberFiend/sight"
    PainSound "CyberFiend/pain"
    DeathSound "CyberFiend/death"
    ActiveSound "CyberFiend/active"
    HitObituary "%o became the Cyber Fiend's dinner." 
    Obituary "The Cyber Fiend puked on %o"
	Species "Demon"
	+USEKILLSCRIPTS
	+DONTHURTSPECIES	
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	Tag "Cyber Fiend"
    States 
    { 
    Spawn: 
		TNT1 A 0
		TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_CYBERFIEND, DND_ENERGY_WEAKNESS)
	Idle:
       CYFN AB 10 A_Look
       Loop 
    See: 
       CYFN A 0 A_PlaySound("CyberFiend/walk")
       CYFN AABB 2 Fast A_Chase
       CYFN C 0 A_PlaySound("CyberFiend/walk")
       CYFN CCDD 2 Fast A_Chase
       Loop 
    Missile:
       TNT1 A 0 A_JumpifCloser(256,1)
       goto see
       TNT1 A 0 A_Jump(256, "Puke1", "Puke2", "Puke3")
    Puke1:
       CYFN E 0 A_PlaySound("CyberFiend/Attack")
       CYFN EF 8 Fast A_FaceTarget
       CYFN G 8 Fast A_CustomMissile("Puke1")
       Goto See      
    Puke2:
       CYFN E 0 A_PlaySound("CyberFiend/Attack")
       CYFN EF 8 Fast A_FaceTarget
       CYFN G 8 Fast A_CustomMissile("Puke2")
       Goto See      
    Puke3:
       CYFN E 0 A_PlaySound("CyberFiend/Attack")
       CYFN EF 8 Fast A_FaceTarget
       CYFN G 8 Fast A_CustomMissile("Puke3")
       Goto See      
    Melee: 
       CYFN E 0 A_PlaySound("CyberFiend/Attack")
       CYFN EF 8 Fast A_FaceTarget
       CYFN G 8 Fast A_CustomMeleeAttack(8 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
       Goto See 
    Pain: 
       CYFN H 2 Fast
       CYFN H 2 Fast A_Pain
       Goto See
    Death: 
       CYFN I 8 A_Scream
	   TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
       CYFN I 0 A_FaceTarget
       CYFN J 0 A_SpawnItemEx("CyberFiendArm", 10, 0, 32, 0, 8, 0, 0, 128)
       CYFN J 8
	   TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
	GaveSoul:
       CYFN K 4 
       CYFN L 4 A_NoBlocking
       CYFN M 4 
       CYFN N -1 
       Stop 
  Death.BookOfTheDead:
  GiveSoul:
    CYFN K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul	   
    Raise: 
	   TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
       CYFN NMLKJI 5 
       Goto See 
    } 
}


//origional Blood demon Arm Decorate, it works so why not use it?
ACTOR CyberFiendArm
{
	Radius 8
	Height 8
	Speed 8
	+DOOMBOUNCE
	+DROPOFF
	+Missile
	+CLIENTSIDEONLY
      States
	{
	Spawn:
         CYF1 ABCDEFGH 2
         Loop
	Death:
	 CYF1 I -1
	 Loop
	}
}
//FYI it actually pukes out body parts, a pinky's hand, a cacodemon eye and a player skull.
ACTOR Puke1
{
	Radius 8
	Height 8
	Speed 16
	Damage (3 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
	DamageType "Demon"
	bouncefactor 0.8 
	bouncecount 8 
	+DOOMBOUNCE
	+DROPOFF
	+THRUGHOST
	+Missile
	States
	{
	Spawn:
		TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
	SpawnLoop:
		PUK1 ABCDEFGH 2
	Loop
	Death:
	TNT1 A 0 A_PlaySound("misc/gibbed")
	TNT1 A 0 A_SpawnDebris("1Gib")
	TNT1 A 0 A_SpawnDebris("2Gib")
	TNT1 A 0 A_SpawnDebris("3Gib")
	TNT1 A 0 A_SpawnDebris("1Gib")
	TNT1 A 0 A_SpawnDebris("2Gib")
	TNT1 A 0 A_SpawnDebris("3Gib")
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}
ACTOR Puke2 : Puke1
{
	States
	{
	Spawn:
	PUK2 ABCDEFGH 2
	Loop
	}
}
ACTOR Puke3 : Puke1
{
	States
	{
	Spawn:
	PUK3 A 2
	Loop
	}
}

Actor 1GIB
{
	health 1
	radius 6
	height 6
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	1GIB A 4
	loop
	Crash:
	1GIB A 1050
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}
Actor 2GIB
{
	health 1
	radius 6
	height 6
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	2GIB A 4
	loop
	Crash:
	2GIB A 1050
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}
Actor 3GIB
{
	health 1
	radius 6
	height 6
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	3GIB A 4
	loop
	Crash:
	3GIB A 1050
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}
Actor IGIB
{
	health 1
	radius 6
	height 6
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	IGIB A 4
	loop
	Crash:
	IGIB A 1050
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}
Actor IGIB2
{
	health 1
	radius 6
	height 6
	mass 1
	+CORPSE
	+NOTELEPORT
	+CLIENTSIDEONLY
	States
	{
	Spawn:
	IGIB B 4
	loop
	Crash:
	IGIB B 1050
	TNT1 A 1 A_FadeOut(1)
	Stop
	}
}

ACTOR FlameDemon : DnD_BaseEnemy
{
   Health 200
   Speed 16
   Height 56
   Radius 30
   Mass 400
   PainChance 150
   REACTIONTIME 8
   MONSTER
   +FLOORCLIP
   +NORADIUSDMG
   +DONTBLAST
   +USEKILLSCRIPTS
   SeeSound "demon/sight"
   PainSound "demon/pain2"
   DeathSound "demon/death2"
   ActiveSound "demon/active"
   MeleeSound "demon/melee"
   HitObituary "A charred demon hunted %o down."
   AttackSound "demon/melee"
   Translation "16:39=101:111", "40:47=5:8", "79:79=8:8", "190:191=7:8", "210:223=87:100", "224:224=161:161"
	Species "Demon"
	+DONTHURTSPECIES   
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	Tag "Flame Demon"
   States
   {
   Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_FLAMEDEMON, DND_EXPLOSIVE_IMMUNE)
	Idle:
      SARG AB 8 A_Look
      Loop
   See:
      SARG AABBCCDD 2 Fast A_Chase
      Loop
   Melee:
      SARG EF 8 Fast A_FaceTarget
      SARG G 8 Fast A_CustomMeleeAttack(6 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
      Goto See
   Pain:
      SARG H 2 Fast
      SARG H 2 Fast A_Pain
      Goto See
   Death:
      SARG I 6
	  TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
      SARG J 6 A_Scream
	  TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
   GaveSoul:
      SARG K 4
      SARG L 4 A_NoBlocking
      SARG M 4
      SARG N -1
      Stop
  GiveSoul:
  Death.BookOfTheDead:
    SARG K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul	  
   Raise:
      TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
      SARG NMLKJI 4
      Goto See
   }
}

ACTOR StoneImp : MechanicalExplosiveResistEnemy
{
  Health 180
  Radius 20
  Height 56
  Speed 6
  Mass 400
  Monster
  BloodType "StoneBitsSpawner"
  DamageFactor "Poison", 0
  DamageFactor "PoisonCloud", 0
  DamageFactor "Electric", 0
  DamageFactor "Lightning", 0
  DamageFactor "Fire", 0.5
  DamageFactor "P_Ice", 1.2
  SeeSound "imp/sight"
  PainSound "imp/pain"
  DeathSound "imp/death"
  ActiveSound "imp/active"
  Obituary "%o was smashed by a stone imp."
  Species "Imp"
  +DONTHURTSPECIES  
  +FLOORCLIP
  +NOBLOODDECALS
  +NOPAIN
  +DONTBLAST
  -DONTRIP
  -NOBLOOD
  +USEKILLSCRIPTS
  DamageFactor "Demon", 0.0
  DamageFactor "DemonPoison_EarthGolem", 0.0
  DamageFactor "DemonFire", 0.0
  DamageFactor "DemonMagic", 0.0
  Tag "Stone Imp"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_STONEIMP, DND_ENERGY_WEAKNESS | DND_BULLET_RESIST | DND_MELEE_RESIST | DND_EXPLOSIVE_RESIST)
Idle:
    GIMP AB 10 A_Look
    Loop
  See:
    GIMP AABBCCDD 3 Fast A_Chase
    Loop
  Melee:
    GIMP EF 8 Fast A_FaceTarget
    GIMP G 6 Fast A_CustomMeleeAttack(12 * random(1, 4) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)), "stoneimp/hit", "", "Melee")
    Goto See
  Pain:
    GIMP H 2 Fast
    GIMP H 2 Fast A_Pain
    Goto See
  Death:
    GIMP I 6
    GIMP J 6 A_Scream
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
  GaveSoul:
    GIMP K 5
    GIMP L 5 A_Fall
    GIMP M 5
    GIMP N -1
    Stop
  GiveSoul:
  Death.BookOfTheDead:
    GIMP K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul
  Raise:
    TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
    GIMP ML 8
    GIMP KJI 6
    Goto See
  }
}

// Stone bits SFX - by Blue Shadow (the spawning code is based on Nash's nashgore code)

ACTOR StoneBitsSpawner : BulletPuff
{
  -ALLOWPARTICLES
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 A 0
    Goto High
    TNT1 A 0
    Goto Medium
    TNT1 A 0
  Low:
    TNT1 AA 0 A_SpawnItemEx("StoneBitsSmall", 0, 0, 8, random(-4, 4), random(-4, 4), random(2, 5), 0, SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEMOMENTUM)
    Goto SpawnPuff
  Medium:
    TNT1 AAA 0 A_SpawnItemEx("StoneBitsMedium", 0, 0, 8, random(-4, 4), random(-4, 4), random(2, 5), 0, SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEMOMENTUM)
    Goto SpawnPuff
  High:
    TNT1 AAAAA 0 A_SpawnItemEx("StoneBitsLarge", 0, 0, 8, random(-4, 4), random(-4, 4), random(2, 5), 0, SXF_ABSOLUTEPOSITION | SXF_ABSOLUTEANGLE | SXF_ABSOLUTEMOMENTUM)
  SpawnPuff:
    PUFF A 4 Bright A_PlaySound("stoneimp/impact")
    PUFF ABCD 4
    Stop
  }
}

ACTOR StoneBitsSmall
{
  Radius 2
  Height 2
  +NOTELEPORT
  +NOBLOCKMAP
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 AA 0 A_Jump(256, "SpawnA", "SpawnB")
  SpawnA:
    TNT1 A 0 A_Jump(256, 1, 2, 3, 4)
    STB1 AAAA 10 A_FadeOut(0.25)
    Stop
    STB1 BBBB 10 A_FadeOut(0.25)
    Stop
    STB1 CCCC 10 A_FadeOut(0.25)
    Stop
    STB1 DDDD 10 A_FadeOut(0.25)
    Stop
  SpawnB:
    TNT1 A 0 A_Jump(256, 1, 2)
    STB2 AAAA 10 A_FadeOut(0.25)
    Stop
    STB2 BBBB 10 A_FadeOut(0.25)
    Stop
  }
}

ACTOR StoneBitsMedium
{
  Radius 2
  Height 2
  +NOTELEPORT
  +NOBLOCKMAP
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 AA 0 A_Jump(256, "SpawnA", "SpawnB", "SpawnC")
  SpawnA:
    TNT1 A 0 A_Jump(256, 1, 2, 3, 4)
    STB1 A 10
    Goto Fade
    STB1 B 10
    Goto Fade
    STB1 C 10
    Goto Fade
    STB1 D 10
    Goto Fade
  SpawnB:
    TNT1 A 0 A_Jump(256, 1, 2)
    STB2 A 10
    Goto Fade
    STB2 B 10
    Goto Fade
  SpawnC:
    TNT1 A 0 A_Jump(256, 1, 2, 3, 4)
    STB3 A 10
    Goto Fade
    STB3 B 10
    Goto Fade
    STB3 C 10
    Goto Fade
    STB3 D 10
    Goto Fade
	Fade:
		"####" "#" 10 A_FadeOut(0.25)
	Loop
  }
}

ACTOR StoneBitsLarge
{
  Radius 2
  Height 2
  +NOTELEPORT
  +NOBLOCKMAP
  +CLIENTSIDEONLY
  States
  {
  Spawn:
    TNT1 AA 0 A_Jump(256, "SpawnB", "SpawnC", "SpawnD")
  SpawnB:
    TNT1 A 0 A_Jump(256, 1, 2)
    STB2 A 10
    Goto Fade
    STB2 B 10
    Goto Fade
  SpawnC:
    TNT1 A 0 A_Jump(256, 1, 2, 3, 4)
    STB3 A 10
    Goto Fade
    STB3 B 10
    Goto Fade
    STB3 C 10
    Goto Fade
    STB3 D 10
    Goto Fade
  SpawnD:
    TNT1 A 0 A_Jump(256, 1, 2, 3, 4)
    STB4 A 10
    Goto Fade
    STB4 B 10
    Goto Fade
    STB4 C 10
    Goto Fade
    STB4 D 10
    Goto Fade
	Fade:
		"####" "#" 10 A_FadeOut(0.25)
	Loop
  }
}

ACTOR Morphed : Inventory {}
ACTOR StoneImpHidden1 : MechanicalExplosiveResistEnemy
{
  //$Category Monsters
  Health 180
  Radius 20
  Height 56
  Speed 8
  Mass 400
  Monster
  BloodType "StoneBitsSpawner"
  DamageFactor "Poison", 0
  DamageFactor "PoisonCloud", 0
  DamageFactor "Electric", 0
  DamageFactor "Lightning", 0
  DamageFactor "Fire", 0.5
  DamageFactor "P_Ice", 1.2
  PainSound "imp/pain"
  DeathSound "imp/death"
  ActiveSound "imp/active"
  Obituary "%o didn't see that stone imp coming."
  Species "Imp"
  DamageFactor "Demon", 0.0
  DamageFactor "DemonPoison_EarthGolem", 0.0
  DamageFactor "DemonFire", 0.0
  DamageFactor "DemonMagic", 0.0
  Tag "Stone Imp"
  +DONTHURTSPECIES
  +FLOORCLIP
  +NOBLOODDECALS
  +NOPAIN
  +DONTRIP
  +LOOKALLAROUND
  +DONTBLAST
  -NOBLOOD
  +USEKILLSCRIPTS
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_STONEIMP, DND_ENERGY_WEAKNESS | DND_BULLET_RESIST | DND_MELEE_RESIST | DND_EXPLOSIVE_RESIST)
	TNT1 A 0 A_GiveInventory("EnemyInDisguise", 1)
Idle:
	STNI A 1 A_Look
	Loop
  Idle:
    GIMP AB 10 A_Look
    Loop
  See:
	STNI A 1 A_JumpIfInventory("Morphed", 1, "Chase")
	STNI A 1 A_JumpIfCloser(128, "Morph")
	Wait
  Morph:
	TNT1 A 0 A_TakeInventory("EnemyInDisguise", 1)
	STNI A 0 A_ChangeFlag("SHOOTABLE", 1)
	STNI A 0 A_ChangeFlag("NOBLOOD", 0)
	STNI A 0 A_ChangeFlag("NODAMAGE", 0)
	STNI ABEFG 4 Fast
	GIMP H 4 Fast A_GiveInventory("Morphed", 1)
  Chase:
    GIMP AABBCCDD 3 Fast A_Chase
    Loop
  Melee:
    GIMP EF 8 Fast A_FaceTarget
    GIMP G 6 Fast A_CustomMeleeAttack(12 * random(1, 4) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)), "stoneimp/hit", "", "Melee")
	TNT1 A 0 A_JumpIfInventory("Morphed", 1, "Chase")
    Goto See
  Pain:
    GIMP H 2 Fast
    GIMP H 2 Fast A_Pain
    Goto See
  Death:
    GIMP I 6
    GIMP J 6 A_Scream
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
  GaveSoul:
    GIMP K 5
    GIMP L 5 A_Fall
    GIMP M 5
    GIMP N -1
    Stop
  GiveSoul:
  Death.BookOfTheDead:
    GIMP K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul
  }
}
ACTOR StoneImpHidden2 : StoneImpHidden1
{
	States
	{
  Spawn:
	STNI C 1 A_Look
	Wait
  See:
	STNI C 1 A_JumpIfInventory("Morphed", 1, "Chase")
	STNI C 1 A_JumpIfCloser(128, "Morph")
  Wait
  Morph:
	STNI A 0 A_ChangeFlag("SHOOTABLE", 1)
	STNI A 0 A_ChangeFlag("NOBLOOD", 0)
	STNI A 0 A_ChangeFlag("NODAMAGE", 0)
	STNI CDEFG 4
	GIMP H 4 A_GiveInventory("Morphed", 1)
	Goto Chase
	}
}

Actor ShortGreenColumn2 : ShortGreenColumn3 { }
Actor TallGreenColumn2 : TallGreenColumn3 { }

Actor ImpDisguise1 : Randomspawner replaces ShortGreenColumn
{
	DropItem "ShortGreenColumn2"
	DropItem "StoneImpHidden1"
}

Actor ImpDisguise2 : Randomspawner replaces TallGreenColumn
{
	DropItem "TallGreenColumn2"
	DropItem "StoneImpHidden2"
}

actor StoneDemon : MechanicalExplosiveResistEnemy
{
  MONSTER
  +FLOORCLIP
  +NORADIUSDMG
  Scale 1.1
  HitObituary "%o was smashed by a stone demon."
  Health 250
  PainChance 100
  Speed 8
  Radius 30
  Height 56
  Mass 9999999
  MissileType StoneDemonBoulder
  MissileHeight 24
  SeeSound "stone/sight"
  AttackSound "demon/melee"
  PainSound "demon/pain"
  DeathSound "stone/death"
  ActiveSound "demon/active"
	Species "Demon"
	+DONTHURTSPECIES  
	+USEKILLSCRIPTS
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	DamageFactor "Lightning", 0.0
	DamageFactor "P_Ice", 1.2
	Tag "Stone Demon"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_STONEDEMON, DND_ENERGY_WEAKNESS | DND_BULLET_RESIST | DND_MELEE_RESIST | DND_EXPLOSIVE_RESIST | DND_HARDENED_SKIN)
Idle:
    STON AB 10 A_Look
    Loop
  See:
    STON AABBCCDD 2 Fast A_Chase
    Loop
  Missile:
    STON EF 6 Fast A_FaceTarget
    STON E 6 Fast A_MissileAttack
    Goto See
  Melee:
    STON EF 8 Fast A_FaceTarget
    STON G 0 A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    STON G 6 Fast A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    STON EF 8 Fast A_FaceTarget
    STON G 6 Fast A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    Goto See
  Pain:
    STON H 3 Fast
    STON H 3 Fast A_Pain
    Goto See
  Death:
    TNT1 AAAAAAAAAAA 0 A_CustomMissile("StoneDemonMiniBoulder",16,0,random(0,359),2,random(0,40))
    STON I 5
    STON J 5 A_Scream
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
  GaveSoul:
    STON K 5
    STON L 5 A_NoBlocking
    STON MN 5
    STON OP 4
    STON Q -1
    Stop
  GiveSoul:
  Death.BookOfTheDead:
    STON K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul
  Raise:
    TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
    STON NMLKJI 5
    Goto See
  }
}

actor StoneDemonBoulder
{
  PROJECTILE
  -NOGRAVITY
  +DOOMBOUNCE
  +BOUNCEONACTORS
  +DONTBLAST
  SeeSound "stone/bounce"
  Radius 6
  Height 6
  Scale 0.7
  Speed 20
  VSpeed 3
  Damage (random(6,12) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
  DamageType "Demon"
  States
  {
  Spawn:
    TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
  SpawnLoop:
    STNB ABCDEFGH 3
    Loop
  Death:
    STNB H 200
    Stop
  }
}

actor StoneDemonMiniBoulder : StoneDemonBoulder
{
  Damage (1 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
  Scale 0.35
  SeeSound ""
}

Actor SoulEater : Demon2x
{
  Health 200
  PainChance 128
  Speed 12
  Radius 30
  Height 56
  Mass 450
  Monster
  +FloorClip
  +LongMeleeRange
  +DontHurtSpecies
  +USEKILLSCRIPTS
  Obituary "%o had %p soul stolen by a Soul Eater."
  HitObituary "%o was eaten by a Soul Eater."
  SeeSound "SoulEater/See"
  AttackSound "Monster/sg2atk"
  PainSound "SoulEater/Pain"
  DeathSound "SoulEater/Die"
  ActiveSound "SoulEater/Act"
  DamageFactor "Demon", 0.0
  DamageFactor "DemonPoison_EarthGolem", 0.0
  DamageFactor "DemonFire", 0.0
  DamageFactor "DemonMagic", 0.0
  DropItem "SoulAmmoSpawner", 32
  Tag "Soul Eater"
  MaxTargetRange 512
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_SOULEATER)
Idle:
    SOEA AB 10 A_Look
    Loop
  See:
    SOEA AABBCCDD 2 Fast A_Chase
    Loop
  Melee:
    SOEA EF 8 Fast A_FaceTarget
	TNT1 A 0 A_CustomMissile("SoulEaterProj",28)
    SOEA G 8 Fast A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    Goto See
  Missile:
    SOEA EF 8 Fast A_FaceTarget
    SOEA G 8 Fast A_CustomMissile("SoulEaterProj",28)
    Goto See
  Pain:
    SOEA H 2 Fast
    SOEA H 2 Fast A_Pain
    Goto See
  Death:
    SOEA I 8
	TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
    SOEA J 8 A_Scream
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
  GaveSoul:
    SOEA K 4
    SOEA L 4 A_NoBlocking
    SOEA M 4
    SOEA N -1
    Stop
  GiveSoul:
  Death.BookOfTheDead:
    SOEA K 1
	TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
	TNT1 A 0 A_GiveToTarget("Souls", 1)  
  Goto GaveSoul
  Raise:
    TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
    SOEA NMLKJI 5
    Goto See
  }
}

Actor SoulEaterProj : MummyFX1
{
	Damage (random(8, 24) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
	DamageType "DemonMagic"
	Speed 12
	
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
		Goto Super::Spawn
		Death:
			TNT1 A 0 A_SpawnItemEx("OrangeParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
		Goto Super::Death
	}
}

ACTOR BigBruty : DnD_BaseEnemy
{
	Health 240
	Radius 30
	Height 56
	mass 999999
	Speed 12
	XScale 1.0
	YScale 1.1
	PainChance 48
	MONSTER
	MeleeRange 96
	+Floorclip
	+DONTBLAST
	+NOFEAR
	+USEKILLSCRIPTS
	PainSound "Bruty/Pain"
	DeathSound "Bruty/Die"
	ActiveSound "Bruty/Act"
	SeeSound "Bruty/See"
	MeleeRange 72
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	Obituary "%o was nuked by a Big Bruty."
	Tag "Big Bruty"
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_BRUTY, DND_DEATH)
		Idle:
			BBRT AB 10 A_Look
		Loop
		See:
		BBRT AABB 3 Fast A_Chase
		TNT1 A 0 A_PlaySound("Bruty/walk")
		BBRT CCDD 3 Fast A_Chase
		TNT1 A 0 A_PlaySound("Bruty/walk")
		Loop
		Pain:
		TNT1 AA 0 A_Pain
		BBRT EEE 4 Fast A_Chase
		Goto See
		Melee:
		BBRT F 4 Fast A_Die("SelfExplosion")
		BBRT F 2 Fast
		Goto Death
		Death:
		BBRT F 1
		TNT1 A 0 A_Scream
		BBRT F 15 A_Scream
		TNT1 A 0 A_NoBlocking
		BBRT G 8 A_Fall
		TNT1 A 0 A_SpawnItem("BruteExplosion1",0,32)
		Goto End
		Death.SelfExplosion:
		TNT1 A 0 A_SpawnItem("BruteExplosion2",0,32)
		TNT1 A 0 A_NoBlocking
		BBRT G 8 A_Fall
		End:
		BBRT H 4	
		BBRT IJKLM 4
		BBRT N -1
		Stop
	}
}

Actor BruteExplosion1 : BaseExplosionDamage
{
	DamageType "Explosive"
	States
	{
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			TNT1 A 0 A_Explode(32 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)), 128)
			TNT1 AAAAAA 0 A_SpawnDebris("NashGore_FlyingBlood")
			TNT1 AAAAAAAAAA 1 A_SpawnItemEx("ExplosionFX", 0, 0, 16, random(-3,3), random(-3,3), random(0,4))
		Stop
	}
}

Actor BruteExplosion2 : BaseExplosionDamage
{
	DamageType "Explosive"
	States
	{
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			TNT1 A 0 A_Explode(64 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)), 128)
			TNT1 AAAAAA 0 A_SpawnDebris("NashGore_FlyingBlood")
			TNT1 AAAAAAAAAA 1 A_SpawnItemEx("ExplosionFX", 0, 0, 16, random(-3,3), random(-3,3), random(0,4))
		Stop
	}
}

actor Scavenger : DnD_BaseEnemy
{
  obituary "%o was wrecked by a Scavenger."
  hitobituary "A Scavenger had %o for lunch."
  health 195
  Gibhealth -10
  radius 20
  height 56
  mass 120
  speed 7
  painchance 128
  +DONTHURTSPECIES
  +DONTBLAST
  +USEKILLSCRIPTS
  seesound "monster/vulsit"
  painsound "monster/vulpai"
  deathsound "monster/vuldth"
  activesound "monster/vulact"
  meleesound "monster/vulhit"
  DamageFactor "Demon", 0.0
  DamageFactor "DemonPoison_EarthGolem", 0.0
  DamageFactor "DemonFire", 0.0
  DamageFactor "DemonMagic", 0.0
  Translation "1:2=[2,2,1]:[1,1,1]", "7:8=0:0", "9:12=[18,14,12]:[3,2,2]", "15:15=[5,4,3]:[5,4,3]", "78:78=[12,9,8]:[12,9,8]", "127:131=[1,1,1]:[165,133,111]", "152:159=[124,94,73]:[24,20,17]"
  MONSTER
	Species "Demon"
  +FLOORCLIP
  Tag "Scavenger"
  states
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_SCAVENGER, DND_RESURRECT)
Idle:
    VULG AB 10 A_Look
    loop
  See:
    TNT1 A 0 A_JumpIfInventory("ScavengerCounter", 0, "NoRaise")
    VULG AABBCCDD 3 Fast A_VileChase
    loop
  NoRaise:
    VULG AABBCCDD 3 Fast A_Chase
    loop
  Melee:
    Missile:
    VULG E 8 Fast A_FaceTarget
    VULG F 1 Fast A_PlaySound("monster/vulswg")
    VULG F 7 Fast A_FaceTarget
    VULG G 6 Fast A_CustomMeleeAttack(4 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
    goto See
  Missile:
    VULG EF 8 Fast A_FaceTarget
    VULG G 6 Fast A_CustomMissile("ScavengerBall",37,0,0,0,0)
    goto See
  Heal:
    TNT1 A 0 A_GiveInventory("ScavengerCounter", 1)
    VULG EFG 3 Fast
  Goto See
  Pain:
    VULG H 2 Fast
    VULG H 2 Fast A_Pain
    goto See
  Death:
    VULG I 8
	TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
	TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoulN")
  GaveSoulN:
    VULG J 8 A_Scream
    VULG KL 6
    VULG M 6 A_NoBlocking
    VULG N -1
    stop
	  GiveSoulN:
	  Death.BookOfTheDead:
		VULG I 1
		TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
		TNT1 A 0 A_GiveToTarget("Souls", 1)  
	  Goto GaveSoulN	  
  Raise:
    TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
    VULG ML 8
    VULG KJI 6
    goto See
  }
}

Actor ScavengerBall
{
  Radius 6
  Height 8
  Speed 16
  Damage (4 * random(1, 8) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
  Projectile
  SeeSound "imp/attack"
  DeathSound "imp/shotx"
  Damagetype "DemonFire"
  Decal BaronScorch
  Translation "111:123=197:207", "124:127=242:245"
  +DONTBLAST
  States
  {
  Spawn:
    TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
  SpawnLoop:
    BAL7 AAAABBBB 1 Bright A_FadeOut(0.075)
    Loop
  Death:
	TNT1 A 0 A_SpawnItemEx("BlueParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	TNT1 AAA 0 A_CustomMissile("ExplosionFX5", 0, 0, random(0,360), 2, random(0,360))
	TNT1 AAA 0 A_CustomMissile("FireballSmoke", 0, 0, random(0,360), 2, random(0,360))
    BAL7 CDE 6 Bright
    Stop
  }
}

Actor ScavengerCounter : Inventory {
	inventory.maxamount 3
}

Actor Nhumcign : Demon2x {
	Translation "0:255=%[0.00,0.00,0.00]:[1.17,0.10,1.29]", "0:47=0:47", "80:127=80:127", "152:235=152:235", "240:255=240:255"
	Health 275
	PainChance 96
	Speed 8
	Obituary "%o had %p ass bitten by a Nhumcign."
	Hitobituary "%o had %p ass bitten by a Nhumcign."
	SeeSound "PurpleDemon/See"
	AttackSound "Monster/sg2atk"
	PainSound "PurpleDemon/Pain"
	DeathSound "PurpleDemon/Die"
	ActiveSound "PurpleDemon/Act"
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	DropItem "SoulAmmoSpawner", 32
	Tag "Nhumcign"
	+USEKILLSCRIPTS
	States {
		Spawn:
			TNT1 A 0
			TNT1 A 0 ACS_ExecuteAlways(964, 0, 1)
			TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_NHUMCIGN, DND_MOBILITY | DND_RAGE)
		Idle:
			SOEA AB 10 A_Look
		Loop
		See:
			TNT1 A 0 A_JumpIfInventory("NhumAngry", 1, "AngrySee")
			TNT1 A 0 A_GiveInventory("NhumHealthCheck", 1)
			SOEA AA 2 Fast A_Chase
			TNT1 A 0 A_GiveInventory("NhumHealthCheck", 1)
			SOEA B 2 Fast A_Chase
			TNT1 A 0 A_GiveInventory("DemonJumpCheck", 1)
			SOEA B 2 Fast A_Chase
			TNT1 A 0 A_JumpIfInventory("DemonGoJump", 1, "MissileGo")
			TNT1 A 0 A_GiveInventory("NhumHealthCheck", 1)
			SOEA C 2 Fast A_Chase
			TNT1 A 0 A_JumpIfInventory("NhumAngry", 1, "AngrySee")
			SOEA C 2 Fast A_Chase
			SOEA D 2 Fast A_Chase
			TNT1 A 0 A_GiveInventory("DemonJumpCheck", 1)
			SOEA D 2 Fast A_Chase
			TNT1 A 0 A_JumpIfInventory("DemonGoJump", 1, "MissileGo")
		Loop
		AngrySee:
			SOEA AA 1 Fast A_Chase("", "", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_SpawnItem("NhumWalkFXA")
			SOEA AA 1 Fast A_Chase
			TNT1 A 0 A_SpawnItem("NhumWalkFXA")
			TNT1 A 0 A_GiveInventory("DemonJumpCheck", 1)
			SOEA BB 1 Fast A_Chase("", "", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_SpawnItem("NhumWalkFXB")
			SOEA BB 1 Fast A_Chase
			TNT1 A 0 A_JumpIfInventory("DemonGoJump", 1, "MissileGo")
			TNT1 A 0 A_SpawnItem("NhumWalkFXB")
			TNT1 A 0 A_GiveInventory("DemonJumpCheck", 1)
			SOEA CC 1 Fast A_Chase("", "", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_SpawnItem("NhumWalkFXC")
			TNT1 A 0 A_JumpIfInventory("DemonGoJump", 1, "MissileGo")
			SOEA CC 1 Fast A_Chase
			TNT1 A 0 A_SpawnItem("NhumWalkFXC")
			SOEA DD 1 Fast A_Chase("", "", CHF_NOPLAYACTIVE)
			TNT1 A 0 A_SpawnItem("NhumWalkFXD")
			SOEA DD 1 Fast A_Chase
			TNT1 A 0 A_SpawnItem("NhumWalkFXD")
		Goto See
		Melee:
			SOEA E 5 Fast A_FaceTarget
			SOEA F 2 Fast A_FaceTarget
			SOEA F 3 Fast A_CustomMeleeAttack(random(1, 10) * 4 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)))
			SOEA G 5 Fast
		Goto See
		MissileGo:
			SOEA EEEE 3 Fast A_FaceTarget
			TNT1 A 0 A_TakeInventory("DemonGoJump", 1)
			TNT1 A 0 A_PlaySound("PurpleDemon/Jump")
			TNT1 A 0 ACS_ExecuteAlways(965)
			SOEA F 3 Fast
			SOEA F 4 Fast ACS_ExecuteAlways(966)
		Goto See
		Pain:
			TNT1 A 0 A_TakeInventory("DemonGoJump", 1)
			TNT1 A 0 A_GiveInventory("NhumHealthCheck", 1)
			SOEA H 2 Fast
			SOEA H 2 Fast A_Pain
		Goto See
		Death:
			SOEA I 8 A_ChangeFlag("NOPAIN", 0)
			TNT1 A 0 A_TakeInventory("NhumAngry", 1)
			TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
			SOEA J 8 A_Scream
			TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
		GaveSoul:
			SOEA K 4
			SOEA L 4 A_NoBlocking
			SOEA M 4
			SOEA N -1
		Stop
		GiveSoul:
		Death.BookOfTheDead:
			SOEA K 1
			TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
			TNT1 A 0 A_GiveToTarget("Souls", 1)  
		Goto GaveSoul
		Raise:
			TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
			SOEA NMLKJI 5
		Goto See
	}
}

Actor DemonLand : BaseExplosionDamage {
	DamageType "Demon"
	Obituary "%o was traumatized by a Nhumcign."
	States
	{
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
			TNT1 A 1 A_Explode(36 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)), 84, 0)
		Stop
	}
}

Actor NhumWalkFXA {
	Height 2
	Radius 2
	Renderstyle Translucent
	Alpha 0.75
	Translation "0:255=%[0.00,0.00,0.00]:[1.17,0.10,1.29]", "0:63=0:63", "80:127=80:127", "152:255=152:255"
	+NOINTERACTION
	+CLIENTSIDEONLY
	States {
		Spawn:
			SOEA A 1 A_FadeOut(0.15)
		Loop
	}
}

Actor NhumWalkFXB : NhumWalkFXA {
	States {
		Spawn:
			SOEA B 1 A_FadeOut(0.15)
		Loop
	}
}

Actor NhumWalkFXC : NhumWalkFXA {
	States {
		Spawn:
			SOEA C 1 A_FadeOut(0.15)
		Loop
	}
}

Actor NhumWalkFXD : NhumWalkFXA {
	States {
		Spawn:
			SOEA D 1 A_FadeOut(0.15)
		Loop
	}
}

Actor NhumAngry : Inventory {
	inventory.maxamount 1
}

Actor NhumHealthCheck : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfInventory("NhumAngry", 1, "Nothing")
			TNT1 A 0 A_JumpIFHealthLower(3 * ACS_ExecuteWithResult(961, 7) / 5, "Anger")
		Stop
		Nothing:
			TNT1 A 0
		Stop
		Anger:
			TNT1 A 0 A_GiveInventory("NhumAngry", 1)
			TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
		Stop
	}
}

Actor Landed : DnD_Activator {
	States {
		Use:
			TNT1 A 0 A_SpawnItem("DemonLand")
			TNT1 A 0 A_PlaySound("PurpleDemon/Land", 6)
			TNT1 A 0 A_TakeInventory("DemonGoJump", 1)
		Stop
	}
}

Actor DemonGoJump : DnD_Boolean { }

Actor DemonJumpCooldown : PowerDamage {
	damagefactor "normal", 1.0
	powerup.duration -1
}

Actor DemonJumpCheck : DnD_Activator {
	States {
		Pickup:
			TNT1 A 0 A_JumpIfCloser(80, "Nothing")
			TNT1 A 0 A_JumpIfCloser(384, "CheckSight")
		Stop
		CheckSight:
			TNT1 A 0 A_JumpIfTargetInLOS("Jump")
		Stop
		Jump:
			TNT1 A 0 A_JumpIfInventory("DemonJumpCooldown", 1, "Nothing")
			TNT1 A 0 A_GiveInventory("DemonJumpCooldown", 1)
			TNT1 A 0 A_GiveInventory("DemonGoJump", 1)
		Stop
		Nothing:
			TNT1 A 0
		Stop
	}
}

Actor DemonFlightDamager : DnD_Activator {
	States {
		Use:
			TNT1 A 0 A_CustomMissile("DemonFlightAtk", 24, 0, 0, CMF_AIMDIRECTION)
		Stop
	}
}

Actor DemonFlightAtk {
	PROJECTILE
	Radius 6
	Height 12
	Damage (3 * random(2, 5) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
	DamageType "Demon"
	+DONTBLAST
	+THRUSPECIES
	Species "Demon"
	Speed 56
	States
	{
		Spawn:
			TNT1 A 1 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
		Stop
		Death:
			TNT1 A 1
		Stop
	}
}

actor Satyr : DnD_BaseEnemy
{
    Health 150
    Radius 24
    Height 56
    Scale 0.9
    Speed 8
    PainChance 84
    Mass 350
    MONSTER 
    +FLOORCLIP
	+DONTBLAST
	+USEKILLSCRIPTS
    SeeSound "Satyr/See"
    PainSound "Satyr/Hit"
    DeathSound "Satyr/Die"
    ActiveSound "Satyr/Act"
    MeleeSound "baron/melee"
    HitObituary "%o was mauled by a satyr."
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	Tag "Satyr"
	Species "Demon"
	+DONTHURTSPECIES	
    States
    {
    Spawn:
		TNT1 A 0
		TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_SATYR)
	Idle:
        STYR AB 10 A_Look
        Loop
    See:
        STYR AABBCCDD 3 Fast A_Chase
        Loop
	Melee:
		STYR E 2 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-1.6)
		STYR E 3 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.0)
		STYR F 2 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.4)
		STYR F 3 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.8)
		TNT1 A 0 A_Stop
		STYR G 5 Fast A_CustomMeleeAttack(random(12, 24) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)), "baron/melee", "")
		STYR P 2 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-1.6)
		STYR P 3 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.0)
		STYR Q 2 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.4)
		STYR Q 3 Fast A_FaceTarget
		TNT1 A 0 A_Recoil(-2.8)
		STYR R 5 Fast A_CustomMeleeAttack(random(12, 24) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)), "baron/melee", "")
		Goto See
    Pain:
        STYR H 2 Fast
        STYR H 2 Fast A_Pain
        Goto See
    Death:
	    TNT1 A 0 A_JumpIfInTargetInventory("Ability_SoulStealer", 1, "GiveSoul")
	GaveSoul:	
        STYR I 5
		TNT1 A 0 ACS_ExecuteAlways(982, 0, 2)
        STYR J 5 A_Scream
        STYR K 6
        STYR L 7 A_Fall
        STYR M 4
        STYR N 4
        STYR O -1
        Stop
	  GiveSoul:
	  Death.BookOfTheDead:
		STYR I 1
		TNT1 A 0 A_SpawnItem("SoulEffectSpawner")
		TNT1 A 0 A_GiveToTarget("Souls", 1)  
	  Goto GaveSoul		
    Raise:
		TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
        STYR ONMLKJI 8
        Goto See
    }
}

Actor EarthGolem : MagicalEnemy { 
    Health 325 
    Speed 6
    Height 56
    Radius 22
    Mass 1024
    PainChance 128
    ReactionTime 8 
    MONSTER
    SeeSound "EarthGolem/See"
    PainSound "EarthGolem/Pain"
    DeathSound "EarthGolem/Death"
    ActiveSound "EarthGolem/Act"
    HitObituary "%o became part of mother nature." 
	Species "Demon"
	DamageFactor "Demon", 0.0
	DamageFactor "DemonPoison_EarthGolem", 0.0
	DamageFactor "DemonFire", 0.0
	DamageFactor "DemonMagic", 0.0
	DamageFactor "AcidRifle", 0.0
	damagefactor "Lightning", 1.5
	damagefactor "LightningFull", 1.5
	Tag "Earth Golem"
	BloodColor "10 A5 10"
	MeleeRange 72
	MaxTargetRange 384
	+DONTHURTSPECIES
	+USEKILLSCRIPTS
    +FLOORCLIP
	+DONTBLAST
    States { 
		Spawn: 
			TNT1 A 0
			TNT1 A 0 ACS_ExecuteAlways(DND_MONSTERSCALESCRIPT, 0, DND_EARTHGOLEM, DND_DEATH | DND_SILVER_WEAKNESS)
		Idle:
		   GOL1 AB 10 A_Look
	    Loop 
		See: 
			GOL1 AABBCCDD 2 Fast A_Chase
	    Loop 
		Melee: 
			TNT1 A 0 A_PlaySound("Golem/Swing")
			GOL1 E 8 Fast A_FaceTarget
			GOL1 F 2 Fast A_FaceTarget
			TNT1 A 0 A_CustomMeleeAttack(5 * random(4, 6) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_SELF)), "Golem/Hit")
			GOL1 FG 6 Fast 
		Goto See
		Missile:
			GOl1 X 5 Fast A_FaceTarget
			TNT1 A 0 A_JumpIfCloser(76, "Melee")
			GOl1 X 5 Fast A_FaceTarget
			TNT1 A 0 A_JumpIfCloser(76, "Melee")
			GOl1 X 5 Fast A_FaceTarget
			TNT1 A 0 A_JumpIfCloser(76, "Melee")
			GOl1 X 5 Fast A_FaceTarget
			GOL1 Y 6 Fast Bright A_CustomMissile("EarthGolemShot", 32)
			TNT1 A 0 A_FaceTarget
			TNT1 A 0  A_CustomMissile("EarthGolemShot", 32, 0, 4)
			GOL1 Y 3 Fast Bright A_CustomMissile("EarthGolemShot", 32, 0, -4)
		Goto See
		Pain: 
		   GOL1 H 4 Fast
		   GOL1 H 4 Fast A_Pain
		   Goto See
		Death: 
		   GOL1 I 5
		   GOL1 J 4 A_Scream
		   GOL1 KKKK 1 A_CustomMissile("EarthGolemPieces", random(16, 32), 0, random(0, 360), CMF_TRACKOWNER | CMF_AIMDIRECTION, 5 * random(-1, 18))
		   TNT1 A 0 A_SpawnItemEx("GolemSoul", 0, 0, 10, 0, 0, 1)
		   TNT1 A 0 A_NoBlocking
		   GOL1 LLLLMMMM 1 A_CustomMissile("EarthGolemPieces", random(16, 32), 0, random(0, 360), CMF_TRACKOWNER | CMF_AIMDIRECTION, 5 * random(-1, 18))
		   GOL1 NO 4 
		   GOL1 P -1 
		   Stop
		Raise: 
		   TNT1 A 0 A_GiveInventory("Mo_Revived", 1)
		   GOL1 ONMLKJI 3
		   Goto See 
    } 
}

Actor EarthGolemShot : VulgarShot {
	Speed 18
	Damage (5 * random(2, 4) * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
	DamageType "DemonPoison_EarthGolem"
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
		SpawnLoop:
			FVUL AA 1 Bright A_SpawnItemEx("BarbTrail",0,0,0,0,0,0,0,128,0)
			TNT1 A 0 A_Weave(2.0, 0, 4.0, 0)
			FVUL AB 1 Bright A_SpawnItemEx("BarbTrail",0,0,0,0,0,0,0,128,0)
			TNT1 A 0 A_Weave(2.0, 0, 4.0, 0)
			FVUL BB 1 Bright A_SpawnItemEx("BarbTrail",0,0,0,0,0,0,0,128,0)
			TNT1 A 0 A_Weave(2.0, 0, 4.0, 0)
		loop
	}
}

Actor EarthGolemPieces {
	Damage (1 * (1.0 + ACS_NamedExecuteWithResult("DND Monster Damage Scale", DND_USETARGET)))
	DamageType "DemonPoison_EarthGolem"
	PROJECTILE
	Speed 16
	Height 8
	Radius 5
	+FORCEPAIN
	-NOGRAVITY
	States {
		Spawn:
			TNT1 A 0 NoDelay ACS_NamedExecuteAlways("DnD Pierce Check")
		SpawnLoop:
			BPBL AB 2 Bright
		Loop
		Death:
			BPBL CDEFG 2 Bright
		Stop
	}
}