Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/Special/WarpBlock.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Warp Block Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.value0 : object.timer
13
14
15
// ========================
16
// Function Declarations
17
// ========================
18
19
reserve function WarpBlock_DebugDraw
20
reserve function WarpBlock_DebugSpawn
21
22
23
// ========================
24
// Function Definitions
25
// ========================
26
27
private function WarpBlock_DebugDraw
28
DrawSprite(0)
29
end function
30
31
32
private function WarpBlock_DebugSpawn
33
temp5 = TypeName[Warp Block]
34
temp4 = 0
35
CallFunction(DebugMode_PlaceBlock)
36
object[arrayPos0].drawOrder = 4
37
object[arrayPos0].groupID = GROUP_BLOCKS
38
end function
39
40
41
// ========================
42
// Events
43
// ========================
44
45
event ObjectUpdate
46
if object.state == 1
47
object.frame = object.timer
48
object.frame >>= 3
49
object.timer++
50
if object.timer == 32
51
object.timer = 0
52
object.state = 0
53
object.frame = 0
54
end if
55
end if
56
57
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
58
CallFunction(SpecialSetup_PlayerBlockCol)
59
next
60
end event
61
62
63
event ObjectDraw
64
CallFunction(SpecialSetup_GetBlockPos)
65
DrawSpriteXY(object.frame, temp0, temp1)
66
end event
67
68
69
event ObjectStartup
70
LoadSpriteSheet("Special/Objects.gif")
71
SpriteFrame(-12, -12, 24, 24, 301, 176)
72
73
foreach (TypeName[Warp Block], arrayPos0, ALL_ENTITIES)
74
object[arrayPos0].groupID = GROUP_BLOCKS
75
next
76
77
SetTableValue(TypeName[Warp Block], DebugMode_ObjCount, DebugMode_TypeTable)
78
SetTableValue(WarpBlock_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
79
SetTableValue(WarpBlock_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
80
DebugMode_ObjCount++
81
end event
82
83
84
// ========================
85
// Editor Events
86
// ========================
87
88
event RSDKDraw
89
DrawSprite(0)
90
end event
91
92
93
event RSDKLoad
94
LoadSpriteSheet("Special/Objects.gif")
95
SpriteFrame(-12, -12, 24, 24, 301, 176)
96
97
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
98
end event
99
100