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/WFZ/VPropeller.txt
1478 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: V Propeller 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 VPropeller_DebugDraw
13
reserve function VPropeller_DebugSpawn
14
15
16
// ========================
17
// Function Definitions
18
// ========================
19
20
private function VPropeller_DebugDraw
21
DrawSprite(0)
22
end function
23
24
25
private function VPropeller_DebugSpawn
26
CreateTempObject(TypeName[V Propeller], 0, object.xpos, object.ypos)
27
end function
28
29
30
// ========================
31
// Events
32
// ========================
33
34
event ObjectUpdate
35
temp0 = object.xpos
36
temp0 >>= 16
37
temp0 -= camera[0].xpos
38
Abs(temp0)
39
temp0 -= 96
40
if temp0 < screen.xcenter
41
temp0 = object.ypos
42
temp0 >>= 16
43
temp0 -= camera[0].ypos
44
Abs(temp0)
45
if temp0 < 160
46
temp0 = oscillation
47
temp0 &= 0x1F
48
if temp0 == 0
49
PlaySfx(SfxName[Helicopter], false)
50
end if
51
end if
52
end if
53
54
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
55
BoxCollisionTest(C_TOUCH, object.entityPos, -4, -64, 4, 64, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
56
if checkResult == true
57
CallFunction(Player_Hit)
58
end if
59
next
60
end event
61
62
63
event ObjectDraw
64
DrawSprite(WFZSetup_vPropellerFrame)
65
end event
66
67
68
event ObjectStartup
69
LoadSpriteSheet("SCZ/Objects.gif")
70
SpriteFrame(-4, -64, 8, 64, 121, 106)
71
SpriteFrame(-4, -32, 8, 64, 121, 106)
72
SpriteFrame(-4, 0, 8, 64, 121, 106)
73
74
SetTableValue(TypeName[V Propeller], DebugMode_ObjCount, DebugMode_TypesTable)
75
SetTableValue(VPropeller_DebugDraw, DebugMode_ObjCount, DebugMode_DrawTable)
76
SetTableValue(VPropeller_DebugSpawn, DebugMode_ObjCount, DebugMode_SpawnTable)
77
DebugMode_ObjCount++
78
end event
79
80
81
// ========================
82
// Editor Events
83
// ========================
84
85
event RSDKDraw
86
DrawSprite(0)
87
end event
88
89
90
event RSDKLoad
91
LoadSpriteSheet("SCZ/Objects.gif")
92
SpriteFrame(-4, -64, 8, 64, 121, 106)
93
94
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
95
end event
96
97