freeslot("sfx_lotede")

enemyList["bluecrawla"] = {
		name = "Blue Crawla",
		skillchance = 100,	-- /100, probability of using a skill
		level = 84,
		hp = 600,
		sp = 260,
		strength = 50,
		magic = 72,
		endurance = 47,
		luck = 53,
		agility = 57,
		melee_natk = "rocket_start",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ELEC,
		resist = ATK_BLESS|ATK_CURSE,
		thinker = generalEnemyThinker,
		r_exp = 1750,

		anim_stand = 		{SPR_POSS, A, 10},
		anim_stand_hurt =	{SPR_POSS, A, 1},
		anim_move =			{SPR_POSS, A, B, C, D, E, F, 2},
		anim_run =			{SPR_POSS, A, B, C, D, E, F, 2},
		anim_hurt =			{SPR_POSS, E, 35},
		anim_getdown =		{SPR_POSS, A, 1},
		anim_downloop =		{SPR_POSS, A, 1},
		anim_getup =		{SPR_POSS, A, 1},	
		anim_atk =			{SPR_POSS, A, B, C, D, E, F, 2},
		
		
		skills = {"rocket_start", "ice amp", "ice boost", "crystal_edge", "crest", "teara", "cocytus"},
	}
	
enemyList["darkbluecrawla"] = {
		name = "Blue Crawla?",
		skillchance = 100,	-- /100, probability of using a skill
		level = 84,
		hp = 600,
		sp = 260,
		strength = 50,
		magic = 72,
		endurance = 47,
		luck = 53,
		agility = 57,
		melee_natk = "rocket_start",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ELEC,
		resist = ATK_BLESS|ATK_CURSE,
		thinker = generalEnemyThinker,
		r_exp = 1750,
		thinkframe = function(mo)
			if not singlesetup
				mo.colorized = true 
				mo.color = SKINCOLOR_GREEN
				mo.singlesetup = true
			end
			if mo and mo.valid and mo.hp
				if not P_RandomRange(0,4)
					local thok = P_SpawnMobj(mo.x + P_RandomRange(-40, 40)*FRACUNIT, mo.y + P_RandomRange(-40, 40)*FRACUNIT, mo.z + P_RandomRange(20,60)*FRACUNIT, MT_DUMMY)
					thok.flags = MF_NOBLOCKMAP
					thok.color = SKINCOLOR_FOREST
					if (leveltime%2) then thok.color = SKINCOLOR_EMERALD end
						thok.tics = 35
						thok.scalespeed = FRACUNIT/32
						thok.destscale = 1
						thok.momz = P_RandomRange(-3, -1)*FRACUNIT
				end	
			end	
		end,		

		anim_stand = 		{SPR_POSS, A, 10},
		anim_stand_hurt =	{SPR_POSS, A, 1},
		anim_move =			{SPR_POSS, A, B, C, D, E, F, 2},
		anim_run =			{SPR_POSS, A, B, C, D, E, F, 2},
		anim_hurt =			{SPR_POSS, E, 35},
		anim_getdown =		{SPR_POSS, A, 1},
		anim_downloop =		{SPR_POSS, A, 1},
		anim_getup =		{SPR_POSS, A, 1},	
		anim_atk =			{SPR_POSS, A, B, C, D, E, F, 2},
		
		
		skills = {"darkhourcurse", "rocket_start", "ice amp", "ice boost", "bufudyne", "rakukaja", "diarama", "mabufudyne"},
}	
	

enemyList["redcrawla"] = {
		name = "Red Crawla",
		skillchance = 100,	-- /100, probability of using a skill
		level = 84,
		hp = 720,
		sp = 300,
		strength = 60,
		magic = 77,
		endurance = 52,
		luck = 55,
		agility = 62,
		melee_natk = "rocket_start",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ELEC,
		resist = ATK_BLESS|ATK_CURSE,
		thinker = generalEnemyThinker,
		r_exp = 1900,

		anim_stand = 		{SPR_SPOS, A, 10},
		anim_stand_hurt =	{SPR_SPOS, A, 1},
		anim_move =			{SPR_SPOS, A, B, C, D, E, F, 2},
		anim_run =			{SPR_SPOS, A, B, C, D, E, F, 2},
		anim_hurt =			{SPR_SPOS, E, 35},
		anim_getdown =		{SPR_SPOS, A, 1},
		anim_downloop =		{SPR_SPOS, A, 1},
		anim_getup =		{SPR_SPOS, A, 1},	
		anim_atk =			{SPR_SPOS, A, B, C, D, E, F, 2},
		
		
		skills = {"rocket_start", "fire amp", "fire boost", "cyclone_napalm", "saintly_force", "orbal_down", "lord_inferno"},
}

enemyList["darkredcrawla"] = {
		name = "Red Crawla?",
		skillchance = 100,	-- /100, probability of using a skill
		level = 84,
		hp = 720,
		sp = 300,
		strength = 60,
		magic = 77,
		endurance = 52,
		luck = 55,
		agility = 62,
		melee_natk = "rocket_start",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ELEC,
		resist = ATK_BLESS|ATK_CURSE,
		thinker = generalEnemyThinker,
		r_exp = 1900,
		thinkframe = function(mo)
			if not singlesetup
				mo.colorized = true 
				mo.color = SKINCOLOR_GREEN
				mo.singlesetup = true
			end
			if mo and mo.valid and mo.hp
				if not P_RandomRange(0,4)
					local thok = P_SpawnMobj(mo.x + P_RandomRange(-40, 40)*FRACUNIT, mo.y + P_RandomRange(-40, 40)*FRACUNIT, mo.z + P_RandomRange(20,60)*FRACUNIT, MT_DUMMY)
					thok.flags = MF_NOBLOCKMAP
					thok.color = SKINCOLOR_FOREST
					if (leveltime%2) then thok.color = SKINCOLOR_EMERALD end
						thok.tics = 35
						thok.scalespeed = FRACUNIT/32
						thok.destscale = 1
						thok.momz = P_RandomRange(-3, -1)*FRACUNIT
				end	
			end	
		end,	
		
		anim_stand = 		{SPR_SPOS, A, 10},
		anim_stand_hurt =	{SPR_SPOS, A, 1},
		anim_move =			{SPR_SPOS, A, B, C, D, E, F, 2},
		anim_run =			{SPR_SPOS, A, B, C, D, E, F, 2},
		anim_hurt =			{SPR_SPOS, E, 35},
		anim_getdown =		{SPR_SPOS, A, 1},
		anim_downloop =		{SPR_SPOS, A, 1},
		anim_getup =		{SPR_SPOS, A, 1},	
		anim_atk =			{SPR_SPOS, A, B, C, D, E, F, 2},
		
		
		skills = {"darkhourcurse", "rocket_start", "fire amp", "fire boost", "agidyne", "mamakaja", "marakunda", "maragidyne"},
}

