actor Motherdemon 2548
{
	//$Category BD Bosses
	//$Icon "monster"
	//$Colour rgb(200, 0, 0)
	//$Sprite MOTHA1
	game Doom
	obituary "%o was obliterated by the mother of all demons."
	health 10000
	radius 60//110px
	height 110//100px
	mass 1000
	scale 1.1
	painchance 20
	speed 16
	seesound "mother/sight"
	attacksound "mother/attack"
	painsound "mother/pain"
	deathsound "mother/death"
	activesound "mother/active"
	DropItem "64UnmakerUpgradeSpawner", 32

	Damagefactor "Avoid", 0.0	Damagefactor "BHFTOnBarrel", 0.0	Damagefactor "Blood", 0.0
	Damagefactor "CancelTeleportFog", 0.0	Damagefactor "CauseWaterSplash", 0.0	DamageFactor "Crush", 10.0
	Damagefactor "GibRemoving", 0.0	Damagefactor "HangingHook", 0.0
	Damagefactor "Head", 1.5	Damagefactor "PussyGrab", 0.0	Damagefactor "Repair", 0.0
	Damagefactor "RevenantHitStomach", 0.0	Damagefactor "SpawnMarine", 0.0	Damagefactor "Stealth", 0.0
	Damagefactor "TeleportRemover", 0.0	Damagefactor "Use", 0.0	Damagefactor "ExtremePunches", 2.5
	Damagefactor "Fatality", 2.5	Damagefactor "HeadKick", 0.5	Damagefactor "HelperMarineFatallity", 2.5
	Damagefactor "Kick", 0.5	Damagefactor "Slide", 0.5
	Damagefactor "Melee", 0.5	Damagefactor "MonsterKnocked", 0.5	Damagefactor "Stomp", 0.5
	Damagefactor "Trample", 0.5	Damagefactor "Slide", 0.5	DamageFactor "TankWeakSpot", 0.0
	Damagefactor "Burn", 0.5	Damagefactor "Fire", 0.5	Damagefactor "Flames", 0.5
	Damagefactor "GreenFire", 0.5	Damagefactor "HumanBBQ", 0.5

	PainChance "Head", 16	PainChance "Taunt", 255	PainChance "Extremepunches", 4
	PainChance "Fatality", 4	PainChance "HelperMarineFatallity", 4	PainChance "Kick", 4
	PainChance "LowKick", 4	PainChance "Melee", 4	PainChance "MonsterKnocked", 4
	PainChance "Slide", 4	PainChance "Trample", 4
	PainChance "Burn", 4	PainChance "Fire", 4	PainChance "Flames", 4
	PainChance "GreenFire", 4	PainChance "HumanBBQ", 4

	MONSTER
	+FLOAT
	+NOGRAVITY
	+BOSS
	+FLOORCLIP
    +DONTRIP
	+DONTMORPH
	+BOSSDEATH
    +NORADIUSDMG
	+MISSILEMORE
	+MISSILEEVENMORE
  states
  {
  Spawn:
	MOTH A 0 A_GiveInventory("TargetIsAMastermind")
  Idle:
    MOTH ABCD 8 A_Look
	MOTH A 0 HealThing(1)
    loop

  See:
	MOTH A 0
	MOTH A 0 ACS_NamedExecuteAlways("BDBossHealth", 0, 0, 0, 0)//Health Bar

  SeeContinue:
    MOTH AABBCCDD 4 A_VileChase
	MOTH A 0 A_Stop
	MOTH A 0 HealThing(1)
    loop

  Missile:
	TNT1 A 0 A_Stop
    MOTH E 4 A_FaceTarget
	TNT1 A 0 A_Jump(96, "SuperAttack")
	MOTH I 4
	MOTH J 0 A_CustomMissile ("MotherFire",4,0,0)
    MOTH J 0 A_CustomMissile ("MotherFire",4,0,30)
    MOTH J 0 A_CustomMissile ("MotherFire",4,0,-30)
    MOTH J 0 A_CustomMissile ("MotherFire",4,0,60)
    MOTH J 0 A_CustomMissile ("MotherFire",4,0,-60)
    MOTH J 0 A_CustomMissile ("MotherBall",84,67,-15)
    MOTH J 0 A_CustomMissile ("MotherBall",120,51,-15)
    MOTH J 0 A_CustomMissile ("MotherBall",84,-67,15)
    MOTH J 0 A_CustomMissile ("MotherBall",120,-51,15)
	MOTH J 32 A_FaceTarget
    MOTH I 4
    goto SeeContinue

 SuperAttack:
	TNT1 A 0
	MOTH F 4 A_FaceTarget
	MOTH G 0 A_CustomMissile ("SuperMotherBall",68)
	TNT1 A 0 A_CustomMissile("Alerter",68)
	MOTH G 16 A_FaceTarget
	MOTH F 4
	goto SeeContinue

  Heal:
	MOTH I 10
	Goto SeeContinue

  Pain:
	TNT1 A 0
    MOTH K 16 A_Pain
    goto SeeContinue

  Death:
    MOTH K 8
    MOTH K 0 A_Scream
	MOTH K 0 A_NoBlocking
    MOTH KLMNO 8 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))

	TNT1 AA 0 A_CustomMissile ("XDeath1", 32, 0, random (0, 360), 2, random (0, 90))
	TNT1 AA 0 A_CustomMissile ("XDeath2", 32, 0, random (0, 360), 2, random (0, 90))
	TNT1 AA 0 A_CustomMissile ("XDeath3", 32, 0, random (0, 360), 2, random (0, 90))

	TNT1 AAAA 0 A_CustomMissile ("ExplosionSpawner", random (50, 90), 0, random (0, 360), 2, random (0, 90))
	TNT1 AAAAAA 0 A_CustomMissile ("Bloodmist", 35, 0, random (0, 360), 2, random (0, 90))
	TNT1 AAAAAAAAAAAAAAA 0 A_CustomMissile ("BloodmistExtraBig", 15, 0, random (0, 360), 2, random (10, 90))

    MOTH PQRST 8
    MOTH T 105
	MOTH T -1 A_BossDeath
    stop

  Crush:
    POL5 A 0
    POL5 A 0 A_PlaySound ("Misc/Gibbed")
    POL5 A -1 A_BossDeath
    Stop
  }
}

