Path: blob/main/Scripts/Mission/PlatformBlock.txt
1319 views
//---------------Sonic CD Platform Block Script---------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.PropertyValue : Object.BlocksNo678sub ObjectPlayerInteraction910if Object.BlocksNo <= 11112// This is a singular Block Platform, so only check Platform Collision as such13PlayerObjectCollision(C_PLATFORM,-16,-16,16,16)1415else1617// This Object is here in the place of several Blocks1819// Base width is 3220TempValue0 = 322122TempValue0 *= Object.BlocksNo2324// Since a left collision of -16's already gonna be tested, we can cut off 16 from the right total25TempValue0 -= 162627PlayerObjectCollision(C_PLATFORM, -16, -16, TempValue0, 16)28end if2930end sub313233sub ObjectDraw3435if Object.BlocksNo <= 13637// Just draw a single Block sprite38DrawSprite(0)3940else4142// Draw all the Blocks in a loop4344// TempValue1 really has no reason to exist here...45// It's always the same value anyway4647TempValue0 = Object.XPos48TempValue1 = Object.YPos49TempValue2 = 05051while TempValue2 < Object.BlocksNo52DrawSpriteXY(0, TempValue0, TempValue1)5354// Add 32 pixels to the current Block Position55TempValue0 += 0x2000005657TempValue2++58loop59end if6061end sub626364sub ObjectStartup6566LoadSpriteSheet("Mission/Objects.gif")6768// Block Frame69SpriteFrame(-16, -16, 32, 32, 1, 1)7071end sub727374// ========================75// Editor Subs76// ========================7778sub RSDKDraw79if Object.BlocksNo < 280DrawSprite(0)81else82TempValue0 = Object.XPos83TempValue1 = 084while TempValue2 < Object.BlocksNo85DrawSpriteXY(0, TempValue0, Object.YPos)86TempValue0 += 0x20000087TempValue1++88loop89end if90end sub919293sub RSDKLoad94LoadSpriteSheet("Mission/Objects.gif")95SpriteFrame(-16, -16, 32, 32, 1, 1)9697SetVariableAlias(ALIAS_VAR_PROPVAL, "BlocksNo")98end sub99100101102103