Path: blob/main/Scripts/TAttack/Records.txt
1319 views
//------------------Sonic CD Records Script-------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value1 : Object.Minutes6#alias Object.Value2 : Object.Seconds7#alias Object.Value3 : Object.MilliSeconds8#alias Object.PropertyValue : Object.Record910// Large Icon Aliases11#alias Object.PropertyValue : LargeIcon.Portrait1213// Menu Control Aliases14#alias Object[0].Value0 : MenuControl.Timer15#alias Object[0].Value4 : MenuControl.SMYPos16#alias Object[0].Value5 : MenuControl.SMCurrentButton17#alias Object[0].State : MenuControl.State1819// Menu Control States20// *SM = Sub Menu21#alias 7 : MENUCONTROL_SM_CONTROLS22#alias 10 : MENUCONTROL_SM_CONFIRMED23#alias 11 : MENUCONTROL_SM_LOAD_LEVEL24#alias 13 : MENUCONTROL_SM_COMFIRMED_LEAVE2526// Property Values27#alias 0 : FIRST_RECORD28#alias 1 : SECOND_RECORD29#alias 2 : THIRD_RECORD3031// Priority32#alias 1 : PRIORITY_ACTIVE3334// Function delarations35#function Records_DrawRecords3637function Records_DrawRecords38Object.Minutes = SaveRAM[ArrayPos0]39Object.Minutes /= 60004041Object.Seconds = SaveRAM[ArrayPos0]42Object.Seconds /= 10043Object.Seconds %= 604445Object.MilliSeconds = SaveRAM[ArrayPos0]46Object.MilliSeconds %= 1004748TempValue0 = Object.XPos49TempValue0 >>= 1650TempValue0 -= 1651DrawNumbers(26, TempValue0, TempValue1, Object.Minutes, 2, 8, 1)52TempValue0 += 2453DrawNumbers(26, TempValue0, TempValue1, Object.Seconds, 2, 8, 1)54TempValue0 += 2455DrawNumbers(26, TempValue0, TempValue1, Object.MilliSeconds, 2, 8, 1)56end function575859sub ObjectMain60Object.YPos = Object.Record61Object.YPos *= 19262Object.YPos -= MenuControl.SMYPos63if Object.YPos < -38464Object.YPos += 57665end if66Object.YPos += 22467Object.YPos <<= 1668end sub697071sub ObjectDraw72DrawSprite(47)73switch Object.PropertyValue74case FIRST_RECORD75TempValue0 = LargeIcon[-1].Portrait76TempValue0 += 3677DrawSprite(TempValue0)78DrawSprite(44)79break8081case SECOND_RECORD82TempValue0 = LargeIcon[-2].Portrait83TempValue0 += 3684DrawSprite(TempValue0)85DrawSprite(45)86break8788case THIRD_RECORD89TempValue0 = LargeIcon[-3].Portrait90TempValue0 += 3691DrawSprite(TempValue0)92DrawSprite(46)93break94end switch9596ArrayPos0 = TempValue097ArrayPos0 -= 3698ArrayPos0 *= 1899100TempValue0 = Object.Record101TempValue0 *= 6102103ArrayPos0 += TempValue0104ArrayPos0 += 48105106TempValue1 = Object.YPos107TempValue1 >>= 16108TempValue1 += 97109CallFunction(Records_DrawRecords)110111TempValue1 += 24112ArrayPos0 += 2113CallFunction(Records_DrawRecords)114115TempValue1 += 24116ArrayPos0 += 2117CallFunction(Records_DrawRecords)118119#platform: Standard120switch MenuControl.State121case MENUCONTROL_SM_CONTROLS122switch MenuControl.SMCurrentButton123case 0124DrawSprite(48)125break126case 1127DrawSprite(49)128break129case 2130DrawSprite(50)131break132end switch133break134135case MENUCONTROL_SM_CONFIRMED136TempValue0 = MenuControl.Timer137TempValue0 &= 3138TempValue0 >>= 1139if TempValue0 == 0140DrawSprite(50)141end if142break143144case MENUCONTROL_SM_LOAD_LEVEL145DrawSprite(50)146break147148case MENUCONTROL_SM_COMFIRMED_LEAVE149TempValue0 = MenuControl.Timer150TempValue0 &= 3151TempValue0 >>= 1152if TempValue0 == 0153DrawSprite(48)154end if155break156157end switch158#endplatform159160#platform: Mobile161DrawSprite(51) // Blocks the PC buttons162#endplatform163end sub164165166sub ObjectStartup167LoadSpriteSheet("TAttack/TimeAttack.gif")168169SpriteFrame(0, 0, 8, 16, 136, 638) // #0 - A170SpriteFrame(0, 0, 8, 16, 145, 638) // #1 - B171SpriteFrame(0, 0, 8, 16, 154, 638) // #2 - C172SpriteFrame(0, 0, 8, 16, 163, 638) // #3 - D173SpriteFrame(0, 0, 8, 16, 172, 638) // #4 - E174SpriteFrame(0, 0, 8, 16, 181, 638) // #5 - F175SpriteFrame(0, 0, 8, 16, 190, 638) // #6 - G176SpriteFrame(0, 0, 8, 16, 199, 638) // #7 - H177SpriteFrame(0, 0, 8, 16, 208, 638) // #8 - I178SpriteFrame(0, 0, 8, 16, 217, 638) // #9 - J179SpriteFrame(0, 0, 8, 16, 226, 638) // #10 - K180SpriteFrame(0, 0, 8, 16, 235, 638) // #11 - L181SpriteFrame(0, 0, 8, 16, 244, 638) // #12 - M182SpriteFrame(0, 0, 8, 16, 253, 638) // #13 - N183SpriteFrame(0, 0, 8, 16, 262, 638) // #14 - O184SpriteFrame(0, 0, 8, 16, 280, 638) // #15 - P185SpriteFrame(0, 0, 8, 16, 289, 638) // #16 - Q186SpriteFrame(0, 0, 8, 16, 298, 638) // #17 - R187SpriteFrame(0, 0, 8, 16, 307, 638) // #18 - S188SpriteFrame(0, 0, 8, 16, 316, 638) // #19 - T189SpriteFrame(0, 0, 8, 16, 325, 638) // #20 - U190SpriteFrame(0, 0, 8, 16, 334, 638) // #21 - V191SpriteFrame(0, 0, 8, 16, 343, 638) // #22 - W192SpriteFrame(0, 0, 8, 16, 352, 638) // #23 - X193SpriteFrame(0, 0, 8, 16, 361, 638) // #24 - Y194SpriteFrame(0, 0, 8, 16, 361, 638) // #25 - Z195SpriteFrame(0, 0, 8, 16, 370, 638) // #26 - 0196SpriteFrame(0, 0, 8, 16, 379, 638) // #27 - 1197SpriteFrame(0, 0, 8, 16, 388, 638) // #28 - 2198SpriteFrame(0, 0, 8, 16, 397, 638) // #29 - 3199SpriteFrame(0, 0, 8, 16, 406, 638) // #30 - 4200SpriteFrame(0, 0, 8, 16, 415, 638) // #31 - 5201SpriteFrame(0, 0, 8, 16, 424, 638) // #32 - 6202SpriteFrame(0, 0, 8, 16, 433, 638) // #33 - 7203SpriteFrame(0, 0, 8, 16, 442, 638) // #34 - 8204SpriteFrame(0, 0, 8, 16, 451, 638) // #35 - 9205SpriteFrame(-32, 17, 64, 32, 1, 731) // #36 - Palmtree Panic206SpriteFrame(-32, 17, 65, 32, 66, 731) // #37 - Collision Chaos207SpriteFrame(-30, 17, 60, 32, 132, 731) // #38 - Tidal Tempest208SpriteFrame(-35, 17, 70, 32, 193, 731) // #39 - Quartz Quadrant209SpriteFrame(-38, 17, 77, 32, 264, 731) // #40 - Wacky Workbench210SpriteFrame(-34, 17, 68, 32, 342, 731) // #41 - Stardust Speedway211SpriteFrame(-32, 17, 64, 32, 1, 764) // #42 - Metallic Madness212SpriteFrame(-32, 17, 64, 32, 1, 764) // #43 - Copy of above (unused)213SpriteFrame(-20, 49, 38, 16, 368, 593) // #44 - Zone 1214SpriteFrame(-20, 49, 40, 15, 366, 610) // #45 - Zone 2215SpriteFrame(-20, 49, 40, 15, 422, 655) // #46 - Zone 3216SpriteFrame(-60, 0, 224, 192, 81, 831) // #47 - Record Menu217SpriteFrame(-60, 0, 44, 8, 306, 864) // #48 - Exit218SpriteFrame(-16, 0, 40, 8, 350, 864) // #49 - Next219SpriteFrame(24, 0, 28, 8, 390, 864) // #50 - Go220SpriteFrame(-60, 0, 112, 8, 306, 855) // #51 - Black Rect221222// Used to be below LoadSpriteSheet, moved here for consistency with the rest of scripts223ArrayPos0 = 32224while ArrayPos0 < 1056225if Object[ArrayPos0].Type == TypeName[Records]226TempValue0 = Screen.CenterX227TempValue0 += 76228TempValue0 <<= 16229Object[ArrayPos0].XPos = TempValue0230Object[ArrayPos0].DrawOrder = 2231Object[ArrayPos0].Priority = PRIORITY_ACTIVE232end if233ArrayPos0++234loop235236end sub237238239// ========================240// Editor Subs241// ========================242243sub RSDKEdit244if Editor.ReturnVariable == true245switch Editor.VariableID246case EDIT_VAR_PROPVAL // Property Value247CheckResult = Object.PropertyValue248break249case 0 // zoneID250CheckResult = Object.PropertyValue251break252end switch253else254switch Editor.VariableID255case EDIT_VAR_PROPVAL // Property Value256Object.PropertyValue = Editor.VariableValue257break258case 0 // zoneID259Object.PropertyValue = Editor.VariableValue260break261end switch262end if263end sub264265266sub RSDKDraw267DrawSprite(47)268269DrawSprite(36)270271TempValue0 = 44272TempValue0 += Object.PropertyValue273DrawSprite(TempValue0)274end sub275276277sub RSDKLoad278LoadSpriteSheet("TAttack/TimeAttack.gif")279280SpriteFrame(0, 0, 8, 16, 136, 638) // #0 - A281SpriteFrame(0, 0, 8, 16, 145, 638) // #1 - B282SpriteFrame(0, 0, 8, 16, 154, 638) // #2 - C283SpriteFrame(0, 0, 8, 16, 163, 638) // #3 - D284SpriteFrame(0, 0, 8, 16, 172, 638) // #4 - E285SpriteFrame(0, 0, 8, 16, 181, 638) // #5 - F286SpriteFrame(0, 0, 8, 16, 190, 638) // #6 - G287SpriteFrame(0, 0, 8, 16, 199, 638) // #7 - H288SpriteFrame(0, 0, 8, 16, 208, 638) // #8 - I289SpriteFrame(0, 0, 8, 16, 217, 638) // #9 - J290SpriteFrame(0, 0, 8, 16, 226, 638) // #10 - K291SpriteFrame(0, 0, 8, 16, 235, 638) // #11 - L292SpriteFrame(0, 0, 8, 16, 244, 638) // #12 - M293SpriteFrame(0, 0, 8, 16, 253, 638) // #13 - N294SpriteFrame(0, 0, 8, 16, 262, 638) // #14 - O295SpriteFrame(0, 0, 8, 16, 280, 638) // #15 - P296SpriteFrame(0, 0, 8, 16, 289, 638) // #16 - Q297SpriteFrame(0, 0, 8, 16, 298, 638) // #17 - R298SpriteFrame(0, 0, 8, 16, 307, 638) // #18 - S299SpriteFrame(0, 0, 8, 16, 316, 638) // #19 - T300SpriteFrame(0, 0, 8, 16, 325, 638) // #20 - U301SpriteFrame(0, 0, 8, 16, 334, 638) // #21 - V302SpriteFrame(0, 0, 8, 16, 343, 638) // #22 - W303SpriteFrame(0, 0, 8, 16, 352, 638) // #23 - X304SpriteFrame(0, 0, 8, 16, 361, 638) // #24 - Y305SpriteFrame(0, 0, 8, 16, 361, 638) // #25 - Z306SpriteFrame(0, 0, 8, 16, 370, 638) // #26 - 0307SpriteFrame(0, 0, 8, 16, 379, 638) // #27 - 1308SpriteFrame(0, 0, 8, 16, 388, 638) // #28 - 2309SpriteFrame(0, 0, 8, 16, 397, 638) // #29 - 3310SpriteFrame(0, 0, 8, 16, 406, 638) // #30 - 4311SpriteFrame(0, 0, 8, 16, 415, 638) // #31 - 5312SpriteFrame(0, 0, 8, 16, 424, 638) // #32 - 6313SpriteFrame(0, 0, 8, 16, 433, 638) // #33 - 7314SpriteFrame(0, 0, 8, 16, 442, 638) // #34 - 8315SpriteFrame(0, 0, 8, 16, 451, 638) // #35 - 9316SpriteFrame(-32, 17, 64, 32, 1, 731) // #36 - Palmtree Panic317SpriteFrame(-32, 17, 65, 32, 66, 731) // #37 - Collision Chaos318SpriteFrame(-30, 17, 60, 32, 132, 731) // #38 - Tidal Tempest319SpriteFrame(-35, 17, 70, 32, 193, 731) // #39 - Quartz Quadrant320SpriteFrame(-38, 17, 77, 32, 264, 731) // #40 - Wacky Workbench321SpriteFrame(-34, 17, 68, 32, 342, 731) // #41 - Stardust Speedway322SpriteFrame(-32, 17, 64, 32, 1, 764) // #42 - Metallic Madness323SpriteFrame(-32, 17, 64, 32, 1, 764) // #43 - Copy of above (unused)324SpriteFrame(-20, 49, 38, 16, 368, 593) // #44 - Zone 1325SpriteFrame(-20, 49, 40, 15, 366, 610) // #45 - Zone 2326SpriteFrame(-20, 49, 40, 15, 422, 655) // #46 - Zone 3327SpriteFrame(-60, 0, 224, 192, 81, 831) // #47 - Record Menu328SpriteFrame(-60, 0, 44, 8, 306, 864) // #48 - Exit329SpriteFrame(-16, 0, 40, 8, 350, 864) // #49 - Next330SpriteFrame(24, 0, 28, 8, 390, 864) // #50 - Go331SpriteFrame(-60, 0, 112, 8, 306, 855) // #51 - Black Rect332333AddEditorVariable("zoneID")334SetActiveVariable("zoneID")335AddEnumVariable("Zone 1", 0)336AddEnumVariable("Zone 2", 1)337AddEnumVariable("Zone 3", 2)338end sub339340341