
// map 312 boss

Actor InitialPinkySpam: fbd_token
{
	inventory.maxamount 99
}

Actor PinkyReserve: fbd_token
{
	inventory.maxamount 666
}

ACTOR BeastmasterIsDeadGoFeral : CustomInventory 
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	inventory.maxamount 1
    States
    {
		Pickup:
			// inventory item's states execute in the context of the actor that item is in the inventory of
			TNT1 A 0
			TNT1 A 0 A_CheckFlag("FRIENDLY", "Nope", AAPTR_Default) // marine NPC companions are monsters with +FRIENDLY flag
			// clear the minion status
			TNT1 A 0 A_RearrangePointers(AAPTR_NULL, AAPTR_NULL, AAPTR_NULL, 0)
			TNT1 A 0 Thing_ChangeTID(0, Random(96,98))
			TNT1 A 0 Thing_Hate(0, tid == 98 ? 96 : tid + 1, 2) // three groups hating each other rock-paper-scissors
			// type 2 = no sight check, ignore player unless attacked by him
			// cannot have a true free-for all because monsters that hate the same thing *cannot* damage each other, no exclusions. Thus, several groups that hate each other
			TNT1 A 0 A_RailWait // set the internal action result variable to true, otherwise fails
			Stop
			
		Nope:
			TNT1 A 0
			TNT1 A 0 A_RailWait // set the internal action result variable to true, otherwise fails because no action functions were called
			Stop
    }
}	

Actor PinkySummon: FBD_BullDemon {
	Tag "$ATTACK_PINKY" // Trained Attack Pinky
	Obituary "$INFERNAL2_O" // %o was harried by Inferrnal Pinkie Beastmaster.
	-COUNTKILL
	+NEVERRESPAWN
	DropItem "DemonStrengthRune" 4 // 2 // much increased chance for the sake of using the Dragonslayer!
	States {
		// they spawn lobbed at high velocity through the air
			// first, the crouched posture from BDv21 monster fatalities (eating a corpse)
		Spawn:
			PDEV B 0 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster")
			"----" A 0 A_TakeInventory("PinkyReserve", 1, 0, AAPTR_Master) // decrease bosses' ammo count
			PDEV B 0 A_PlaySound("demon/melee", 4) // boss has no firing sound for this
			PDEV B 0 A_SetUserVar("user_jump_power", CallAcs("AdjustJumpPowerForEDAYMarsChapter", 25))
			PDEV BBBBB 1
			// then, the leaping frame
			SAPC B 2
			SAPC BBBBBBBBB 2 A_Look
			Goto Spawned
	}
}

Actor MultiplayerPinkySummon: PinkySummon { // similar to stoneskin pinky but without checking if caster is dead and WITHOUT ELEMENTAL VULNERABILITIES
	Tag "MegaPinky"
	Obituary "%o was mauled by a MegaPinky."
	Translation "16:37=250:254" // bright purple
	Health 2000 // ten times as durable
	damagefactor "SSG", 2.0 // original has 50x
}

/*
========== Tricks of the trade ============

You may noticed BD monsters only use frames with duration 2 and 3, say,
SKEL AA 3
instead of
AKEL A 6
This is deliberate, to avoid them speeding up when fast monsters is enabled.
The fast monsters feature works by shortening frame duration but it only affects frames with duration of 4 and up. So 4,5 and 6 become 3, 7 and 8 become 4, 9 and 10 become 5 and so on.
*/

