Path: blob/main/Scripts/R5/StaticPlatform.txt
1319 views
//--------------Sonic CD Static Platform Script---------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// HUD Alias5#alias Object[24].PropertyValue : HUD.CurrentTimePeriod67// Time Period Aliases8#alias 0 : TIME_PRESENT9#alias 1 : TIME_PAST10#alias 2 : TIME_GOOD_FUTURE11#alias 3 : TIME_BAD_FUTURE1213// Property Values14#alias 0 : PLATFORM_SMALL15#alias 1 : PLATFORM_MEDIUM16#alias 2 : PLATFORM_LARGE17#alias 3 : PLATFORM_SMALL_CONVEYOR18#alias 4 : PLATFORM_MEDIUM_CONVEYOR19#alias 5 : PLATFORM_LARGE_CONVEYOR202122sub ObjectPlayerInteraction2324switch Object.PropertyValue25case PLATFORM_SMALL26PlayerObjectCollision(C_PLATFORM, -16, -16, 16, 12)27break2829case PLATFORM_MEDIUM30PlayerObjectCollision(C_PLATFORM, -32, -16, 32, 12)31break3233case PLATFORM_LARGE34PlayerObjectCollision(C_PLATFORM, -48, -16, 48, 12)35break3637case PLATFORM_SMALL_CONVEYOR38// (with the Conveyor code removed, functionally identical to the normal Small Platform)39PlayerObjectCollision(C_PLATFORM, -16, -16, 16, 12)40break4142case PLATFORM_MEDIUM_CONVEYOR43// (Also with no Conveyor code associated with it... pretty much the same as the normal Medium Platform type)44PlayerObjectCollision(C_PLATFORM, -32, -16, 32, 12)45break4647case PLATFORM_LARGE_CONVEYOR48// (You may notice some corresponding code is missing, that's because the took the Conveyor out of the name!)49PlayerObjectCollision(C_PLATFORM, -48, -16, 48, 12)50break5152end switch5354end sub555657sub ObjectDraw5859switch Object.PropertyValue60case PLATFORM_SMALL61case PLATFORM_MEDIUM62case PLATFORM_LARGE63// Standard Platform64DrawSprite(Object.PropertyValue)65break6667// These next 3 types are for Conveyor Belt types, where the Conveyor Belt Frame is overlayed atop the normal Platform Sprite6869case PLATFORM_SMALL_CONVEYOR70DrawSprite(0)71DrawSprite(3)72break7374case PLATFORM_MEDIUM_CONVEYOR75DrawSprite(1)76DrawSprite(4)77break7879case PLATFORM_LARGE_CONVEYOR80DrawSprite(2)81DrawSprite(5)82break8384end switch8586end sub878889sub ObjectStartup9091// So an initial sheet is loaded here...92// but then more sheets are loaded down below? Huh?93LoadSpriteSheet("R5/Objects.gif")9495// But anyway, this Object's Sprite Frames are the same as Dip Platform's, including Conveyor Frames, so the order is:9697// 0 - Small Platform Frame98// 1 - Normal Sized Platform Frame99// 2 - Large Platform Frame100101// 3 - Small Conveyor Belt Frame102// 4 - Medium Sized Conveyor Belt Frame103// 5 - Large Conveyor Belt Frame104105// The essentially unused Conveyor Belt Frames are to be layered on top of the Platform Frames, though they aren't really used from this Object106107switch HUD.CurrentTimePeriod108case TIME_PRESENT109LoadSpriteSheet("R5/Objects.gif")110SpriteFrame(-16, -16, 32, 32, 1, 51)111SpriteFrame(-32, -16, 64, 32, 34, 51)112SpriteFrame(-48, -16, 96, 32, 1, 84)113SpriteFrame(-16, -16, 32, 16, 65, 208)114SpriteFrame(-32, -16, 64, 16, 1, 208)115SpriteFrame(-48, -16, 96, 16, 1, 191)116break117118case TIME_PAST119LoadSpriteSheet("R5/Objects3.gif")120SpriteFrame(-16, -16, 32, 32, 1, 170)121SpriteFrame(-32, -16, 64, 32, 34, 170)122SpriteFrame(-48, -16, 96, 32, 1, 203)123SpriteFrame(-16, -16, 32, 16, 223, 148)124SpriteFrame(-32, -16, 64, 16, 159, 148)125SpriteFrame(-48, -16, 96, 16, 159, 131)126break127128case TIME_GOOD_FUTURE129LoadSpriteSheet("R5/Objects3.gif")130SpriteFrame(-16, -16, 32, 32, 1, 170)131SpriteFrame(-32, -16, 64, 32, 34, 170)132SpriteFrame(-48, -16, 96, 32, 1, 203)133SpriteFrame(-16, -16, 32, 16, 223, 182)134SpriteFrame(-32, -16, 64, 16, 159, 182)135SpriteFrame(-48, -16, 96, 16, 159, 165)136break137138case TIME_BAD_FUTURE139LoadSpriteSheet("R5/Objects3.gif")140SpriteFrame(-16, -16, 32, 32, 1, 170)141SpriteFrame(-32, -16, 64, 32, 34, 170)142SpriteFrame(-48, -16, 96, 32, 1, 203)143SpriteFrame(-16, -16, 32, 16, 223, 216)144SpriteFrame(-32, -16, 64, 16, 159, 216)145SpriteFrame(-48, -16, 96, 16, 159, 199)146break147148end switch149150end sub151152153// ========================154// Editor Subs155// ========================156157sub RSDKEdit158if Editor.ReturnVariable == true159switch Editor.VariableID160case EDIT_VAR_PROPVAL // Property Value161CheckResult = Object.PropertyValue162break163case 0 // Type164CheckResult = Object.PropertyValue165break166end switch167else168switch Editor.VariableID169case EDIT_VAR_PROPVAL // Property Value170Object.PropertyValue = Editor.VariableValue171break172case 0 // Type173Object.PropertyValue = Editor.VariableValue174break175end switch176end if177end sub178179180sub RSDKDraw181if Object.PropertyValue >= 3182TempValue0 = -3183TempValue0 += Object.PropertyValue184DrawSprite(TempValue0)185end if186187DrawSprite(Object.PropertyValue)188end sub189190191sub RSDKLoad192LoadSpriteSheet("R5/Objects.gif")193194// TODO: support for other time periods, this is just present195// certainly there's some better way to do it rather than a bunch of unique and boring checkCurrentStageFolder checks?196SpriteFrame(-16, -16, 32, 32, 1, 51)197SpriteFrame(-32, -16, 64, 32, 34, 51)198SpriteFrame(-48, -16, 96, 32, 1, 84)199SpriteFrame(-16, -16, 32, 16, 65, 208)200SpriteFrame(-32, -16, 64, 16, 1, 208)201SpriteFrame(-48, -16, 96, 16, 1, 191)202203AddEditorVariable("Type")204SetActiveVariable("Type")205AddEnumVariable("Small", 0)206AddEnumVariable("Medium", 1)207AddEnumVariable("Large", 2)208AddEnumVariable("Small Conveyor", 3)209AddEnumVariable("Medium Conveyor", 4)210AddEnumVariable("Large Conveyor", 5)211end sub212213214