Path: blob/master/Sonic 1/Scripts/Ending/Emeralds.txt
1481 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Emeralds Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.timer12private alias object.value1 : object.radius1314// States15private alias 0 : EMERALDS_ASCEND16private alias 1 : EMERALDS_SPIN1718// Ending Pose Aliases19private alias 9 : ENDINGPOSE_EMERALDSFLASH_B202122// ========================23// Tables24// ========================2526private table Emeralds_throwAngles6270280, 85, 171, 256, 341, 42729end table3031private table Emeralds_throwAngles7320330, 73, 146, 219, 293, 365, 43834end table353637// ========================38// Events39// ========================4041event ObjectUpdate42switch object.state43case EMERALDS_ASCEND44object.ypos -= 0x1000045object.timer++46if object.timer == 11247object.timer = 048object.state++49end if50break5152case EMERALDS_SPIN53if object.speed == 51254// Increase P1's Ending Pose state to what should hopefully be ENDINGPOSE_EMERALDSFLASH_A55object[0].state++56end if5758// Once the screen is completely white, take that time to unload the object59if object[0].state == ENDINGPOSE_EMERALDSFLASH_B60object.type = TypeName[Blank Object]61end if62break6364end switch6566if object.radius < 0x100067object.radius += 1668end if6970if object.speed < 0x40071object.speed += 272end if7374object.angle += object.speed75object.rotation = object.angle76object.rotation >>= 477end event787980event ObjectDraw81if specialStage.emeralds == 0x3F // If the Player has 6 emeralds82temp0 = 683else84temp0 = 785end if8687while temp0 > 088if specialStage.emeralds == 0x3F // (Six emeralds check again)89GetTableValue(temp3, temp0, Emeralds_throwAngles6)90else91GetTableValue(temp3, temp0, Emeralds_throwAngles7)92end if93temp3 += object.rotation9495Cos(temp1, temp3)96temp1 *= object.radius97temp1 += object.xpos9899Sin(temp2, temp3)100temp2 *= object.radius101temp2 += object.ypos102103DrawSpriteXY(temp0, temp1, temp2)104temp0--105loop106end event107108109event ObjectStartup110LoadSpriteSheet("Ending/Objects.gif")111112SpriteFrame(-6, -6, 12, 12, 1, 1) // 0 - White emerald flash frame113114SpriteFrame(-6, -6, 12, 12, 14, 1) // 1 - Blue emerald115SpriteFrame(-6, -6, 12, 12, 27, 1) // 2 - Orange emerald116117if options.superStates == false118SpriteFrame(-6, -6, 12, 12, 40, 1) // 3 - Pink emerald119else120SpriteFrame(-6, -6, 12, 12, 105, 1) // 3 - Purple emerald121end if122123SpriteFrame(-6, -6, 12, 12, 53, 1) // 4 - Green emerald124SpriteFrame(-6, -6, 12, 12, 66, 1) // 5 - Red emerald125SpriteFrame(-6, -6, 12, 12, 79, 1) // 6 - Grey emerald126SpriteFrame(-6, -6, 12, 12, 92, 1) // 7 - Light blue emerald127128// The dark orange emerald at (118, 1) is unused129end event130131132// ========================133// Editor Events134// ========================135136event RSDKDraw137DrawSprite(0)138end event139140141event RSDKLoad142LoadSpriteSheet("Ending/Objects.gif")143SpriteFrame(-6, -6, 12, 12, 1, 1)144145SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")146end event147148149