local GUN = GUN_Troops

--Checks if the freeslot entry exist BEFORE adding it.
local function SingleFreeSlot(...)
	for _,slot in ipairs({...})
		if not rawget(_G, slot)
			freeslot(slot) --Since it doesn't exist yet, so go ahead and add it!
		end
	end
end

SingleFreeSlot(
--#============================================================================================================================#
--CUSTOM OBJECTS / THINGS!
--Let's setup freeslots here! Due to the order of Lua and SOC loading, objects need to be slotted here rather than in SOC
--#============================================================================================================================#

"MT_GUNHUNTER", "MT_GUNHUNTER_SHIELD", "MT_GUNHUNTER_LASER", "MT_GUNHUNTER_GRENADE", "MT_GUNHUNTER_SNIPERSHOT",

"MT_GUNBEETLE", "MT_GUNBLUEEAGLE", "MT_GUNFLIGHTPATH",

"MT_GUNAUTOFRAME", "MT_GUNOVERLAY", "MT_GUNDEBRIS",

--============================================================================================================================
--CUSTOM STATES!
--I'd normally prefer adding these through SOC, but this mod is liable to be added multiple times due to it's nature,
--So I need the SingleFreeSlot function.
--============================================================================================================================

"S_GUNH_STAND", --Gun Hunter states.
"S_GUNH_INACTIVE",
"S_GUNH_FALL",
"S_GUNH_LAND",
"S_GUNH_FLOAT",
"S_GUNH_BATTLE",

"S_GUNH_LASER", --Accompanying projectiles.
"S_GUNH_LASEREXPLODE",
"S_GUNH_GRENADE",
"S_GUNH_SNIPERSHOT",
"S_GUNH_SHIELD", 

"S_GUNB_AMBUSH", --Invisible state before teleporting in. Also the state the flightpath uses.
"S_GUNB_MONOEYE", --Default GUN Beetle. Doesn't do much.
"S_GUNB_TURRET", 
"S_GUNB_BOMBER",
"S_GUNB_SPRING",

"S_GUNE_JETPLANE",

"S_GUNAUTOFRAME", --Effect states.

--#============================================================================================================================#
--SOUND EFFECTS:
--SFX means Sounds Effects, btw. GFX is Graphical Effects. And VFX is Visual Effects. Basically the same thing.
--#============================================================================================================================#

"sfx_ghsfx1", "sfx_ghsfx2", "sfx_ghsfx3", "sfx_ghsfx4", "sfx_ghsfx5", "sfx_ghsfx6", "sfx_ghsfx7", "sfx_ghsfx8", "sfx_ghsfx9",

"sfx_ghsfxa", "sfx_ghsfxb", "sfx_ghsfxc", "sfx_ghsfxd", "sfx_ghsfxe", "sfx_ghsfxf", "sfx_ghsfxg", "sfx_ghsfxh", "sfx_ghsfxi",

"sfx_ghsfxj", "sfx_ghsfxk", "sfx_ghsfxl", "sfx_ghsfxm", "sfx_ghsfxn", "sfx_ghsfxo", "sfx_ghsfxp", "sfx_ghsfxq", "sfx_ghsfxr",

"sfx_yuedth"

) --Make sure the last final doesn't have a "," behind it!


--#============================================================================================================================#

--GHSFX is the prefix for our custom sounds!
--Here we set the captions so I can remember which sound is what. (My SLADE won't preview SFX)
--We also the flags to determine sound range.

/*
sfxinfo[sfx_ghsfx1]={caption = "Armored Menace Awakens", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfx2]={caption = "Laser Dissolve"}
sfxinfo[sfx_ghsfx3]={caption = "Mech Exploding" ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfx4]={caption = "Laser Charge"}
sfxinfo[sfx_ghsfx5]={caption = "\x82"+"Laser Fire" ,flags = SF_X2AWAYSOUND, singular = true,}
sfxinfo[sfx_ghsfx6]={caption = "Metallic Slam", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfx7]={caption = "\x85"+"Sniper Charge..." ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfx8]={caption = "\x82"+"Laser Fire 2" ,flags = SF_X4AWAYSOUND, singular = true,}
sfxinfo[sfx_ghsfx9]={caption = "Sniper Steam"}
sfxinfo[sfx_ghsfxa]={caption = "Sniper Ready" ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxb]={caption = "Mech Recoil"}
sfxinfo[sfx_ghsfxc]={caption = "Finishing Explosion" , flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxd]={caption = "The Crimson Eye of GUN"}
sfxinfo[sfx_ghsfxe]={caption = "\x82"+"GUN Beetle Zap"}
sfxinfo[sfx_ghsfxf]={caption = "GUN Mech Ambience", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfxg]={caption = "Lasersight"}
sfxinfo[sfx_ghsfxh]={caption = "\x81"+"Grenade Lob", flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxi]={caption = "Thruster Dash"}
sfxinfo[sfx_ghsfxj]={caption = "Thruster Flight"}
sfxinfo[sfx_ghsfxk]={caption = "Thruster Activate"}
sfxinfo[sfx_ghsfxl]={caption = "Armored Core"}

sfxinfo[sfx_yuedth]={caption = "SA2 explosion"}
*/

sfxinfo[sfx_ghsfx1]={caption = "Robot awaken", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfx2]={caption = "Laser Dissolve"}
sfxinfo[sfx_ghsfx3]={caption = "Mech Exploding" ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfx4]={caption = "Laser Charge"}
sfxinfo[sfx_ghsfx5]={caption = "\x82"+"Laser Fire" ,flags = SF_X2AWAYSOUND, singular = true,}
sfxinfo[sfx_ghsfx6]={caption = "Metal slam", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfx7]={caption = "\x85"+"Sniper Charge..." ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfx8]={caption = "\x82"+"Laser Fire 2" ,flags = SF_X4AWAYSOUND, singular = true,}
sfxinfo[sfx_ghsfx9]={caption = "Sniper Steam"}
sfxinfo[sfx_ghsfxa]={caption = "Sniper Ready" ,flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxb]={caption = "Mech Recoil"}
sfxinfo[sfx_ghsfxc]={caption = "Finishing Explosion" , flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxd]={caption = "The Crimson Eye of GUN"}
sfxinfo[sfx_ghsfxe]={caption = "\x82"+"GUN Beetle Zap"}
sfxinfo[sfx_ghsfxf]={caption = "Robot hum", flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_ghsfxg]={caption = "Lasersight"}
sfxinfo[sfx_ghsfxh]={caption = "\x81"+"Grenade Lob", flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_ghsfxi]={caption = "Thruster Dash"}
sfxinfo[sfx_ghsfxj]={caption = "Thruster Flight"}
sfxinfo[sfx_ghsfxk]={caption = "Thruster Activate"}
sfxinfo[sfx_ghsfxl]={caption = "Armored Core"}

sfxinfo[sfx_yuedth]={caption = "Explosion"}

