Path: blob/main/Scripts/R3/EPlatform.txt
1319 views
//---------------Sonic CD Eggman Platform Script--------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.HitboxLeft6#alias Object.Value1 : Object.HitboxRight7#alias Object.Value2 : Object.Length8#alias Object.Value3 : Object.MusicFade910// States11#alias 0 : EPLATFORM_IDLE12#alias 1 : EPLATFORM_EXTEND_LARGE13#alias 2 : EPLATFORM_EXTEND_SHORT14#alias 3 : EPLATFORM_BLANK1516// Property Values17#alias 6 : EPLATFORM_SHORT18#alias 8 : EPLATFORM_LARGE1920// Priority21#alias 0 : PRIORITY_BOUNDS22#alias 1 : PRIORITY_ACTIVE232425sub ObjectMain26switch Object.State27case EPLATFORM_IDLE28if Object.PropertyValue == EPLATFORM_LARGE // check if it's the platform used by Eggman2930PlayerObjectCollision(C_TOUCH, -64, -64, 64, -48)31if CheckResult == true32Object.State = EPLATFORM_EXTEND_LARGE33Stage.NewYBoundary2 = Object.iYPos34Stage.NewYBoundary2 += 2435end if3637else3839TempValue0 = Object.HitboxRight40TempValue0 += 3241TempValue0 <<= 1642TempValue0 += Object.XPos43if Player.XPos > TempValue044Object.State = EPLATFORM_EXTEND_SHORT45Object.Priority = PRIORITY_ACTIVE46end if4748end if49break5051case EPLATFORM_EXTEND_LARGE52if Object.Length < Object.PropertyValue53Object.Length++54Object.HitboxLeft -= 1655else56Object.State = EPLATFORM_BLANK57end if58break5960case EPLATFORM_EXTEND_SHORT61if Object.Length < Object.PropertyValue62Object.Length++63Object.HitboxLeft -= 1664end if65// Start the boss music66if Object.MusicFade < 10067Object.MusicFade++68Music.Volume--69else70PlayMusic(4)71Object.State = EPLATFORM_BLANK72Object.Priority = PRIORITY_BOUNDS73end if74break7576case EPLATFORM_BLANK77break78end switch79end sub808182sub ObjectPlayerInteraction83PlayerObjectCollision(C_PLATFORM, Object.HitboxLeft, -16, Object.HitBoxRight, 16)84end sub858687sub ObjectDraw88TempValue0 = 089TempValue1 = Object.HitBoxRight90TempValue1 <<= 1691TempValue1 -= 0x8000092TempValue1 += Object.XPos93while TempValue0 < Object.Length94DrawSpriteXY(0, TempValue1, Object.YPos)95TempValue0++96TempValue1 -= 0x10000097loop98end sub99100101sub ObjectStartup102LoadSpriteSheet("R3/Objects2.gif")103104SpriteFrame(-8, -16, 16, 32, 117, 0) // #0 - Eggman Platform105106// Used to be below LoadSpriteSheet, moved here for consistency107ArrayPos0 = 32108while ArrayPos0 < 1056109if Object[ArrayPos0].Type == TypeName[EPlatform]110Object[ArrayPos0].HitBoxRight = Object[ArrayPos0].PropertyValue111Object[ArrayPos0].HitBoxRight <<= 3112Object[ArrayPos0].HitboxLeft = Object[ArrayPos0].HitBoxRight113end if114ArrayPos0++115loop116end sub117118119// ========================120// Editor Subs121// ========================122123sub RSDKDraw124DrawSprite(0)125TempValue0 = Object.PropertyValue126TempValue0 <<= 3127TempValue1 = TempValue0128129TempValue2 = 0130TempValue3 = TempValue0131TempValue3 <<= 16132TempValue3 -= 0x80000133TempValue3 += Object.XPos134while TempValue2 < Object.PropertyValue135DrawSpriteXY(0, TempValue3, Object.YPos)136TempValue2++137TempValue3 -= 0x100000138loop139end sub140141142sub RSDKLoad143LoadSpriteSheet("R3/Objects2.gif")144145SpriteFrame(-8, -16, 16, 32, 117, 0) // #0 - Eggman Platform146147SetVariableAlias(ALIAS_VAR_PROPVAL, "Length")148end sub149150151