ACTOR Beastmaster_2: MotherdemonBase 17540
{
	// inherited health 10000
	
	// We absolutely do *not* need him floating off the edge and hovering over the lava moat
	// ..or, floating up above his pinkie shield after being propelled by an explosion.
	// The base motherdemon is prone to these.
	-FLOAT
	-NOGRAVITY
	+NODROPOFF
	
	+NEVERRESPAWN
	
	Tag "$INFERNAL2" // Pinkie Beastmaster
	Obituary "$INFERNAL2_O" // %o was harried by Beastmaster's pinkies.
	
	var int user_burst_remaining;
	var int user_initial_spam;
	
	PainChance "Argent", 0
	DamageFactor "Argent", 0.0 // immune to own attack -- otherwise may kill self :(
	
	States
	{
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 4)
			"----" A 0 A_GiveInventory("InitialPinkySpam", 30)
			"----" A 0 A_GiveInventory("PinkyReserve", 266)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			Goto Stand
			
		Aftermath: // boss death function overridable by descendant classes
			// applies feral infighting to *all* hostile monsters on the map
			"----" A 1 A_RadiusGive("BeastmasterIsDeadGoFeral", 9999, RGF_CUBE | RGF_NOSIGHT | RGF_MONSTERS, 1)
			"----" A -1
			Stop			
	
		Missile:
			"----" A 0
			"----" A 0 A_JumpIfInventory("InitialPinkySpam", 1, "PinkySpam")
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, 2)
			"----" A 0 A_JumpIfCloser(400, "RingOfFire")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "PinkySpam")
			Goto OopsOutOfPinkies						
			
		OopsOutOfPinkies:
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "Nukem")
			"----" A 0 A_JumpIfCloser(800, "RingOfFire")
			//Goto FireWalls // must honor inheritance *and* Zandronum clientside quirks
			"----" A 1 A_Jump(256, "FireWalls")
			Wait
			
		PinkySpam:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2 
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget			
			MOTH IIII 2
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", 5)
		
		Lob:
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			//beastmaster radius 60 + pinky radius 20 = 80 * sqrt(2) = 114, 
			// was initially 100, resuiling in him failing to lob at angles near the corner directions (45, 135, -45, -135)
			MOTH J 4 A_SpawnItemEx("PinkySummon", 114, 0, 42, 30, 0, 10, 0, SXF_SETMASTER | SXF_TRANSFERPOINTERS, 0, 99)
			MOTH J 4
			"----" A 0 A_TakeInventory("InitialPinkySpam", 1)
			
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget					
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH I 5
			"----" A 0 A_SetUserVar("user_burst_remaining", user_burst_remaining - 1)
			
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "LobOhShi")
			
			"----" A 0 A_JumpIfInventory("InitialPinkySpam", 1, "Lob") // ignore burst length
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "ClearNopainAndSee")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "Lob")
			Goto OopsOutOfPinkies
			
		LobOhShi:
			"----" A 0 A_ChangeFlag("NOPAIN", 1)
			"----" A 0 A_Recoil(5)
			"----" A 0 A_JumpIfCloser(400, "Nukem")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, 2)
			"----" A 1 A_Jump(256, "OopsOutOfPinkies")
			"----" A 0 A_JumpIfInventory("InitialPinkySpam", 1, "Lob") // ignore burst length
			"----" A 1 A_JumpIfTargetInLOS("Lob", 0, JLOSF_DEADNOJUMP)
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "ClearNopainAndSee")
			"----" A 1 A_Jump(256, "Lob")
			Wait
			
			
		
		RingOfFire:
			"----" A 0
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "Nukem")
			"----" A 0 A_JumpIfHealthLower(1000 * (1 + CallAcs("FBD_GetGameSkill")), "OneNuke")
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH IIII 2
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH JJJJ 2
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")

			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,0,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,10,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,20,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,30,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,40,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,50,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,60,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,70,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,80,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,90,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,100,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,110,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,120,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,130,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,140,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,150,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,160,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,170,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,180,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,190,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,200,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,210,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,220,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,230,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,240,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,250,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,260,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,270,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,280,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,290,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,300,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,310,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,320,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,330,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,340,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,350,2,10)
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
			"----" A 0 A_TakeInventory("Enraged", 1)
			goto See		
		
		
		FuriousRetaliation: // may be invoked from parent classes' methods
			"----" A 0 A_GiveInventory("Enraged", 1)
		FireWalls:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH IIII 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH JJJJ 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")

			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,0,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,70,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,-70,2,0)
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
			"----" A 0 A_JumpIfInventory("Enraged", 1, "Nukem")
			"----" A 0 A_JumpIfHealthLower(1000 * (1 + CallAcs("FBD_GetGameSkill")), "OneNuke")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "See")
			"----" A 1 A_JumpIfTargetInLOS("OneNuke", 0, JLOSF_DEADNOJUMP)
			goto See

		OneNuke:
			"----" A 0
			"----" A 0 A_ChangeFlag("NOPAIN", 1)
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2 
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget			
			MOTH IIII 2
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", 1)
			
		Nukem:
			"----" A 0
			"----" A 0 A_ChangeFlag("NOPAIN", 1)
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2 
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget			
			MOTH IIII 2
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", Random(1, CallAcs("FBD_GetGameSkill") + 1))
		
		NuclearLaunchDetected:
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			//beastmaster radius 60 + pinky radius 20 = 80 * sqrt(2) = 114, 
			// was initially 100, resuiling in him failing to lob at angles near the corner directions (45, 135, -45, -135)
			MOTH J 4 A_CustomMissile("BeastNuke", 0.0000152587890625 * user_head_scale * 100.0, 0, angle, CMF_AIMOFFSET | CMF_ABSOLUTEANGLE  | CMF_SAVEPITCH)
			MOTH J 4
			
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget					
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH I 5
			"----" A 0 A_SetUserVar("user_burst_remaining", user_burst_remaining - 1)
			
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "NuclearLaunchBackpedal")
			
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "ClearNopainAndSee")
			Loop
			
		NuclearLaunchBackpedal:
			"----" A 0 A_Recoil(8)
			"----" A 1 A_JumpIfTargetInLOS("NuclearLaunchDetected", 0, JLOSF_DEADNOJUMP)
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "ClearNopainAndSee")
			"----" A 1 A_Jump(256, "NuclearLaunchDetected")
			Wait

		ClearNopainAndSee:
			"----" A 0 A_ChangeFlag("NOPAIN", 0)
			"----" A 1 A_Jump(256, "See")
			Wait
	}
}