actor MotherBall : GreenPlasmaBall
{
	Damage (random(16,16))
	+THRUGHOST
	+SEEKERMISSILE
	Scale 0.375
	Speed 15
	Damagetype "Fire"
	States
	{
	Spawn:
	    TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
		SPKO A 4 BRIGHT
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "SpawnCheap")

	Spawn1:
		SPKO A 4 BRIGHT A_SpawnItemEx("SmallFlameTrails", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 2, 0, random (160, 210), 2, random (-30, 30))
		TNT1 A 0 A_SeekerMissile (2,4, SMF_LOOK)
		Loop

	SpawnCheap:
	    SPKO A 4 BRIGHT
		TNT1 A 0 A_SeekerMissile (2,4, SMF_LOOK)
		Loop

	Death:
		TNT1 A 0 A_SpawnItemEx("SparkX", 0, 0, 0, 0, 0, 0, 0, 128)
	    TNT1 A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	    TNT1 A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
		TNT1 AA 0 A_SpawnItem("RedFlare",0,0)
		TNT1 A 0 A_SetScale(0.7)
		TNT1 A 0 A_FadeOut(0.2)
		FRPR ABCDEFGH 2 BRIGHT
		Stop

	XDeath:
        TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("SparkX", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 AA 0 A_SpawnItem("RedFlare",0,0)
	    TNT1 A 0 A_SetScale(0.7)
		TNT1 A 0 A_FadeOut(0.2)
		FRPR ABCDEFGH 2 BRIGHT
		Stop
	}
}

