Path: blob/master/Sonic 1/Scripts/Special/GoalBlock.txt
1483 views
// ----------------------------------1// RSDK Project: Sonic 12// Script Description: Goal Block Object3// Script Author: Christian Whitehead/Simon Thomley4// Unpacked by Rubberduckycooly's script unpacker5// ----------------------------------67// ========================8// Aliases9// ========================1011private alias object.value0 : object.active1213// Player Aliases14private alias object.state : player.state15private alias object.xvel : player.xvel16private alias object.yvel : player.yvel17private alias object.speed : player.speed18private alias object.interaction : player.interaction192021// ========================22// Function Declarations23// ========================2425reserve function GoalBlock_DebugDraw26reserve function GoalBlock_DebugSpawn272829// ========================30// Function Definitions31// ========================3233private function GoalBlock_DebugDraw34DrawSprite(0)35end function363738private function GoalBlock_DebugSpawn39temp5 = TypeName[Goal Block]40temp4 = 041CallFunction(DebugMode_PlaceBlock)42object[arrayPos0].drawOrder = 443object[arrayPos0].groupID = GROUP_BLOCKS44end function454647// ========================48// Events49// ========================5051event ObjectUpdate52foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)53CallFunction(SpecialSetup_PlayerBlockCol)54if checkResult > 055player[currentPlayer].state = Player_State_Static56player[currentPlayer].xvel = 057player[currentPlayer].yvel = 058player[currentPlayer].speed = 059object.active = false60player[currentPlayer].interaction = false61ResetObjectEntity(20, TypeName[Special Finish], 0, 0, 0)62object[20].priority = PRIORITY_ACTIVE63PlaySfx(SfxName[Exit SS], false)64stage.timeEnabled = false65options.touchControls = false66end if67next68end event697071event ObjectDraw72CallFunction(SpecialSetup_GetBlockPos)73temp2 = oscillation74temp2 &= 1575temp2 >>= 376#platform: USE_ORIGINS77if game.playMode == BOOT_PLAYMODE_MIRRORING78object.direction = FLIP_X79DrawSpriteFX(temp2, FX_FLIP, temp0, temp1)80else81DrawSpriteXY(temp2, temp0, temp1)82end if83#endplatform84#platform: USE_STANDALONE85DrawSpriteXY(temp2, temp0, temp1)86#endplatform87end event888990event ObjectStartup91LoadSpriteSheet("Special/Objects.gif")92SpriteFrame(-12, -12, 24, 24, 201, 76)93SpriteFrame(-12, -12, 24, 24, 201, 176)9495foreach (TypeName[Goal Block], arrayPos0, ALL_ENTITIES)96object[arrayPos0].groupID = GROUP_BLOCKS97next9899SetTableValue(TypeName[Goal Block], DebugMode_ObjCount, DebugMode_TypeTable)100SetTableValue(GoalBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)101SetTableValue(GoalBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)102DebugMode_ObjCount++103end event104105106// ========================107// Editor Events108// ========================109110event RSDKDraw111DrawSprite(0)112end event113114115event RSDKLoad116LoadSpriteSheet("Special/Objects.gif")117SpriteFrame(-12, -12, 24, 24, 201, 76)118119SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")120end event121122123