// 1K3 DECOHack source file (by Aurelius)
// Compatible with DECOHack v0.22.0 (or later)

#include <doom19>

//////////////////////////////
////  STATES & RESOURCES  ////
//////////////////////////////

// STATES FREED

	weapon 0 free states
	weapon 1 free states
	weapon 2 free states
	weapon 3 free deselect weapon 3 free select
	weapon 4 free deselect weapon 4 free select
	weapon 5 free deselect weapon 5 free select
	weapon 6 free deselect weapon 6 free select
	weapon 7 free deselect weapon 7 free select
	weapon 8 free deselect weapon 8 free select
	
	thing 8 free states				// Revenant fireball trail
	thing 9 free death				// Mancubus
	thing 15 free death 			// Cacodemon
	thing 21 free death				// Arachnotron
	thing 33 free states			// Caco projectile
	thing 40 free states			// Teleport fog
	thing 41 free states			// Item respawn fog
	thing 61 free states			// Computer map
	thing 83 free states			// Tall green pillar
	thing 84 free states			// Short green pillar
	thing 85 free states			// Tall red pillar
	thing 86 free states			// Short red pillar
	thing 87 free states			// Pillar with skull
	thing 88 free states			// Pillar with heart
	thing 89 free states			// Eye in symbol
	thing 90 free states			// Flaming skulls
	thing 91 free states			// Grey tree
	thing 95 free states			// Small blue torch
	thing 96 free states			// Small green torch
	thing 97 free states			// Small red torch
	thing 98 free states			// Brown stub / stalagmite
	thing 106 free states			// Hanging leg
	thing 107 free states			// Hanging arms out 2
	thing 108 free states			// Hanging torso / pair of legs
	thing 109 free states			// One-legged body
	thing 110 free states			// Hanging leg
	thing 111 free states			// Swaying body 2
	thing 121 free states			// 5 skewered heads
	thing 127 free states			// Large tree
	thing 134 free states			// Hanging body brain removed
	thing 126 free states			// Twitching body
	thing 133 free states			// Hanging body 5
	thing 134 free states			// Hanging body 6
	thing 135 free states			// Pool of blood 1
	thing 136 free states			// Pool of blood 2
	thing 137 free states			// Pool of brain
	
	state free 67 to 68				// Chainsaw Ready state
	state free 77 to 78				// Plasma rifle firing frames
	state free 35 to 48				// SSG
	state free 54					// Chaingun ReFire

	state free 73					// Chainsaw ReFire
	state free 97 	to 	101			// Imp fireball
	state free 158 	to 	172			// Player Death and XDeath frames
	state free 194 	to 	202			// Trooper XDeath frames
	state free 281	to	310			// Arch-Vile attack
	state free 339					// Revenant redundant FaceTarget
	state free 357	to 	361			// Manc fireball
	state free 452 	to 	454			// Imp attack
	state free 462 	to 	469			// Imp XDeath frames
	state free 575	to	576			// Hell Knight death frames
	state free 542	to 	548			// Baron of Hell death frames
	state free 631					// Spiderdemon BossDeath
	state free 700					// Cyberdemon BossDeath
	state free 720 	to 	725			// Pain Elemental Raise frames
	state free 726 	to 	798			// SS, Keen and BossBrain stuff
	state free 834	to	839			// Skull keys
	state free 880					// Chaingun pickup
	state free 887					// Unused stalagmite frame
	state free 892	to 	893			// Unused player frames
	state free 961	to	962			// Tall lamp
	state free 965	to	966			// Tall lamp 2

// STATES PROTECTED

	state protect 546 to 547		// Chaingun
	state protect 838				// Chaingun 2
	state protect 880				// Chaingun pickup
	state protect 67 to 68			// Chainsaw Ready state
	state protect 79 to 80


