//===========================================================================
//
// Cacodemon
//
//===========================================================================
ACTOR InfernalCacodemon replaces Cacodemon
{
	//$Title Infernal Cacodemon
	//$Category Project Brutality - Monsters/Flyers
	//$Sprite INFRA1
	Tag "Infernal Cacodemon"
	Game Doom
	BloodType "Brutal_Blood"
	SpawnID 19
	Health 280
        GibHealth 25
        DamageFactor "Crush", 10.0
	DamageFactor "SSG", 10.0
	DamageFactor "Saw", 0.3
	Radius 31
	Height 56
	Mass 400
	Speed 10
	Health 425
	PainChance 128
	PainChance "Kick", 255
	PainChance "Avoid", 190
	PainChance "Saw", 255
	PainChance "Stun", 255
	PainChance "Siphon", 255
	Monster
	Scale 0.9
	+FLOAT +NOGRAVITY
	SeeSound "monster/infsit"
	PainSound "monster/infpai"
	DeathSound "monster/infact"
	ActiveSound ""
	Obituary "%o was deep fried by an Infernal Cacodemon."
	DropItem "DemonStrengthRune" 5
	DropItem "DemonStrengthRune" 3
	DropItem "HasteSphere" 4
	DropItem "DoubleSphere" 2
	DamageFactor "Blood", 0.0 DamageFactor "BlueBlood", 0.0 DamageFactor "GreenBlood", 0.0
	damagefactor "killme", 0.0
	
	DropItem "Demonpickup2" 65
	DropItem "Demonpickup" 255
	
	Species "FlyingBalls"	
	+FIRERESIST
	+DONTHURTSPECIES
	+DONTHARMSPECIES
	
	States 
	   { 
	   
	   Death.Blackhole:
        TNT1 A 0 A_NoBlocking
        TNT1 A 0 A_SpawnItem("BlackHoledMagcaco")
		Stop
	   
	   Death.Fatality:
		TNT1 A 0 A_Pain
		TNT1 A 0 A_JumpIfIntargetInventory("FistsSelected", 1, 1)
		Goto Death
        TNT1 A 0 A_NoBlocking
		TNT1 A 0 A_GiveToTarget("GoFatality", 1)
        TNT1 A 0 A_GiveToTarget("MagCacoFatality", 1)
        Stop
	   
	   ReplaceVanilla:
		TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
		TNT1 A 0 A_ChangeFlag("COUNTKILL", 0)
		TNT1 A 0 A_SpawnItemEx ("Vanilla_MagCaco",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION |SXF_TRANSFERSPECIAL| SXF_TRANSFERAMBUSHFLAG ,0)
		Stop
	   
	   Spawn: 
		   TNT1 AA 0
		   INFR A 8 Bright A_Look 
		   Goto Spawn+2 
	   See: 
		   INFR BCD 2 Bright A_Chase 
		   Loop 
	   Missile:
		   TNT1 A 0 A_JumpIfCloser(192, "Torch")
		   TNT1 A 0 A_Jump(50, "WatcherComets")
		   TNT1 A 0 A_Jump(256, "Fireballs")
	   Fireballs:
			TNT1 A 0 A_JumpIf(waterlevel > 2, "See")
		   INFR HI 4 Bright A_FaceTarget
		   INFR J 0 Bright A_CustomMissile ("FireShot",24,0,0,0,0)
		   INFR J 4 BRIGHT
		   Goto See
	   WatcherComets:
			INFR HI 4 Bright A_FaceTarget 
		   INFR J 0 Bright A_CustomMissile ("WatcherSummonComet",24,0,0,0,0)
		   INFR J 4 BRIGHT
			Goto See
		Torch:
		   INFR HI 4 Bright A_FaceTarget 
			TNT1 A 0 A_PlaySound("flamersh",2)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 2 BRIGHT
		   INFR I 2 BRIGHT
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 2 BRIGHT
		   INFR I 2 BRIGHT
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 1 BRIGHT A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   TNT1 A 0 A_CustomMissile("FlamethrowerMissileFatso",30,0,0,0)
		   INFR J 2 BRIGHT
		   INFR I 2 BRIGHT
		   Goto See
		
	     
	   Melee:	
	    TNT1 A 0 A_PlaySound("monster/ovlbit")
		INFR AFG 5 A_Facetarget
		TNT1 A 0 A_CustomMissile("MagCacodemonBite", 42, 0, 0, 0)
		INFR E 4
		Goto See
		   
	   Pain: 
		   INFR K 3 Bright A_Pain 
		   INFR K 3 Bright
		   Goto See 
		   
	Possession:
		TNT1 A 0 A_SetInvulnerable
		INFR K 3
		INFR K 3 A_Pain
		"####" "#" 35 ACS_NamedExecuteAlways("Pos - Flicker effect")
		TNT1 A 0 A_UnSetInvulnerable
		Goto See
		
	Pain.Stun:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx ("StunElectrocute", random (-4, 4), random (-4, 4),  random (16, 32), 0, 0)
		INFR K 1 A_Pain
		INFR KKKKKKKKKK 3 A_SpawnItemEx ("StunElectrocute", random (-12, 12), random (-12, 12),  random (16, 52), 0, 0)
		INFR K 1 A_Pain
		INFR KKKKKKKKKK 3 A_SpawnItemEx ("StunElectrocute", random (-12, 12), random (-12, 12),  random (16, 52), 0, 0)
		INFR K 1 A_Pain
		INFR KKKKKKKKKK 3 A_SpawnItemEx ("StunElectrocute", random (-12, 12), random (-12, 12),  random (16, 52), 0, 0)
		INFR K 1 A_Pain
		INFR KKKKKKKKKK 3 A_SpawnItemEx ("StunElectrocute", random (-12, 12), random (-12, 12),  random (16, 52), 0, 0)
		INFR K 1 A_Pain
		INFR KKKKKKKKKK 3 A_SpawnItemEx ("StunElectrocute", random (-12, 12), random (-12, 12),  random (16, 52), 0, 0)
		INFR K 1 A_Pain
		Goto See
		
	Pain.Siphon:
		
		TNT1 AAA 0 A_SpawnItemEx ("RedLightning_Small", random (-12, 12), random (-12, 12), random (16, 52), 0, 0)
			INFR K 1 A_FaceTarget
			INFR K 1 A_GiveToTarget("HealthBonus",4)
		INFR K 5 A_FaceTarget 
		TNT1 A 0 A_Pain
		Goto See
		   
	   Pain.Kick:
        TNT1 A 0 A_FaceTarget
		INFR K 6 A_Recoil(5)
		INFR K 6 A_Pain
		INFR K 10
		Goto See
		   
	   Death: 
		   INFR L 4 Bright 
		   INFR M 3 Bright A_Scream
		   INFR N 3 Bright
		   TNT1 A 0 A_Explode (20,100)
	TNT1 AAAAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
         TNT1 AAAAAAAAA 0 A_CustomMissile ("CeilBloodLauncherLong", 0, 0, random (0, 360), 2, random (50, 130))
		 TNT1 A 0 A_CustomMissile ("XDeathBrain1", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("XDeathBrain2", 32, 0, random (0, 360), 2, random (0, 160))
        TNT1 AAAAAAAA 0 A_CustomMissile ("PEPart1", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("WatcherSummonComet", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 A 0 A_CustomMissile ("WatcherSummonComet", 32, 0, random (0, 360), 2, random (0, 160))
        TNT1 AAAA 0 A_CustomMissile ("PEPart2", 32, 0, random (0, 360), 2, random (0, 160))
		 TNT1 AAAAAAAA 0 A_CustomMissile ("Brutal_FlyingBlood", 32, 0, random (0, 360), 2, random (0, 160))
		EXPL A 0 A_SpawnItemEx("ExplosionParticleSpawner", 0, 0, 0, 0, 0, 0, 0, 128)
	EXPL AAAAAAAAAAAAAAAAA 0 A_CustomMissile ("FireBallExplosion", 6, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 BRIGHT A_NoBlocking
		TNT1 AA 0 A_CustomMissile ("FireballExplosionFlamesBig", 32, 0, random (0, 360), 2, random (0, 360))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 4 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 6 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 6 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 6 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 6 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 A 0 A_CustomMissile ("ExplosionSmoke", 1, 0, random (0, 360), 2, random (70, 110))
		TNT1 AAA 6 A_CustomMissile ("RealFlameTrailsSmallLong", 1, 0, random (0, 360), 2, random (70, 110))
		Stop
		
		Death.IceBeam:
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	TNT1 A 0 A_ChangeFlag("SOLID", 0)
	TNT1 A 0 A_SpawnItemEx("FrozenMagCaco", 0, 0, 0, 0, 0, 0, random(1,360), SXF_NOCHECKPOSITION)
	TNT1 A 0 A_SpawnItem("IceCrystalGround")
	TNT1 A 0 A_SpawnItem("IceCrystalGround")
	TNT1 A 0 A_SpawnItem("IceCrystalGround")
	Stop

Death.Ice:
	Death.Freeze:
	Death.Frost:
	TNT1 A 0 A_ChangeFlag("SHOOTABLE", 0)
	TNT1 A 0 A_ChangeFlag("SOLID", 0)
	TNT1 A 0 A_SpawnItemEx("FrozenMagCaco", 0, 0, 0, 0, 0, 0, random(1,360), SXF_NOCHECKPOSITION)
	Stop
	   } 
}

Actor FatalizedMagCacoDemon: DeadCacoDemon1
{Health 200 States{Spawn:
        IN1F J -1
        Stop    
       Death.Cut:  Death.Cutless: Death.Plasma:  Death.Plasma2:   Death: 
	    TNT1 AAAA 0 bright A_CustomMissile ("SuperGoreSpawner", 5, 0, random (0, 360), 2, random (30, 180))
		TNT1 AAAA 0 A_CustomMissile ("PEPart2", 0, 0, random (0, 360), 2, random (0, 160))
		Stop}}
		
ACTOR MagCacodemonBite: ImpAttack
{
    +THRUGHOST
	DamageType Eat
    Damage 10
}

Actor FireShot
{
  Radius 3
  Height 3
  Speed 18
  Damage 3
  Projectile
  RenderStyle Add
  Alpha 0.72
  Scale 0.32
  DamageType Fire
  SeeSound "heavyfireball/throw"
  DeathSound "heavyfireball/explode"
  Decal RevenantScorch
  +DONTSPLASH
  States
  {
  Spawn:
	TNT1 A 0 A_Playsound("DarkImpFireLoop", 1, 1)
	Fly:
	TNT1 A 0 A_SpawnItem("FireballFlare",0,0)
    FSHT AB 1 Bright A_SpawnItemEx("FireTail",0,0,0,0,0,0,0,128)
	TNT1 A 0 A_JumpIf(waterlevel > 0, "Disappear")
	TNT1 A 0 A_SpawnItemEx("OrangeLensFlareAlt",0,0,0,0,0,0,0,128)
	TNT1 A 0 A_CustomMissile("ExplosionParticleVerySlow", 0, 0, random (0, 360), 2, random (50, 130))
	TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (160, 210), 2, random (-30, 30))
	TNT1 A 0 A_SpawnItem ("CoolAndNewFlameTrails")
    FSHT CD 1 Bright A_SpawnItemEx("FireTail",0,0,0,0,0,0,0,128)
	TNT1 A 0 A_JumpIf(waterlevel > 0, "Disappear")
	TNT1 A 0 A_SpawnItem("FireballFlare",0,0)
	TNT1 A 0 A_CustomMissile("ExplosionParticleVerySlow", 0, 0, random (0, 360), 2, random (50, 130))
	TNT1 A 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (160, 210), 2, random (-30, 30))
	TNT1 A 0 A_SpawnItem ("CoolAndNewFlameTrails")
    Loop
  Death:
	TNT1 A 0 A_StopSound(1)
    FSHT A 0 Bright A_Explode(15, 60)
	TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
	TNT1 AAAA 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	FRFX ZZZ 0 BRIGHT A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
	EXPL AAAAAA 0 A_CustomMissile ("FireBallExplosionFlames", 1, 0, random (0, 360), 2, random (0, 360))
	TNT1 A 0 A_Jump(118, 2)
	TNT1 A 0 A_SpawnItemEx("DragonsBreathPiece1", random (-15, 15), random (-15, 15))
	TNT1 A 0 A_SpawnItemEx("DragonsBreathPiece2", random (-35, 35), random (-35, 35))
	TNT1 A 0 A_SpawnItemEx("DragonsBreathPiece3", random (-45, 45), random (-45, 35))
	TNT1 AAAAAAAAAA 0 A_CustomMissile ("ExplosionParticleHeavy", 0, 0, random (0, 180), 2, random (0, 180))
	TNT1 AAAAAAA 19 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
    Stop
	Disappear:
	TNT1 A 1
	STOP
  }
}

Actor FireTail
{
  Projectile
  RenderStyle Add
  +NoClip
  Alpha 0.4
  States
  {
  Spawn:
    FRTB ABCDEFGHI 1 Bright
    Stop
  }
}

Actor EscapeExplosion 
{
  SeeSound "pyro/explosion"
  Radius 8
  Height 56
  Speed 0
  States
  {
  Spawn:
    NKXP B 1 Bright A_CustomMissile ("FireballExplosionFlamesBig", 10, 0, random (0, 360), 2, random (0, 360))
    NKXP C 1 Bright A_CustomMissile ("FireballExplosionFlamesBig", 25, 0, random (0, 360), 2, random (0, 360))
	TNT1 A 0 A_CustomMissile ("FireballExplosionFlamesBig", 35, 0, random (0, 360), 2, random (0, 360))
    NKXP D 1 Bright A_Explode(20, 128)
	TNT1 AAAAAA 0 A_CustomMissile ("FireballExplosionFlamesBig", 45, 0, random (0, 360), 2, random (0, 360))
    NKXP EFGHIJKLMNOPQRSTUV 1 Bright 
    Stop
  }
}

Actor PyroBall
{
  Radius 10
  Height 8
  Speed 15
  SeeSound "pyro/bomb"
  DeathSound "pyro/bombhit"
  Projectile  
  RenderStyle Add
  Alpha 0.7
  -NoGravity
  +DoomBounce
  +LowGravity
  +FireDamage
  +SeekerMissile
  Decal RevenantScorch
  States
  {
  Spawn:
    RBAL A 0 Bright
    RBAL A 0 Bright A_AlertMonsters
    RBAL AAAABBBB 1 Bright 
    Goto Spawn +2
  Death:
    RBAL DEFGHI 4 Bright 
    Stop
  }
}

Actor FirebombExplosion1
{
  Radius 11
  Height 8
  Speed 18
  Damage 6
  +NoBlockMap
  +DropOff
  +Missile
  +ActivateImpact
  +ActivatePCross
  Obituary "%o was killed by a firebomb explosion."
  States
  {
  Spawn:
     FRME A 1 Bright
     Loop
  Death:
     FRME A 0
     FRME A 0 A_PlaySound("pyro/blastexplosion")
	 TNT1 AAAA 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL AAA 0 A_CustomMissile ("FireballExplosionFlamesBig", 6, 0, random (0, 360), 2, random (0, 360))
	FRFX ZZ 0 BRIGHT A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 0, 2, random (50, 130))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 90, 2, random (50, 130))
     FRME A 3 Bright A_Explode(25, 64)
     FRME B 1 Bright //A_Mushroom("Pyroball",8)
     FRME B 2 Bright A_CustomMissile("FirebombExplosion2",25,0,180)
     FRME CDEFGHIJKLMNOPQRS 1 Bright
     Stop
  }
}