enemyList["springshell"] = {
		name = "Spring Shell",
		skillchance = 100,	-- /100, probability of using a skill
		level = 87,
		hp = 800,
		sp = 420,
		strength = 67,
		magic = 70,
		endurance = 57,
		luck = 49,
		agility = 48,
		melee_natk = "springtoss",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ICE,
		resist = ATK_BLESS|ATK_CURSE|ATK_ELEC,
		thinker = generalEnemyThinker,
		r_exp = 2045,	

		anim_stand = 		{SPR_SSHL, A, 10},
		anim_stand_hurt =	{SPR_SSHL, A, 1},
		anim_move =			{SPR_SSHL, A, B, C, D, 2},
		anim_run =			{SPR_SSHL, A, B, C, D, 2},
		anim_hurt =			{SPR_SSHL, E, 35},
		anim_getdown =		{SPR_SSHL, A, 1},
		anim_downloop =		{SPR_SSHL, A, 1},
		anim_getup =		{SPR_SSHL, A, 1},	
		anim_atk =			{SPR_SSHL, A, B, C, D, 2},		
		
		skills = {"rocket_start", "springtoss", "elec amp", "elec boost", "ragna_blast", "saint", "clock_up", "ragna_dorian"},
}

enemyList["darkspringshell"] = {
		name = "Spring Shell?",
		skillchance = 100,	-- /100, probability of using a skill
		level = 87,
		hp = 800,
		sp = 420,
		strength = 67,
		magic = 70,
		endurance = 57,
		luck = 49,
		agility = 48,
		melee_natk = "springtoss",	-- enemies don't have crit anims for their attacks.
		weak = ATK_ICE,
		resist = ATK_BLESS|ATK_CURSE|ATK_ELEC,
		thinker = generalEnemyThinker,
		r_exp = 2045,
		thinkframe = function(mo)
			if not singlesetup
				mo.colorized = true 
				mo.color = SKINCOLOR_GREEN
				mo.singlesetup = true
			end
			if mo and mo.valid and mo.hp
				if not P_RandomRange(0,4)
					local thok = P_SpawnMobj(mo.x + P_RandomRange(-40, 40)*FRACUNIT, mo.y + P_RandomRange(-40, 40)*FRACUNIT, mo.z + P_RandomRange(20,60)*FRACUNIT, MT_DUMMY)
					thok.flags = MF_NOBLOCKMAP
					thok.color = SKINCOLOR_FOREST
					if (leveltime%2) then thok.color = SKINCOLOR_EMERALD end
						thok.tics = 35
						thok.scalespeed = FRACUNIT/32
						thok.destscale = 1
						thok.momz = P_RandomRange(-3, -1)*FRACUNIT
				end	
			end	
		end,		
		
		
		anim_stand = 		{SPR_SSHL, A, 10},
		anim_stand_hurt =	{SPR_SSHL, A, 1},
		anim_move =			{SPR_SSHL, A, B, C, D, 2},
		anim_run =			{SPR_SSHL, A, B, C, D, 2},
		anim_hurt =			{SPR_SSHL, E, 35},
		anim_getdown =		{SPR_SSHL, A, 1},
		anim_downloop =		{SPR_SSHL, A, 1},
		anim_getup =		{SPR_SSHL, A, 1},	
		anim_atk =			{SPR_SSHL, A, B, C, D, 2},		
		
		skills = {"darkhourcurse", "rocket_start", "springtoss", "elec amp", "elec boost", "ziodyne", "heat riser", "maziodyne", "dekaja"},		
}



enemyList["georeaper"] = {
		name = "Orbal Reaper", -- /Such a original enemy. Much Wow
		skillchance = 100,	-- /100, probability of using a skill
		level = 100,
		hp = 10000,
		sp = 8888,
		strength = 85,
		magic = 85,
		endurance = 99,
		luck = 90,
		agility = 85,
		melee_natk = "strike_1",	-- enemies don't have crit anims for their attacks.
		thinker = generalEnemyThinker,
		boss = true,
		endboss = true,
		turns = 2,
		scale = FRACUNIT*3/2,

		r_exp = 75000,
		anim_stand = 		{SPR_REAP, A, B, C, D, E, F, G, H, I, J, 4},
		anim_stand_hurt = 	{SPR_REAP, A, B, C, D, E, F, G, H, I, J, 4},
		anim_move =			{SPR_REAP, A, B, C, D, E, F, G, H, I, J, 4},
		anim_run =			{SPR_REAP, A, B, C, D, E, F, G, H, I, J, 4},
		anim_hurt =			{SPR_REAP, A, 10},
		anim_getdown =		{SPR_REAP, A, 1},
		anim_downloop =		{SPR_REAP, A, 1},
		anim_getup =		{SPR_REAP, A, 1},		-- enemies don't need special standing, death or revive anims.
													-- they explode on death, and cannot be revived.
													-- unless it's specified like for players.
													
		hudcutin = "REAP_A",	-- cut in
		color = SKINCOLOR_WHITE,
													
													
		skills = {"reapermusicthing", "megidolaon", "power charge", "mind charge", "megaton raid", "vicious strike", "heat riser",
					"orbal_down", "chrono_down", "phantom_pain", "lord_inferno", "cocytus",
					"NoTeamaero_storm", "golden halo", "ragna_dorian", "zeruel_cannon", "lost_eden", "adamantine_guard", "a_reflex",
					"dekaja", "innocence_arc", "death_scream", "ragna_vortex", 
					"seventh caliber", "psycho force", "abyss_fall", "diamond_nova", "crimson_ray", "judgement_bolt", "void boost 7"},
}

