Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R8/InvisibleBlock.txt
1319 views
1
//--------------Sonic CD Invisible Block Script---------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Gravity
6
#alias 0 : GRAVITY_GROUND
7
8
// Collision
9
#alias 4 : C_BOX3
10
#alias 2 : PLAYER_COL_LWALL
11
#alias 3 : PLAYER_COL_RWALL
12
#alias 4 : PLAYER_COL_ROOF
13
14
// Ink Effect Aliases
15
#alias 2 : INK_ALPHA
16
17
// Climbable
18
#alias 0 : CLIMBABLE
19
#alias 1 : NOT_CLIMBABLE
20
21
sub ObjectPlayerInteraction
22
#platform: Use_Standalone
23
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
24
if Player.Gravity == GRAVITY_GROUND
25
if CheckResult == PLAYER_COL_ROOF
26
CallFunction(Player_Kill)
27
end if
28
end if
29
#endplatform
30
31
#platform: Use_Origins
32
switch Object.PropertyValue
33
case CLIMBABLE
34
if Player.State != Player_State_LedgePullUp
35
if Player.Animation == ANI_CLIMBING
36
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
37
else
38
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
39
if Player.Animation == ANI_GLIDING
40
switch CheckResult
41
case PLAYER_COL_LWALL
42
case PLAYER_COL_RWALL
43
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
44
CallFunction(Player_ClimbBlock)
45
break
46
end switch
47
end if
48
49
if Player.Gravity == GRAVITY_GROUND
50
if CheckResult == PLAYER_COL_ROOF
51
CallFunction(Player_Kill)
52
end if
53
end if
54
end if
55
end if
56
break
57
58
case NOT_CLIMBABLE
59
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
60
// Bug Details: The crush code is missing here LOL
61
break
62
end switch
63
#endplatform
64
end sub
65
66
67
// ========================
68
// Editor Subs
69
// ========================
70
71
sub RSDKDraw
72
TempValue0 = Object.XPos
73
TempValue0 -= 0x100000
74
TempValue1 = Object.YPos
75
TempValue1 -= 0x100000
76
77
DrawRectOutline(TempValue0, TempValue1, 0x20, 0x20, 0xFF, 0xFF, 0, 0xFF)
78
79
Object.InkEffect = INK_ALPHA
80
Object.Alpha = 1
81
DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)
82
end sub
83
84
85
sub RSDKLoad
86
LoadSpriteSheet("Global/Display.gif")
87
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
88
89
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
90
end sub
91
92