-- Upgrade Notification

-- ABOUT: Since Tails doesn't get a super form, he'll have reduced Ring Bomb costs when the Emeralds are collected. This will notify you when that happens.

if srb2p return end -- If we're in SRB2P, this will end the code

addHook("ThinkFrame", function()
	for player in players.iterate do -- For every player out there...
		if player.mo.skin ~= "tails" then // If the player is Tails...
			continue -- Continues the code
		end
		
		if (All7Emeralds(emeralds)) and not player.drbnotified then // If the player gets all Emeralds and isn't notified yet...
			player.drbnotified = true -- Activates the code for only one frame
			S_StartSound(player.mo, sfx_s3k68) -- Plays the discovery sound
			
			-- NOTE: Gives a pair of messages in the console due to a certain someone also having an upgrade notification.
			COM_BufInsertText(player, "echo Congrats on getting those emeralds!")
			print("\x87\Tails Emerald Upgrades:", "\x88\Dummy Ring Bomb: \x80\D.R.Bs will now cost less rings to use (regular throws/carpet bombs are 1, snipe throws are 2). You can also throw them at a faster rate when not flying.")
		end
	end
end)