ACTOR Beastmaster_1: Beastmaster_2 17946
{
	Health 8000
	States
	{
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 8)
			"----" A 0 A_GiveInventory("InitialPinkySpam", 20)
			"----" A 0 A_GiveInventory("PinkyReserve", 135)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			Goto Stand	
			
		FuriousRetaliation:
			"----" A 0 A_GiveInventory("Enraged", 1)
		FireWalls:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH IIII 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH JJJJ 2
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")

			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,0,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,90,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,-90,2,0)
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HHHH 2
			"----" A 0 A_JumpIfHealthLower(1000 * (1 + CallAcs("FBD_GetGameSkill")), "OneNuke")
			"----" A 0 A_JumpIfInventory("Enraged", 1, "RingOfFire")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "See")
			"----" A 1 A_JumpIfTargetInLOS("OneNuke", 0, JLOSF_DEADNOJUMP)
			goto See
	}
}


ACTOR Beastmaster_3: Beastmaster_2 17542
{
	Health 15000
	States {
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 8)
			"----" A 0 A_GiveInventory("InitialPinkySpam", 60)
			"----" A 0 A_GiveInventory("PinkyReserve", 384)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			Goto Stand
			
		FuriousRetaliation:
			"----" A 0 A_GiveInventory("Enraged", 1)
		FireWalls:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HH 4 // unlike 2, 4 shortens to 3 with fast monsters making this phase 6 instead of 8
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
			MOTH II 4
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH JJ 4
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget	
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")

			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,35,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,70,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,-70,2,0)
			"----" A 0 bright A_CustomMissile (BeastmasterFirewall,0,0,-35,2,0)
			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HH 4
			"----" A 0 A_JumpIfHealthLower(1000 * (1 + CallAcs("FBD_GetGameSkill")), "OneNuke")
			"----" A 0 A_JumpIfInventory("Enraged", 1, "RingOfFire")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "See")
			"----" A 1 A_JumpIfTargetInLOS("OneNuke", 0, JLOSF_DEADNOJUMP)
			goto See			
	}
}

