Path: blob/main/Scripts/R3/RPlatform.txt
1319 views
//----------------Sonic CD Rise Platform Script---------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Raising6#alias Object.Value1 : Object.Timer7#alias Object.Value2 : Object.YPlayerFloor8#alias Object.Value3 : Object.YVelocity9#alias Object.Value4 : Object.YOriginPos10#alias Object.Value5 : Object.RiseTimer1112// States13#alias 0 : RISEPLATFORM_IDLE14#alias 1 : RISEPLATFORM_DELAY15#alias 2 : RISEPLATFORM_ASCEND16#alias 3 : RISEPLATFORM_DELAY_217#alias 4 : RISEPLATFORM_SLOW18#alias 5 : RISEPLATFORM_FLOAT19#alias 6 : RISEPLATFORM_RESET2021// Priority22#alias 0 : PRIORITY_BOUNDS23#alias 1 : PRIORITY_ACTIVE242526sub ObjectMain27if Object.OutOfBounds == true28Object.YPos = Object.YOriginPos29Object.State = RISEPLATFORM_RESET30Object.Timer = 031end if3233switch Object.State34case RISEPLATFORM_IDLE35Object.YPlayerFloor = 036if Object.Raising == true37Object.State = RISEPLATFORM_DELAY3839Object.Priority = PRIORITY_ACTIVE4041Object.YVelocity = 042Object.RiseTimer = 043end if44break4546case RISEPLATFORM_DELAY47Object.YPlayerFloor = Object.YVelocity48if Object.RiseTimer < 849Object.RiseTimer++50else51Object.RiseTimer = 052Object.State++53end if54break5556case RISEPLATFORM_ASCEND57if Object.YVelocity > -0x4000058Object.YVelocity -= 0x100059else60Object.State++61end if6263Object.YPlayerFloor = Object.YVelocity64break6566case RISEPLATFORM_DELAY_267if Object.RiseTimer < 3668Object.RiseTimer++69else70Object.RiseTimer = 071Object.State++72end if7374Object.YPlayerFloor = Object.YVelocity75break7677case RISEPLATFORM_SLOW78if Object.YVelocity < 079Object.YVelocity += 0x100080else81Object.State++82end if83Object.YPlayerFloor = Object.YVelocity84break8586case RISEPLATFORM_FLOAT87if Object.Raising == true88if Object.Timer < 1689Object.Timer++9091TempValue0 = Object.Timer92TempValue0 &= 39394if TempValue0 == 395Object.YPlayerFloor = 0x1000096else97Object.YPlayerFloor = 098end if99else100Object.YPlayerFloor = 0101end if102else103if Object.Timer > 0104Object.Timer--105106TempValue0 = Object.Timer107TempValue0 &= 3108109if TempValue0 == 3110Object.YPlayerFloor = -0x10000111else112Object.YPlayerFloor = 0113end if114else115Object.YPlayerFloor = 0116end if117end if118break119120case RISEPLATFORM_RESET121if Object.OutOfBounds == true122Object.State = RISEPLATFORM_IDLE123Object.Priority = PRIORITY_BOUNDS124end if125break126127end switch128Object.Raising = false129end sub130131132sub ObjectPlayerInteraction133PlayerObjectCollision(C_PLATFORM, -32, -16, 32, 12)134if CheckResult == true135Object.Raising = true136Player.YPos += Object.YPlayerFloor137end if138end sub139140141sub ObjectDraw142Object.YPos += Object.YPlayerFloor143DrawSprite(0)144end sub145146147sub ObjectStartup148LoadSpriteSheet("R3/Objects.gif")149150SpriteFrame(-32, -16, 64, 32, 100, 1) // Rise Platform151152ArrayPos0 = 32153while ArrayPos0 < 1056154if Object[ArrayPos0].Type == TypeName[R Platform]155Object[ArrayPos0].YOriginPos = Object[ArrayPos0].YPos156end if157ArrayPos0++158loop159end sub160161162// ========================163// Editor Subs164// ========================165166sub RSDKDraw167DrawSprite(0)168169if Editor.ShowGizmos == true170TempValue0 = Object.iYPos171TempValue0 -= 420172TempValue0 <<= 16173174DrawArrow(Object.XPos, Object.YPos, Object.XPos, TempValue0, 255, 255, 255, 0)175end if176end sub177178179sub RSDKLoad180LoadSpriteSheet("R3/Objects.gif")181182SpriteFrame(-32, -16, 64, 32, 100, 1) // Rise Platform183184SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")185end sub186187188