actor MotherBallDumb : MotherBall
{
	Damage (random(16,16))
	+THRUGHOST
	-SEEKERMISSILE
	Scale 0.375
	Speed 15
	FastSpeed 30
	States
	{
	Spawn:
	    TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
		SPDO A 4 BRIGHT
		TNT1 A 0 A_JumpIfInventory("lowgraphicsmode", 1, "SpawnCheap")

	Spawn1:
		SPKO A 4 BRIGHT A_SpawnItemEx("SmallFlameTrails", 0, 0, 0, 0, 0, 0, 0, 128)
		TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrailDarker", 2, 0, random (160, 210), 2, random (-30, 30))
		Loop

	SpawnCheap:
	    SPKO A 4 BRIGHT
		Loop
	}
}

actor MotherFire
{
  game Doom
  height 32
  radius 16
  damage (random(8,8))
  speed 30
  renderstyle Add
  alpha 0.5
  Scale 1.0
  damagetype "Fire"
  PROJECTILE
  +RANDOMIZE
  +FLOORHUGGER
  states
  {
  Spawn:
    F1RE ABCDEFGH 2 BRIGHT A_CustomMissile("MotherFireTrail")
	F2RE ABCDEFGH 2 BRIGHT A_CustomMissile("MotherFireTrail")

  Death:
    stop
  }
}

actor MotherFireTrail
{
  game Doom
  RenderStyle Add
  Alpha 0.5
  seesound "vile/firecrkl"
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  +CANNOTPUSH
  +FLOORHUGGER
  states
  {
  Spawn:
	TNT1 A 0
	F1RE A 2 BRIGHT A_SetScale(0.95)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
    F1RE B 2 BRIGHT A_SetScale(0.9)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE C 2 BRIGHT A_SetScale(0.85)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE D 2 BRIGHT A_SetScale(0.8)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE E 2 BRIGHT A_SetScale(0.75)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE F 2 BRIGHT A_SetScale(0.7)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE G 2 BRIGHT A_SetScale(0.65)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F1RE H 2 BRIGHT A_SetScale(0.6)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE A 2 BRIGHT A_SetScale(0.55)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
    F2RE B 2 BRIGHT A_SetScale(0.5)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE C 2 BRIGHT A_SetScale(0.45)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE D 2 BRIGHT A_SetScale(0.4)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE E 2 BRIGHT A_SetScale(0.35)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE F 2 BRIGHT A_SetScale(0.3)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE G 2 BRIGHT A_SetScale(0.25)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
	F2RE H 2 BRIGHT A_SetScale(0.20)
	TNT1 A 0 A_Explode(random(6,48), 32, 0)
    Stop
  }
}

ACTOR SuperMotherBall : BelphegorGreenPlasmaBall
{
	Scale 3.0
	Damagetype "Fire"
	States
	{
	Spawn:
		FRFX AB 1 BRIGHT A_SpawnItem("RedFlare2",0,0)
		TNT1 A 0 A_SpawnItemEx("FlameTrails", 0, 0, 0, 0, 0, 0, 0, 128)
		Loop

	Death:
		FRPV A 0
		FRPV A 0 Radius_Quake (2, 35, 0, 5, 0)
		FRPV A 0 A_Explode(7, 7, 1)
        TNT1 AAAA 0 A_CustomMissile ("ExplosionFlames", 2, 0, random (0, 360), 2, random (0, 360))
        FRPV A 0 A_CustomMissile ("BigNeoSmoke", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 0, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 45, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 90, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 135, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 180, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 225, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 270, CMF_AIMDIRECTION, random(0,15))
		TNT1 A 0 A_CustomMissile("MotherBallDumb", 8, 0, 315, CMF_AIMDIRECTION, random(0,15))
		FRFX CDEFGHIJKLMNOP 2 Bright A_SpawnItem("RedFlare",0,0)
		TNT1 AAAA 2 A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		Stop
	}
}