///////////////////
////  STRINGS  ////
///////////////////

	strings
	{
		135 "As you progress through Mars City, you find\nthe hellspawn are starting to react to\nyour incursion.\n\nTheir defences are being reinforced. They\nplan to stop you here. But you're having\nnone of it.\n\nYou nearly died here once already, you\nmust get off this dust ball and keep\npushing through to whatever horrors\nawait you next.\n\nMars be damned, perhaps it always was... "
			
		136 "You awake in a small cave. Looking outside\nyou realise that you are back on Earth.\n\nBut.. something's not right.\n\nGrowing angry, it dawns on you that while\nthis is Earth, it's not your era.\n\nThe hellspawn have gone back in time to\nthe Tudor period, for reasons unknown.\nNo matter, you will deal with them here\nlike you have everywhere else...\n\nJust hope at the end of this you can get\nback to your own time."
		
		137 "The intense heat hits you the moment you\nstep through the portal.\n\nYou seem to be on some sort of a tropical\nisland, where vast jungles and volcanos\nawait you, along with the hellspawn that\nhave plagued your every step.\n\nYou sense a powerful presence here...\nPerhaps the leader of this retched army?"
		
		138 "As the master of the horde dies in a\nglorious hail of blood and guts, you find\nthat time starts to distort. You are\nprepared for death but instead find\nyourself where this story began.\n\nYou stand next to the ruins of your home.\nNot long after, you start to see humans\nagain, survivors of this terrible war.\n\nHumanity lives again, thanks to you.\nThe Veteran of the long war.\n\nThanks to everyone that have played or\nhelped make the 1k trilogy a success.\n\n-Liberation 2021- "
					 
		139 "What's this? A tech base in the middle of\nthe Tudor period?\n\nFine then... How hard can it be?!\n\n...Now where did I put my flashlight?"
		
		140 "Tough times ahead.\n\nNot a puzzle map this time, thank god.\n\nEven so, better think fast!"
		
		141 "ZINTBG1"
		142 "ZINTBG2"
		143 "ZINTBG3"
		144 "ZINTBG4"
		145 "ZINTBG5"
		146 "ZINTBG6"
		
		152 "PLASMA ZOMBIE"
		
		439 "You need a blue key to activate this."
		440 "You need a purple key to activate this."
		441 "You need a green key to activate this."
		442 "You need a blue key for this door."
		443 "You need a green key for this door."
		444 "You need a purple key for this door."
		454 "Picked up a blue card."
		455 "Picked up a green card."
		456 "Picked up a purple card."
		457 "Picked up a sapphire key."
		458 "Picked up an emerald key."
		459 "Picked up an amethyst key."
		473 "Picked up a cell clip."
		474 "Picked up a cell pack."
		478 "Got the BFG9000! Oh, yes."
		479 "Got an assault rifle!"
		481 "Got a rocket launcher!"
		482 "Got a plasma rifle!"
		483 "Got a shotgun!"
		484 "Got the super shotgun!"
		
		677 "Dust Devils"
		678 "Tharsis Awakens"
		679 "Lower City Grime"
		680	"Monuments of Mars"
		681 "Martian Vista"
		682 "A Memory From Earth"
		683 "Back Alleys"
		684 "Concrete Avalanche"
		685 "Martian Midnight"
		686 "Red Alley"
		687 "In Kasei Valles"
		688 "Forlorn Hope"
		689 "Viridical Mines"
		690 "Bad Manor"
		691 "The Black Ramparts"
		692 "Corruption"
		693 "A Thousand Stars"
		694 "A Farewell to Dark Ages"
		695 "Gutter Waltz"
		696 "Wall of Omens"
 		697 "Skull"
		698 "Crossbones"
		699 "Exile's Path"
		700 "Efflorescence"
		701 "Strangling Fruit"
		702 "A Trail of Scorched Earth"
		703 "Nightfall"
		704 "Tropical Warfare"
		705 "Path of the Withered Vine"
		706 "False Deity"
		707 "Farfarout"
		708 "Vintage Murderfest"
		
		939		"TRO2"		// TROO replaced
		940		"SHGN"		// SHTG replaced
		941		"PNCH"		// PUNG replaced
		942		"PSSG"		// PISG replaced
		943		"PSSF"		// PISF replaced
		945		"SHG2"		// SHT2 replaced
		946		"CHGN"		// CHGG replaced
		947		"CGFN"		// CHGF replaced
		951		"PZSG"		// PLSG replaced
		952		"PZSF"		// PLSF replaced
		957 	"FIRB"		// BAL1 replaced
		965		"BFOG"		// TFOG replaced
		979		"GRCA"		// HEAD replaced
		990 	"PLSZ"		// SSWV replaced
		991 	"GARG"		// KEEN replaced
		992 	"LARD"		// BBRN replaced
		993 	"TERM"		// BOSF replaced
		1001	"CARB"		// BKEY replaced
		1002	"CARM"		// RKEY replaced
		1003	"CARG"		// YKEY replaced
		1004	"SAPH"		// BSKU replaced
		1005	"AMTH"		// RSKU replaced
		1006	"EMRD"		// YSKU replaced
		1034 	"SMOK"		// SMT2 replaced
		1046	"LAMP"		// SMIT replaced
		1047	"ANIM"		// COL1 replaced
		1048	"MRCK"		// COL2 replaced
		1049	"LGHT"		// COL3 replaced
		1050	"PROP"		// COL4 replaced
		1054	"TREE"		// TRE1 replaced
		1059	"WEED"		// COL5 replaced
		1060 	"RFTB"		// TBLU replaced
		1061	"RFTG"		// TGRN replaced
		1062	"RFTR"		// TRED replaced	
	}


