--=============================FREESLOTS============================================
--Freeslots are here. Needs to be first in line.
--==================================================================================

freeslot(
"SKINCOLOR_EMPEROR1",
"SKINCOLOR_EMPEROR2",
"SKINCOLOR_EMPEROR3",
"SKINCOLOR_EMPEROR4",
"SKINCOLOR_EMPEROR5",
"SKINCOLOR_SMS1R",
"SKINCOLOR_SMS2R",
"SKINCOLOR_SMS3R",
"SKINCOLOR_SMS4R",
"SKINCOLOR_SMS5R",
"SKINCOLOR_SMS1",
"SKINCOLOR_SMS2",
"SKINCOLOR_SMS3",
"SKINCOLOR_SMS4",
"SKINCOLOR_FLAMEBREAKER1",
"SKINCOLOR_FLAMEBREAKER2",
"SKINCOLOR_FLAMEBREAKER3",
"SKINCOLOR_FLAMEBREAKER4",
"SKINCOLOR_FLAMEBREAKER5",
"SKINCOLOR_MYSTICAL1",
"SKINCOLOR_MYSTICAL2",
"SKINCOLOR_MYSTICAL3",
"SKINCOLOR_MYSTICAL4",
"SKINCOLOR_MYSTICAL5",
"SKINCOLOR_SONIC1",
"SKINCOLOR_SONIC2",
"SKINCOLOR_SONIC3",
"SKINCOLOR_SONIC4",
"SKINCOLOR_SONIC5",
"SKINCOLOR_TRANSFORMATION1",
"SKINCOLOR_TRANSFORMATION2",
"SKINCOLOR_TRANSFORMATION3",
"SKINCOLOR_TRANSFORMATION4",
"SKINCOLOR_TRANSFORMATION5",
"SKINCOLOR_ZEEJIN1",
"SKINCOLOR_ZEEJIN2",
"SKINCOLOR_ZEEJIN3",
"SKINCOLOR_ZEEJIN4",
"SKINCOLOR_ZEEJIN5",
"SKINCOLOR_ZENITH1",
"SKINCOLOR_ZENITH2",
"SKINCOLOR_ZENITH3",
"SKINCOLOR_ZENITH4",
"SKINCOLOR_ZENITH5",
"SKINCOLOR_MOONSLAMMER1",
"SKINCOLOR_MOONSLAMMER2",
"SKINCOLOR_MOONSLAMMER3",
"SKINCOLOR_MOONSLAMMER4",
"SKINCOLOR_MOONSLAMMER5",
"SKINCOLOR_BREEZY1",
"SKINCOLOR_BREEZY2",
"SKINCOLOR_BREEZY3",
"SKINCOLOR_BREEZY4",
"SKINCOLOR_BREEZY5",
"SKINCOLOR_SOLAR1",
"SKINCOLOR_SOLAR2",
"SKINCOLOR_SOLAR3",
"SKINCOLOR_SOLAR4",
"SKINCOLOR_SOLAR5",
"SKINCOLOR_GALACTIC1",
"SKINCOLOR_GALACTIC2",
"SKINCOLOR_GALACTIC3",
"SKINCOLOR_GALACTIC4",
"SKINCOLOR_GALACTIC5",
"SKINCOLOR_SMSROVERGLOW",
"SKINCOLOR_SMSROVERGLOWRED"
)

