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/LZ/SBZ3Fall.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: SBZ3 Fall 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.playerID
13
14
private alias 0 : SBZ3FALL_SETUP
15
private alias 1 : SBZ3FALL_HANDLEFALL
16
17
// Player Aliases
18
private alias object.state : player.state
19
private alias object.direction : player.direction
20
private alias object.animation : player.animation
21
private alias object.gravity : player.gravity
22
private alias object.value26 : player.flightVelocity
23
24
25
// ========================
26
// Events
27
// ========================
28
29
event ObjectUpdate
30
if object.state == SBZ3FALL_SETUP
31
if recAnimation != 0
32
temp0 = recAnimation
33
else
34
temp0 = ANI_HURT
35
temp0 <<= 16
36
temp0 |= ANI_HURT
37
temp0 <<= 8
38
end if
39
40
// Create an SBZ3 Fall object for every player
41
currentPlayer = 0
42
while currentPlayer < playerCount
43
CreateTempObject(TypeName[SBZ3 Fall], 0, object.xpos, object.ypos)
44
object[tempObjectPos].state = SBZ3FALL_HANDLEFALL
45
object[tempObjectPos].playerID = currentPlayer
46
object[tempObjectPos].direction = temp0
47
object[tempObjectPos].direction &= 0xFF
48
temp0 >>= 8
49
object[tempObjectPos].animation = temp0
50
object[tempObjectPos].animation &= 0xFF
51
temp0 >>= 8
52
53
currentPlayer++
54
loop
55
56
object.type = TypeName[Blank Object]
57
else
58
currentPlayer = object.playerID
59
60
if player[currentPlayer].gravity == GRAVITY_GROUND
61
object.type = TypeName[Blank Object]
62
else
63
player[currentPlayer].direction = object.direction
64
player[currentPlayer].animation = object.animation
65
66
if player[currentPlayer].animation == ANI_JUMPING
67
#platform: USE_STANDALONE
68
player[currentPlayer].state = Player_State_Air
69
#endplatform
70
#platform: USE_ORIGINS
71
player[currentPlayer].state = Player_State_Air_NoDropDash
72
#endplatform
73
object.type = TypeName[Blank Object]
74
end if
75
76
if player[currentPlayer].animation == ANI_FLYING
77
player[currentPlayer].state = Player_State_Fly
78
player[currentPlayer].flightVelocity = 0x800
79
object.type = TypeName[Blank Object]
80
end if
81
82
if player[currentPlayer].animation == ANI_GLIDING
83
if player[currentPlayer].direction == 1
84
player[currentPlayer].state = Player_State_GlideLeft
85
else
86
player[currentPlayer].state = Player_State_GlideRight
87
end if
88
89
object.type = TypeName[Blank Object]
90
end if
91
92
if player[currentPlayer].animation == ANI_GLIDING_DROP
93
player[currentPlayer].state = Player_State_GlideDrop
94
object.type = TypeName[Blank Object]
95
end if
96
end if
97
end if
98
end event
99
100
101
// ========================
102
// Editor Events
103
// ========================
104
105
event RSDKDraw
106
DrawSprite(0)
107
end event
108
109
110
event RSDKLoad
111
LoadSpriteSheet("Global/Display.gif")
112
SpriteFrame(-8, -8, 16, 16, 239, 239) // "Trigger" - #0
113
114
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
115
end event
116
117