Actor FirebombExplosion2 : FirebombExplosion1
{
  States
  {
  Death:
    FRME A 0
    FRME A 0 A_PlaySound("pyro/blastexplosion")
	TNT1 AAAA 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL AAA 0 A_CustomMissile ("FireballExplosionFlamesBig", 6, 0, random (0, 360), 2, random (0, 360))
	FRFX ZZ 0 BRIGHT A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 0, 2, random (50, 130))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 90, 2, random (50, 130))
    FRME A 3 Bright A_Explode(25, 64)
    FRME B 1 Bright
    FRME B 2 Bright A_CustomMissile("FirebombExplosion3",20,0,180)
    FRME CDEFGHIJKLMNOPQRS 1 Bright
    Stop
  }
}

Actor FirebombExplosion3 : FirebombExplosion1
{
  Speed 14
  Damage 5
  States
  {
  Death:
    FRME A 0
    FRME A 0 A_PlaySound("pyro/blastexplosion")
    FRME A 3 Bright A_Explode(25, 64)
	TNT1 AAAA 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL AAA 0 A_CustomMissile ("FireballExplosionFlamesBig", 6, 0, random (0, 360), 2, random (0, 360))
	FRFX ZZ 0 BRIGHT A_CustomMissile ("BigNeoSmoke", 2, 0, random (0, 360), 2, random (0, 360))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 0, 2, random (50, 130))
	EXPL A 0 A_CustomMissile ("FlyingBurningFuelSmall", 12, 0, 90, 2, random (50, 130))
    FRME BCDEFGHIJKLMNOPQRS 1 Bright
    Stop
  }
}

