Path: blob/master/Sonic 2/Scripts/WFZ/BeltPlatformS.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 22// Script Description: Belt Platform S 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.beltID1314// BeltPlatform Aliases15private alias object.value0 : beltPlatform.timer1617// BeltPlatform States18private alias 1 : BELTPLATFORM_APPEARING192021// ========================22// Events23// ========================2425event ObjectUpdate26if object.timer == 027object.priority = PRIORITY_ACTIVE28object.timer = 642930arrayPos0 = object.entityPos31arrayPos0 += object.beltID32arrayPos0++33object[arrayPos0].xpos = object.xpos34object[arrayPos0].ypos = object.ypos35object[arrayPos0].state = BELTPLATFORM_APPEARING36object[arrayPos0].priority = PRIORITY_ACTIVE37object[arrayPos0].frame = 23839GetBit(temp0, object.propertyValue, 1)40if temp0 == false41object[arrayPos0].yvel = -0x1000042else43object[arrayPos0].yvel = 0x1000044end if4546object.beltID++47GetBit(temp0, object.propertyValue, 0)48if temp0 == false49beltPlatform[arrayPos0].timer = 19950object.beltID &= 351else52beltPlatform[arrayPos0].timer = 45553object.beltID &= 754end if55else56object.timer--57end if5859temp0 = object.xpos60temp0 >>= 1661temp0 -= camera[0].xpos62Abs(temp0)63temp0 -= 12864if temp0 > screen.xcenter65object.timer = 066object.beltID = 067object.priority = PRIORITY_XBOUNDS68end if69end event707172event ObjectDraw73// Did this Draw Something at one point??74end event757677event ObjectStartup78foreach (TypeName[Belt Platform S], arrayPos0, ALL_ENTITIES)79object[arrayPos0].priority = PRIORITY_XBOUNDS80next81end event828384// ========================85// Editor Events86// ========================8788event RSDKEdit89if editor.returnVariable == true90switch editor.variableID91case EDIT_VAR_PROPVAL // property value92checkResult = object.propertyValue93break9495case 0 // type96GetBit(checkResult, object.propertyValue, 0)97break9899case 1 // direction100GetBit(checkResult, object.propertyValue, 1)101break102103end switch104else105switch editor.variableID106case EDIT_VAR_PROPVAL // property value107object.propertyValue = editor.variableValue108break109110case 0 // type111CheckNotEqual(editor.variableValue, false)112SetBit(object.propertyValue, 0, checkResult)113break114115case 1 // direction116CheckNotEqual(editor.variableValue, false)117SetBit(object.propertyValue, 1, checkResult)118break119120end switch121end if122end event123124125event RSDKDraw126DrawSprite(0)127end event128129130event RSDKLoad131LoadSpriteSheet("Global/Display.gif")132SpriteFrame(-16, -16, 32, 32, 1, 143)133134AddEditorVariable("type")135SetActiveVariable("type")136AddEnumVariable("Quick Interval", 0)137AddEnumVariable("Slow Interval", 1)138139AddEditorVariable("direction")140SetActiveVariable("direction")141AddEnumVariable("Up", 0)142AddEnumVariable("Down", 1)143end event144145146