-
Notifications
You must be signed in to change notification settings - Fork 0
/
story.ni
4803 lines (3999 loc) · 242 KB
/
story.ni
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
"Threediopolis" by Andrew Schultz
[Stuff to search for:
(BR)major, for list manipulation and header stuff
(BR)tof findies (regular mode)
(BR)top scenery progress
(BR)tos scenery
(BR)too table of observies
(BR)tsc table of score comments
(BR)tse table of sad endings
(BR)the table of happy endings
(BR)tol table of lookbys
]
volume 1
the story headline is "A Futuristic Word-Play Gofering"
the story description is "The big city is griddy and gritty. Can you navigate it?"
the release number is 4.
release along with cover art.
[release along with an interpreter.]
Use maximum indexed text length of at least 3000.
Use dynamic memory allocation of at least 16384.
book extensions
include Basic Screen Effects Modified by Emily Short. [I just increased the size of a buffer, replacing 64 with 70, for the friends header]
include Conditional Undo by Jesse McGrew.
section debug stub
to debug-say (tt - text):
if debug-state is true:
say "DEBUG: [tt][line break]";
section get rid of default verbs
understand the command "kiss" as something new.
understand the command "rub" as something new.
understand the command "burn" as something new.
understand the command "stand" as something new.
understand the command "wave" as something new.
does the player mean drinking the package: it is likely.
instead of drinking:
say "There are hydration stations all around Threediopolis. You just take them for granted, now."
the block attacking rule is not listed in any rulebook.
check attacking:
if noun is package:
say "It's probably got an alarm or something if you get violent." instead;
if noun is bracelet:
say "No, it's kind of cool in an ironic sort of way." instead;
if player carries the noun:
if noun is availableometer or noun is adrift-a-tron:
say "[if a-charges is 10]Not while it still has charges[else]You could recycle it instead once you're done[end if]." instead;
say "No, it should be useful. Sorry if you're a bit frustrated!" instead;
if noun is a quasi-entry:
say "Force is neither necessary nor appreciated. Just [if noun is front door]knock[else]go in[end if] instead." instead;
if noun is the player:
say "Oh dear, I hope the puzzles haven't driven you THAT up the wall." instead;
say "Vandalism is an easy crime to detect and prosecute. Camera technology, etc." instead;
section debug extensions - not for release
[include object response tests by Juhana Leinonen. [makes sure certain actions work as intended, checks default]
include property checking by Emily Short. [make sure descriptions are implemented] [commented out for debug-zblorbability]]
section debug-start - not for release
the first begin play rule is listed first in the when play begins rules.
when play begins (this is the first begin play rule):
now debug-state is true;
[every turn (this is the debug-tracking rule):
say "[thestring]";
do nothing.
say "[your-tally].";]
Include (- Switches z; -) after "ICL Commands" in "Output.i6t".
book i6 cool stuff
[thanks to climbingstars for the main code behind the yes/no example. I tweaked some trivial stuff. If you want to change the yes/no defaults, this is a good start. It even tells you if you are using no words or too many. Snaz-zee!]
To set the/-- pronoun it to (O - an object): (- LanguagePronouns-->3 = {O}; -).
chapter redraw status line only some of the time
section status line redraw modifier
Include (-
[ DrawStatusLine width posb;
@push say__p; @push say__pc;
BeginActivity(CONSTRUCTING_STATUS_LINE_ACT);
VM_MoveCursorInStatusLine(1, 1);
if (statuswin_current) {
width = VM_ScreenWidth(); posb = width-15;
spaces width;
ClearParagraphing();
if (ForActivity(CONSTRUCTING_STATUS_LINE_ACT) == false) {
VM_MoveCursorInStatusLine(1, 2);
switch(metaclass(left_hand_status_line)) {
String: print (string) left_hand_status_line;
Routine: left_hand_status_line();
}
VM_MoveCursorInStatusLine(1, posb);
switch(metaclass(right_hand_status_line)) {
String: print (string) right_hand_status_line;
Routine: right_hand_status_line();
}
}
VM_MoveCursorInStatusLine(1, 1); VM_MainWindow();
}
ClearParagraphing();
EndActivity(CONSTRUCTING_STATUS_LINE_ACT);
@pull say__pc; @pull say__p;
];
-) before "Printing.i6t".
chapter allow o
Include (-
[ Keyboard a_buffer a_table nw i w w2 x1 x2;
sline1 = score; sline2 = turns;
while (true) {
! Save the start of the buffer, in case "oops" needs to restore it
for (i=0 : i<64 : i++) oops_workspace->i = a_buffer->i;
! In case of an array entry corruption that shouldn't happen, but would be
! disastrous if it did:
#Ifdef TARGET_ZCODE;
a_buffer->0 = INPUT_BUFFER_LEN;
a_table->0 = 15; ! Allow to split input into this many words
#Endif; ! TARGET_
! Print the prompt, and read in the words and dictionary addresses
PrintPrompt();
DrawStatusLine();
KeyboardPrimitive(a_buffer, a_table);
! Set nw to the number of words
#Ifdef TARGET_ZCODE; nw = a_table->1; #Ifnot; nw = a_table-->0; #Endif;
! If the line was blank, get a fresh line
if (nw == 0) {
@push etype; etype = BLANKLINE_PE;
players_command = 100;
BeginActivity(PRINTING_A_PARSER_ERROR_ACT);
if (ForActivity(PRINTING_A_PARSER_ERROR_ACT) == false) L__M(##Miscellany,10);
EndActivity(PRINTING_A_PARSER_ERROR_ACT);
@pull etype;
continue;
}
! Unless the opening word was OOPS, return
! Conveniently, a_table-->1 is the first word on both the Z-machine and Glulx
w = a_table-->1;
! Undo handling
if ((w == UNDO1__WD or UNDO3__WD) && (nw==1)) {
Perform_Undo();
continue;
}
i = VM_Save_Undo();
#ifdef PREVENT_UNDO; undo_flag = 0; #endif;
#ifndef PREVENT_UNDO; undo_flag = 2; #endif;
if (i == -1) undo_flag = 0;
if (i == 0) undo_flag = 1;
if (i == 2) {
VM_RestoreWindowColours();
VM_Style(SUBHEADER_VMSTY);
SL_Location(); print "^";
! print (name) location, "^";
VM_Style(NORMAL_VMSTY);
L__M(##Miscellany, 13);
continue;
}
return nw;
}
];
-) instead of "Reading the Command" in "Parser.i6t"
chapter Ed's question
to decide what number is Ed-blab:
(- EdBlab() -)
Include (-
Array edMad --> 4 "'Yes or no. Not rocket science.' Whew. He's a bit...direct." "'C'mon, kid, you can't answer an easy yes-no question...'" "'Last chance. No wrong answers. Only two possible.' He's a little upset, but a simple yes/no will probably make him happy." "'Okay, you asked for it. Or you didn't.'";
Array edSilent --> 4 "'Yeah, yeah. Doer not a talker. But I need a simple yes or no.'" "Ed out-silences you into feeling you really should answer yes or no." "With a quizzical frown, Ed moves a hand up, then down. He's a little ticked, but a simple yes/no will change that." "Ed shrugs.";
[ EdBlab i j k;
k = 0;
for (::) {
if (location ~= nothing && parent(player) ~= nothing) DrawStatusLine();
KeyboardPrimitive(buffer, parse);
#Ifdef TARGET_ZCODE;
j = parse->1;
#Ifnot; ! TARGET_GLULX;
j = parse-->0;
#Endif; ! TARGET_
k++;
if (j) { ! at least one word entered
i = parse-->1;
if (i == YES1__WD or YES2__WD) rtrue;
if (i == NO1__WD or NO2__WD) rfalse;
if (j > 1) { print "'No biographies. Yes or no.'"; }
else { print (string) edMad-->k; }
} else { print (string) edSilent-->k; }
if (k == 4) return 2;
}
];
-)
chapter transcripting stub
Include (-
[ CheckTranscriptStatus;
#ifdef TARGET_ZCODE;
return ((0-->8) & 1);
#ifnot;
return (gg_scriptstr ~= 0);
#endif;
];
-).
To decide whether currently transcripting: (- CheckTranscriptStatus() -)
ignore-transcript-nag is a truth state that varies.
after reading a command:
let locom be the player's command in lower case;
if the player's command matches the regular expression "^\p" or the player's command matches the regular expression "^\*":
if character number 1 in the player's command is "[bracket]":
say "Did you mean to hit P?";
if the player consents:
try pushing the button instead;
else:
say "Ok, you don't need to use brackets, though.";
reject the player's command;
if currently transcripting:
say "Noted.";
reject the player's command;
otherwise:
if ignore-transcript-nag is false:
say "You've made a comment-style command, but Transcript is off. Type TRANSCRIPT to turn it on, if you wish to make notes. Or if you want to eliminate this nag, for instance if you have an interpreter that does so independently, say yes now.";
if the player consents:
now ignore-transcript-nag is true;
reject the player's command;
if alpha-look-mode is true or scen-look-mode is true:
if character number 1 in locom is "x":
say "You turn away.";
now saw-see is true;
now command prompt is ">";
now alpha-look-mode is false;
reject the player's command;
unless locom matches the regular expression "^<densuw>":
say "That's not a direction you can move the scope in.";
reject the player's command;
eval-dir "[character number 1 in the player's command in upper case]" instead;
if scen-look-mode is true or look-mode is true or bm-mode is true:
if locom matches the regular expression "<a-z>":
say "You need to input a number[if scen-look-mode is true] or direction[end if]--0 will [if bm-mode is true]list your conversation options[else]decline help[end if].";
reject the player's command;
[ if look-mode is false:
if the player's command matches the regular expression "^<0-9><0-9>*$":
if number of characters in locom is 3:
say "You need to try to walk to that location.";
else if number of characters in locom < 3:
say "Too few numbers in that to be a Threediopolis address. Which you should specify how to walk to, anyway.";
else:
say "That is outside Threediopolis City Bounds. Fourth-dimensional travel is for spaceports only.";
reject the player's command;]
if fast-run is false:
if number of characters in locom is 2 or number of characters in locom is 3:
now reserve-command is locom;
let HH be hash of locom;
if HH is 108 or HH is 105 or HH is 103 or HH is 8:
say "[if HH is 108]That's a pretty crazy diagonal direction. You'd crash into something, even with a jetpack[else if HH is 8]It would be more efficient if you could walk through buildings, but they're private property[else]Upward-diagonal directions are possible, but even with a jetpack, you could get ticketed for them[end if]. Did you mean to run these directions in order?";
if debug-state is true or the player consents:
say "[italic type][bracket]NOTE: you can [one of]always[or]still[stopping] remove this command check for good with J (for jump through diagonals--no argument.[close bracket][roman type][line break]";
dirparse reserve-command;
else:
say "Ok--you can always bypass the two-to-three-letter-command check with J (for jumping.)";
the rule succeeds;
now ignore-remaining-dirs is false;
if the number of characters in locom > 1:
if locom matches the regular expression "^<ewnsud \.>*$":
if the player's command matches "see new seens":
if player has the book:
say "You don't need this command, since you already have the book.";
the rule succeeds;
carry out the newseensing activity;
if number of characters in your-tally >= 1:
say "[italic type][bracket]NOTE: I kicked you back to the start[if number of visible quasi-entries > 0] and also removed the place you could've entered. They're all gone now[end if].[close bracket][roman type][line break]";
now my-table is table of scenery;
now fast-run is true;
now list-in-status is false;
reset-game;
increment the turn count;
the rule succeeds;
dirparse locom;
the rule succeeds;
let w1 be word number 1 in locom;
if w1 is "g" or w1 is "again":
say "That would actually make getting around in Threediopolis more complex. Because you can't really move from there to here, again, or not that way[if edtasks + pals < 3]. You'll understand once you find a few things--it'd just allow all kinds of extra crazy [italic type]guesses[roman type][else]. Most of the fun stuff would begin with G, though EGGS and DUNG would be left, which is not so fun[end if]. Using one-word directions should be quick enough.";
reject the player's command;
if locom matches the text "x 0":
say "The number zero is ambiguous here, so I'll reject it. It could mean everything below the second number, or only the second number. X 3 or X 13 should, for example, serve either purpose." instead;
reject the player's command;
if locom matches the regular expression "<\d>+<\p\s>+<\d>+":
if spacedashwarn is false:
say "[italic type][bracket]NOTE: instead of typing in two separate numbers, you can just lump them together, in the future.[close bracket][roman type][line break]";
now spacedashwarn is true;
replace the regular expression "(<\d>+)<\p\s>+(<\d>+)" in locom with "\1\2";
change the text of the player's command to locom;
spacedashwarn is a truth state that varies.
section debug variables i still need in release
debug-state is a truth state that varies.
superuser is a truth state that varies.
book undoing
understand the command "undo" as something new.
oopsy-daisy is a number that varies.
rule for deciding whether to allow undo:
if oopsy-daisy > 0 and oopsy-daisy <= number of rows in table of undo-msgs:
choose row oopsy-daisy in table of undo-msgs;
say "[ok-all-right entry][line break]";
if oopsy-daisy is 5 or oopsy-daisy is 4: [hard-coded to save memory. You can't undo using the adrift-a-tron. There used to be a can-undo entry.]
deny undo;
else:
allow undo;
otherwise:
say "Undeeds won't get you back to where you were. In fact, that's sort of why Ed Dunn hired you[one of]. [italic type][bracket]Fourth wall note: you can undo if you get killed, or you make a truly drastic decision to change cheat devices, but otherwise, you can't. Just push the button on your device to reset your wanderings instead[roman type].[close bracket][roman type][line break][or].[stopping]";
deny undo;
table of undo-msgs
ok-all-right
"Okay, I'll pretend you didn't wait around too long." [zzz]
"Okay, I'll pretend you didn't want to complete the game just yet." [win the game]
"Okay, I'll let you back away from the egress." [END]
"No device is a make-or-break cheat." [get availableometer/adrift-a-tron]
"It's a pretty cool cheat-tool, but it's not THAT cool." [backtracking for availableometer/adrift-a-tron]
"Okay, the Sneeds will be glad to wait for you. Even if they caught you lurking around (and they won't,) they'd chalk it up to shyness or whatever!" [Sneeds]
"Okay, this gets rid of the book of secrets til later." [undo getting book of secrets]
book when play begins
dee-male is a truth state that varies. dee-male is false.
friends-found is a number that varies. friends-found is 0.
edtasks is a number that varies. edtasks is 0.
pals is a number that varies. pals is 0.
maxedtasks is a number that varies. maxedtasks is 0.
maxpals is a number that varies. maxpals is 0.
to decide what number is taskdone:
decide on pals + edtasks;
secs is a number that varies.
quality is a kind of value. the qualities are chums, biz, party, relax, stuffly, or youish.
begin-rows is a number that varies. end-rows is a number that varies.
salty is a truth state that varies.
when play begins (this is the table tweaking and checking and randomizing rule):
now my-table is table of findies;
repeat through table of findies:
unless there is a findtype entry:
now findtype entry is biz;
if findtype entry is chums:
increment maxpals;
else:
increment maxedtasks;
now found entry is 0;
if there is no searchedfor entry:
now searchedfor entry is 1;
if there is no breakbefore entry:
now breakbefore entry is 0;
if there is no unlist entry:
now unlist entry is false;
[ if there is no descrip entry:
say "BUG [tally entry] needs descrip.";]
repeat through table of scenery:
if there is no found entry:
now found entry is 0;
[ if there is no descrip entry:
say "BUG [tally entry] needs descrip.";]
[ repeat through table of nearlies:
if there is no found-yet entry:
now found-yet entry is false;]
[ if there is no descrip entry:
say "BUG [tally entry] needs descrip.";]
if a random chance of 1 in 2 succeeds:
now dee-male is true;
assign-plurals;
repeat through table of findies:
now twistiness entry is letfound of tally entry;
repeat through table of scenery:
now twistiness entry is letfound of tally entry;
choose-next-zag;
now secs is number of rows in table of scenery;
calibrate-scenery-progress;
sort table of observies in random order;
now opposite-direction is southwest;
now begin-rows is 1;
now end-rows is 3;
if a random chance of 1 in 2 succeeds:
now salty is true;
to choose-next-zag:
let A be (next-zag + 9) / 10;
now next-zag is A * 10;
increase next-zag by a random number from 2 to 10;
to decide which number is letfound of (zzz - indexed text):
let temp be 0;
if zzz matches the text "e", case insensitively:
increment temp;
if zzz matches the text "u", case insensitively:
increment temp;
if zzz matches the text "s", case insensitively:
increment temp;
if zzz matches the text "n", case insensitively:
increment temp;
if zzz matches the text "w", case insensitively:
increment temp;
if zzz matches the text "d", case insensitively:
increment temp;
decide on temp;
book stubs and location globals
[I would REALLY like to use ital-say here, but that causes the game to need Glulx.]
your-tally is indexed text that varies.
ns is a number that varies. ew is a number that varies. ud is a number that varies.
to say qp:
say "[if player does not have book of top secret things]DEEDS: ENDED?[no line break][else if eggsfound < 80]SEEN, SUSSED, END...[no line break][else]DUDE! SENSE-ENDUED![no line break][end if]";
to endgame-process:
let donesies be taskdone;
choose row with tally of "Deedee" in table of findies;
say "[if found entry is 0]Ed seems quite upset you weren't able to find Deedee. He knows it was a ways away, but still--well, she will hear of the party[else]Ed nods to you and to Deedee[end if]. ";
if pals < (maxpals - 1) - found entry:
say "Then Ed grumbles a bit that you didn't find enough of his friends. The party should still be happening enough. ";
else if pals is maxpals - 1 - found entry:
repeat through table of findies:
if findtype entry is chums and found entry is 0:
say "'Nice job finding my other friends. Too bad you couldn't find [tally entry in upper case], but they won't be burned out next time.' ";
else:
say "'These other friends of mine can keep a party exciting on their own.' ";
say "[paragraph break]";
repeat through table of sad endings:
if stuff-i-did entry >= taskdone:
now oopsy-daisy is 2;
say "[eval entry][line break]";
end the story saying "[qp]";
continue the action;
say "'[if county of youish is maxy of youish]It's good to see you did all the fun stuff I put in there. I like fun[else]You could've done a little more fun stuff, no guilt[end if].'[paragraph break]Ed hands you some cool junk: ";
say "[if 3 * county of stuffly >= 2 * maxy of stuffly]a New York Yankees world champs t-shirt from before those lovable losers['] 90-year drought[else]an antique zip drive[end if], ";
say "[if 3 * county of party >= 2 * maxy of party]a big block of dehydrated beer[else]a canister of your least favorite flavor of powdered fruit punch[end if], ";
say "[if 3 * county of biz >= 2 * maxy of biz]a little extra for helping his business run smoothly[else]a Round Tuit to help you be a bit more business-minded[end if], and a ";
say "[if 3 * county of relax >= 2 * maxy of relax]CD--yes, a CD--of games Ed assures you are awesome, by some Andrew Schultz guy[else]download code for game 14 in a series that's been stale since #2[end if]. ";
repeat through the table of happy endings:
if donesies <= stuff-i-did entry:
say "[eval entry]";
now oopsy-daisy is 2;
if donesies > 20:
end the story finally;
else:
end the story;
the rule succeeds;
say "Oops. You scored too high. This is a BUG.";
scenery-sorted is a truth state that varies.
rule for amusing a victorious player:
say "Have you tried:[line break]";
repeat through table of stupid jokes:
say "--[nyuk entry][line break]";
if eggsfound is secs:
continue the action;
let A be 0;
let left-to-find be 2;
if secs - eggsfound < 2:
now left-to-find is secs - eggsfound;
let word-length be 3;
while left-to-find > 0 and word-length < 11:
repeat through table of scenery:
if number of characters in tally entry is word-length:
if left-to-find > 0:
decrement left-to-find;
say "--[tally entry in upper case]?";
increment word-length;
to say door-warn:
choose row with tally of "End" in table of findies;
if found entry is not 0:
say " (you will have to restart to see this)";
table of stupid jokes
nyuk
"swearing?"
"Entering the ominous door and ignoring the warning[door-warn]?"
"Z 3 times in a row? Then trying it again?"
"SING (before/after solving a few puzzles) or XYZZY?"
"Not answering YES or NO to Ed Dunn four times in a row? (He reacts differently to multi-, one- and zero- word responses.)"
"Visiting Ed Dunn with no tasks done? 1, 4, 7, 10, then every 4 give different responses."
"Just searching through the source code (^table of (scenery|nearlies) regular expression) to learn all the 'funny' hidden places at once?"
to decide what number is eggsfound:
let ef be 0;
repeat through table of scenery:
if found entry > 0:
increment ef;
decide on ef.
zero-ticker is a number that varies. zero-ticker is 0.
plus-ticker is a number that varies. plus-ticker is 0.
base-hint-count is a number that varies. base-hint-count is 0.
hint-iter is a number that varies. hint-iter is 0.
ed-happy-test is a truth state that varies.
to decide what number is force-ed-point:
choose row with tally of "EdDunn" in table of findies;
if found entry is 0:
decide on 1;
decide on 0;
hint-ever-block is a truth state that varies.
opposite-direction is a direction that varies.
hint-oppo is a truth state that varies.
ignore-susp is a truth state that varies.
just-found is a truth state that varies.
mb-mb-not is a number that varies.
say-back is a truth state that varies.
to reset-game:
now opposite-direction is southwest;
now ns is 4;
now ew is 4;
now ud is 4;
if adrift-on is true:
say "[line break]You decide to shut the adrift-a-tron off before trying another run.[paragraph break]";
now adrift-on is false;
now drift-this-trip is false;
let add-to be number of characters in your-tally;
if add-to >= 8:
if player does not have book of top secret things:
if taskdone < 4:
increment mb-mb-not;
if mb-mb-not is 2:
say "[line break]Hmm. Maybe you didn't need to walk around so much, or so long. Ed Dunn was brief with you, but he didn't seem cruel. Shorter walks and using the teleport could be better.";
now mb-mb-not is 0;
note-far-gone add-to;
if add-to > 7:
now add-to is 7;
if taskdone >= 3 or player has book of top secret things:
if just-found is false:
increase plus-ticker by add-to;
if add-to > 0:
now say-back is true;
now your-tally is "";
now all visible quasi-entries are off-stage;
now ignore-susp is false;
if door to ed is visible:
now door to ed is off-stage;
if say-back is true:
move player to outside-area;
if hint-block is false and just-found is false:
consider the try-a-hint rule;
if the rule succeeded:
if hint-ever-block is false:
now hint-ever-block is true;
say "[line break][italic type][bracket]NOTE: you can toggle hints like this by typing hh.[close bracket][roman type][line break]";
now just-found is false;
if taskdone is 19 + force-ed-point:
if ed-happy-test is false:
say "Hmm. You think Ed would be relatively happy enough with what you've done. He mentioned he didn't need perfection. [go-see-ed].[line break]";
now ed-happy-test is true;
continue the action;
if taskdone is 45 - force-ed-point:
say "Hmm. You've got 90% done. That should be enough for Ed. You hope. There may be some obscure tasks (err, 'stretch goals') in there. [go-see-ed].[if force-ed-point is 1][paragraph break][end if]";
to say go-see-ed:
say "You could probably go see him [if ed-happy-test is false]again [end if]any time, now"
this is the plural-almost rule:
let needplurals be 0; [I can make this a function, I know]
repeat through table of plurals:
if found entry is 1:
if found corresponding to a tally of mult entry in table of findies is 0:
increment needplurals;
if needplurals is 0:
the rule fails;
say "You wonder if you didn't almost make it somewhere but you just didn't go far enough...you searched for one instead of many[if needplurals > 1], maybe more than once[end if].";
the rule succeeds;
table of plurals
sing mult found
"dud" "Duds" 0
"ewe" "Ewes" 0
"nun" -- --
"sud" -- --
"deed" -- --
"dude" -- --
"dune" -- --
"nude" -- --
"seed" -- --
"weed" -- --
"sense" -- --
"wuss" "Wusses" --
"newdud" -- --
"weenee" -- --
"useddud" -- --
to assign-plurals:
let L be indexed text;
repeat through table of plurals:
if there is no found entry:
now found entry is 0;
now L is "[sing entry]";
now mult entry is "[L]s";
this is the try-a-hint rule:
if player has book of top secret things:
consider the try-scen-hint rule;
else:
consider the try-ed-hint rule;
if the rule succeeded:
the rule succeeds;
the rule fails.
sneed-count is a number that varies.
cheat-ticker is a truth state that varies.
this is the try-scen-hint rule:
unless cheat-ticker is true:
if plus-ticker >= 15:
now plus-ticker is 0;
now base-hint-count is 0;
else:
the rule fails;
let temp be 0;
increment sneed-count;
if sneed-count is 4:
say "You briefly wonder if you should just call it a day and go take up the Sneeds['] invitation. But, hmm, maybe one more try.";
now sneed-count is 0;
repeat through table of scenery:
if found entry is 0 and twistiness entry < 3:
increment temp;
if temp > 0:
say "Feeling a bit stuck, you consider finding the least twisty place[if temp > 1]s[end if] remaining[if temp > 1], or close to it. You count [temp in words] total[end if].";
if temp is 1:
repeat through table of scenery:
if twistiness entry < 3 and found entry is 0:
say "[line break]That place is at [sector-num of tally entry], written up as [descrip entry].";
the rule succeeds;
repeat through table of scenery:
if found entry is 0 and diffic entry is alfhint:
if temp is 0:
say "[if temp is 0]You look at the list and see something where you could probably figure out directions to go, if not the order: [else], [end if][descrip entry]";
increment temp;
if temp > 0:
if temp is 1 and found corresponding to a tally of "wenewenew" in table of scenery is 0:
say "[one of], which looks long, but the clue [one of]may help[or]looks symmetrical, hmm[stopping][or][stopping].";
else:
say "[if temp > 1]. This is one of [temp in words] such left[end if].";
the rule succeeds;
let temp be found corresponding to a tally of "dense" in table of scenery;
if temp is 0:
say "You feel a bit less foggy--thick--realizing you could figure the directions to the overpopulated area. The order...it can't be TOO hard.";
the rule succeeds;
let temp be found corresponding to a tally of "dunse" in table of scenery + found corresponding to a tally of "swune" in table of scenery;
if temp < 2:
say "Hm. There's [if temp is 0]those[else]that[end if] stupid misspelled very twisty one[if temp is 0]s[end if], near. But--you can work out what direction you don't have to go. That must be a help.";
the rule succeeds;
let temp be found corresponding to a tally of "seduse" in table of scenery;
if temp is 0:
say "That 'riskay' night club is alluring--no, not that way, just--you think you see which way you'd need to double back.";
the rule succeeds;
let temp be found corresponding to a tally of "ensue" in table of scenery;
if temp is 0:
say "You just sort of let it happen, and you think you see the ways to get to the kinda near place at 546. The order...it can't be TOO hard.";
the rule succeeds;
let temp be found corresponding to a tally of "sweenee" in table of scenery;
if temp is 0:
say "You recall the misspelled hot dog stand. It was somewhere else before, you're sure.";
the rule succeeds;
let temp be found corresponding to a tally of "sundew" in table of scenery;
if temp is 0:
say "Hmm. The plant. Six twisty, six places to go. It'll be a tangle to get there, having to go every which way--but that cuts down the possibilities. You think.";
the rule succeeds;
let temp be found corresponding to a tally of "sudden" in table of scenery;
if temp is 0:
say "Hm, the BANG is kind of like the Scandinavian vacation, but probably not the same letters. Maybe you can work it out.";
the rule succeeds;
let temp be found corresponding to a tally of "deseesed" in table of scenery;
if temp is 0:
say "You reflect on the symmetry of life, how you arrive and leave helpless--if you are lucky--despite all medical advances.";
the rule succeeds;
let temp be found corresponding to a tally of "dedududu" in table of scenery;
if temp is 0:
say "You whistle four notes as you think about what that police clue could possibly mean.";
the rule succeeds;
let temp be found corresponding to a tally of "newwessewn" in table of scenery;
if temp is 0:
say "You remember some sort of weird suburb that sounded posh, back when you were working through your tasks for Ed. What was it? It's--well, it's not too twisty to get there. You probably can figure how to start. Maybe you should [if set to abbreviated room descriptions]de-zone-out[else]listen a bit more to[end if] the announcements.";
the rule succeeds;
let temp be found corresponding to a tally of "senessense" in table of scenery;
if temp is 0:
say "You feel you must be going senile, not knowing how those three letters misspell an old folks['] home.";
the rule succeeds;
say "Well, this kind of stinks. You're on a real cold streak. Maybe you can figure what to do by looking at your list. Maybe somewhere will make sense that didn't before you found a few other places. The list's getting pretty alphabetized.";
the rule fails;
this is the try-ed-hint rule:
let bool be false;
let found-this-time be 0;
unless cheat-ticker is true:
if taskdone < 3:
increment zero-ticker;
if zero-ticker > 2:
say "[one of]You flash back to Ed Dunn's voice booming through your head: 'It's not just where you go but how you get there!' Maybe you can try hitting some of the nearer locations until something turns up[or]You remember nightmares, from when you were a kid, of going one way then back to somewhere totally different[cycling].";
now zero-ticker is 0;
the rule succeeds;
the rule fails;
if plus-ticker >= 15:
now plus-ticker is 0;
now base-hint-count is 0;
else:
the rule fails;
if taskdone < 7:
say "Frustrating. Maybe if you can pick off some of the nearer tasks in the same location, others will open up[one of][or]. Come to thik of it, you COULD brute force it. But that'd be a lot of walking[stopping].";
the rule succeeds;
if edtasks + pals + force-ed-point is number of rows in table of findies:
say "You're not sure what you're flailing around for. Time to see Ed Dunn.";
the rule succeeds;
let acro be found corresponding to a tally of "Edu" in table of findies + found corresponding to a tally of "Dns" in table of findies + found corresponding to a tally of "Nes" in table of findies;
if acro < 3:
say "[ed-stat] is babbling [if acro is 2]a[else]some[end if] three-letter acronym[unless acro is 2]s[end if] you feel half guilty for not understanding. Or not liking and not using. You know you've heard [if acro is 2]it[else]them[end if] before, though.";
the rule succeeds;
let sewing be found corresponding to a tally of "Sew" in table of findies + found corresponding to a tally of "Sewn" in table of findies + found corresponding to a tally of "Sewed" in table of findies;
if sewing < 3:
say "You wonder if you can thread the needle [if sewing is 2]once more[else if sewing is 1]again[else]somehow[end if] through the streets to mark off a quick task of Ed's.";
the rule succeeds;
consider the plural-almost rule;
if the rule succeeded:
the rule succeeds;
let eeds be found corresponding to a tally of "Seeds" in table of findies + found corresponding to a tally of "Deeds" in table of findies + found corresponding to a tally of "Weeds" in table of findies;
if eeds < 3:
say "Needs, needs, needs, you mumble to yourself, wondering if there are any you could pick off relatively easily.";
the rule succeeds;
repeat through table of findies:
if diffic entry is deduc and found entry is 0:
if found-this-time > 0:
say ", ";
else:
say "You note you could figure out the directions to take, here: ";
say "[descrip entry]@[sector-num of tally entry]";
increment found-this-time;
if found-this-time > 0:
say ".";
the rule succeeds;
if found corresponding to a tally of "Wendee" in table of findies is 0:
if found corresponding to a tally of "Uwe" in table of findies is 1 or task-list is super-alpha:
now bool is true;
say "You [if bool is true]are[else]can be pretty[end if] sure of the first letter of that frieend far away";
if found corresponding to a tally of "Uwe" in table of findies is 0 and task-list is not super-alpha:
say "--but the friend at 544 may help narrow things down";
say ".";
the rule succeeds;
if task-list is super-alpha:
repeat through table of findies:
if diffic entry is alfhint and found entry is 0:
if found-this-time > 0:
say ", ";
else if found-this-time < 6:
say "You note you could figure out the directions to take, here, now that the list was reorganized: ";
increment found-this-time;
say "[descrip entry]@[sector-num of tally entry]";
if found-this-time > 0:
say ".";
the rule succeeds;
let nunes be found corresponding to a tally of "Nudes" in table of findies + found corresponding to a tally of "Dunes" in table of findies + found corresponding to a tally of "Dudes" in table of findies;
if nunes < 3:
say "[one of][ed-stat] ranting against his rival. Nunes, Nunes, Nunes[or]You wonder why Ed Dunn hated Nunes so much[stopping].";
the rule succeeds;
let uns be found corresponding to a tally of "Unused" in table of findies + found corresponding to a tally of "Unwed" in table of findies + found corresponding to a tally of "Unseen" in table of findies;
if uns < 3:
say "Static from the teleport device has Ed ranting. ";
if found corresponding to a tally of "Unused" in table of findies is 0:
say "Being worn out. ";
if found corresponding to a tally of "Unseen" in table of findies is 0:
say "Being overexposed. ";
if found corresponding to a tally of "Unwed" in table of findies is 0:
say "Being married. ";
say "[if uns is 1]V[else if uns is 2]Both v[else]All v[end if]ery un-Ed.";
the rule succeeds;
if found corresponding to a tally of "Senses" in table of findies is 0:
say "[ed-stat] motivational-speaking about how some people are more receptive to hearing, some to seeing, some to feeling.";
the rule succeeds;
if found corresponding to a tally of "Wedded" in table of findies is 0:
say "[one of]A very ecological limo tied with balloons and recyclable tin cans rattles by just as you pop back[or]You cringe, hoping that that limo won't reappear[stopping].";
the rule succeeds;
let dudsy be found corresponding to a tally of "UsedDuds" in table of findies + found corresponding to a tally of "NewDuds" in table of findies;
if dudsy < 2:
say "[ed-stat] jabbering about building on [if dudsy is 1]one more thing[else]a couple things[end if] you previously [dudsdid] to think bigger.";
the rule succeeds;
if found corresponding to a tally of "Seeweed" in table of findies is 0:
say "[ed-stat] claiming [one of]Deedee likes the healthy stuff and the fried stuff. Gee[or]the green food he wants for his party is very un-, un-, hmm, no, that's not it. It's--organic, an extension of one concept, or a useful combination of two others[or]that DeWeese fellow is a culinary genius[cycling].";
the rule succeeds;
if found corresponding to a tally of "Weenees" in table of findies is 0:
say "[ed-stat] claiming that one hot dog hut owner is really on the level. His prices don't fluctuate up and down. Apparently the guy overuses apostrophe's as well as vowels.";
the rule succeeds;
say "Well, this kind of stinks. You're on a real cold streak. Maybe you can figure what to do by looking at your list. Maybe somewhere will make sense that didn't before you found a few other places[random-hint].";
the rule fails;
to say ed-stat:
say "[one of]Weird! Static from your transporter device. [or]You overhear, over static from your transporter, [stopping]Ed Dunn"
to say dudsdid:
if found corresponding to a tally of "Duds" in table of findies is 0:
say "could've done";
else:
say "did"
to say random-hint:
increment hint-iter;
if task-list is alpha and hint-iter is 3:
now hint-iter is 0;
say ". Or maybe you could take Ed Dunn up on his offer of help";
to decide which number is the sector-num of (i - indexed text):
let q be i in lower case;
let z be 444;
increase z by number of times q matches the text "e" - number of times q matches the text "w";
increase z by 10 * (number of times q matches the text "n" - number of times q matches the text "s");
increase z by 100 * (number of times q matches the text "u" - number of times q matches the text "d");
decide on z;
chapter transport tubes
the transport tubes are a backdrop. the transport tubes are everywhere. "It's rude to stare while people zoom up and down."
instead of doing something other than examining transport tubes:
if current action is entering:
say "But which way? Up or down?" instead;
say "The tubes aren't worth thinking much about. You just need to get places."
chapter going
instead of exiting:
say "Out? Of Threediopolis? You would be arrested for absconding with that package sooner or later.";
to dirsmack:
say "In these efficient days, people find using more than one letter for a direction too flowery.[line break]";
before going (this is the don't waste my time with all those extra letters already now rule):
if word number 1 in the player's command in lower case is "go":
say "In these sped-up days, the word 'go' is superfluous. Unless you are in charge, like Ed Dunn.'" instead;
if the player's command matches the regular expression "(north|south|east|west|up|down)", case insensitively:
dirsmack instead;
chapter no noun needed
Rule for printing a parser error when the latest parser error is the only understood as far as error: [I can't do better as "[word number 1]" comes up blank]
say "That command doesn't need more than one letter. You may wish to retry without the second word.";
chapter blank parser
Rule for printing a parser error when the latest parser error is the can't see any such thing error:
repeat through table of scenery:
if your-tally is tally entry:
say "Whatever you just saw is gone now--thankfully, it wasn't critical, even though it was kind of interesting.";
the rule succeeds;
say "Nothing like that is here[if number of visible quasi-entries > 0], and you don't need to observe any landmarks in detail, just (k)nock or go (i)n[end if][one of]. If you just saw something in the background, it was there for local flavor[or][stopping][if player has book][one of]. Plus, your score goes up when you find scenery, now[or][stopping][end if].";
the rule succeeds;
hint-index is a number that varies.
max-skips is a number that varies. max-skips is 4.
skip-index is a number that varies. skip-index is 1.
to decide which number is ronum of (iitt - indexed text):
let locom be iitt in lower case;
let j be character number 1 in locom;
if j is "d", decide on 1;
if j is "e", decide on 2;
if j is "n", decide on 3;
if player has task-list and task-list is super-alpha:
if j is "u", decide on 6;
if j is "w", decide on 7;
if character number 2 in locom is "e", decide on 4;
decide on 5; [SE = 4, S* = 5]
if j is "s", decide on 4;
if j is "u", decide on 5;
if j is "w", decide on 6;
decide on 0;
Rule for printing a parser error when the latest parser error is the I beg your pardon error:
let cur-row be 0;
let cur-row-2 be 0;
let skips-so-far be 0;
let poss-skips be max-skips;
let remainin be number of rows in table of findies - (edtasks + pals + force-ed-point);
if bm-mode is true:
say "It's hard to plan ahead with the suspicious guy all in your personal space. Type 0 to see a list of conversation choices." instead;
if player has book:
now remainin is secs - eggsfound;
if poss-skips > remainin:
now poss-skips is remainin;
if poss-skips is 0:
if the door to the sneed house is visible or door to ed is visible:
say "You've got nothing else to do. You really should walk in." instead;
say "You hesitate, noting you have nothing left to do on your list. You probably want to go [if player has book]visit the Sneeds[else]back to Ed Dunn[end if] now." instead;
if scen-look-mode is true or look-mode is true:
say "The telescope is too distracting! It's so much higher-tech than your list, but you can leave by typing 0." instead;
if there is a visible quasi-entry:
if your-tally is not "see" and your-tally is not "EdDunn" and your-tally is not "sneeds":
say "Something's right here! You can just [if front door is visible]knock[else]go in[end if]." instead;
say "There's something nearby, but you still pick something at random from your notes.";
increment skip-index;
if skip-index > poss-skips:
now skip-index is 1;
debug-say "Note: wrapping.";
if debug-state is true:
say "DEBUG: [skip-index] index, [poss-skips] possible skips, [max-skips] max skips, [remainin] remaining.";
if player has book:
repeat with disnum running from 3 to 10:
repeat through table of scenery:
increment cur-row;
if number of characters in tally entry is disnum and found entry is 0:
increment skips-so-far;
if skips-so-far is skip-index:
say "[what-next]. Hmm... '[descrip entry] at [sector-num of tally entry]' in row [ronum of tally entry] looks (relatively) not too bad. ";
if twistx is false:
say "[line break]" instead;
now skips-so-far is 0;
repeat with twi running from 1 to 6:
repeat through table of scenery:
increment cur-row-2;
if twistiness entry is twi and found entry is 0:
increment skips-so-far;
if skips-so-far is skip-index:
say "[if cur-row-2 is cur-row]It also looks not-too-twisty[else]Also, '[descrip entry]' at [sector-num of tally entry] is not too twisty[end if].";
the rule succeeds;
if task-list is not super-alpha:
repeat through table of findies:
if found entry is 0:
increment skips-so-far;
if skips-so-far is skip-index:
say "[what-next]. Hmm... '[descrip entry] at [sector-num of tally entry]' is as good as any. It is [nearness of tally entry]." instead;
repeat with disnum running from 3 to 8:
repeat through table of findies:
if number of characters in tally entry is disnum and found entry is 0:
increment skips-so-far;
if skips-so-far is skip-index:
say "[what-next]. Hmm... '[descrip entry] at [sector-num of tally entry]' in row [ronum of tally entry] is as good as any. It is [nearness of tally entry]." instead;