Path: blob/master/Sonic 1/Scripts/Mission/RingReset.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: RingReset Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// This Object is used in Mission "Ring Challenge 50" - M014 - Mission_Zone0489// ========================10// Aliases11// ========================1213private alias object.value0 : object.timeCheckpoint1415// Ring/Ring Sparkle Aliases16private alias object.value2 : object.missionTypeEX1718private alias 10 : MISSIONNO_RINGCHALLENGE50192021// ========================22// Events23// ========================2425event ObjectUpdate26// Make sure the Object is out of the Player's sight before doing anything27if object.outOfBounds == true28// First, get the total time29temp0 = stage.minutes30temp0 *= 6031temp0 += stage.seconds3233// Then compare it to when this Ring was collected34if temp0 >= object.timeCheckpoint35// If enough time has lapsed, then turn this Object back into a Ring36object.type = TypeName[Ring]3738// Reset the Object's values39object.priority = PRIORITY_BOUNDS40object.timeCheckpoint = 041end if42end if43end event444546event ObjectStartup47// This Object should only be used in Act 1, Act 2 is "The One Ring" Mission where we, of course, don't want respawning rings48if stage.actNum == 149game.missionFunctionNo = MISSIONNO_RINGCHALLENGE505051// Set the RingReset Type ID in all the Ring Objects across the level52temp0 = TypeName[RingReset]53foreach (TypeName[Ring], arrayPos0, ALL_ENTITIES)54object[arrayPos0].missionTypeEX = temp055next56end if57end event585960// ========================61// Editor Events62// ========================6364event RSDKDraw65DrawSprite(0)66end event676869event RSDKLoad70LoadSpriteSheet("Global/Items.gif")71SpriteFrame(-8, -8, 16, 16, 1, 1)7273SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")74end event757677