/
rm006.sc
1082 lines (1016 loc) · 16.8 KB
/
rm006.sc
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
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; Sierra Script 1.0 - (do not remove this comment)
;;; Decompiled by sluicebox
(script# 6)
(include sci.sh)
(use Main)
(use Interface)
(use CodeCue)
(use Door)
(use KQ5Room)
(use PolyPath)
(use Polygon)
(use Follow)
(use Chase)
(use RFeature)
(use Jump)
(use Motion)
(use User)
(use Actor)
(use System)
(public
rm006 0
)
(local
local0
local1
local2
[local3 20] = [0 153 79 154 108 153 140 155 192 153 197 156 267 153 319 153 319 189 0 189]
[local23 26] = [0 40 253 40 264 121 289 124 298 128 302 134 283 140 231 145 77 146 77 105 72 105 72 145 0 145]
[local49 18] = [319 145 302 145 302 139 304 134 299 127 287 119 266 119 250 0 319 0]
[local67 9] = [1005 210 90 5 8 26 19 24 32]
[local76 9] = [1000 30 60 4 11 24 19 23 30]
)
(procedure (localproc_0 param1 param2) ; UNUSED
(if (< argc 2)
(= param2 5)
)
(OnControl
CONTROL
(- (param1 x:) param2)
(- (param1 y:) param2)
(+ (param1 x:) param2)
(+ (param1 y:) param2)
)
)
(procedure (localproc_1 &tmp temp0)
(signCel init:)
(RedrawCast)
(while (not (OneOf ((= temp0 (Event new:)) type:) evMOUSEBUTTON evKEYBOARD evJOYDOWN))
(temp0 dispose:)
)
(temp0 dispose:)
(signCel dispose:)
)
(instance rm006 of KQ5Room
(properties
picture 6
north 7
east 3
west 27
)
(method (init)
(super init:)
(= global320 46)
(= global321 121)
(gGlobalAudio number: 7777 loop: -1 doNotStop: 1 play:)
(gEgo normal: 1 setStep: 2 1 view: 2 init:)
(smoke setCycle: Fwd init:)
(stream1 setCycle: Fwd init:)
(stream2 setCycle: Fwd init:)
(stream3 setCycle: Fwd init:)
(stream4 setCycle: Fwd init:)
(stream5 setCycle: Fwd init:)
(= global325 3030)
(self
setFeatures: bakeSign road wind logs house
setRegions: 202 ; owl
addObstacle: poly1 poly2 poly3
)
(poly1 points: @local3 size: 10)
(poly2 points: @local23 size: 13)
(poly3 points: @local49 size: 9)
(switch gPrevRoomNum
(west
(gEgo posn: 7 152)
(self setScript: (ScriptID 202 1)) ; stdWalkIn
)
(east
(gEgo posn: 316 150)
(self setScript: (ScriptID 202 1)) ; stdWalkIn
)
(north
(gEgo posn: 264 121 priority: 1 init:)
((gEgo head:) priority: 1)
(HandsOff)
(self setScript: room6WalkIn)
)
(206 ; bakeShop
(gEgo posn: 116 150)
(HandsOff)
(self setScript: outDoor)
)
(else
(gEgo posn: 316 150)
)
)
(if (and (or (gEgo has: 8) (gEgo has: 16)) (not (IsFlag 83))) ; Shoe, Stick
(rat setLoop: 6 ignoreActors: 1 init:)
(cat setLoop: 2 ignoreActors: 1 init:)
)
(Load rsVIEW 71)
(gGlobalSound2 number: 24 loop: -1 play:)
(door init:)
(bakeSign init:)
)
(method (doit &tmp temp0)
(cond
(script
(script doit:)
)
((& (gEgo onControl: 0) $0040)
(HandsOff)
(self setScript: walkTo7)
)
((= temp0 (self edgeToRoom: (gEgo edgeHit:)))
((ScriptID 202 2) register: (gEgo edgeHit:)) ; stdWalkOut
(self setScript: (ScriptID 202 2)) ; stdWalkOut
)
((& (gEgo onControl: 1) $4000)
(HandsOff)
(gEgo setMotion: 0)
(self setScript: openDoor)
)
((& (gEgo onControl: 0) $0002)
(HandsOff)
(self setScript: drownHim)
)
(
(and
(gCast contains: rat)
(> (gEgo x:) 290)
(> (gEgo y:) 142)
)
(User canControl: 0)
(gEgo setMotion: 0)
(SetFlag 83)
(gGlobalSound3 number: 882 loop: -1 play:)
(self setScript: catAndMouse)
)
)
)
(method (handleEvent event)
(if
(or
script
(event claimed:)
(not (== (event type:) evVERB))
(not (& (OnControl CONTROL (event x:) (event y:)) $0002))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 208)
(event claimed: 1)
)
(3 ; Do
(gEgo setMotion: PolyPath (gEgo x:) 189)
(event claimed: 1)
)
)
)
)
(method (newRoom newRoomNumber)
(if (!= newRoomNumber 27)
(gGlobalSound fade:)
)
(super newRoom: newRoomNumber)
)
(method (dispose)
(DisposeScript 972)
(DisposeScript 971)
(DisposeScript 991)
(super dispose:)
)
)
(instance openDoor of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(gEgo setMotion: PolyPath 73 146 self)
)
(1
(gEgo cel: 1)
(gGlobalAudio stop: doNotStop: 0)
(proc762_1 @local76 3031 self)
)
(2
(door cycleSpeed: 2 setCycle: End self)
)
(3
(gEgo
setPri: 11
setMotion: MoveTo (gEgo x:) (- (gEgo y:) 7) self
)
)
(4
(door setPri: 12 setCycle: Beg self)
)
(5
(gGlobalSound fade:)
(gGlobalSound2 fade:)
(gCurRoom newRoom: 206) ; bakeShop
)
)
)
)
(instance outDoor of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(gEgo normal: 0 setPri: 11 setLoop: 2 posn: 73 141)
(door setPri: 12 cycleSpeed: 2 setCycle: End self)
)
(1
(gEgo
setLoop: -1
normal: 1
setMotion: MoveTo (gEgo x:) (+ (gEgo y:) 9) self
)
)
(2
(door setPri: -1 setCycle: Beg)
(= cycles 16)
)
(3
(gGlobalAudio number: 7777 loop: -1 doNotStop: 1 play:)
(gEgo setPri: -1)
(door stopUpd:)
(HandsOn)
(self dispose:)
)
)
)
)
(instance walkTo7 of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(gEgo
setMotion:
MoveTo
(- (gEgo x:) 10)
(- (gEgo y:) 3)
self
)
)
(1
(HandsOn)
(gCurRoom newRoom: 7)
(self dispose:)
)
)
)
)
(instance drownHim of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(proc762_1 @local76 3032 self)
)
(1
(DoAudio audWPLAY 8068)
(= cycles 1)
)
(2
((gEgo head:) hide:)
(gEgo
normal: 0
view: 71
cel: 0
setMotion: MoveTo (gEgo x:) (+ (gEgo y:) 5)
cycleSpeed: 2
setCycle: End self
)
)
(3
(gGlobalAudio number: 8068 loop: 1 play:)
(gEgo
setLoop: 2
posn: (- (gEgo x:) 30) (+ (gEgo y:) 10)
setCycle: Fwd
setStep: 3 1
setMotion: MoveTo -15 169
cycleSpeed: 3
)
(= cycles 1)
)
(4
(if (!= (DoAudio audPOSITION) -1)
(-- state)
else
(gGlobalAudio number: 7777 loop: -1 doNotStop: 1 play:)
)
(= cycles 1)
)
(5
(if (> (gEgo x:) -15)
(-- state)
)
(= cycles 1)
)
(6
(= seconds 3)
)
(7
(cls)
(= global330 179)
(EgoDead)
)
)
)
)
(instance shoeFly of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(if (!= local2 0)
(flyShoe setCycle: Walk)
)
(flyShoe setMotion: Chase cat 5 self)
)
(1
(catAndMouse changeState: 6)
(flyShoe
setStep: 3 3
setMotion:
JumpTo
(+ (flyShoe x:) 20)
(+ (flyShoe y:) 20)
self
)
)
(2
(flyShoe setScript: 0 dispose:)
)
)
)
)
(instance catAndMouse of Script
(properties)
(method (doit)
(super doit:)
(if (and (== state 1) (not local1) (== (cat cel:) 6))
(rat dispose:)
)
(if (and (== state 4) (== (gEgo cel:) 5))
(flyShoe
setLoop: (if (== local2 2) 14 else 11)
illegalBits: 0
ignoreActors: 1
ignoreHorizon: 1
x: (- (gEgo x:) 15)
y: (- (gEgo y:) 19)
setScript: shoeFly
init:
)
)
)
(method (changeState newState)
(switch (= state newState)
(0
(gGlobalAudio stop:)
(gCurRoom setFeatures: catStrip)
(Say 207)
(rat setCycle: Walk setMotion: MoveTo 330 151)
(cat setCycle: Walk setMotion: Chase rat 10 self)
)
(1
(cls)
(if local1
(cat cel: 0 setLoop: 4 setCycle: CT 8 1)
(rat hide:)
else
(= local0 1)
(cat cel: 0 setLoop: 4 setCycle: End self)
(rat dispose:)
)
(gGlobalSound3 stop:)
)
(2
(cat setLoop: 5 setCycle: Walk setMotion: MoveTo -20 151 self)
)
(3
(HandsOn)
(client setScript: 0)
(cat dispose:)
(self dispose:)
)
(4
(cls)
(HandsOff)
((gEgo head:) hide:)
(gEgo
view: 221
normal: 0
loop: 1
cel: 0
cycleSpeed: 1
setCycle: End self
)
(cat setMotion: Follow rat 10)
)
(5)
(6
(gGlobalSound3 stop:)
((gEgo head:) show:)
(gEgo
normal: 1
view: 2
x: (- (gEgo x:) 11)
loop: 1
cycleSpeed: 0
setCycle: KQ5SyncWalk
)
(cat setLoop: 3 setCycle: Walk setMotion: MoveTo -20 151)
(rat setMotion: MoveTo (- (gEgo x:) 25) (gEgo y:) self)
(gGlobalAudio number: 7063 loop: 1 play:)
)
(7
(gGlobalSound4 number: 63 loop: 1 play:)
(rat setLoop: 8)
(= cycles 5)
)
(8
(proc762_1 @local67 5103 self)
)
(9
(= cycles 1)
)
(10
(gGlobalSound4 fade:)
(cls)
(= cycles 1)
)
(11
(rat setLoop: 7 setMotion: MoveTo -20 151 self)
)
(12
(rat dispose:)
(= cycles 5)
)
(13
(gGlobalAudio number: 7777 loop: -1 doNotStop: 1 play:)
(HandsOn)
(client setScript: 0)
)
)
)
)
(instance moveScript of Script ; UNUSED
(properties)
(method (changeState newState)
(switch (= state newState)
(0
(client setCycle: End self)
)
(1
(= cycles 10)
)
(2
(client setCycle: Beg self)
)
(3
(= state -1)
(= seconds (Random 3 10))
)
)
)
)
(instance room6WalkIn of Script
(properties)
(method (changeState newState)
(switch (= state newState)
(0
((ScriptID 202 4) ; cedric
view: 138
loop: 2
cel: 0
cycleSpeed: 3
setCycle: End
)
(= cycles 2)
)
(1
(gEgo setPri: -1 setMotion: PolyPath 301 136 self)
((gEgo head:) setPri: -1)
)
(2
(HandsOn)
((ScriptID 202 4) setScript: (ScriptID 202 3)) ; cedric, rotate
(self dispose:)
)
)
)
)
(class StreamProp of Prop
(properties)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (& (OnControl CONTROL (event x:) (event y:)) $0002))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 208)
(event claimed: 1)
)
(3 ; Do
(gEgo setMotion: PolyPath (gEgo x:) 189)
(event claimed: 1)
)
)
)
)
)
(instance stream1 of StreamProp
(properties
x 194
y 175
view 220
priority 5
signal 16400
cycleSpeed 6
detailLevel 3
)
)
(instance stream2 of StreamProp
(properties
x 113
y 174
view 220
loop 1
priority 5
signal 16400
cycleSpeed 6
detailLevel 3
)
)
(instance stream3 of StreamProp
(properties
x 13
y 175
view 220
loop 9
priority 5
signal 16400
cycleSpeed 6
detailLevel 3
)
)
(instance stream4 of StreamProp
(properties
x 59
y 167
view 220
loop 10
priority 5
signal 16400
cycleSpeed 5
detailLevel 3
)
)
(instance stream5 of StreamProp
(properties
x 289
y 174
view 220
loop 13
priority 5
signal 16400
cycleSpeed 5
detailLevel 3
)
)
(instance road of RFeature
(properties)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (& (OnControl CONTROL (event x:) (event y:)) $0004))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 209)
(event claimed: 1)
)
)
)
)
)
(instance wind of RFeature
(properties)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (& (OnControl CONTROL (event x:) (event y:)) $0008))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 210)
(event claimed: 1)
)
)
)
)
)
(instance logs of RFeature
(properties)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (& (OnControl CONTROL (event x:) (event y:)) $0010))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 211)
(event claimed: 1)
)
)
)
)
)
(instance house of RFeature
(properties
nsTop 34
nsLeft 9
nsBottom 143
nsRight 278
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 212)
(event claimed: 1)
)
)
)
)
)
(instance door of Door
(properties
x 85
y 143
view 221
signal 16385
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 213)
(event claimed: 1)
)
(3 ; Do
(HandsOff)
(gCurRoom setScript: openDoor)
(event claimed: 1)
)
)
)
)
)
(instance signCel of Prop
(properties
x 100
y 100
view 221
loop 6
priority 15
signal 16
)
)
(instance bakeSign of RFeature
(properties
nsTop 106
nsLeft 95
nsBottom 116
nsRight 109
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(2 ; Look
(localproc_1)
(event claimed: 1)
)
)
)
)
)
(instance cat of Actor
(properties
x -80
y 151
view 220
loop 2
xStep 4
)
(method (doit)
(super doit:)
(+= nsLeft 5)
(+= nsRight 5)
(+= nsTop 5)
(+= nsBottom 5)
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 214)
(event claimed: 1)
)
(3 ; Do
(if local0
(Say 215)
else
(Say 216)
)
(event claimed: 1)
)
(4 ; Inventory
(switch (gInventory indexOf: (gTheIconBar curInvIcon:))
(8
(if local0
(Say 215)
else
(= local1 1)
(gEgo put: 8 6) ; Shoe
(SetScore 4)
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(16
(if local0
(Say 215)
else
(SetScore 4)
(= local2 1)
(= local1 1)
(gEgo put: 16 6) ; Stick
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(19
(if local0
(Say 215)
else
(= local2 3)
(= local1 1)
(gEgo put: 19 6) ; Leg_of_Lamb
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(5
(if local0
(Say 215)
else
(= local2 2)
(= local1 1)
(gEgo put: 5 6) ; Fish
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(28
(event claimed: 0)
)
)
)
)
)
)
)
(instance catStrip of RFeature
(properties
nsBottom 200
nsRight 320
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(4 ; Inventory
(switch (gInventory indexOf: (gTheIconBar curInvIcon:))
(8
(if local0
(Say 215)
else
(= local1 1)
(gEgo put: 8 6) ; Shoe
(SetScore 4)
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(16
(if local0
(Say 215)
else
(= local2 1)
(= local1 1)
(gEgo put: 16 6) ; Stick
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(5
(if local0
(Say 215)
else
(= local2 2)
(= local1 1)
(gEgo put: 5 6) ; Fish
(catAndMouse changeState: 4)
)
(event claimed: 1)
)
(28
(event claimed: 0)
)
)
)
)
)
)
)
(instance rat of Actor
(properties
x 38
y 151
view 220
loop 6
xStep 2
)
(method (handleEvent event)
(if
(or
(event claimed:)
(not (== (event type:) evVERB))
(not (MousedOn self event))
)
(return)
else
(switch (event message:)
(2 ; Look
(Say 214)
(event claimed: 1)
)
)
)
)
)
(instance flyShoe of Actor
(properties
view 220
loop 11
priority 13
signal 18448
xStep 12
)
)
(instance hands of Prop ; UNUSED
(properties
x 204
y 93
view 223
loop 2
cel 3
priority 12
signal 16400
)
)
(instance theMouth of Prop ; UNUSED
(properties