Path: blob/master/Sonic 1/Scripts/LZ/CorkActivation.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Cork Activation Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.propertyValue : object.corkCount1213private alias object.value0 : object.endSlot14private alias object.value1 : object.startSlot151617// ========================18// Events19// ========================2021event ObjectUpdate22arrayPos0 = object.startSlot23while arrayPos0 < object.endSlot24object[arrayPos0].priority = PRIORITY_ACTIVE25arrayPos0++26loop27end event282930event ObjectDraw31// Even if it's a "Draw" event, there's not really much drawing that actually happens here32// Instead, it just does some more managing of priorities33// (Keep in mind, when the player's dead Updates aren't ran anymore but Draws are)3435arrayPos0 = object.startSlot36while arrayPos0 < object.endSlot37if stage.state == STAGE_RUNNING38object[arrayPos0].priority = PRIORITY_INACTIVE39else40object[arrayPos0].priority = PRIORITY_ACTIVE41end if42arrayPos0++43loop44end event454647event ObjectStartup48foreach (TypeName[Cork Activation], arrayPos0, ALL_ENTITIES)49object[arrayPos0].priority = PRIORITY_XBOUNDS50arrayPos1 = arrayPos051object[arrayPos0].endSlot = object[arrayPos0].corkCount5253temp0 = false54while temp0 == false55if object[arrayPos1].type == TypeName[Cork]56object[arrayPos0].startSlot = arrayPos157temp0 = true58else59arrayPos1++60if arrayPos1 >= 0x42061temp0 = true62end if63end if64loop65object[arrayPos0].endSlot += object[arrayPos0].startSlot66next67end event686970// ========================71// Editor Events72// ========================7374event RSDKDraw75DrawSprite(0)7677if editor.showGizmos == true78editor.drawingOverlay = true7980arrayPos0 = object.entityPos8182GetObjectType(temp0, "Cork")8384checkResult = true85while checkResult == true86checkNotEqual(object[arrayPos0].type, temp0)87arrayPos0 += checkResult8889if arrayPos0 >= 0x42090checkResult = false91end if92loop9394arrayPos1 = arrayPos095arrayPos1 += object.corkCount9697while arrayPos0 < arrayPos198DrawLine(object.xpos, object.ypos, object[arrayPos0].xpos, object[arrayPos0].ypos, 0xFF, 0xFF, 0x00)99arrayPos0++100loop101102editor.drawingOverlay = false103end if104end event105106107event RSDKLoad108LoadSpriteSheet("Global/Display.gif")109SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0110111SetVariableAlias(ALIAS_VAR_PROPVAL, "corkCount")112end event113114115