ACTOR Beastmaster_4: Beastmaster_3 17683
{
	Health 20000
	Tag "$INFERNAL2UV" // Brutal Beastmaster
	States {
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 4)
			"----" A 0 A_GiveInventory("InitialPinkySpam", 90)
			"----" A 0 A_GiveInventory("PinkyReserve", 666)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			Goto Stand
		
		PinkySpam:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HH 3 

				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget			
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)			
			MOTH II 3
			
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", 5)
		
		Lob: // the fire rate is doubled (no animation, would be too jerky) 5 tics instead of 9
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH J 4 A_SpawnItemEx("PinkySummon", 114, 0, 42, 30, 0, 10, 0, SXF_SETMASTER | SXF_TRANSFERPOINTERS, 0, 99)
			"----" A 0 A_TakeInventory("InitialPinkySpam", 1)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget		
			MOTH J 1
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "LobOhShi")

			"----" A 0 A_SetUserVar("user_burst_remaining", user_burst_remaining - 1)
			
			"----" A 0 A_JumpIfInventory("InitialPinkySpam", 1, "Lob") // ignore burst length
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "See")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "Lob")
			Goto OopsOutOfPinkies			

	}
}

ACTOR Beastmaster_Coop: Beastmaster_4 17628 // shoots megapinkies with 10x health instead
{
	States {
		Spawn:
			MOTH A 1 NODELAY ACS_NamedExecuteWithResult("FBD_RunMonster", 16, 110) // motherdemon headbox, scale 110%
			"----" A 0 A_SetUserVar("user_stunlock_limit", 4)
			"----" A 0 A_GiveInventory("InitialPinkySpam", 9) // 1/10th because they have 2000 hp rather than 200
			"----" A 0 A_GiveInventory("PinkyReserve", 66)
			"----" A 0 A_GiveInventory("TargetIsAGreatTerribleBoss")
			"----" A 0 A_GiveInventory("TargetIsABoss")
			
			Goto Stand
			
		PinkySpam:
			"----" A 0
			"----" A 0 A_FaceTarget
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 62, 0, 41)
			MOTH HH 2 
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 54, 0, 62)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget			
			MOTH II 2
			"----" A 0 A_PlaySoundEx ("Mother/attack", "Body")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", 5)
		
		Lob: // fires Multiplayer Megapinkies instead (2000 health apiece)
			"----" A 0 ACS_NamedExecuteWithResult("AdjustHeadboxMkII", 33, 0, 77)
			MOTH J 4 A_SpawnItemEx("MultiplayerPinkySummon", 114, 0, 42, 30, 0, 10, 0, SXF_SETMASTER | SXF_TRANSFERPOINTERS, 0, 99)
			"----" A 0 A_TakeInventory("InitialPinkySpam", 1)
				//***Che: do NOT adjust aim if target goes out of sight or is invisible
				"----" A 0 A_JumpIf(CallAcs("FBD_TargetIsInvisible"), 4)
				"----" A 0 A_JumpIfTargetInLOS(2)
				"----" A 0 A_Jump(256, 2)
				"----" A 0 A_FaceTarget		
			MOTH J 1
			
			"----" A 0 A_JumpIfInTargetInventory("DragonslayerSelected", 1, "LobOhShi")
			
			"----" A 0 A_SetUserVar("user_burst_remaining", user_burst_remaining - 1)
			"----" A 0 A_JumpIfInventory("InitialPinkySpam", 1, "Lob") // ignore burst length
			"----" A 0 A_JumpIf(user_burst_remaining <= 0, "See")
			"----" A 0 A_JumpIfInventory("PinkyReserve", 1, "Lob")
			Goto OopsOutOfPinkies	
	}
}

// need I remind you that Argent damage *heals* monsters

