Path: blob/main/Scripts/R1/TileTriggerH.txt
1319 views
//---------------Sonic CD Tile Trigger H 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.HitboxLeft8#alias Object.Value1 : Object.HitboxRight9#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// Helper aliases18#alias Object.PropertyValue : Helper.StoredChunk // This is a blank object1920// Property Values21#alias 0 : STARTUP_CHUNK22#alias 1 : NEXT_CHUNK232425sub ObjectPlayerInteraction26PlayerObjectCollision(C_TOUCH, Object.HitboxLeft, -12, Object.HitboxRight, 12)27if CheckResult == true2829if Helper[+1].StoredChunk == STARTUP_CHUNK30TempValue0 = Object.StartupChunk31else32TempValue0 = Object.NextChunk33end if34SetTileLayerEntry(TempValue0, 0, Object.ChunkX, Object.ChunkY)35TempValue0++3637SetTileLayerEntry(TempValue0, 0, Object.NextChunkX, Object.ChunkY)38TempValue0++3940SetTileLayerEntry(TempValue0, 0, Object.ChunkX, Object.NextChunkY)41TempValue0++4243SetTileLayerEntry(TempValue0, 0, Object.NextChunkX, Object.NextChunkY)44TempValue0++45end if46end sub474849sub ObjectStartup50ArrayPos0 = 3251while ArrayPos0 < 105652if Object[ArrayPos0].Type == TypeName[Tile Trigger H]53ArrayPos1 = ArrayPos054ArrayPos1++ // This should always be a blank object55Object[ArrayPos0].HitboxLeft = Object[ArrayPos0].Size56Object[ArrayPos0].HitboxLeft <<= 357Object[ArrayPos0].HitboxRight = Object[ArrayPos0].HitboxLeft58FlipSign(Object[ArrayPos0].HitboxLeft)59Object[ArrayPos0].HitboxLeft -= 860Object[ArrayPos0].HitboxRight += 86162Object[ArrayPos0].ChunkX = Object[ArrayPos1].iXPos63Object[ArrayPos0].ChunkX >>= 76465Object[ArrayPos0].NextChunkX = Object[ArrayPos0].ChunkX66Object[ArrayPos0].NextChunkX++6768Object[ArrayPos0].ChunkY = Object[ArrayPos1].iYPos69Object[ArrayPos0].ChunkY >>= 77071Object[ArrayPos0].NextChunkY = Object[ArrayPos0].ChunkY72Object[ArrayPos0].NextChunkY++7374GetTileLayerEntry(Object[ArrayPos0].StartupChunk, 0, Object[ArrayPos0].ChunkX, Object[ArrayPos0].ChunkY)7576Object[ArrayPos0].NextChunk = Object[ArrayPos0].StartupChunk77Object[ArrayPos0].NextChunk += 478end if79ArrayPos0++80loop81end sub828384// ========================85// Editor Subs86// ========================8788sub RSDKDraw89// size90TempValue0 = Object.PropertyValue91TempValue0 <<= 1992FlipSign(TempValue0)93TempValue0 += Object.XPos94TempValue0 += 0x800009596TempValue4 = 097while TempValue4 < Object.PropertyValue98DrawSpriteXY(0, TempValue0, Object.YPos)99TempValue0 += 0x100000100TempValue4++101loop102103if Object.PropertyValue == 0104DrawSprite(0)105end if106107if Editor.ShowGizmos == true108DrawArrow(Object.XPos, Object.YPos, Object[+1].XPos, Object[+1].YPos, 255, 255, 0)109end if110end sub111112113sub RSDKLoad114LoadSpriteSheet("Global/Display.gif")115SpriteFrame(-8, -8, 16, 16, 173, 67) // #0 - "T" Icon116117SetVariableAlias(ALIAS_VAR_PROPVAL, "size")118end sub119120121