actor Motherdemon 2548
{
	//$category "BD Bosses"
	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
	reactiontime 8
	speed 32
	seesound "mother/sight"
	attacksound "mother/attack"
	painsound "mother/pain"
	deathsound "mother/death"
	activesound "mother/active"
	DropItem "DemonStrengthRune", 16

	Damagefactor "Avoid", 0.0	Damagefactor "BHFTOnBarrel", 0.0	Damagefactor "Blood", 0.0
	Damagefactor "CancelTeleportFog", 0.0	Damagefactor "CauseWaterSplash", 0.0	Damagefactor "Crush", 30.0
	Damagefactor "Cut", 0.5	Damagefactor "Extremepunches", 1.0	Damagefactor "Fatality", 2.5
	Damagefactor "FriendBullet", 0.5	Damagefactor "GibRemoving", 0.0	Damagefactor "Glass", 0.0
	Damagefactor "HangingHook", 0.0	Damagefactor "Head", 1.0	Damagefactor "HeadKick", 0.5
	Damagefactor "HelperMarineFatallity", 1.0	Damagefactor "KillMe", 1.0	Damagefactor "Leg", 0.25
	Damagefactor "LowKick", 0.25	Damagefactor "MonsterKnocked", 0.5	Damagefactor "PussyGrab", 0.0
	Damagefactor "Repair", 0.0	Damagefactor "RevenantHitStomach", 0.0	Damagefactor "Saw", 0.5
	Damagefactor "Slide", 0.25	Damagefactor "SpawnMarine", 0.0	Damagefactor "Taunt", 1.0
	Damagefactor "TeleportRemover", 0.0	Damagefactor "Use", 0.0	Damagefactor "Kick", 0.5
	Damagefactor "Melee", 0.5	Damagefactor "Shrapnel", 0.5	Damagefactor "Slime", 0.5
	Damagefactor "Stealth", 0.5	Damagefactor "Stomp", 0.5	Damagefactor "Trample", 0.5
	Damagefactor "Burn", 0.5	Damagefactor "Fire", 0.5	Damagefactor "Flames", 0.5
	Damagefactor "GreenFire", 0.5	Damagefactor "HumanBBQ", 0.5	Damagefactor "Bullet", 0.5
	Damagefactor "Desintegrate", 0.5	Damagefactor "Explosive", 0.75	Damagefactor "ExplosiveImpact", 0.5
	Damagefactor "Minigun", 0.5	Damagefactor "Minor", 0.5	Damagefactor "MonsterBullet", 0.5
	Damagefactor "MonsterMinigun", 0.5	Damagefactor "MonsterShotgunBullet", 0.5	Damagefactor "Shotgun", 0.5
	Damagefactor "SSG", 0.5

	PainChance "Avoid", 0	PainChance "Burn", 16	PainChance "Cut", 16
	PainChance "ExplosiveImpact", 16	PainChance "Extremepunches", 4	PainChance "Fatality", 4
	PainChance "Fire", 16	PainChance "Flames", 16	PainChance "GreenFire", 16
	PainChance "Head", 16	PainChance "HelperMarineFatallity", 4	PainChance "HumanBBQ", 16
	PainChance "Kick", 4	PainChance "LowKick", 4	PainChance "Melee", 4
	PainChance "MonsterKnocked", 4	PainChance "Saw", 16	PainChance "Slide", 4
	PainChance "Stealth", 4	PainChance "Taunt", 255	PainChance "Trample", 4

	MONSTER
	+BOSS
	+FLOAT
	+NOGRAVITY
	+DONTMORPH
	+NORADIUSDMG
	+MISSILEMORE
	+MISSILEEVENMORE
	+FORCEXYBILLBOARD
	+NOTARGET
  states
  {
  Spawn:
    MOTH ABCD 8 A_Look
	MOTH A 0 HealThing(1)
    loop
	
  See:
	TNT1 A 0
	TNT1 A 0 ACS_ExecuteAlways(621, 0, 0, 0, 0)//Health Bar
	
  SeeContinue:	
    MOTH AABBCCDD 4 A_VileChase
	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 BRIGHT
	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,-45)
    MOTH J 0 A_CustomMissile ("MotherBall",120,51,-45)
    MOTH J 0 A_CustomMissile ("MotherBall",84,-67,45)
    MOTH J 0 A_CustomMissile ("MotherBall",120,-51,45)
	MOTH J 32 BRIGHT A_FaceTarget
    MOTH I 4 BRIGHT
    goto SeeContinue

 SuperAttack:
	TNT1 A 0
	MOTH F 4 BRIGHT A_FaceTarget
	MOTH G 0 A_CustomMissile ("SuperMotherBall",68)
	MOTH G 16 BRIGHT A_FaceTarget
	MOTH F 4 BRIGHT
	goto SeeContinue
 
  Heal:
	MOTH H 10 BRIGHT
	Goto SeeContinue
 
  Pain:
	TNT1 A 0
    MOTH K 16 A_Pain
    goto SeeContinue
 
  Death:
    MOTH K 10
    MOTH I 0 A_Scream
	MOTH L 0 A_NoBlocking
    MOTH KKKKKKKK 12 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 L 3
    MOTH L 3
    MOTH MNOPQRST 4
    MOTH T 300
    TNT1 A 0 A_BossDeath
	TNT1 A 0 A_BrainDie
	MOTH T 20
    stop
	
  Crush:
    POL5 A 0
    POL5 A 0 A_PlaySound ("Misc/Gibbed")
    POL5 A -1
    Stop
  }
}

