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/Enemies/CluckerBase.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: Clucker Base Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Function Declarations
10
// ========================
11
12
reserve function CluckerBase_DebugDraw
13
reserve function CluckerBase_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function CluckerBase_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function CluckerBase_DebugSpawn
26
CreateTempObject(TypeName[Clucker Base], 0, object.xpos, object.ypos)
27
end function
28
29
30
// ========================
31
// Events
32
// ========================
33
34
event ObjectUpdate
35
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
36
BoxCollisionTest(C_SOLID, object.entityPos, -16, -8, 16, 8, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
37
next
38
end event
39
40
41
event ObjectDraw
42
DrawSprite(0)
43
end event
44
45
46
event ObjectStartup
47
CheckCurrentStageFolder("Zone11")
48
if checkResult == true
49
LoadSpriteSheet("SCZ/Objects.gif")
50
SpriteFrame(-24, -8, 48, 16, 1, 206)
51
52
// Hm?
53
// Why is this part in the zone folder check if it's the same between both?
54
SetTableValue(TypeName[Clucker Base], DebugMode_ObjCount, DebugMode_TypesTable)
55
SetTableValue(CluckerBase_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
56
SetTableValue(CluckerBase_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
57
DebugMode_ObjCount++
58
else
59
LoadSpriteSheet("MBZ/Objects.gif")
60
SpriteFrame(-24, -8, 48, 16, 576, 289)
61
62
// The same as the SCZ addition type above, not quite sure why it's separate here...
63
SetTableValue(TypeName[Clucker Base], DebugMode_ObjCount, DebugMode_TypesTable)
64
SetTableValue(CluckerBase_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
65
SetTableValue(CluckerBase_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
66
DebugMode_ObjCount++
67
end if
68
end event
69
70
71
// ========================
72
// Editor Events
73
// ========================
74
75
event RSDKDraw
76
DrawSprite(0)
77
end event
78
79
80
event RSDKLoad
81
CheckCurrentStageFolder("Zone11")
82
if checkResult == true
83
LoadSpriteSheet("SCZ/Objects.gif")
84
SpriteFrame(-24, -8, 48, 16, 1, 206)
85
else
86
LoadSpriteSheet("MBZ/Objects.gif")
87
SpriteFrame(-24, -8, 48, 16, 576, 289)
88
end if
89
90
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
91
end event
92
93