local dng = {
	
	name = "Geofront Sector A",											-- The Dungeon's name
	description = "Explore the Geofront during the Dark Hour.",	
	gensize = 5,															-- 1-6 sets how big the generation can get.
	floors = 20,															-- # of floors.
	level = 70,																-- Starting level
	levelcap = 99,															-- Max level
	
	weapon_addpow = 800,													-- power added to the stock equipped weapon (10:1)
	armour_adddef = 500,													-- defence added to the stock equipped wardring (10:1)
	
	dungeonmusic = "ZERGEO",												-- Music to play inside the dungeon
	mapid = 47,
	
	
	floortextures = "ERZBG4",												-- Prefix of the floor texture
	ceilingtexture = "ERZBG1",												-- Ceiling texture
	useautotile = false,													-- wether to change the floor texture based on surrounding tiles. leave to off to only use a single floor texture accross the entire floor
	startwalltexture = "ERZGREY3",											-- 1st wall texture
	texturerange = 0,														-- Texture range: How far from the startwalltexture can we randomize?
	brightness = 200,
	skynum = 9,
	maxep = 6,
	
	allowinterference = true,												-- Chooses to allow generation interference (dark floors, dread floors... etc)
	
	shufflelevel = 9,														-- Maximum shuffle time levels
	shufflepersonas = {
		"trumpeter",
		"lilith",
		"archangel",
		"raphael",
		"sati",
		"loki",
		"alice",
		"daisoujou",
		"anubis",
		"kinki",
		"quezacoatl",
		"belphegor",
		"siegfried",
		"matador",
		"hell biker",
		"byakko",
		"seiryuu",
		"mara",
		"zeit",
		"kea",
		"guy",
		"noel",
		"wazy",
		"renne",
		"earcus",
		
		},
		
		-- List of Sub-Personas.
	
	shop = "tiotrailsshop",												-- Name of the custom shop. Defaults to the regular Velvet Shop
	
	-- Item drop tables:
	itemdrops = {
		{"snuffsoul", 17},
		{"chewing soul", 10},
		{"silverring", 25},
		{"silvercombiring", 10},
		{"hypercombiring", 8},
		{"homunculus", 7},
		{"me patra gem", 10},
		{"megidola gem", 3},
		{"megidolaon gem", 2},
		{"agidyne gem", 5},
		{"bufudyne gem", 5},
		{"ziodyne gem", 5},
		{"garudyne gem", 5},
		{"psiodyne gem", 5},
		{"freidyne gem", 5},
		{"hell magatama", 2},
		{"cyclone magatama", 2},
		{"storm magatama", 2},
		{"frost magatama", 2},
		{"megidolaon gem", 2},
		{"blow bouncer", 9},
		{"magic mirror", 9},
		{"dekaja gem", 15},
		{"dekunda gem", 15},
		{"1up", 10},
		{"super1up", 5},
		{"chaos drive 2", 10},
		{"chaos drive 3", 7},
		{"hyperring", 10},
		{"diamond", 15},
		{"ruby", 13},
		{"painite", 9},
		{"tearalbalm", 10},
		{"spcharge", 16},
		{"spcharge2", 8},
		{"spcharge3", 8},
		{"revbalm", 8},
		{"celbalm", 4},
		{"zerpow", 2},
		{"antidote", 3},
		{"relaxant", 4},
		{"tape", 3},
		{"spray", 4},
		{"warmer", 3},
		{"eye", 3},
		{"mint", 3},
		{"salts", 3},
		{"curiabalm", 4},
		{"stablet", 7},
		{"recuriabalm", 4},
		{"battlescope", 7},
		
		
		{{"series", "novel"}, 12},
		{{"series", "v2-alter"}, 12},
		{{"series", "v2-vitalis"}, 9},
		{{"series", "v2-spirita"}, 9},
		{{"series", "awake"}, 8},
		{{"series", "obliance"}, 7},			
		{{"series", "freifi"}, 5},
		{{"series", "buhn"}, 1},
		{{"ring", "novel rings"}, 10},
		{{"ring", "vitalis rings"}, 5},
		{{"ring", "spirita rings"}, 5},
		{{"ring", "awake rings"}, 5},
		{{"ring", "freifi rings"}, 2},
	},
	
	-- Floor data table:
	floordata = {
		
		-- Floor 1
		[1] = {
			noreaper = nil,
			map = nil,	-- Nil map means that we let the game generate it randomly.
		},
		
		-- Floors 2, 3, and 4 will use the same data as floor 1's!
		
		-- Floor 5
		[7] = {
			map = BOSSFLOOR,
			noreaper = true,
			eventdir = 270,		-- Angle of the in-map enemy spawn
			spawndir = 90,		-- Player spawn angle
			shopdir = 0,		-- This is a boss floor.
		},

		-- Floor 6, go back to normal random floors!
		[8] = {
			noreaper = nil,
			map = nil,	-- Nil map means that we let the game generate it randomly.
		},

		[12] = {
			map = BOSSFLOOR,
			noreaper = true,
			eventdir = 270,		-- Angle of the in-map enemy spawn
			spawndir = 90,		-- Player spawn angle
			shopdir = 0,		-- This is a boss floor.
		},
		
		[13] = {
			map = BOSSFLOOR,
			noreaper = true,
			eventdir = 270,		-- Angle of the in-map enemy spawn
			spawndir = 90,		-- Player spawn angle
			shopdir = 0,		-- This is a boss floor.
		},
		
		
		[14] = {
			dungeonmusic = "AOGEO",
			noreaper = nil,
			map = nil,	-- Nil map means that we let the game generate it randomly.
		},
		
		-- Floor 10, our final floor, go back to being a boss floor for our final boss
		[17] = {
			map = BOSSFLOOR,
			noreaper = true,
			eventdir = 270,
			spawndir = 90,
			shopdir = 0,		-- This is a boss floor.
		},
		
		[18] = {
			noreaper = nil,
			map = nil,	-- Nil map means that we let the game generate it randomly.
		},
		
		[20] = {
			map = BOSSFLOOR,
			noreaper = true,
			eventdir = 270,
			spawndir = 90,
			shopdir = 0,		-- This is a boss floor.
		},
		
	},

	floorattributeoverrides = {

		[14] = {
			dungeonmusic = "AOGEO",
			brightness = 170,
		},
		
		[14] = {
			dungeonmusic = "AOGEO",
			brightness = 170,
		},
		
		[14] = {
			dungeonmusic = "AOGEO",
			brightness = 170,
		},
		
		[14] = {
			dungeonmusic = "AOGEO",
			brightness = 170,
		},
		
		[14] = {
			dungeonmusic = "AOGEO",
			brightness = 170,
		},		
	},
	
	-- Finally, our enemies.
	-- This is a small example, your tables can get a lot bigger than these but I want to keep simple and comprehensive!
	notes = {
		[GEN_PERFORATED] = "This floors seems unstable... Keep your eyes open.",
		[GEN_STRONG] = "Strong enemies detected. Please be careful...",
		[GEN_GOLD] = "Detected golden enemies. They must have something valuable.",
		[GEN_DREAD] = "Dangerous enemy detected! Get out as soon as possible!",
		[GEN_INTERFERENCE] = "An error occurred. Map is temporarily unavailable.",
		[GEN_DARK] = "The lights are out. Stay alert with your surroundings.",
		[GEN_CLEAR] = "Floor scanned. Preparing the map for this floor...",
	},	
	enemies = {
		
		-- Enemies from floor 1 onwards:
		[1] = {
			
			-- Enemy waves in floor 1
		{
			"idol_adamah",
			"nyogo_adamah",
			"idol_adamah",
		},

		{
			"giant_adamah",
			"turret_adamah",
			"turret_adamah",
			"twins_adamah",
		},

		{
			"balance_adamah",
			"giant_adamah",
			"balance_adamah",
		},

		{
			"gene_adamah",
			"knight_adamah",
			"gene_adamah",
		},

		{
			"castle_adamah",
			"turret_adamah",
			"turret_adamah",
			"castle_adamah",
		},

		{
			"minotaur_adamah",
			"dice_adamah",
			"minotaur_adamah",
		},

		{
			"dice_adamah",
			"dice_adamah",
			"nyogo_adamah",
			"dice_adamah",
			"dice_adamah",
		},

		{
			"giant_adamah",
			"giant_adamah",
			"giant_adamah",
		},

		{
			"snake_adamah",
			"phantom_adamah",
			"panzer_adamah",
			"phantom_adamah",
		},

		{
			"dice_adamah",
			"nyogo_adamah",
			"phantom_adamah",
			"dice_adamah",
		},

		{
			"sand_adamah",
			"beetle_adamah",
			"drive_adamah",
			"sand_adamah",
		},

		{
			"gene_adamah",
			"hand_adamah",
			"hand_adamah",
			"gene_adamah",
		},

		{
			"idol_adamah",
			"hand_adamah",
			"hand_adamah",
			"idol_adamah",
		},

		{
			"balance_adamah",
			"panzer_adamah",
			"balance_adamah",
		},
		
		{
			"pesce_adamah",
			"nyogo_adamah",
			"pesce_adamah",
		},

		{
			"gigas_adamah",
			"sand_adamah",
			"maya_adamah",
			"gigas_adamah",
		},

		{
			"idol_adamah",
			"idol_adamah",
			"minotaur_adamah",
			"idol_adamah",
		},

		{
			"idol_adamah",
			"hand_adamah",
			"maya_adamah",
			"idol_adamah",
		},

		{
			"minotaur_adamah",
			"minotaur_adamah",
		},

		{
			"snake_adamah",
			"panzer_adamah",
			"snake_adamah",
		},

		{
			"idol_adamah",
			"minotaur_adamah",
			"idol_adamah",
		},

		{
			"snake_adamah",
			"knight_adamah",
			"snake_adamah",
		},

		{
			"drive_adamah",
			"giant_adamah",
			"nyogo_adamah",
		},

		{
			"idol_adamah",
			"idol_adamah",
			"idol_adamah",
			"dice_adamah",
		},
		
			
		},
		
		
		-- Remember? We set floor 5 to be a boss floor above, so let's make the enemies that spawn here bosses!
		-- Mecha Sonichough the game never uses it, you can have multiple waves here to have different bosses spawn!
		
		[7] = {
						
			{	
			
			"eagle_boss1_adamah",
			"eagle_boss1_adamah",
			"eagle_boss1_adamah",
					
			},
			
		},
		
		-- And here, we're back to our normal encounters from floor 6 onwards. They can be different from the encounters we had in 1F.
		[8] = {
			
			-- Enemy waves in floor 1
				{
		"maya_monad",
		"mage_monad",
		"maya_monad",
	},
	
	{
		"maya_monad",
		"hablerie_monad",
		"maya_monad",
	},	

	{
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
	},
	
	{
		"redcrawla",
		"redcrawla",
		"redcrawla",
		"redcrawla",
	},	
	
	{
		"redcrawla",
		"darkredcrawla",
		"darkredcrawla",
		"redcrawla",
	},		
	

	{
		"bluecrawla",
		"darkbluecrawla",
		"darkbluecrawla",
		"bluecrawla",
	},

	{
		"redcrawla",
		"redcrawla",
		"redcrawla",
		"redcrawla",
	},



	{
		"bluecrawla",
		"redcrawla",
		"bluecrawla",
	},



	{
		"sand_monad",
		"maya_monad",
		"sand_monad",
	},	

	{
		"eagle_monad",
		"musha_monad",
		"musha_monad",
	},
	
	{
		"maya_monad",
		"tower_monad",
		"maya_monad",
		"maya_monad",
	},	
	
	{
		"musha_monad",
		"giant_monad",
		"mage_monad",
		"mage_monad",
	},		

	{
		"knight_monad",
		"hablerie_monad",
		"knight_monad",
		"maya_monad",
	},
	
	{
		"sand_monad",
		"turret_monad",
		"sand_monad",
	},
	
	{
		"turret_monad",
		"giant_monad",
		"turret_monad",
	},
	
	{
		"turret_monad",
		"tower_monad",
		"turret_monad",
	},	

			
		},
		
	
	[12] = {
						
			{
			
			"knight_boss1_adamah",
			"knight_boss1_adamah",
			"knight_boss1_adamah",
			
			},
			
		},
		
	[13] = {
	
			{
			
			"drive_boss_monad"
			
			},
			
		},
		
		[14] = {
			
	{
		"maya_monad",
		"basalt_monad",
		"maya_monad",
	},

	{
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
	},
	
	{
		"redcrawla",
		"redcrawla",
		"redcrawla",
		"redcrawla",
	},	
	
	{
		"redcrawla",
		"darkredcrawla",
		"darkredcrawla",
		"redcrawla",
	},		
	

	{
		"bluecrawla",
		"darkbluecrawla",
		"darkbluecrawla",
		"bluecrawla",
	},

	{
		"bluecrawla",
		"redcrawla",
		"springshell",
		"redcrawla",
	},

	{
		"springshell",
		"springshell",
	},

	{
		"darkspringshell",
		"darkspringshell",
	},

	{
		"springshell",
		"darkspringshell",
	},


	{
		"bluecrawla",
		"redcrawla",
		"bluecrawla",
	},

	{
		"springshell",
		"redcrawla",
		"springshell",
	},


	{
		"maya_monad",
		"machine_monad",
		"maya_monad",
	},

	{
		"maya_monad",
		"okina_monad",
		"maya_monad",
	},
	
	{
		"sand_monad",
		"okina_monad",
		"sand_monad",
		"gigas_monad",
	},	

	{
		"eagle_monad",
		"musha_monad",
		"musha_monad",
	},
	
	{
		"maya_monad",
		"okina_monad",
		"maya_monad",
		"maya_monad",
		"gigas_monad",
	},	
	
	{
		"musha_monad",
		"giant_monad",
		"giant_monad",
		"mage_monad",
		"mage_monad",
	},		

	{
		"knight_monad",
		"giant_monad",
		"knight_monad",
		"maya_monad",
	},
	
	{
		"sand_monad",
		"sand_monad",
		"gigas_monad",
	},
	
	{
		"giant_monad",
		"giant_monad",
	},
	
	{
		"tower_monad",
		"gigas_monad",
		
		
	},				
	
		},	
		
		[17] = {
			
			{
				"maya_boss_monad",	
			},
			
		},
		
		[18] = {
			
	{
		"maya_monad",
		"basalt_monad",
		"maya_monad",
	},

	{
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
		"bluecrawla",
	},
	
	{
		"redcrawla",
		"redcrawla",
		"redcrawla",
		"redcrawla",
	},	
	
	{
		"redcrawla",
		"darkredcrawla",
		"darkredcrawla",
		"redcrawla",
	},		
	

	{
		"bluecrawla",
		"darkbluecrawla",
		"darkbluecrawla",
		"bluecrawla",
	},

	{
		"bluecrawla",
		"redcrawla",
		"springshell",
		"redcrawla",
	},

	{
		"springshell",
		"springshell",
	},

	{
		"darkspringshell",
		"darkspringshell",
	},

	{
		"springshell",
		"darkspringshell",
	},


	{
		"bluecrawla",
		"redcrawla",
		"bluecrawla",
	},

	{
		"springshell",
		"redcrawla",
		"springshell",
	},



	{
		"maya_monad",
		"machine_monad",
		"maya_monad",
	},

	{
		"maya_monad",
		"okina_monad",
		"maya_monad",
	},
	
	{
		"sand_monad",
		"okina_monad",
		"sand_monad",
		"gigas_monad",
	},	

	{
		"eagle_monad",
		"musha_monad",
		"musha_monad",
	},
	
	{
		"maya_monad",
		"okina_monad",
		"maya_monad",
		"maya_monad",
		"gigas_monad",
	},	
	
	{
		"musha_monad",
		"giant_monad",
		"giant_monad",
		"mage_monad",
		"mage_monad",
	},		

	{
		"knight_monad",
		"giant_monad",
		"knight_monad",
		"maya_monad",
	},
	
	{
		"sand_monad",
		"sand_monad",
		"gigas_monad",
	},
	
	{
		"giant_monad",
		"giant_monad",
	},
	
	{
		"tower_monad",
		"gigas_monad",
		
		
	},	
		
		},	
		
		[20] = {
			
			{
				"georeaper",	-- The rampage drive has an "endboss" field.
			},		
			
		},
		
	},
}

