-- 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" // If the player is Tails...
			continue -- Continues the code
		end
		if (All7Emeralds(emeralds)) and not player.drbnotified // 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\D.R.B Emerald Upgrades:", "\x88\Pricing: \x80\Regular throws/carpet bombs now cost 1 ring to use. Snipe throws now cost 2 rings.", "\x88\Cooldown: \x80\Regular throws and snipe throws now only have a 1-second cooldown.")
		end
		if (All7Emeralds(emeralds))
			player.mo.drbupgraded = 1
		else
			player.mo.drbupgraded = 0
		end
	end
end)