Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-Sonic-2-2013-Script-Decompilation
Path: blob/master/Sonic 1/Scripts/SYZ/Eggman.txt
1483 views
1
// ----------------------------------
2
// RSDK Project: Sonic 1
3
// Script Description: Eggman Object
4
// Script Author: Christian Whitehead/Simon Thomley
5
// Unpacked by Rubberduckycooly's script unpacker
6
// ----------------------------------
7
8
// Using SYZEggman as a prefix here because there's like 12 "Eggman" objects in the game so its less confusing this way
9
10
// ========================
11
// Aliases
12
// ========================
13
14
private alias object.value0 : object.timer
15
private alias object.value1 : object.health
16
private alias object.value2 : object.invincibilityTimer
17
private alias object.value3 : object.flameAnim
18
private alias object.value4 : object.flameAnimTimer
19
private alias object.value5 : object.boundsL
20
private alias object.value6 : object.boundsR
21
private alias object.value7 : object.boundsB
22
private alias object.value8 : object.originPos.y
23
private alias object.value9 : object.stingerPos
24
private alias object.value10 : object.grabbedBlockSlot
25
private alias object.value11 : object.playerDetected
26
27
// Eggman States
28
private alias 0 : SYZEGGMAN_AWAITPLAYER
29
private alias 1 : SYZEGGMAN_MOVELEFT
30
private alias 2 : SYZEGGMAN_MOVERIGHT
31
private alias 3 : SYZEGGMAN_LOWERDOWN
32
private alias 4 : SYZEGGMAN_GRABBLOCK
33
private alias 5 : SYZEGGMAN_GRABBEDBLOCK
34
private alias 6 : SYZEGGMAN_SHAKEBLOCK
35
private alias 7 : SYZEGGMAN_RISEUP
36
private alias 8 : SYZEGGMAN_DESTROYBLOCK
37
private alias 9 : SYZEGGMAN_RETRACTSTINGER
38
private alias 10 : SYZEGGMAN_MISSEDBLOCK
39
private alias 11 : SYZEGGMAN_EXPLODE
40
private alias 12 : SYZEGGMAN_DEFEATED
41
private alias 13 : SYZEGGMAN_FLEE
42
private alias 14 : SYZEGGMAN_ESCAPE
43
44
// Eggman Animations
45
private alias 0 : SYZEGGANI_INVISIBLE
46
private alias 1 : SYZEGGANI_IDLE
47
private alias 2 : SYZEGGANI_LAUGH
48
private alias 3 : SYZEGGANI_LAUGH_LOOP
49
private alias 4 : SYZEGGANI_HIT
50
private alias 5 : SYZEGGANI_DEFEATED
51
private alias 6 : SYZEGGANI_TOASTED
52
private alias 7 : SYZEGGANI_PANIC
53
54
// Flame Animations
55
private alias 0 : FLAME_INACTIVE
56
private alias 1 : FLAME_ACTIVE
57
private alias 2 : FLAME_EXPLODE
58
59
// Marker Aliases
60
private alias object.xpos : bossMarker.xpos
61
private alias object.ypos : bossMarker.ypos
62
private alias object.ixpos : bossMarker.ixpos
63
private alias object.iypos : bossMarker.iypos
64
65
// Boss Barrier Aliases
66
private alias object.state : bossBarrier.state
67
68
private alias 1 : BOSSBARRIER_RISE
69
private alias 2 : BOSSBARRIER_LOWER
70
71
// Boss Block Aliases
72
private alias 1 : BOSSBLOCK_NONSOLID
73
74
// Player Aliases
75
private alias object.xpos : player.xpos
76
private alias object.xvel : player.xvel
77
private alias object.speed : player.speed
78
private alias object.animation : player.animation
79
private alias object.collisionRight : player.collisionRight
80
81
private alias object.value40 : player.hitboxLeft
82
private alias object.value38 : player.hitboxTop
83
private alias object.value41 : player.hitboxRight
84
private alias object.value39 : player.hitboxBottom
85
86
// Music Events
87
private alias 26 : SLOT_MUSICEVENT_BOSS
88
89
private alias 0 : MUSICEVENT_FADETOBOSS
90
private alias 1 : MUSICEVENT_FADETOSTAGE
91
private alias 2 : MUSICEVENT_TRANSITION
92
93
94
// ========================
95
// Function Declarations
96
// ========================
97
98
reserve function SYZEggman_Float
99
reserve function SYZEggman_CheckAbovePlayer
100
reserve function SYZEggman_HandleBlockMovement
101
102
103
// ========================
104
// Function Definitions
105
// ========================
106
107
private function SYZEggman_Float
108
Sin256(object.ypos, object.angle)
109
object.ypos <<= 10
110
object.ypos += object.originPos.y
111
object.angle += 2
112
object.angle &= 0xFF
113
end function
114
115
116
private function SYZEggman_CheckAbovePlayer
117
if object.playerDetected == false
118
temp0 = player[0].xpos
119
temp0 >>= 21
120
temp1 = object.xpos
121
temp1 >>= 21
122
if temp0 == temp1
123
temp0 = object.xpos
124
temp0 >>= 16
125
temp0 &= 31
126
if temp0 == 16
127
object.xpos &= 0xFFFF0000
128
object.yvel = 0x18000
129
object.flameAnim = FLAME_INACTIVE
130
object.state = SYZEGGMAN_LOWERDOWN
131
object.playerDetected = true
132
end if
133
end if
134
end if
135
end function
136
137
138
private function SYZEggman_HandleBlockMovement
139
arrayPos0 = object.grabbedBlockSlot
140
object[arrayPos0].ypos = object.ypos
141
object[arrayPos0].ypos += 0x280000
142
end function
143
144
145
// ========================
146
// Events
147
// ========================
148
149
event ObjectUpdate
150
if camera[0].ypos < stage.newYBoundary1
151
camera[0].ypos += 2
152
end if
153
154
switch object.state
155
case SYZEGGMAN_AWAITPLAYER
156
temp0 = bossMarker[+1].ixpos
157
temp0 += screen.xcenter
158
stage.newXBoundary2 = temp0
159
160
temp0 -= screen.xsize
161
stage.newXBoundary1 = temp0
162
163
temp0 = bossMarker[+1].iypos
164
temp0 -= screen.ysize
165
stage.newYBoundary1 = temp0
166
stage.newYBoundary2 = bossMarker[+1].iypos
167
168
if player[0].xpos > bossMarker[+1].xpos
169
object.boundsB = bossMarker[+1].ypos
170
object.boundsB -= 0xC80000
171
object.originPos.y = bossMarker[+1].ypos
172
object.originPos.y -= 0xC80000
173
object.boundsL = bossMarker[+1].xpos
174
object.boundsL -= 0x960000
175
object.boundsR = bossMarker[+1].xpos
176
object.boundsR += 0x960000
177
if screen.xsize > 320
178
bossBarrier[+2].state = BOSSBARRIER_RISE
179
bossBarrier[+3].state = BOSSBARRIER_RISE
180
end if
181
182
object.xvel = -0x10000
183
object.flameAnim = FLAME_ACTIVE
184
ResetObjectEntity(SLOT_MUSICEVENT_BOSS, TypeName[Music Event], MUSICEVENT_FADETOBOSS, 0, 0)
185
object[SLOT_MUSICEVENT_BOSS].priority = PRIORITY_ACTIVE
186
object.grabbedBlockSlot = -1
187
object.state++
188
end if
189
break
190
191
case SYZEGGMAN_MOVELEFT
192
object.xpos += object.xvel
193
if object.xpos <= object.boundsL
194
FlipSign(object.xvel)
195
object.direction = FACING_LEFT
196
object.playerDetected = false
197
object.state = SYZEGGMAN_MOVERIGHT
198
end if
199
CallFunction(SYZEggman_Float)
200
CallFunction(SYZEggman_CheckAbovePlayer)
201
break
202
203
case SYZEGGMAN_MOVERIGHT
204
object.xpos += object.xvel
205
if object.xpos >= object.boundsR
206
FlipSign(object.xvel)
207
object.direction = FACING_RIGHT
208
object.playerDetected = false
209
object.state = SYZEGGMAN_MOVELEFT
210
end if
211
CallFunction(SYZEggman_Float)
212
CallFunction(SYZEggman_CheckAbovePlayer)
213
break
214
215
case SYZEGGMAN_LOWERDOWN
216
object.ypos += object.yvel
217
temp0 = bossMarker[+1].ypos
218
temp0 -= 0x4C0000
219
220
if object.ypos >= temp0
221
object.ypos = temp0
222
object.yvel = 0
223
object.state++
224
end if
225
226
if object.stingerPos < 0x200000
227
object.stingerPos += 0x20000
228
end if
229
break
230
231
case SYZEGGMAN_GRABBLOCK
232
object.grabbedBlockSlot = -1
233
foreach (TypeName[Boss Block], arrayPos0, ACTIVE_ENTITIES)
234
BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 32, arrayPos0, -16, -16, 16, 16)
235
if checkResult == true
236
object[arrayPos0].state = BOSSBLOCK_NONSOLID
237
object.grabbedBlockSlot = arrayPos0
238
end if
239
next
240
241
if object.grabbedBlockSlot > -1
242
object.state = SYZEGGMAN_GRABBEDBLOCK
243
if object.animation == SYZEGGANI_IDLE
244
object.animation = SYZEGGANI_PANIC
245
object.animationTimer = 0
246
end if
247
else
248
object.yvel = -0x40000
249
object.state = SYZEGGMAN_MISSEDBLOCK
250
end if
251
break
252
253
case SYZEGGMAN_GRABBEDBLOCK
254
object.timer++
255
if object.timer == 20
256
object.timer = 0
257
object.originPos.y = object.ypos
258
object.state++
259
end if
260
break
261
262
case SYZEGGMAN_SHAKEBLOCK
263
temp0 = object.timer
264
temp0 >>= 1
265
temp0 &= 1
266
if temp0 == 0
267
object.ypos = -0x20000
268
else
269
object.ypos = 0x20000
270
end if
271
272
object.ypos += object.originPos.y
273
object.timer++
274
if object.timer == 32
275
object.timer = 0
276
object.yvel = -0x80000
277
if object.animation != SYZEGGANI_PANIC
278
object.animation = SYZEGGANI_PANIC
279
object.animationTimer = 0
280
end if
281
object.state++
282
end if
283
284
CallFunction(SYZEggman_HandleBlockMovement)
285
break
286
287
case SYZEGGMAN_RISEUP
288
object.ypos += object.yvel
289
temp0 = bossMarker[+1].ypos
290
temp0 -= 0xF00000
291
if object.ypos <= temp0
292
object.ypos = temp0
293
object.originPos.y = object.ypos
294
object.yvel = 0x18000
295
object.state++
296
end if
297
CallFunction(SYZEggman_HandleBlockMovement)
298
break
299
300
case SYZEGGMAN_DESTROYBLOCK
301
object.timer++
302
if object.timer == 48
303
object.ypos = object.originPos.y
304
CallFunction(SYZEggman_HandleBlockMovement)
305
object.timer = 0
306
object.animation = SYZEGGANI_IDLE
307
object.animationTimer = 0
308
object[arrayPos0].type = TypeName[Blank Object]
309
310
CreateTempObject(TypeName[Boss Block], 1, object[arrayPos0].xpos, object[arrayPos0].ypos)
311
object[tempObjectPos].ixpos -= 8
312
object[tempObjectPos].iypos -= 8
313
object[tempObjectPos].xvel = -0x18000
314
object[tempObjectPos].yvel = -0x20000
315
316
CreateTempObject(TypeName[Boss Block], 2, object[arrayPos0].xpos, object[arrayPos0].ypos)
317
object[tempObjectPos].ixpos += 8
318
object[tempObjectPos].iypos -= 8
319
object[tempObjectPos].xvel = 0x18000
320
object[tempObjectPos].yvel = -0x20000
321
322
CreateTempObject(TypeName[Boss Block], 3, object[arrayPos0].xpos, object[arrayPos0].ypos)
323
object[tempObjectPos].ixpos -= 8
324
object[tempObjectPos].iypos += 8
325
object[tempObjectPos].xvel = -0x10000
326
object[tempObjectPos].yvel = -0x10000
327
328
CreateTempObject(TypeName[Boss Block], 4, object[arrayPos0].xpos, object[arrayPos0].ypos)
329
object[tempObjectPos].ixpos += 8
330
object[tempObjectPos].iypos += 8
331
object[tempObjectPos].xvel = 0x10000
332
object[tempObjectPos].yvel = -0x10000
333
334
PlaySfx(SfxName[Block Break], false)
335
object.grabbedBlockSlot = -1
336
object.state++
337
else
338
object.originPos.y += object.yvel
339
if object.originPos.y >= object.boundsB
340
object.originPos.y = object.boundsB
341
object.yvel = 0
342
end if
343
temp0 = object.timer
344
temp0 >>= 1
345
temp0 &= 1
346
if temp0 == 0
347
object.ypos = -0x10000
348
else
349
object.ypos = 0x10000
350
end if
351
object.ypos += object.originPos.y
352
CallFunction(SYZEggman_HandleBlockMovement)
353
end if
354
break
355
356
case SYZEGGMAN_RETRACTSTINGER
357
if object.stingerPos > 0
358
object.stingerPos -= 0x20000
359
else
360
object.angle = 0
361
object.flameAnim = FLAME_ACTIVE
362
if object.xvel > 0
363
object.state = SYZEGGMAN_MOVERIGHT
364
else
365
object.state = SYZEGGMAN_MOVELEFT
366
end if
367
end if
368
break
369
370
case SYZEGGMAN_MISSEDBLOCK
371
object.ypos += object.yvel
372
object.yvel += 0x800
373
if object.ypos <= object.boundsB
374
object.ypos = object.boundsB
375
object.originPos.y = object.ypos
376
object.state = SYZEGGMAN_RETRACTSTINGER
377
end if
378
break
379
380
case SYZEGGMAN_EXPLODE
381
if object.stingerPos > 0
382
object.stingerPos -= 0x20000
383
end if
384
385
object.timer++
386
temp0 = object.timer
387
temp0 &= 7
388
if temp0 == 4
389
Rand(temp0, 64)
390
temp0 -= 32
391
temp0 <<= 16
392
temp0 += object.xpos
393
Rand(temp1, 48)
394
temp1 -= 24
395
temp1 <<= 16
396
temp1 += object.ypos
397
CreateTempObject(TypeName[Explosion], 0, temp0, temp1)
398
PlaySfx(SfxName[Explosion], false)
399
end if
400
401
if object.timer == 180
402
object.animation = SYZEGGANI_TOASTED
403
object.animationTimer = 0
404
object.timer = 0
405
object.direction = FACING_LEFT
406
ResetObjectEntity(SLOT_MUSICEVENT_BOSS, TypeName[Music Event], MUSICEVENT_FADETOSTAGE, 0, 0)
407
object[SLOT_MUSICEVENT_BOSS].priority = PRIORITY_ACTIVE
408
object.state++
409
end if
410
break
411
412
case SYZEGGMAN_DEFEATED
413
if object.timer < 40
414
object.ypos += object.yvel
415
object.yvel -= 0x800
416
object.timer++
417
else
418
object.timer = 0
419
object.yvel = 0
420
object.angle = 0
421
object.originPos.y = object.ypos
422
object.state++
423
end if
424
break
425
426
case SYZEGGMAN_FLEE
427
CallFunction(SYZEggman_Float)
428
if object.timer < 8
429
object.timer++
430
else
431
object.timer = 0
432
object.animation = SYZEGGANI_PANIC
433
object.animationTimer = 0
434
object.flameAnim = FLAME_EXPLODE
435
object.flameAnimTimer = 0
436
object.priority = PRIORITY_ACTIVE
437
temp0 = tileLayer[0].xsize
438
temp0 <<= 7
439
stage.newXBoundary2 = temp0
440
object.state++
441
end if
442
break
443
444
case SYZEGGMAN_ESCAPE
445
CallFunction(SYZEggman_Float)
446
object.xpos += 0x40000
447
object.originPos.y -= 0x4000
448
if object.outOfBounds == true
449
object.type = TypeName[Blank Object]
450
object.priority = PRIORITY_BOUNDS
451
end if
452
break
453
454
end switch
455
456
if object.health != 0
457
if object.invincibilityTimer > 0
458
object.invincibilityTimer--
459
end if
460
461
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
462
if object.invincibilityTimer == 0
463
CheckEqual(player[currentPlayer].animation, ANI_HURT)
464
temp0 = checkResult
465
CheckEqual(player[currentPlayer].animation, ANI_DYING)
466
temp0 |= checkResult
467
CheckEqual(player[currentPlayer].animation, ANI_DROWNING)
468
temp0 |= checkResult
469
if temp0 != 0
470
if object.animation != SYZEGGANI_LAUGH
471
object.animation = SYZEGGANI_LAUGH
472
object.animationTimer = 0
473
end if
474
end if
475
476
if object.stingerPos > 0x100000
477
BoxCollisionTest(C_TOUCH, object.entityPos, -6, 0, 6, 40, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
478
if checkResult == true
479
CallFunction(Player_Hit)
480
end if
481
end if
482
483
#platform: USE_STANDALONE
484
BoxCollisionTest(C_TOUCH, object.entityPos, -20, -16, 20, 16, currentPlayer, C_BOX, C_BOX, C_BOX, C_BOX)
485
#endplatform
486
#platform: USE_ORIGINS
487
BoxCollisionTest(C_TOUCH, object.entityPos, -20, -16, 20, 16, currentPlayer, player[currentPlayer].hitboxLeft, player[currentPlayer].hitboxTop, player[currentPlayer].hitboxRight, player[currentPlayer].hitboxBottom)
488
#endplatform
489
if checkResult == true
490
CallFunction(Player_CheckHit)
491
if checkResult == true
492
object.health--
493
if object.health == 0
494
#platform: USE_ORIGINS
495
CallNativeFunction2(NotifyCallback, NOTIFY_KILL_BOSS, 0)
496
CallNativeFunction2(NotifyCallback, NOTIFY_BOSS_END, true)
497
#endplatform
498
player.score += 1000
499
object.animation = SYZEGGANI_DEFEATED
500
object.animationTimer = 0
501
object.flameAnim = FLAME_INACTIVE
502
object.timer = 0
503
object.yvel = 0
504
object.state = SYZEGGMAN_EXPLODE
505
if screen.xsize > 320
506
bossBarrier[+2].state = BOSSBARRIER_LOWER
507
bossBarrier[+3].state = BOSSBARRIER_LOWER
508
end if
509
510
if object.grabbedBlockSlot > -1
511
arrayPos0 = object.grabbedBlockSlot
512
object[arrayPos0].type = TypeName[Blank Object]
513
514
CreateTempObject(TypeName[Boss Block], 1, object[arrayPos0].xpos, object[arrayPos0].ypos)
515
object[tempObjectPos].ixpos -= 8
516
object[tempObjectPos].iypos -= 8
517
object[tempObjectPos].xvel = -0x18000
518
object[tempObjectPos].yvel = -0x20000
519
520
CreateTempObject(TypeName[Boss Block], 2, object[arrayPos0].xpos, object[arrayPos0].ypos)
521
object[tempObjectPos].ixpos += 8
522
object[tempObjectPos].iypos -= 8
523
object[tempObjectPos].xvel = 0x18000
524
object[tempObjectPos].yvel = -0x20000
525
526
CreateTempObject(TypeName[Boss Block], 3, object[arrayPos0].xpos, object[arrayPos0].ypos)
527
object[tempObjectPos].ixpos -= 8
528
object[tempObjectPos].iypos += 8
529
object[tempObjectPos].xvel = -0x10000
530
object[tempObjectPos].yvel = -0x10000
531
532
CreateTempObject(TypeName[Boss Block], 4, object[arrayPos0].xpos, object[arrayPos0].ypos)
533
object[tempObjectPos].ixpos += 8
534
object[tempObjectPos].iypos += 8
535
object[tempObjectPos].xvel = 0x10000
536
object[tempObjectPos].yvel = -0x10000
537
end if
538
else
539
object.animation = SYZEGGANI_HIT
540
object.animationTimer = 0
541
object.invincibilityTimer = 32
542
PlaySfx(SfxName[Boss Hit], false)
543
end if
544
end if
545
end if
546
end if
547
next
548
end if
549
550
// Screen R Boundary Lock
551
if object.state < SYZEGGMAN_FLEE
552
foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
553
temp0 = player[currentPlayer].collisionRight
554
temp0 <<= 16
555
temp0 += player[currentPlayer].xpos
556
temp1 = stage.curXBoundary2
557
temp1 <<= 16
558
if temp0 > temp1
559
player[currentPlayer].xvel = 0
560
player[currentPlayer].speed = 0
561
player[currentPlayer].xpos = temp1
562
temp0 = player[currentPlayer].collisionRight
563
temp0 <<= 16
564
player[currentPlayer].xpos -= temp0
565
end if
566
next
567
end if
568
end event
569
570
571
event ObjectDraw
572
temp0 = object.ypos
573
temp0 += object.stingerPos
574
DrawSpriteFX(19, FX_FLIP, object.xpos, temp0)
575
576
switch object.animation
577
default
578
case SYZEGGANI_INVISIBLE
579
break
580
581
case SYZEGGANI_IDLE
582
temp0 = object.animationTimer
583
temp0 /= 6
584
object.animationTimer++
585
object.animationTimer %= 12
586
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
587
break
588
589
case SYZEGGANI_LAUGH
590
temp0 = object.animationTimer
591
temp0 %= 10
592
temp0 /= 5
593
temp0 += 9
594
object.animationTimer++
595
if object.animationTimer == 50
596
object.animationTimer = 0
597
if player[0].animation != ANI_DYING
598
object.animation = SYZEGGANI_IDLE
599
end if
600
end if
601
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
602
break
603
604
case SYZEGGANI_LAUGH_LOOP
605
temp0 = object.animationTimer
606
temp0 /= 5
607
temp0 += 9
608
object.animationTimer++
609
object.animationTimer %= 10
610
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
611
break
612
613
case SYZEGGANI_HIT
614
temp0 = object.animationTimer
615
temp0 &= 1
616
temp0 += 2
617
object.animationTimer++
618
if object.animationTimer == 30
619
object.animationTimer = 0
620
object.animation = SYZEGGANI_IDLE
621
end if
622
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
623
break
624
625
case SYZEGGANI_DEFEATED
626
temp0 = object.animationTimer
627
temp0 >>= 5
628
temp0 += 4
629
object.animationTimer++
630
object.animationTimer &= 63
631
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
632
break
633
634
case SYZEGGANI_TOASTED
635
DrawSpriteFX(6, FX_FLIP, object.xpos, object.ypos)
636
break
637
638
case SYZEGGANI_PANIC
639
temp0 = object.animationTimer
640
temp0 >>= 2
641
temp0 += 7
642
object.animationTimer++
643
object.animationTimer %= 7
644
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
645
break
646
647
end switch
648
649
switch object.flameAnim
650
default
651
case FLAME_INACTIVE
652
break
653
654
case FLAME_ACTIVE
655
temp0 = object.flameAnimTimer
656
temp0 >>= 2
657
temp0 += 11
658
object.flameAnimTimer++
659
object.flameAnimTimer &= 7
660
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
661
break
662
663
case FLAME_EXPLODE
664
temp0 = object.flameAnimTimer
665
temp0 /= 3
666
temp0 += 11
667
object.flameAnimTimer++
668
if object.flameAnimTimer > 21
669
object.flameAnimTimer = 18
670
end if
671
DrawSpriteFX(temp0, FX_FLIP, object.xpos, object.ypos)
672
break
673
674
end switch
675
end event
676
677
678
event ObjectStartup
679
LoadSpriteSheet("Global/Eggman.gif")
680
SpriteFrame(-28, -32, 64, 56, 1, 1)
681
SpriteFrame(-28, -32, 64, 56, 66, 1)
682
SpriteFrame(-28, -32, 64, 56, 131, 1)
683
SpriteFrame(-28, -32, 64, 56, 1, 58)
684
SpriteFrame(-28, -32, 64, 56, 1, 1)
685
SpriteFrame(-28, -32, 64, 56, 1, 58)
686
SpriteFrame(-28, -32, 64, 56, 66, 58)
687
SpriteFrame(-28, -32, 64, 56, 131, 58)
688
SpriteFrame(-28, -32, 64, 56, 66, 1)
689
SpriteFrame(-28, -32, 64, 56, 1, 115)
690
SpriteFrame(-28, -32, 64, 56, 66, 115)
691
SpriteFrame(34, 1, 10, 9, 196, 2)
692
SpriteFrame(33, 0, 15, 11, 196, 12)
693
SpriteFrame(34, -1, 22, 14, 213, 1)
694
SpriteFrame(34, -8, 32, 26, 213, 16)
695
SpriteFrame(34, -1, 22, 14, 213, 1)
696
SpriteFrame(34, -8, 32, 26, 213, 16)
697
SpriteFrame(34, 1, 10, 9, 196, 2)
698
SpriteFrame(33, 0, 15, 11, 196, 12)
699
SpriteFrame(-8, -16, 16, 32, 238, 60)
700
701
foreach (TypeName[Eggman], arrayPos0, ALL_ENTITIES)
702
object[arrayPos0].animation = SYZEGGANI_IDLE
703
#platform: USE_ORIGINS
704
if game.bossOneLife == false
705
object[arrayPos0].health = 8
706
else
707
object[arrayPos0].health = 1
708
end if
709
#endplatform
710
#platform: USE_STANDALONE
711
object[arrayPos0].health = 8
712
#endplatform
713
next
714
end event
715
716
717
// ========================
718
// Editor Events
719
// ========================
720
721
event RSDKDraw
722
temp0 = object.ypos
723
temp0 += 0x200000
724
DrawSpriteFX(19, FX_FLIP, object.xpos, temp0)
725
726
DrawSpriteFX(0, FX_FLIP, object.xpos, object.ypos)
727
728
if editor.showGizmos == true
729
editor.drawingOverlay = true
730
731
DrawArrow(object.xpos, object.ypos, object[+1].xpos, object[+1].ypos, 255, 255, 0) // arena marker
732
DrawArrow(object.xpos, object.ypos, object[+2].xpos, object[+2].ypos, 255, 255, 0) // boundsL
733
DrawArrow(object.xpos, object.ypos, object[+3].xpos, object[+3].ypos, 255, 255, 0) // boundsR
734
735
editor.drawingOverlay = false
736
end if
737
end event
738
739
740
event RSDKLoad
741
LoadSpriteSheet("Global/Eggman.gif")
742
SpriteFrame(-28, -32, 64, 56, 1, 1)
743
SpriteFrame(-28, -32, 64, 56, 66, 1)
744
SpriteFrame(-28, -32, 64, 56, 131, 1)
745
SpriteFrame(-28, -32, 64, 56, 1, 58)
746
SpriteFrame(-28, -32, 64, 56, 1, 1)
747
SpriteFrame(-28, -32, 64, 56, 1, 58)
748
SpriteFrame(-28, -32, 64, 56, 66, 58)
749
SpriteFrame(-28, -32, 64, 56, 131, 58)
750
SpriteFrame(-28, -32, 64, 56, 66, 1)
751
SpriteFrame(-28, -32, 64, 56, 1, 115)
752
SpriteFrame(-28, -32, 64, 56, 66, 115)
753
SpriteFrame(34, 1, 10, 9, 196, 2)
754
SpriteFrame(33, 0, 15, 11, 196, 12)
755
SpriteFrame(34, -1, 22, 14, 213, 1)
756
SpriteFrame(34, -8, 32, 26, 213, 16)
757
SpriteFrame(34, -1, 22, 14, 213, 1)
758
SpriteFrame(34, -8, 32, 26, 213, 16)
759
SpriteFrame(34, 1, 10, 9, 196, 2)
760
SpriteFrame(33, 0, 15, 11, 196, 12)
761
SpriteFrame(-8, -16, 16, 32, 238, 60)
762
763
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
764
end event
765
766