///////////////////
////  PICKUPS  ////
///////////////////

	thing 61	// Computer map
	{
		clear states
		
		states
		{
			Spawn:
				PMAP E 18 Bright
				PMAP F 6 Bright
		}
	}
	
	state 874{CELL B -1 stop}	// Energy cell clip
	state 875{CELP B -1 stop}	// Energy cell pack
	
	thing 74 swap with 68	// Chaingun with cell clip
	
	thing 68 "_Cell clip" {}
	thing 69 "_Cell pack" {}

	thing 51 "_Emerald key"
	{
		clear states
		
		states
		{
			spawn:
				EMRD A 10
				EMRD A 10 Bright
				loop
		}
	}

	thing 52 "_Ruby key"
	{
		clear states
		
		states
		{
			spawn:
				AMTH A 10
				AMTH A 10 Bright
				loop
		}
	}

	thing 53 "_Sapphire key"
	{
		clear states
		
		states
		{
			spawn:
				SAPH A 10
				SAPH A 10 Bright
				loop
		}
	}


///////////////////////////
////  PROPS & EFFECTS  ////
///////////////////////////

	thing 103 "_DeathExit"		// You telefrag this instead of the IoS
	{
		Health 1
		Speed 0
		Mass 999999
		Radius 8
		Height 64
		
		clear states
		flags 0
		
		+SOLID
		+SHOOTABLE
		
		states
		{
			Spawn:
				CAND B 1 A_Look
				loop
			See:
				CAND B 4 A_Chase
				loop
			Death:
				CAND B 1 A_BrainDie
				Stop
		}
	}
	
	thing 104 "_Telefragger"	// Used to telefrag final boss
	{
		Health 1
		Speed 8
		Mass 999999
		Radius 16
		Height 128

		clear states
		flags 0
		
		+SOLID
		+SHOOTABLE
			
		state spawn thing 103 spawn
		state see thing 103 see
		
		states
		{
			Death:
				LGHT A 5 Bright A_Explode
				LGHT BCDEFG 5 Bright
				stop
		}
	}
	
	thing 8 	// Revenant fireball trail
	{
		clear states
		state spawn thing 38 spawn
	}

	
	thing 40	// Teleport fog
	{
		clear states
		
		states
		{
			Spawn:
				CAND B 2
				BFOG ABCDEFG 6 Bright
				Stop
		}
	}

	thing 41	// Item respawn fog
	{
		clear states
		
		states
		{
			spawn:
				IFOG BCDE 6 Bright
				Stop
		}
	}

	thing 95 "_Tech torch (blue)"	// Small blue torch
	{
		clear states
		
		states
		{
			spawn:
				LAMP GHIJ 4 Bright
				loop
		}
	}

	thing 96 "_Tech torch (green)"	// Small green torch
	{
		clear states
		
		states
		{
			spawn:
				LAMP CDEF 4 Bright
				loop
		}
	}

	thing 97 "_Tech torch (magenta)"	// Small red torch
	{
		clear states
		
		states
		{
			spawn:
				LAMP KLMN 4 Bright
				loop
		}
	}

	thing 102 "_SmokePlume"
	{
		clear states
		flags 0
		
		states
		{
			spawn:
				SMOK ABCDEFGH 4
				loop
		}
	}
	
	thing 105 "_Sheep"		// Fluffy and immortal
	{
		height 25
		radius 24
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				ANIM A 105
				ANIM B 70
				ANIM A 35
				ANIM C 7
				ANIM D 70
				ANIM C 7
				loop
		}
	}
	
	thing 120 "_Tree 1"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		
		states
		{
			spawn:
				TREE D -1
				stop
		}
	}
	
	thing 108 "_Tree 2"
	{
		radius 32
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		
		states
		{
			spawn:
				TREE E -1
				stop
		}
	}
	
	thing 110 "_Tree 3"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				TREE F -1
				stop
		}
	}

	thing 85 "_Tree 4"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		
		states
		{
			spawn:
				TREE G -1
				stop
		}
	}

	thing 98 "_Lamp Post 1"
	{
		radius 16
		height 16
	
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				LAMP A -1
				stop
		}
	}
	
	thing 106 "_Lamp Post 2"
	{
		radius 16
		height 16
	
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				LAMP B -1
				stop
		}
	}
	
	thing 83 "_Chicken"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		states
		{
			spawn:
				ANIM G 140
				ANIM FH 7
				ANIM I 16
				ANIM HF 7
				loop
		}
	}
	
	thing 91 "_Palm Tree 1"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				TREE A -1
				stop
		}
	}
	
	thing 127 "_Palm Tree 2"
	{
		radius 16
		height 16
	
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				TREE B -1
				stop
		}
	}
	
	thing 84 "_Palm Tree 3"
	{
		radius 16
		height 16
	
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				TREE C -1
				stop
		}
	}
	
	thing 137 "_Palm Tree 4"
	{
		radius 16
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			spawn:
				TREE H -1
				stop
		}
	}
	
	thing 86 "_Pig"
	{
		radius 16
		height 24
		
		clear states
		flags 0
		
		states
		{
			spawn:
				ANIM J -1
				stop
		}
	}
	
	thing 114 "_Rock 1"
	{
		clear states
		flags 0
		
		states
		{
			Spawn:
				MRCK A -1
				Stop
		}
	}
	
	thing 115 "_Rock 2"
	{
		clear states
		flags 0
		
		states
		{
			Spawn:
				MRCK B -1
				Stop
		}
	}
	
	thing 134 "_Rock 3"
	{
		height 16
		
		clear states
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				MRCK C -1
				Stop
		}
	}
	
	thing 87 "_Barrel (wood)"
	{
		height 16
		radius 14
		
		clear states
		
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				PROP A -1
				Stop
		}
	}
	
	thing 90 "_Barrel (metal)"
	{
		height 16
		radius 14
		
		clear states
		
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				PROP D -1
				Stop
		}
	}
	
	thing 88 "_Grass patch 1"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				WEED A -1
				Stop
		}
	}
	
	thing 89 "_Grass patch 2"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				WEED B -1
				Stop
		}
	}
	
	thing 126 "_Trash 1"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				PROP B -1
				Stop
		}
	}
	
	thing 133 "_Trash 2"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				PROP C -1
				Stop
		}
	}
	
	thing 109 "_Pipe 1"
	{
		height 16
		
		clear states
		
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				PROP E -1
				Stop
		}
	}
	
	thing 136 "_Pipe 2"
	{
		height 16
		
		clear states
		
		flags 0
		
		+SOLID
		
		states
		{
			Spawn:
				PROP F -1
				Stop
		}
	}
	
	thing 107 "_Bush 1"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				WEED C -1
				Stop
		}
	}
	
	thing 111 "_Bush 2"
	{
		clear states
		
		flags 0
		
		states
		{
			Spawn:
				WEED D -1
				Stop
		}
	}

