Path: blob/main/Scripts/R6/R6BossCSetup.txt
1319 views
//---------------Sonic CD R6 Boss C Setup Script--------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value1 : Object.PaletteBank6#alias Object.Value4 : Object.LightTile7#alias Object.Value5 : Object.ElectricTile8#alias Object.Value6 : Object.BounceFloorAnim9#alias Object.Value7 : Object.BounceFloorTile10#alias Object.Scale : Object.BounceFloorFlag11#alias Object.Direction : Object.WebDirection1213// Player Aliases14#alias Player.Value4 : Player.InvincibleTimer1516// States17#alias 2 : R6C_SETUP_WEB_SHOCK // Unused in boss stages1819// Web Directions20#alias 0 : VERTICAL_WEB21#alias 1 : HORIZONTAL_WEB22#alias 2 : DIAGONAL_WEB2324// Gravity25#alias 1 : GRAVITY_AIR2627// Stage SFX28#alias 0 : SFX_S_BOUNCEFLOOR29#alias 2 : SFX_S_CATCH3031// Priority32#alias 1 : PRIORITY_ACTIVE3334// Tile Info35#alias 8 : TILEINFO_ANGLEB363738sub ObjectMain39TempValue0 = Object.LightTile40TempValue0 &= 141if TempValue0 == 042TempValue0 = Object.LightTile43TempValue0 >>= 144TempValue0 += 80845Copy16x16Tile(579, TempValue0)46end if47Object.LightTile++48Object.LightTile %= 244950TempValue0 = Object.ElectricTile51TempValue0 %= 552if TempValue0 == 053TempValue0 = Object.ElectricTile54TempValue0 /= 555TempValue0 += 82056Copy16x16Tile(580, TempValue0)57TempValue0 += 358Copy16x16Tile(581, TempValue0)59end if60Object.ElectricTile++61Object.ElectricTile %= 156263TempValue0 = Object.BounceFloorAnim64TempValue0 &= 165if TempValue0 == 066TempValue0 = Object.BounceFloorTile67TempValue0 += 82668Object.BounceFloorTile++69Object.BounceFloorTile %= 670Copy16x16Tile(543, TempValue0)71end if72Object.BounceFloorAnim++73Object.BounceFloorAnim &= 5117475Object.BounceFloorFlag = true7677TempValue0 = Object.PaletteBank78TempValue0 >>= 179SetActivePalette(TempValue0, 0, Screen.YSize)80Object.PaletteBank++81Object.PaletteBank %= 682end sub838485sub ObjectPlayerInteraction86TempValue2 = Player.XPos87TempValue2 >>= 1688TempValue2 += Player.CollisionRight8990TempValue3 = Player.YPos91TempValue3 >>= 1692TempValue3 += Player.CollisionBottom93TempValue3 += 294Get16x16TileInfo(TempValue0, TempValue2, TempValue3, TILEINFO_ANGLEB)9596TempValue2 = Player.XPos97TempValue2 >>= 1698TempValue2 += Player.CollisionLeft99Get16x16TileInfo(TempValue1, TempValue2, TempValue3, TILEINFO_ANGLEB)100// Bug Details:101// Sonic Team updated the normal bounce floor (which is R6BounceFloor in Origins for the Past and Present)102// to prevent Knuckles from disabling his collisions when climbing onto the floor (they knew about this bug)103// However, they didn't update it here and in R6BossDSetup.104TempValue0 |= TempValue1105if TempValue0 == true106if Object.BounceFloorFlag == true107if Player.YVelocity > -1108Player.Animation = ANI_JUMPING109Player.Gravity = GRAVITY_AIR110Player.Timer = 0111Player.YVelocity = -0x160000112113#platform: Use_Origins114Player.State = Player_State_Air_NoDropDash115#endplatform116117#platform: Use_Standalone118Player.State = Player_State_Air119#endplatform120PlayStageSfx(SFX_S_BOUNCEFLOOR, false)121122#platform: Use_Haptics123HapticEffect(60, 0, 0, 0)124#endplatform125126end if127end if128end if129130TempValue2 -= Player.CollisionLeft131TempValue3 -= Player.CollisionBottom132TempValue3 -= 2133// You will see constant checks for R6C_SETUP_WEB_SHOCK state134// but the code to reach that state is removed, since there are no shock webs on the boss stage135Get16x16TileInfo(TempValue0, TempValue2, TempValue3, TILEINFO_ANGLEB)136switch TempValue0137case 2138if Player.InvincibleTimer == 0139Player.State = Player_State_GotHit140if Player.Direction == FACING_LEFT141Player.Speed = 0x20000142else143Player.Speed = -0x20000144end if145end if146break147case 5148if Object.State == R6C_SETUP_WEB_SHOCK149if Player.InvincibleTimer == 0150Player.State = Player_State_GotHit151if Player.Direction == FACING_LEFT152Player.Speed = 0x20000153else154Player.Speed = -0x20000155end if156end if157end if158break159case 6160if Object.State == R6C_SETUP_WEB_SHOCK161if Object.WebDirection == VERTICAL_WEB162if Player.InvincibleTimer == 0163Player.State = Player_State_GotHit164if Player.Direction == FACING_LEFT165Player.Speed = 0x20000166else167Player.Speed = -0x20000168end if169end if170end if171end if172break173case 7174if Object.State == R6C_SETUP_WEB_SHOCK175if Object.WebDirection == HORIZONTAL_WEB176if Player.InvincibleTimer == 0177Player.State = Player_State_GotHit178if Player.Direction == FACING_LEFT179Player.Speed = 0x20000180else181Player.Speed = -0x20000182end if183end if184end if185end if186break187case 8188if Object.State == R6C_SETUP_WEB_SHOCK189if Object.WebDirection == DIAGONAL_WEB190if Player.InvincibleTimer == 0191Player.State = Player_State_GotHit192if Player.Direction == FACING_LEFT193Player.Speed = 0x20000194else195Player.Speed = -0x20000196end if197end if198end if199end if200break201end switch202TempValue3 -= 4203Get16x16TileInfo(TempValue0, TempValue2, TempValue3, TILEINFO_ANGLEB)204switch TempValue0205case 2206if Player.InvincibleTimer == 0207Player.State = Player_State_GotHit208if Player.Direction == FACING_LEFT209Player.Speed = 0x20000210else211Player.Speed = -0x20000212end if213end if214break215case 5216if Object.State == R6C_SETUP_WEB_SHOCK217if Player.InvincibleTimer == 0218Player.State = Player_State_GotHit219if Player.Direction == FACING_LEFT220Player.Speed = 0x20000221else222Player.Speed = -0x20000223end if224end if225end if226break227case 6228if Object.State == R6C_SETUP_WEB_SHOCK229if Object.WebDirection == VERTICAL_WEB230if Player.InvincibleTimer == 0231Player.State = Player_State_GotHit232if Player.Direction == FACING_LEFT233Player.Speed = 0x20000234else235Player.Speed = -0x20000236end if237end if238end if239end if240break241case 7242if Object.State == R6C_SETUP_WEB_SHOCK243if Object.WebDirection == HORIZONTAL_WEB244if Player.InvincibleTimer == 0245Player.State = Player_State_GotHit246if Player.Direction == FACING_LEFT247Player.Speed = 0x20000248else249Player.Speed = -0x20000250end if251end if252end if253end if254break255case 8256if Object.State == R6C_SETUP_WEB_SHOCK257if Object.WebDirection == DIAGONAL_WEB258if Player.InvincibleTimer == 0259Player.State = Player_State_GotHit260if Player.Direction == FACING_LEFT261Player.Speed = 0x20000262else263Player.Speed = -0x20000264end if265end if266end if267end if268break269end switch270TempValue3 += 4271TempValue3 += Player.CollisionTop272Get16x16TileInfo(TempValue0, TempValue2, TempValue3, TILEINFO_ANGLEB)273if TempValue0 == 3274TempValue4 = TempValue3275TempValue4 &= 15276if TempValue4 < 8277if Player.State != Player_State_HangBar278Player.State = Player_State_HangBar279Player.YVelocity = 0280Player.Animation = ANI_HANGING281TempValue3 &= 0x7FF0282TempValue3 += 4283TempValue3 -= Player.CollisionTop284Player.iYPos = TempValue3285PlayStageSfx(SFX_S_CATCH, false)286Screen.AdjustCameraY = 0287end if288end if289end if290end sub291292293sub ObjectStartup294Object[19].Type = TypeName[R6 Setup]295Object[19].Priority = PRIORITY_ACTIVE296Object[19].DrawOrder = 2297298TempValue0 = 1299while TempValue0 < 3300RotatePalette(161, 163, 0)301CopyPalette(0, TempValue0)302TempValue0++303loop304RotatePalette(161, 163, 0)305end sub306307308// ========================309// Editor Subs310// ========================311312sub RSDKDraw313DrawSprite(0)314end sub315316317sub RSDKLoad318LoadSpriteSheet("Global/Display.gif")319SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon320321SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")322end sub323324325