Path: blob/main/Scripts/R1/TileTriggerL.txt
1319 views
//---------------Sonic CD Tile Trigger L Script---------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// This is a chunk swapper for loops56// Aliases7#alias Object.Value0 : Object.HitboxTop8#alias Object.Value1 : Object.HitboxBottom9#alias Object.Value2 : Object.ChunkX10#alias Object.Value3 : Object.ChunkY11#alias Object.Value4 : Object.NextChunkX12#alias Object.Value5 : Object.NextChunkY13#alias Object.Value6 : Object.StartupChunk14#alias Object.Value7 : Object.NextChunk15#alias Object.PropertyValue : Object.Size1617// Gravity18#alias 0 : GRAVITY_GROUND192021sub ObjectPlayerInteraction22if Player.Gravity == GRAVITY_GROUND23PlayerObjectCollision(C_TOUCH, -12, Object.HitboxTop, 12, Object.HitboxBottom)24if CheckResult == true25if Player.Speed > 026TempValue0 = Object.NextChunk27else28TempValue0 = Object.StartupChunk29end if30SetTileLayerEntry(TempValue0, 0, Object.ChunkX, Object.ChunkY)31TempValue0++3233SetTileLayerEntry(TempValue0, 0, Object.NextChunkX, Object.ChunkY)34TempValue0++3536SetTileLayerEntry(TempValue0, 0, Object.ChunkX, Object.NextChunkY)37TempValue0++3839SetTileLayerEntry(TempValue0, 0, Object.NextChunkX, Object.NextChunkY)40TempValue0++41end if42end if43end sub444546sub ObjectStartup47ArrayPos0 = 3248while ArrayPos0 < 105649if Object[ArrayPos0].Type == TypeName[Tile Trigger L]50ArrayPos1 = ArrayPos051ArrayPos1++ // This should always be a blank object52Object[ArrayPos0].HitboxTop = Object[ArrayPos0].Size53Object[ArrayPos0].HitboxTop <<= 354Object[ArrayPos0].HitboxBottom = Object[ArrayPos0].HitboxTop55FlipSign(Object[ArrayPos0].HitboxTop)56Object[ArrayPos0].HitboxTop -= 857Object[ArrayPos0].HitboxBottom += 85859Object[ArrayPos0].ChunkX = Object[ArrayPos1].iXPos60Object[ArrayPos0].ChunkX >>= 76162Object[ArrayPos0].NextChunkX = Object[ArrayPos0].ChunkX63Object[ArrayPos0].NextChunkX++6465Object[ArrayPos0].ChunkY = Object[ArrayPos1].iYPos66Object[ArrayPos0].ChunkY >>= 76768Object[ArrayPos0].NextChunkY = Object[ArrayPos0].ChunkY69Object[ArrayPos0].NextChunkY++7071GetTileLayerEntry(Object[ArrayPos0].StartupChunk, 0, Object[ArrayPos0].ChunkX, Object[ArrayPos0].ChunkY)7273Object[ArrayPos0].NextChunk = Object[ArrayPos0].StartupChunk74Object[ArrayPos0].NextChunk += 475end if76ArrayPos0++77loop78end sub798081// ========================82// Editor Subs83// ========================8485sub RSDKDraw86TempValue0 = Object.PropertyValue87TempValue0 <<= 1988FlipSign(TempValue0)89TempValue0 += Object.YPos90TempValue0 += 0x800009192TempValue4 = 093while TempValue4 < Object.PropertyValue94DrawSpriteXY(0, Object.XPos, TempValue0)95TempValue0 += 0x10000096TempValue4++97loop9899if Object.PropertyValue == 0100DrawSprite(0)101end if102103if Editor.ShowGizmos == true104Editor.DrawingOverlay = true105DrawArrow(Object.XPos, Object.YPos, Object[+1].XPos, Object[+1].YPos, 255, 255, 0)106Editor.DrawingOverlay = false107end if108end sub109110111sub RSDKLoad112LoadSpriteSheet("Global/Display.gif")113SpriteFrame(-8, -8, 16, 16, 156, 67) // #0 - "L" Icon114115SetVariableAlias(ALIAS_VAR_PROPVAL, "size")116end sub117118119