Actor PyroBlast
{
  Projectile
  +SeekerMissile
  +NoGravity
  RenderStyle Add
  Alpha 0.4
  SeeSound "pyro/blast"
  DeathSound "pyro/flamepoof"
  Speed 17
  Height 10
  Radius 10
  Decal Scorch
  states
  {
  Spawn:
    SBLL ABCDEFGHIJ 1 Bright A_SpawnItemEx("FireTail",0,0,0,0,0,0,0,128)
    SBLL A 0 Bright A_SeekerMissile(0,2)
    Goto Spawn+1
  Death:
    SBLL K 0 A_CustomMissile("FirebombExplosion1",1,0,45)
    SBLL K 0 A_CustomMissile("FirebombExplosion1",1,0,135)
    SBLL K 0 A_CustomMissile("FirebombExplosion1",1,0,225)
    SBLL K 0 A_CustomMissile("FirebombExplosion1",1,0,315)
    SBLL LMNOPQRSTUVW 1 Bright
    Stop
  }
}

Actor WalkFire
{
  +NoClip
  +Missile
  +DropOff
  +Randomize
  Scale 1.5
  Speed 1
  RenderStyle Add
  Alpha 0.67
  States
  {
  Spawn:
    TNT1 A 8
    FRTF A 2 Bright
    FRTF A 0 
    FRTF B 2 Bright
    FRTF B 0 
    FRTF C 2 Bright
    FRTF C 0 
    FRTF C 0 
    FRTF C 0 A_Jump(191,4)
    FRTF C 0 A_CustomMissile("WalkFire", 0, 24, 0)
    FRTF C 0 A_CustomMissile("WalkFire", 0, 0, 0)
    FRTF C 0 A_CustomMissile("WalkFire", 0, -24, 0)
	TNT1 A 0 A_CustomMissile("ExplosionParticleVerySlow", 4, 0, random (0, 360), 2, random (50, 130))
    FRTF DEFGHIJKLMNO 2 Bright 
	TNT1 A 0 A_CustomMissile("ExplosionParticleVerySlow", 4, 0, random (0, 360), 2, random (50, 130))
    Stop
  }
}