actor MotherBall : GreenPlasmaBall
{
	Damage (random(5,40))
	+THRUGHOST
	+SEEKERMISSILE
	Scale 0.375
	States
	{
	Spawn:
	    TNT1 A 0
		TNT1 A 0 ACS_NamedExecuteAlways("BDCheckJanitor", 0, 0, 0, 0)//Check Effects
	
	Spawn1:
		SPKO A 1 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 1 BRIGHT A_SpawnItemEx("SmallFlameTrails", 0, 0, 0, 0, 0, 0, 0, 128)
		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 A_JumpIfCloser(220, "StopInAir")
		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
	
	StopInAir:
		FRPR ABCDEF 1 BRIGHT
		Stop
	}
}

Actor MotherBallDumb : MotherBall
{
	-SEEKERMISSILE
}

actor MotherFire
{
  game Doom
  height 32
  radius 16
  damage 6
  speed 40
  renderstyle Translucent
  alpha 0.75
  damagetype "Fire"
  PROJECTILE
  +RANDOMIZE
  +FLOORHUGGER
  states
  {
  Spawn:
    FIR3 AAAAAAAAAAAAAAAA 2 BRIGHT A_CustomMissile("MotherFireTrail")
    
  Death:
    stop
  }
}

actor MotherFireTrail
{
  game Doom
  RenderStyle translucent
  Alpha 0.75
  seesound "vile/firecrkl"
  +NOBLOCKMAP
  +NOGRAVITY
  +NOTELEPORT
  +CANNOTPUSH
  +FLOORHUGGER
  states
  {
  Spawn:
	TNT1 A 0
    FIR3 ABCDEFGHIJKLMNOP 2 BRIGHT A_Explode(random(6,48), 32, 0)
    Stop
  }
}

ACTOR SuperMotherBall : BelphegorGreenPlasmaBall
{
	Damage (random(10,80))
	Scale 2.0
	States
	{
	Spawn:
	    TNT1 A 0 A_SpawnItem("RedFlare22",0,0)
		FRFX B 1 BRIGHT A_SpawnItemEx("FlameTrails", 0, 0, 0, 0, 0, 0, 0, 128) 
		Loop
	
	Death:
		FRPV A 0 
		FRPV A 0 Radius_Quake (2, 54, 0, 15, 0)
		FRPV A 0 A_Explode(32, 96, 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
		TNT1 AAAA 2 A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
		Stop
	}
}