// AMBIENT SOUNDS

	thing 135		// Waterfall
	{
		flags 0
		+NOSECTOR
		+NOBLOCKMAP
		
		PainSound "SSDTH"
		
		clear states
		
		states
		{
			spawn:
				CAND E 160 A_Pain
				loop
		}
	}

	thing 121		// Jungle
	{
		flags 0
		+NOSECTOR
		+NOBLOCKMAP
		
		PainSound "KEENDT"
		
		clear states
		
		states
		{
			spawn:
				CAND E 270 A_Pain
				loop
		}
	}

	thing 112		// Drone
	{
		flags 0
		+NOSECTOR
		+NOBLOCKMAP
		
		PainSound "BOSCUB"
		
		clear states
		
		states
		{
			spawn:
				CAND E 158 A_Pain
				loop
		}
	}
	
// NON-BLOCKING HANGING STUFF

	each thing from 129 to 132 { -SOLID }

//	IND. STATES

	state 960 {goto 959}		// Tall lamp
	state 964 {goto 963}		// Tall lamp 2


///////////////////
////  WEAPONS  ////
///////////////////


	ammo 2
	{
		max 300
		pickup 10
	}

//--------------------------------------------------------

	weapon 0	// Fist
	{
		clear states
		
		states
		{
			ready:
				PNCH A 1 A_WeaponReady
				loop
			select:
				PNCH A 1 Offset(1,52) A_Raise
				goto ready
			deselect:
				PSSG A 1 Offset(1,92) A_LoadShotgun2
				PSSG A 1 A_Lower
				wait
			fire:
				PNCH B 4 Offset(1,32)
				PNCH C 4 A_Punch
				PNCH D 4
				PNCH C 3
				PNCH B 2
				goto ready
		}
	}

