Path: blob/main/Scripts/Mission/RingReset.txt
1319 views
//-----------------Sonic CD Ring Reset Script-----------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//3//--------Used on Mission "M095 - Ring Challenge 100"---------//45// Aliases6#alias Object.Value0 : Object.TimeCheckpoint78// This Value's used for by Rings, more specifically by the Ring Sparkle they turn into9#alias Object.Value2 : Object.MissionTypeEX1011// Priority Aliases12#alias 0 : PRIORITY_BOUNDS1314// Mission Function15#alias 10 : RULE_RESPAWN_RINGS161718sub ObjectMain1920// Note - this object may never be placed directly into a Scene,21// but rings from the "Ring Challenge 100" mission will turn into this object in place of unloading2223// Make sure the Object's out of bounds right now, we don't want any visible appearing in front of the player24// -> Do note, this object has a priority of PRIORITY_ACTIVE, which is why this works25if Object.OutOfBounds == true2627// Get the total current stage time28TempValue0 = Stage.Minutes29TempValue0 *= 6030TempValue0 += Stage.Seconds3132// See if it's greater than (or equal to) the time this Ring holds33// (The value the Ring holds will be 20 seconds after the time it was collected)34if TempValue0 >= Object.TimeCheckpoint3536// Turn this object back into a ring, and give it normal Priority again37Object.Type = TypeName[Ring]38Object.Priority = PRIORITY_BOUNDS3940// And reset the time Value too, of course41Object.TimeCheckpoint = 04243end if4445end if4647end sub484950sub ObjectStartup5152// Sets the special rule for this mission53game.missionFunctionNo = RULE_RESPAWN_RINGS5455// Cycle through all rings and set their their special type to that of the Ring Reset object5657TempValue0 = TypeName[Ring Reset]5859ArrayPos0 = 3260while ArrayPos0 < 105661if Object[ArrayPos0].Type == TypeName[Ring]62Object[ArrayPos0].MissionTypeEX = TempValue063end if6465ArrayPos0++66loop6768end sub697071// ========================72// Editor Subs73// ========================7475sub RSDKDraw76Object.InkEffect = 177DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)78end sub798081sub RSDKLoad82LoadSpriteSheet("Global/Items.gif")83SpriteFrame(-8, -8, 16, 16, 1, 1)8485SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")86end sub8788899091