--#============================================================================================================================#
--GUN TROOPS! By Metalwario64 and Golden Shine! Comments here by Golden Shine!

--Since I don't know how many mods will be added that want to use these enemies at once,
--I'll make a system that tries to prioritize the newest versions and otherwise blocks content from older versions.
--It's not perfect, I can't stop sprites and SOC content from being added, but it shouldn't be too game-breaking anyway.
--#============================================================================================================================#

--<#CURRENT VERSION#>--
rawset(_G,"GUN_V",{})
GUN_V.version = 001 --Remember to increase this number with every public release!

--I'll attempt to use sub tables+functions this time, rather than make a billion rawsets. 
--Every project I'll try to adapt a few new tricks, so wish me luck!

if not GUN_Troops --No current version loaded, go ahead and add it!
or not GUN_Troops.version 
or (GUN_Troops.version < GUN_V.version) --Version is higher than last added one, continue!

	rawset(_G,"GUN_Troops",{}) --This is the main table we'll be using for most of it.
	GUN_Troops.version = GUN_V.version
	GUN_Troops.blockload = false
	
	if consoleplayer or displayplayer
		CONS_Printf(consoleplayer or displayplayer, "\x8c"+"GUN Troops v"+GUN_Troops.version+"\x80"+" for [SRB2 2.2.13] by\x82 Golden Shine\x80 and\x81 MetalWario64")
	end
end
local GUN = GUN_Troops --I'll shorten the GUN_Troops table to GUN!

--BUG TESTING FUNCTIONS! Should probably remove after the mod's done.

rawset(_G, "preent", function(message) --Error print that calls attention with SFX.
	print("\x85"+message)
 	S_StartSound(nil, sfx_skid)
	P_StartQuake(50*FRACUNIT, 12)
end)
rawset(_G, "priint", function(message, priority, p) --Priority-dependent for version of print.
	priority = (priority) or FRACUNIT*3777
	if (priority > 1) --MAGIC debug number Make >= 0 to display all debug messages.
		if p and (p == consoleplayer)
			CONS_Printf(p, message)
		else
			print(message)
		end
	end
end)