//--------------------------------------------------------
	
	weapon 1	// Pistol
	{
		clear states
		state deselect weapon 0 deselect
		
		states
		{
			ready:
				PSSG A 1 A_WeaponReady
				loop
			select:
				PSSG A 1 Offset(1,52) A_Raise
				goto ready
			fire:
				PSSG A 1
				PSSF A 3 A_FirePistol
				PSSG BA 3
				goto ready
			flash:
				PSSF A 4 A_Light1
				goto lightdone
        }
    }

//--------------------------------------------------------
	
	weapon 2	// Shotgun
	{
		clear states
		state deselect weapon 0 deselect
		
		states
		{
			ready:
				SHGN A 1 A_WeaponReady
				loop
			select:
				SHGN A 1 Offset(1,52) A_Raise
				goto ready
			fire:
				SHGN A 3
				SHGN I 3 A_FireShotgun
				SHGN J 4 
				SHGN C 2
				SHGN D 5 
				SHGN F 4
				SHGN H 5
				SHGN C 2
				SHGN B 1
				goto ready
			flash:
				CAND B 4 Bright A_Light2
				CAND B 3 Bright A_Light1
				goto lightdone
		}
	}

//--------------------------------------------------------
	
	// Some shenanigans to work around hardcoded Chaingun flash frame behavior
	
	state unprotect 880
	
	state 880
	{
		MGUN B -1
		stop
	}
	
	state 52
	{
		CGFN A 2 Bright A_FireCGun
		goto 838
	}
	
	state unprotect 838
	
	state 838
	{
		CHGN A 1
		goto 53
	}
	
	state 53
	{
		CGFN B 1 Bright A_FireCGun
		goto 546
	}
	
	state unprotect 546 to 547
	
	state fill 546
	{
		CHGN BA 1
		goto 49
	}
	
	state 55
	{
		CAND B 3 A_Light2
		goto 1
	}

	state 56
	{
		CAND B 3 A_Light1
		goto 1
	}
	
	weapon 3	// Assault Rifle
	{
		clear state select
		clear state fire

		state deselect weapon 0 deselect
		state fire 52
		
		states
		{
			select:
				CHGN A 1 Offset(1,52) A_Raise
				goto ready
		}
	}