Actor RainCometNull
{
  Radius 0
  Height 0
  Speed 8
  Projectile
  +FloorClip
  +Ripper
  +DoomBounce
  +CeilingHugger
  +DontHurtSpecies
  States
  {
  Spawn:
    ZAP5 A 0 A_Jump(5,8)
    ZAP5 AAAAAA 1 A_Wander
    ZAP5 A 8 A_CustomMissile("FallingComet",-24,random(0,128),random(0,360),2,random(1,89))
    Loop
  Death:
    ZAP5 A 0
    Stop
  }
}

Actor FallingComet
{
  Radius 6
  Height 8
  Speed 5
  Damage 5
  ExplosionDamage 15
  ExplosionRadius 45
  Scale 0.55
  Projectile
  SeeSound "pyro/comet"
  DeathSound "pyro/cometdeath"
  -NoGravity
  -Float
  +FloorClip
  +DontHurtSpecies 
  +SpawnCeiling
  Decal RevenantScorch
  States
  {
  Spawn:
    COMT AAAABBBBCCCC 1 Bright A_SpawnItemEx("FireTail", 0, 0, 0, 0, 0, 0, 0, 128)
    Loop
  Death:
    COMT D 3 Bright A_SpawnItemEx("CometDeathGlow", 0, 0, 0, 0, 0, 0, 0, 128)
    COMT E 3 Bright A_Explode(12,78,0)
    COMT E 0 A_SpawnItemEx("CometDeath", 0, 0, 0, 0, 0, 0, 0, 128)
    Stop
  }
}

