Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 2/Scripts/Mission/SCZSpeedUp.txt
1480 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: SCZSpeedUp Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// This Object is used in Mission "Tornado Flyby" - M040 - Mission_Zone10
9
10
// ========================
11
// Events
12
// ========================
13
14
event ObjectUpdate
15
// What this object does is make every projectile move just a tad bit faster, at double the projectile's standard speed
16
17
// Cycle through the entire temp object list and update its objects, looking for projectiles
18
arrayPos0 = 0x420
19
while arrayPos0 < 0x4A0
20
switch object[arrayPos0].type
21
case TypeName[Turtloid Shot]
22
// Turtloid Shot xvel is normally -0x8000, this is double that
23
object[arrayPos0].xvel = -0x10000
24
break
25
26
case TypeName[Nebula Bomb]
27
// Making it fall faster, apply 2x gravity
28
// (The first round of `+= 0x3800` is already done in the Nebula Bomb script)
29
object[arrayPos0].yvel += 0x3800
30
break
31
32
case TypeName[OctusShot] // Normally has a name of [Octus Shot] in OOZ, but WFZ removes the space
33
// Octus Shot xvel is normally +/- 0x20000, is this again double that
34
if object[arrayPos0].xvel < 0
35
object[arrayPos0].xvel = -0x40000
36
else
37
object[arrayPos0].xvel = 0x40000
38
end if
39
break
40
41
case TypeName[AsteronSpike] // Similar case here, normally [Asteron Spike] but WFZ's entry removes the space
42
switch object[arrayPos0].propertyValue
43
case 0
44
// Normally has a yvel of -0x40000 (and an xvel of 0)
45
object[arrayPos0].yvel = -0x80000
46
break
47
48
case 1
49
// Normally has an xvel of +/- 0x30000, and a yvel of -0x10000
50
if object[arrayPos0].xvel < 0
51
object[arrayPos0].xvel = -0x60000
52
else
53
object[arrayPos0].xvel = 0x60000
54
end if
55
object[arrayPos0].yvel = -0x20000
56
break
57
58
case 2
59
// Normally has an xvel of +/- 0x30000, and a yvel of -0x30000
60
if object[arrayPos0].xvel < 0
61
object[arrayPos0].xvel = -0x60000
62
else
63
object[arrayPos0].xvel = 0x60000
64
end if
65
object[arrayPos0].yvel = 0x60000
66
break
67
68
end switch // object[arrayPos0].propertyValue
69
break
70
71
end switch // object[arrayPos0].type
72
73
arrayPos0++
74
loop
75
end event
76
77
78
event ObjectStartup
79
foreach (TypeName[SCZSpeedUp], arrayPos0, ALL_ENTITIES)
80
object[arrayPos0].priority = PRIORITY_ACTIVE
81
next
82
end event
83
84
85
// ========================
86
// Editor Events
87
// ========================
88
89
event RSDKDraw
90
DrawSprite(0)
91
end event
92
93
94
event RSDKLoad
95
LoadSpriteSheet("Global/Display.gif")
96
SpriteFrame(-16, -16, 32, 32, 1, 143)
97
98
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
99
end event
100
101