ACTOR Belphegor : BaronofHell 2544
{
	//$Category BD Monsters
	//$Icon "monster"
	//$Colour rgb(200, 0, 0)
	//$Sprite BOS3A1
    Scale 1.2
	Game Doom
    GibHealth 25
	+NOICEDEATH
    Health 2500
	Mass 2000
	SeeSound "belphegor/sight"
	PainSound "PSXDP2"
	ActiveSound "belphegor/active"
	DeathSound "belphegor/death"
	Obituary "%o was no match for the Belphegor."
	BloodType "Green_Blood", "GreenSawBlood", "GreenSawBlood"
	BloodColor "DarkGreen"
	MaxStepHeight 24
	MaxDropOffHeight 32
	Damagefactor "CallingTheBaronAFaggot", 0.0
	+MISSILEMORE
	DeathHeight 4
	BurnHeight 0
    Speed 8
	FastSpeed 12
	Species "Bruiser"
	Radius 24//62SpriteW(120%=74)
	Height 71//74SpriteH(120%=89)
	Tag "Belphegor"
	DropItem "64UnmakerUpgradeSpawner", 4
	States
	{
	Spawn:
		BOS3 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		TNT1 A 0 A_GiveInventory("TargetIsABaronOfHell")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 B 10 A_Look
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 D 10 A_Look
		Loop
	See:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Token1", 1, "See2")
		BOS3 AAAA 2 A_Chase
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 BBBB 2 A_Chase("","")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 CCCC 2 A_Chase
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 BBBB 2 A_Chase
		Loop

	See2:
		B0S3 PPP 1 A_Chase("","")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		B0S3 QQQ 1 A_Chase("","")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		B0S3 RRR 1 A_Chase
		Loop

	Pain.Taunt:
		TNT1 A 0
		TNT1 A 0 HealThing(2)
		TNT1 A 0 A_CHangeFlag("FASTER", 1)
		TNT1 A 0 A_CHangeFlag("NOPAIN", 1)
		TNT1 A 0 A_GiveInventory("Token1", 1)
		B0S3 IJKL 3
		TNT1 A 0 A_PlaySound("belphegor/sight")
		B0S3 MNONMNOMN 3
		B0S3 LKJ 3
		Goto See2
	Melee:
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
        BOS3 F 8
        TNT1 A 0 A_PlaySound("weapons/gswing")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 G 8 A_FaceTarget
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		TNT1 AA 0 A_CustomMissile("BaronAttack",16,0,0,0)
		BOS3 H 8 A_FaceTarget
		TNT1 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		Goto See

	Melee2:
		TNT1 AA 0 A_CustomMissile("BaronAttack",16,0,0,0)
		TNT1 A 0 A_PlaySound("weapons/gswing")
		BOS3 H 8 A_FaceTarget
        TNT1 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		Goto See

    Missile:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Token1", 1, "MissileAngry")
		TNT1 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 F 8 A_FaceTarget
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 G 8 A_FaceTarget
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		TNT1 A 0 A_JumpIfCloser(64, "Melee2")
		BOS3 H 8 A_CustomMissile("BelphegorGreenPlasmaBall", 47, 0, 0, 1)
		TNT1 A 0 A_CustomMissile("Alerter", 47)
		Goto See

	 MissileAngry:
		TNT1 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 G 0 A_FaceTarget
		BOS3 FFFF 1 A_Chase("","")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		BOS3 G 0 A_FaceTarget
		BOS3 GGGG 1 A_Chase("","")
		TNT1 A 0 A_SpawnItem("HeadshotTarget8b", 0, 71)
		TNT1 A 0 A_JumpIfCloser(64, "Melee2")
		BOS3 H 0 A_CustomMissile("BelphegorGreenPlasmaBall", 47, 0, 0, 1)
		TNT1 A 0 A_CustomMissile("Alerter", 47)
		BOS3 G 0 A_FaceTarget
		BOS3 HHHH 1 A_Chase("","")
		Goto See2

	Pain:
		TNT1 A 0 A_JumpIfInventory("Curbstomp_Marine", 1, "CurbstompMarine")
		TNT1 A 0 A_SpawnItem("HeadshotTarget4b", 0, 71)
		TNT1 A 0 A_JumpIfHealthLower(1000, "Pain.Taunt")
		BOS3 E 3
		TNT1 A 0 A_SpawnItem("HeadshotTarget4b", 0, 71)
		BOS3 E 3 A_Pain
		TNT1 A 0 A_Jump(32, "Pain.Taunt")
		Goto See

    Death.SSG:
	XDeath:
	Death.Railgun:
		 TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath2Green", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath3Green", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath4Green", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath5Green", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath6Green", 55, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_SpawnItem("MuchBlood2Green", 0, 55)
		 TNT1 AAAA 0 A_CustomMissile ("GreenGuts", 52, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeathHellKnightArm", 52, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeathOrgan1Green", 55, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeathOrgan2Green", 55, 0, random (0, 360), 2, random (0, 160))
		BXDE B 0 A_Scream
		BO3G ABCD 8 A_NoBlocking
		TNT1 A 0 A_SpawnItem ("GreenGrowingBloodPool")
		TNT1 A 0 A_SpawnItem ("DeadBelphegorXDeath")
		TNT1 A -1 A_BossDeath
	    Stop

	Death:
	    BOS3 I 8 A_Scream
		BOS3 J 8
		BOS3 K 8 A_NoBlocking
		BOS3 L 8
		TNT1 A 0 A_SpawnItem("DeadBelphegor")
		TNT1 A -1 A_BossDeath
	    Stop

	Death.head:
		TNT1 AAAAAA 0 A_CustomMissile ("Xdeath1", 82, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAA 0 A_CustomMissile ("Brains1", 82, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("Brains2", 82, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("Brains3", 82, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAA 0 A_CustomMissile ("Brains6", 82, 0, random (0, 360), 2, random (0, 160))
		TNT1 A 0 A_NoBlocking
		BOS3 MNOPQR 8
		BOS3 R -1 A_bossdeath
	    Stop

	Raise:
	TNT1 A 0 A_SpawnItem("PentagramSpawnerBig")
		BOS3 LKJI 8
		Goto See

	Death.Taunt:
		Goto Death

    Death.Eat:
		TNT1 A 0 A_GiveToTarget("EatMe",1)
		Goto Death+3
		Stop

   CurbstompMarine:
        TNT1 A 0 A_ChangeFlag("NOPAIN", 1)
        BS3F AB 8
	    BS3F CDEF 8
	    EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		BS3F HI 8
		BS3F J 4
		BS3F K 4
		EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		TNT1 AAAAA 0 A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		TNT1 AAA 0 A_CustomMissile ("XDeath2", 5, 0, random (0, 360), 2, random (0, 160))
		TNT1 AA 0 A_CustomMissile ("XDeath3", 5, 0, random (0, 360), 2, random (0, 160))
        TNT1 A 0 A_CustomMissile ("MuchBlood2", 50, 0, random (0, 360), 2, random (0, 160))
		TNT1 AAAA 0 A_CustomMissile ("XDeath1", 1, 0, random (0, 360), 2, random (0, 160))
        TNT1 AAAAA 0 A_CustomMissile ("PlayerFlyingBlood", 50, 0, random (0, 360), 2, random (0, 160))
		BS3F L 4
		BS3F NM 4
		BS3F N 4
	    TNT1 AAAA 0 A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		TNT1 AAAA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("Blood", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), 2, random (30, 90))
		BS3F OP 4

		BS3F NM 4
		BS3F N 4
	    TNT1 AAAA 0 A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		TNT1 AAAA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("Blood", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), 2, random (30, 90))
		BS3F OP 4

		BS3F NM 4
		BS3F N 4
	    TNT1 AAAA 0 A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		TNT1 AAAA 0 A_CustomMissile ("BloodMistBig", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("Blood", 10, 0, random (0, 360), 2, random (30, 90))
		TNT1 AAA 0 A_CustomMissile ("XDeath1", 10, 0, random (0, 360), 2, random (30, 90))
		BS3F OP 4

		TNT1 A 0 A_TakeInventory("Curbstomp_Marine")
        TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
		Goto See
	}
}

ACTOR BelphegorGreenPlasmaBall: BaronBall
{
	Radius 10
	Height 16
	Speed 20
	FastSpeed 25
	Projectile
	+RANDOMIZE
	+FORCEXYBILLBOARD
    +THRUGHOST
	+GHOST
    Damage (random(48,48))
	RenderStyle Add
	Alpha 0.9
	Scale 0.5
	SeeSound "baron/attack"
	DeathSound "FAREXPL"
	Decal "Scorch"
	Species "Bruiser"
	States
	{
	Spawn:
		PBAL CC 1 BRIGHT A_SpawnItem("GreenFlareMedium2",0,0)
		TNT1 A 0 A_CustomMissile ("GreenFlameTrails", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 2, 0, random (160, 210), 2, random (-30, 30))
		Loop

	Death:
		BFE1 A 0 Bright
		EXPL A 0 Radius_Quake (2, 35, 0, 5, 0)
		BFE1 A 0 Bright A_Explode(7,7,1)
        TNT1 AAAA 0 A_CustomMissile ("GreenExplosionFire", 2, 0, random (0, 360), 2, random (0, 360))
        EXPL A 0 A_CustomMissile ("BigNeoSmoke", 0, 0, random (0, 360), 2, random (0, 360))
		FRPG BCDEF 2 Bright A_SpawnItem("GreenFlare",0,0)
		TNT1 AAAA 2 A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		Stop
	}
}

Actor DeadBelphegor: CurbstompedMarine
{
    Radius 12
    Height 18
    Scale 1.2
    Mass 8000
    Health 100
	BloodType "Green_Blood", "GreenSawBlood", "GreenSawBlood"
	BloodColor "DarkGreen"
	States
    {
    Spawn:
		BOS3 L 1
		BOS3 L -1
        Stop

	Pain.Kick:
	Pain.ExplosiveImpact:
		TNT1 A 0
		TNT1 A 0 ThrustThingZ(0,25,0,1)
		TNT1 A 0 A_Jump(256, "Spawn")
		Goto Death

	Pain.Trample:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("floorslimy")
		TNT1 A 0 ThrustThingZ(0,25,1,1)
		TNT1 A 0 A_Jump(256, "Spawn")
		Goto Death

	Raise:
	TNT1 A 0 A_SpawnItem("PentagramSpawnerBig")
		BOS3 LKJI 8
		TNT1 A 0 A_NoBlocking
        TNT1 A 0 A_SpawnItemEx("Belphegor",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		Stop
    Death:
		 TNT1 A 0
	     TNT1 A 0 A_NoBlocking
		 TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath4Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath5Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath6Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AAA 0 A_SpawnItem("MuchBlood2Green", 0, 25)
		 TNT1 A 0 A_SpawnItem("MuchBlood3Green", 0, 25)
		 TNT1 AAAA 0 A_CustomMissile ("GreenGuts", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("XDeathHellKnightArm", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeathOrgan1Green", 15, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeathOrgan2Green", 15, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_SpawnItem("DeadBelphegorXDeath")
		 Stop
    Death.Plasma: Death.Plasma2:
    Death.Flames:
    Death.Burn:
        TNT1 A 0
        TNT1 A 0 A_Scream
        TNT1 A 0 A_NoBlocking
		EXPL AAAAA 0 A_CustomMissile ("ExplosionSmoke", 32, 0, random (0, 360), 2, random (0, 360))
        BOSB ABCDE 9 A_CustomMissile ("PlasmaSmoke", 24, 0, random (0, 180), 2, random (0, 180))
        BOSB EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE 8 A_CustomMissile ("PlasmaSmoke", 16, 0, random (0, 180), 2, random (0, 180))
        BOSB E -1
        Stop

	Death.Desintegrate:
	Death.CrushedBodies:
		 TNT1 A 0 A_SetAngle(0)
		 TNT1 A 0 bright A_CustomMissile ("GreenSuperGoreSpawner", 1, -40, random (0, 360), 2, random (25, 45))
		 TNT1 A 0 bright A_CustomMissile ("GreenSuperGoreSpawner", 1, 40, random (0, 360), 2, random (25, 45))
		 TNT1 A 0 A_CustomMissile ("XDeath1Green", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath2bGreen", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath3bGreen", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("GreenBloodMistBig", 1, -40, random (0, 360), 2, random (30, 90))
		 TNT1 AA 0 A_CustomMissile ("GreenBloodMistBig", 1, 40, random (0, 360), 2, random (30, 90))
		 TNT1 A 0 A_SetAngle(90)
		 TNT1 A 0 bright A_CustomMissile ("GreenSuperGoreSpawner", 1, -40, random (0, 360), 2, random (25, 45))
		 TNT1 A 0 bright A_CustomMissile ("GreenSuperGoreSpawner", 1, 40, random (0, 360), 2, random (25, 45))
		 TNT1 A 0 A_CustomMissile ("XDeath1Green", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath2bGreen", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeath3bGreen", 1, random (-30, 30), random (0, 360), 2, random (0, 160))
		 TNT1 AA 0 A_CustomMissile ("GreenBloodMistBig", 1, -40, random (0, 360), 2, random (30, 90))
		 TNT1 AA 0 A_CustomMissile ("GreenBloodMistBig", 1, 40, random (0, 360), 2, random (30, 90))
		 TNT1 A 0 A_NoBlocking
		 GIBS Y 1
		 GIBS Y -1
		Stop
	}
}

Actor DeadBelphegorXDeath: DeadBelphegor
{
	Health 100
	States
    {
    Spawn:

		BO3G E 1
		BO3G E -1
        Stop
	Raise:
	TNT1 A 0 A_SpawnItem("PentagramSpawnerBig")
		BOS3 LKJI 8
		TNT1 A 0 A_NoBlocking
        TNT1 A 0 A_SpawnItemEx("Belphegor",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
		Stop
    Death:
		 TNT1 A 0
	     TNT1 A 0 A_NoBlocking
		 TNT1 AA 0 A_CustomMissile ("XDeath2bGreen", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath3bGreen", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath4Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath5Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AA 0 A_CustomMissile ("XDeath6Green", 25, 0, random (0, 360), 2, random (20, 90))
		 TNT1 AAA 0 A_SpawnItem("MuchBlood2Green", 0, 25)
		 TNT1 A 0 A_SpawnItem("MuchBlood3Green", 0, 25)
		 Stop
	}
}

Actor FatalizedBelphegor: DeadBelphegor
{
States
    {
    Spawn:
		TNT1 AAAAAA 0 A_CustomMissile ("GreenBloodMistBig", 50, 0, random (0, 360), 2, random (0, 160))
		BS4F JK 7
		TNT1 AAAAAAAAAA 0 A_CustomMissile ("MuchBloodGreen", 50, 0, random (0, 360), 2, random (0, 160))
		BS4F L -1
        Stop
    }
}