Actor WatcherSummonComet
{
  Radius 6
  Height 8
  Speed 15
  Damage 10
  DamageType "Fire"
  SpawnID 250
  Scale 1.25
  Projectile
  +DoomBounce
  BounceFactor 0.6
  Gravity 0.5
  SeeSound "Afrit/CometFire"
  DeathSound "Afrit/CometHit"
  Decal Scorch
  States
  {
  Spawn:
    COMT AAAAAAAAAAAAABBBBBBBBBBBBBBBCCCCCCCCCCCCCC  1 Bright A_SpawnItemEx("ArchCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
    Goto Death
  Death:
    COMT D 3 Bright A_SpawnItemEx("CometDeathGlow", 0, 0, 0, 0, 0, 0, 0, 128)
    COMT E 3 
	TNT1 A 0 Bright A_SpawnItem("Watcher")
    TNT1 A 0 A_SpawnItemEx("ArchCometDeath", 0, 0, 0, 0, 0, 0, 0, 128)
    Stop
  }
}

///////////////////////////======VANILLA======//////////////////////////////////

Actor Vanilla_MagCaco : InfernalCacodemon
{
	DropItem "DemonStrengthRune" 6
	States
	{
		Spawn: 
		   INFR A 8 Bright A_Look 
		   Loop 
	}
}
