ACTOR BossBrainReplacer Replaces BossBrain
{
	Health 250
	Mass 10000000
	PainChance 255
	PainSound "brain/pain"
	DeathSound "brain/death"
	+SOLID +SHOOTABLE
	+NOICEDEATH
	+OLDRADIUSDMG
	Damagefactor "Avoid", 0.0	Damagefactor "BHFTOnBarrel", 0.0	Damagefactor "Blood", 0.0
	Damagefactor "CancelTeleportFog", 0.0	Damagefactor "CauseWaterSplash", 0.0
	Damagefactor "GibRemoving", 0.0	Damagefactor "Glass", 0.0	Damagefactor "HangingHook", 0.0
	Damagefactor "Head", 0.0	Damagefactor "PussyGrab", 100.0	Damagefactor "Repair", 0.0
	Damagefactor "RevenantHitStomach", 0.0	Damagefactor "SpawnMarine", 0.0	DamageFactor "TankWeakSpot", 0.0
	Damagefactor "TeleportRemover", 0.0	Damagefactor "Use", 0.0	Damagefactor "SSG", 5.0
	Damagefactor "ExtremePunches", 5.0	Damagefactor "Fatality", 5.0	Damagefactor "HelperMarineFatallity", 5.0
	States
	{
	Spawn:
	BBRN A 2
	MARN A 0 ACS_NamedExecuteAlways("BDDisableMapEnhancements", 0, 0, 0, 0)//Check if advanced decorations are disabled.
	BBRN A 2
	TNT1 A 0 A_JumpIf(x == 2880, "ReplaceDoom2Check")
	MARN A 0 ACS_NamedExecuteAlways("MapEnhancementNaziVerification", 0, 0, 0, 0)//Check if you are playing on an Wolfenstein level
	TNT1 A 0 Thing_ChangeTID(0,748)
	BBRN A 2
	TNT1 A 0 A_JumpIfInventory("AltEasyMarineVerification", 1, "IsPlayingAlt")

	Vanilla:
	Spawn2:
	BBRN A -1
	Stop

	ReplaceDoom2Check:
	TNT1 A 1
	TNT1 A 0 A_JumpIf(y == 1648, "ReplaceDoom2")
	Goto Spawn2

	ReplaceDoom2:
	TNT1 A 1
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", 0)
	TNT1 A 0 ACS_NamedExecuteAlways("MapEnhancementD2Map30")
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeatBase",0,600,-50,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat1",0,580,-70,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat2",15,540,-100,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat3",-15,500,-120,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat1",-25,460,-100,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat2",-15,420,-80,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat3",0,400,-60,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat2",20,360,-20,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat1",5,320,0,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("GateKeeperMeat3",0,280,10,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	TNT1 A 0 A_SpawnItemEx ("IconOfSin",0,600,0,0,0,0,0,SXF_NOCHECKPOSITION | SXF_TRANSFERAMBUSHFLAG ,0)
	Goto Spawn2

	IsPlayingAlt:
	TNT1 A 1
	TNT1 A 0 A_ChangeFlag("COUNTKILL", 0)
	TNT1 A 0 A_ChangeFlag("THRUACTORS", 1)
	TNT1 A 0 A_ChangeFlag("NOTARGET", 1)
	TNT1 A 0 A_ChangeFlag("NOBLOCKMAP", 1)
	TNT1 A 0 A_SpawnItemEx("AltMap01Airplane", 0, 0, 28, 0, 0, 0, 0, SXF_TRANSFERPOINTERS | SXF_TRANSFERAMBUSHFLAG)
	Stop

	BrainExplode:
	MISL BC 10 Bright
	MISL D 10 A_BrainExplode
	Stop

	Pain:
	BBRN B 36 A_BrainPain
	Goto Spawn2

	Death:
	TNT1 AAAAAAAAAAAAAA 0 A_CustomMissile ("BloodMistExtraBig", 50, 0, random (0, 360), 2, random (20, 90))
	TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("SuperGoreMist", 54, 0, random (0, 360), 2, random (30, 90))
	TNT1 AAAAAAAA 0 A_CustomMissile ("SuperGoreSpawner2", 64, 0, random (0, 360), 2, random (20, 40))
	TNT1 AA 0 A_CustomMissile ("XDeath1", 52, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_CustomMissile ("XDeath2", 52, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_CustomMissile ("XDeath3", 52, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_CustomMissile ("XDeath4", 52, 0, random (0, 360), 2, random (10, 90))
	TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece2", 65, 0, random (0, 360), 2, random (10, 90))
	TNT1 AA 0 A_CustomMissile ("XDeathSkinPiece1", 65, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_CustomMissile ("XDeathOrgan1", 24, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_CustomMissile ("XDeathOrgan2", 24, 0, random (0, 360), 2, random (10, 90))
	TNT1 A 0 A_SpawnItem ("BigBloodSpot")
	TNT1 A 100 A_BrainScream
	TNT1 AA 10
	TNT1 A -1 A_BrainDie
	Stop

	Death.Crush:
	BBRN A 100 A_BrainScream
	BBRN AA 10
	BBRN A -1 A_BrainDie
	Stop
	}
}

ACTOR AltMap01Airplane
{
	Health 250
	Mass 10000000
	PainChance 255
	+SOLID
	+SHOOTABLE
	+NOICEDEATH
	+OLDRADIUSDMG
	PainSound "brain/pain"
	DeathSound "brain/death"
	damagefactor "Blood", 0.0 damagefactor "BlueBlood", 0.0 damagefactor "GreenBlood", 0.0    damagefactor "Avoid", 0.0
	damagefactor "Shrapnel", 0.0	damagefactor "KillMe", 0.0  damagefactor "TeleportRemover", 0.0
	States
	{
		BrainExplode:
			MISL BC 10 Bright
			MISL D 10 A_BrainExplode
			Stop
		Spawn:
			TNT1 A 1
			TNT1 A 0 A_SetAngle(90)
			TNT1 A 0 A_SpawnItemEx("AltMap01CloudSpawner", 1100, 0, 0)
		Spawn2:
			TNT1 A 0 A_PlaySoundEx("AMBAIRP", 1, 1)
			TNT1 A 10
			Loop
		Pain:
			BBRN B 36 A_BrainPain
			Goto Spawn
		Death:
			BBRN A 100 A_BrainScream
			BBRN AA 10
			BBRN A -1 A_BrainDie
			Stop
	}
}