Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R1/InvisibleBlock.txt
1319 views
1
//------------Sonic CD Invisivle Block Script-------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
//-------Aliases-------//
6
#alias Object.PropertyValue : InvisBlock.Type
7
8
#alias 0 : CLIMBABLE
9
#alias 1 : NOT_CLIMBABLE
10
11
#alias 4 : C_BOX3
12
#alias 2 : PLAYER_COL_LWALL
13
#alias 3 : PLAYER_COL_RWALL
14
15
// Ink Effect Aliases
16
#alias 2 : INK_ALPHA // Uses transparency value of Object.Alpha
17
18
19
sub ObjectPlayerInteraction
20
switch InvisBlock.Type
21
case CLIMBABLE
22
if Player.State != Player_State_LedgePullUp
23
if Player.Animation == ANI_CLIMBING
24
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
25
else
26
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
27
if Player.Animation == ANI_GLIDING
28
switch CheckResult
29
case PLAYER_COL_LWALL
30
case PLAYER_COL_RWALL
31
PlayerObjectCollision(C_BOX3, -16, -16, 16, 16)
32
CallFunction(Player_ClimbBlock)
33
break
34
end switch
35
end if
36
end if
37
end if
38
break
39
40
case NOT_CLIMBABLE
41
PlayerObjectCollision(C_BOX, -16, -16, 16, 16)
42
break
43
end switch
44
end sub
45
46
47
sub ObjectDraw
48
if Stage.DebugMode == true
49
// No funny Eggman sprites here, just a boring square :(
50
51
TempValue0 = Object.iXPos
52
TempValue0 -= 16
53
TempValue0 -= Screen.XOffset
54
55
TempValue1 = Object.iYPos
56
TempValue1 -= 16
57
TempValue1 -= Screen.YOffset
58
59
if InvisBlock.Type == CLIMBABLE
60
DrawRect(TempValue0, TempValue1, 32, 32, 50, 96, 100, 150)
61
else
62
DrawRect(TempValue0, TempValue1, 32, 32, 25, 48, 50, 200)
63
end if
64
65
Object.DrawOrder = 5
66
end if
67
end sub
68
69
sub RSDKDraw
70
TempValue0 = Object.XPos
71
TempValue0 -= 0x100000
72
TempValue1 = Object.YPos
73
TempValue1 -= 0x100000
74
75
DrawRectOutline(TempValue0,TempValue1,0x20,0x20,255,255,0,255)
76
77
Object.InkEffect = INK_ALPHA
78
Object.Alpha = 1
79
DrawSpriteFX(0, FX_INK, Object.XPos, Object.YPos)
80
end sub
81
82
sub RSDKLoad
83
LoadSpriteSheet("Global/Display.gif")
84
SpriteFrame(-16, -16, 32, 32, 1, 143)
85
86
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
87
end sub
88
89