freeslot(
"sfx_sarb", "sfx_spld", "sfx_gentrg", "sfx_harrg1", "sfx_harrg2", "sfx_harrg3", "sfx_stst", "sfx_smex", "sfx_bkhl",
"sfx_smach", "sfx_cmph", "sfx_hypemt", "sfx_machw", "sfx_machwb", "sfx_machwh", "sfx_smsdr", "sfx_hmsfly",

"MT_SMSFIREBLAST", "MT_HMSFIREBLAST", "MT_HMSFLAMEREST", "MT_HMS_NAPALM_FLAMES", "MT_HMSNOVABLAST", "MT_HMSNOVABLASTHB", 
"MT_HMSNOVAWAVE", "MT_HMSBLACKHOLE", "MT_SMS_THOK",

"SPR_SMSG",

"MT_SMSAURATRAIL", "MT_SMSSPDTHOK", "MT_SMSBLINDDASHCHARGE", "MT_SMSAIRBOOST", "MT_SMSGROUNDBOOST", "MT_SMSWALLJUMP", 
"MT_SMSSPRINTLINE", "MT_SMSBOOSTAURA", "MT_HMSRISEAURA", "MT_HMSSTOMPAURA", "MT_SMSSWAVE", "MT_HMSGAX", "MT_HMSGAXA", 
"MT_HMSGAXHB", "MT_HMSGAXT", "MT_HMSWARPPOINT", "MT_HMSWARPPOINT2", "MT_HMSWARPPOINTRETURN", "MT_HMSLIPILLAR", 
"MT_POWERSHARE", "MT_SMSPOWERAURA", "MT_SMSBLINDDASH", "MT_SMSHOMING", "MT_HMSLIGHTNING1", "MT_HMSLIGHTNING2", "MT_GOLDENSHINE", 
"MT_SMSROVERGLOW", "MT_CMPHRADIUS", "MT_SMSDIVEBOMB", "MT_ATOMDIVETARGET", "MT_SMSPOWERBOMB", "MT_HMSPOWERBOMB", "MT_HMSPBC", 
"MT_CMPHTRACKER",  "MT_CORPSETRACKER", "MT_SMSTHROWTRACKER",  "MT_SMSDUMMYTRACKER", "MT_ATOMDIVEPOP",

"sfx_sdodge", "sfx_sswip", "sfx_nuexp", "sfx_pwbmb", "sfx_nerf",
"sfx_smsmmi", "sfx_smsmmp", "sfx_smsmmf", "sfx_smsmms", "sfx_hmsnob", "sfx_hmsnof", 
"sfx_smsrbt", "sfx_hmsgax", "sfx_smscrt", "sfx_smscr2",
"sfx_smsha1", "sfx_smsha2", "sfx_smsha3", "sfx_smsha4", "sfx_smsha5",

"sfx_bljp", "sfx_bljpw", "sfx_smsfx1", "sfx_smsfx2", "sfx_smsfx3", "sfx_smsfx4",
"sfx_smsfx5", "sfx_smsfx6", "sfx_smsfx7",  "sfx_smsfx8", "sfx_smsfx9", "sfx_smsfxa", "sfx_eggahh")

--Here's a function that checks if the freeslot entry exist BEFORE adding it. 
local function SingleFreeSlot(...)
	for _,slot in ipairs({...})
		if not rawget(_G, slot) freeslot(slot) end --Since it doesn't exist yet, go ahead and add it!
	end
end
SingleFreeSlot("MT_RADIALBOOST", "MT_SMSSPEEDSPARKLE", "MT_SMSSPARKLESPAWN", "MT_HMSWAVEAURA", "MT_SMSSILVERRING", "MT_SMSAUTOFRAME",
"MT_SMSSPLAT", "MT_SSXA", "MT_SMSECHECK", "MT_SMSSOUNDOBJ", "MT_FACCIOLO_BOSS", "MT_HIVEBEAST", "MT_SMSRGORE", "MT_SMSRGORESPAWN", 
"MT_SMSSTOMPLINE", "MT_HMSSTOMPEXPLODE", "MT_BURSTLIGHT", "MT_BURSTWAVE", "MT_SMMK", "MT_SMSTSPARK", "MT_SMSSPINFIRE", "MT_SMSSTEAM",
"MT_RVGMISSILE", "MT_THEMYSTICEMERALD")

--Let's set some sound priorities!

sfxinfo[sfx_bkhl] = {priority = 9999998, flags = SF_NOMULTIPLESOUND|SF_NOINTERRUPT|SF_X8AWAYSOUND,}
sfxinfo[sfx_cmph] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_smach] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_machwh] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_harrg1] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_harrg2] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_harrg3] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_smsrbt] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_smsdr] = {flags = SF_X2AWAYSOUND,}
sfxinfo[sfx_smscrt] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_smscr2] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_nerf] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_hmsnob] = {flags = SF_X8AWAYSOUND,}
sfxinfo[sfx_hmsnof] = {priority = 9999992, flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_hmsgax] = {priority = 9999994, flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_smex] = {singular = true,}
sfxinfo[sfx_pwbmb] = {flags = SF_X4AWAYSOUND,}
sfxinfo[sfx_nuexp] = {priority = 9999999,flags = SF_NOMULTIPLESOUND|SF_X8AWAYSOUND|SF_X2AWAYSOUND}
sfxinfo[sfx_hypemt] = {priority = 9999997,flags = SF_X8AWAYSOUND|SF_X4AWAYSOUND|SF_X2AWAYSOUND}
sfxinfo[sfx_smsfx7] = {priority = 9999998,flags = SF_X8AWAYSOUND|SF_X4AWAYSOUND|SF_X2AWAYSOUND}
sfxinfo[sfx_eggahh] = {priority = 500000,flags = SF_X4AWAYSOUND}
sfxinfo[sfx_bljpw] = {flags = SF_X2AWAYSOUND}
sfxinfo[sfx_smsfx1] = {flags = SF_X8AWAYSOUND|SF_X2AWAYSOUND}
sfxinfo[sfx_smsfx5] = {priority = 9999992, flags = SF_X8AWAYSOUND}
sfxinfo[sfx_smsfx6] = {flags = SF_X4AWAYSOUND}
sfxinfo[sfx_smsfx8] = {flags = SF_X2AWAYSOUND}
sfxinfo[sfx_smsfxa] = {flags = SF_X2AWAYSOUND}

