Path: blob/main/Scripts/R8/R8Spikes.txt
1319 views
//----------------Sonic CD R8 Spikes Script-------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Player.Value4 : Player.InvincibleTimer67// Property Values8#alias 0 : DRAWING_PLANE_A9#alias 1 : DRAWING_PLANE_B101112sub ObjectPlayerInteraction13if Player.CollisionPlane == Object.PropertyValue14PlayerObjectCollision(C_BOX, -16, -12, 16, 16)15if Player.YVelocity > -116if Player.InvincibleTimer == 017PlayerObjectCollision(C_TOUCH, -15, -13, 15, -12)18if CheckResult == true19Player.State = Player_State_GotHit20if Player.XPos > Object.XPos21Player.Speed = 0x2000022else23Player.Speed = -0x2000024end if25end if26end if27end if28end if29end sub303132sub ObjectDraw33DrawSprite(0)34end sub353637sub ObjectStartup38LoadSpriteSheet("Global/Items3.gif")3940SpriteFrame(-16, -16, 32, 32, 50, 1) // #0 - Spikes4142ArrayPos0 = 3243while ArrayPos0 < 105644if Object[ArrayPos0].Type == TypeName[R8 Spikes]45if Object[ArrayPos0].PropertyValue == DRAWING_PLANE_B46Object[ArrayPos0].DrawOrder = 147end if48end if49ArrayPos0++50loop51end sub525354// ========================55// Editor Subs56// ========================5758sub RSDKEdit59if Editor.ReturnVariable == true60switch Editor.VariableID61case EDIT_VAR_PROPVAL // Property Value62CheckResult = Object.PropertyValue63CheckResult &= 164break65case 0 // drawPlane66CheckResult = Object.PropertyValue67CheckResult &= 168break69end switch70else71switch Editor.VariableID72case EDIT_VAR_PROPVAL // Property Value73Object.PropertyValue = Editor.VariableValue74Object.PropertyValue &= 175break76case 0 // drawPlane77Object.PropertyValue = Editor.VariableValue78Object.PropertyValue &= 179break80end switch81end if82end sub8384sub RSDKDraw85Object.InkEffect = Object.PropertyValue86DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)87end sub888990sub RSDKLoad91LoadSpriteSheet("Global/Items3.gif")9293SpriteFrame(-16, -16, 32, 32, 50, 1) // #0 - Spikes9495AddEditorVariable("drawPlane")96SetActiveVariable("drawPlane")97AddEnumVariable("Plane A", DRAWING_PLANE_A)98AddEnumVariable("Plane B", DRAWING_PLANE_B)99end sub100101102