File size: 25,156 Bytes
fd84f14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild

from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
from enum import Enum


if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
    raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__))

class Level(KaitaiStruct):

    class AutoscrollSpeed(Enum):
        x1 = 0
        x2 = 1
        x3 = 2

    class ClearCondition(Enum):
        none = 0
        reach_the_goal_without_landing_after_leaving_the_ground = 137525990
        reach_the_goal_after_defeating_at_least_all_mechakoopa = 199585683
        reach_the_goal_after_defeating_at_least_all_cheep_cheep = 272349836
        reach_the_goal_without_taking_damage = 375673178
        reach_the_goal_as_boomerang_mario = 426197923
        reach_the_goal_while_wearing_a_shoe = 436833616
        reach_the_goal_as_fire_mario = 713979835
        reach_the_goal_as_frog_mario = 744927294
        reach_the_goal_after_defeating_at_least_all_larry = 751004331
        reach_the_goal_as_raccoon_mario = 900050759
        reach_the_goal_after_defeating_at_least_all_blooper = 947659466
        reach_the_goal_as_propeller_mario = 976173462
        reach_the_goal_while_wearing_a_propeller_box = 994686866
        reach_the_goal_after_defeating_at_least_all_spike = 998904081
        reach_the_goal_after_defeating_at_least_all_boom_boom = 1008094897
        reach_the_goal_while_holding_a_koopa_shell = 1051433633
        reach_the_goal_after_defeating_at_least_all_porcupuffer = 1061233896
        reach_the_goal_after_defeating_at_least_all_charvaargh = 1062253843
        reach_the_goal_after_defeating_at_least_all_bullet_bill = 1079889509
        reach_the_goal_after_defeating_at_least_all_bully_bullies = 1080535886
        reach_the_goal_while_wearing_a_goomba_mask = 1151250770
        reach_the_goal_after_defeating_at_least_all_hop_chops = 1182464856
        reach_the_goal_while_holding_a_red_pow_block_or_reach_the_goal_after_activating_at_least_all_red_pow_block = 1219761531
        reach_the_goal_after_defeating_at_least_all_bob_omb = 1221661152
        reach_the_goal_after_defeating_at_least_all_spiny_spinies = 1259427138
        reach_the_goal_after_defeating_at_least_all_bowser_meowser = 1268255615
        reach_the_goal_after_defeating_at_least_all_ant_trooper = 1279580818
        reach_the_goal_on_a_lakitus_cloud = 1283945123
        reach_the_goal_after_defeating_at_least_all_boo = 1344044032
        reach_the_goal_after_defeating_at_least_all_roy = 1425973877
        reach_the_goal_while_holding_a_trampoline = 1429902736
        reach_the_goal_after_defeating_at_least_all_morton = 1431944825
        reach_the_goal_after_defeating_at_least_all_fish_bone = 1446467058
        reach_the_goal_after_defeating_at_least_all_monty_mole = 1510495760
        reach_the_goal_after_picking_up_at_least_all_1_up_mushroom = 1656179347
        reach_the_goal_after_defeating_at_least_all_hammer_bro = 1665820273
        reach_the_goal_after_hitting_at_least_all_p_switch_or_reach_the_goal_while_holding_a_p_switch = 1676924210
        reach_the_goal_after_activating_at_least_all_pow_block_or_reach_the_goal_while_holding_a_pow_block = 1715960804
        reach_the_goal_after_defeating_at_least_all_angry_sun = 1724036958
        reach_the_goal_after_defeating_at_least_all_pokey = 1730095541
        reach_the_goal_as_superball_mario = 1780278293
        reach_the_goal_after_defeating_at_least_all_pom_pom = 1839897151
        reach_the_goal_after_defeating_at_least_all_peepa = 1969299694
        reach_the_goal_after_defeating_at_least_all_lakitu = 2035052211
        reach_the_goal_after_defeating_at_least_all_lemmy = 2038503215
        reach_the_goal_after_defeating_at_least_all_lava_bubble = 2048033177
        reach_the_goal_while_wearing_a_bullet_bill_mask = 2076496776
        reach_the_goal_as_big_mario = 2089161429
        reach_the_goal_as_cat_mario = 2111528319
        reach_the_goal_after_defeating_at_least_all_goomba_galoomba = 2131209407
        reach_the_goal_after_defeating_at_least_all_thwomp = 2139645066
        reach_the_goal_after_defeating_at_least_all_iggy = 2259346429
        reach_the_goal_while_wearing_a_dry_bones_shell = 2549654281
        reach_the_goal_after_defeating_at_least_all_sledge_bro = 2694559007
        reach_the_goal_after_defeating_at_least_all_rocky_wrench = 2746139466
        reach_the_goal_after_grabbing_at_least_all_50_coin = 2749601092
        reach_the_goal_as_flying_squirrel_mario = 2855236681
        reach_the_goal_as_buzzy_mario = 3036298571
        reach_the_goal_as_builder_mario = 3074433106
        reach_the_goal_as_cape_mario = 3146932243
        reach_the_goal_after_defeating_at_least_all_wendy = 3174413484
        reach_the_goal_while_wearing_a_cannon_box = 3206222275
        reach_the_goal_as_link = 3314955857
        reach_the_goal_while_you_have_super_star_invincibility = 3342591980
        reach_the_goal_after_defeating_at_least_all_goombrat_goombud = 3346433512
        reach_the_goal_after_grabbing_at_least_all_10_coin = 3348058176
        reach_the_goal_after_defeating_at_least_all_buzzy_beetle = 3353006607
        reach_the_goal_after_defeating_at_least_all_bowser_jr = 3392229961
        reach_the_goal_after_defeating_at_least_all_koopa_troopa = 3437308486
        reach_the_goal_after_defeating_at_least_all_chain_chomp = 3459144213
        reach_the_goal_after_defeating_at_least_all_muncher = 3466227835
        reach_the_goal_after_defeating_at_least_all_wiggler = 3481362698
        reach_the_goal_as_smb2_mario = 3513732174
        reach_the_goal_in_a_koopa_clown_car_junior_clown_car = 3649647177
        reach_the_goal_as_spiny_mario = 3725246406
        reach_the_goal_in_a_koopa_troopa_car = 3730243509
        reach_the_goal_after_defeating_at_least_all_piranha_plant_jumping_piranha_plant = 3748075486
        reach_the_goal_after_defeating_at_least_all_dry_bones = 3797704544
        reach_the_goal_after_defeating_at_least_all_stingby_stingbies = 3824561269
        reach_the_goal_after_defeating_at_least_all_piranha_creeper = 3833342952
        reach_the_goal_after_defeating_at_least_all_fire_piranha_plant = 3842179831
        reach_the_goal_after_breaking_at_least_all_crates = 3874680510
        reach_the_goal_after_defeating_at_least_all_ludwig = 3974581191
        reach_the_goal_as_super_mario = 3977257962
        reach_the_goal_after_defeating_at_least_all_skipsqueak = 4042480826
        reach_the_goal_after_grabbing_at_least_all_coin = 4116396131
        reach_the_goal_after_defeating_at_least_all_magikoopa = 4117878280
        reach_the_goal_after_grabbing_at_least_all_30_coin = 4122555074
        reach_the_goal_as_balloon_mario = 4153835197
        reach_the_goal_while_wearing_a_red_pow_box = 4172105156
        reach_the_goal_while_riding_yoshi = 4209535561
        reach_the_goal_after_defeating_at_least_all_spike_top = 4269094462
        reach_the_goal_after_defeating_at_least_all_banzai_bill = 4293354249

    class Gamestyle(Enum):
        smb1 = 12621
        smb3 = 13133
        nsmbw = 21847
        sm3dw = 22323
        smw = 22349

    class GameVersion(Enum):
        v1_0_0 = 0
        v1_0_1 = 1
        v1_1_0 = 2
        v2_0_0 = 3
        v3_0_0 = 4
        v3_0_1 = 5
        unk = 33

    class ClearConditionCategory(Enum):
        none = 0
        parts = 1
        status = 2
        actions = 3
    def __init__(self, _io, _parent=None, _root=None):
        self._io = _io
        self._parent = _parent
        self._root = _root if _root else self
        self._read()

    def _read(self):
        self.start_y = self._io.read_u1()
        self.goal_y = self._io.read_u1()
        self.goal_x = self._io.read_s2le()
        self.timer = self._io.read_s2le()
        self.clear_condition_magnitude = self._io.read_s2le()
        self.year = self._io.read_s2le()
        self.month = self._io.read_s1()
        self.day = self._io.read_s1()
        self.hour = self._io.read_s1()
        self.minute = self._io.read_s1()
        self.autoscroll_speed = KaitaiStream.resolve_enum(Level.AutoscrollSpeed, self._io.read_u1())
        self.clear_condition_category = KaitaiStream.resolve_enum(Level.ClearConditionCategory, self._io.read_u1())
        self.clear_condition = KaitaiStream.resolve_enum(Level.ClearCondition, self._io.read_s4le())
        self.unk_gamever = self._io.read_s4le()
        self.unk_management_flags = self._io.read_s4le()
        self.clear_attempts = self._io.read_s4le()
        self.clear_time = self._io.read_s4le()
        self.unk_creation_id = self._io.read_u4le()
        self.unk_upload_id = self._io.read_s8le()
        self.game_version = KaitaiStream.resolve_enum(Level.GameVersion, self._io.read_s4le())
        self.unk1 = self._io.read_bytes(189)
        self.gamestyle = KaitaiStream.resolve_enum(Level.Gamestyle, self._io.read_s2le())
        self.unk2 = self._io.read_u1()
        self.name = (self._io.read_bytes(66)).decode(u"UTF-16LE")
        self.description = (self._io.read_bytes(202)).decode(u"UTF-16LE")
        self.overworld = Level.Map(self._io, self, self._root)
        self.subworld = Level.Map(self._io, self, self._root)

    class Map(KaitaiStruct):

        class BoundaryType(Enum):
            built_above_line = 0
            built_below_line = 1

        class AutoscrollType(Enum):
            none = 0
            slow = 1
            normal = 2
            fast = 3
            custom = 4

        class Orientation(Enum):
            horizontal = 0
            vertical = 1

        class Theme(Enum):
            overworld = 0
            underground = 1
            castle = 2
            airship = 3
            underwater = 4
            ghost_house = 5
            snow = 6
            desert = 7
            sky = 8
            forest = 9

        class LiquidMode(Enum):
            static = 0
            rising_or_falling = 1
            rising_and_falling = 2

        class LiquidSpeed(Enum):
            none = 0
            x1 = 1
            x2 = 2
            x3 = 3
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.theme = KaitaiStream.resolve_enum(Level.Map.Theme, self._io.read_u1())
            self.autoscroll_type = KaitaiStream.resolve_enum(Level.Map.AutoscrollType, self._io.read_u1())
            self.boundary_type = KaitaiStream.resolve_enum(Level.Map.BoundaryType, self._io.read_u1())
            self.orientation = KaitaiStream.resolve_enum(Level.Map.Orientation, self._io.read_u1())
            self.liquid_end_height = self._io.read_u1()
            self.liquid_mode = KaitaiStream.resolve_enum(Level.Map.LiquidMode, self._io.read_u1())
            self.liquid_speed = KaitaiStream.resolve_enum(Level.Map.LiquidSpeed, self._io.read_u1())
            self.liquid_start_height = self._io.read_u1()
            self.boundary_right = self._io.read_s4le()
            self.boundary_top = self._io.read_s4le()
            self.boundary_left = self._io.read_s4le()
            self.boundary_bottom = self._io.read_s4le()
            self.unk_flag = self._io.read_s4le()
            self.object_count = self._io.read_s4le()
            self.sound_effect_count = self._io.read_s4le()
            self.snake_block_count = self._io.read_s4le()
            self.clear_pipe_count = self._io.read_s4le()
            self.piranha_creeper_count = self._io.read_s4le()
            self.exclamation_mark_block_count = self._io.read_s4le()
            self.track_block_count = self._io.read_s4le()
            self.unk1 = self._io.read_s4le()
            self.ground_count = self._io.read_s4le()
            self.track_count = self._io.read_s4le()
            self.ice_count = self._io.read_s4le()
            self.objects = [None] * (2600)
            for i in range(2600):
                self.objects[i] = Level.Obj(self._io, self, self._root)

            self.sounds = [None] * (300)
            for i in range(300):
                self.sounds[i] = Level.Sound(self._io, self, self._root)

            self.snakes = [None] * (5)
            for i in range(5):
                self.snakes[i] = Level.Snake(self._io, self, self._root)

            self.clear_pipes = [None] * (200)
            for i in range(200):
                self.clear_pipes[i] = Level.ClearPipe(self._io, self, self._root)

            self.piranha_creepers = [None] * (10)
            for i in range(10):
                self.piranha_creepers[i] = Level.PiranhaCreeper(self._io, self, self._root)

            self.exclamation_blocks = [None] * (10)
            for i in range(10):
                self.exclamation_blocks[i] = Level.ExclamationBlock(self._io, self, self._root)

            self.track_blocks = [None] * (10)
            for i in range(10):
                self.track_blocks[i] = Level.TrackBlock(self._io, self, self._root)

            self.ground = [None] * (4000)
            for i in range(4000):
                self.ground[i] = Level.Ground(self._io, self, self._root)

            self.tracks = [None] * (1500)
            for i in range(1500):
                self.tracks[i] = Level.Track(self._io, self, self._root)

            self.icicles = [None] * (300)
            for i in range(300):
                self.icicles[i] = Level.Icicle(self._io, self, self._root)

            self.unk2 = self._io.read_bytes(3516)


    class ClearPipeNode(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.type = self._io.read_u1()
            self.index = self._io.read_u1()
            self.x = self._io.read_u1()
            self.y = self._io.read_u1()
            self.width = self._io.read_u1()
            self.height = self._io.read_u1()
            self.unk1 = self._io.read_u1()
            self.direction = self._io.read_u1()


    class Track(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u2le()
            self.flags = self._io.read_u1()
            self.x = self._io.read_u1()
            self.y = self._io.read_u1()
            self.type = self._io.read_u1()
            self.lid = self._io.read_u2le()
            self.unk2 = self._io.read_u2le()
            self.unk3 = self._io.read_u2le()


    class TrackBlockNode(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.direction = self._io.read_u1()
            self.unk2 = self._io.read_u2le()


    class Obj(KaitaiStruct):

        class ObjId(Enum):
            goomba = 0
            koopa = 1
            piranha_flower = 2
            hammer_bro = 3
            block = 4
            question_block = 5
            hard_block = 6
            ground = 7
            coin = 8
            pipe = 9
            spring = 10
            lift = 11
            thwomp = 12
            bullet_bill_blaster = 13
            mushroom_platform = 14
            bob_omb = 15
            semisolid_platform = 16
            bridge = 17
            p_switch = 18
            pow = 19
            super_mushroom = 20
            donut_block = 21
            cloud = 22
            note_block = 23
            fire_bar = 24
            spiny = 25
            goal_ground = 26
            goal = 27
            buzzy_beetle = 28
            hidden_block = 29
            lakitu = 30
            lakitu_cloud = 31
            banzai_bill = 32
            one_up = 33
            fire_flower = 34
            super_star = 35
            lava_lift = 36
            starting_brick = 37
            starting_arrow = 38
            magikoopa = 39
            spike_top = 40
            boo = 41
            clown_car = 42
            spikes = 43
            big_mushroom = 44
            shoe_goomba = 45
            dry_bones = 46
            cannon = 47
            blooper = 48
            castle_bridge = 49
            jumping_machine = 50
            skipsqueak = 51
            wiggler = 52
            fast_conveyor_belt = 53
            burner = 54
            door = 55
            cheep_cheep = 56
            muncher = 57
            rocky_wrench = 58
            track = 59
            lava_bubble = 60
            chain_chomp = 61
            bowser = 62
            ice_block = 63
            vine = 64
            stingby = 65
            arrow = 66
            one_way = 67
            saw = 68
            player = 69
            big_coin = 70
            half_collision_platform = 71
            koopa_car = 72
            cinobio = 73
            spike_ball = 74
            stone = 75
            twister = 76
            boom_boom = 77
            pokey = 78
            p_block = 79
            sprint_platform = 80
            smb2_mushroom = 81
            donut = 82
            skewer = 83
            snake_block = 84
            track_block = 85
            charvaargh = 86
            slight_slope = 87
            steep_slope = 88
            reel_camera = 89
            checkpoint_flag = 90
            seesaw = 91
            red_coin = 92
            clear_pipe = 93
            conveyor_belt = 94
            key = 95
            ant_trooper = 96
            warp_box = 97
            bowser_jr = 98
            on_off_block = 99
            dotted_line_block = 100
            water_marker = 101
            monty_mole = 102
            fish_bone = 103
            angry_sun = 104
            swinging_claw = 105
            tree = 106
            piranha_creeper = 107
            blinking_block = 108
            sound_effect = 109
            spike_block = 110
            mechakoopa = 111
            crate = 112
            mushroom_trampoline = 113
            porkupuffer = 114
            cinobic = 115
            super_hammer = 116
            bully = 117
            icicle = 118
            exclamation_block = 119
            lemmy = 120
            morton = 121
            larry = 122
            wendy = 123
            iggy = 124
            roy = 125
            ludwig = 126
            cannon_box = 127
            propeller_box = 128
            goomba_mask = 129
            bullet_bill_mask = 130
            red_pow_box = 131
            on_off_trampoline = 132
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.x = self._io.read_s4le()
            self.y = self._io.read_s4le()
            self.unk1 = self._io.read_s2le()
            self.width = self._io.read_u1()
            self.height = self._io.read_u1()
            self.flag = self._io.read_s4le()
            self.cflag = self._io.read_s4le()
            self.ex = self._io.read_s4le()
            self.id = KaitaiStream.resolve_enum(Level.Obj.ObjId, self._io.read_s2le())
            self.cid = self._io.read_s2le()
            self.lid = self._io.read_s2le()
            self.sid = self._io.read_s2le()


    class Icicle(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.x = self._io.read_u1()
            self.y = self._io.read_u1()
            self.type = self._io.read_u1()
            self.unk1 = self._io.read_u1()


    class Snake(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.index = self._io.read_u1()
            self.node_count = self._io.read_u1()
            self.unk1 = self._io.read_u2le()
            self.nodes = [None] * (120)
            for i in range(120):
                self.nodes[i] = Level.SnakeNode(self._io, self, self._root)



    class ClearPipe(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.index = self._io.read_u1()
            self.node_count = self._io.read_u1()
            self.unk = self._io.read_u2le()
            self.nodes = [None] * (36)
            for i in range(36):
                self.nodes[i] = Level.ClearPipeNode(self._io, self, self._root)



    class ExclamationBlock(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.index = self._io.read_u1()
            self.node_count = self._io.read_u1()
            self.unk2 = self._io.read_u1()
            self.nodes = [None] * (10)
            for i in range(10):
                self.nodes[i] = Level.ExclamationBlockNode(self._io, self, self._root)



    class Ground(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.x = self._io.read_u1()
            self.y = self._io.read_u1()
            self.id = self._io.read_u1()
            self.background_id = self._io.read_u1()


    class SnakeNode(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.index = self._io.read_u2le()
            self.direction = self._io.read_u2le()
            self.unk1 = self._io.read_u4le()


    class Sound(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.id = self._io.read_u1()
            self.x = self._io.read_u1()
            self.y = self._io.read_u1()
            self.unk1 = self._io.read_u1()


    class TrackBlock(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.index = self._io.read_u1()
            self.node_count = self._io.read_u1()
            self.unk2 = self._io.read_u1()
            self.nodes = [None] * (10)
            for i in range(10):
                self.nodes[i] = Level.TrackBlockNode(self._io, self, self._root)



    class PiranhaCreeperNode(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.direction = self._io.read_u1()
            self.unk2 = self._io.read_u2le()


    class PiranhaCreeper(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.index = self._io.read_u1()
            self.node_count = self._io.read_u1()
            self.unk2 = self._io.read_u1()
            self.nodes = [None] * (20)
            for i in range(20):
                self.nodes[i] = Level.PiranhaCreeperNode(self._io, self, self._root)



    class ExclamationBlockNode(KaitaiStruct):
        def __init__(self, _io, _parent=None, _root=None):
            self._io = _io
            self._parent = _parent
            self._root = _root if _root else self
            self._read()

        def _read(self):
            self.unk1 = self._io.read_u1()
            self.direction = self._io.read_u1()
            self.unk2 = self._io.read_u2le()