actor BeastmasterFirewall
{
	game Doom
	height 8
	scale 0.8
	radius 6
	damage 5
	speed 15
	renderstyle Translucent
	alpha 0.5
	seesound "skeleton/attack"
	deathsound "null"
	PROJECTILE
	+RANDOMIZE
	+NODAMAGETHRUST
	+FLOORHUGGER
	+THRUACTORS
	ActiveSound "KYRDTRCH"
	var int user_starting_z;
	
	DamageType "Argent"
	
	states
	{
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_SetUserVar("user_starting_z", z)
		Fly:
			TNT1 A 1
			TNT1 A 0 A_JumpIf(z > user_starting_z + 130 || z < user_starting_z - 130, "Death")
			//TNT1 A 0 A_CustomMissile ("FireballExplosionFlames", random (0, 8), 0, random (0, 360), 2, random (80, 100))
			TNT1 A 1
			TNT1 A 0 A_JumpIf(z > user_starting_z + 130 || z < user_starting_z - 130, "Death")
			TNT1 A 0 A_CustomMissile("BeastmasterFlames", 32, 0, 0, 2 | CMF_TRACKOWNER, -90)
			TNT1 A 0 A_LoopActiveSound
			
			loop
		Death:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE)
			stop
	}
}




ACTOR BeastmasterFlames
{
    Radius 12
    Height 12
    Speed 5
	PROJECTILE
	+MISSILE
    +NOTELEPORT
    +BLOODLESSIMPACT 
	+THRUGHOST
	+NODAMAGETHRUST
	+NOGRAVITY
	+FLOAT
	+DONTFALL
	//+FORCERADIUSDMG
	DamageType "Argent"
	Renderstyle Add
	Gravity 0.2
	Alpha 0.03 // fades in during the first phase
	Mass 0
	
	// golden to pinkish
	Translation "160:167=[255,0,255]:[55,0,47]", "227:231=[255,185,255]:[255,0,255]", "224:226=[255,0,255]:[255,0,255]", "232:235=[183,0,155]:[55,0,47]"

		// This ChebMaster had initially cloned NF4R* (truecolor) as NF4Y* (doom-paletted, golden)
		// for the supercyberdemon.
		// Now exploiting the fact I have a palette swappable flame
	
    States
    {
		Spawn:
			TNT1 A 0 A_JumpIf(waterlevel > 1, "Underwater")
		Live:
			tnt1 A 10
			Stop
		XDeath:
			TNT1 A 0
			TNT1 A 0 A_ChangeFlag("NOGRAVITY", 0)
		Death:
			TNT1 A 0
			TNT1 A 0 A_Playsound("beastmaster/flame", 1)
		
			// This pseudorandom gives *the same* result for identical range at a given position *during a whole second*
			// So using different ranges that aren't divisible by each other is a must!
			// (the pseudorandom uses a simple modulo by range on a ~11-bit seed)			
			TNT1 A 0 A_SetScale((CallAcs("FBD_PseudoRandom", 0, 6) < 4 ? -1 : 1) * 0.1 * CallAcs("FBD_PseudoRandom", 8, 12), 0.1 * CallAcs("FBD_PseudoRandom", 7, 15))
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT A_FadeIn(0.02) // 0.02 x 16 = 0.32 + initial 0.03 = 0.35
			TNT1 A 0 A_Explode(16, 64, 0)
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			
			
			TNT1 A 0 A_Jump(32, "TurnOff")
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			
			TNT1 A 0 A_Jump(32, "TurnOff")
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			
			TNT1 A 0 A_Jump(32, "TurnOff")
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)
			
			TNT1 A 0 A_Jump(32, "TurnOff")
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT
			TNT1 A 0 A_Explode(16, 64, 0)

			Goto TurnOff
			
		TurnOff:
			"----" A 0 A_StopSound(1)
			NF4Y QRSTUV 1 BRIGHT
			Stop			
			
		Underwater:
		Splash:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx ("UnderwaterExplosion",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
			TNT1 A 0 A_Explode(50, 120, 0)
			TNT1 A 1
			Stop
    }
}