//--------------------------------------------------------
	
	weapon 4	// Rocket launcher
	{
		clear state select
		state deselect weapon 0 deselect
		
		states
		{
			select:
				MISG A 1 Offset(1,52) A_Raise
				goto ready
		}
	}

//--------------------------------------------------------

	weapon 5 	// Plasma rifle
	{
		clear state select
		clear state fire
		
		state deselect weapon 0 deselect
		
		states
		{
			fire:
				CAND B 3 A_FirePlasma
				PZSG B 2 A_ReFire
				PZSG D 1
				PZSG E 16
				PZSG D 2
				PZSG C 2
				goto ready
			select:
				PZSG A 1 Offset(1,52) A_Raise
				goto ready
		}
	}

//--------------------------------------------------------
	
	weapon 6	// BFG
	{
		clear state select
		state deselect weapon 0 deselect
		
		states
		{
			select:
				BFGG A 1 Offset(1,52) A_Raise
				goto ready
		}
	}

//--------------------------------------------------------
	
	state unprotect 67 to 68
	
	state fill 67
	{
		SAWG CD 2 A_WeaponReady
		goto 67
	}
	
	weapon 7	// Chainsaw
	{
		clear state select
		
		state deselect weapon 0 deselect
		
		states
		{
			select:
				SAWG A 1 Offset(1,52) A_Raise
				goto ready
		}
	}

	state 72 {goto 67}	// Removing Chainsaw ReFire

//--------------------------------------------------------
	
	weapon 8	// Super shotgun
	{
		clear state select
		clear state flash
		
		state deselect weapon 0 deselect
		
		states
		{
			select:
				SHG2 A 1 Offset(1,52) A_Raise
				goto ready
			fire:
				SHG2 B 4 Bright A_FireShotgun2
				SHG2 C 3 Bright
				SHG2 A 4 A_CheckReload
				SHG2 D 2 A_Light1
				SHG2 E 8 
				SHG2 F 2 A_OpenShotgun2
				SHG2 G 10
				SHG2 I 3
				SHG2 K 3  A_LoadShotgun2
				SHG2 L 2
				SHG2 MN 3
				SHG2 O 4
				SHG2 P 1 A_CloseShotgun2
				goto ready
			flash:
				CAND B 12 A_Light2
				goto lightdone
		}
	}


