Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R3/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
// ========================
6
// Aliases
7
// ========================
8
9
// Climbable
10
#alias 0 : INVISIBLEBLOCK_CLIMBABLE
11
#alias 1 : INVISIBLEBLOCK_BLOCK
12
13
// Collision
14
#alias 4 : C_BOX3
15
#alias 2 : PLAYER_COL_LWALL
16
#alias 3 : PLAYER_COL_RWALL
17
18
19
// ========================
20
// Subs
21
// ========================
22
23
sub ObjectPlayerInteraction
24
#platform: Use_Standalone
25
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
26
#endplatform
27
28
#platform: Use_Origins
29
switch Object.PropertyValue
30
case INVISIBLEBLOCK_CLIMBABLE
31
if Player.State != Player_State_LedgePullUp
32
if Player.Animation == ANI_CLIMBING
33
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
34
else
35
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
36
if Player.Animation == ANI_GLIDING
37
switch CheckResult
38
case PLAYER_COL_LWALL
39
case PLAYER_COL_RWALL
40
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
41
CallFunction(Player_ClimbBlock)
42
break
43
end switch
44
end if
45
end if
46
end if
47
break
48
49
case INVISIBLEBLOCK_BLOCK
50
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
51
break
52
end switch
53
#endplatform
54
end sub
55
56
57
// ========================
58
// Editor Subs
59
// ========================
60
61
sub RSDKDraw
62
DrawSprite(0)
63
64
TempValue0 = Object.iXPos
65
TempValue0 -= 16
66
TempValue1 = Object.iYPos
67
TempValue1 -= 14
68
DrawRectOutline(TempValue0, TempValue1, 32, 30, 255, 255, 255, 255)
69
end sub
70
71
72
sub RSDKLoad
73
LoadSpriteSheet("Global/Display.gif")
74
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
75
76
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
77
end sub
78
79