// ----------------------------------
// RSDK Project: Sonic 1
// Script Description: Unlock Test Object
// Script Author: Christian Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

// ========================
// Aliases
// ========================

// Achievement Aliases
// Only really the last one is used in this script, but may as well list the rest for reference anyways
// (Also yeah all the code for these Achievements is still in Origins's scripts lol)

// "Ramp Ring Acrobatics" - "Without touching the ground, collect all the rings in a trapezoid formation in Green Hill Zone Act 1"
private alias  0 : ACHIEVEMENT_RAMPRINGACRO

// "Blast Processing" - "Clear Green Hill Zone Act 1 in under 30 seconds"
private alias  1 : ACHIEVEMENT_BLASTPROCESSING

// "Secret of Marble Zone" - "Travel though a secret room in Marbale Zone Act 3"
private alias  2 : ACHIEVEMENT_SECRETOFMZ

// "Block Buster" - "Break 16 blocks in a row without stopping" (in Marble Zone)
private alias  3 : ACHIEVEMENT_BLOCKBUSTER

// "Ring King" - "Collect 200 Rings"
private alias  4 : ACHIEVEMENT_RINGKING

// "Secret of Labyrinth Zone" - "Activate and ride the hidden platform in Labyrinth Zone Act 1"
private alias  5 : ACHIEVEMENT_SECRETOFLZ

// "Flawless Pursuit" - "Clear the boss in Labyrinth Zone without getting hurt"
private alias  6 : ACHIEVEMENT_FLAWLESSPURSUIT

// "Bombs Away" - "Defeat the boss in Starlight Zone using only the see-saw bombs"
private alias  7 : ACHIEVEMENT_BOMBSAWAY

// "Hidden Transporter" - "Collect 50 Rings and take the hidden transporter path in Scrap Brain Act 2"
private alias  8 : ACHIEVEMENT_HIDDENTRANSPORTER

// "Chaos Connoisseur" - "Collect all the chaos emeralds"
private alias  9 : ACHIEVEMENT_CHAOSCONNOISSEUR

// "One For the Road" - "As a parting gift, land a final hit on Dr. Eggman's escaping Egg Mobile"
private alias 10 : ACHIEVEMENT_ONEFORTHEROAD

// "Beat The Clock" - "Clear the Time Attack mode in less than 45 minutes" (do note that this isn't normally unlocked through scripts, instead it's unlocked by the fancy 3d menu side of things)
private alias 11 : ACHIEVEMENT_BEATTHECLOCK

// Total count, nothing special to say about this one
private alias 12 : ACHIEVEMENT_COUNT


// ========================
// Events
// ========================

event ObjectUpdate
	// This object is meant to unlock all achievments, so cycle through all of them while unlocking each
	temp0 = 0
	while temp0 < ACHIEVEMENT_COUNT
		CallNativeFunction2(SetAchievement, temp0, 100)
		temp0++
	loop

	// Erase this object and reset the game
	object.type = TypeName[Blank Object]
	engine.state = RESET_GAME
end event


event ObjectStartup
	// Hide Touch Controls
	
	options.touchControls = false
end event


// ========================
// Editor Events
// ========================

event RSDKDraw
	DrawSprite(0)
end event


event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
	
	SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
end event
