Path: blob/master/Sonic 1/Scripts/GHZ/BridgeEnd.txt
1480 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Bridge End Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Function Declarations9// ========================1011reserve function BridgeEnd_DebugDraw12reserve function BridgeEnd_DebugSpawn131415// ========================16// Function Definitions17// ========================1819private function BridgeEnd_DebugDraw20temp0 = object.direction21temp0 &= 122DrawSprite(temp0)23end function242526private function BridgeEnd_DebugSpawn27CreateTempObject(TypeName[Bridge End], 0, object.xpos, object.ypos)28object[tempObjectPos].drawOrder = 429object[tempObjectPos].propertyValue = object.direction30object[tempObjectPos].propertyValue &= 131end function323334// ========================35// Events36// ========================3738event ObjectDraw39DrawSprite(object.propertyValue)40end event414243event ObjectStartup44LoadSpriteSheet("GHZ/Objects.gif")4546// Sprite frames47SpriteFrame(-16, -8, 32, 16, 18, 1)48SpriteFrame(-16, -8, 32, 16, 51, 1)4950// Set all Bridge End objects to have a drawOrder of 4, one above the standard of 351// (This object was made while v4 spec was still being developed, foreaches didn't exist back when this object was made so a v3-styled loop is used instead)52arrayPos0 = 3253while arrayPos0 < 0x42054if object[arrayPos0].type == TypeName[Bridge End]55object[arrayPos0].drawOrder = 456end if5758arrayPos0++59loop6061// Add this object to the debug mode list62SetTableValue(TypeName[Bridge End], DebugMode_ObjCount, DebugMode_TypesTable)63SetTableValue(BridgeEnd_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)64SetTableValue(BridgeEnd_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)65DebugMode_ObjCount++66end event676869// ========================70// Editor Events71// ========================7273event RSDKEdit74if editor.returnVariable == true75switch editor.variableID76case EDIT_VAR_PROPVAL // property value77checkResult = object.propertyValue78checkResult &= 179break8081case 0 // direction82checkResult = object.propertyValue83checkResult &= 184break8586end switch87else88switch editor.variableID89case EDIT_VAR_PROPVAL // property value90object.propertyValue = editor.variableValue91object.propertyValue &= 192break9394case 0 // direction95object.propertyValue = editor.variableValue96object.propertyValue &= 197break9899end switch100end if101end event102103104event RSDKDraw105DrawSprite(object.propertyValue)106end event107108109event RSDKLoad110LoadSpriteSheet("GHZ/Objects.gif")111SpriteFrame(-16, -8, 32, 16, 18, 1)112SpriteFrame(-16, -8, 32, 16, 51, 1)113114AddEditorVariable("direction")115SetActiveVariable("direction")116AddEnumVariable("Left", 0)117AddEnumVariable("Right", 1)118end event119120121