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/OOZ/OOZSetup.txt
1479 views
1
// ----------------------------------
2
// RSDK Project: Sonic 2
3
// Script Description: OOZ Setup Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// ========================
9
// Aliases
10
// ========================
11
12
private alias object.value0 : object.deformTimer
13
private alias object.value1 : object.lightAniTileDelay
14
private alias object.value2 : object.lightAniTileFrame
15
private alias object.value3 : object.diamondAniTileDelay
16
private alias object.value4 : object.diamondAniTileFrame
17
private alias object.value5 : object.oilAniTileDelay
18
private alias object.value6 : object.oilAniTileFrame
19
private alias object.value7 : object.updatedBG
20
private alias object.value8 : object.oilSlideTimer
21
22
// Tile Flag Aliases
23
private alias 0 : TILE_NORMAL
24
private alias 1 : TILE_OILPOOL
25
private alias 3 : TILE_OILSTRIP
26
private alias 5 : TILE_OILSLIDE
27
28
// Tile Info ID Aliases
29
private alias 1 : TILEINFO_DIRECTION
30
private alias 8 : TILEINFO_ANGLEB
31
32
// Player Aliases
33
private alias object.state : player.state
34
private alias object.xpos : player.xpos
35
private alias object.ypos : player.ypos
36
private alias object.iypos : player.iypos
37
private alias object.xvel : player.xvel
38
private alias object.yvel : player.yvel
39
private alias object.speed : player.speed
40
private alias object.drawOrder : player.drawOrder
41
private alias object.direction : player.direction
42
private alias object.gravity : player.gravity
43
private alias object.pushing : player.pushing
44
private alias object.left : player.left
45
private alias object.right : player.right
46
private alias object.jumpPress : player.jumpPress
47
private alias object.controlLock : player.controlLock
48
private alias object.angle : player.angle
49
private alias object.frame : player.frame
50
private alias object.animation : player.animation
51
private alias object.animationSpeed : player.animationSpeed
52
private alias object.collisionMode : player.collisionMode
53
private alias object.collisionBottom : player.collisionBottom
54
private alias object.tileCollisions : player.tileCollisions
55
56
private alias object.value1 : player.timer
57
private alias object.value14 : player.skidding
58
private alias object.value18 : player.sortedDrawOrder
59
private alias object.value20 : player.topSpeed
60
private alias object.value35 : player.jumpAbilityState
61
62
// Tracks
63
private alias 0 : TRACK_STAGE
64
private alias 1 : TRACK_ACTFINISH
65
private alias 2 : TRACK_INVINCIBLE
66
private alias 3 : TRACK_CONTINUE
67
private alias 4 : TRACK_BOSS
68
private alias 5 : TRACK_GAMEOVER
69
private alias 6 : TRACK_DROWNING
70
private alias 7 : TRACK_SUPER
71
72
// Reserved object slots
73
private alias 10 : SLOT_ZONESETUP
74
private alias 25 : SLOT_MUSICEVENT_CHANGE
75
private alias 26 : SLOT_MUSICEVENT_BOSS
76
77
// Music Events
78
private alias 2 : MUSICEVENT_TRANSITION
79
80
private alias 0 : MUSICEVENT_FLAG_NOCHANGE
81
private alias 1 : MUSICEVENT_FLAG_SPEEDUP
82
private alias 2 : MUSICEVENT_FLAG_SLOWDOWN
83
84
// Music Loops
85
private alias 293572 : MUSIC_LOOP_OOZ
86
private alias 235236 : MUSIC_LOOP_OOZ_F
87
88
private alias 38679 : MUSIC_LOOP_INV
89
private alias 30897 : MUSIC_LOOP_INV_F
90
91
92
// ========================
93
// Function Declarations
94
// ========================
95
96
// These first four functions are run by the Player Object, the ones with "PlayerState" in them are assigned to the player's state
97
reserve function OOZSetup_OilWalkAnimSpeed
98
reserve function OOZSetup_PlayerState_OilPool
99
reserve function OOZSetup_HandleOilMovement
100
reserve function OOZSetup_PlayerState_OilSlide
101
102
reserve function OOZSetup_SpeedUpMusic
103
reserve function OOZSetup_SlowDownMusic
104
105
106
// ========================
107
// Tables
108
// ========================
109
110
private table OOZSetup_deformTable
111
1, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 0, 0
112
2, 0, 3, 2, 2, 3, 2, 2, 1, 3, 0, 0, 1, 0, 1, 3
113
1, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 2, 1, 2, 0, 0
114
2, 0, 3, 2, 2, 3, 2, 2, 1, 3, 0, 0, 1, 0, 1, 3
115
end table
116
117
private table OOZSetup_lightAniFrameTable
118
816, 12
119
817, 6
120
818, 10
121
819, 4
122
end table
123
124
private table OOZSetup_diamondAniFrameTable1
125
820, 7
126
821, 7
127
822, 7
128
823, 7
129
end table
130
131
private table OOZSetup_diamondAniFrameTable2
132
824, 7
133
826, 7
134
828, 7
135
830, 7
136
end table
137
138
// This is MCZ's palette cycle, why is this here? I do not know
139
private table OOZSetup_paletteCycle
140
0xC00000, 0xE06000, 0xE0C000, 0xE0E080
141
end table
142
143
144
// ========================
145
// Function Definitions
146
// ========================
147
148
// TODO: update these to match new player func names
149
150
private function OOZSetup_OilWalkAnimSpeed
151
player.animationSpeed = player.speed
152
if player.animationSpeed < 0
153
FlipSign(player.animationSpeed)
154
end if
155
player.animationSpeed *= 120
156
player.animationSpeed /= 0x60000
157
player.animationSpeed += 20
158
end function
159
160
161
private function OOZSetup_PlayerState_OilPool
162
if player.animation != ANI_SKIDDING
163
temp7 = true
164
else
165
temp7 = false
166
end if
167
168
CallFunction(Player_HandleGroundMovement)
169
if player.gravity == GRAVITY_AIR
170
#platform: USE_STANDALONE
171
player.state = Player_State_Air
172
#endplatform
173
#platform: USE_ORIGINS
174
player.state = Player_State_Air_NoDropDash
175
#endplatform
176
CallFunction(Player_HandleAirMovement)
177
else
178
CallFunction(Player_HandleOnGround)
179
if player.speed == 0
180
if player.collisionMode == CMODE_FLOOR
181
if player.timer < 240
182
player.animation = ANI_STOPPED
183
player.timer++
184
else
185
player.animation = ANI_WAITING
186
if stage.playerListPos == PLAYER_KNUCKLES_A
187
player.timer++
188
if player.timer == 834
189
player.timer = 0
190
player.animation = ANI_STOPPED
191
end if
192
end if
193
end if
194
end if
195
else
196
player.timer = 0
197
if player.speed > 0
198
if player.speed < 0x5F5C2
199
player.animation = ANI_WALKING
200
CallFunction(Player_HandleWalkAnimSpeed)
201
else
202
if player.speed > 0x9FFFF
203
player.animation = ANI_PEELOUT
204
else
205
player.animation = ANI_RUNNING
206
end if
207
CallFunction(Player_HandleRunAnimSpeed)
208
end if
209
else
210
if player.speed > -0x5F5C2
211
player.animation = ANI_WALKING
212
CallFunction(Player_HandleWalkAnimSpeed)
213
else
214
if player.speed < -0x9FFFF
215
player.animation = ANI_PEELOUT
216
else
217
player.animation = ANI_RUNNING
218
end if
219
CallFunction(Player_HandleRunAnimSpeed)
220
end if
221
end if
222
end if
223
224
if player.skidding > 0
225
if temp7 == true
226
PlaySfx(SfxName[Skidding], false)
227
end if
228
player.animation = ANI_SKIDDING
229
player.animationSpeed = 0
230
231
player.skidding--
232
if ringTimer == 0
233
CreateTempObject(TypeName[Dust Puff], 0, player.xpos, player.ypos)
234
player[tempObjectPos].iypos += player.collisionBottom
235
player[tempObjectPos].drawOrder = player.sortedDrawOrder
236
end if
237
238
if player.speed > 0
239
player.direction = FACING_RIGHT
240
else
241
player.direction = FACING_LEFT
242
end if
243
end if
244
245
if player.collisionMode == CMODE_FLOOR
246
if player.pushing == 2
247
player.animation = ANI_PUSHING
248
player.animationSpeed = 0
249
end if
250
end if
251
252
if player.jumpPress == true
253
CallFunction(Player_Action_Jump)
254
end if
255
end if
256
end function
257
258
259
private function OOZSetup_HandleOilMovement
260
if player.controlLock > 0
261
player.controlLock--
262
Sin256(temp0, player.angle)
263
temp0 *= 0x2000
264
temp0 >>= 8
265
player.speed += temp0
266
else
267
if player.left == true
268
temp0 = player.topSpeed
269
FlipSign(temp0)
270
if player.speed > temp0
271
player.speed -= 0x400
272
end if
273
274
if player.speed <= 0
275
player.direction = FACING_LEFT
276
end if
277
end if
278
279
if player.right == true
280
if player.speed < player.topSpeed
281
player.speed += 0x400
282
end if
283
284
if player.speed >= 0
285
player.direction = FACING_RIGHT
286
end if
287
end if
288
289
temp0 = player.left
290
temp0 |= player.right
291
if temp0 == false
292
if player.speed > 0
293
player.speed -= 4
294
if player.speed < 0
295
player.speed = 0
296
end if
297
else
298
player.speed += 4
299
if player.speed > 0
300
player.speed = 0
301
end if
302
end if
303
304
if player.speed > 0x2000
305
Sin256(temp0, player.angle)
306
temp0 *= 0x2000
307
temp0 >>= 8
308
player.speed += temp0
309
end if
310
311
if player.speed < -0x2000
312
Sin256(temp0, player.angle)
313
temp0 *= 0x2000
314
temp0 >>= 8
315
player.speed += temp0
316
end if
317
318
if player.angle > 192
319
if player.angle < 228
320
if player.speed > -0x10000
321
if player.speed < 0x10000
322
player.controlLock = 30
323
end if
324
end if
325
end if
326
end if
327
328
if player.angle > 28
329
if player.angle < 64
330
if player.speed > -0x10000
331
if player.speed < 0x10000
332
player.controlLock = 30
333
end if
334
end if
335
end if
336
end if
337
else
338
Sin256(temp0, player.angle)
339
temp0 *= 0x2000
340
temp0 >>= 8
341
player.speed += temp0
342
if player.right == true
343
if player.left == false
344
if player.angle > 192
345
if player.angle < 228
346
if player.speed < 0x28000
347
if player.speed > -0x20000
348
player.controlLock = 30
349
end if
350
end if
351
end if
352
end if
353
end if
354
else
355
if player.left == true
356
if player.angle > 28
357
if player.angle < 64
358
if player.speed > -0x28000
359
if player.speed < 0x20000
360
player.controlLock = 30
361
end if
362
end if
363
end if
364
end if
365
end if
366
end if
367
end if
368
end if
369
end function
370
371
372
private function OOZSetup_PlayerState_OilSlide
373
CallFunction(OOZSetup_HandleOilMovement)
374
375
if player.gravity == GRAVITY_AIR
376
#platform: USE_STANDALONE
377
player.state = Player_State_Air
378
#endplatform
379
#platform: USE_ORIGINS
380
player.state = Player_State_Air_NoDropDash
381
#endplatform
382
CallFunction(Player_HandleAirMovement)
383
else
384
CallFunction(Player_HandleOnGround)
385
if player.speed == 0
386
if player.collisionMode == CMODE_FLOOR
387
if player.timer < 240
388
player.animation = ANI_STOPPED
389
player.timer++
390
else
391
player.animation = ANI_WAITING
392
if stage.playerListPos == PLAYER_KNUCKLES_A
393
player.timer++
394
if player.timer == 834
395
player.timer = 0
396
player.animation = ANI_STOPPED
397
end if
398
end if
399
end if
400
end if
401
else
402
player.timer = 0
403
if player.animation != ANI_WATERSLIDE
404
if player.speed > 0
405
if player.speed < 0x30000
406
player.animation = ANI_WALKING
407
CallFunction(OOZSetup_OilWalkAnimSpeed)
408
else
409
player.animation = ANI_RUNNING
410
player.animationSpeed = 240
411
end if
412
else
413
if player.speed > -0x30000
414
player.animation = ANI_WALKING
415
CallFunction(OOZSetup_OilWalkAnimSpeed)
416
else
417
player.animation = ANI_RUNNING
418
player.animationSpeed = 240
419
end if
420
end if
421
end if
422
end if
423
424
player.skidding = 0
425
if player.collisionMode == CMODE_FLOOR
426
if player.pushing == 2
427
player.animation = ANI_PUSHING
428
player.animationSpeed = 0
429
end if
430
end if
431
432
if player.jumpPress == true
433
CallFunction(Player_Action_Jump)
434
end if
435
#platform: USE_ORIGINS
436
switch player.collisionMode
437
case CMODE_LWALL
438
if player.angle <= 192
439
if player.speed > -0x20000
440
if player.speed < 0x20000
441
player.gravity = GRAVITY_AIR
442
player.angle = 0
443
player.collisionMode = CMODE_FLOOR
444
player.speed = player.xvel
445
end if
446
end if
447
end if
448
break
449
case CMODE_ROOF
450
if player.speed > -0x20000
451
if player.speed < 0x20000
452
player.gravity = GRAVITY_AIR
453
player.angle = 0
454
player.collisionMode = CMODE_FLOOR
455
player.speed = player.xvel
456
end if
457
end if
458
break
459
case CMODE_RWALL
460
if player.angle >= 64
461
if player.speed > -0x20000
462
if player.speed < 0x20000
463
player.gravity = GRAVITY_AIR
464
player.angle = 0
465
player.collisionMode = CMODE_FLOOR
466
player.speed = player.xvel
467
end if
468
end if
469
end if
470
break
471
end switch
472
#endplatform
473
end if
474
end function
475
476
477
private function OOZSetup_SpeedUpMusic
478
CheckEqual(object[SLOT_MUSICEVENT_CHANGE].type, TypeName[Music Event])
479
temp0 = checkResult
480
CheckEqual(object[SLOT_MUSICEVENT_CHANGE].propertyValue, MUSICEVENT_TRANSITION)
481
temp0 &= checkResult
482
CheckEqual(stage.musicFlag, MUSICEVENT_FLAG_NOCHANGE)
483
temp0 &= checkResult
484
if temp0 == false
485
switch music.currentTrack
486
case TRACK_STAGE
487
SetMusicTrack("Invincibility_F.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV_F)
488
SwapMusicTrack("OilOcean_F.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ_F, 8000)
489
break
490
491
case TRACK_INVINCIBLE
492
SetMusicTrack("OilOcean_F.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ_F)
493
SwapMusicTrack("Invincibility_F.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV_F, 8000)
494
break
495
496
case TRACK_BOSS
497
case TRACK_DROWNING
498
case TRACK_SUPER
499
SetMusicTrack("OilOcean_F.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ_F)
500
SetMusicTrack("Invincibility_F.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV_F)
501
break
502
503
end switch
504
else
505
stage.musicFlag = MUSICEVENT_FLAG_SPEEDUP
506
end if
507
end function
508
509
510
private function OOZSetup_SlowDownMusic
511
CheckEqual(object[SLOT_MUSICEVENT_CHANGE].type, TypeName[Music Event])
512
temp0 = checkResult
513
CheckEqual(object[SLOT_MUSICEVENT_CHANGE].propertyValue, MUSICEVENT_TRANSITION)
514
temp0 &= checkResult
515
CheckEqual(stage.musicFlag, MUSICEVENT_FLAG_NOCHANGE)
516
temp0 &= checkResult
517
if temp0 == false
518
switch music.currentTrack
519
case TRACK_STAGE
520
SetMusicTrack("Invincibility.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV)
521
SwapMusicTrack("OilOcean.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ, 12500)
522
break
523
524
case TRACK_INVINCIBLE
525
SetMusicTrack("OilOcean.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ)
526
SwapMusicTrack("Invincibility.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV, 12500)
527
break
528
529
case TRACK_BOSS
530
case TRACK_DROWNING
531
case TRACK_SUPER
532
SetMusicTrack("OilOcean.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ)
533
SetMusicTrack("Invincibility.ogg", TRACK_INVINCIBLE, MUSIC_LOOP_INV)
534
break
535
536
end switch
537
else
538
stage.musicFlag = MUSICEVENT_FLAG_SLOWDOWN
539
end if
540
end function
541
542
543
// ========================
544
// Events
545
// ========================
546
547
event ObjectUpdate
548
// Slightly update the BG for the boss
549
// (Realigns the city, otherwise the BG would look like the boss takes place in the sky)
550
if options.vsMode == false
551
if stage.actNum == 2
552
if object.updatedBG == false
553
if camera[0].ypos < 256
554
if camera[0].xpos > 8512
555
temp0 = screen.yoffset
556
temp0 *= 44
557
temp0 <<= 8
558
temp1 = screen.yoffset
559
temp1 >>= 2
560
temp1 += 128
561
tileLayer[1].scrollPos = screen.yoffset
562
tileLayer[1].scrollPos *= temp1
563
tileLayer[1].scrollPos <<= 8
564
tileLayer[1].scrollPos -= temp0
565
FlipSign(tileLayer[1].scrollPos)
566
tileLayer[1].parallaxFactor = temp1
567
568
object.updatedBG = true
569
end if
570
end if
571
end if
572
end if
573
end if
574
575
object.deformTimer++
576
if object.deformTimer > 7
577
object.deformTimer = 0
578
tileLayer[1].deformationOffset++
579
RotatePalette(0, 170, 173, false)
580
end if
581
582
if object.lightAniTileDelay < 2
583
GetTableValue(temp0, object.lightAniTileFrame, OOZSetup_lightAniFrameTable)
584
585
Copy16x16Tile(756, temp0)
586
object.lightAniTileFrame++
587
588
GetTableValue(object.lightAniTileDelay, object.lightAniTileFrame, OOZSetup_lightAniFrameTable)
589
object.lightAniTileFrame++
590
object.lightAniTileFrame &= 7
591
else
592
object.lightAniTileDelay--
593
end if
594
595
if object.diamondAniTileDelay < 2
596
GetTableValue(temp0, object.diamondAniTileFrame, OOZSetup_diamondAniFrameTable1)
597
Copy16x16Tile(757, temp0)
598
599
GetTableValue(temp0, object.diamondAniTileFrame, OOZSetup_diamondAniFrameTable2)
600
Copy16x16Tile(758, temp0)
601
temp0++
602
603
Copy16x16Tile(759, temp0)
604
605
object.diamondAniTileFrame++
606
GetTableValue(object.diamondAniTileDelay, object.diamondAniTileFrame, OOZSetup_diamondAniFrameTable1)
607
object.diamondAniTileFrame++
608
object.diamondAniTileFrame &= 7
609
else
610
object.diamondAniTileDelay--
611
end if
612
613
// Oil!!!
614
if object.oilAniTileDelay < 2
615
temp0 = object.oilAniTileFrame
616
temp0 += 768
617
Copy16x16Tile(760, temp0)
618
temp0++
619
620
Copy16x16Tile(761, temp0)
621
temp0++
622
623
Copy16x16Tile(762, temp0)
624
temp0++
625
626
Copy16x16Tile(763, temp0)
627
temp0 += 21
628
629
Copy16x16Tile(764, temp0)
630
temp0++
631
632
Copy16x16Tile(765, temp0)
633
temp0++
634
635
Copy16x16Tile(766, temp0)
636
temp0++
637
638
Copy16x16Tile(767, temp0)
639
640
object.oilAniTileDelay = 18
641
object.oilAniTileFrame += 4
642
object.oilAniTileFrame %= 24
643
else
644
object.oilAniTileDelay--
645
end if
646
647
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
648
if player[currentPlayer].state == Player_State_Static
649
if player[currentPlayer].ypos < -0x800000
650
// If the Player's up in the sky while static they were likely sent there by a Ball Cannon, so return them to normal now
651
#platform: USE_STANDALONE
652
player[currentPlayer].state = Player_State_Air
653
#endplatform
654
#platform: USE_ORIGINS
655
player[currentPlayer].state = Player_State_Air_NoDropDash
656
#endplatform
657
player[currentPlayer].gravity = GRAVITY_AIR
658
player[currentPlayer].jumpAbilityState = 0
659
player[currentPlayer].tileCollisions = true
660
end if
661
end if
662
663
if player[currentPlayer].animation == ANI_TWIRL
664
// (This is just to make sure the last frame in the Twirl animation isn't seen, since it's the same as the first frame and the animation loops)
665
player[currentPlayer].frame %= 24
666
end if
667
668
temp1 = player[currentPlayer].xpos
669
temp1 >>= 16
670
temp2 = player[currentPlayer].ypos
671
temp2 >>= 16
672
temp2 += 6
673
674
Get16x16TileInfo(temp0, temp1, temp2, TILEINFO_ANGLEB)
675
switch temp0
676
default
677
case TILE_NORMAL
678
break
679
680
case TILE_OILPOOL
681
if player[currentPlayer].yvel > -1
682
player[currentPlayer].state = OOZSetup_PlayerState_OilPool
683
if player[currentPlayer].animation == ANI_JUMPING
684
player[currentPlayer].animation = ANI_WALKING
685
end if
686
player[currentPlayer].gravity = GRAVITY_GROUND
687
player[currentPlayer].yvel = 0
688
player[currentPlayer].ypos += 0x10000
689
end if
690
break
691
692
case TILE_OILSTRIP
693
if player[currentPlayer].gravity == GRAVITY_GROUND
694
player[currentPlayer].state = OOZSetup_PlayerState_OilSlide
695
end if
696
break
697
698
case TILE_OILSLIDE
699
if player[currentPlayer].gravity == GRAVITY_GROUND
700
player[currentPlayer].state = OOZSetup_PlayerState_OilSlide
701
player[currentPlayer].animation = ANI_WATERSLIDE
702
Get16x16TileInfo(temp0, temp1, temp2, TILEINFO_DIRECTION)
703
switch temp0
704
case FLIP_NONE
705
case FLIP_Y
706
if player[currentPlayer].speed > -0x80000
707
player[currentPlayer].speed -= 0x4000
708
end if
709
break
710
711
case FLIP_X
712
case FLIP_XY
713
if player[currentPlayer].speed < 0x80000
714
player[currentPlayer].speed += 0x4000
715
end if
716
break
717
718
end switch
719
720
if player[currentPlayer].speed < 0
721
player[currentPlayer].direction = FACING_LEFT
722
else
723
player[currentPlayer].direction = FACING_RIGHT
724
end if
725
726
if currentPlayer == 0
727
if object.oilSlideTimer == 0
728
PlaySfx(SfxName[Oil Slide], false)
729
end if
730
object.oilSlideTimer++
731
object.oilSlideTimer &= 15
732
end if
733
end if
734
break
735
736
end switch
737
next
738
end event
739
740
741
event ObjectStartup
742
SetMusicTrack("OilOcean.ogg", TRACK_STAGE, MUSIC_LOOP_OOZ)
743
744
SpeedUpMusic = OOZSetup_SpeedUpMusic
745
SlowDownMusic = OOZSetup_SlowDownMusic
746
747
animalType1 = TypeName[Rocky]
748
animalType2 = TypeName[Pecky]
749
750
// This is resetting the boss flash color, [OOZ Eggman] does this too though so it's somewhat redundant
751
SetPaletteEntry(0, 192, 0x000000)
752
753
object[SLOT_ZONESETUP].type = TypeName[OOZ Setup]
754
object[SLOT_ZONESETUP].priority = PRIORITY_ACTIVE
755
756
stage.newYBoundary2 = 1896
757
stage.deathBoundary = stage.newYBoundary2
758
stage.deathBoundary -= 8
759
stage.deathBoundary <<= 16
760
761
arrayPos0 = 0
762
while arrayPos0 < 576
763
temp0 = arrayPos0
764
temp0 &= 63
765
GetTableValue(stage.deformationData2[arrayPos0], temp0, OOZSetup_deformTable)
766
arrayPos0++
767
loop
768
769
// Slightly update the BG for the boss if the player is respawning at the closest starpost to the boss
770
// (Realigns the city, otherwise the BG would look like the boss takes place in the sky)
771
if stage.actNum == 2
772
tileLayer[1].scrollPos = 0
773
tileLayer[1].parallaxFactor = 44
774
if camera[0].ypos < 640
775
if camera[0].xpos > 8444
776
tileLayer[1].parallaxFactor = 128
777
object[SLOT_ZONESETUP].updatedBG = true
778
end if
779
end if
780
end if
781
end event
782
783
784
// ========================
785
// Editor Events
786
// ========================
787
788
event RSDKDraw
789
DrawSprite(0)
790
end event
791
792
793
event RSDKLoad
794
LoadSpriteSheet("Global/Display.gif")
795
SpriteFrame(-16, -16, 32, 32, 1, 143)
796
797
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
798
end event
799
800