Path: blob/master/Sonic 2/Scripts/OOZ/SpikesActivator.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Spikes Activator Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.endSlot12private alias object.value1 : object.startSlot131415// ========================16// Events17// ========================1819event ObjectUpdate20arrayPos0 = object.startSlot21while arrayPos0 < object.endSlot22object[arrayPos0].priority = PRIORITY_ACTIVE23arrayPos0++24loop25end event262728event ObjectDraw29arrayPos0 = object.startSlot30while arrayPos0 < object.endSlot31if stage.state == STAGE_RUNNING32object[arrayPos0].priority = PRIORITY_INACTIVE33else34object[arrayPos0].priority = PRIORITY_ACTIVE35end if3637arrayPos0++38loop39end event404142event ObjectStartup43foreach (TypeName[Spikes Activator], arrayPos0, ALL_ENTITIES)44arrayPos1 = arrayPos045object[arrayPos0].endSlot = object[arrayPos0].propertyValue4647temp0 = false48while temp0 == false49if object[arrayPos1].type == TypeName[Moving Spikes]50object[arrayPos0].startSlot = arrayPos151temp0 = true52else53arrayPos1++54if arrayPos1 >= 0x42055temp0 = true56end if57end if58loop5960object[arrayPos0].endSlot += object[arrayPos0].startSlot61next62end event636465// ========================66// Editor Events67// ========================6869event RSDKDraw70DrawSprite(0)7172if editor.showGizmos == true73editor.drawingOverlay = true7475object.endSlot = object.propertyValue7677GetObjectType(temp1, "Moving Spikes")7879temp0 = false80arrayPos0 = object.entityPos81while temp0 == false82if object[arrayPos0].type == temp183object.startSlot = arrayPos084temp0 = true85else86arrayPos0++87if arrayPos0 >= 0x42088editor.drawingOverlay = false89return90end if91end if92loop9394object.endSlot += object.startSlot9596arrayPos0 = object.startSlot97while arrayPos0 < object.endSlot98DrawArrow(object.xpos, object.ypos, object[arrayPos0].xpos, object[arrayPos0].ypos, 0xE0, 0xE0, 0xE0)99loop100101editor.drawingOverlay = false102end if103end event104105106event RSDKLoad107LoadSpriteSheet("Global/Display.gif")108SpriteFrame(-8, -8, 16, 16, 168, 18) // "Trigger" - #0109110SetVariableAlias(ALIAS_VAR_PROPVAL, "activateSlot")111end event112113114