//And finally, to round things off, captions!

/*
sfxinfo[sfx_HMSJUM].caption = "SMS jump"
sfxinfo[sfx_bldash].caption = "BlindDash"
sfxinfo[sfx_smsbrk].caption = "Chalkboard abuse"
sfxinfo[sfx_smsv01].caption = "Compassion and empathy"
sfxinfo[sfx_smsv02].caption = "Nobody's faster than me!"
sfxinfo[sfx_smsv03].caption = "Is that all you got?"
sfxinfo[sfx_smsv04].caption = "C'mon!"
sfxinfo[sfx_pain02].caption = "WHAT THE--(fruit)"
sfxinfo[sfx_pain03].caption = "Ouch!"
sfxinfo[sfx_pain04].caption = "Huagh!"
sfxinfo[sfx_dead01].caption = "Sound of dying"
sfxinfo[sfx_dead02].caption = "N-no...!"
sfxinfo[sfx_bldchg].caption = "Charging Blinddash..." */ --Oh, oops. SRB2 doesn't view these as seperate sounds.


--Walljump sounds.
sfxinfo[sfx_bljp].caption = "Super Straight Walljump"
sfxinfo[sfx_bljpw].caption = "Walljump"
sfxinfo[sfx_smsfx2].caption = "Struggling Walljump"
sfxinfo[sfx_smsfx3].caption = "Straight Walljump"
sfxinfo[sfx_smsfx4].caption = "Kickback Walljump"

--Randomized voiceclips for airboosting and other actions.
sfxinfo[sfx_smsha1].caption = "GO!!"
sfxinfo[sfx_smsha2].caption = "...heh!"
sfxinfo[sfx_smsha3].caption = "Hohp!"
sfxinfo[sfx_smsha4].caption = "HA!"
sfxinfo[sfx_smsha5].caption = "HYAH!!!"

--Hyper Mystic Sonic sfx
sfxinfo[sfx_hmsfly].caption = "HMS flight boost"
sfxinfo[sfx_hypemt].caption = "Hyper Mystic transformation"
sfxinfo[sfx_smsfx7].caption = "Hyper Mystic Sonic appears"
sfxinfo[sfx_bkhl].caption = "Hmph! It's aaaaall over!"
sfxinfo[sfx_hmsgax].caption = "Galaxy Storm"
sfxinfo[sfx_nuexp].caption = "Nuclear Explosion"
sfxinfo[sfx_hmsnof].caption = "NovaBlast Fire"

--Misc
sfxinfo[sfx_smsfx5].caption = "Comet Haymaker"
sfxinfo[sfx_smsfx6].caption = "RIP wall"
sfxinfo[sfx_smsfx8].caption = "Haymaker Leap"
sfxinfo[sfx_smsfx9].caption = "Speed Broken"
sfxinfo[sfx_smsrbt].caption = "Ring Burst"
sfxinfo[sfx_smex].caption = "Small flame explosion"
sfxinfo[sfx_sarb].caption = "Airboost"
sfxinfo[sfx_stst].caption = "Stomp fling"
sfxinfo[sfx_spld].caption = "Mighty explosion"
sfxinfo[sfx_cmph].caption = "Incoming spanking" --Haymaker scream
sfxinfo[sfx_nerf].caption = "Haymaker impact" --Haymaker impact sound.
sfxinfo[sfx_smsfx1].caption = "Crater Impact"
sfxinfo[sfx_sdodge].caption = "Swift dodge"
sfxinfo[sfx_pwbmb].caption = "Samus sueing SMS"
sfxinfo[sfx_sswip].caption = "Footsweep"
sfxinfo[sfx_smach].caption = "Sound barrier shatter"
sfxinfo[sfx_machw].caption = "Whoosh" --Wind sound when running fast
sfxinfo[sfx_machwh].caption = "Harsh whoosh" --Wind sound when running REALLY fast.
sfxinfo[sfx_machwb].caption = "Speeding" --Sonic Unleashed speed sound.
sfxinfo[sfx_smsdr].caption = "Drifting"
sfxinfo[sfx_hmsnob].caption = "Corpses"
sfxinfo[sfx_smscrt].caption = "Critical!!"
sfxinfo[sfx_smscr2].caption = "WHU-OWW!!"

--Robot gibs sfx.
sfxinfo[sfx_harrg1].caption = "Crying in despair"
sfxinfo[sfx_harrg2].caption = "Cry of pain"
sfxinfo[sfx_harrg3].caption = "Cries of agony"
sfxinfo[sfx_gentrg].caption = "Robot gore"
sfxinfo[sfx_smsfxa].caption = "Disintegrated"

--Menu sfx
sfxinfo[sfx_smsmmi].caption = "SMS Menu1"
sfxinfo[sfx_smsmmp].caption = "SMS Menu2"
sfxinfo[sfx_smsmmf].caption = "SMS Menu3"