ACTOR BeastFireRingFlame0: BeastmasterFlames
{
	// instead of being a floor hugger, we bounce on floors (and are stopped by stairs!
	// on the plus side, this ring falls into the moat graphically
	
	/*
	+BOUNCEONFLOORS
	-BOUNCEONWALLS
	BounceType None
	BounceCount 99
	BounceFactor 1.0
	-NOGRAVITY
	//Screw this screwy mess, they are too bouncy. Floorhugger will do.
	//NO!
	//F*** YES!
	*/
	
	
	+FLOORHUGGER
	
	+THRUACTORS
	
	Speed 10
	FastSpeed 10
	
	Damage 0
	
	States {
		Death:
		XDeath:
		Crash:
			TNT1 A 0
			Goto TurnOff
			
		Spawn:
			TNT1 A 0 NODELAY A_SetScale((CallAcs("FBD_PseudoRandom", 0, 6) < 4 ? -1 : 1) * 0.1 * CallAcs("FBD_PseudoRandom", 8, 12), 0.1 * CallAcs("FBD_PseudoRandom", 7, 15))
			TNT1 A 0 A_PlaySound("beastmaster/flame", 1)
			NF4Y ABCDFEGH 1 BRIGHT A_FadeIn(0.02) // 0.02 x 16 = 0.32 + initial 0.03 = 0.35
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT A_FadeIn(0.02) // 0.02 x 16 = 0.32 + initial 0.03 = 0.35
			"----" A 0 A_Explode(8, 64, 0)
			
			//16 tics x 10 speed = 160
			// circumference = 160 * 2 * Pi = 1004
			// 1004 / 32 = 31 flames initial, increasing to 36 (angle step 10)
			// Phase 1 flames have angle step 5 (spawns two at +2.5, -2.5) (72 pcs) and must split after 16 tics, at the radius of 320
			// Phase 2 flames have angle step 2.5 (spawns two at +1.25, -1.25) (144pcs) and end must split after 32 tics at the radius of 640
			// Phase 3 flames have angle step 1.25 (spawns two at +0.625, -0.625) (288pcs), live 64 tics and die out at the radius of 1280
			
			// 2 is CMF_AIMDIRECTION
			"----" A 0 A_CustomMissile("BeastFireRingFlame1", 8, 0, 2.5, 2 | CMF_TRACKOWNER, 1)
			"----" A 0 A_CustomMissile("BeastFireRingFlame1", 8, 0, -2.5, 2 | CMF_TRACKOWNER, 1)
			
			"----" A 0 A_StopSound(1)
			
			// merge seamlessly with the newly spawned flames: they fade in, we fade out
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT A_FadeOut(0.02)
			Stop
	}	
}

ACTOR BeastFireRingFlame1: BeastFireRingFlame0
{
	States {
		Spawn:
			TNT1 A 0 NODELAY A_SetScale((CallAcs("FBD_PseudoRandom", 0, 6) < 4 ? -1 : 1) * 0.1 * CallAcs("FBD_PseudoRandom", 8, 12), 0.1 * CallAcs("FBD_PseudoRandom", 7, 15))
			TNT1 A 0 A_PlaySound("beastmaster/flame", 1)
			NF4Y ABCDFEGH 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)
			
			
			"----" A 0 A_CustomMissile("BeastFireRingFlame2", 8, 0, 1.25, 2 | CMF_TRACKOWNER, 1)
			"----" A 0 A_CustomMissile("BeastFireRingFlame2", 8, 0, -1.25, 2 | CMF_TRACKOWNER, 1)
			
			"----" A 0 A_StopSound(1)
			
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT A_FadeOut(0.02)
			Stop	
	}
}

ACTOR BeastFireRingFlame2: BeastFireRingFlame1
{
	States {
		Spawn:
			TNT1 A 0 NODELAY A_SetScale((CallAcs("FBD_PseudoRandom", 0, 6) < 4 ? -1 : 1) * 0.1 * CallAcs("FBD_PseudoRandom", 8, 12), 0.1 * CallAcs("FBD_PseudoRandom", 7, 15))
			TNT1 A 0 A_PlaySound("beastmaster/flame", 1)
			NF4Y ABCDFEGH 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)

			NF4Y ABCDFEGH 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)		
			
			"----" A 0 A_CustomMissile("BeastFireRingFlame3", 8, 0, 0.625, 2 | CMF_TRACKOWNER, 1)
			"----" A 0 A_CustomMissile("BeastFireRingFlame3", 8, 0, -0.625, 2 | CMF_TRACKOWNER, 1)
			
			"----" A 0 A_StopSound(1)
			
			// merge seamlessly with the newly spawned flames: they fade in, we fade out
			NF4Y ABCDFEGHIJKLMNOP 1 BRIGHT A_FadeOut(0.02)
			Stop	
	}
}