////////////////////
////  MONSTERS  ////
////////////////////

	
	thing 1		// Player
	{
		clear state Death
		clear state XDeath
		
		states
		{
			Death:
				PLAY H 10
				PLAY I 10 A_Scream
				PLAY J 10 A_Fall
				PLAY K 10
			Deadbody:
				PLAY N -1
				stop
			XDeath:
				PLAY O 5
				goto 228
		}
	}
	
	thing 113 	// Dead Marine
	{
		clear states
		
		state spawn thing 1 deadbody
	}
	
	thing 2		// Trooper
	{
		clear state XDeath
		
		states
		{
			XDeath:
				POSS M 5
				goto 228
		}
	}
	
	thing 5		// Arch-Vile attack
	{
		clear states
		
		states
		{
			Spawn:
				FIRE A 3 Bright A_StartFire
				FIRE BA 3 Bright A_Fire
				FIRE B 3 Bright A_FireCrackle
				FIRE CBCBCDCDE 3 Bright A_Fire
				FIRE D 3 Bright A_FireCrackle
				FIRE EDEFGH 3 Bright A_Fire
				Stop
		}
	}
	
	thing 6		// Revenant
	{
		clear state missile
		state missile 340
	}
	
	thing 9		// Mancubus
	{
		clear state death
		
		states
		{
			Death:
				FATT K 6
				FATT L 6 A_Scream
				FATT M 6 A_Fall
				FATT NOPQRS 6
				FATT T -1
				Stop
		}
	}
	
	thing 10	// Manc fireball
	{
		clear states
		
		states
		{
			Spawn:
				MANF AB 4 Bright
				loop
			Death:
				MISL B 8 Bright
				goto 128
		}		
	}
	
	thing 11 swap with 24	// Chaingun sargeant with SS Nazi
	
	thing 11 "_PlasmaZombie"	// Plasma zombie
	{
		clear states
		
		DeathSound "PODTH2"
		
		state XDeath 228
		states
		{
			Spawn:
				PLSZ AB 10 A_Look
				Loop
			See:
				PLSZ AABBCCDD 3 A_Chase
				Loop
			Missile:
				PLSZ E 10 A_FaceTarget
			ReFire:
				PLSZ F 6 Bright A_BspiAttack
				PLSZ E 4 
				PLSZ F 1 Bright A_CPosRefire
				Goto ReFire
			Pain:
				PLSZ G 3
				PLSZ G 3 A_Pain
				Goto See
			Death:
				PLSZ H 5
				PLSZ I 5 A_Scream
				PLSZ J 5 A_Fall
				PLSZ K 5
				PLSZ L -1
				Stop
			Raise:
				PLSZ L 5
				PLSZ KJIH 5
				Goto See 
		}
	}
	
	thing 12 "_Greater Imp"		// Imp
	{
		clear state missile
		clear state melee
		
		states
		{
			Missile:
				TRO2 EF 8 A_FaceTarget
				TRO2 G 6 A_HeadAttack
				goto see
			XDeath:
				TRO2 N 5
				goto 228
		}
	}

	thing 15 	// Cacodemon
	{
		clear state death
		
		states
		{
			Death:
				GRCA G 6
				GRCA H 8 A_Scream
				GRCA I 8 
				GRCA J 8
				GRCA K 8 A_Fall
				GRCA L 8
				GRCA M -1
		}
	}
	
	thing 19 {health 50}	// Lost Soul health nerf
	
	thing 21		// Arachnotron
	{
		clear state death
		
		states
		{
			Death:
				BSPI J 20 A_Scream
				BSPI K 7 A_Fall
				BSPI LMNO 7
				BSPI P -1
				Stop
		}
	}
	
	thing 23 	// Pain Elemental
	{
		clear state raise
	}
	
	thing 25 "_Gargoyle"
	{
		Health 60
		Radius 16
		Height 36
		Mass 60
		Speed 20
		PainChance 50
		
		Flags 0
		+SOLID
        +SHOOTABLE
        +COUNTKILL
		+FLOAT
		+NOGRAVITY
		
		SeeSound "KEENPN"
		PainSound "KEENPN"
		DeathSound "SLOP"
		ActiveSound "BGACT"
		
		clear states
		
		States
		{
			Spawn:
				GARG ABCB 10 A_Look
				Loop
			See:
				GARG BBCC 3 A_Chase
				Loop
			Missile:
				GARG D 5 Bright
				GARG E 5 Bright A_FaceTarget
				GARG F 8 Bright A_HeadAttack
				Goto See
			Pain:
				GARG G 2
				GARG G 2 A_Pain
				Goto See
			Death:
				GARG H 5 
				GARG I 4 A_Scream
				GARG J 4 
				GARG K 4 A_Fall
				GARG LMN 4
				GARG O -1			
				Stop
			Raise:
				GARG NMLKJIH 4
				goto see
		}
	}
	
	thing 26 "_Big Boss"
	{
		Health 350000
		Radius 80
		Height 110
		Mass 50000
		Speed 20
		PainChance 0
		
		+NOBLOOD
		+COUNTKILL
		
		SeeSound "BOSPN"
		
		clear states
		
		states
		{
			Spawn:
				LARD B 1 A_Look
				loop
			See:
				LARD A 4 A_Hoof
				LARD BCDE 4 A_Chase
				LARD F 4 A_Metal
			Missile:
				LARD G 10 A_SpidRefire
				LARD H 0 A_FatAttack1
				LARD H 0 A_FatAttack2
				LARD H 8 Bright A_FatAttack3
				goto missile
			Pain:
				LARD U 6 A_BrainPain
				LARD V 6 
				LARD J 280
				goto see
			Death:
				LARD K 8 Bright A_Explode
				LARD L 8 Bright A_BrainScream
				LARD M 8 Bright A_Fall
				LARD NOPQRS 8 Bright
				LARD T 280
				LARD T -1 A_BrainDie
				Stop
		}
	}
	
	thing 32 "_Flame Projectile"
	{
		Speed 20
		Radius 6
		Height 4
		Damage 5
		
		SeeSound "flamst"
		PainSound ""
		AttackSound ""
		DeathSound "flamst"
		
		clear states
		
		states
		{
			Spawn:
				FIRB AB 6 Bright
				FIRB CDE 5 Bright
			Death:
				FIRB FGHI 3 Bright
				FIRB J 3 Bright
				stop
		}
	}
	
	thing 29 : thing 32 "_Flame Projectile 2" { -NOCLIP }	// Demon spawn cube replacement 
	
	thing 27 "_Flame tower"		// Demon spawner replacement
	{
		-NOSECTOR
		
		clear states
		
		states
		{
			Spawn:
				SMOK I 4 Bright A_Look
				loop
			See:
				SMOK I 0 Bright A_BrainAwake
			Spit:
				SMOK I 3 Bright A_BrainSpit
				SMOK J 3 Bright A_BrainSpit
				goto spit
		}
	}

	
	thing 28	// Flame tower target
	{ 
		radius 8
		
		-NOBLOCKMAP
		-NOSECTOR

		states
		{
			spawn:
				CAND B 4
				loop
		}
	}
	
	thing 33		// Caco projectile
	 {
		Damage 4
		
		clear states
		
		states
		{
			Spawn:
				FIRB KL 4 Bright
				loop
			Death:
				FIRB MN 4 Bright 
				FIRB OP 4 Bright
				stop
		}
	 }
	
	thing 116 "_Hell Scorcher"
	{
		Health 500
		Radius 24
		Height 64
		Mass 600
		Speed 12
		PainChance 50
		
		Flags 0
		+SOLID
		+SHOOTABLE
		+COUNTKILL
		
		SeeSound "BOSPN"
		PainSound "TINK"
		DeathSound "SKLDTH"
		
		clear states
		
		states
		{
			Spawn:
				TERM A 10 A_Look
				Loop
			See:
				TERM A 4 A_Chase
				TERM B 5 A_Chase
				TERM C 4 A_Chase
				TERM D 5 A_Chase
				Loop
			Missile:
				TERM E 10 A_FaceTarget
				TERM FFFFFFFF 1 Bright A_TroopAttack
				TERM E 4
				Goto See
			Pain:
				TERM G 3
				TERM G 3 A_Pain
				Goto See
			Death:
				TERM G 18 A_Scream
				TERM H 6 
				TERM IJ 6 Bright 
				TERM KLM 6 Bright A_Explode
				TERM N 6
				TERM O 5 A_Fall
				TERM P -1
				Stop
		}
	}
	
	thing 16		// Baron of Hell
	{
		clear state death
		
		states
		{
			death:
				BOSS I 8
				BOSS J 8 A_Scream
				BOSS K 8
				BOSS L 8 A_Fall
				BOSS O -1
				Stop
		}
	}

//	IND. STATES

	state 574 {goto 577}		// Hell Knight death frame simplification
	state 630 {SPID S -1}
	state 699 {CYBR P -1}

