Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/R8/HotaruLaser.txt
1319 views
1
//----------------Sonic CD Hotaru Laser Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
#alias Object.Value1 : Object.LaserYPos
8
#alias Object.Value2 : Object.HotaruEntity
9
10
// States
11
#alias 0 : HOTARULASER_SHOT
12
#alias 1 : HOTARULASER_SPLASH
13
14
// Collision Sides
15
#alias 0 : CSIDE_FLOOR
16
17
18
sub ObjectMain
19
switch Object.State
20
case HOTARULASER_SHOT
21
Object.YPos += 0x80000
22
23
ObjectTileCollision(CSIDE_FLOOR, 0, 8, 0)
24
if CheckResult == true
25
Object.LaserYPos = Object.YPos
26
Object.State++
27
end if
28
break
29
30
case HOTARULASER_SPLASH
31
if Object.Timer < 2
32
Object.YPos += 0x80000
33
Object.Timer++
34
else
35
Object.Type = TypeName[Blank Object]
36
end if
37
break
38
end switch
39
end sub
40
41
42
sub ObjectPlayerInteraction
43
ArrayPos0 = Object.HotaruEntity
44
45
if Object[ArrayPos0].Type == TypeName[Hotaru]
46
PlayerObjectCollision(C_TOUCH, -4, -8, 4, 8)
47
if CheckResult == true
48
CallFunction(Player_Hit)
49
end if
50
end if
51
end sub
52
53
54
sub ObjectDraw
55
DrawSprite(2)
56
57
TempValue0 = Object.AnimationTimer
58
TempValue0 >>= 1
59
DrawSpriteXY(TempValue0, Object.XPos, Object.LaserYPos)
60
61
Object.AnimationTimer++
62
Object.AnimationTimer &= 3
63
end sub
64
65
66
sub ObjectStartup
67
LoadSpriteSheet("R8/Objects3.gif")
68
69
SpriteFrame(-12, -8, 24, 16, 146, 158) // #0 - Laser Splash frame 0
70
SpriteFrame(-12, -8, 24, 16, 171, 158) // #1 - Laser Splash frame 1
71
72
SpriteFrame(-4, -8, 8, 22, 196, 133) // #2 - Laser
73
end sub
74
75
76
// ========================
77
// Editor Subs
78
// ========================
79
80
sub RSDKDraw
81
DrawSprite(0)
82
end sub
83
84
85
sub RSDKLoad
86
LoadSpriteSheet("R8/Objects3.gif")
87
SpriteFrame(-4, -8, 8, 22, 196, 133) // #0 - Laser
88
89
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
90
end sub
91
92