freeslot("SKINCOLOR_S1CD")
skincolors[SKINCOLOR_S1CD] = {
    name = "S1/SCD",
    ramp = {145,146,146,170,171,171,172,172,172,172,173,173,173,174,174,175},
    invcolor = SKINCOLOR_WHITE,
    invshade = 9,
    chatcolor = V_AZUREMAP,
    accessible = true
}


addHook("ThinkFrame", do
	for player in players.iterate
	     if (player.mo.state == S_PLAY_WALK) and (player.mo.frame == C) and P_IsObjectOnGround(player.mo)
	         S_StartSound(player.mo, sfx_walk, player)
		end
	end
end)


addHook("ThinkFrame", do
	for player in players.iterate
	     if (player.mo.state == S_PLAY_WALK) and (player.mo.frame == G) and P_IsObjectOnGround(player.mo)
	         S_StartSound(player.mo, sfx_walk, player)
		end
	end
end)


addHook("ThinkFrame", do
	for player in players.iterate
	if (player.mo.state == S_PLAY_RUN) and not player.powers[pw_super] and (player.mo.frame == B) and P_IsObjectOnGround(player.mo)
		P_SpawnSkidDust(player, -7*FRACUNIT, sfx_none)
		P_SpawnSkidDust(player, -7*FRACUNIT, sfx_none)
		S_StartSound(player.mo, sfx_run, player)
		P_IsObjectOnGround(player.mo)
		end
	end
end)


addHook("PlayerThink", function(player)
	if player.mo and player.mo.skin == "metalsonic"
	if (player.mo.state == S_PLAY_DASH) and not player.powers[pw_super] and P_IsObjectOnGround(player.mo) then
	    player.powers[pw_invulnerability] = TICRATE/4
		P_SpawnSkidDust(player, -9*FRACUNIT, sfx_none)
		P_SpawnSkidDust(player, -9*FRACUNIT, sfx_none)
		local ghost = P_SpawnGhostMobj(player.mo)
		ghost.fuse = 5
		end
	end
end)


addHook("PlayerThink", function(player)
	if player.mo and player.mo.skin == "metalknuckles"
	if (player.mo.state == S_PLAY_DASH) and not player.powers[pw_super] and P_IsObjectOnGround(player.mo) then
	    player.powers[pw_invulnerability] = TICRATE/4
		P_SpawnSkidDust(player, -9*FRACUNIT, sfx_none)
		local ghost = P_SpawnGhostMobj(player.mo)
		ghost.fuse = 5
		end
	end
end)


addHook("PlayerThink", function(player)
	if player.mo and player.mo.skin == "maimy"
	if (player.mo.state == S_PLAY_DASH) and not player.powers[pw_super] and P_IsObjectOnGround(player.mo) then
	    player.powers[pw_invulnerability] = TICRATE/4
		P_SpawnSkidDust(player, -9*FRACUNIT, sfx_none)
		local ghost = P_SpawnGhostMobj(player.mo)
		ghost.fuse = 5
		end
	end
end)