Path: blob/master/Sonic 1/Scripts/SYZ/VerticalDoor.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Vertical Door Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.movePos.y1213private alias 0 : VERTICALDOOR_IDLE14private alias 1 : VERTICALDOOR_OPENING15private alias 2 : VERTICALDOOR_OPENED1617// PushButton aliases18private alias object.propertyValue : pushButton.stood192021// ========================22// Function Declarations23// ========================2425reserve function VerticalDoor_DebugDraw26reserve function VerticalDoor_DebugSpawn272829// ========================30// Tables31// ========================3233private function VerticalDoor_DebugDraw34DrawSprite(0)35end function363738private function VerticalDoor_DebugSpawn39CreateTempObject(TypeName[Vertical Door], 0, object.xpos, object.ypos)40end function414243// ========================44// Events45// ========================4647event ObjectUpdate48switch object.state49case VERTICALDOOR_IDLE50if pushButton[-1].stood == true51object.state = VERTICALDOOR_OPENING52end if53break5455case VERTICALDOOR_OPENING56if object.movePos.y < 0x40000057object.movePos.y += 0x2000058object.ypos -= 0x2000059else60object.state++61end if62break6364case VERTICALDOOR_OPENED65break6667end switch6869foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)70BoxCollisionTest(C_SOLID, object.entityPos, -16, -32, 16, 32, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)71next72end event737475event ObjectDraw76DrawSprite(0)77end event787980event ObjectStartup81LoadSpriteSheet("SYZ/Objects.gif")82SpriteFrame(-16, -32, 32, 64, 119, 34)8384SetTableValue(TypeName[Vertical Door], DebugMode_ObjCount, DebugMode_TypesTable)85SetTableValue(VerticalDoor_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)86SetTableValue(VerticalDoor_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)87DebugMode_ObjCount++88end event899091// ========================92// Editor Events93// ========================9495event RSDKDraw96DrawSprite(0)9798if editor.showGizmos == true99editor.drawingOverlay = true100101// Draw an arrow from this object's activator button102DrawArrow(object[-1].xpos, object[-1].ypos, object.xpos, object.ypos, 255, 255, 255)103104// Draw the door's destination105temp0 = object.xpos; temp0 -= 0x100000106temp1 = object.ypos; temp1 -= 0x500000107DrawRectOutline(temp0, temp1, 0x200000, 0x400000, 255, 255, 255, 255)108109editor.drawingOverlay = false110end if111end event112113114event RSDKLoad115LoadSpriteSheet("SYZ/Objects.gif")116SpriteFrame(-16, -32, 32, 64, 119, 34)117118// set to 160 once in syz3 for some reason, only to never be seen again...119SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")120end event121122123