-
Notifications
You must be signed in to change notification settings - Fork 0
/
pygmentalion.t
3898 lines (3711 loc) · 133 KB
/
pygmentalion.t
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
#charset "utf-8"
// SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
/*
Copyright 2014, 2022, 2023, 2024 David Corbett
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
Copyright 2014, 2022, 2023, 2024 David Corbett
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <adv3.h>
#include <bignum.h>
#include <en_us.h>
extern function extern_function;
extern method extern_method;
extern function extern_function(a, b=a, c='<<a>>', d:, e:=1, f?, ...);
extern method extern_method(a, b=a, c='<<a>>', d:, e:=1, f?, [g]);;
extern class extern_class;
extern object extern_object;
intrinsic 't3vm' { };
#ifndef PropDefAny
intrinsic class Object 'root-object/030004' { };
#endif
object /**//**/ // /* \\
#define Room Unthing
template [lst];
/*
* Quotations from "Le Roman de la Rose" are transcribed from MS. Douce 195,
* owned by Bodleian Library, University of Oxford
* (https://digital.bodleian.ox.ac.uk/objects/bb971cd2-a682-45e5-866f-31ce76482afe/).
*/
versionInfo: GameID
IFID = '17D8EFC3-07DA-4DDE-A837-FF7C4E386A77'
name = 'Pygmentalion'
headline = 'An Interactive Romance'
byline = 'by David Corbett'
htmlByline = 'by <a href="mailto:corbett.dav\100northeastern.edu">David
Corbett</a>'
version = '2'
authorEmail = 'David Corbett\040<corbett.dav\x40northeastern.edu>'
desc = 'Colors gleam and fade as her wardrobe runs the gamut, but she
remains pale and lifeless. Though she is a statue carved by your own
hand, you love her more than anything. If only she could live and love
you too.\\nPygmentalion is a short game originally designed to provide
an example file for the syntax highlighter Pygments.'
htmlDesc = 'Colors gleam and fade as her wardrobe runs the gamut, but she
remains pale and lifeless. Though she is a statue carved by your own
hand, you love her more than anything. If only she could live and love
you too.<p><i>Pygmentalion</i> is a short game originally designed to
provide an example file for the syntax highlighter <a
href="https://pygments.org/">Pygments</a>.'
firstPublished = '2014-10-08'
forgivenessLevel = 'Merciful'
gameUrl = 'http://github.com/dscorbett/pygmentalion'
copyingRules = 'Other; Compilations Allowed'
presentationProfile = 'Multimedia'
showAbout()
{
"This is a short game originally designed to provide an example file
for the syntax highlighter <<externalLink('https://pygments.org/',
'Pygments')>>.\b
Scattered throughout the game are highlighted words corresponding to
syntactic token types. Finding them increases your score but is not
necessary to beat the game. Some are easy to find, but these are the
<<highlightToken('exception')>> rather than the rule. Many are hidden
and some may become unavailable as the story progresses.\b
The command CALCULATE may be abbreviated as C. For more commands, type
<<aHref('help', 'HELP')>>.\b
For hints, <<aHref('pray to Iris', 'PRAY TO IRIS')>>.
<!-- For clues, ask Ariadne. -->";
}
showCredit() {
"Credit goes to Pygments for providing the excuse to write this game.
The story was loosely inspired by a section of <<externalLink(
'https://digital.bodleian.ox.ac.uk/objects/bb971cd2-a682-45e5-866f-<<
>>31ce76482afe/', iOrQ('Le Roman de la Rose'))>>. For license and
copyright information, type <<aHref('license', 'LICENSE')>>. ";
}
;
/*
* Pymalıon fu ētaılleꝛꝛes.
* Poᷣtrayās en fus ⁊ en peꝛꝛeˢ
* En metaulx en os ⁊ en cyꝛes
* Et en touteˢ aultres matıres.
* Quon peult a tel oeuure trouuer.
* Poᷣ ſon grant engin eſpꝛouuer.
* Car maıſtre en fu bıen ꝺıre loz.
* Ainſı com poᷣ acquerre loz.
* Se voult a poᷣtraıre ꝺeẟuyꝛe.
* Sı fıſt vng ymage ꝺiuuyꝛe.
* Et miſt au faıre tel entente.
* Quel fu ſı plaıſāt et ſı gente.
* Quel ſembloıt eſtre auſſı viue.
* Com la plus belle rıens qͥ viue
* (MS. Douce 195, fol. 149r)
*/
gameMain: GameMainDef
initialPlayerChar: Actor {
vocabWords = 'Pygmentalion'
desc
{
"Your calm exterior belies the tempestuous feelings within. You are
currently <<feelings[rand_feeling_index_box_muller]>> ";
}
location = entrance
rand_feeling_index_box_muller
{
local u1 = (rand(99) + 1) / 100.0;
local u2 = rand(100) / 100.0;
local std_dev = 6.0;
local tolerance = 1.3;
local magnitude = std_dev * (-2.0 * u1.logE()).sqrt();
local mean = (feelings.length - 1 - tolerance * std_dev)
* libScore.totalScore / gameMain.maxScore
+ 1 + std_dev * tolerance / 2;
local z0 =
magnitude * (BigNumber.getPi(3) * 2.0 * u2).cosine() + mean;
return z0 < 1
? 1
: z0 > feelings.length
? feelings.length
: toInteger(z0);
}
feelings = [
'angry at the uncaring Fates.',
'bitter about how unfair everything is.',
'feeling tormented.',
'feeling harrowed by your tragic life.',
'in a panic that she will never love you.',
'in despair: she will never be able to love you.',
'jealous. What if someone sneaks into the studio and she loves him
instead?',
'jealous. What if someone peeks through the window and sees her?',
'feeling frustrated.',
'dejected.',
'in a blue funk.',
'exhausted and drained.',
'full of self-pity.',
'pessimistic.',
'lonely.',
'racked with doubts.',
'wincing at how desperate she must think you.',
'uneasy.',
'feeling sick of eating chopped liver every day.',
'embarrassed about loving a statue.',
'nervous about loving a living woman.',
'musing upon your statue. Where can you find a woman like that?',
'wondering how much longer you can buy such expensive gifts before
your credit runs out.',
'considering your plight with remote detachment.',
'running through what-if scenarios.',
'hoping a passing god might deign to metamorphose you into a
statue.',
'daydreaming about your most recent date.',
'feeling tentatively hopeful.',
'optimistic.',
'learning that life is okay.',
'daydreaming about your next date.',
'brainstorming dress patterns.',
'mentally composing an ode to her beauty.',
'determined to make this relationship work.',
'pleased with your progress so far.',
'smiling, thinking of her pretty face.',
'counting the ways you love her.',
'planning your wedding.',
'thinking about your future children.',
'grateful to the benevolent eudaemons.',
'feeling happy.',
'giddy with excitement.',
'euphoric due to infatuation.',
'thinking about how much you love her.'
]
dobjFor(GiveTo)
{
verify
{
if (gIobj == statue)
/*
* Oꝛ ſuys par ceſte mal baıllys.
* Par le meſt tout lı ſēs faıllys.
* Las ꝺont me vint ceſte penſee.
* Cōme fu telle amour bꝛaſcee.
* (MS. Douce 195, fol. 149r–149v)
*/
illogicalAlready('{You/He} {have} already given {yourself}
to {that iobj/her}. {You/He} {were} {its iobj/hers}
from the moment {you/he} first saw {that iobj/her}. ');
else
nonObvious;
}
}
}
showIntro
{
/*
* Bıen le cuıẟay lācer de bout.
* Maıs ıl reſſoꝛt ⁊ ıe rebout.
* Ce rıēs ny vault touſıoᷣˢ recule.
* Ny pot entrer poᷣ choſe nulle.
* [...]
* Troys foız hurta.iij.foız faıllıt.
* Troys foız a ſa poꝛte aſſaıllıt.
* Troys foız ſaſſıſt en la vallee.
* Tout las poᷣ pꝛenꝺꝛe allenee.
* (MS. Douce 195, fol. 155r)
*/
"Ivory— Horn— Ivory— You push on the gates separating
you from your beloved, but they do not budge.
<.p>Darkness— Light— Darkness— Colors gleam and fade
as her wardrobe runs the gamut, but she remains pale and lifeless.
Though she is a statue carved by your own hand, you love her more than
anything. If only she could live and love you too.
<.p>You pound again on the ivory gate, and as you do—
<.p>You awake in your studio. Perhaps this is the day your prayers will
be answered.\b
<b><<versionInfo.name>></b>\n
Copyright 2014, 2022, 2023, 2024 <<versionInfo.byline>>\n
Version <<versionInfo.version>>\b
<.notification>First-time players should type <<aHref('about',
'ABOUT')>>. Those unfamiliar with interactive fiction in general should
type <<aHref('help', 'HELP')>>. See also <<aHref('credits',
'CREDITS')>>.<./notification>\b";
}
setAboutBox
{
"<aboutbox><center>
<b><<versionInfo.name.toUpper()>></b>\b
Version <<versionInfo.version>>\b
Copyright 2014, 2022, 2023, 2024 <<versionInfo.byline>>
</center></aboutbox>";
}
;
enum token token, tokOp, token;
modify cmdTokenizer
rules_ = static
[
['whitespace', new RexPattern('%s+'), nil, &tokCvtSkip, nil],
['punctuation', new RexPattern('[.,;:?!]'), tokPunct, nil, nil],
['spelled number',
new RexPattern('<NoCase>(twenty|thirty|forty|fifty|sixty|'
+ 'seventy|eighty|ninety)-'
+ '(one|two|three|four|five|six|seven|eight|nine)'
+ '(?!<AlphaNum>)'),
tokWord, &tokCvtSpelledNumber, nil],
['spelled operator', new RexPattern(
'<NoCase>(plus|positive|minus|negat(iv)?e|not|inverse(%s+of)?|'
+ 'times|over|divided%s+by|mod(ulo)?|and|xor|or|[al]?sh[lr])'
+ '(?!<AlphaNum>)'),
tokOp, &tokCvtSpelledOperator, nil],
['operator', R'[-!~+*/%&^|]|<<|>>>?', tokOp, nil, nil],
['x', R'[xX](?=%d)', tokWord, &tokCvtSpelledOperator, nil],
['word', new RexPattern('<Alpha|-|&><AlphaNum|-|&|squote>*'),
tokWord, nil, nil],
['string ascii-quote', R"""<min>([`\'"])(.*)%1(?!<AlphaNum>)""",
tokString, nil, nil],
['string back-quote', R"<min>`(.*)'(?!%w)", tokString, nil, nil],
['string curly single-quote', new RexPattern('<min>\u2018(.*)\u2019'),
tokString, nil, nil],
['string curly double-quote', new RexPattern('<min>\u201C(.*)\u201D'),
tokString, nil, nil],
['string unterminated', R'''([`\'"\u2018\u201C](.*)''', tokString,
nil, nil],
['integer', new RexPattern('[0-9](,?[0-9])*'), tokInt, &tokCvtInt,
nil]
]
replace tokCvtSpelledOperator(txt, typ, toks)
{
toks.append([rexReplace(R'%s+', txt.toLower(), '\\'), typ, txt]);
}
tokCvtInt(txt, typ, toks)
{
toks.append([txt.findReplace(',', ''), typ, txt]);
}
;
externalLink(href, txt)
{
local linksHttp =
#ifdef TADS_INCLUDE_NET
true
#else
systemInfo(SysInfoLinksHttp) == 1
#endif
;
if (linksHttp)
return '<a href="<<href.htmlify>>" target=_blank><<txt>></a>';
return '<<txt>> (<<href.htmlify>>)';
}
iOrQ(txt)
{
local element = outputManager.htmlMode ? 'i' : 'q';
return '\x3C<<element>>><<txt>></<<element>>>';
}
ul(plain, [items])
{
local s = new StringBuffer;
if (!outputManager.htmlMode)
s.append('\b');
s.append('<ul');
if (plain)
s.append(outputManager.htmlMode
? ' style="list-style-type: none"'
: ' plain');
s.append('>');
for (local item in items)
{
if (!outputManager.htmlMode)
s.append('\t');
s.append('<li>');
if (outputManager.htmlMode)
s.append(item);
else
{
s.append(
rexReplace(['<li>', R'\b(?=<ul%b)', R'(?<=</ul>)\b'],
item, ['\t%*', '\n']));
s.append('\n');
}
}
s.append('</ul>');
if (!outputManager.htmlMode)
s.append('\b');
return toString(s);
}
/* Tokens */
/*
* Puiˢ li reueſt en maīteˢ guıſes.
* Robeˢ faıcteˢ ꝑ grāˢ maıſtrıſeˢ.
* De bıaulx ꝺꝛaps ẟe ſoye ⁊ ꝺe laīe.
* Deſcarlate ꝺe tıretaine.
* De vert ꝺe pers ⁊ ẟe bꝛunecte
* De couleᷣ freſche fine ⁊ necte.
* Ou moult a rıches paneˢ mıſes.
* Herminees vaıres et griſes
* Puis les lı roſte puis reſſaye.
* Cōmant lı ſıet robbe de ſaye
* Senꝺaulx meloguins galebꝛunˢ.
* Inꝺes vermeılz ıaunes ⁊ bꝛunˢ.
* [...]
* Aultre foız luy repꝛēẟ courage.
* De tout oſter ⁊ mectre guinꝺeˢ.
* Iaunes vermeılles vers ⁊ inꝺeˢ.
* (MS. Douce 195, fol. 150r)
*/
class Token: Achievement, InitObject
{
points = 1;
desc = "<<before_>><<desc_>><<after_>>";
before = before = '', before_
after = (after = '', after_)
#ifndef TADS_INCLUDE_NET
execute()
{
local textColors = systemInfo(SysInfoTextColors);
// Gargoyle falsely claims to support RGB, but it does not even support
// swapping foreground and background colors.
if (textColors == SysInfoTxcRGB
&& systemInfo(SysInfoOsName) == 'Gargoyle')
textColors = SysInfoTxcNone;
if (textColors != SysInfoTxcRGB)
{
if (textColors != SysInfoTxcNone && systemInfo(SysInfoBanners))
{
before_ = '<font color=bgcolor bgcolor=text>';
after_ = '</font>';
}
else
{
// If banners are not supported, assume this is plain mode,
// which falsely claims that `systemInfo(SysInfoTextColors) ==
// SysInfoTxcAnsiFgBg`.
before_ = '<b>[[';
after_ = ']]</b>';
}
}
}
#endif
}
Token template inherited 'before_' 'after_' 'desc_';
#define DoTokens \
DoToken(builtin, '<font color=green><u>', '</u></font>') \
DoToken(comment, '<i><font color=#408080>', '</font></i>') \
DoToken(decorator, '<font color=#aa22ff><u>', '</u></font>') \
DoToken(error, '<FONT COLOR=RED><U>', '</U></FONT>') \
DoToken(escape, '<b><font color=#bb6622>', '</font></b>') \
DoToken(exception, '<b><font color=#D2413A>', '</font></b>') \
DoToken(float, '<font color=gray><u>', '</u></font>') \
DoToken(keyword, \
'<b><font face=TADS-Sans,sans-serif color=green>', '</font></b>') \
DoToken(label, '<font color=#A0A000><u>', '</u></font>') \
DoToken(long, '<i><font color=gray>', '</font></i>') \
DoToken(name, '<u>', '</u>') \
DoToken(number, '<font color=#666666><u>', '</u></font>') \
DoToken(operator, '<b><font color=\"#AA22FF\">', '</font></b>') \
DoToken(string, '<font color=\'#BA2121\'><u>', '</u></font>') \
DoToken(whitespace, \
'''<font <<if systemInfo(SysInfoOsName) == 'Spatterlight'>> \
color=white bgcolor=black \
<<else>> \
color="bgcolor"bgcolor=\'text\' \
style="color: white; background-color: black" \
<<end>>>''', '</font>') \
#define DoToken(name, before, after) name##Token: Token before after #@name;
DoTokens
#undef DoToken
#define DoToken(name, before, after) #@name -> name##Token,
highlightTokenOutputFilter: OutputFilter, InitObject
tagPattern = R'<nocase><langle>!token<rangle>(.*?)<langle>!/token<rangle>'
tokenMap = [
DoTokens
* -> nil
]
execute
{
mainOutputStream.addOutputFilter(self);
}
filterText(ostr, val)
{
local match;
local index = 1;
while ((match = rexSearch(tagPattern, val, index)) != nil)
{
local inputTokenString = rexGroup(1)[3];
local outputTokenString;
local token = tokenMap[
rexReplace(R'<^AlphaNum>+', inputTokenString.toLower(), '')];
if (!token)
outputTokenString = inputTokenString;
else
{
token.awardPointsOnce();
outputTokenString =
'<<token.before>><<inputTokenString>><<token.after>>';
}
local val0 = val.substr(1, match[1] - 1) + outputTokenString;
index = val0.length() + 1;
val = val0 + val.substr(match[1] + match[2]);
}
return val;
}
;
function highlightToken(tokenString)
{
return '<!token><<tokenString>><!/token>';
}
string /**//**/ // /* \\
#define Room Unthing
template <<highlight *>> highlightToken;
/* Grammar for materials */
dictionary property materialWord;
grammar adjWord(materialWord): <materialWord materialWord>->adj_
: AdjPhraseWithVocab
getVocabMatchList(resolver, results, extraFlags)
{
return getWordMatches(adj_, &materialWord, resolver, extraFlags,
VocabTruncated);
}
getAdjustedTokens()
{
return [adj_, &materialWord];
}
;
/* Rooms and objects */
+ property location;
entrance: Room 'Studio Entrance'
"Your studio is where you create great works of art, though you have made
nothing since you carved that statue. This corner, which now serves as your
bedroom and dining room, is the entrance to the building. A door leads
outside, and the studio itself is to the north and the east. "
north = workbenchRoom
northeast = sinkRoom
east = altarRoom
south = door
out asExit(south)
roomParts = (roomParts = inherited() - [defaultNorthWall, defaultEastWall])
;
+ door: LockableWithKey, Door 'door' 'door'
"It is a simple wooden door. "
materialWord = 'wood' 'wooden'
keyList = [key]
cannotOpenLockedMsg = '{The dobj/He} {is} locked. <<first time>>In {your}
distracted state, {you/he} must have misplaced the key. <<only>>You
cannot <<highlight 'escape'>>!<<breakingWouldBeUseful = true, nil>> '
;
+ campBed: Bed '(camp) bed' 'camp bed'
"It is a narrow portable camp bed. You brought it into the studio so you
would not have to leave the statue every night. "
bulk = 10
;
+ endTable: Surface 'end table*tables' 'end table'
"It’s a small portable table. "
bulk = 10
;
++ coinBox: OpenableContainer, RestrictedContainer
'(coin) box/pyx/pyxis' 'coin box'
"This small round box is where you keep your coins, when you have any. "
bulk = 5
iobjFor(PutIn) {
check
{
failCheck('{You/He} {can} only put coins in the coin box. ');
}
}
lookInDesc_ = 'empty. Maybe next time {you/he} check{s}, {it dobj/he} will
contain a coin. {You/He} can only hope'
lookInDesc = "\^<<itIsContraction>> <<lookInDesc_>>. "
openStatus
{
return isOpen ? '<<inherited>> and <<lookInDesc_>>' : inherited;
}
;
++ wineBottle: Thing 'dark sea sea-dark seadark bottle/wine' 'bottle of wine'
"It’s a bottle of sea-dark wine. "
aNameObjShort = (getFacets()[1].aNameObjShort)
getFacets() { return [waterBottle]; }
bulk = (getFacets()[1].bulk)
dobjFor(Taste)
{
preCond = (inherited() + objHeld)
action
{
local loc = location;
"{You/He} take{s} a sip and realize that this is not sea-dark wine
after all. It is just seawater. ";
moveInto(nil);
waterBottle.moveInto(loc);
}
}
dobjFor(Drink) remapTo(Taste, DirectObject)
dobjFor(Pour)
{
preCond = (inherited() + objHeld)
verify { }
check
{
failCheck('That would be a waste of good wine. ');
}
}
dobjFor(PourInto)
{
remap
{
local iobj = gIobj ?? gTentativeIobj;
return iobj != nil && (iobj.ofKind(WaterContainer) || iobj == self)
? inherited()
: [PourAction, DirectObject];
}
preCond = (inherited() + objHeld)
verify
{
if (self == gIobj)
illogicalSelf('{You/He} {can\'t} pour {that dobj/him} into
{itself}. ');
}
check
{
failCheck('That would be a waste of good wine: {the iobj/he} {is}
not a krater. ');
}
}
dobjFor(PourOnto) remapTo(PourInto, DirectObject, IndirectObject)
iobjFor(PutIn)
{
verify
{
illogical('The bottle is already full of wine. ');
}
}
;
waterBottle: Thing
'dark sea wine-dark winedark bottle/seawater/water'
'bottle of <<if salty>>sea<<end>>water'
"It’s a bottle of <<if salty>>wine-dark sea<<end>>water. "
aNameObjShort = (getFacets()[1].aNameObj)
getFacets() { return [bottle]; }
bulk = (getFacets()[1].bulk)
pourVolume = 163 // 750 ml - 1 sip
salty = true
dobjFor(Taste)
{
action
{
if (salty)
"{It dobj/He} taste{s} salty. ";
else
inherited();
}
}
dobjFor(Drink)
{
preCond = []
verify { }
check
{
if (salty)
failCheck('That would be disgusting. ');
else
failCheck('{You\'re} not thirsty. ');
}
}
dobjFor(Pour)
{
preCond = (inherited() + objHeld)
verify { }
check
{
failCheck('That would make a mess. ');
}
}
dobjFor(PourInto)
{
remap { return delegated wineBottle; }
preCond = (inherited() + objHeld)
verify { return delegated wineBottle; }
action
{
bottle.moveInto(location);
moveInto(nil);
}
}
dobjFor(PourOnto) remapTo(PourInto, DirectObject, IndirectObject)
iobjFor(PutIn)
{
verify
{
illogical('The bottle is already full of water. ');
}
}
;
bottle: RestrictedContainer 'bottle' 'bottle'
"It’s an empty bottle made of translucent amber glass. "
getFacets() { return [waterBottle]; }
bulk = 5
maxSingleBulk = 0
canPutIn(obj)
{
return obj.ofKind(Water);
}
cannotPutInMsg(obj)
{
return '\^<<nameIs>> for liquids only. ';
}
dobjFor(Drink)
{
verify
{
illogical('{The dobj/He} {is} empty. ');
}
}
dobjFor(Pour) remapTo(Drink, DirectObject)
dobjFor(PourInto) remapTo(Drink, DirectObject)
dobjFor(PourOnto) remapTo(Drink, DirectObject)
iobjFor(PutIn)
{
check
{
if (gDobj.bulk > maxSingleBulk)
/*
* Par la ſentelle q̄ ıay dıcte.
* Quı tāt ert eſtroıcte et petıte.
* (MS. Douce 195, fol. 155r)
*/
failCheck('{The dobj/He} {is} too big to fit through the neck
of {the iobj/him}. ');
else
inherited();
}
action
{
if (gDobj.ofKind(FloorWater) || gDobj.location.level < 1000)
"{The dobj/He} {is} too shallow for {you/him} to get any of it
into {the iobj/him}. ";
else
{
"{You/He} fill{s} {the iobj/him} with water. ";
gDobj.location.setLevel(
level: gDobj.location.level - waterBottle.pourVolume);
local loc = location;
moveInto(nil);
waterBottle.salty = nil;
waterBottle.moveInto(loc);
}
}
}
;
++ plateOfLiver: Food 'chopped liver plate' 'plate of chopped liver'
"You have been living on chopped liver since you moved into the studio
permanently. It isn’t bad, but it does get monotonous. "
materialWord = 'clay'
getFacets() { return [plate]; }
bulk = (getFacets()[1].bulk)
dobjFor(Eat)
{
preCond = []
action
{
local loc = location;
"{You/He} eat{s} all the liver. The plate will be full again
tomorrow morning though. Somehow, the liver always regenerates
overnight. ";
moveInto(nil);
plate.moveInto(loc);
}
}
;
plate: Thing 'plate' 'plate'
"It is empty, for now. Painted on the clay are images of a hepatos, a
glaukos, and other fish. "
materialWord = 'clay'
bulk = 5
;
key: PresentLater, Key
'(door) clean grime grimy inscription key/tool*keys tools' 'bronze key'
@altar
"It is a <<unless clean>>grimy<<end>> bronze key. <<if clean>>On it is \
etched the word <q><<keyword>></q>. "
materialWord = 'bronze' 'metal'
clean = nil
keyword = (keyword = greekWordGenerator.generate(), targetprop)
getState = (clean ? cleanInscriptionState : grimyState)
allStates = [cleanInscriptionState, grimyState]
dobjFor(CleanWith)
{
action
{
clean = true;
"{You/He} clean{s} {the dobj/him}, revealing an inscription. ";
}
}
;
grimyState: ThingState
stateTokens = ['grime', 'grimy']
;
cleanState: ThingState
stateTokens = ['clean']
;
cleanInscriptionState: cleanState
stateTokens = (inherited() + 'inscription')
;
workbenchRoom: Room 'At the Workbench'
"This workbench, in the northwest part of the studio, was where you would
create works of art. Now you just come here to contemplate your
creation’s beauty, dress her up, ply her with gifts, and lament your
hopeless situation.\b
<<if gActor.setHer(statue)>><<end>>
The statue stands on a plinth beside the workbench<<if
!statue.contentsListedInExamine && statue.contents[1].seen>>, wearing
<<statue.contents[1].aName>><<end>>. "
east = sinkRoom
southeast = altarRoom
south = entrance
roomParts = (roomParts = inherited() - [defaultEastWall, defaultSouthWall])
getDestName(actor, origin) { return 'the workbench'; }
;
+ chair: Chair 'diphros folding chair/okladias/stool' 'stool'
"It’s a portable folding stool, or diphros okladias. "
bulk = 10
;
+ workbench: Chair, Fixture
'bench/workbench' 'workbench'
"Your workbench is usually scattered with tools and materials and
half-finished projects. "
descContentsLister: surfaceDescContentsLister
{
showListPrefixWide(itemCount, pov, parent)
{
"\b";
inherited(itemCount, pov, parent);
}
}
obviousPostures = []
;
++ chisel: Thing 'chisel/tool*tools' 'chisel'
"This is a sharp tool used for carving. "
dobjFor(Attack)
{
check
{
failCheck('{You/He} {is}n’t in the mood for carving anything.
');
}
}
dobjFor(AttackWith)
{
action { replaceAction(Attack, gDobj); }
}
;
/*
* Dune aguılle bıen afılee.
* Dargent ẟe fıl ꝺoꝛ enfılee.
* Lı a pour mieulx eſtˢ veſtue.
* Chūne manche eſtroıt couſue.
* (MS. Douce 195, fol. 150v)
*/
++ needle: Thing 'needle/tool*tools' 'needle'
"This is a sharp tool used for sewing. It is made of silver. "
materialWord = 'metal' 'silver'
bulk = 0
;
/*
* Anneletz ẟoꝛ es ẟoız lı boute.
* (MS. Douce 195, fol. 150v)
*/
++ goldNugget: Thing '(large) nugget' 'gold nugget'
"It is a large nugget of gold that sparkles in the light. You haven’t
decided what to make it into yet. "
materialWord = 'gold' 'golden' 'metal'
;
++ idol: Thing '(aphrodite) (cytherea) (venus) idol/statuette' 'idol'
"It’s a small statuette of Aphrodite carved from meerschaum. "
materialWord = 'meerschaum' 'sepiolite'
bulk = 5
dobjFor(PrayTo) remapTo(PrayTo, aphrodite)
;
+ plinth: Fixture, Thing 'plinth/pedestal' 'plinth'
"It’s a smoothed block of marble half a cubit high. "
materialWord = 'marble'
contentsListedInExamine = nil
;
replace grammar predicate(Screw): ' ': object;
replace grammar predicate(ScrewWith): ' ': object;
replace grammar predicate(Unscrew): ' ': object;
replace grammar predicate(UnscrewWith): ' ': object;
// You're not Archimedes.
+ + statue: Fixture, Surface
'(flawless) (milk-white) "creation\'s" \
beauty/carving/creation/galatea/statue/woman' 'statue'
"This is a<<if nameToken.scoreCount>>n untitled<<end>> statue of a
<<if exceptionToken.scoreCount>>beautiful<<end>> woman carved from
<<if errorToken.scoreCount>>flawless <<end>>
<<if whitespaceToken.scoreCount>>milk-white <<end>>ivory.
<<if escapeToken.scoreCount || longToken.scoreCount>>Her
<<if longToken.scoreCount>>long <<end>>hair is done up in a
chignon<<if escapeToken.scoreCount>>, with a few strands falling down her
neck<<end>><<if floatToken.scoreCount>>, and \v<<else>>. <<end>><<end>>
<<if floatToken.scoreCount>>She radiates an aura of contrapposto grace.
<<end>><.p><<if labelToken.scoreCount || keywordToken.scoreCount ||
decoratorToken.scoreCount || operatorToken.scoreCount ||
builtinToken.scoreCount || commentToken.scoreCount>>You wonder what she
<<if labelToken.scoreCount>>is going to<<else if
keywordToken.scoreCount>>will<<else>>would<<end>> be like as a living
woman. <<if decoratorToken.scoreCount>>Maybe she’<<if
keywordToken.scoreCount>>ll<<else>>d<<end>> be a painter and expand your
business. <<end>>
<<if operatorToken.scoreCount>>Maybe she’<<if
keywordToken.scoreCount>>ll<<else>>d<<end>> have a head for figures and
<<if keywordToken.scoreCount>>will<<else>>would<<end>> put the accounts in
order. <<end>>
<<if builtinToken.scoreCount>>She’<<if
keywordToken.scoreCount>>ll<<else>>d<<end>> love you, obviously, but beyond
that you don’t know. <<else>>Who knows? You can only dream. <<end>>
<<if commentToken.scoreCount>>If only Aphrodite would bring her to life
without this silly puzzle about tokens and mirrors! <<end>>
<<end>><.p><<if !contentsListedInExamine>>She is wearing
<<buildSynthParam('a/him', contents[1])>>. "
materialWord = 'ivory'
contentsListedInExamine =
(contents.length() != 1 || contents[1] != necklace)
propertyset 'is*'
{
propertyset 'H*'
{
im = nil\
er = true;
}
It = true
}
dobjFor(Kiss)
{
check
{
/*
* Car quāt ıe me vueıl a aıſıer.
* Et ꝺacoller et ꝺe baıſıer.
* Ie truis mamye autreſſı roıẟe.
* Cōme eſt.ı.pel et auſſı froıꝺe.
* Car quāt poᷣ la baıſıer y touche.
* Toute me refroıꝺıſt la bouche.
* Ha trop ay parle follemāt.
* Mercy ꝺoulce amye ē ꝺemāẟ.
* (MS. Douce 195, fol. 149v)
*/
failCheck('{The dobj/She} {is} as stiff and cold as a post,
{you/he} know{s} from experience. It would be more satisfying
if {it dobj/she} were alive. Sorry, but it’s true. ');
}
}
dobjFor(Hug)
{
preCond = [actorStanding]
action
{
/*
* Souef a ſes maīs la detaſte.
* Et croıt aınſı ꝯ ſe fuſt paſte.
* Que ce ſoıt ſa char quı lı fuye.
* Maiˢ ceſt ſa main qͥl y appuye.
* (MS. Douce 195, fol. 150r)
*/
"<<one of>>{You/He} hold{s} {the dobj/her} in {your} arms.
The ivory is cold, but as {you/he} linger{s} in a loving
embrace, {you/he} notice{s} {its dobj/her} hand feels different: it
has the warmth and softness of real flesh.
<<if keywordToken.scoreCount>>Aphrodite did it! <<end>>
{The dobj/She} {is} finally coming to life!
<.p>Oh. That was just {your} own hand. Never mind.
<<or>>{The dobj/She} {is} as stiff and cold as a post.
<<stopping>>";
}
}
dobjFor(Feel) remapTo(Hug, DirectObject)
dobjFor(TalkTo)
{
verify { }
action