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