Actor SuperDemon 31269
{
	Obituary "%o was crushed by a SuperDemon."
	Health 3500
	Radius 40
	Height 110
	Mass 1000
	Speed 15
	seesound "cyber/sight"
	painsound "cyber/pain"
	deathsound "superdemon/death"
	activesound "cyber/active"
	MONSTER
	+BOSS
	+FLOORCLIP
	+NORADIUSDMG
	+DONTMORPH
	+MISSILEMORE
	+NOICEDEATH
	+DONTRIP
	+DONTHURTSPECIES
	+DONTHARMSPECIES
	Species "CyberDemon"
	damagefactor "Explosive", 1.1
    damagefactor "HKFT", 0.05
	damagefactor "HKFT", 0.05
	damagefactor "Decaptate", 5.0
	damagefactor "Avoid", 0.0
	damagefactor "killme", 0.0
	damagefactor "GibRemoving", 0.0
	damagefactor "TeleportRemover", 0.0
	DamageFactor "CauseObjectsToSplash", 0.0
	DamageFactor "Blackhole", 0.75
	damagefactor "Crush", 20.0
	damagefactor "Blood", 0.0 
	damagefactor "BlueBlood", 0.0 
	damagefactor "GreenBlood", 0.0
	MaxStepHeight 24
	MaxDropOffHeight 32
	PainChance 20
	PainChance "KillMe", 64
	PainChance "Taunt", 255
	BloodType "CyberDemon_Blood", "SawBlood", "SawBlood"
	DropItem "DemonStrengthRune" 25
	Tag "Super Demon"
	States
	{
		Death.KillMe:
			Death.Taunt:
				TNT1 A 0 A_ChangeFlag("SOLID", 0)
				TNT1 A 0 A_SpawnItem("SuperDemon")
				Stop
				
		Pain:
    			SUPR G 10 A_Pain
    			goto See

		Pain.KillMe:
			TNT1 A 0
			Goto See
			
		ReplaceVanilla:
			TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
			TNT1 A 0 A_ChangeFlag("COUNTKILL", 0)
			TNT1 A 0 A_SpawnItemEx ("Vanilla_SuperDemon",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION |SXF_TRANSFERSPECIAL| SXF_TRANSFERAMBUSHFLAG ,0)
			Stop
			
		Spawn:
			TNT1 A 0 ACS_ExecuteAlways(796, 0, 0, 0, 0)//Check if Vanilla Mode is activated
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			TNT1 A 0 A_GiveInventory("TargetIsACyberdemon")
			SUPR C 10 A_Look
		Stand:
			SUPR A 10 A_Look
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR B 10 A_Look
			Loop
			
		See:
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			TNT1 A 0 A_SpawnItem("HeavyFootSteps32")
			SUPR A 3 A_PlaySound("monster/anhoof",5)
			SUPR A 3
			//TNT1 A 0 A_JumpIfCloser(120, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR AA 2 A_Chase
			//TNT1 A 0 A_JumpIfCloser(120, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR BB 2 A_Chase
			TNT1 A 0 A_SpawnItem("HeavyFootSteps32")
			//TNT1 A 0A_JumpIfCloser(120, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR C 2 A_Chase
			SUPR C 2
			SUPR C 2 A_PlaySound("Cyber/Metal", 6)
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR D 2 A_Chase
			SUPR D 2 A_Chase
			//TNT1 A 0A_JumpIfCloser (120, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox",0, 100,0)
			SUPR DD 2 A_Chase
			Loop
			
		Missile:
			//TNT1 A 0 A_JumpIfCloser(180, "Stomp")
			//TNT1 A 0 A_JumpIfInventory("Enraged", 1, "SpecialAttack")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR E 8 A_FaceTarget
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100)
			SUPR F 6 BRIGHT A_CustomMissile("SuperDemonBall", 54, -45, 0)
			//TNT1 A 0 A_JumpIfCloser(180, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR E 6 A_FaceTarget
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR F 6 BRIGHT A_CustomMissile("SuperDemonBall", 54, -45, 0)
			//TNT1 A 0 A_JumpIfCloser(180, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR E 6 A_FaceTarget
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR F 6 BRIGHT A_CustomMissile("SuperDemonBall", 54, -45, 0)
			//TNT1 A 0 A_JumpIfCloser(180, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR E 6 A_FaceTarget
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR F 6 BRIGHT A_CustomMissile("SuperDemonBall", 54, -45, 0)
			//TNT1 A 0 A_JumpIfCloser(180, "Stomp")
			TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
			SUPR E 6 A_FaceTarget
			Goto See
			
		Death:
			SUPR H 3 A_PlaySound ("SuperDemon/Snarl")
			SUPR H 3 A_CustomMissile("Brutal_FlyingBlood", 0, 0, random (-80, -100), 2, random(45, 80))
			SUPR I 3 A_Scream
			SUPR I 3 A_CustomMissile("Brutal_FlyingBlood", 0, 0, random (-80, -100), 2, random(45, 80))
			SUPR J 2 A_CustomMissile("SuperDemonArm", 45, -50, -50)
			SUPR KL 4 A_CustomMissile("Brutal_FlyingBlood", 0, 0, random (-80, -100), 2, random(45, 80))
			SUPR M 6 A_PlaySound("Superdemon/Crash")
			SUPR N 6 A_CustomMissile("Brutal_FlyingBlood", 0, 0, random (-80, -100), 2, random(45, 80))
			SUPR O 6 A_CustomMissile("Brutal_FlyingBlood", 0, 0, random (-80, -100), 2, random(45, 80))
			TNT1 A 0 A_NoBlocking
			SUPR O -1 A_BossDeath
	}
}

ACTOR SuperDemonArm
{
   Radius 10
   Height 8
   Speed 1
   Damage 1
   Scale 1
   PROJECTILE
   -NOGRAVITY
   +LOWGRAVITY
   States
   {
	Spawn:
		TNT1 A 0 A_SpawnItem("Brutal_BloodSpot",0,0,0,1)
		TNT1 A 0 A_JumpIf(waterlevel > 1, "Death")
		SUPH ABC 5 A_CustomMissile("Brutal_FlyingBloodTrail5",0,0,random(-80,-100),2,random(45,80))
		Goto Death
	Death:
		SUPH D 5 
		SUPH E -1
		Stop
   }
}

actor SuperDemonBall
{
  TRANSLATION 2
  spawnid 154
  radius 6
  height 16
  speed 16
  damage 15
  scale 1.5
  Bouncefactor 0.6
  BounceCount 5
  renderstyle Add
  seesound "baron/attack"
  deathsound "baron/shotx"
  PROJECTILE
  +RANDOMIZE
  states
  {
  Spawn:
    BAL9 AB 1 bright
    loop
  Death:
    BAL9 CDE 6 bright
    stop
  }
}

/////////////////////Vanilla/////////////////////////

Actor Vanilla_SuperDemon : SuperDemon
{
	States
	{
		Spawn:
		TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
		TNT1 A 0 A_GiveInventory("TargetIsACyberdemon")
        CYBR A 10 A_Look
		TNT1 A 0 A_SpawnItem("CybersHitBox", 0, 100,0)
        CYBR B 10 A_Look
        Loop
	}
}