Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/Block.txt
1319 views
1
//------------------Sonic CD Block Script---------------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
//-------Aliases-------//
6
#alias 4 : C_BOX3
7
#alias 2 : PLAYER_COL_LWALL
8
#alias 3 : PLAYER_COL_RWALL
9
10
sub ObjectPlayerInteraction
11
#platform: Use_Standalone
12
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
13
#endplatform
14
15
#platform: Use_Origins
16
if Player.State != Player_State_LedgePullUp
17
if Player.Animation == ANI_CLIMBING
18
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
19
else
20
if Player.Animation == ANI_GLIDING
21
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
22
switch CheckResult
23
case PLAYER_COL_LWALL
24
Player.Direction = FACING_RIGHT
25
CallFunction(Player_ClimbBlock)
26
break
27
28
case PLAYER_COL_RWALL
29
Player.Direction = FACING_LEFT
30
CallFunction(Player_ClimbBlock)
31
break
32
end switch
33
else
34
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
35
end if
36
end if
37
end if
38
#endplatform
39
end sub
40
41
42
sub ObjectDraw
43
DrawSprite(0)
44
end sub
45
46
47
sub ObjectStartup
48
LoadSpriteSheet("R3/Objects.gif")
49
SpriteFrame(-16, -16, 32, 32, 1, 1) // #0 - Block
50
end sub
51
52
53
// ========================
54
// Editor Subs
55
// ========================
56
57
sub RSDKDraw
58
DrawSprite(0)
59
end sub
60
61
62
sub RSDKLoad
63
LoadSpriteSheet("R3/Objects.gif")
64
SpriteFrame(-16, -16, 32, 32, 1, 1) // #0 - Block
65
66
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
67
end sub
68
69