P_registerCustomDungeon(dng)

attackDefs["ragna_dorian"] = {
		name = "Ragna Dorian",
		type = ATK_ELEC,
		power = 350,
		accuracy = 90,
		costtype = CST_SP,
		status = COND_SHOCK,
		statuschance = 2,
		cost = 24,
		desc = "Orbal Art.\nHeavy Elec Damage to all enemies.\nMay Shock",
		target = TGT_ALLENEMIES,
		anim = function(mo, targets, hittargets, timer)	
			local avgx, avgy = 0, 0
			for i = 1, #hittargets -- Get average position of targets
				avgx = $ + hittargets[i].x/FRACUNIT
				avgy = $ + hittargets[i].y/FRACUNIT
			end
			avgx = ($/#hittargets)*FRACUNIT
			avgy = ($/#hittargets)*FRACUNIT
			
			if timer >= 10 and timer <= 40
				if leveltime%8 == 0
					playSound(mo.battlen, sfx_zio2)
				end	
			end				
			
			if timer >= 10 and timer <= 40
				if leveltime%8 == 0
					local z2 = P_SpawnMobj(avgx + P_RandomRange(-120, 120)*FRACUNIT, avgy + P_RandomRange(-120, 120)*FRACUNIT, mo.z, MT_DUMMY)
					z2.state, z2.scale, z2.color = S_LZIO21, FRACUNIT*4, SKINCOLOR_LIME
					z2.destscale = FRACUNIT*1
				end
			end	
			
			if timer >= 40 and timer <= 80
				if leveltime%6 == 0
					playSound(mo.battlen, sfx_zio2)
				end	
			end				
			
			if timer >= 40 and timer <= 80
				if leveltime%6 == 0
					local z2 = P_SpawnMobj(avgx + P_RandomRange(-120, 120)*FRACUNIT, avgy + P_RandomRange(-120, 120)*FRACUNIT, mo.z, MT_DUMMY)
					z2.state, z2.scale, z2.color = S_LZIO21, FRACUNIT*4, SKINCOLOR_LIME
					z2.destscale = FRACUNIT*1
				end
			end
			
			if timer >= 80 and timer <= 120
				if leveltime%4 == 0
					playSound(mo.battlen, sfx_zio2)
				end	
			end				
			
			if timer >= 80 and timer <= 120
				if leveltime%4 == 0
					local z2 = P_SpawnMobj(avgx + P_RandomRange(-120, 120)*FRACUNIT, avgy + P_RandomRange(-120, 120)*FRACUNIT, mo.z, MT_DUMMY)
					z2.state, z2.scale, z2.color = S_LZIO21, FRACUNIT*4, SKINCOLOR_LIME
					z2.destscale = FRACUNIT*1
				end
			end			
			
			
			if timer == 121
				for i = 1,#hittargets -- damageObject must be used on all enemies individually.
					local target = hittargets[i]
					lightningblast(target, SKINCOLOR_LIME, FRACUNIT*3/2)
					localquake(mo.battlen, FRACUNIT*8, 8)
				end	
			end				
				
				
			if timer == 130
				for i = 1,#hittargets -- damageObject must be used on all enemies individually.
					local target = hittargets[i]
					lightningblast(target, SKINCOLOR_LIME, FRACUNIT*3/2)
					localquake(mo.battlen, FRACUNIT*10, 8)
				end	
			end			
			
			if timer == 139
				for k,v in ipairs(mo.allies)
					if v and v.control and v.control.valid
						P_FlashPal(v.control, 5, 5)
					end
				end
			end				
				
			if timer == 140
				for i = 1,#hittargets -- damageObject must be used on all enemies individually.
					local target = hittargets[i]
					lightningblast(target, SKINCOLOR_LIME, FRACUNIT*3/2)
					localquake(mo.battlen, FRACUNIT*20, 8)
					damageObject(target)

					for i = 1, 10
						local range = 1024
						local z1 = P_SpawnMobj(target.x + P_RandomRange(-range, range)*mo.scale, target.y + P_RandomRange(-range, range)*mo.scale, target.z, MT_DUMMY)
						z1.state, z1.scale, z1.color = S_LZIO11, target.scale*9/4, SKINCOLOR_LIME
						z1.destscale = target.scale
						z1.tics = $ + P_RandomRange(-1, 12)
					end
				end	
			end					
								
			
			if timer == 160
				return true
			end
		end,
}

attackDefs["lost_eden"] = {
		name = "Lost Eden",
		type = ATK_PSY,
		power = 700,
		accuracy = 90,
		costtype = CST_SP,
		statuschance = 10,
		status = COND_BRAINWASH,
		cost = 60,
		desc = "Lost Art.\nSevere Psi Damage to all enemies.\nMay Brainwash and lower Physical and Magic Attack.",
		target = TGT_ALLENEMIES,	
		custombackground = function(v, x, y, atk_color, mo) --changes the atk background and icons
			PDraw(v, x+3, y+3, v.cachePatch("LOST_ART"), V_SNAPTOLEFT)
			PDraw(v, x, y, v.cachePatch("H_ATKBG"), V_SNAPTOLEFT, v.getColormap(TC_DEFAULT, atk_color))
		end,
		hudfunc = 	function(v, mo, timer)			
						if timer > 210
						and timer < 260
							local t = timer-210
							local p = "H_ATR"..t/2
							if v.patchExists(p)
								drawScreenwidePatch(v, v.cachePatch(p))
							end
						end
					end,
			
		anim = function(mo, targets, hittargets, timer)	
			local colors = {SKINCOLOR_RED, SKINCOLOR_YELLOW, SKINCOLOR_BLUE, SKINCOLOR_GREEN, SKINCOLOR_ORANGE, SKINCOLOR_PURPLE, SKINCOLOR_MAGENTA}
			local psiocolors = {SKINCOLOR_TEAL, SKINCOLOR_YELLOW, SKINCOLOR_PINK, SKINCOLOR_BLACK, SKINCOLOR_WHITE}
			local avgx, avgy = 0, 0
			for i = 1, #hittargets -- Get average position of targets
				avgx = $ + hittargets[i].x/FRACUNIT
				avgy = $ + hittargets[i].y/FRACUNIT
			end
			avgx = ($/#hittargets)*FRACUNIT
			avgy = ($/#hittargets)*FRACUNIT
			
			if timer == 10
				playSound(mo.battlen, sfx_lotede)
				S_StartSoundAtVolume(nil,sfx_lotede,70)
			end

			if timer >= 10 and timer <= 200
			and (timer%7) == 0
				local m = P_SpawnMobj(avgx, avgy, mo.z, MT_DUMMY)
				m.sprite = SPR_NTHK
				m.color = SKINCOLOR_GOLD
				m.scale = FRACUNIT*12
				m.flags2 = $|MF2_SPLAT
				m.flags = MF_NOBLOCKMAP
				m.renderflags = $|RF_NOCOLORMAPS
				m.frame = A|FF_TRANS70
			end	

			
			if timer >= 10 and timer <= 200
				for i = 1, #hittargets
					local t = hittargets[i]
					avgx = $+ t.x/FRACUNIT
					avgy = $+ t.y/FRACUNIT
					local thok = P_SpawnMobj(t.x + P_RandomRange(-228, 228)*FRACUNIT, t.y + P_RandomRange(-228, 228)*FRACUNIT, t.z + P_RandomRange(0, 50)*FRACUNIT, MT_DUMMY)
					thok.state = S_SSPK1
					thok.momz = P_RandomRange(3, 10)*FRACUNIT
					thok.fuse = 55 - timer
					thok.tics = P_RandomRange(10, 35)
					thok.scale = FRACUNIT/2
				end					
			end
		
			local myears
			for k,v in ipairs(hittargets)
				local target = v
				local time = timer - 6*(k-1)

				if time >= 10 and time <= 90

					if leveltime%5 == 0
						local thok = P_SpawnMobj(avgx + P_RandomRange(-200, 200)*FRACUNIT, avgy + P_RandomRange(-200, 200)*FRACUNIT, mo.z + P_RandomRange(0, 200)<<FRACBITS, MT_DUMMY)
						A_OldRingExplode(thok, MT_SUPERSPARK)
						thok.flags2 = $|MF2_DONTDRAW
						if not myears
							playSound(mo.battlen, sfx_hamas1)
						end
						myears = true

						local speeds = {FRACUNIT/16, FRACUNIT/10, FRACUNIT/3, FRACUNIT/8}
						local fuses = {20, 16, 8, 16}

						for i = 1, 2
							local l = P_SpawnMobj(thok.x, thok.y, thok.z + FRACUNIT*32, MT_THOK)	-- mt_thok for auto fadeout
							l.tics = -1
							l.sprite = SPR_CARD
							l.color = colors[P_RandomRange(1, #colors)]
							l.frame = L|(i== 2 and TR_TRANS40 or TR_TRANS70)|FF_FULLBRIGHT
							l.scale = FRACUNIT/2
							l.destscale = FRACUNIT*6
							l.scalespeed = speeds[i]
							l.fuse = fuses[i]
						end
					end
					if time == 35
						for i = 1,8
							local thok = P_SpawnMobj(avgx + P_RandomRange(-40, 40)*FRACUNIT, avgy + P_RandomRange(-40, 40)*FRACUNIT, mo.z, MT_DUMMY)
							thok.state = S_SSPK1
							thok.momz = P_RandomRange(15, 30)*FRACUNIT
							thok.momx = P_RandomRange(-6, 6)*FRACUNIT
							thok.momy = P_RandomRange(-6, 6)*FRACUNIT
						end	
					end
				end
			end	
			
			if timer >= 170 and timer <= 210
			and (timer%5) == 0
				for i = 1, #hittargets
					local t = hittargets[i]
					avgx = $+ t.x/FRACUNIT
					avgy = $+ t.y/FRACUNIT
					local s = P_SpawnMobj(t.x + P_RandomRange(-128, 128)<<FRACBITS, t.y + P_RandomRange(-128, 128)<<FRACBITS, t.z + P_RandomRange(0, 192)<<FRACBITS, MT_DUMMY)
					s.color = SKINCOLOR_WHITE
					s.state = S_MEGISTAR1
					s.scale = $*2 + P_RandomRange(0, 65535)
				end	
			end		
			
			if timer >= 90 and timer <= 200
				if timer == 90
				or timer == 110
				or timer == 130
				or timer == 150
				or timer == 170
				or timer == 190
					playSound(mo.battlen, sfx_s3k74)
				end
				if not (timer%4)

					local ol = P_SpawnMobj(avgx + P_RandomRange(-200, 200)*FRACUNIT, avgy + P_RandomRange(-200, 200)*FRACUNIT, mo.z + P_RandomRange(0, 200)<<FRACBITS, MT_DUMMY)
					ol.sprite = SPR_NTHK
					ol.color = psiocolors[P_RandomRange(1, #psiocolors)]
					ol.scale = 1
					ol.destscale = FRACUNIT*32
					ol.scalespeed = FRACUNIT/5
					ol.frame = B|FF_FULLBRIGHT
					ol.tics = 20

					ol = P_SpawnMobj(avgx + P_RandomRange(-200, 200)*FRACUNIT, avgy + P_RandomRange(-200, 200)*FRACUNIT, mo.z + P_RandomRange(0, 200)<<FRACBITS, MT_DUMMY)
					ol.sprite = SPR_NTHK
					ol.color = psiocolors[P_RandomRange(1, #psiocolors)]
					ol.scale = 1
					ol.destscale = FRACUNIT*32
					ol.scalespeed = FRACUNIT
					ol.frame = B|FF_FULLBRIGHT|TR_TRANS50
					ol.tics = 8
				end
			end	
			
			if timer == 190
				for k,v in ipairs(mo.allies)
					if v and v.control and v.control.valid
						P_FlashPal(v.control, 5, 5)
					end
				end
			end	
			
			if timer >= 190 and timer <= 280
				for i = 1, 2
					local m = P_SpawnMobj(avgx, avgy, mo.z, MT_DUMMY)
					m.color = colors[P_RandomRange(1, #colors)]
					m.frame = D|FF_FULLBRIGHT|FF_TRANS50
					m.sprite = SPR_BEAM
					m.scale = FRACUNIT*10
				end	
			end

			if timer >= 190 and timer <= 280
			and (timer%5) == 0
				for i = 1, 64
					local m = P_SpawnMobj(avgx, avgy, mo.z, MT_DUMMY)
					m.state = S_SSPK1
					m.frame = A
					m.tics = TICRATE
					m.fuse = TICRATE
					m.destscale = 1
					m.color = SKINCOLOR_WHITE
					m.flags = MF_NOCLIPTHING|MF_NOCLIPHEIGHT
					m.momx = P_RandomRange(-64, 64)*FRACUNIT
					m.momy = P_RandomRange(-64, 64)*FRACUNIT
					m.momz = P_RandomRange(0, 64)*FRACUNIT
				end
			end	

			
			
			if timer == 281
				for k,v in ipairs(mo.allies)
					if v and v.control and v.control.valid
						P_FlashPal(v.control, 2, 5)
					end
				end			
				playSound(mo.battlen, sfx_s3k83)
			end	
			
			if timer == 282
				for i = 1, #hittargets
					local target = hittargets[i]
					damageObject(target)
					if target.damagestate ~= DMG_MISS
					and target.damagestate ~= DMG_BLOCK
					and target.damagestate ~= DMG_DRAIN 
						buffStat(target, "mag", -25)
						buffStat(target, "atk", -25)
						BTL_logMessage(targets[1].battlen, "Magic Attack down!\nPhysical Attack down!")
					end						
				end
			end			
			
			if timer == 300
				return true
			end
		end,			
}

attackDefs["darkhourcurse"] = {
		name = "Infection",
		type = ATK_PASSIVE,
		passive = PSV_STARTTURN,
		desc = "Buffs your stats on each turn",
		nometronome = true,
		norandom = true,
		anim = function(mo, targets, hittargets, timer)
				if timer < 40
					BTL_logMessage(mo.battlen, mo.name.." is acting weird...\nStats increased!")
				elseif timer == 30
					mo.magic = $+2
					mo.agility = $+2
					mo.strength = $+2
				end
				if timer == 1
					playSound(mo.battlen, sfx_frei1)
					playSound(mo.battlen, sfx_eih1)
					playSound(mo.battlen, sfx_buff)
				end	
					
				if timer < 30 and leveltime%5 == 0
					for i = 1,1
						local thok = P_SpawnMobj(mo.x + P_RandomRange(-40, 40)*FRACUNIT, mo.y + P_RandomRange(-40, 40)*FRACUNIT, mo.z + P_RandomRange(30, 60)<<FRACBITS, MT_DUMMY)
						thok.flags = MF_NOBLOCKMAP
						thok.color = SKINCOLOR_GREEN
						if timer%2 then thok.color = SKINCOLOR_EMERALD end
						thok.tics = 35
						thok.scalespeed = FRACUNIT/32
						thok.destscale = 1
						thok.momz = P_RandomRange(-3, -1)*FRACUNIT
					end	
				end	
				
				if timer < 30 and leveltime%5 == 0
					local thok = P_SpawnMobj(mo.x+P_RandomRange(-70, 70)*FRACUNIT, mo.y+P_RandomRange(-70, 70)*FRACUNIT, mo.z+P_RandomRange(0, 50)*FRACUNIT, MT_DUMMY)
					thok.state = S_CDUST1
					thok.momz = P_RandomRange(3, 10)*FRACUNIT
					thok.color = SKINCOLOR_FOREST
					thok.tics = P_RandomRange(10, 35)
					thok.scale = FRACUNIT*3/2
				end				
				
				
				if timer == 40
					return true
				end	
			end,	
}		


attackDefs["rocket_start"] = {
	name = "Rocket Start",
	type = ATK_STRIKE,
	power = 410,
	cost = 13,
	critical = 5,
	accuracy = 100,
	statuschance = 3,
	status = COND_DIZZY,
	costtype = CST_HPPERCENT,
	anim_norepel = true,
	desc = "Rev your engine and burst off at speed.\nMay inflict dizzy.",
	target = TGT_ENEMY, 
	anim = function(mo, targets, hittargets, timer)
		local target = hittargets[1]
		local cam = server.P_BattleStatus[mo.battlen].cam
		if timer == 1
			CAM_stop(cam)
			mo.angle = R_PointToAngle2(mo.x,mo.y,target.x,target.y)
			mo.resetz = mo.z
			local cx = mo.x + 256*cos(mo.angle)
			local cy = mo.y + 256*sin(mo.angle)
			P_TeleportMove(cam, cx, cy, mo.z + FRACUNIT*16)
			server.P_BattleStatus[mo.battlen].cam.angle = R_PointToAngle2(cam.x, cam.y, mo.x, mo.y)
		end
		if timer == 10
			ANIM_set(mo, mo.anim_run, true)
			S_StartSound(mo,sfx_s3kab)
		elseif timer == 20
			S_StartSound(mo,sfx_s3kab4)
		elseif timer == 30
			S_StartSound(mo,sfx_s3kab8)
		elseif timer == 40
			ANIM_set(mo, mo.anim_atk, true)
			S_StartSound(mo,sfx_s3kabf)
		end
		if timer == 50
			S_StartSound(mo,sfx_s3k83)
			CAM_angle(cam, mo.angle, ANG20)
		end
		if timer < 50 and timer >= 10
			local dust = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
			dust.angle = (mo.angle + ANGLE_180) + (ANG1*(P_RandomRange(-45,45))) 
			dust.state = S_CDUST1
			P_InstaThrust(dust, dust.angle, 30*FRACUNIT)
			dust.color = SKINCOLOR_WHITE
			dust.scale = FRACUNIT*2
		elseif timer < 70 and timer >= 50
			local dust = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
			dust.angle = (mo.angle + ANGLE_180) + (ANG1*(P_RandomRange(-15,15))) 
			dust.state = S_CDUST1
			P_InstaThrust(dust, dust.angle, 30*FRACUNIT)
			dust.color = SKINCOLOR_WHITE
			dust.scale = FRACUNIT*2
			P_InstaThrust(mo,mo.angle,FRACUNIT*70)
		end
		if timer == 55
			damageObject(target)
			if target.damagestate ~= DMG_MISS		-- make sure we landed the attack
			and target.damagestate ~= DMG_BLOCK
			and target.damagestate ~= DMG_DRAIN
				S_StartSound(mo,sfx_s3k9e)
				localquake(mo.battlen, FRACUNIT*20, 10)
				target.flags2 = $|MF2_SPLAT
			end
		end
		if timer == 85
			P_TeleportMove(mo,mo.x,mo.y,mo.resetz)
			mo.resetz = nil
			target.flags2 = $ & !MF2_SPLAT
			return true
		end
	end,
	critanim = function(mo, targets, hittargets, timer)
		local target = hittargets[1]
		local cam = server.P_BattleStatus[mo.battlen].cam
		if timer == 1
			CAM_stop(cam)
			mo.angle = R_PointToAngle2(mo.x,mo.y,target.x,target.y)
			mo.resetz = mo.z
			local cx = mo.x + 256*cos(mo.angle)
			local cy = mo.y + 256*sin(mo.angle)
			P_TeleportMove(cam, cx, cy, mo.z + FRACUNIT*16)
			server.P_BattleStatus[mo.battlen].cam.angle = R_PointToAngle2(cam.x, cam.y, mo.x, mo.y)
		end
		if timer == 5
			ANIM_set(mo, mo.anim_run, true)
			S_StartSound(mo,sfx_s3kab)
		elseif timer == 10
			S_StartSound(mo,sfx_s3kab2)
		elseif timer == 15
			S_StartSound(mo,sfx_s3kab4)
		elseif timer == 20
			S_StartSound(mo,sfx_s3kab6)
		elseif timer == 25
			ANIM_set(mo, mo.anim_atk, true)
			S_StartSound(mo,sfx_s3kab8)
		elseif timer == 30
			S_StartSound(mo,sfx_s3kaba)
		elseif timer == 35
			S_StartSound(mo,sfx_s3kabc)
		elseif timer == 40
			S_StartSound(mo,sfx_s3kabe)
		elseif timer == 45
			S_StartSound(mo,sfx_s3kabf)
		end
		if timer == 50
			S_StartSound(mo,sfx_s3k83)
			CAM_angle(cam, mo.angle, ANG10)
		end
		if timer < 50 and timer >= 5
			for i = 1,3
				local dust = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
				dust.angle = (mo.angle + ANGLE_180) + (ANG1*(P_RandomRange(-45,45))) 
				dust.state = S_CDUST1
				P_InstaThrust(dust, dust.angle, 30*FRACUNIT)
				dust.color = SKINCOLOR_WHITE
				dust.scale = FRACUNIT*2
			end
		elseif timer < 70 and timer >= 50
			for i = 1,5
				local dust = P_SpawnMobj(mo.x, mo.y, mo.z, MT_DUMMY)
				dust.angle = (mo.angle + ANGLE_180) + (ANG1*(P_RandomRange(-15,15))) 
				dust.state = S_CDUST1
				P_InstaThrust(dust, dust.angle, 30*FRACUNIT)
				dust.color = SKINCOLOR_WHITE
				dust.scale = FRACUNIT*2
			end
			P_InstaThrust(mo,mo.angle,FRACUNIT*70)
		end
		if timer == 55
			damageObject(target)
			if target.damagestate ~= DMG_MISS		-- make sure we landed the attack
			and target.damagestate ~= DMG_BLOCK
			and target.damagestate ~= DMG_DRAIN
				S_StartSound(mo,sfx_s3k9b)
				localquake(mo.battlen, FRACUNIT*20, 10)
				target.flags2 = $|MF2_SPLAT
				target.momz = 0
				target.prevscale = target.scale
				target.scale = $*3
			end
		end
		if timer == 95
			P_TeleportMove(mo,mo.x,mo.y,mo.resetz)
			mo.resetz = nil
			target.flags2 = $ & !MF2_SPLAT
			target.scale = target.prevscale
			target.prevscale = nil
			return true
		end
	end,
}

attackDefs["springtoss"] = {
		name = "Spring Toss",
		type = ATK_STRIKE,
		power = 410,
		accuracy = 95,
		costtype = CST_SP,
		luckbased = true,	-- use luck instead of agility
		cost = 13,
		desc = "Toss a spring to the enemy",
		target = TGT_ENEMY,
		anim = function(mo, targets, hittargets, timer)
				local target = hittargets[1]
				
				if timer == 10
					playSound(mo.battlen, sfx_ltchr)
				end 
				
				if timer >= 10 and timer <= 40
					local sx = mo.x + P_RandomRange(-32,32)*FRACUNIT
					local sy = mo.y + P_RandomRange(-32,32)*FRACUNIT
					local sz = mo.z + P_RandomRange(0,32)*FRACUNIT
					
					local s = P_SpawnMobj(sx, sy, sz, MT_DUMMY)

					s.frame = A
					s.color = SKINCOLOR_YELLOW
					s.scale = FRACUNIT
					s.destscale = FRACUNIT/5
					s.scalespeed = (FRACUNIT*4/5)/9
					s.target = mo
					s.tics = 10
					s.momx = (mo.x - s.x)/10
					s.momy = (mo.y - s.y)/10
					s.momz = (mo.z - s.z)/10
				end 			
				
				if timer == 41
					playSound(mo.battlen, sfx_spring)
					playSound(mo.battlen, sfx_s3k51)
					mo.angle = R_PointToAngle2(mo.x, mo.y, target.x, target.y)

						local z = mo.z
						local hit = P_SpawnMobj(target.x & (64*FRACUNIT -1), target.y & (64*FRACUNIT -1), target.subsector.sector.floorheight, MT_NULL)
						hit.tics = 55

						local dist = P_AproxDistance(target.x - mo.x, target.y - mo.y)
						local horizontal = dist / 55
						local vertical = FixedMul((gravity*55)/2, mo.scale)
						
						local bruh = P_SpawnMobj(mo.x,mo.y,mo.z,MT_YELLOWSPRING)
						
						bruh.momx = FixedMul(horizontal, cos(mo.angle))
						bruh.momy = FixedMul(horizontal, sin(mo.angle))
						bruh.momz = vertical
						bruh.scale = mo.scale
						bruh.fuse = 50
						target.bruhn = bruh
				end
				
				if timer == 95
					playSound(mo.battlen, sfx_tf2pan)
					localquake(mo.battlen, FRACUNIT*10, 10)
					for i=1,16
						local b = P_SpawnMobj(target.x, target.y, target.z+20*FRACUNIT, MT_DUMMY)
						b.momx = P_RandomRange(-8, 8)*FRACUNIT
						b.momy = P_RandomRange(-8, 8)*FRACUNIT
						b.momz = P_RandomRange(-8, 8)*FRACUNIT
						b.state = S_SSPK1
						b.frame = A|FF_FULLBRIGHT
						b.scale = FRACUNIT*3
						b.destscale = FRACUNIT/12
					end
				end	
				
				if timer == 96
					damageObject(target)
				end
				if timer == 110
					return true
				end
				if target.bruhn and target.bruhn.valid
					local srbtwomoment = P_SpawnGhostMobj(target.bruhn)
					srbtwomoment.colorized = true
					srbtwomoment.color = SKINCOLOR_SILVER
				end					
		end,
	}



attackDefs["reapermusicthing"] = {
        name = "Reaper Music Thing",
        type = ATK_PASSIVE,
        norandom = true,
        desc = "Changes the music",
        passive = PSV_STARTBATTLE,
        anim = function(mo, targets, hittargets, timer)
            server.geobosstimer = 58
            server.fuckingmusic_a = true
        end,
    }
	
attackDefs["loamusicthing"] = {
        name = "Loa Music Thing",
        type = ATK_PASSIVE,
        norandom = true,
        desc = "Changes the music",
        passive = PSV_STARTBATTLE,
        anim = function(mo, targets, hittargets, timer)
            server.geobosstimer = 58
            server.shitmusic_b = true
        end,
    }
    		
local function GeoBossThinker(mo)
    if server and server.valid
        
        if server.geobosstimer == nil then server.geobosstimer = 0 end
        
        if server.geobosstimer > 0 then 
            server.geobosstimer = $1-1 
        end
        
        if server.geobosstimer == 2  
            if server.fuckingmusic_a
                S_ChangeMusic("FORENY",true)
            end
        elseif server.geobosstimer == 1
            server.fuckingmusic_a = false
        end
    end
end

addHook("ThinkFrame", GeoBossThinker)