Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/CPZ/Accessory.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Accessory Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
// Player Aliases
13
private alias object.value17 : debugMode.currentSelection
14
15
16
// ========================
17
// Function Declarations
18
// ========================
19
20
reserve function Accessory_DebugDraw
21
reserve function Accessory_DebugSpawn
22
23
24
// ========================
25
// Static Values
26
// ========================
27
28
private value Accessory_debugStartID = 0
29
30
31
// ========================
32
// Function Definitions
33
// ========================
34
35
private function Accessory_DebugDraw
36
temp0 = debugMode[0].currentSelection
37
temp0 -= Accessory_debugStartID
38
39
DrawSprite(temp0)
40
end function
41
42
43
private function Accessory_DebugSpawn
44
temp0 = debugMode[0].currentSelection
45
temp0 -= Accessory_debugStartID
46
47
CreateTempObject(TypeName[Accessory], temp0, object.xpos, object.ypos)
48
end function
49
50
51
// ========================
52
// Events
53
// ========================
54
55
event ObjectUpdate
56
// Empty event :(
57
end event
58
59
60
event ObjectDraw
61
DrawSprite(object.propertyValue)
62
end event
63
64
65
event ObjectStartup
66
LoadSpriteSheet("CPZ/Objects.gif")
67
68
// These are some unused metal poles from the original S2 release
69
70
// Wide Frame
71
SpriteFrame(-8, -48, 16, 48, 198, 207)
72
73
// Slim Frame
74
SpriteFrame(-4, -40, 8, 39, 215, 216)
75
76
temp0 = 0
77
Accessory_debugStartID = DebugMode_ObjCount
78
while temp0 < 2
79
SetTableValue(TypeName[Accessory], DebugMode_ObjCount, DebugMode_TypesTable)
80
SetTableValue(Accessory_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
81
SetTableValue(Accessory_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
82
DebugMode_ObjCount++
83
temp0++
84
loop
85
end event
86
87
88
// ========================
89
// Editor Events
90
// ========================
91
92
event RSDKDraw
93
DrawSprite(object.propertyValue)
94
end event
95
96
97
event RSDKLoad
98
LoadSpriteSheet("CPZ/Objects.gif")
99
SpriteFrame(-8, -48, 16, 48, 198, 207)
100
SpriteFrame(-4, -40, 8, 39, 215, 216)
101
102
SetVariableAlias(ALIAS_VAR_PROPVAL, "frameID")
103
end event
104
105