Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/PaletteAni_C.txt
1319 views
1
//-------------Sonic CD Palette Animation Script--------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
#alias Object.Value1 : Object.CurrentPalette
8
9
// Priority
10
#alias 1 : PRIORITY_ACTIVE
11
12
13
sub ObjectMain
14
Object.Timer++
15
if Object.Timer == 3
16
Object.Timer = 0
17
Object.CurrentPalette++
18
Object.CurrentPalette %= 3
19
SetActivePalette(Object.CurrentPalette, 0, 240)
20
end if
21
end sub
22
23
24
sub ObjectStartup
25
Object[19].Type = TypeName[PaletteAnimation]
26
Object[19].Priority = PRIORITY_ACTIVE
27
28
CopyPalette(0, 1)
29
CopyPalette(0, 2)
30
31
// Bug Details:
32
// The TempValue2 here seems to cause the structs in R33C to use a black palette cycle when they are supposed to be green.
33
// This is because in "Palettes/R3C_PalCycle.act", idx-31 and idx-63 are black color slots.
34
// Could either imply that this is a coding oversight or a .pal file issue. Unsure of which it is.
35
TempValue0 = 0
36
TempValue1 = 0
37
TempValue2 = 32
38
while TempValue0 < 3
39
LoadPalette("R3C_PalCycle.act", TempValue0, 160, TempValue1, TempValue2)
40
TempValue0++
41
TempValue1 += 32
42
TempValue2 += 32
43
loop
44
end sub
45
46
47
// ========================
48
// Editor Subs
49
// ========================
50
51
sub RSDKDraw
52
DrawSprite(0)
53
end sub
54
55
56
sub RSDKLoad
57
LoadSpriteSheet("Global/Display.gif")
58
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
59
60
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
61
end sub
62
63