ACTOR BeastFireRingFlame3: BeastFireRingFlame2
{
	States {
		Spawn:
			TNT1 A 0 NODELAY A_SetScale((CallAcs("FBD_PseudoRandom", 0, 6) < 4 ? -1 : 1) * 0.1 * CallAcs("FBD_PseudoRandom", 8, 12), 0.1 * CallAcs("FBD_PseudoRandom", 7, 15))
			TNT1 A 0 A_PlaySound("beastmaster/flame", 1)
			NF4Y ABCDFEGH 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT A_FadeIn(0.02)
			"----" A 0 A_Explode(8, 64, 0)

			NF4Y ABCDFEGH 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)	

			NF4Y ABCDFEGH 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)	

			NF4Y ABCDFEGH 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)
			NF4Y IJKLMNOP 1 BRIGHT
			"----" A 0 A_Explode(8, 64, 0)				
			
			Goto TurnOff
	}
}

ACTOR BeastNuke: FBD_CacoBall
{
	Translation "112:127=251:254", "224:227=4:4", "228:231=250:250"
	Radius 8
	Height 8
	Speed 20
	FastSpeed 25
	Projectile
	+RANDOMIZE
	+FORCEXYBILLBOARD
	RenderStyle Translucent
	Alpha 0.95
	Scale 1.0 
	DamageType "Argent"
	Species "Motherdemons" // to avoid exploding against the headbox right away
	SeeSound "baron/attack"
	ActiveSound "KYROAR01"
	DeathSound "hater/death"
	States
	{
		Spawn:
			BFS1 X 2 BRIGHT
			"----" A 0 A_JumpIf(z - floorz < 20, "Proximity")
			"----" A 0 A_LoopActiveSound
			"----" A 0 A_SetScale(Random(0,1) ? 1.0 : -1.0, 1.0)
			BFS1 Y 2 BRIGHT
			"----" A 0 A_JumpIf(z - floorz < 20, "Proximity")
			"----" A 0 A_LoopActiveSound
			"----" A 0 A_SetScale(Random(0,1) ? 1.0 : -1.0, 1.0)
			Loop
		Proximity:
			"----" A 1 A_Die // doesn't do anything on Zandronum client
			Wait
		Death:
			TNT1 A 0
			TNT1 A 0 A_StopSound(CHAN_VOICE)
			
			"----" A 0 A_Scream
			"----" AAA 0 BRIGHT A_CustomMissile ("HaterExplosionSfx", 16, 0, random (0, 360), 2, random (-90, 90)) 
			
			// inflict horrible damage:
			"----" A 0 A_CustomMissile ("HaterGonnaHate", 16, 0, random (0, 360), 2, random (-90, 90))
			
			BFE1 CCCDDDEEE 1 BRIGHT A_CustomMissile ("HaterExplosionSfx", 16, 0, random (0, 360), 2, random (-90, 90))

			"----" A 0 A_PlaySound("distantexp", 5)
			
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,0,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,10,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,20,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,30,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,40,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,50,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,60,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,70,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,80,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,90,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,100,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,110,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,120,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,130,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,140,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,150,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,160,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,170,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,180,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,190,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,200,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,210,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,220,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,230,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,240,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,250,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,260,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,270,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,280,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,290,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,300,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,310,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,320,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,330,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,340,2,10)
			"----" A 0 bright A_CustomMissile (BeastFireRingFlame0,0,0,350,2,10)

			TNT1 A 30
						
			Stop
	}
}