Debian Codegraph @

terps/tads/tads3/lib/adv3/en_us/msg_neu.t

raw
1 #charset "us-ascii"
2
3 /*
4 * Copyright (c) 2000, 2006 Michael J. Roberts. All Rights Reserved.
5 *
6 * TADS 3 Library - "neutral" messages for US English
7 *
8 * This module provides standard library messages with a parser/narrator
9 * that's as invisible (neutral) as possible. These messages are designed
10 * to reduce the presence of the computer as mediator in the story, to
11 * give the player the most direct contact that we can with the scenario.
12 *
13 * The parser almost always refers to itself in the third person (by
14 * calling itself something like "this story") rather than in the first
15 * person, and, whenever possible, avoids referring to itself in the first
16 * place. Our ideal phrasing is either second-person, describing things
17 * directly in terms of the player character's experience, or "no-person,"
18 * simply describing things without mentioning the speaker or listener at
19 * all. For example, rather than saying "I don't see that here," we say
20 * "you don't see that here," or "that's not here." We occasionally stray
21 * from this ideal where achieving it would be too awkward.
22 *
23 * In the earliest days of adventure games, the parser was usually a
24 * visible presence: the early parsers frequently reported things in the
25 * first person, and some even had specific personalities. This
26 * conspicuous parser style has become less prevalent in modern games,
27 * though, and authors now usually prefer to treat the parser as just
28 * another part of the user interface, which like all good UI's is best
29 * when the user doesn't notice it.
30 */
31
32 #include "adv3.h"
33 #include "en_us.h"
34
35 /* ------------------------------------------------------------------------ */
36 /*
37 * Build a message parameter string with the given parameter type and
38 * name.
39 *
40 * This is useful when we have a name from a variable, and we need to
41 * build the message substitution string for embedding in a larger
42 * string. We can't just embed the name variable using <<var>>, because
43 * that would process the output piecewise - the output filter needs to
44 * see the whole {typ var} expression in one go. So, instead of writing
45 * this:
46 *
47 *. {The/he <<var>>} {is} ...
48 *
49 * write this:
50 *
51 *. <<buildParam('The/he', var)>> {is} ...
52 */
53 buildParam(typeString, nm)
54 {
55 return '{' + typeString + ' ' + nm + '}';
56 }
57
58 /*
59 * Synthesize a message parameter, and build it into a parameter string
60 * with the given substitution type.
61 *
62 * For example, buildSynthParam('abc', obj) returns '{abc xxx}', where
63 * 'xxx' is a synthesized message parameter name (created using
64 * gSynthMessageParam) for the object obj.
65 */
66 buildSynthParam(typeString, obj)
67 {
68 return '{' + typeString + ' ' + gSynthMessageParam(obj) + '}';
69 }
70
71
72 /* ------------------------------------------------------------------------ */
73 /*
74 * Library Messages
75 */
76 libMessages: MessageHelper
77 /*
78 * The pronoun to use for the objective form of the personal
79 * interrogative pronoun. Strictly speaking, the right word for
80 * this usage is "whom"; but regardless of what the grammar books
81 * say, most American English speakers these days use "who" for both
82 * the subjective and objective cases; to many ears, "whom" sounds
83 * old-fashioned, overly formal, or even pretentious. (Case in
84 * point: a recent television ad tried to make a little kid look
85 * ultra-sophisticated by having him answer the phone by asking
86 * "*whom* may I ask is calling?", with elaborate emphasis on the
87 * "whom." Of course, the correct usage in this case is "who," so
88 * the ad only made the kid look pretentious. It goes to show that,
89 * at least in the mind of the writer of the ad, "whom" is just the
90 * snooty, formal version of "who" that serves only to signal the
91 * speaker's sophistication.)
92 *
93 * By default, we distinguish "who" and "whom." Authors who prefer
94 * to use "who" everywhere can do so by changing this property's
95 * value to 'who'.
96 */
97 whomPronoun = 'whom'
98
99 /*
100 * Flag: offer an explanation of the "OOPS" command when it first
101 * comes up. We'll only show this the first time the player enters
102 * an unknown word. If you never want to offer this message at all,
103 * simply set this flag to nil initially.
104 *
105 * See also oopsNote() below.
106 */
107 offerOopsNote = true
108
109 /*
110 * some standard commands for insertion into <a> tags - these are in
111 * the messages so they can translated along with the command set
112 */
113 commandLookAround = 'look around'
114 commandFullScore = 'full score'
115
116 /* announce a completely remapped action */
117 announceRemappedAction(action)
118 {
119 return '<./p0>\n<.assume>' + action.getParticiplePhrase()
120 + '<./assume>\n';
121 }
122
123 /*
124 * Get a string to announce an implicit action. This announces the
125 * current global action. 'ctx' is an ImplicitAnnouncementContext
126 * object describing the context in which the message is being
127 * displayed.
128 */
129 announceImplicitAction(action, ctx)
130 {
131 /* build the announcement from the basic verb phrase */
132 return ctx.buildImplicitAnnouncement(action.getImplicitPhrase(ctx));
133 }
134
135 /*
136 * Announce a silent implied action. This allows an implied action
137 * to work exactly as normal (including the suppression of a default
138 * response message), but without any announcement of the implied
139 * action.
140 */
141 silentImplicitAction(action, ctx) { return ''; }
142
143 /*
144 * Get a string to announce that we're implicitly moving an object to
145 * a bag of holding to make room for taking something new. If
146 * 'trying' is true, it means we want to phrase the message as merely
147 * trying the action, not actually performing it.
148 */
149 announceMoveToBag(action, ctx)
150 {
151 /* build the announcement, adding an explanation */
152 return ctx.buildImplicitAnnouncement(
153 action.getImplicitPhrase(ctx) + ' to make room');
154 }
155
156 /* show a library credit (for a CREDITS listing) */
157 showCredit(name, byline) { "<<name>> <<byline>>"; }
158
159 /* show a library version number (for a VERSION listing) */
160 showVersion(name, version) { "<<name>> version <<version>>"; }
161
162 /* there's no "about" information in this game */
163 noAboutInfo = "<.parser>This story has no ABOUT information.<./parser> "
164
165 /*
166 * Show a list state name - this is extra state information that we
167 * show for an object in a listing involving the object. For
168 * example, a light source might add a state like "(providing
169 * light)". We simply show the list state name in parentheses.
170 */
171 showListState(state) { " (<<state>>)"; }
172
173 /* a set of equivalents are all in a given state */
174 allInSameListState(lst, stateName)
175 { " (<<lst.length() == 2 ? 'both' : 'all'>> <<stateName>>)"; }
176
177 /* generic long description of a Thing from a distance */
178 distantThingDesc(obj)
179 {
180 gMessageParams(obj);
181 "{It's obj} too far away to make out any detail. ";
182 }
183
184 /* generic long description of a Thing under obscured conditions */
185 obscuredThingDesc(obj, obs)
186 {
187 gMessageParams(obj, obs);
188 "{You/he} {can\'t} make out any detail through {the obs/him}. ";
189 }
190
191 /* generic "listen" description of a Thing at a distance */
192 distantThingSoundDesc(obj)
193 { "{You/he} {can\'t} hear any detail from this distance. "; }
194
195 /* generic obscured "listen" description */
196 obscuredThingSoundDesc(obj, obs)
197 {
198 gMessageParams(obj, obs);
199 "{You/he} {can\'t} hear any detail through {the obs/him}. ";
200 }
201
202 /* generic "smell" description of a Thing at a distance */
203 distantThingSmellDesc(obj)
204 { "{You/he} {can\'t} smell much at this distance. "; }
205
206 /* generic obscured "smell" description */
207 obscuredThingSmellDesc(obj, obs)
208 {
209 gMessageParams(obj, obs);
210 "{You/he} {can\'t} smell much through {the obs/him}. ";
211 }
212
213 /* generic "taste" description of a Thing */
214 thingTasteDesc(obj)
215 {
216 gMessageParams(obj);
217 "{It/he obj} taste{s/d} much as {you/he} would {|have}
218 expect{|ed}. ";
219 }
220
221 /* generic "feel" description of a Thing */
222 thingFeelDesc(obj)
223 { "{You/he} {feel[s]|felt} nothing out of the ordinary. "; }
224
225 /* obscured "read" description */
226 obscuredReadDesc(obj)
227 {
228 gMessageParams(obj);
229 "{You/he} {can\'t} see {that obj/him} well enough to read
230 {it/him}. ";
231 }
232
233 /* dim light "read" description */
234 dimReadDesc(obj)
235 {
236 gMessageParams(obj);
237 "There{&rsquo;s| was} not enough light to read {that obj/him}. ";
238 }
239
240 /* lit/unlit match description */
241 litMatchDesc(obj) { "\^<<obj.nameIs>> lit. "; }
242 unlitMatchDesc(obj) { "\^<<obj.nameIs>> an ordinary match. "; }
243
244 /* lit candle description */
245 litCandleDesc(obj) { "\^<<obj.nameIs>> lit. "; }
246
247 /*
248 * Prepositional phrases for putting objects into different types of
249 * objects.
250 */
251 putDestContainer(obj) { return 'into ' + obj.theNameObj; }
252 putDestSurface(obj) { return 'onto ' + obj.theNameObj; }
253 putDestUnder(obj) { return 'under ' + obj.theNameObj; }
254 putDestBehind(obj) { return 'behind ' + obj.theNameObj; }
255 putDestFloor(obj) { return 'to ' + obj.theNameObj; }
256 putDestRoom(obj) { return 'into ' + obj.theNameObj; }
257
258 /* the list separator character in the middle of a list */
259 listSepMiddle = ", "
260
261 /* the list separator character for a two-element list */
262 listSepTwo = " and "
263
264 /* the list separator for the end of a list of at least three elements */
265 listSepEnd = ", and "
266
267 /*
268 * the list separator for the middle of a long list (a list with
269 * embedded lists not otherwise set off, such as by parentheses)
270 */
271 longListSepMiddle = "; "
272
273 /* the list separator for a two-element list of sublists */
274 longListSepTwo = ", and "
275
276 /* the list separator for the end of a long list */
277 longListSepEnd = "; and "
278
279 /* show the basic score message */
280 showScoreMessage(points, maxPoints, turns)
281 {
282 "In <<turns>> move<<turns == 1 ? '' : 's'>>, you have
283 scored <<points>> of a possible <<maxPoints>> point<<
284 maxPoints == 1 ? '' : 's'>>. ";
285 }
286
287 /* show the basic score message with no maximum */
288 showScoreNoMaxMessage(points, turns)
289 {
290 "In <<turns>> move<<turns == 1 ? '' : 's'>>, you have
291 scored <<points>> point<<points == 1 ? '' : 's'>>. ";
292 }
293
294 /* show the full message for a given score rank string */
295 showScoreRankMessage(msg) { "This makes you <<msg>>. "; }
296
297 /*
298 * show the list prefix for the full score listing; this is shown on
299 * a line by itself before the list of full score items, shown
300 * indented and one item per line
301 */
302 showFullScorePrefix = "Your score consists of:"
303
304 /*
305 * show the item prefix, with the number of points, for a full score
306 * item - immediately after this is displayed, we'll display the
307 * description message for the achievement
308 */
309 fullScoreItemPoints(points)
310 {
311 "<<points>> point<<points == 1 ? '' : 's'>> for ";
312 }
313
314 /* score change - first notification */
315 firstScoreChange(delta)
316 {
317 scoreChange(delta);
318 scoreChangeTip.showTip();
319 }
320
321 /* score change - notification other than the first time */
322 scoreChange(delta)
323 {
324 "<.commandsep><.notification><<
325 basicScoreChange(delta)>><./notification> ";
326 }
327
328 /*
329 * basic score change notification message - this is an internal
330 * service routine for scoreChange and firstScoreChange
331 */
332 basicScoreChange(delta)
333 {
334 "Your <<aHref(commandFullScore, 'score', 'Show full score')>>
335 has just <<delta > 0 ? 'in' : 'de'>>creased by
336 <<spellInt(delta > 0 ? delta : -delta)>>
337 point<<delta is in (1, -1) ? '' : 's'>>.";
338 }
339
340 /* acknowledge turning tips on or off */
341 acknowledgeTipStatus(stat)
342 {
343 "<.parser>Tips are now turned <<stat ? 'on' : 'off'>>.<./parser> ";
344 }
345
346 /* describe the tip mode setting */
347 tipStatusShort(stat)
348 {
349 "TIPS <<stat ? 'ON' : 'OFF'>>";
350 }
351
352 /* get the string to display for a footnote reference */
353 footnoteRef(num)
354 {
355 /* set up a hyperlink for the note that enters the "note n" command */
356 return '<sup>[<<aHref('footnote ' + num, toString(num))>>]</sup>';
357 }
358
359 /* first footnote notification */
360 firstFootnote()
361 {
362 footnotesTip.showTip();
363 }
364
365 /* there is no such footnote as the given number */
366 noSuchFootnote(num)
367 {
368 "<.parser>The story has never referred to any such
369 footnote.<./parser> ";
370 }
371
372 /* show the current footnote status */
373 showFootnoteStatus(stat)
374 {
375 "The current setting is FOOTNOTES ";
376 switch(stat)
377 {
378 case FootnotesOff:
379 "OFF, which hides all footnote references.
380 Type <<aHref('footnotes medium', 'FOOTNOTES MEDIUM',
381 'Set footnotes to Medium')>> to
382 show references to footnotes except those you&rsquo;ve
383 already seen, or <<aHref('footnotes full', 'FOOTNOTES FULL',
384 'Set footnotes to Full')>>
385 to show all footnote references. ";
386 break;
387
388 case FootnotesMedium:
389 "MEDIUM, which shows references to unread footnotes, but
390 hides references to those you&rsquo;ve already read. Type
391 <<aHref('footnotes off', 'FOOTNOTES OFF',
392 'Turn off footnotes')>> to hide
393 footnote references entirely, or <<aHref(
394 'footnotes full', 'FOOTNOTES FULL',
395 'Set footnotes to Full')>> to show every reference, even to
396 notes you&rsquo;ve already read. ";
397 break;
398
399 case FootnotesFull:
400 "FULL, which shows every footnote reference, even to
401 notes you&rsquo;ve already read. Type <<aHref('footnotes medium',
402 'FOOTNOTES MEDIUM', 'Set footnotes to Medium')>> to show
403 only references to notes you
404 haven&rsquo;t yet read, or <<
405 aHref('footnotes off', 'FOOTNOTES OFF', 'Turn off footnotes')>>
406 to hide footnote references entirely. ";
407 break;
408 }
409 }
410
411 /* acknowledge a change in the footnote status */
412 acknowledgeFootnoteStatus(stat)
413 {
414 "<.parser>The setting is now
415 <<shortFootnoteStatus(stat)>>.<./parser> ";
416 }
417
418 /* show the footnote status, in short form */
419 shortFootnoteStatus(stat)
420 {
421 "FOOTNOTES <<
422 stat == FootnotesOff ? 'OFF'
423 : stat == FootnotesMedium ? 'MEDIUM'
424 : 'FULL' >>";
425 }
426
427 /*
428 * Show the main command prompt.
429 *
430 * 'which' is one of the rmcXxx phase codes indicating what kind of
431 * command we're reading. This default implementation shows the
432 * same prompt for every type of input, but games can use the
433 * 'which' value to show different prompts for different types of
434 * queries, if desired.
435 */
436 mainCommandPrompt(which) { "\b&gt;"; }
437
438 /*
439 * Show a pre-resolved error message string. This simply displays
440 * the given string.
441 */
442 parserErrorString(actor, msg) { say(msg); }
443
444 /* show the response to an empty command line */
445 emptyCommandResponse = "<.parser>I beg your pardon?<./parser> "
446
447 /* invalid token (i.e., punctuation) in command line */
448 invalidCommandToken(ch)
449 {
450 "<.parser>The story doesn&rsquo;t know how to use the character
451 &lsquo;<<ch>>&rsquo; in a command.<./parser> ";
452 }
453
454 /*
455 * Command group prefix - this is displayed after a command line and
456 * before the first command results shown after the command line.
457 *
458 * By default, we'll show the "zero-space paragraph" marker, which
459 * acts like a paragraph break in that it swallows up immediately
460 * following paragraph breaks, but doesn't actually add any space.
461 * This will ensure that we don't add any space between the command
462 * input line and the next text.
463 */
464 commandResultsPrefix = '<.p0>'
465
466 /*
467 * Command "interruption" group prefix. This is displayed after an
468 * interrupted command line - a command line editing session that
469 * was interrupted by a timeout event - just before the text that
470 * interrupted the command line.
471 *
472 * By default, we'll show a paragraph break here, to set off the
473 * interrupting text from the command line under construction.
474 */
475 commandInterruptionPrefix = '<.p>'
476
477 /*
478 * Command separator - this is displayed after the results from a
479 * command when another command is about to be executed without any
480 * more user input. That is, when a command line contains more than
481 * one command, this message is displayed between each successive
482 * command, to separate the results visually.
483 *
484 * This is not shown before the first command results after a
485 * command input line, and is not shown after the last results
486 * before a new input line. Furthermore, this is shown only between
487 * adjacent commands for which output actually occurs; if a series
488 * of commands executes without any output, we won't show any
489 * separators between the silent commands.
490 *
491 * By default, we'll just start a new paragraph.
492 */
493 commandResultsSeparator = '<.p>'
494
495 /*
496 * "Complex" result separator - this is displayed between a group of
497 * messages for a "complex" result set and adjoining messages. A
498 * command result list is "complex" when it's built up out of
499 * several generated items, such as object identification prefixes
500 * or implied command prefixes. We use additional visual separation
501 * to set off these groups of messages from adjoining messages,
502 * which is especially important for commands on multiple objects,
503 * where we would otherwise have several results shown together. By
504 * default, we use a paragraph break.
505 */
506 complexResultsSeparator = '<.p>'
507
508 /*
509 * Internal results separator - this is displayed to visually
510 * separate the results of an implied command from the results for
511 * the initiating command, which are shown after the results from
512 * the implied command. By default, we show a paragraph break.
513 */
514 internalResultsSeparator = '<.p>'
515
516 /*
517 * Command results suffix - this is displayed just before a new
518 * command line is about to be read if any command results have been
519 * shown since the last command line.
520 *
521 * By default, we'll show nothing extra.
522 */
523 commandResultsSuffix = ''
524
525 /*
526 * Empty command results - this is shown when we read a command line
527 * and then go back and read another without having displaying
528 * anything.
529 *
530 * By default, we'll return a message indicating that nothing
531 * happened.
532 */
533 commandResultsEmpty =
534 ('Nothing obvious happen' + tSel('s', 'ed') + '.<.p>')
535
536 /*
537 * Intra-command report separator. This is used to separate report
538 * messages within a single command's results. By default, we show
539 * a paragraph break.
540 */
541 intraCommandSeparator = '<.p>'
542
543 /*
544 * separator for "smell" results - we ordinarily show each item's
545 * odor description as a separate paragraph
546 */
547 smellDescSeparator()
548 {
549 "<.p>";
550 }
551
552 /*
553 * separator for "listen" results
554 */
555 soundDescSeparator()
556 {
557 "<.p>";
558 }
559
560 /* a command was issued to a non-actor */
561 cannotTalkTo(targetActor, issuingActor)
562 {
563 "\^<<targetActor.nameIs>> not something <<issuingActor.itNom>>
564 <<issuingActor.verbCan>> talk to. ";
565 }
566
567 /* greeting actor while actor is already talking to us */
568 alreadyTalkingTo(actor, greeter)
569 {
570 "\^<<greeter.theName>> already <<greeter.verbToHave>>
571 <<actor.theNamePossAdj>> attention. ";
572 }
573
574 /* no topics to suggest when we're not talking to anyone */
575 noTopicsNotTalking = "<.parser>{You're} not currently talking
576 to anyone.<./parser> "
577
578 /*
579 * Show a note about the OOPS command. This is, by default, added
580 * to the "I don't know that word" error the first time that error
581 * occurs.
582 */
583 oopsNote()
584 {
585 oopsTip.showTip();
586 }
587
588 /* can't use OOPS right now */
589 oopsOutOfContext = "<.parser>You can only use OOPS to correct
590 a misspelling immediately after the story points out a word
591 it doesn&rsquo;t know.<./parser> "
592
593 /* OOPS in context, but without the word to correct */
594 oopsMissingWord = "<.parser>To use OOPS to correct a misspelling,
595 put the corrected word after OOPS, as in OOPS BOOK.<./parser> "
596
597 /* acknowledge setting VERBOSE mode (true) or TERSE mode (nil) */
598 acknowledgeVerboseMode(verbose)
599 {
600 if (verbose)
601 "<.parser>VERBOSE mode is now selected.<./parser> ";
602 else
603 "<.parser>TERSE mode is now selected.<./parser> ";
604 }
605
606 /* show the current VERBOSE setting, in short form */
607 shortVerboseStatus(stat) { "<<stat ? 'VERBOSE' : 'TERSE'>> mode"; }
608
609 /* show the current score notify status */
610 showNotifyStatus(stat)
611 {
612 "<.parser>Score notifications are
613 currently <<stat ? 'on' : 'off'>>.<./parser> ";
614 }
615
616 /* show the current score notify status, in short form */
617 shortNotifyStatus(stat) { "NOTIFY <<stat ? 'ON' : 'OFF'>>"; }
618
619 /* acknowledge a change in the score notification status */
620 acknowledgeNotifyStatus(stat)
621 {
622 "<.parser>Score notifications are now
623 <<stat ? 'on' : 'off'>>.<./parser> ";
624 }
625
626 /*
627 * Announce the current object of a set of multiple objects on which
628 * we're performing an action. This is used to tell the player
629 * which object we're acting upon when we're iterating through a set
630 * of objects specified in a command targeting multiple objects.
631 */
632 announceMultiActionObject(obj, whichObj, action)
633 {
634 /*
635 * get the display name - we only need to differentiate this
636 * object from the other objects in the iteration
637 */
638 local nm = obj.getAnnouncementDistinguisher(
639 action.getResolvedObjList(whichObj)).name(obj);
640
641 /* build the announcement */
642 return '<./p0>\n<.announceObj>' + nm + ':<./announceObj> <.p0>';
643 }
644
645 /*
646 * Announce a singleton object that we selected from a set of
647 * ambiguous objects. This is used when we disambiguate a command
648 * and choose an object over other objects that are also logical but
649 * are less likely. In such cases, it's courteous to tell the
650 * player what we chose, because it's possible that the user meant
651 * one of the other logical objects - announcing this type of choice
652 * helps reduce confusion by making it immediately plain to the
653 * player when we make a choice other than what they were thinking.
654 */
655 announceAmbigActionObject(obj, whichObj, action)
656 {
657 /*
658 * get the display name - distinguish the object from everything
659 * else in scope, since we chose from a set of ambiguous options
660 */
661 local nm = obj.getAnnouncementDistinguisher(gActor.scopeList())
662 .theName(obj);
663
664 /* announce the object in "assume" style, ending with a newline */
665 return '<.assume>' + nm + '<./assume>\n';
666 }
667
668 /*
669 * Announce a singleton object we selected as a default for a
670 * missing noun phrase.
671 *
672 * 'resolvedAllObjects' indicates where we are in the command
673 * processing: this is true if we've already resolved all of the
674 * other objects in the command, nil if not. We use this
675 * information to get the phrasing right according to the situation.
676 */
677 announceDefaultObject(obj, whichObj, action, resolvedAllObjects)
678 {
679 /*
680 * put the action's default-object message in "assume" style,
681 * and start a new line after it
682 */
683 return '<.assume>'
684 + action.announceDefaultObject(obj, whichObj, resolvedAllObjects)
685 + '<./assume>\n';
686 }
687
688 /* 'again' used with no prior command */
689 noCommandForAgain()
690 {
691 "<.parser>There&rsquo;s nothing to repeat.<./parser> ";
692 }
693
694 /* 'again' cannot be directed to a different actor */
695 againCannotChangeActor()
696 {
697 "<.parser>To repeat a command like <q>turtle, go north,</q>
698 just say <q>again,</q> not <q>turtle, again.</q><./parser> ";
699 }
700
701 /* 'again': can no longer talk to target actor */
702 againCannotTalkToTarget(issuer, target)
703 {
704 "\^<<issuer.theName>> <<issuer.verbCannot>> repeat that command. ";
705 }
706
707 /* the last command cannot be repeated in the present context */
708 againNotPossible(issuer)
709 {
710 "That command cannot be repeated now. ";
711 }
712
713 /* system actions cannot be directed to non-player characters */
714 systemActionToNPC()
715 {
716 "<.parser>This command cannot be directed to another
717 character in the story.<./parser> ";
718 }
719
720 /* confirm that we really want to quit */
721 confirmQuit()
722 {
723 "Do you really want to quit?\ (<<aHref('y', 'Y', 'Confirm quitting')
724 >> is affirmative) >\ ";
725 }
726
727 /*
728 * QUIT message. We display this to acknowledge an explicit player
729 * command to quit the game. This is the last message the game
730 * displays on the way out; there is no need to offer any options at
731 * this point, because the player has decided to exit the game.
732 *
733 * By default, we show nothing; games can override this to display an
734 * acknowledgment if desired. Note that this isn't a general
735 * end-of-game 'goodbye' message; the library only shows this to
736 * acknowledge an explicit QUIT command from the player.
737 */
738 okayQuitting() { }
739
740 /*
741 * "not terminating" confirmation - this is displayed when the
742 * player doesn't acknowledge a 'quit' command with an affirmative
743 * response to our confirmation question
744 */
745 notTerminating()
746 {
747 "<.parser>Continuing the story.<./parser> ";
748 }
749
750 /* confirm that they really want to restart */
751 confirmRestart()
752 {
753 "Do you really want to start over?\ (<<aHref('Y', 'Y',
754 'Confirm restart')>> is affirmative) >\ ";
755 }
756
757 /* "not restarting" confirmation */
758 notRestarting() { "<.parser>Continuing the story.<./parser> "; }
759
760 /*
761 * Show a game-finishing message - we use the conventional "*** You
762 * have won! ***" format that text games have been using since the
763 * dawn of time.
764 */
765 showFinishMsg(msg) { "<.p>*** <<msg>>\ ***<.p>"; }
766
767 /* standard game-ending messages for the common outcomes */
768 finishDeathMsg = '{YOU/HE pc} {[HAVE]|} DIED'
769 finishVictoryMsg = ('YOU ' + tSel('HAVE ', '') + 'WON')
770 finishFailureMsg = ('YOU ' + tSel('HAVE ', '') + 'FAILED')
771 finishGameOverMsg = 'GAME OVER'
772
773 /*
774 * Get the save-game file prompt. Note that this must return a
775 * single-quoted string value, not display a value itself, because
776 * this prompt is passed to inputFile().
777 */
778 getSavePrompt = 'Save game to file'
779
780 /* get the restore-game prompt */
781 getRestorePrompt = 'Restore game from file'
782
783 /* successfully saved */
784 saveOkay() { "<.parser>Saved.<./parser> "; }
785
786 /* save canceled */
787 saveCanceled() { "<.parser>Canceled.<./parser> "; }
788
789 /* saved failed due to a file write or similar error */
790 saveFailed(exc)
791 {
792 "<.parser>Failed; your computer might be running low
793 on disk space, or you might not have the necessary permissions
794 to write this file.<./parser> ";
795 }
796
797 /* save failed due to storage server request error */
798 saveFailedOnServer(exc)
799 {
800 "<.parser>Failed, because of a problem accessing the storage server:
801 <<makeSentence(exc.errMsg)>><./parser>";
802 }
803
804 /*
805 * make an error message into a sentence, by capitalizing the first
806 * letter and adding a period at the end if it doesn't already have
807 * one
808 */
809 makeSentence(msg)
810 {
811 return rexReplace(
812 ['^<space>*[a-z]', '(?<=[^.?! ])<space>*$'], msg,
813 [{m: m.toUpper()}, '.']);
814 }
815
816 /* note that we're restoring at startup via a saved-position launch */
817 noteMainRestore() { "<.parser>Restoring saved game...<./parser>\n"; }
818
819 /* successfully restored */
820 restoreOkay() { "<.parser>Restored.<./parser> "; }
821
822 /* restore canceled */
823 restoreCanceled() { "<.parser>Canceled.<./parser> "; }
824
825 /* restore failed due to storage server request error */
826 restoreFailedOnServer(exc)
827 {
828 "<.parser>Failed, because of a problem accessing the storage server:
829 <<makeSentence(exc.errMsg)>><./parser>";
830 }
831
832 /* restore failed because the file was not a valid saved game file */
833 restoreInvalidFile()
834 {
835 "<.parser>Failed: this is not a valid saved
836 position file.<./parser> ";
837 }
838
839 /* restore failed because the file was corrupted */
840 restoreCorruptedFile()
841 {
842 "<.parser>Failed: this saved state file appears to be
843 corrupted. This can occur if the file was modified by another
844 program, or the file was copied between computers in a non-binary
845 transfer mode, or the physical media storing the file were
846 damaged.<./parser> ";
847 }
848
849 /* restore failed because the file was for the wrong game or version */
850 restoreInvalidMatch()
851 {
852 "<.parser>Failed: the file was not saved by this
853 story (or was saved by an incompatible version of
854 the story).<./parser> ";
855 }
856
857 /* restore failed for some reason other than those distinguished above */
858 restoreFailed(exc)
859 {
860 "<.parser>Failed: the position could not be
861 restored.<./parser> ";
862 }
863
864 /* error showing the input file dialog (or character-mode equivalent) */
865 filePromptFailed()
866 {
867 "<.parser>A system error occurred asking for a filename.
868 Your computer might be running low on memory, or might have a
869 configuration problem.<./parser> ";
870 }
871
872 /* error showing the input file dialog, with a system error message */
873 filePromptFailedMsg(msg)
874 {
875 "<.parser>Failed: <<makeSentence(msg)>><./parser> ";
876 }
877
878 /* Web UI inputFile error: uploaded file is too large */
879 webUploadTooBig = 'The file you selected is too large to upload.'
880
881 /* PAUSE prompt */
882 pausePrompt()
883 {
884 "<.parser>The story is now paused. Please press
885 the space bar when you are ready to resume the story, or
886 press the &lsquo;S&rsquo; key to save the current
887 position.<./parser><.p>";
888 }
889
890 /* saving from within a pause */
891 pauseSaving()
892 {
893 "<.parser>Saving the story...<./parser><.p>";
894 }
895
896 /* PAUSE ended */
897 pauseEnded()
898 {
899 "<.parser>Resuming the story.<./parser> ";
900 }
901
902 /* acknowledge starting an input script */
903 inputScriptOkay(fname)
904 {
905 "<.parser>Reading commands from <q><<
906 File.getRootName(fname).htmlify()>></q>...<./parser>\n ";
907 }
908
909 /* error opening input script */
910 inputScriptFailed = "<.parser>Failed; the script input file could
911 not be opened.<./parser> "
912
913 /* exception opening input script */
914 inputScriptFailedException(exc)
915 {
916 "<.parser>Failed; <<exc.displayException>><./parser> ";
917 }
918
919 /* get the scripting inputFile prompt message */
920 getScriptingPrompt = 'Please select a name for the new script file'
921
922 /* acknowledge scripting on */
923 scriptingOkay()
924 {
925 "<.parser>The transcript will be saved to the file.
926 Type <<aHref('script off', 'SCRIPT OFF', 'Turn off scripting')>> to
927 discontinue scripting.<./parser> ";
928 }
929
930 scriptingOkayWebTemp()
931 {
932 "<.parser>The transcript will be saved.
933 Type <<aHref('script off', 'SCRIPT OFF', 'Turn off scripting')>>
934 to discontinue scripting and download the saved
935 transcript.<./parser> ";
936 }
937
938 /* scripting failed */
939 scriptingFailed = "<.parser>Failed; an error occurred opening
940 the script file.<./parser> "
941
942 /* scripting failed with an exception */
943 scriptingFailedException(exc)
944 {
945 "<.parser>Failed; <<exc.displayException>><./parser>";
946 }
947
948 /* acknowledge cancellation of script file dialog */
949 scriptingCanceled = "<.parser>Canceled.<./parser> "
950
951 /* acknowledge scripting off */
952 scriptOffOkay = "<.parser>Scripting ended.<./parser> "
953
954 /* SCRIPT OFF ignored because we're not in a script file */
955 scriptOffIgnored = "<.parser>No script is currently being
956 recorded.<./parser> "
957
958 /* get the RECORD prompt */
959 getRecordingPrompt = 'Please select a name for the new command log file'
960
961 /* acknowledge recording on */
962 recordingOkay = "<.parser>Commands will now be recorded. Type
963 <<aHref('record off', 'RECORD OFF',
964 'Turn off recording')>>
965 to stop recording commands.<.parser> "
966
967 /* recording failed */
968 recordingFailed = "<.parser>Failed; an error occurred opening
969 the command recording file.<./parser> "
970
971 /* recording failed with exception */
972 recordingFailedException(exc)
973 {
974 "<.parser>Failed; <<exc.displayException()>><./parser> ";
975 }
976
977 /* acknowledge cancellation */
978 recordingCanceled = "<.parser>Canceled.<./parser> "
979
980 /* recording turned off */
981 recordOffOkay = "<.parser>Command recording ended.<./parser> "
982
983 /* RECORD OFF ignored because we're not recording commands */
984 recordOffIgnored = "<.parser>No command recording is currently being
985 made.<./parser> "
986
987 /* REPLAY prompt */
988 getReplayPrompt = 'Please select the command log file to replay'
989
990 /* REPLAY file selection canceled */
991 replayCanceled = "<.parser>Canceled.<./parser> "
992
993 /* undo command succeeded */
994 undoOkay(actor, cmd)
995 {
996 "<.parser>Taking back one turn: <q>";
997
998 /* show the target actor prefix, if an actor was specified */
999 if (actor != nil)
1000 "<<actor>>, ";
1001
1002 /* show the command */
1003 "<<cmd>></q>.<./parser><.p>";
1004 }
1005
1006 /* undo command failed */
1007 undoFailed()
1008 {
1009 "<.parser>No more undo information is
1010 available.<./parser> ";
1011 }
1012
1013 /* comment accepted, with or without transcript recording in effect */
1014 noteWithScript = "<.parser>Comment recorded.<./parser> "
1015 noteWithoutScript = "<.parser>Comment <b>not</b> recorded.<./parser> "
1016
1017 /* on the first comment without transcript recording, warn about it */
1018 noteWithoutScriptWarning = "<.parser>Comment <b>not</b> recorded.
1019 Use <<aHref('script', 'SCRIPT', 'Begin saving the transcript')
1020 >> if you want to start recording the transcript.<./parser> "
1021
1022 /* invalid finishGame response */
1023 invalidFinishOption(resp)
1024 {
1025 "\bThat isn&rsquo;t one of the options. ";
1026 }
1027
1028 /* acknowledge new "exits on/off" status */
1029 exitsOnOffOkay(stat, look)
1030 {
1031 if (stat && look)
1032 "<.parser>The list of exits will now be shown in both
1033 the status line and in each room description.<./parser> ";
1034 else if (!stat && !look)
1035 "<.parser>The list of exits will no longer be shown in
1036 either the status line or room description.<./parser> ";
1037 else
1038 "<.parser>The list of exits <<stat ? 'will' : 'will not'>> be
1039 shown in the status line, and <<look ? 'will' : 'won&rsquo;t'>>
1040 be included in room descriptions.<./parser> ";
1041 }
1042
1043 /* explain how to turn exit display on and off */
1044 explainExitsOnOff()
1045 {
1046 exitsTip.showTip();
1047 }
1048
1049 /* describe the current EXITS settings */
1050 currentExitsSettings(statusLine, roomDesc)
1051 {
1052 "EXITS ";
1053 if (statusLine && roomDesc)
1054 "ON";
1055 else if (statusLine)
1056 "STATUSLINE";
1057 else if (roomDesc)
1058 "LOOK";
1059 else
1060 "OFF";
1061 }
1062
1063 /* acknowledge HINTS OFF */
1064 hintsDisabled = '<.parser>Hints are now disabled.<./parser> '
1065
1066 /* rebuff a request for hints when they've been previously disabled */
1067 sorryHintsDisabled = '<.parser>Sorry, but hints have been disabled
1068 for this session, as you requested. If you&rsquo;ve changed your
1069 mind, you&rsquo;ll have to save your current position, exit the TADS
1070 interpreter, and start a new interpreter session.<./parser> '
1071
1072 /* this game has no hints */
1073 hintsNotPresent = '<.parser>Sorry, this story doesn&rsquo;t
1074 have any built-in hints.<./parser> '
1075
1076 /* there are currently no hints available (but there might be later) */
1077 currentlyNoHints = '<.parser>Sorry, no hints are currently available.
1078 Please check back later.<./parser> '
1079
1080 /* show the hint system warning */
1081 showHintWarning =
1082 "<.notification>Warning: Some people don&rsquo;t like built-in hints,
1083 since the temptation to ask for help prematurely can become
1084 overwhelming when hints are so close at hand. If you&rsquo;re worried
1085 that your willpower won&rsquo;t hold up, you can disable hints for the
1086 rest of this session by typing <<aHref('hints off', 'HINTS OFF')
1087 >>. If you still want to see the hints now, type
1088 <<aHref('hint', 'HINT')>>.<./notification> "
1089
1090 /* done with hints */
1091 hintsDone = '<.parser>Done.<./parser> '
1092
1093 /* optional command is not supported in this game */
1094 commandNotPresent = "<.parser>That command isn&rsquo;t needed
1095 in this story.<./parser> "
1096
1097 /* this game doesn't use scoring */
1098 scoreNotPresent = "<.parser>This story doesn&rsquo;t use
1099 scoring.<./parser> "
1100
1101 /* mention the FULL SCORE command */
1102 mentionFullScore()
1103 {
1104 fullScoreTip.showTip();
1105 }
1106
1107 /* SAVE DEFAULTS successful */
1108 savedDefaults()
1109 {
1110 "<.parser>Your current settings have been stored as the
1111 default settings for new games. The saved settings are: ";
1112
1113 /* show all of the settings */
1114 settingsUI.showAll();
1115
1116 ". Most newer games will apply these settings automatically
1117 whenever you start (or RESTART) the game, but note that older
1118 games will not.<./parser> ";
1119 }
1120
1121 /* RESTORE DEFAULTS successful */
1122 restoredDefaults()
1123 {
1124 "<.parser>The saved default settings have been put into
1125 effect. The new settings are: ";
1126
1127 /* show all of the settings */
1128 settingsUI.showAll();
1129
1130 ".<./parser> ";
1131 }
1132
1133 /* show a separator for the settingsUI.showAll() list */
1134 settingsItemSeparator = "; "
1135
1136 /* SAVE/RESTORE DEFAULTS not supported (old interpreter version) */
1137 defaultsFileNotSupported = "<.parser>Sorry, but the version of the
1138 TADS interpreter you&rsquo;re using doesn&rsquo;t support saving
1139 or restoring defaults. You must install a more recent version
1140 in order to use this feature.<./parser> "
1141
1142 /* RESTORE DEFAULTS file open/read error */
1143 defaultsFileReadError(exc)
1144 {
1145 "<.parser>An error occurred reading the default settings
1146 file. The global defaults can't be restored.<./parser> ";
1147 }
1148
1149 /* SAVE DEFAULTS file creation error */
1150 defaultsFileWriteError = "<.parser>An error occurred writing
1151 the default settings file. The defaults have not been
1152 saved. You might be out of disk space, or you might not
1153 have the necessary permissions to write the file.<./parser> "
1154
1155 /*
1156 * Command key list for the menu system. This uses the format
1157 * defined for MenuItem.keyList in the menu system. Keys must be
1158 * given as lower-case in order to match input, since the menu
1159 * system converts input keys to lower case before matching keys to
1160 * this list.
1161 *
1162 * Note that the first item in each list is what will be given in
1163 * the navigation menu, which is why the fifth list contains 'ENTER'
1164 * as its first item, even though this will never match a key press.
1165 */
1166 menuKeyList = [
1167 ['q'],
1168 ['p', '[left]', '[bksp]', '[esc]'],
1169 ['u', '[up]'],
1170 ['d', '[down]'],
1171 ['ENTER', '\n', '[right]', ' ']
1172 ]
1173
1174 /* link title for 'previous menu' navigation link */
1175 prevMenuLink = '<font size=-1>Previous</font>'
1176
1177 /* link title for 'next topic' navigation link in topic lists */
1178 nextMenuTopicLink = '<font size=-1>Next</font>'
1179
1180 /*
1181 * main prompt text for text-mode menus - this is displayed each
1182 * time we ask for a keystroke to navigate a menu in text-only mode
1183 */
1184 textMenuMainPrompt(keylist)
1185 {
1186 "\bSelect a topic number, or press &lsquo;<<
1187 keylist[M_PREV][1]>>&rsquo; for the previous
1188 menu or &lsquo;<<keylist[M_QUIT][1]>>&rsquo; to quit:\ ";
1189 }
1190
1191 /* prompt text for topic lists in text-mode menus */
1192 textMenuTopicPrompt()
1193 {
1194 "\bPress the space bar to display the next line,
1195 &lsquo;<b>P</b>&rsquo; to go to the previous menu, or
1196 &lsquo;<b>Q</b>&rsquo; to quit.\b";
1197 }
1198
1199 /*
1200 * Position indicator for topic list items - this is displayed after
1201 * a topic list item to show the current item number and the total
1202 * number of items in the list, to give the user an idea of where
1203 * they are in the overall list.
1204 */
1205 menuTopicProgress(cur, tot) { " [<<cur>>/<<tot>>]"; }
1206
1207 /*
1208 * Message to display at the end of a topic list. We'll display
1209 * this after we've displayed all available items from a
1210 * MenuTopicItem's list of items, to let the user know that there
1211 * are no more items available.
1212 */
1213 menuTopicListEnd = '[The End]'
1214
1215 /*
1216 * Message to display at the end of a "long topic" in the menu
1217 * system. We'll display this at the end of the long topic's
1218 * contents.
1219 */
1220 menuLongTopicEnd = '[The End]'
1221
1222 /*
1223 * instructions text for banner-mode menus - this is displayed in
1224 * the instructions bar at the top of the screen, above the menu
1225 * banner area
1226 */
1227 menuInstructions(keylist, prevLink)
1228 {
1229 "<tab align=right ><b>\^<<keylist[M_QUIT][1]>></b>=Quit <b>\^<<
1230 keylist[M_PREV][1]>></b>=Previous Menu<br>
1231 <<prevLink != nil ? aHrefAlt('previous', prevLink, '') : ''>>
1232 <tab align=right ><b>\^<<keylist[M_UP][1]>></b>=Up <b>\^<<
1233 keylist[M_DOWN][1]>></b>=Down <b>\^<<
1234 keylist[M_SEL][1]>></b>=Select<br>";
1235 }
1236
1237 /* show a 'next chapter' link */
1238 menuNextChapter(keylist, title, hrefNext, hrefUp)
1239 {
1240 "Next: <<aHref(hrefNext, title)>>;
1241 <b>\^<<keylist[M_PREV][1]>></b>=<<aHref(hrefUp, 'Menu')>>";
1242 }
1243
1244 /*
1245 * cannot reach (i.e., touch) an object that is to be manipulated in
1246 * a command - this is a generic message used when we cannot
1247 * identify the specific reason that the object is in scope but
1248 * cannot be touched
1249 */
1250 cannotReachObject(obj)
1251 {
1252 "{You/he} {cannot} reach <<obj.theNameObj>>. ";
1253 }
1254
1255 /*
1256 * cannot reach an object, because the object is inside the given
1257 * container
1258 */
1259 cannotReachContents(obj, loc)
1260 {
1261 gMessageParams(obj, loc);
1262 return '{You/he} {cannot} reach {the obj/him} through '
1263 + '{the loc/him}. ';
1264 }
1265
1266 /* cannot reach an object because it's outisde the given container */
1267 cannotReachOutside(obj, loc)
1268 {
1269 gMessageParams(obj, loc);
1270 return '{You/he} {cannot} reach {the obj/him} through '
1271 + '{the loc/him}. ';
1272 }
1273
1274 /* sound is coming from inside/outside a container */
1275 soundIsFromWithin(obj, loc)
1276 {
1277 "\^<<obj.theName>> appear<<obj.verbEndingSEd>> to be
1278 coming from inside <<loc.theNameObj>>. ";
1279 }
1280 soundIsFromWithout(obj, loc)
1281 {
1282 "\^<<obj.theName>> appear<<obj.verbEndingSEd>> to be
1283 coming from outside <<loc.theNameObj>>. ";
1284 }
1285
1286 /* odor is coming from inside/outside a container */
1287 smellIsFromWithin(obj, loc)
1288 {
1289 "\^<<obj.theName>> appear<<obj.verbEndingSEd>> to be
1290 coming from inside <<loc.theNameObj>>. ";
1291 }
1292 smellIsFromWithout(obj, loc)
1293 {
1294 "\^<<obj.theName>> appear<<obj.verbEndingSEd>> to be
1295 coming from outside <<loc.theNameObj>>. ";
1296 }
1297
1298 /* default description of the player character */
1299 pcDesc(actor)
1300 {
1301 "\^<<actor.theName>> look<<actor.verbEndingSEd>> the same
1302 as usual. ";
1303 }
1304
1305 /*
1306 * Show a status line addendum for the actor posture, without
1307 * mentioning the actor's location. We won't mention standing, since
1308 * this is the default posture.
1309 */
1310 roomActorStatus(actor)
1311 {
1312 /* mention any posture other than standing */
1313 if (actor.posture != standing)
1314 " (<<actor.posture.participle>>)";
1315 }
1316
1317 /* show a status line addendum: standing in/on something */
1318 actorInRoomStatus(actor, room)
1319 { " (<<actor.posture.participle>> <<room.actorInName>>)"; }
1320
1321 /* generic short description of a dark room */
1322 roomDarkName = 'In the dark'
1323
1324 /* generic long description of a dark room */
1325 roomDarkDesc = "It{&rsquo;s| was} pitch black. "
1326
1327 /*
1328 * mention that an actor is here, without mentioning the enclosing
1329 * room, as part of a room description
1330 */
1331 roomActorHereDesc(actor)
1332 {
1333 "\^<<actor.nameIs>> <<actor.posture.participle>>
1334 <<tSel('here', 'there')>>. ";
1335 }
1336
1337 /*
1338 * mention that an actor is visible at a distance or remotely,
1339 * without mentioning the enclosing room, as part of a room
1340 * description
1341 */
1342 roomActorThereDesc(actor)
1343 {
1344 "\^<<actor.nameIs>> <<actor.posture.participle>> nearby. ";
1345 }
1346
1347 /*
1348 * Mention that an actor is in a given local room, as part of a room
1349 * description. This is used as a default "special description" for
1350 * an actor.
1351 */
1352 actorInRoom(actor, cont)
1353 {
1354 "\^<<actor.nameIs>> <<actor.posture.participle>>
1355 <<cont.actorInName>>. ";
1356 }
1357
1358 /*
1359 * Describe an actor as standing/sitting/lying on something, as part
1360 * of the actor's EXAMINE description. This is additional
1361 * information added to the actor's description, so we refer to the
1362 * actor with a pronoun ("He's standing here").
1363 */
1364 actorInRoomPosture(actor, room)
1365 {
1366 "\^<<actor.itIs>> <<actor.posture.participle>>
1367 <<room.actorInName>>. ";
1368 }
1369
1370 /*
1371 * Describe an actor's posture, as part of an actor's "examine"
1372 * description. If the actor is standing, don't bother mentioning
1373 * anything, as standing is the trivial default condition.
1374 */
1375 roomActorPostureDesc(actor)
1376 {
1377 if (actor.posture != standing)
1378 "\^<<actor.itIs>> <<actor.posture.participle>>. ";
1379 }
1380
1381 /*
1382 * mention that the given actor is visible, at a distance or
1383 * remotely, in the given location; this is used in room
1384 * descriptions when an NPC is visible in a remote or distant
1385 * location
1386 */
1387 actorInRemoteRoom(actor, room, pov)
1388 {
1389 /* say that the actor is in the room, using its remote in-name */
1390 "\^<<actor.nameIs>> <<actor.posture.participle>>
1391 <<room.inRoomName(pov)>>. ";
1392 }
1393
1394 /*
1395 * mention that the given actor is visible, at a distance or
1396 * remotely, in the given nested room within the given outer
1397 * location; this is used in room descriptions
1398 */
1399 actorInRemoteNestedRoom(actor, inner, outer, pov)
1400 {
1401 /*
1402 * say that the actor is in the nested room, in the current
1403 * posture, and add then add that we're in the outer room as
1404 * well
1405 */
1406 "\^<<actor.nameIs>> <<outer.inRoomName(pov)>>,
1407 <<actor.posture.participle>> <<inner.actorInName>>. ";
1408 }
1409
1410 /*
1411 * Prefix/suffix messages for listing actors in a room description,
1412 * for cases when the actors are in the local room in a nominal
1413 * container that we want to mention: "Bob and Bill are sitting on
1414 * the couch."
1415 */
1416 actorInGroupPrefix(posture, cont, lst) { "\^"; }
1417 actorInGroupSuffix(posture, cont, lst)
1418 {
1419 " <<lst.length() == 1 ? tSel('is', 'was') : tSel('are', 'were')>>
1420 <<posture.participle>> <<cont.actorInName>>. ";
1421 }
1422
1423 /*
1424 * Prefix/suffix messages for listing actors in a room description,
1425 * for cases when the actors are inside a nested room that's inside
1426 * a remote location: "Bob and Bill are in the courtyard, sitting on
1427 * the bench."
1428 */
1429 actorInRemoteGroupPrefix(pov, posture, cont, remote, lst) { "\^"; }
1430 actorInRemoteGroupSuffix(pov, posture, cont, remote, lst)
1431 {
1432 " <<lst.length() == 1 ? tSel('is', 'was') : tSel('are', 'were')>>
1433 <<remote.inRoomName(pov)>>, <<posture.participle>>
1434 <<cont.actorInName>>. ";
1435 }
1436
1437 /*
1438 * Prefix/suffix messages for listing actors in a room description,
1439 * for cases when the actors' nominal container cannot be seen or is
1440 * not to be stated: "Bob and Bill are standing here."
1441 *
1442 * Note that we don't always want to state the nominal container,
1443 * even when it's visible. For example, when actors are standing on
1444 * the floor, we don't bother saying that they're on the floor, as
1445 * that's stating the obvious. The container will decide whether or
1446 * not it wants to be included in the message; containers that don't
1447 * want to be mentioned will use this form of the message.
1448 */
1449 actorHereGroupPrefix(posture, lst) { "\^"; }
1450 actorHereGroupSuffix(posture, lst)
1451 {
1452 " <<lst.length() == 1 ? tSel('is', 'was') : tSel('are', 'were')>>
1453 <<posture.participle>> <<tSel('here', 'there')>>. ";
1454 }
1455
1456 /*
1457 * Prefix/suffix messages for listing actors in a room description,
1458 * for cases when the actors' immediate container cannot be seen or
1459 * is not to be stated, and the actors are in a remote location:
1460 * "Bob and Bill are in the courtyard."
1461 */
1462 actorThereGroupPrefix(pov, posture, remote, lst) { "\^"; }
1463 actorThereGroupSuffix(pov, posture, remote, lst)
1464 {
1465 " <<lst.length() == 1 ? tSel('is', 'was') : tSel('are', 'were')>>
1466 <<posture.participle>> <<remote.inRoomName(pov)>>. ";
1467 }
1468
1469 /* a traveler is arriving, but not from a compass direction */
1470 sayArriving(traveler)
1471 {
1472 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1473 <<traveler.travelerLocName>>. ";
1474 }
1475
1476 /* a traveler is departing, but not in a compass direction */
1477 sayDeparting(traveler)
1478 {
1479 "\^<<traveler.travelerName(nil)>> <<traveler.verbToLeave>>
1480 <<traveler.travelerLocName>>. ";
1481 }
1482
1483 /*
1484 * a traveler is arriving locally (staying within view throughout the
1485 * travel, and coming closer to the PC)
1486 */
1487 sayArrivingLocally(traveler, dest)
1488 {
1489 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1490 <<traveler.travelerLocName>>. ";
1491 }
1492
1493 /*
1494 * a traveler is departing locally (staying within view throughout
1495 * the travel, and moving further away from the PC)
1496 */
1497 sayDepartingLocally(traveler, dest)
1498 {
1499 "\^<<traveler.travelerName(true)>> <<traveler.verbToLeave>>
1500 <<traveler.travelerLocName>>. ";
1501 }
1502
1503 /*
1504 * a traveler is traveling remotely (staying within view through the
1505 * travel, and moving from one remote top-level location to another)
1506 */
1507 sayTravelingRemotely(traveler, dest)
1508 {
1509 "\^<<traveler.travelerName(true)>> <<traveler.verbToGo>> to
1510 <<traveler.travelerLocName>>. ";
1511 }
1512
1513 /* a traveler is arriving from a compass direction */
1514 sayArrivingDir(traveler, dirName)
1515 {
1516 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1517 <<traveler.travelerRemoteLocName>> from the <<dirName>>. ";
1518 }
1519
1520 /* a traveler is leaving in a given compass direction */
1521 sayDepartingDir(traveler, dirName)
1522 {
1523 local nm = traveler.travelerRemoteLocName;
1524
1525 "\^<<traveler.travelerName(nil)>> <<traveler.verbToLeave>>
1526 to the <<dirName>><<nm != '' ? ' from ' + nm : ''>>. ";
1527 }
1528
1529 /* a traveler is arriving from a shipboard direction */
1530 sayArrivingShipDir(traveler, dirName)
1531 {
1532 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1533 <<traveler.travelerRemoteLocName>> from <<dirName>>. ";
1534 }
1535
1536 /* a traveler is leaving in a given shipboard direction */
1537 sayDepartingShipDir(traveler, dirName)
1538 {
1539 local nm = traveler.travelerRemoteLocName;
1540
1541 "\^<<traveler.travelerName(nil)>> <<traveler.verbToLeave>>
1542 to <<dirName>><<nm != '' ? ' from ' + nm : ''>>. ";
1543 }
1544
1545 /* a traveler is going aft */
1546 sayDepartingAft(traveler)
1547 {
1548 local nm = traveler.travelerRemoteLocName;
1549
1550 "\^<<traveler.travelerName(nil)>> <<traveler.verbToGo>>
1551 aft<<nm != '' ? ' from ' + nm : ''>>. ";
1552 }
1553
1554 /* a traveler is going fore */
1555 sayDepartingFore(traveler)
1556 {
1557 local nm = traveler.travelerRemoteLocName;
1558
1559 "\^<<traveler.travelerName(nil)>> <<traveler.verbToGo>>
1560 forward<<nm != '' ? ' from ' + nm : ''>>. ";
1561 }
1562
1563 /* a shipboard direction was attempted while not onboard a ship */
1564 notOnboardShip = "That direction {is|was}n&rsquo;t meaningful {|t}here. "
1565
1566 /* a traveler is leaving via a passage */
1567 sayDepartingThroughPassage(traveler, passage)
1568 {
1569 "\^<<traveler.travelerName(nil)>> <<traveler.verbToLeave>>
1570 <<traveler.travelerRemoteLocName>> through <<passage.theNameObj>>. ";
1571 }
1572
1573 /* a traveler is arriving via a passage */
1574 sayArrivingThroughPassage(traveler, passage)
1575 {
1576 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1577 <<traveler.travelerRemoteLocName>> through <<passage.theNameObj>>. ";
1578 }
1579
1580 /* a traveler is leaving via a path */
1581 sayDepartingViaPath(traveler, passage)
1582 {
1583 "\^<<traveler.travelerName(nil)>> <<traveler.verbToLeave>>
1584 <<traveler.travelerRemoteLocName>> via <<passage.theNameObj>>. ";
1585 }
1586
1587 /* a traveler is arriving via a path */
1588 sayArrivingViaPath(traveler, passage)
1589 {
1590 "\^<<traveler.travelerName(true)>> enter<<traveler.verbEndingSEd>>
1591 <<traveler.travelerRemoteLocName>> via <<passage.theNameObj>>. ";
1592 }
1593
1594 /* a traveler is leaving up a stairway */
1595 sayDepartingUpStairs(traveler, stairs)
1596 {
1597 "\^<<traveler.travelerName(nil)>> <<traveler.verbToGo>>
1598 up <<stairs.theNameObj>>. ";
1599 }
1600
1601 /* a traveler is leaving down a stairway */
1602 sayDepartingDownStairs(traveler, stairs)
1603 {
1604 "\^<<traveler.travelerName(nil)>> <<traveler.verbToGo>>
1605 down <<stairs.theNameObj>>. ";
1606 }
1607
1608 /* a traveler is arriving by coming up a stairway */
1609 sayArrivingUpStairs(traveler, stairs)
1610 {
1611 local nm = traveler.travelerRemoteLocName;
1612
1613 "\^<<traveler.travelerName(true)>> <<traveler.verbToCome>>
1614 up <<stairs.theNameObj>><<nm != '' ? ' to ' + nm : ''>>. ";
1615 }
1616
1617 /* a traveler is arriving by coming down a stairway */
1618 sayArrivingDownStairs(traveler, stairs)
1619 {
1620 local nm = traveler.travelerRemoteLocName;
1621
1622 "\^<<traveler.travelerName(true)>> <<traveler.verbToCome>>
1623 down <<stairs.theNameObj>><<nm != '' ? ' to ' + nm : ''>>. ";
1624 }
1625
1626 /* acompanying another actor on travel */
1627 sayDepartingWith(traveler, lead)
1628 {
1629 "\^<<traveler.travelerName(nil)>> <<traveler.verbToCome>>
1630 with <<lead.theNameObj>>. ";
1631 }
1632
1633 /*
1634 * Accompanying a tour guide. Note the seemingly reversed roles:
1635 * the lead actor is the one initiating the travel, and the tour
1636 * guide is the accompanying actor. So, the lead actor is
1637 * effectively following the accompanying actor. It seems
1638 * backwards, but really it's not: the tour guide merely shows the
1639 * lead actor where to go, but it's up to the lead actor to actually
1640 * initiate the travel.
1641 */
1642 sayDepartingWithGuide(guide, lead)
1643 {
1644 "\^<<lead.theName>> let<<tSel(lead.verbEndingS, '')>>
1645 <<guide.theNameObj>> lead the way. ";
1646 }
1647
1648 /* note that a door is being opened/closed remotely */
1649 sayOpenDoorRemotely(door, stat)
1650 {
1651 "Someone <<stat ? 'open' + tSel('s', 'ed')
1652 : 'close' + tSel('s', 'd')>>
1653 <<door.theNameObj>> from the other side. ";
1654 }
1655
1656 /*
1657 * open/closed status - these are simply adjectives that can be used
1658 * to describe the status of an openable object
1659 */
1660 openMsg(obj) { return 'open'; }
1661 closedMsg(obj) { return 'closed'; }
1662
1663 /* object is currently open/closed */
1664 currentlyOpen = '{It\'s dobj} currently open. '
1665 currentlyClosed = '{It\'s dobj} currently closed. '
1666
1667 /* stand-alone independent clause describing current open status */
1668 openStatusMsg(obj) { return obj.itIsContraction + ' ' + obj.openDesc; }
1669
1670 /* locked/unlocked status - adjectives describing lock states */
1671 lockedMsg(obj) { return 'locked'; }
1672 unlockedMsg(obj) { return 'unlocked'; }
1673
1674 /* object is currently locked/unlocked */
1675 currentlyLocked = '{It\'s dobj} currently locked. '
1676 currentlyUnlocked = '{It\'s dobj} currently unlocked. '
1677
1678 /*
1679 * on/off status - these are simply adjectives that can be used to
1680 * describe the status of a switchable object
1681 */
1682 onMsg(obj) { return 'on'; }
1683 offMsg(obj) { return 'off'; }
1684
1685 /* daemon report for burning out a match */
1686 matchBurnedOut(obj)
1687 {
1688 gMessageParams(obj);
1689 "{The obj/he} finish{es/ed} burning, and disappear{s/ed} into a
1690 cloud of ash. ";
1691 }
1692
1693 /* daemon report for burning out a candle */
1694 candleBurnedOut(obj)
1695 {
1696 gMessageParams(obj);
1697 "{The obj/he} burn{s/ed} down too far to stay lit, and {goes}
1698 out. ";
1699 }
1700
1701 /* daemon report for burning out a generic fueled light source */
1702 objBurnedOut(obj)
1703 {
1704 gMessageParams(obj);
1705 "{The obj/he} {goes} out. ";
1706 }
1707
1708 /*
1709 * Standard dialog titles, for the Web UI. These are shown in the
1710 * title bar area of the Web UI dialog used for inputDialog() calls.
1711 * These correspond to the InDlgIconXxx icons. The conventional
1712 * interpreters use built-in titles when titles are needed at all,
1713 * but in the Web UI we have to generate these ourselves.
1714 */
1715 dlgTitleNone = 'Note'
1716 dlgTitleWarning = 'Warning'
1717 dlgTitleInfo = 'Note'
1718 dlgTitleQuestion = 'Question'
1719 dlgTitleError = 'Error'
1720
1721 /*
1722 * Standard dialog button labels, for the Web UI. These are built in
1723 * to the conventional interpreters, but in the Web UI we have to
1724 * generate these ourselves.
1725 */
1726 dlgButtonOk = 'OK'
1727 dlgButtonCancel = 'Cancel'
1728 dlgButtonYes = 'Yes'
1729 dlgButtonNo = 'No'
1730
1731 /* web UI alert when a new user has joined a multi-user session */
1732 webNewUser(name) { "\b[<<name>> has joined the session.]\n"; }
1733
1734 /*
1735 * Warning prompt for inputFile() warnings generated when reading a
1736 * script file, for the Web UI. The interpreter normally displays
1737 * these warnings directly, but in Web UI mode, the program is
1738 * responsible, so we need localized messages.
1739 */
1740 inputFileScriptWarning(warning, filename)
1741 {
1742 /* remove the two-letter error code at the start of the string */
1743 warning = warning.substr(3);
1744
1745 /* build the message */
1746 return warning + ' Do you wish to proceed?';
1747 }
1748 inputFileScriptWarningButtons = [
1749 '&Yes, use this file', '&Choose another file', '&Stop the script']
1750 ;
1751
1752 /* ------------------------------------------------------------------------ */
1753 /*
1754 * Player Character messages. These messages are generated when the
1755 * player issues a regular command to the player character (i.e.,
1756 * without specifying a target actor).
1757 */
1758 playerMessages: libMessages
1759 /* invalid command syntax */
1760 commandNotUnderstood(actor)
1761 {
1762 "<.parser>The story doesn&rsquo;t understand that
1763 command.<./parser> ";
1764 }
1765
1766 /* a special topic can't be used right now, because it's inactive */
1767 specialTopicInactive(actor)
1768 {
1769 "<.parser>That command can&rsquo;t be used right now.<./parser> ";
1770 }
1771
1772 /* no match for a noun phrase */
1773 noMatch(actor, action, txt) { action.noMatch(self, actor, txt); }
1774
1775 /*
1776 * No match message - we can't see a match for the noun phrase. This
1777 * is the default for most verbs.
1778 */
1779 noMatchCannotSee(actor, txt)
1780 { "{You/he} {sees} no <<txt>> {|t}here. "; }
1781
1782 /*
1783 * No match message - we're not aware of a match for the noun phrase.
1784 * Some sensory actions, such as LISTEN TO and SMELL, use this
1785 * variation instead of the normal version; the things these commands
1786 * refer to tend to be intangible, so "you can't see that" tends to
1787 * be nonsensical.
1788 */
1789 noMatchNotAware(actor, txt)
1790 { "{You/he} {are} not aware of any <<txt>> {|t}here. "; }
1791
1792 /* 'all' is not allowed with the attempted action */
1793 allNotAllowed(actor)
1794 {
1795 "<.parser><q>All</q> cannot be used with that verb.<./parser> ";
1796 }
1797
1798 /* no match for 'all' */
1799 noMatchForAll(actor)
1800 {
1801 "<.parser>{You/he} {sees} nothing suitable {|t}here.<./parser> ";
1802 }
1803
1804 /* nothing left for 'all' after removing 'except' items */
1805 noMatchForAllBut(actor)
1806 {
1807 "<.parser>{You/he} {sees} nothing else
1808 {|t}here.<./parser> ";
1809 }
1810
1811 /* nothing left in a plural phrase after removing 'except' items */
1812 noMatchForListBut(actor) { noMatchForAllBut(actor); }
1813
1814 /* no match for a pronoun */
1815 noMatchForPronoun(actor, typ, pronounWord)
1816 {
1817 /* show the message */
1818 "<.parser>The word <q><<pronounWord>></q> doesn&rsquo;t refer to
1819 anything right now.<./parser> ";
1820 }
1821
1822 /*
1823 * Ask for a missing object - this is called when a command is
1824 * completely missing a noun phrase for one of its objects.
1825 */
1826 askMissingObject(actor, action, which)
1827 {
1828 reportQuestion('<.parser>\^' + action.whatObj(which)
1829 + ' do you want '
1830 + (actor.referralPerson == ThirdPerson
1831 ? actor.theName : '')
1832 + ' to '
1833 + action.getQuestionInf(which) + '?<./parser> ');
1834 }
1835
1836 /*
1837 * An object was missing - this is called under essentially the same
1838 * circumstances as askMissingObject, but in cases where interactive
1839 * resolution is impossible and we simply wish to report the problem
1840 * and do not wish to ask for help.
1841 */
1842 missingObject(actor, action, which)
1843 {
1844 "<.parser>You need to be more specific
1845 about <<action.whatObj(which)>> you want
1846 <<actor.referralPerson == ThirdPerson ? actor.theName : ''>>
1847 to <<action.getQuestionInf(which)>>.<./parser> ";
1848 }
1849
1850 /*
1851 * Ask for a missing literal phrase.
1852 */
1853 askMissingLiteral(actor, action, which)
1854 {
1855 /* use the standard missing-object message */
1856 askMissingObject(actor, action, which);
1857 }
1858
1859 /*
1860 * Show the message for a missing literal phrase.
1861 */
1862 missingLiteral(actor, action, which)
1863 {
1864 "<.parser>Please be more specific
1865 about <<action.whatObj(which)>> to
1866 <<action.getQuestionInf(which)>>. Try, for example,
1867 <<action.getQuestionInf(which)>> <q>something</q>.<./parser> ";
1868 }
1869
1870 /* reflexive pronoun not allowed */
1871 reflexiveNotAllowed(actor, typ, pronounWord)
1872 {
1873 "<.parser>The story doesn&rsquo;t understand how to use the word
1874 <q><<pronounWord>></q> like that.<./parser> ";
1875 }
1876
1877 /*
1878 * a reflexive pronoun disagrees in gender, number, or something
1879 * else with its referent
1880 */
1881 wrongReflexive(actor, typ, pronounWord)
1882 {
1883 "<.parser>The story doesn&rsquo;t understand what the
1884 word <q><<pronounWord>></q> refers to.<./parser> ";
1885 }
1886
1887 /* no match for a possessive phrase */
1888 noMatchForPossessive(actor, owner, txt)
1889 {
1890 "<.parser>\^<<owner.nameDoes>>
1891 not appear to have any such thing.<./parser> ";
1892 }
1893
1894 /* no match for a plural possessive phrase */
1895 noMatchForPluralPossessive(actor, txt)
1896 {
1897 "<.parser>\^They <<tSel('do', 'did')>> not appear to have any such
1898 thing.<./parser> ";
1899 }
1900
1901 /* no match for a containment phrase */
1902 noMatchForLocation(actor, loc, txt)
1903 {
1904 "<.parser>\^<<actor.nameSees>>
1905 no <<loc.childInName(txt)>>.<./parser> ";
1906 }
1907
1908 /* nothing in a container whose contents are specifically requested */
1909 nothingInLocation(actor, loc)
1910 {
1911 "<.parser>\^<<actor.nameSees>>
1912 <<loc.childInName('nothing unusual')>>.<./parser> ";
1913 }
1914
1915 /* no match for the response to a disambiguation question */
1916 noMatchDisambig(actor, origPhrase, disambigResponse)
1917 {
1918 /*
1919 * show the message, leaving the <.parser> tag mode open - we
1920 * always show another disambiguation prompt after this message,
1921 * so we'll let the prompt close the <.parser> mode
1922 */
1923 "<.parser>That was not one of the choices. ";
1924 }
1925
1926 /* empty noun phrase ('take the') */
1927 emptyNounPhrase(actor)
1928 {
1929 "<.parser>You seem to have left out some words.<./parser> ";
1930 }
1931
1932 /* 'take zero books' */
1933 zeroQuantity(actor, txt)
1934 {
1935 "<.parser>\^<<actor.theName>> <<actor.verbCant>> do that to zero of
1936 something.<./parser> ";
1937 }
1938
1939 /* insufficient quantity to meet a command request ('take five books') */
1940 insufficientQuantity(actor, txt, matchList, requiredNum)
1941 {
1942 "<.parser>\^<<actor.nameDoes>>n&rsquo;t see that many
1943 <<txt>> <<tSel('here', 'there')>>.<./parser> ";
1944 }
1945
1946 /* a unique object is required, but multiple objects were specified */
1947 uniqueObjectRequired(actor, txt, matchList)
1948 {
1949 "<.parser>You can&rsquo;t use multiple objects there.<./parser> ";
1950 }
1951
1952 /* a single noun phrase is required, but a noun list was used */
1953 singleObjectRequired(actor, txt)
1954 {
1955 "<.parser>Multiple objects aren&rsquo;t allowed with that
1956 command.<./parser> ";
1957 }
1958
1959 /*
1960 * The answer to a disambiguation question specifies an invalid
1961 * ordinal ("the fourth one" when only three choices were offered).
1962 *
1963 * 'ordinalWord' is the ordinal word entered ('fourth' or the like).
1964 * 'originalText' is the text of the noun phrase that caused the
1965 * disambiguation question to be asked in the first place.
1966 */
1967 disambigOrdinalOutOfRange(actor, ordinalWord, originalText)
1968 {
1969 /* leave the <.parser> tag open, for the re-prompt that will follow */
1970 "<.parser>There were not that many choices. ";
1971 }
1972
1973 /*
1974 * Ask the canonical disambiguation question: "Which x do you
1975 * mean...?". 'matchList' is the list of ambiguous objects with any
1976 * redundant equivalents removed; and 'fullMatchList' is the full
1977 * list, including redundant equivalents that were removed from
1978 * 'matchList'.
1979 *
1980 * If askingAgain is true, it means that we're asking the question
1981 * again because we got an invalid response to the previous attempt
1982 * at the same prompt. We will have explained the problem, and now
1983 * we're going to give the user another crack at the same response.
1984 *
1985 * To prevent interactive disambiguation, do this:
1986 *
1987 * throw new ParseFailureException(&ambiguousNounPhrase,
1988 *. originalText, matchList, fullMatchList);
1989 */
1990 askDisambig(actor, originalText, matchList, fullMatchList,
1991 requiredNum, askingAgain, dist)
1992 {
1993 /* mark this as a question report with a dummy report */
1994 reportQuestion('');
1995
1996 /*
1997 * Open the "<.parser>" tag, if we're not "asking again." If we
1998 * are asking again, we will already have shown a message
1999 * explaining why we're asking again, and that message will have
2000 * left us in <.parser> tag mode, so we don't need to open the
2001 * tag again.
2002 */
2003 if (!askingAgain)
2004 "<.parser>";
2005
2006 /*
2007 * the question varies depending on whether we want just one
2008 * object or several objects in the final result
2009 */
2010 if (requiredNum == 1)
2011 {
2012 /*
2013 * One object needed - use the original text in the query.
2014 *
2015 * Note that if we're "asking again," we will have shown an
2016 * additional message first explaining *why* we're asking
2017 * again, and that message will have left us in <.parser>
2018 * tag mode; so we need to close the <.parser> tag in this
2019 * case, but we don't need to show a new one.
2020 */
2021 if (askingAgain)
2022 "Which did you mean,
2023 <<askDisambigList(matchList, fullMatchList, nil, dist)>>?";
2024 else
2025 "Which <<originalText>> do you mean,
2026 <<askDisambigList(matchList, fullMatchList, nil, dist)>>?";
2027 }
2028 else
2029 {
2030 /*
2031 * Multiple objects required - ask by number, since we can't
2032 * easily guess what the plural might be given the original
2033 * text.
2034 *
2035 * As above, we only need to *close* the <.parser> tag if
2036 * we're asking again, because we will already have shown a
2037 * prompt that opened the tag in this case.
2038 */
2039 if (askingAgain)
2040 "Which <<spellInt(requiredNum)>> (of
2041 <<askDisambigList(matchList, fullMatchList, true, dist)>>)
2042 did you mean?";
2043 else
2044 "Which <<spellInt(requiredNum)>>
2045 (of <<askDisambigList(matchList, fullMatchList,
2046 true, dist)>>) do you mean?";
2047 }
2048
2049 /* close the <.parser> tag */
2050 "<./parser> ";
2051 }
2052
2053 /*
2054 * we found an ambiguous noun phrase, but we were unable to perform
2055 * interactive disambiguation
2056 */
2057 ambiguousNounPhrase(actor, originalText, matchList, fullMatchList)
2058 {
2059 "<.parser>The story doesn&rsquo;t know which
2060 <<originalText>> you mean.<./parser> ";
2061 }
2062
2063 /* the actor is missing in a command */
2064 missingActor(actor)
2065 {
2066 "<.parser>You must be more specific about <<
2067 whomPronoun>> you want<<tSel('', 'ed')>> to address.<./parser> ";
2068 }
2069
2070 /* only a single actor can be addressed at a time */
2071 singleActorRequired(actor)
2072 {
2073 "<.parser>You can only address one person at a time.<./parser> ";
2074 }
2075
2076 /* cannot change actor mid-command */
2077 cannotChangeActor()
2078 {
2079 "<.parser>You cannot address more than one character on
2080 a single command line in this story.<./parser> ";
2081 }
2082
2083 /*
2084 * tell the user they entered a word we don't know, offering the
2085 * chance to correct it with "oops"
2086 */
2087 askUnknownWord(actor, txt)
2088 {
2089 /* start the message */
2090 "<.parser>The word <q><<txt>></q> is not necessary in this
2091 story.<./parser> ";
2092
2093 /* mention the OOPS command, if appropriate */
2094 oopsNote();
2095 }
2096
2097 /*
2098 * tell the user they entered a word we don't know, but don't offer
2099 * an interactive way to fix it (i.e., we can't use OOPS at this
2100 * point)
2101 */
2102 wordIsUnknown(actor, txt)
2103 {
2104 "<.parser>The story doesn&rsquo;t understand that
2105 command.<./parser> ";
2106 }
2107
2108 /* the actor refuses the command because it's busy with something else */
2109 refuseCommandBusy(targetActor, issuingActor)
2110 {
2111 "\^<<targetActor.nameIs>> busy. ";
2112 }
2113
2114 /* cannot speak to multiple actors */
2115 cannotAddressMultiple(actor)
2116 {
2117 "<.parser>\^<<actor.theName>> <<actor.verbCannot>> address multiple
2118 people at once.<./parser> ";
2119 }
2120
2121 /*
2122 * Remaining actions on the command line were aborted due to the
2123 * failure of the current action. This is just a hook for the game's
2124 * use, if it wants to provide an explanation; by default, we do
2125 * nothing. Note that games that override this will probably want to
2126 * use a flag property so that they only show this message once -
2127 * it's really only desirable to explain the the mechanism, not to
2128 * flag it every time it's used.
2129 */
2130 explainCancelCommandLine()
2131 {
2132 }
2133 ;
2134
2135 /* ------------------------------------------------------------------------ */
2136 /*
2137 * Non-Player Character (NPC) messages - parser-mediated format. These
2138 * versions of the NPC messages report errors through the
2139 * parser/narrator.
2140 *
2141 * Note that a separate set of messages can be selected to report
2142 * messages in the voice of the NPC - see npcMessagesDirect below.
2143 */
2144
2145 /*
2146 * Standard Non-Player Character (NPC) messages. These messages are
2147 * generated when the player issues a command to a specific non-player
2148 * character.
2149 */
2150 npcMessages: playerMessages
2151 /* the target cannot hear a command we gave */
2152 commandNotHeard(actor)
2153 {
2154 "\^<<actor.nameDoes>> not respond. ";
2155 }
2156
2157 /* no match for a noun phrase */
2158 noMatchCannotSee(actor, txt)
2159 { "\^<<actor.nameSees>> no <<txt>>. "; }
2160 noMatchNotAware(actor, txt)
2161 { "\^<<actor.nameIs>> not aware of any <<txt>>. "; }
2162
2163 /* no match for 'all' */
2164 noMatchForAll(actor)
2165 {
2166 "<.parser>\^<<actor.nameDoes>>n&rsquo;t see anything
2167 suitable.<./parser> ";
2168 }
2169
2170 /* nothing left for 'all' after removing 'except' items */
2171 noMatchForAllBut(actor)
2172 {
2173 "<.parser>\^<<actor.nameSees>> nothing
2174 else.<./parser> ";
2175 }
2176
2177 /* insufficient quantity to meet a command request ('take five books') */
2178 insufficientQuantity(actor, txt, matchList, requiredNum)
2179 {
2180 "<.parser>\^<<actor.nameDoes>>n&rsquo;t see that many
2181 <<txt>>.<./parser> ";
2182 }
2183
2184 /*
2185 * we found an ambiguous noun phrase, but we were unable to perform
2186 * interactive disambiguation
2187 */
2188 ambiguousNounPhrase(actor, originalText, matchList, fullMatchList)
2189 {
2190 "<.parser>\^<<actor.nameDoes>>n&rsquo;t know which
2191 <<originalText>> you mean<<tSel('', 't')>>.<./parser> ";
2192 }
2193
2194 /*
2195 * Missing object query and error message templates
2196 */
2197 askMissingObject(actor, action, which)
2198 {
2199 reportQuestion('<.parser>\^' + action.whatObj(which)
2200 + ' do you want ' + actor.theNameObj + ' to '
2201 + action.getQuestionInf(which) + '?<./parser> ');
2202 }
2203 missingObject(actor, action, which)
2204 {
2205 "<.parser>You must be more specific
2206 about <<action.whatObj(which)>> you want <<actor.theNameObj>> to
2207 <<action.getQuestionInf(which)>>.<./parser> ";
2208 }
2209
2210 /* missing literal phrase query and error message templates */
2211 missingLiteral(actor, action, which)
2212 {
2213 "<.parser>You must be more specific about <<action.whatObj(which)>>
2214 you want <<actor.theNameObj>> to <<action.getQuestionInf(which)>>.
2215 For example: <<actor.theName>>, <<action.getQuestionInf(which)>>
2216 <q>something</q>.<./parser> ";
2217 }
2218 ;
2219
2220 /*
2221 * Deferred NPC messages. We use this to report deferred messages from
2222 * an NPC to the player. A message is deferred when a parsing error
2223 * occurs, but the NPC can't talk to the player because there's no sense
2224 * path to the player. When this happens, the NPC queues the message
2225 * for eventual delivery; when a sense path appears later that lets the
2226 * NPC talk to the player, we deliver the message through this object.
2227 * Since these messages describe conditions that occurred in the past,
2228 * we use the past tense to phrase the messages.
2229 *
2230 * This default implementation simply doesn't report deferred errors at
2231 * all. The default message voice is the parser/narrator character, and
2232 * there is simply no good way for the parser/narrator to say that a
2233 * command failed in the past for a given character: "Bob looks like he
2234 * didn't know which box you meant" just doesn't work. So, we'll simply
2235 * not report these errors at all.
2236 *
2237 * To report messages in the NPC's voice directly, modify the NPC's
2238 * Actor object, or the Actor base class, to return
2239 * npcDeferredMessagesDirect rather than this object from
2240 * getParserMessageObj().
2241 */
2242 npcDeferredMessages: object
2243 ;
2244
2245 /* ------------------------------------------------------------------------ */
2246 /*
2247 * NPC messages, reported directly in the voice of the NPC. These
2248 * messages are not selected by default, but a game can use them instead
2249 * of the parser-mediated versions by modifying the actor object's
2250 * getParserMessageObj() to return these objects.
2251 */
2252
2253 /*
2254 * Standard Non-Player Character (NPC) messages. These messages are
2255 * generated when the player issues a command to a specific non-player
2256 * character.
2257 */
2258 npcMessagesDirect: npcMessages
2259 /* no match for a noun phrase */
2260 noMatchCannotSee(actor, txt)
2261 {
2262 "\^<<actor.nameVerb('look')>> around. <q>I don&rsquo;t
2263 see any <<txt>>.</q> ";
2264 }
2265 noMatchNotAware(actor, txt)
2266 {
2267 "<q>I&rsquo;m not aware of any <<txt>>,</q> <<actor.nameSays>>. ";
2268 }
2269
2270 /* no match for 'all' */
2271 noMatchForAll(actor)
2272 {
2273 "\^<<actor.nameSays>>, <q>I don&rsquo;t see anything suitable.</q> ";
2274 }
2275
2276 /* nothing left for 'all' after removing 'except' items */
2277 noMatchForAllBut(actor)
2278 {
2279 "\^<<actor.nameSays>>, <q>I see nothing else here.</q> ";
2280 }
2281
2282 /* 'take zero books' */
2283 zeroQuantity(actor, txt)
2284 {
2285 "\^<<actor.nameSays>>,
2286 <q>I can&rsquo;t do that to zero of something.</q> ";
2287 }
2288
2289 /* insufficient quantity to meet a command request ('take five books') */
2290 insufficientQuantity(actor, txt, matchList, requiredNum)
2291 {
2292 "\^<<actor.nameSays>>,
2293 <q>I don&rsquo;t see that many <<txt>> here.</q> ";
2294 }
2295
2296 /* a unique object is required, but multiple objects were specified */
2297 uniqueObjectRequired(actor, txt, matchList)
2298 {
2299 "\^<<actor.nameSays>>,
2300 <q>I can&rsquo;t use multiple objects like that.</q> ";
2301 }
2302
2303 /* a single noun phrase is required, but a noun list was used */
2304 singleObjectRequired(actor, txt)
2305 {
2306 "\^<<actor.nameSays>>,
2307 <q>I can&rsquo;t use multiple objects like that.</q> ";
2308 }
2309
2310 /* no match for the response to a disambiguation question */
2311 noMatchDisambig(actor, origPhrase, disambigResponse)
2312 {
2313 /* leave the quote open for the re-prompt */
2314 "\^<<actor.nameSays>>,
2315 <q>That was not one of the choices. ";
2316 }
2317
2318 /*
2319 * The answer to a disambiguation question specifies an invalid
2320 * ordinal ("the fourth one" when only three choices were offered).
2321 *
2322 * 'ordinalWord' is the ordinal word entered ('fourth' or the like).
2323 * 'originalText' is the text of the noun phrase that caused the
2324 * disambiguation question to be asked in the first place.
2325 */
2326 disambigOrdinalOutOfRange(actor, ordinalWord, originalText)
2327 {
2328 /* leave the quote open for the re-prompt */
2329 "\^<<actor.nameSays>>,
2330 <q>There weren&rsquo;t that many choices. ";
2331 }
2332
2333 /*
2334 * Ask the canonical disambiguation question: "Which x do you
2335 * mean...?". 'matchList' is the list of ambiguous objects with any
2336 * redundant equivalents removed, and 'fullMatchList' is the full
2337 * list, including redundant equivalents that were removed from
2338 * 'matchList'.
2339 *
2340 * To prevent interactive disambiguation, do this:
2341 *
2342 * throw new ParseFailureException(&ambiguousNounPhrase,
2343 *. originalText, matchList, fullMatchList);
2344 */
2345 askDisambig(actor, originalText, matchList, fullMatchList,
2346 requiredNum, askingAgain, dist)
2347 {
2348 /* mark this as a question report */
2349 reportQuestion('');
2350
2351 /* the question depends on the number needed */
2352 if (requiredNum == 1)
2353 {
2354 /* one required - ask with the original text */
2355 if (!askingAgain)
2356 "\^<<actor.nameVerb('ask')>>, <q>";
2357
2358 "Which <<originalText>> do you mean, <<
2359 askDisambigList(matchList, fullMatchList, nil, dist)>>?</q> ";
2360 }
2361 else
2362 {
2363 /*
2364 * more than one required - we can't guess at the plural
2365 * given the original text, so just use the number
2366 */
2367 if (!askingAgain)
2368 "\^<<actor.nameVerb('ask')>>, <q>";
2369
2370 "Which <<spellInt(requiredNum)>> (of <<
2371 askDisambigList(matchList, fullMatchList, true, dist)>>)
2372 do you mean?</q> ";
2373 }
2374 }
2375
2376 /*
2377 * we found an ambiguous noun phrase, but we were unable to perform
2378 * interactive disambiguation
2379 */
2380 ambiguousNounPhrase(actor, originalText, matchList, fullMatchList)
2381 {
2382 "\^<<actor.nameSays>>,
2383 <q>I don&rsquo;t know which <<originalText>> you mean.</q> ";
2384 }
2385
2386 /*
2387 * Missing object query and error message templates
2388 */
2389 askMissingObject(actor, action, which)
2390 {
2391 reportQuestion('\^' + actor.nameSays
2392 + ', <q>\^' + action.whatObj(which)
2393 + ' do you want me to '
2394 + action.getQuestionInf(which) + '?</q> ');
2395 }
2396 missingObject(actor, action, which)
2397 {
2398 "\^<<actor.nameSays>>,
2399 <q>I don&rsquo;t know <<action.whatObj(which)>>
2400 you want me to <<action.getQuestionInf(which)>>.</q> ";
2401 }
2402 missingLiteral(actor, action, which)
2403 {
2404 /* use the same message we use for a missing ordinary object */
2405 missingObject(actor, action, which);
2406 }
2407
2408 /* tell the user they entered a word we don't know */
2409 askUnknownWord(actor, txt)
2410 {
2411 "\^<<actor.nameSays>>,
2412 <q>I don&rsquo;t know the word <q><<txt>></q>.</q> ";
2413 }
2414
2415 /* tell the user they entered a word we don't know */
2416 wordIsUnknown(actor, txt)
2417 {
2418 "\^<<actor.nameSays>>,
2419 <q>You used a word I don&rsquo;t know.</q> ";
2420 }
2421 ;
2422
2423 /*
2424 * Deferred NPC messages. We use this to report deferred messages from
2425 * an NPC to the player. A message is deferred when a parsing error
2426 * occurs, but the NPC can't talk to the player because there's no sense
2427 * path to the player. When this happens, the NPC queues the message
2428 * for eventual delivery; when a sense path appears later that lets the
2429 * NPC talk to the player, we deliver the message through this object.
2430 * Since these messages describe conditions that occurred in the past,
2431 * we use the past tense to phrase the messages.
2432 *
2433 * Some messages will never be deferred:
2434 *
2435 * commandNotHeard - if a command is not heard, it will never enter an
2436 * actor's command queue; the error is given immediately in response to
2437 * the command entry.
2438 *
2439 * refuseCommandBusy - same as commandNotHeard
2440 *
2441 * noMatchDisambig - interactive disambiguation will not happen in a
2442 * deferred response situation, so it is impossible to have an
2443 * interactive disambiguation failure.
2444 *
2445 * disambigOrdinalOutOfRange - for the same reason noMatchDisambig can't
2446 * be deferred.
2447 *
2448 * askDisambig - if we couldn't display a message, we definitely
2449 * couldn't perform interactive disambiguation.
2450 *
2451 * askMissingObject - for the same reason that askDisambig can't be
2452 * deferred
2453 *
2454 * askUnknownWord - for the same reason that askDisambig can't be
2455 * deferred.
2456 */
2457 npcDeferredMessagesDirect: npcDeferredMessages
2458 commandNotUnderstood(actor)
2459 {
2460 "\^<<actor.nameSays>>,
2461 <q>I didn&rsquo;t understand what you meant.</q> ";
2462 }
2463
2464 /* no match for a noun phrase */
2465 noMatchCannotSee(actor, txt)
2466 {
2467 "\^<<actor.nameSays>>, <q>I didn&rsquo;t see any <<txt>>.</q> ";
2468 }
2469 noMatchNotAware(actor, txt)
2470 {
2471 "\^<<actor.nameSays>>, <q>I wasn&rsquo;t aware of any <<txt>>.</q> ";
2472 }
2473
2474 /* no match for 'all' */
2475 noMatchForAll(actor)
2476 {
2477 "\^<<actor.nameSays>>, <q>I didn&rsquo;t see anything suitable.</q> ";
2478 }
2479
2480 /* nothing left for 'all' after removing 'except' items */
2481 noMatchForAllBut(actor)
2482 {
2483 "\^<<actor.nameSays>>,
2484 <q>I didn&rsquo;t see what you meant.</q> ";
2485 }
2486
2487 /* empty noun phrase ('take the') */
2488 emptyNounPhrase(actor)
2489 {
2490 "\^<<actor.nameSays>>,
2491 <q>You left some words out.</q> ";
2492 }
2493
2494 /* 'take zero books' */
2495 zeroQuantity(actor, txt)
2496 {
2497 "\^<<actor.nameSays>>,
2498 <q>I didn&rsquo;t understand what you meant.</q> ";
2499 }
2500
2501 /* insufficient quantity to meet a command request ('take five books') */
2502 insufficientQuantity(actor, txt, matchList, requiredNum)
2503 {
2504 "\^<<actor.nameSays>>,
2505 <q>I didn&rsquo;t see enough <<txt>>.</q> ";
2506 }
2507
2508 /* a unique object is required, but multiple objects were specified */
2509 uniqueObjectRequired(actor, txt, matchList)
2510 {
2511 "\^<<actor.nameSays>>,
2512 <q>I didn&rsquo;t understand what you meant.</q> ";
2513 }
2514
2515 /* a unique object is required, but multiple objects were specified */
2516 singleObjectRequired(actor, txt)
2517 {
2518 "\^<<actor.nameSays>>,
2519 <q>I didn&rsquo;t understand what you meant.</q> ";
2520 }
2521
2522 /*
2523 * we found an ambiguous noun phrase, but we were unable to perform
2524 * interactive disambiguation
2525 */
2526 ambiguousNounPhrase(actor, originalText, matchList, fullMatchList)
2527 {
2528 "\^<<actor.nameSays>>,
2529 <q>I couldn&rsquo;t tell which <<originalText>> you meant.</q> ";
2530 }
2531
2532 /* an object phrase was missing */
2533 askMissingObject(actor, action, which)
2534 {
2535 reportQuestion('\^' + actor.nameSays
2536 + ', <q>I didn&rsquo;t know '
2537 + action.whatObj(which) + ' you wanted me to '
2538 + action.getQuestionInf(which) + '.</q> ');
2539 }
2540
2541 /* tell the user they entered a word we don't know */
2542 wordIsUnknown(actor, txt)
2543 {
2544 "\^<<actor.nameSays>>,
2545 <q>You used a word I don&rsquo;t know.</q> ";
2546 }
2547 ;
2548
2549 /* ------------------------------------------------------------------------ */
2550 /*
2551 * Verb messages for standard library verb implementations for actions
2552 * performed by the player character. These return strings suitable for
2553 * use in VerifyResult objects as well as for action reports
2554 * (defaultReport, mainReport, and so on).
2555 *
2556 * Most of these messages are generic enough to be used for player and
2557 * non-player character alike. However, some of the messages either are
2558 * too terse (such as the default reports) or are phrased awkwardly for
2559 * NPC use, so the NPC verb messages override those.
2560 */
2561 playerActionMessages: MessageHelper
2562 /*
2563 * generic "can't do that" message - this is used when verification
2564 * fails because an object doesn't define the action ("doXxx")
2565 * method for the verb
2566 */
2567 cannotDoThatMsg = '{You/he} {can\'t} do that. '
2568
2569 /* must be holding something before a command */
2570 mustBeHoldingMsg(obj)
2571 {
2572 gMessageParams(obj);
2573 return '{You/he} {must} be holding {the obj/him} to do that. ';
2574 }
2575
2576 /* it's too dark to do that */
2577 tooDarkMsg = 'It{&rsquo;s| was} too dark to do that. '
2578
2579 /* object must be visible */
2580 mustBeVisibleMsg(obj)
2581 {
2582 gMessageParams(obj);
2583 return '{You/he} {cannot} see {that obj/him}. ';
2584 }
2585
2586 /* object can be heard but not seen */
2587 heardButNotSeenMsg(obj)
2588 {
2589 gMessageParams(obj);
2590 return '{You/he} {can} hear {an obj/him}, but {you/he}
2591 {can\'t} see {it obj/him}. ';
2592 }
2593
2594 /* object can be smelled but not seen */
2595 smelledButNotSeenMsg(obj)
2596 {
2597 gMessageParams(obj);
2598 return '{You/he} {can} smell {an obj/him}, but {you/he}
2599 {can\'t} see {it obj/him}. ';
2600 }
2601
2602 /* cannot hear object */
2603 cannotHearMsg(obj)
2604 {
2605 gMessageParams(obj);
2606 return '{You/he} {cannot} hear {that obj/him}. ';
2607 }
2608
2609 /* cannot smell object */
2610 cannotSmellMsg(obj)
2611 {
2612 gMessageParams(obj);
2613 return '{You/he} {cannot} smell {that obj/him}. ';
2614 }
2615
2616 /* cannot taste object */
2617 cannotTasteMsg(obj)
2618 {
2619 gMessageParams(obj);
2620 return '{You/he} {cannot} taste {that obj/him}. ';
2621 }
2622
2623 /* must remove an article of clothing before a command */
2624 cannotBeWearingMsg(obj)
2625 {
2626 gMessageParams(obj);
2627 return '{You/he} {must} take off {the obj/him}
2628 before {it actor/he} {can} do that. ';
2629 }
2630
2631 /* all contents must be removed from object before doing that */
2632 mustBeEmptyMsg(obj)
2633 {
2634 gMessageParams(obj);
2635 return '{You/he} {must} take everything out of {the obj/him}
2636 before {it actor/he} {can} do that. ';
2637 }
2638
2639 /* object must be opened before doing that */
2640 mustBeOpenMsg(obj)
2641 {
2642 gMessageParams(obj);
2643 return '{You/he} {must} open {the obj/him}
2644 before {it actor/he} {can} do that. ';
2645 }
2646
2647 /* object must be closed before doing that */
2648 mustBeClosedMsg(obj)
2649 {
2650 gMessageParams(obj);
2651 return '{You/he} {must} close {the obj/him}
2652 before {it actor/he} {can} do that. ';
2653 }
2654
2655 /* object must be unlocked before doing that */
2656 mustBeUnlockedMsg(obj)
2657 {
2658 gMessageParams(obj);
2659 return '{You/he} {must} unlock {the obj/him}
2660 before {it actor/he} {can} do that. ';
2661 }
2662
2663 /* no key is needed to lock or unlock this object */
2664 noKeyNeededMsg = '{The dobj/he} {does} not appear to take a key. '
2665
2666 /* actor must be standing before doing that */
2667 mustBeStandingMsg = '{You/he} {must} stand up before {it actor/he}
2668 {can} do that. '
2669
2670 /* must be sitting on/in chair */
2671 mustSitOnMsg(obj)
2672 {
2673 gMessageParams(obj);
2674 return '{You/he} {must} sit {in obj} first. ';
2675 }
2676
2677 /* must be lying on/in object */
2678 mustLieOnMsg(obj)
2679 {
2680 gMessageParams(obj);
2681 return '{You/he} {must} lie {in obj} first. ';
2682 }
2683
2684 /* must get on/in object */
2685 mustGetOnMsg(obj)
2686 {
2687 gMessageParams(obj);
2688 return '{You/he} {must} get {in obj} first. ';
2689 }
2690
2691 /* object must be in loc before doing that */
2692 mustBeInMsg(obj, loc)
2693 {
2694 gMessageParams(obj, loc);
2695 return '{The obj/he} {must} be {in loc} before {you/he}
2696 {can} do that. ';
2697 }
2698
2699 /* actor must be holding the object before we can do that */
2700 mustBeCarryingMsg(obj, actor)
2701 {
2702 gMessageParams(obj, actor);
2703 return '{The actor/he} {must} be holding {the obj/him}
2704 before {it actor/he} {can} do that. ';
2705 }
2706
2707 /* generic "that's not important" message for decorations */
2708 decorationNotImportantMsg(obj)
2709 {
2710 gMessageParams(obj);
2711 return '{The obj/he} {is}n&rsquo;t important. ';
2712 }
2713
2714 /* generic "you don't see that" message for "unthings" */
2715 unthingNotHereMsg(obj)
2716 {
2717 gMessageParams(obj);
2718 return '{You/he} {does}n&rsquo;t see {that obj/him} {|t}here. ';
2719 }
2720
2721 /* generic "that's too far away" message for Distant items */
2722 tooDistantMsg(obj)
2723 {
2724 gMessageParams(obj);
2725 return '{The obj/he} {is} too far away. ';
2726 }
2727
2728 /* generic "no can do" message for intangibles */
2729 notWithIntangibleMsg(obj)
2730 {
2731 gMessageParams(obj);
2732 return '{You/he} {can\'t} do that to {an obj/him}. ';
2733 }
2734
2735 /* generic failure message for varporous objects */
2736 notWithVaporousMsg(obj)
2737 {
2738 gMessageParams(obj);
2739 return '{You/he} {can\'t} do that to {an obj/him}. ';
2740 }
2741
2742 /* look in/look under/look through/look behind/search vaporous */
2743 lookInVaporousMsg(obj)
2744 {
2745 gMessageParams(obj);
2746 return '{You/he} just {sees} {the obj/him}. ';
2747 }
2748
2749 /*
2750 * cannot reach (i.e., touch) an object that is to be manipulated in
2751 * a command - this is a generic message used when we cannot
2752 * identify the specific reason that the object is in scope but
2753 * cannot be touched
2754 */
2755 cannotReachObjectMsg(obj)
2756 {
2757 gMessageParams(obj);
2758 return '{You/he} {cannot} reach {the obj/him}. ';
2759 }
2760
2761 /* cannot reach an object through an obstructor */
2762 cannotReachThroughMsg(obj, loc)
2763 {
2764 gMessageParams(obj, loc);
2765 return '{You/he} {cannot} reach {the obj/him} through '
2766 + '{the loc/him}. ';
2767 }
2768
2769 /* generic long description of a Thing */
2770 thingDescMsg(obj)
2771 {
2772 gMessageParams(obj);
2773 return '{You/he} {sees} nothing unusual about '
2774 + '{it obj/him}. ';
2775 }
2776
2777 /* generic LISTEN TO description of a Thing */
2778 thingSoundDescMsg(obj)
2779 { return '{You/he} hear{s/d} nothing out of the ordinary. '; }
2780
2781 /* generic "smell" description of a Thing */
2782 thingSmellDescMsg(obj)
2783 { return '{You/he} smell{s/ed} nothing out of the ordinary. '; }
2784
2785 /* default description of a non-player character */
2786 npcDescMsg(npc)
2787 {
2788 gMessageParams(npc);
2789 return '{You/he} {sees} nothing unusual about '
2790 + '{the npc/him}. ';
2791 }
2792
2793 /* generic messages for looking prepositionally */
2794 nothingInsideMsg =
2795 'There{&rsquo;s| was} nothing unusual in {the dobj/him}. '
2796 nothingUnderMsg =
2797 '{You/he} {sees} nothing unusual under {the dobj/him}. '
2798 nothingBehindMsg =
2799 '{You/he} {sees} nothing unusual behind {the dobj/him}. '
2800 nothingThroughMsg =
2801 '{You/he} {can} see nothing through {the dobj/him}. '
2802
2803 /* this is an object we can't look behind/through */
2804 cannotLookBehindMsg = '{You/he} {can\'t} look behind {the dobj/him}. '
2805 cannotLookUnderMsg = '{You/he} {can\'t} look under {the dobj/him}. '
2806 cannotLookThroughMsg = '{You/he} {can\'t} see through {the dobj/him}. '
2807
2808 /* looking through an open passage */
2809 nothingThroughPassageMsg = '{You/he} {can\'t} see much through
2810 {the dobj/him} from {|t}here. '
2811
2812 /* there's nothing on the other side of a door we just opened */
2813 nothingBeyondDoorMsg = 'Opening {the dobj/him} reveal{s|ed} nothing
2814 unusual. '
2815
2816 /* there's nothing here with a specific odor */
2817 nothingToSmellMsg =
2818 '{You/he} smell{s/ed} nothing out of the ordinary. '
2819
2820 /* there's nothing here with a specific noise */
2821 nothingToHearMsg = '{You/he} hear{s/d} nothing out of the ordinary. '
2822
2823 /* a sound appears to be coming from a source */
2824 noiseSourceMsg(src)
2825 {
2826 return '{The dobj/he} seem{s/ed} to be coming from '
2827 + src.theNameObj + '. ';
2828 }
2829
2830 /* an odor appears to be coming from a source */
2831 odorSourceMsg(src)
2832 {
2833 return '{The dobj/he} seem{s/ed} to be coming from '
2834 + src.theNameObj + '. ';
2835 }
2836
2837 /* an item is not wearable */
2838 notWearableMsg =
2839 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} wear. '
2840
2841 /* doffing something that isn't wearable */
2842 notDoffableMsg =
2843 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} remove. '
2844
2845 /* already wearing item */
2846 alreadyWearingMsg = '{You\'re} already wearing {it dobj/him}. '
2847
2848 /* not wearing (item being doffed) */
2849 notWearingMsg = '{You\'re} not wearing {that dobj/him}. '
2850
2851 /* default response to 'wear obj' */
2852 okayWearMsg = 'Okay, {you\'re} now wearing {the dobj/him}. '
2853
2854 /* default response to 'doff obj' */
2855 okayDoffMsg = 'Okay, {you\'re} no longer wearing {the dobj/him}. '
2856
2857 /* default response to open/close */
2858 okayOpenMsg = shortTMsg(
2859 'Opened. ', '{You/he} open{s/ed} {the dobj/him}. ')
2860 okayCloseMsg = shortTMsg(
2861 'Closed. ', '{You/he} close{s/d} {the dobj/him}. ')
2862
2863 /* default response to lock/unlock */
2864 okayLockMsg = shortTMsg(
2865 'Locked. ', '{You/he} lock{s/ed} {the dobj/him}. ')
2866 okayUnlockMsg = shortTMsg(
2867 'Unlocked. ', '{You/he} unlock{s/ed} {the dobj/him}. ')
2868
2869 /* cannot dig here */
2870 cannotDigMsg = '{You/he} {have} no reason to dig in {that dobj/him}. '
2871
2872 /* not a digging implement */
2873 cannotDigWithMsg =
2874 '{You/he} {sees} no way to use {that iobj/him} as a shovel. '
2875
2876 /* taking something already being held */
2877 alreadyHoldingMsg = '{You/he} {are} already carrying {the dobj/him}. '
2878
2879 /* actor taking self ("take me") */
2880 takingSelfMsg = '{You/he} {can\'t} take {yourself}. '
2881
2882 /* dropping an object not being carried */
2883 notCarryingMsg = '{You\'re} not carrying {that dobj/him}. '
2884
2885 /* actor dropping self */
2886 droppingSelfMsg = '{You/he} {can\'t} drop {yourself}. '
2887
2888 /* actor putting self in something */
2889 puttingSelfMsg = '{You/he} {can\'t} do that to {yourself}. '
2890
2891 /* actor throwing self */
2892 throwingSelfMsg = '{You/he} {can\'t} throw {yourself}. '
2893
2894 /* we can't put the dobj in the iobj because it's already there */
2895 alreadyPutInMsg = '{The dobj/he} {is} already in {the iobj/him}. '
2896
2897 /* we can't put the dobj on the iobj because it's already there */
2898 alreadyPutOnMsg = '{The dobj/he} {is} already on {the iobj/him}. '
2899
2900 /* we can't put the dobj under the iobj because it's already there */
2901 alreadyPutUnderMsg = '{The dobj/he} {is} already under {the iobj/him}. '
2902
2903 /* we can't put the dobj behind the iobj because it's already there */
2904 alreadyPutBehindMsg = '{The dobj/he} {is} already behind {the iobj/him}. '
2905
2906 /*
2907 * trying to move a Fixture to a new container by some means (take,
2908 * drop, put in, put on, etc)
2909 */
2910 cannotMoveFixtureMsg = '{The dobj/he} {cannot} be moved. '
2911
2912 /* trying to take a Fixture */
2913 cannotTakeFixtureMsg = '{You/he} {can\'t} take {that dobj/him}. '
2914
2915 /* trying to put a Fixture in something */
2916 cannotPutFixtureMsg = '{You/he} {can\'t} put {the dobj/him} anywhere. '
2917
2918 /* trying to take/move/put an Immovable object */
2919 cannotTakeImmovableMsg = '{You/he} {can\'t} take {that dobj/him}. '
2920 cannotMoveImmovableMsg = '{The dobj/he} {cannot} be moved. '
2921 cannotPutImmovableMsg = '{You/he} {can\'t} put {the dobj/him} anywhere. '
2922
2923 /* trying to take/move/put a Heavy object */
2924 cannotTakeHeavyMsg = '{The dobj/he} {is} too heavy. '
2925 cannotMoveHeavyMsg = '{The dobj/he} {is} too heavy. '
2926 cannotPutHeavyMsg = '{The dobj/he} {is} too heavy. '
2927
2928 /* trying to move a component object */
2929 cannotMoveComponentMsg(loc)
2930 {
2931 return '{The dobj/he} {is} part of ' + loc.theNameObj + '. ';
2932 }
2933
2934 /* trying to take a component object */
2935 cannotTakeComponentMsg(loc)
2936 {
2937 return '{You/he} {can\'t} have {that/him dobj}; '
2938 + '{it\'s dobj} part of ' + loc.theNameObj + '. ';
2939 }
2940
2941 /* trying to put a component in something */
2942 cannotPutComponentMsg(loc)
2943 {
2944 return '{You/he} {can\'t} put {that/him dobj} anywhere; '
2945 + '{it\'s dobj} part of ' + loc.theNameObj + '. ';
2946 }
2947
2948 /* specialized Immovable messages for TravelPushables */
2949 cannotTakePushableMsg = '{You/he} {can\'t} take {that/him dobj}, but
2950 {it actor/he} might {be|have been} able to push it somewhere. '
2951 cannotMovePushableMsg = 'It wouldn&rsquo;t {|have} accomplish{|ed}
2952 anything to move {the dobj/him} around aimlessly, but {it actor/he}
2953 might {be|have been} able to push {it dobj/him} in a specific
2954 direction. '
2955 cannotPutPushableMsg = '{You/he} {can\'t} put {that/him dobj} anywhere,
2956 but {it actor/he} might {be|have been} able to push it somewhere. '
2957
2958 /* can't take something while occupying it */
2959 cannotTakeLocationMsg = '{You/he} {can\'t} take {that/him dobj}
2960 while {you\'re} occupying {it/him dobj}. '
2961
2962 /* can't REMOVE something that's being held */
2963 cannotRemoveHeldMsg = 'There{\'s| was} nothing to remove
2964 {the dobj/him} from. '
2965
2966 /* default 'take' response */
2967 okayTakeMsg = shortTMsg(
2968 'Taken. ', '{You/he} {take[s]|took} {the dobj/him}. ')
2969
2970 /* default 'drop' response */
2971 okayDropMsg = shortTMsg(
2972 'Dropped. ', '{You/he} drop{s/ped} {the dobj/him}. ')
2973
2974 /* dropping an object */
2975 droppingObjMsg(dropobj)
2976 {
2977 gMessageParams(dropobj);
2978 return '{You/he} drop{s/ped} {the dropobj/him}. ';
2979 }
2980
2981 /* default receiveDrop suffix for floorless rooms */
2982 floorlessDropMsg(dropobj)
2983 {
2984 gMessageParams(dropobj);
2985 return '{It dropobj/he} {fall[s]|fell} out of sight below. ';
2986 }
2987
2988 /* default successful 'put in' response */
2989 okayPutInMsg = shortTIMsg(
2990 'Done. ', '{You/he} put{[s]|} {the dobj/him} in {the iobj/him}. ')
2991
2992 /* default successful 'put on' response */
2993 okayPutOnMsg = shortTIMsg(
2994 'Done. ', '{You/he} put{[s]|} {the dobj/him} on {the iobj/him}. ')
2995
2996 /* default successful 'put under' response */
2997 okayPutUnderMsg = shortTIMsg(
2998 'Done. ', '{You/he} put{[s]|} {the dobj/him} under {the iobj/him}. ')
2999
3000 /* default successful 'put behind' response */
3001 okayPutBehindMsg = shortTIMsg(
3002 'Done. ', '{You/he} put{[s]|} {the dobj/him} behind {the iobj/him}. ')
3003
3004 /* try to take/move/put/taste an untakeable actor */
3005 cannotTakeActorMsg = '{The dobj/he} {won\'t} let {you/him} do that. '
3006 cannotMoveActorMsg = '{The dobj/he} {won\'t} let {you/him} do that. '
3007 cannotPutActorMsg = '{The dobj/he} {won\'t} let {you/him} do that. '
3008 cannotTasteActorMsg = '{The dobj/he} {won\'t} let {you/him} do that. '
3009
3010 /* trying to take/move/put/taste a person */
3011 cannotTakePersonMsg =
3012 '{The dobj/he} probably wouldn&rsquo;t {|have} like{|d} that. '
3013 cannotMovePersonMsg =
3014 '{The dobj/he} probably wouldn&rsquo;t {|have} like{|d} that. '
3015 cannotPutPersonMsg =
3016 '{The dobj/he} probably wouldn&rsquo;t {|have} like{|d} that. '
3017 cannotTastePersonMsg =
3018 '{The dobj/he} probably wouldn&rsquo;t {|have} like{|d} that. '
3019
3020 /* cannot move obj through obstructor */
3021 cannotMoveThroughMsg(obj, obs)
3022 {
3023 gMessageParams(obj, obs);
3024 return '{You/he} {can\'t} move {that obj/him} through '
3025 + '{the obs/him}. ';
3026 }
3027
3028 /* cannot move obj in our out of container cont */
3029 cannotMoveThroughContainerMsg(obj, cont)
3030 {
3031 gMessageParams(obj, cont);
3032 return '{You/he} {can\'t} move {that obj/him} through '
3033 + '{the cont/him}. ';
3034 }
3035
3036 /* cannot move obj because cont is closed */
3037 cannotMoveThroughClosedMsg(obj, cont)
3038 {
3039 gMessageParams(cont);
3040 return '{You/he} {can\'t} do that because {the cont/he} {is} '
3041 + 'closed. ';
3042 }
3043
3044 /* cannot fit obj into cont through cont's opening */
3045 cannotFitIntoOpeningMsg(obj, cont)
3046 {
3047 gMessageParams(obj, cont);
3048 return '{You/he} {can\'t} do that because {the obj/he} {is}
3049 too big to put into {the cont/him}. ';
3050 }
3051
3052 /* cannot fit obj out of cont through cont's opening */
3053 cannotFitOutOfOpeningMsg(obj, cont)
3054 {
3055 gMessageParams(obj, cont);
3056 return '{You/he} {can\'t} do that because {the obj/he} {is}
3057 too big to take out of {the cont/him}. ';
3058 }
3059
3060 /* actor 'obj' cannot reach in our out of container 'cont' */
3061 cannotTouchThroughContainerMsg(obj, cont)
3062 {
3063 gMessageParams(obj, cont);
3064 return '{The obj/he} {can\'t} reach anything through '
3065 + '{the cont/him}. ';
3066 }
3067
3068 /* actor 'obj' cannot reach through cont because cont is closed */
3069 cannotTouchThroughClosedMsg(obj, cont)
3070 {
3071 gMessageParams(obj, cont);
3072 return '{The obj/he} {can\'t} do that because
3073 {the cont/he} {is} closed. ';
3074 }
3075
3076 /* actor cannot fit hand into cont through cont's opening */
3077 cannotReachIntoOpeningMsg(obj, cont)
3078 {
3079 gMessageParams(obj, cont);
3080 return '{The obj/he} {can\'t} fit {its/her} hand into '
3081 + '{the cont/him}. ';
3082 }
3083
3084 /* actor cannot fit hand into cont through cont's opening */
3085 cannotReachOutOfOpeningMsg(obj, cont)
3086 {
3087 gMessageParams(obj, cont);
3088 return '{The obj/he} {can\'t} fit {its/her} hand through
3089 {the cont/him}. ';
3090 }
3091
3092 /* the object is too large for the actor to hold */
3093 tooLargeForActorMsg(obj)
3094 {
3095 gMessageParams(obj);
3096 return '{The obj/he} {is} too large for {you/him} to hold. ';
3097 }
3098
3099 /* the actor doesn't have room to hold the object */
3100 handsTooFullForMsg(obj)
3101 {
3102 return '{Your} hands {are|were} too full to hold '
3103 + obj.theNameObj + '. ';
3104 }
3105
3106 /* the object is becoming too large for the actor to hold */
3107 becomingTooLargeForActorMsg(obj)
3108 {
3109 gMessageParams(obj);
3110 return '{You/he} {cannot} do that because {the obj/he}
3111 would {|have} become too large for {you/him} to hold. ';
3112 }
3113
3114 /* the object is becoming large enough that the actor's hands are full */
3115 handsBecomingTooFullForMsg(obj)
3116 {
3117 gMessageParams(obj);
3118 return '{You/he} {cannot} do that because {its/her} hands
3119 would {|have} become too full to hold {the obj/him}. ';
3120 }
3121
3122 /* the object is too heavy (all by itself) for the actor to hold */
3123 tooHeavyForActorMsg(obj)
3124 {
3125 gMessageParams(obj);
3126 return '{The obj/he} {is} too heavy for {you/him} to pick up. ';
3127 }
3128
3129 /*
3130 * the object is too heavy (in combination with everything else
3131 * being carried) for the actor to pick up
3132 */
3133 totalTooHeavyForMsg(obj)
3134 {
3135 gMessageParams(obj);
3136 return '{The obj/he} {is} too heavy; {you/he} {will} have to put
3137 something else down first. ';
3138 }
3139
3140 /* object is too large for container */
3141 tooLargeForContainerMsg(obj, cont)
3142 {
3143 gMessageParams(obj, cont);
3144 return '{The obj/he} {is} too large for {the cont/him}. ';
3145 }
3146
3147 /* object is too large to fit under object */
3148 tooLargeForUndersideMsg(obj, cont)
3149 {
3150 gMessageParams(obj, cont);
3151 return '{The obj/he} {is} too large to put under {the cont/him}. ';
3152 }
3153
3154 /* object is too large to fit behind object */
3155 tooLargeForRearMsg(obj, cont)
3156 {
3157 gMessageParams(obj, cont);
3158 return '{The obj/he} {is} too large to put behind {the cont/him}. ';
3159 }
3160
3161 /* container doesn't have room for object */
3162 containerTooFullMsg(obj, cont)
3163 {
3164 gMessageParams(obj, cont);
3165 return '{The cont/he} {is} already too full to hold {the obj/him}. ';
3166 }
3167
3168 /* surface doesn't have room for object */
3169 surfaceTooFullMsg(obj, cont)
3170 {
3171 gMessageParams(obj, cont);
3172 return 'There{&rsquo;s| was} no room for {the obj/him} on '
3173 + '{the cont/him}. ';
3174 }
3175
3176 /* underside doesn't have room for object */
3177 undersideTooFullMsg(obj, cont)
3178 {
3179 gMessageParams(obj, cont);
3180 return 'There{&rsquo;s| was} no room for {the obj/him} under '
3181 + '{the cont/him}. ';
3182 }
3183
3184 /* rear surface/space doesn't have room for object */
3185 rearTooFullMsg(obj, cont)
3186 {
3187 gMessageParams(obj, cont);
3188 return 'There{&rsquo;s |was} no room for {the obj/him} behind '
3189 + '{the cont/him}. ';
3190 }
3191
3192 /* the current action would make obj too large for its container */
3193 becomingTooLargeForContainerMsg(obj, cont)
3194 {
3195 gMessageParams(obj, cont);
3196 return '{You/he} {cannot} do that because it would {make|have made}
3197 {the obj/him} too large for {the cont/him}. ';
3198 }
3199
3200 /*
3201 * the current action would increase obj's bulk so that container is
3202 * too full
3203 */
3204 containerBecomingTooFullMsg(obj, cont)
3205 {
3206 gMessageParams(obj, cont);
3207 return '{You/he} {cannot} do that because {the obj/he}
3208 would no longer {|have} fit{|ted} in {the cont/him}. ';
3209 }
3210
3211 /* trying to put an object in a non-container */
3212 notAContainerMsg = '{You/he} {can\'t} put anything in {the iobj/him}. '
3213
3214 /* trying to put an object on a non-surface */
3215 notASurfaceMsg = 'There{&rsquo;s| was} no good surface on
3216 {the iobj/him}. '
3217
3218 /* can't put anything under iobj */
3219 cannotPutUnderMsg =
3220 '{You/he} {can\'t} put anything under {that iobj/him}. '
3221
3222 /* nothing can be put behind the given object */
3223 cannotPutBehindMsg = '{You/he} {can\'t} put anything
3224 behind {the iobj/him}. '
3225
3226 /* trying to put something in itself */
3227 cannotPutInSelfMsg = '{You/he} {can\'t} put {the dobj/him} in {itself}. '
3228
3229 /* trying to put something on itself */
3230 cannotPutOnSelfMsg = '{You/he} {can\'t} put {the dobj/him} on {itself}. '
3231
3232 /* trying to put something under itself */
3233 cannotPutUnderSelfMsg = '{You/he} {can\'t} put {the dobj/him} under
3234 {itself}. '
3235
3236 /* trying to put something behind itself */
3237 cannotPutBehindSelfMsg = '{You/he} {can\'t} put {the dobj/him} behind
3238 {itself}. '
3239
3240 /* can't put something in/on/etc a restricted container/surface/etc */
3241 cannotPutInRestrictedMsg =
3242 '{You/he} {can\'t} put {that dobj/him} in {the iobj/him}. '
3243 cannotPutOnRestrictedMsg =
3244 '{You/he} {can\'t} put {that dobj/him} on {the iobj/him}. '
3245 cannotPutUnderRestrictedMsg =
3246 '{You/he} {can\'t} put {that dobj/him} under {the iobj/him}. '
3247 cannotPutBehindRestrictedMsg =
3248 '{You/he} {can\'t} put {that dobj/him} behind {the iobj/him}. '
3249
3250 /* trying to return something to a remove-only dispenser */
3251 cannotReturnToDispenserMsg =
3252 '{You/he} {can\'t} put {a dobj/him} back in {the iobj/him}. '
3253
3254 /* wrong item type for dispenser */
3255 cannotPutInDispenserMsg =
3256 '{You/he} {can\'t} put {a dobj/him} in {the iobj/him}. '
3257
3258 /* the dobj doesn't fit on this keyring */
3259 objNotForKeyringMsg = '{The dobj/he} {does}n&rsquo;t fit
3260 on {the iobj/him}. '
3261
3262 /* the dobj isn't on the keyring */
3263 keyNotOnKeyringMsg = '{The dobj/he} {is} not attached to {the iobj/him}. '
3264
3265 /* can't detach key (with no iobj specified) because it's not on a ring */
3266 keyNotDetachableMsg = '{The dobj/he} {is}n&rsquo;t attached to anything. '
3267
3268 /* we took a key and attached it to a keyring */
3269 takenAndMovedToKeyringMsg(keyring)
3270 {
3271 gMessageParams(keyring);
3272 return '{You/he} pick{s/ed} up {the dobj/him} and
3273 attach{es/ed actor} {it dobj/him} to {the keyring/him}. ';
3274 }
3275
3276 /* we attached a key to a keyring automatically */
3277 movedKeyToKeyringMsg(keyring)
3278 {
3279 gMessageParams(keyring);
3280 return '{You/he} attach{es/ed} {the dobj/him} to {the keyring/him}. ';
3281 }
3282
3283 /* we moved several keys to a keyring automatically */
3284 movedKeysToKeyringMsg(keyring, keys)
3285 {
3286 gMessageParams(keyring);
3287 return '{You/he} attach{es/ed} {your/his} loose key'
3288 + (keys.length() > 1 ? 's' : '')
3289 + ' to {the keyring/him}. ';
3290 }
3291
3292 /* putting y in x when x is already in y */
3293 circularlyInMsg(x, y)
3294 {
3295 gMessageParams(x, y);
3296 return '{You/he} {can\'t} do that while {the x/he} {is}
3297 in {the y/him}. ';
3298 }
3299
3300 /* putting y in x when x is already on y */
3301 circularlyOnMsg(x, y)
3302 {
3303 gMessageParams(x, y);
3304 return '{You/he} {can\'t} do that while {the x/he} {is}
3305 on {the y/him}. ';
3306 }
3307
3308 /* putting y in x when x is already under y */
3309 circularlyUnderMsg(x, y)
3310 {
3311 gMessageParams(x, y);
3312 return '{You/he} {can\'t} do that while {the x/he} {is}
3313 under {the y/him}. ';
3314 }
3315
3316 /* putting y in x when x is already behind y */
3317 circularlyBehindMsg(x, y)
3318 {
3319 gMessageParams(x, y);
3320 return '{You/he} {can\'t} do that while {the x/he} {is}
3321 behind {the y/him}. ';
3322 }
3323
3324 /* taking dobj from iobj, but dobj isn't in iobj */
3325 takeFromNotInMsg = '{The dobj/he} {is}n&rsquo;t in {that iobj/him}. '
3326
3327 /* taking dobj from surface, but dobj isn't on iobj */
3328 takeFromNotOnMsg = '{The dobj/he} {is}n&rsquo;t on {that iobj/him}. '
3329
3330 /* taking dobj from under something, but dobj isn't under iobj */
3331 takeFromNotUnderMsg = '{The dobj/he} {is}n&rsquo;t
3332 under {that iobj/him}. '
3333
3334 /* taking dobj from behind something, but dobj isn't behind iobj */
3335 takeFromNotBehindMsg = '{The dobj/he} {is}n&rsquo;t
3336 behind {that iobj/him}. '
3337
3338 /* taking dobj from an actor, but actor doesn't have iobj */
3339 takeFromNotInActorMsg = '{The iobj/he} {does}n&rsquo;t
3340 have {that dobj/him}. '
3341
3342 /* actor won't let go of a possession */
3343 willNotLetGoMsg(holder, obj)
3344 {
3345 gMessageParams(holder, obj);
3346 return '{The holder/he} {won\'t} let {you/him} have {that obj/him}. ';
3347 }
3348
3349 /* must say which way to go */
3350 whereToGoMsg = 'You&rsquo;ll have to say which way to go. '
3351
3352 /* travel attempted in a direction with no exit */
3353 cannotGoThatWayMsg = '{You/he} {can\'t} go that way. '
3354
3355 /* travel attempted in the dark in a direction with no exit */
3356 cannotGoThatWayInDarkMsg = 'It{&rsquo;s| was} too dark; {you/he}
3357 {can\'t} see where {you\'re} going. '
3358
3359 /* we don't know the way back for a GO BACK */
3360 cannotGoBackMsg = '{You/he} {does}n&rsquo;t know how to return
3361 from {|t}here. '
3362
3363 /* cannot carry out a command from this location */
3364 cannotDoFromHereMsg = '{You/he} {can\'t} do that from {|t}here. '
3365
3366 /* can't travel through a close door */
3367 cannotGoThroughClosedDoorMsg(door)
3368 {
3369 gMessageParams(door);
3370 return '{You/he} {can\'t} do that, because {the door/he} {is} '
3371 + 'closed. ';
3372 }
3373
3374 /* cannot carry out travel while 'dest' is within 'cont' */
3375 invalidStagingContainerMsg(cont, dest)
3376 {
3377 gMessageParams(cont, dest);
3378 return '{You/he} {can\'t} do that while {the dest/he} {is}
3379 {in cont}. ';
3380 }
3381
3382 /* cannot carry out travel while 'cont' (an actor) is holding 'dest' */
3383 invalidStagingContainerActorMsg(cont, dest)
3384 {
3385 gMessageParams(cont, dest);
3386 return '{You/he} {can\'t} do that while {the cont/he} {is}
3387 holding {the dest/him}. ';
3388 }
3389
3390 /* can't carry out travel because 'dest' isn't a valid staging location */
3391 invalidStagingLocationMsg(dest)
3392 {
3393 gMessageParams(dest);
3394 return '{You/he} {can\'t} get {in dest}. ';
3395 }
3396
3397 /* destination is too high to enter from here */
3398 nestedRoomTooHighMsg(obj)
3399 {
3400 gMessageParams(obj);
3401 return '{The obj/he} {is} too high to reach from {|t}here. ';
3402 }
3403
3404 /* enclosing room is too high to reach by GETTING OUT OF here */
3405 nestedRoomTooHighToExitMsg(obj)
3406 {
3407 return 'It{&rsquo;s| was} too long a drop to do that from {|t}here. ';
3408 }
3409
3410 /* cannot carry out a command from a nested room */
3411 cannotDoFromMsg(obj)
3412 {
3413 gMessageParams(obj);
3414 return '{You/he} {can\'t} do that from {the obj/him}. ';
3415 }
3416
3417 /* cannot carry out a command from within a vehicle in a nested room */
3418 vehicleCannotDoFromMsg(obj)
3419 {
3420 local loc = obj.location;
3421 gMessageParams(obj, loc);
3422 return '{You/he} {can\'t} do that while {the obj/he} {is} {in loc}. ';
3423 }
3424
3425 /* cannot go that way in a vehicle */
3426 cannotGoThatWayInVehicleMsg(traveler)
3427 {
3428 gMessageParams(traveler);
3429 return '{You/he} {can\'t} do that {in traveler}. ';
3430 }
3431
3432 /* cannot push an object that way */
3433 cannotPushObjectThatWayMsg(obj)
3434 {
3435 gMessageParams(obj);
3436 return '{You/he} {can\'t} go that way pushing {the obj/him}. ';
3437 }
3438
3439 /* cannot push an object to a nested room */
3440 cannotPushObjectNestedMsg(obj)
3441 {
3442 gMessageParams(obj);
3443 return '{You/he} {can\'t} push {the obj/him} there. ';
3444 }
3445
3446 /* cannot enter an exit-only passage */
3447 cannotEnterExitOnlyMsg(obj)
3448 {
3449 gMessageParams(obj);
3450 return '{You/he} {can\'t} enter {the obj/him} from {|t}here. ';
3451 }
3452
3453 /* must open door before going that way */
3454 mustOpenDoorMsg(obj)
3455 {
3456 gMessageParams(obj);
3457 return '{You/he} {must} open {the obj/him} first. ';
3458 }
3459
3460 /* door closes behind actor during travel through door */
3461 doorClosesBehindMsg(obj)
3462 {
3463 gMessageParams(obj);
3464 return '<.p>After {you/he} {goes} through {the obj/him}, {it/he}
3465 close{s/d} behind {it actor/him}. ';
3466 }
3467
3468 /* the stairway does not go up/down */
3469 stairwayNotUpMsg = '{The dobj/he} only {goes} down from {|t}here. '
3470 stairwayNotDownMsg = '{The dobj/he} only {goes} up from {|t}here. '
3471
3472 /* "wait" */
3473 timePassesMsg = 'Time pass{es|ed}... '
3474
3475 /* "hello" with no target actor */
3476 sayHelloMsg = (addressingNoOneMsg)
3477
3478 /* "goodbye" with no target actor */
3479 sayGoodbyeMsg = (addressingNoOneMsg)
3480
3481 /* "yes"/"no" with no target actor */
3482 sayYesMsg = (addressingNoOneMsg)
3483 sayNoMsg = (addressingNoOneMsg)
3484
3485 /* an internal common handler for sayHelloMsg, sayGoodbyeMsg, etc */
3486 addressingNoOneMsg
3487 {
3488 return '{You/he} {must} be more specific about '
3489 + gLibMessages.whomPronoun
3490 + ' {it actor/he} want{s/ed} to talk to. ';
3491 }
3492
3493 /* "yell" */
3494 okayYellMsg = '{You/he} scream{s/ed} as loud as {it actor/he} {can}. '
3495
3496 /* "jump" */
3497 okayJumpMsg = '{You/he} jump{s/ed} a little, and land{s/ed} back where
3498 {it actor/he} {|had} started. '
3499
3500 /* cannot jump over object */
3501 cannotJumpOverMsg = '{You/he} {can\'t} jump over {that dobj/him}. '
3502
3503 /* cannot jump off object */
3504 cannotJumpOffMsg = '{You/he} {can\'t} jump off {that dobj/him}. '
3505
3506 /* cannot jump off (with no direct object) from here */
3507 cannotJumpOffHereMsg = 'There{&rsquo;s| was} nowhere to jump
3508 from {|t}here. '
3509
3510 /* failed to find a topic in a consultable object */
3511 cannotFindTopicMsg =
3512 '{You/he} {can\'t} seem to find that in {the dobj/him}. '
3513
3514 /* an actor doesn't accept a command from another actor */
3515 refuseCommand(targetActor, issuingActor)
3516 {
3517 gMessageParams(targetActor, issuingActor);
3518 return '{The targetActor/he} refuse{s/d} {your/his} request. ';
3519 }
3520
3521 /* cannot talk to an object (because it makes no sense to do so) */
3522 notAddressableMsg(obj)
3523 {
3524 gMessageParams(obj);
3525 return '{You/he} {cannot} talk to {that obj/him}. ';
3526 }
3527
3528 /* actor won't respond to a request or other communicative gesture */
3529 noResponseFromMsg(other)
3530 {
3531 gMessageParams(other);
3532 return '{The other/he} {does} not respond. ';
3533 }
3534
3535 /* trying to give something to someone who already has the object */
3536 giveAlreadyHasMsg = '{The iobj/he} already {has} {that/him dobj}. '
3537
3538 /* can't talk to yourself */
3539 cannotTalkToSelfMsg = 'Talking to {yourself/himself}
3540 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3541
3542 /* can't ask yourself about anything */
3543 cannotAskSelfMsg = 'Talking to {yourself/himself}
3544 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3545
3546 /* can't ask yourself for anything */
3547 cannotAskSelfForMsg = 'Talking to {yourself/himself}
3548 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3549
3550 /* can't tell yourself about anything */
3551 cannotTellSelfMsg = 'Talking to {yourself/himself}
3552 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3553
3554 /* can't give yourself something */
3555 cannotGiveToSelfMsg = 'Giving {the dobj/him} to {yourself/himself}
3556 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3557
3558 /* can't give something to itself */
3559 cannotGiveToItselfMsg = 'Giving {the dobj/him} to {itself}
3560 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3561
3562 /* can't show yourself something */
3563 cannotShowToSelfMsg = 'Showing {the dobj/him} to {yourself/himself}
3564 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3565
3566 /* can't show something to itself */
3567 cannotShowToItselfMsg = 'Showing {the dobj/him} to {itself}
3568 {won&rsquo;t|wouldn&rsquo;t} accomplish anything. '
3569
3570 /* can't give/show something to a non-actor */
3571 cannotGiveToMsg = '{You/he} {cannot} give anything to {an iobj/him}. '
3572 cannotShowToMsg = '{You/he} {cannot} show anything to {an iobj/him}. '
3573
3574 /* actor isn't interested in something being given/shown */
3575 notInterestedMsg(actor)
3576 {
3577 return '\^' + actor.nameDoes + ' not appear interested. ';
3578 }
3579
3580 /* vague ASK/TELL (for ASK/TELL <actor> <topic> syntax errors) */
3581 askVagueMsg = '<.parser>The story doesn&rsquo;t understand that command.
3582 Please use ASK ACTOR ABOUT TOPIC (or just A TOPIC).<./parser> '
3583 tellVagueMsg = '<.parser>The story doesn&rsquo;t understand that command.
3584 Please use TELL ACTOR ABOUT TOPIC (or just T TOPIC).<./parser> '
3585
3586 /* object cannot hear actor */
3587 objCannotHearActorMsg(obj)
3588 {
3589 return '\^' + obj.nameDoes
3590 + ' not appear to hear {you/him}. ';
3591 }
3592
3593 /* actor cannot see object being shown to actor */
3594 actorCannotSeeMsg(actor, obj)
3595 {
3596 return '\^' + actor.nameDoes + ' not appear to be able to see '
3597 + obj.theNameObj + '. ';
3598 }
3599
3600 /* not a followable object */
3601 notFollowableMsg = '{You/he} {cannot} follow {that dobj/him}. '
3602
3603 /* cannot follow yourself */
3604 cannotFollowSelfMsg = '{You/he} {cannot} follow {yourself}. '
3605
3606 /* following an object that's in the same location as the actor */
3607 followAlreadyHereMsg = '{The dobj/he} {is} right {|t}here. '
3608
3609 /*
3610 * following an object that we *think* is in our same location (in
3611 * other words, we're already in the location where we thought we
3612 * last saw the object go), but it's too dark to see if that's
3613 * really true
3614 */
3615 followAlreadyHereInDarkMsg = '{The dobj/he} should {be|have been} right
3616 {|t}here, but {you/he} {can\'t} see {it dobj/him}. '
3617
3618 /* trying to follow an object, but don't know where it went from here */
3619 followUnknownMsg = '{You\'re} not sure where {the dobj/he}
3620 {went|had gone} from {|t}here. '
3621
3622 /*
3623 * we're trying to follow an actor, but we last saw the actor in the
3624 * given other location, so we have to go there to follow
3625 */
3626 cannotFollowFromHereMsg(srcLoc)
3627 {
3628 return 'The last place {you/he} {saw|had seen} {the dobj/him} was '
3629 + srcLoc.getDestName(gActor, gActor.location) + '. ';
3630 }
3631
3632 /* acknowledge a 'follow' for a target that was in sight */
3633 okayFollowInSightMsg(loc)
3634 {
3635 return '{You/he} follow{s/ed} {the dobj/him} '
3636 + loc.actorIntoName + '. ';
3637 }
3638
3639 /* obj is not a weapon */
3640 notAWeaponMsg = '{You/he} {can\'t} attack anything with {the iobj/him}. '
3641
3642 /* no effect attacking obj */
3643 uselessToAttackMsg = '{You/he} {cannot} attack {that dobj/him}. '
3644
3645 /* pushing object has no effect */
3646 pushNoEffectMsg = 'Pushing {the dobj/him} {has|had} no effect. '
3647
3648 /* default 'push button' acknowledgment */
3649 okayPushButtonMsg = '<q>Click.</q> '
3650
3651 /* lever is already in pushed state */
3652 alreadyPushedMsg =
3653 '{It\'s dobj} already pushed as far as {it dobj/he} {will} go. '
3654
3655 /* default acknowledgment to pushing a lever */
3656 okayPushLeverMsg = '{You/he} push{es/ed} {the dobj/him} to
3657 {its/her dobj} stop. '
3658
3659 /* pulling object has no effect */
3660 pullNoEffectMsg = 'Pulling {the dobj/him} {has|had} no effect. '
3661
3662 /* lever is already in pulled state */
3663 alreadyPulledMsg =
3664 '{It\'s dobj} already pulled as far as {it dobj/he} {will} go. '
3665
3666 /* default acknowledgment to pulling a lever */
3667 okayPullLeverMsg = '{You/he} pull{s/ed} {the dobj/him} to
3668 {its/her dobj} stop. '
3669
3670 /* default acknowledgment to pulling a spring-loaded lever */
3671 okayPullSpringLeverMsg = '{You/he} pull{s/ed} {the dobj/him}, which
3672 spr{ing[s]|ung} back to {its/her} starting position as soon as
3673 {you/he} let{[s]|} go of {it dobj/him}. '
3674
3675 /* moving object has no effect */
3676 moveNoEffectMsg = 'Moving {the dobj/him} {has|had} no effect. '
3677
3678 /* cannot move object to other object */
3679 moveToNoEffectMsg = 'This would {|have} accomplish{|ed} nothing. '
3680
3681 /* cannot push an object through travel */
3682 cannotPushTravelMsg = 'This would {|have} accomplish{|ed} nothing. '
3683
3684 /* acknowledge pushing an object through travel */
3685 okayPushTravelMsg(obj)
3686 {
3687 return '<.p>{You/he} push{es/ed} ' + obj.theNameObj
3688 + ' into the area. ';
3689 }
3690
3691 /* cannot use object as an implement to move something */
3692 cannotMoveWithMsg =
3693 '{You/he} {cannot} move anything with {the iobj/him}. '
3694
3695 /* cannot set object to setting */
3696 cannotSetToMsg = '{You/he} {cannot} set {that dobj/him} to anything. '
3697
3698 /* invalid setting for generic Settable */
3699 setToInvalidMsg = '{The dobj/he} {has} no such setting. '
3700
3701 /* default 'set to' acknowledgment */
3702 okaySetToMsg(val)
3703 { return 'Okay, {the dobj/he} {is} now set to ' + val + '. '; }
3704
3705 /* cannot turn object */
3706 cannotTurnMsg = '{You/he} {cannot} turn {that dobj/him}. '
3707
3708 /* must specify setting to turn object to */
3709 mustSpecifyTurnToMsg = '{You/he} {must} specify the setting to
3710 turn {it dobj/him} to. '
3711
3712 /* cannot turn anything with object */
3713 cannotTurnWithMsg =
3714 '{You/he} {cannot} turn anything with {that iobj/him}. '
3715
3716 /* invalid setting for dial */
3717 turnToInvalidMsg = '{The dobj/he} {has} no such setting. '
3718
3719 /* default 'turn to' acknowledgment */
3720 okayTurnToMsg(val)
3721 { return 'Okay, {the dobj/he} {is} now set to ' + val + '. '; }
3722
3723 /* switch is already on/off */
3724 alreadySwitchedOnMsg = '{The dobj/he} {is} already on. '
3725 alreadySwitchedOffMsg = '{The dobj/he} {is} already off. '
3726
3727 /* default acknowledgment for switching on/off */
3728 okayTurnOnMsg = 'Okay, {the dobj/he} {is} now on. '
3729 okayTurnOffMsg = 'Okay, {the dobj/he} {is} now off. '
3730
3731 /* flashlight is on but doesn't light up */
3732 flashlightOnButDarkMsg = '{You/he} turn{s/ed} on {the dobj/him}, but
3733 nothing seem{s|ed} to happen. '
3734
3735 /* default acknowledgment for eating something */
3736 okayEatMsg = '{You/he} {eat[s]|ate} {the dobj/him}. '
3737
3738 /* object must be burning before doing that */
3739 mustBeBurningMsg(obj)
3740 {
3741 return '{You/he} {must} light ' + obj.theNameObj
3742 + ' before {it actor/he} {can} do that. ';
3743 }
3744
3745 /* match not lit */
3746 matchNotLitMsg = '{The dobj/he} {is}n&rsquo;t lit. '
3747
3748 /* lighting a match */
3749 okayBurnMatchMsg =
3750 '{You/he} str{ike[s]|uck} {the dobj/him}, igniting a small flame. '
3751
3752 /* extinguishing a match */
3753 okayExtinguishMatchMsg = '{You/he} put{[s]|} out {the dobj/him}, which
3754 disappear{s/ed} into a cloud of ash. '
3755
3756 /* trying to light a candle with no fuel */
3757 candleOutOfFuelMsg =
3758 '{The dobj/he} {is} too burned down; {it/he} {cannot} be lit. '
3759
3760 /* lighting a candle */
3761 okayBurnCandleMsg = '{You/he} {light[s]|lit} {the dobj/him}. '
3762
3763 /* extinguishing a candle that isn't lit */
3764 candleNotLitMsg = '{The dobj/he} {is} not lit. '
3765
3766 /* extinguishing a candle */
3767 okayExtinguishCandleMsg = 'Done. '
3768
3769 /* cannot consult object */
3770 cannotConsultMsg =
3771 '{That dobj/he} {is} not something {you/he} {can} consult. '
3772
3773 /* cannot type anything on object */
3774 cannotTypeOnMsg = '{You/he} {cannot} type anything on {that dobj/him}. '
3775
3776 /* cannot enter anything on object */
3777 cannotEnterOnMsg = '{You/he} {cannot} enter anything on {that dobj/him}. '
3778
3779 /* cannot switch object */
3780 cannotSwitchMsg = '{You/he} {cannot} switch {that dobj/him}. '
3781
3782 /* cannot flip object */
3783 cannotFlipMsg = '{You/he} {cannot} flip {that dobj/him}. '
3784
3785 /* cannot turn object on/off */
3786 cannotTurnOnMsg =
3787 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} turn on. '
3788 cannotTurnOffMsg =
3789 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} turn off. '
3790
3791 /* cannot light */
3792 cannotLightMsg = '{You/he} {cannot} light {that dobj/him}. '
3793
3794 /* cannot burn */
3795 cannotBurnMsg = '{That dobj/he} {is} not something {you/he} {can} burn. '
3796 cannotBurnWithMsg =
3797 '{You/he} {cannot} burn anything with {that iobj/him}. '
3798
3799 /* cannot burn this specific direct object with this specific iobj */
3800 cannotBurnDobjWithMsg = '{You/he} {cannot} light {the dobj/him}
3801 with {the iobj/him}. '
3802
3803 /* object is already burning */
3804 alreadyBurningMsg = '{The dobj/he} {is} already burning. '
3805
3806 /* cannot extinguish */
3807 cannotExtinguishMsg = '{You/he} {cannot} extinguish {that dobj/him}. '
3808
3809 /* cannot pour/pour in/pour on */
3810 cannotPourMsg = '{That dobj/he} {is} not something {you/he} {can} pour. '
3811 cannotPourIntoMsg =
3812 '{You/he} {cannot} pour anything into {that iobj/him}. '
3813 cannotPourOntoMsg =
3814 '{You/he} {cannot} pour anything onto {that iobj/him}. '
3815
3816 /* cannot attach object to object */
3817 cannotAttachMsg =
3818 '{You/he} {cannot} attach {that dobj/him} to anything. '
3819 cannotAttachToMsg =
3820 '{You/he} {cannot} attach anything to {that iobj/him}. '
3821
3822 /* cannot attach to self */
3823 cannotAttachToSelfMsg =
3824 '{You/he} {cannot} attach {the dobj/him} to {itself}. '
3825
3826 /* cannot attach because we're already attached to the given object */
3827 alreadyAttachedMsg =
3828 '{The dobj/he} {is} already attached to {the iobj/him}. '
3829
3830 /*
3831 * dobj and/or iobj can be attached to certain things, but not to
3832 * each other
3833 */
3834 wrongAttachmentMsg =
3835 '{You/he} {can\'t} attach {that dobj/him} to {the iobj/him}. '
3836
3837 /* dobj and iobj are attached, but they can't be taken apart */
3838 wrongDetachmentMsg =
3839 '{You/he} {can\'t} detach {that dobj/him} from {the iobj/him}. '
3840
3841 /* must detach the object before proceeding */
3842 mustDetachMsg(obj)
3843 {
3844 gMessageParams(obj);
3845 return '{You/he} {must} detach {the obj/him} before {it actor/he}
3846 {can} do that. ';
3847 }
3848
3849 /* default message for successful Attachable attachment */
3850 okayAttachToMsg = 'Done. '
3851
3852 /* default message for successful Attachable detachment */
3853 okayDetachFromMsg = 'Done. '
3854
3855 /* cannot detach object from object */
3856 cannotDetachMsg = '{You/he} {cannot} detach {that dobj/him}. '
3857 cannotDetachFromMsg =
3858 '{You/he} {cannot} detach anything from {that iobj/him}. '
3859
3860 /* no obvious way to detach a permanent attachment */
3861 cannotDetachPermanentMsg =
3862 'There{&rsquo;s| was} no obvious way to detach {that dobj/him}. '
3863
3864 /* dobj isn't attached to iobj */
3865 notAttachedToMsg = '{The dobj/he} {is}n&rsquo;t attached
3866 to {that iobj/him}. '
3867
3868 /* breaking object would serve no purpose */
3869 shouldNotBreakMsg =
3870 'Breaking {that dobj/him} would {|have} serve{|d} no purpose. '
3871
3872 /* cannot cut that */
3873 cutNoEffectMsg = '{The iobj/he} {can\'t} seem to cut {the dobj/him}. '
3874
3875 /* can't use iobj to cut anything */
3876 cannotCutWithMsg = '{You/he} {can\'t} cut anything with {the iobj/him}. '
3877
3878 /* cannot climb object */
3879 cannotClimbMsg =
3880 '{That dobj/he} {is} not something {you/he} {can} climb. '
3881
3882 /* object is not openable/closable */
3883 cannotOpenMsg = '{That dobj/he} {is} not something {you/he} {can} open. '
3884 cannotCloseMsg =
3885 '{That dobj/he} {is} not something {you/he} {can} close. '
3886
3887 /* already open/closed */
3888 alreadyOpenMsg = '{The dobj/he} {is} already open. '
3889 alreadyClosedMsg = '{The dobj/he} {is} already closed. '
3890
3891 /* already locked/unlocked */
3892 alreadyLockedMsg = '{The dobj/he} {is} already locked. '
3893 alreadyUnlockedMsg = '{The dobj/he} {is} already unlocked. '
3894
3895 /* cannot look in container because it's closed */
3896 cannotLookInClosedMsg = '{The dobj/he} {is} closed. '
3897
3898 /* object is not lockable/unlockable */
3899 cannotLockMsg =
3900 '{That dobj/he} {is} not something {you/he} {can} lock. '
3901 cannotUnlockMsg =
3902 '{That dobj/he} {is} not something {you/he} {can} unlock. '
3903
3904 /* attempting to open a locked object */
3905 cannotOpenLockedMsg = '{The dobj/he} seem{s/ed} to be locked. '
3906
3907 /* object requires a key to unlock */
3908 unlockRequiresKeyMsg =
3909 '{You/he} seem{s/ed} to need a key to unlock {the dobj/him}. '
3910
3911 /* object is not a key */
3912 cannotLockWithMsg =
3913 '{The iobj/he} {does}n&rsquo;t look suitable for locking that. '
3914 cannotUnlockWithMsg =
3915 '{The iobj/he} {does}n&rsquo;t look suitable for unlocking that. '
3916
3917 /* we don't know how to lock/unlock this */
3918 unknownHowToLockMsg =
3919 'It{&rsquo;s| was} not clear how to lock {the dobj/him}. '
3920 unknownHowToUnlockMsg =
3921 'It{&rsquo;s| was} not clear how to unlock {the dobj/him}. '
3922
3923 /* the key (iobj) does not fit the lock (dobj) */
3924 keyDoesNotFitLockMsg = '{The iobj/he} {does}n&rsquo;t fit the lock. '
3925
3926 /* found key on keyring */
3927 foundKeyOnKeyringMsg(ring, key)
3928 {
3929 gMessageParams(ring, key);
3930 return '{You/he} tr{ies/ied} each key on {the ring/him}, and
3931 {find[s actor]|found} that {the key/he} fit{s/ted} the lock. ';
3932 }
3933
3934 /* failed to find a key on keyring */
3935 foundNoKeyOnKeyringMsg(ring)
3936 {
3937 gMessageParams(ring);
3938 return '{You/he} tr{ies/ied} each key on {the ring/him},
3939 but {you/he} {can\'t} find anything that fit{s|ted} the lock. ';
3940 }
3941
3942 /* not edible/drinkable */
3943 cannotEatMsg = '{The dobj/he} {does} not appear to be edible. '
3944 cannotDrinkMsg = '{That dobj/he} {does} not appear to be something
3945 {you/he} {can} drink. '
3946
3947 /* cannot clean object */
3948 cannotCleanMsg =
3949 '{You/he} wouldn&rsquo;t {|have} know{|n} how to
3950 clean {that dobj/him}. '
3951 cannotCleanWithMsg =
3952 '{You/he} {can\'t} clean anything with {that iobj/him}. '
3953
3954 /* cannot attach key (dobj) to (iobj) */
3955 cannotAttachKeyToMsg =
3956 '{You/he} {cannot} attach {the dobj/him} to {that iobj/him}. '
3957
3958 /* actor cannot sleep */
3959 cannotSleepMsg = '{You/he} {does}n&rsquo;t need to sleep right now. '
3960
3961 /* cannot sit/lie/stand/get on/get out of */
3962 cannotSitOnMsg =
3963 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} sit on. '
3964 cannotLieOnMsg =
3965 '{That dobj/he} {is}n&rsquo;t something {you/he} {can} lie on. '
3966 cannotStandOnMsg = '{You/he} {can\'t} stand on {that dobj/him}. '
3967 cannotBoardMsg = '{You/he} {can\'t} board {that dobj/him}. '
3968 cannotUnboardMsg = '{You/he} {can\'t} get out of {that dobj/him}. '
3969 cannotGetOffOfMsg = '{You/he} {can\'t} get off of {that dobj/him}. '
3970
3971 /* standing on a PathPassage */
3972 cannotStandOnPathMsg = 'If {you/he} want{s/ed} to follow {the dobj/him},
3973 just say so. '
3974
3975 /* cannot sit/lie/stand on something being held */
3976 cannotEnterHeldMsg =
3977 '{You/he} {can\'t} do that while {you\'re} holding {the dobj/him}. '
3978
3979 /* cannot get out (of current location) */
3980 cannotGetOutMsg = '{You\'re} not in anything {you/he} {can} disembark. '
3981
3982 /* actor is already in a location */
3983 alreadyInLocMsg = '{You\'re} already {in dobj}. '
3984
3985 /* actor is already standing/sitting on/lying on */
3986 alreadyStandingMsg = '{You\'re} already standing. '
3987 alreadyStandingOnMsg = '{You\'re} already standing {on dobj}. '
3988 alreadySittingMsg = '{You\'re} already sitting down. '
3989 alreadySittingOnMsg = '{You\'re} already sitting {on dobj}. '
3990 alreadyLyingMsg = '{You\'re} already lying down. '
3991 alreadyLyingOnMsg = '{You\'re} already lying {on dobj}. '
3992
3993 /* getting off something you're not on */
3994 notOnPlatformMsg = '{You\'re} not {on dobj}. '
3995
3996 /* no room to stand/sit/lie on dobj */
3997 noRoomToStandMsg =
3998 'There{&rsquo;s| was} no room for {you/him} to stand {on dobj}. '
3999 noRoomToSitMsg =
4000 'There{&rsquo;s| was} no room for {you/him} to sit {on dobj}. '
4001 noRoomToLieMsg =
4002 'There{&rsquo;s| was} no room for {you/him} to lie {on dobj}. '
4003
4004 /* default report for standing up/sitting down/lying down */
4005 okayPostureChangeMsg(posture)
4006 { return 'Okay, {you\'re} now ' + posture.participle + '. '; }
4007
4008 /* default report for standing/sitting/lying in/on something */
4009 roomOkayPostureChangeMsg(posture, obj)
4010 {
4011 gMessageParams(obj);
4012 return 'Okay, {you\'re} now ' + posture.participle + ' {on obj}. ';
4013 }
4014
4015 /* default report for getting off of a platform */
4016 okayNotStandingOnMsg = 'Okay, {you\'re} no longer {on dobj}. '
4017
4018 /* cannot fasten/unfasten */
4019 cannotFastenMsg = '{You/he} {cannot} fasten {the dobj/him}. '
4020 cannotFastenToMsg =
4021 '{You/he} {cannot} fasten anything to {the iobj/him}. '
4022 cannotUnfastenMsg = '{You/he} {cannot} unfasten {the dobj/him}. '
4023 cannotUnfastenFromMsg =
4024 '{You/he} {cannot} unfasten anything from {the iobj/him}. '
4025
4026 /* cannot plug/unplug */
4027 cannotPlugInMsg = '{You/he} {sees} no way to plug in {the dobj/him}. '
4028 cannotPlugInToMsg =
4029 '{You/he} {sees} no way to plug anything into {the iobj/him}. '
4030 cannotUnplugMsg = '{You/he} {sees} no way to unplug {the dobj/him}. '
4031 cannotUnplugFromMsg =
4032 '{You/he} {sees} no way to unplug anything from {the iobj/him}. '
4033
4034 /* cannot screw/unscrew */
4035 cannotScrewMsg = '{You/he} {sees} no way to screw {the dobj/him}. '
4036 cannotScrewWithMsg =
4037 '{You/he} {cannot} screw anything with {the iobj/him}. '
4038 cannotUnscrewMsg = '{You/he} {sees} no way to unscrew {the dobj/him}. '
4039 cannotUnscrewWithMsg =
4040 '{You/he} {cannot} unscrew anything with {the iobj/him}. '
4041
4042 /* cannot enter/go through */
4043 cannotEnterMsg =
4044 '{That/he dobj} {is} not something {you/he} {can} enter. '
4045 cannotGoThroughMsg =
4046 '{That/he dobj} {is} not something {you/he} {can} go through. '
4047
4048 /* can't throw something at itself */
4049 cannotThrowAtSelfMsg =
4050 '{You/he} {can\'t} throw {that dobj/him} at {itself}. '
4051
4052 /* can't throw something at an object inside itself */
4053 cannotThrowAtContentsMsg = '{You/he} {must} remove {the iobj/him}
4054 from {the dobj/him} before {it actor/he} {can} do that. '
4055
4056 /* can't throw through a sense connector */
4057 cannotThrowThroughMsg(target, loc)
4058 {
4059 gMessageParams(target, loc);
4060 return '{You/he} {cannot} throw anything through {the loc/him}. ';
4061 }
4062
4063 /* shouldn't throw something at the floor */
4064 shouldNotThrowAtFloorMsg =
4065 '{You/he} should just {|have} put {it dobj/him} down instead. '
4066
4067 /* THROW <obj> <direction> isn't supported; use THROW AT instead */
4068 dontThrowDirMsg =
4069 ('<.parser>You need to be more specific about
4070 what ' + (gActor.referralPerson == ThirdPerson
4071 ? 'you want {the actor/him}' : '')
4072 + ' to throw {the dobj/him} at.<./parser> ')
4073
4074 /* thrown object bounces off target (short report) */
4075 throwHitMsg(projectile, target)
4076 {
4077 gMessageParams(projectile, target);
4078 return '{The projectile/he} hit{[s]|} {the target/him} without any
4079 obvious effect. ';
4080 }
4081
4082 /* thrown object lands on target */
4083 throwFallMsg(projectile, target)
4084 {
4085 gMessageParams(projectile, target);
4086 return '{The projectile/he} land{s/ed} on {the target/him}. ';
4087 }
4088
4089 /* thrown object bounces off target and falls to destination */
4090 throwHitFallMsg(projectile, target, dest)
4091 {
4092 gMessageParams(projectile, target);
4093 return '{The projectile/he} hit{[s]|} {the target/him}
4094 without any obvious effect, and {fall[s projectile]|fell} '
4095 + dest.putInName + '. ';
4096 }
4097
4098 /* thrown object falls short of distant target (sentence prefix only) */
4099 throwShortMsg(projectile, target)
4100 {
4101 gMessageParams(projectile, target);
4102 return '{The projectile/he} {fall[s]|fell} well short of '
4103 + '{the target/him}. ';
4104 }
4105
4106 /* thrown object falls short of distant target */
4107 throwFallShortMsg(projectile, target, dest)
4108 {
4109 gMessageParams(projectile, target);
4110 return '{The projectile/he} {fall[s]|fell} ' + dest.putInName
4111 + ' well short of {the target/him}. ';
4112 }
4113
4114 /* target catches object */
4115 throwCatchMsg(obj, target)
4116 {
4117 return '\^' + target.theName + ' '
4118 + tSel('catch' + target.verbEndingEs, 'caught')
4119 + ' ' + obj.theNameObj + '. ';
4120 }
4121
4122 /* we're not a suitable target for THROW TO (because we're not an NPC) */
4123 cannotThrowToMsg = '{You/he} {cannot} throw anything to {an iobj/him}. '
4124
4125 /* target does not want to catch anything */
4126 willNotCatchMsg(catcher)
4127 {
4128 return '\^' + catcher.nameDoes
4129 + 'n&rsquo;t look like ' + catcher.itNom + ' want'
4130 + catcher.verbEndingSEd + ' to catch anything. ';
4131 }
4132
4133 /* cannot kiss something */
4134 cannotKissMsg = 'Kissing {the dobj/him} {has|had} no obvious effect. '
4135
4136 /* person uninterested in being kissed */
4137 cannotKissActorMsg
4138 = '{The dobj/he} probably wouldn&rsquo;t {|have} like{|d} that. '
4139
4140 /* cannot kiss yourself */
4141 cannotKissSelfMsg = '{You/he} {cannot} kiss {yourself}. '
4142
4143 /* it is now dark at actor's location */
4144 newlyDarkMsg = 'It {is|was} now pitch black. '
4145 ;
4146
4147 /*
4148 * Non-player character verb messages. By default, we inherit all of
4149 * the messages defined for the player character, but we override some
4150 * that must be rephrased slightly to make sense for NPC's.
4151 */
4152 npcActionMessages: playerActionMessages
4153 /* "wait" */
4154 timePassesMsg = '{You/he} wait{s/ed}... '
4155
4156 /* trying to move a Fixture/Immovable */
4157 cannotMoveFixtureMsg = '{You/he} {cannot} move {that dobj/him}. '
4158 cannotMoveImmovableMsg = '{You/he} {cannot} move {that dobj/him}. '
4159
4160 /* trying to take/move/put a Heavy object */
4161 cannotTakeHeavyMsg =
4162 '{That dobj/he} {is} too heavy for {you/him} to take. '
4163 cannotMoveHeavyMsg =
4164 '{That dobj/he} {is} too heavy for {you/him} to move. '
4165 cannotPutHeavyMsg =
4166 '{That dobj/he} {is} too heavy for {you/him} to move. '
4167
4168 /* trying to move a component object */
4169 cannotMoveComponentMsg(loc)
4170 {
4171 return '{You/he} {cannot} do that because {the dobj/he} {is} part
4172 of ' + loc.theNameObj + '. ';
4173 }
4174
4175 /* default successful 'take' response */
4176 okayTakeMsg = '{You/he} {take[s]|took} {the dobj/him}. '
4177
4178 /* default successful 'drop' response */
4179 okayDropMsg = '{You/he} put{[s]|} down {the dobj/him}. '
4180
4181 /* default successful 'put in' response */
4182 okayPutInMsg = '{You/he} put{[s]|} {the dobj/him} in {the iobj/him}. '
4183
4184 /* default successful 'put on' response */
4185 okayPutOnMsg = '{You/he} put{[s]|} {the dobj/him} on {the iobj/him}. '
4186
4187 /* default successful 'put under' response */
4188 okayPutUnderMsg =
4189 '{You/he} put{[s]|} {the dobj/him} under {the iobj/him}. '
4190
4191 /* default successful 'put behind' response */
4192 okayPutBehindMsg =
4193 '{You/he} put{[s]|} {the dobj/him} behind {the iobj/him}. '
4194
4195 /* default succesful response to 'wear obj' */
4196 okayWearMsg =
4197 '{You/he} put{[s]|} on {the dobj/him}. '
4198
4199 /* default successful response to 'doff obj' */
4200 okayDoffMsg = '{You/he} {take[s]|took} off {the dobj/him}. '
4201
4202 /* default successful responses to open/close */
4203 okayOpenMsg = '{You/he} open{s/ed} {the dobj/him}. '
4204 okayCloseMsg = '{You/he} close{s/d} {the dobj/him}. '
4205
4206 /* default successful responses to lock/unlock */
4207 okayLockMsg = '{You/he} lock{s/ed} {the dobj/him}. '
4208 okayUnlockMsg = '{You/he} unlock{s/ed} {the dobj/him}. '
4209
4210 /* push/pull/move with no effect */
4211 pushNoEffectMsg = '{You/he} tr{ies/ied} to push {the dobj/him}, with no '
4212 + 'obvious effect. '
4213 pullNoEffectMsg = '{You/he} tr{ies/ied} to pull {the dobj/him}, with no '
4214 + 'obvious effect. '
4215 moveNoEffectMsg = '{You/he} tr{ies/ied} to move {the dobj/him}, with no '
4216 + 'obvious effect. '
4217 moveToNoEffectMsg = '{You/he} {leaves} {the dobj/he} where {it/he} {is}. '
4218
4219 whereToGoMsg =
4220 'You&rsquo;ll have to say which way {you/he} should {|have} go{|ne}. '
4221
4222 /* object is too large for container */
4223 tooLargeForContainerMsg(obj, cont)
4224 {
4225 gMessageParams(obj, cont);
4226 return '{You/he} {cannot} do that because {the obj/he} {is}
4227 too large for {the cont/him}. ';
4228 }
4229
4230 /* object is too large for underside */
4231 tooLargeForUndersideMsg(obj, cont)
4232 {
4233 gMessageParams(obj, cont);
4234 return '{You/he} {cannot} do that because {the obj/he}
4235 {won\'t} fit under {the cont/him}. ';
4236 }
4237
4238 /* object is too large to fit behind something */
4239 tooLargeForRearMsg(obj, cont)
4240 {
4241 gMessageParams(obj, cont);
4242 return '{You/he} {cannot} do that because {the obj/he}
4243 {won\'t} fit behind {the cont/him}. ';
4244 }
4245
4246 /* container doesn't have room for object */
4247 containerTooFullMsg(obj, cont)
4248 {
4249 gMessageParams(obj, cont);
4250 return '{You/he} {cannot} do that because {the cont/he} {is}
4251 already too full to hold {the obj/him}. ';
4252 }
4253
4254 /* surface doesn't have room for object */
4255 surfaceTooFullMsg(obj, cont)
4256 {
4257 gMessageParams(obj, cont);
4258 return '{You/he} {cannot} do that because there{\'s| was}
4259 no room for {the obj/him} on {the cont/him}. ';
4260 }
4261
4262 /* the dobj doesn't fit on this keyring */
4263 objNotForKeyringMsg = '{You/he} {cannot} do that because {that dobj/he}
4264 {does}n&rsquo;t fit on {the iobj/him}. '
4265
4266 /* taking dobj from iobj, but dobj isn't in iobj */
4267 takeFromNotInMsg = '{You/he} {cannot} do that because
4268 {the dobj/he} {is}n&rsquo;t in {that iobj/him}. '
4269
4270 /* taking dobj from surface, but dobj isn't on iobj */
4271 takeFromNotOnMsg = '{You/he} {cannot} do that because
4272 {the dobj/he} {is}n&rsquo;t on {that iobj/him}. '
4273
4274 /* taking dobj under something, but dobj isn't under iobj */
4275 takeFromNotUnderMsg = '{You/he} {cannot} do that because
4276 {the dobj/he} {is}n&rsquo;t under {that iobj/him}. '
4277
4278 /* taking dobj from behind something, but dobj isn't behind iobj */
4279 takeFromNotBehindMsg = '{You/he} {cannot} do that because
4280 {the dobj/he} {is}n&rsquo;t behind {that iobj/him}. '
4281
4282 /* cannot jump off (with no direct object) from here */
4283 cannotJumpOffHereMsg = 'There{&rsquo;s| was} nowhere for
4284 {you/him} to jump. '
4285
4286 /* should not break object */
4287 shouldNotBreakMsg = '{You/he} {does}n&rsquo;t want to
4288 break {that dobj/him}. '
4289
4290 /* report for standing up/sitting down/lying down */
4291 okayPostureChangeMsg(posture)
4292 { return '{You/he} ' + posture.msgVerbI + '. '; }
4293
4294 /* report for standing/sitting/lying in/on something */
4295 roomOkayPostureChangeMsg(posture, obj)
4296 {
4297 gMessageParams(obj);
4298 return '{You/he} ' + posture.msgVerbT + ' {on obj}. ';
4299 }
4300
4301 /* report for getting off a platform */
4302 okayNotStandingOnMsg = '{You/he} {get[s]|got} {offof dobj}. '
4303
4304 /* default 'turn to' acknowledgment */
4305 okayTurnToMsg(val)
4306 { return '{You/he} turn{s/ed} {the dobj/him} to ' + val + '. '; }
4307
4308 /* default 'push button' acknowledgment */
4309 okayPushButtonMsg = '{You/he} push{es/ed} {the dobj/him}. '
4310
4311 /* default acknowledgment for switching on/off */
4312 okayTurnOnMsg = '{You/he} turn{s/ed} {the dobj/him} on. '
4313 okayTurnOffMsg = '{You/he} turn{s/ed} {the dobj/him} off. '
4314
4315 /* the key (iobj) does not fit the lock (dobj) */
4316 keyDoesNotFitLockMsg = '{You/he} tr{ies/ied} {the iobj/he}, but
4317 {it iobj/he} {does}n&rsquo;t fit the lock. '
4318
4319 /* acknowledge entering "follow" mode */
4320 okayFollowModeMsg = '<q>Okay, I will follow {the dobj/him}.</q> '
4321
4322 /* note that we're already in "follow" mode */
4323 alreadyFollowModeMsg = '<q>I\'m already following {the dobj/him}.</q> '
4324
4325 /* extinguishing a candle */
4326 okayExtinguishCandleMsg = '{You/he} extinguish{es/ed} {the dobj/him}. '
4327
4328 /* acknowledge attachment */
4329 okayAttachToMsg =
4330 '{You/he} attach{es/ed} {the dobj/him} to {the iobj/him}. '
4331
4332 /* acknowledge detachment */
4333 okayDetachFromMsg =
4334 '{You/he} detach{es/ed} {the dobj/him} from {the iobj/him}. '
4335
4336 /*
4337 * the PC's responses to conversational actions applied to oneself
4338 * need some reworking for NPC's
4339 */
4340 cannotTalkToSelfMsg = '{You/he} {won\'t} accomplish anything talking
4341 to {yourself/himself}. '
4342 cannotAskSelfMsg = '{You/he} {won\'t} accomplish anything talking
4343 to {yourself/himself}. '
4344 cannotAskSelfForMsg = '{You/he} {won\'t} accomplish anything talking
4345 to {yourself/himself}. '
4346 cannotTellSelfMsg = '{You/he} {won\'t} accomplish anything talking
4347 to {yourself/himself}. '
4348 cannotGiveToSelfMsg = '{You/he} {won\'t} accomplish anything
4349 giving {the dobj/him} to {yourself/himself}. '
4350 cannotShowToSelfMsg = '{You/he} {won\'t} accomplish anything
4351 showing {the dobj/him} to {yourself/himself}. '
4352 ;
4353
4354 /* ------------------------------------------------------------------------ */
4355 /*
4356 * Standard tips
4357 */
4358
4359 scoreChangeTip: Tip
4360 "If you&rsquo;d prefer not to be notified about score changes in the
4361 future, type <<aHref('notify off', 'NOTIFY OFF', 'Turn off score
4362 notifications')>>."
4363 ;
4364
4365 footnotesTip: Tip
4366 "A number in [square brackets] like the one above refers to a footnote,
4367 which you can read by typing FOOTNOTE followed by the number:
4368 <<aHref('footnote 1', 'FOOTNOTE 1', 'Show footnote [1]')>>, for example.
4369 Footnotes usually contain added background information that might be
4370 interesting but isn&rsquo;t essential to the story. If you&rsquo;d
4371 prefer not to see footnotes at all, you can control their appearance by
4372 typing <<aHref('footnotes', 'FOOTNOTES', 'Control footnote
4373 appearance')>>."
4374 ;
4375
4376 oopsTip: Tip
4377 "If this was an accidental misspelling, you can correct it by typing
4378 OOPS followed by the corrected word now. Any time the story points out an
4379 unknown word, you can correct a misspelling using OOPS as your next
4380 command."
4381 ;
4382
4383 fullScoreTip: Tip
4384 "To see a detailed accounting of your score, type
4385 <<aHref('full score', 'FULL SCORE')>>."
4386 ;
4387
4388 exitsTip: Tip
4389 "You can control the exit listings with the EXITS command.
4390 <<aHref('exits status', 'EXITS STATUS',
4391 'Turn on status line exit listings')>>
4392 shows the exit list in the status line,
4393 <<aHref('exits look', 'EXITS LOOK', 'List exits in room descriptions')>>
4394 shows a full exit list in each room description,
4395 <<aHref('exits on', 'EXITS ON', 'Turn on all exit lists')>>
4396 shows both, and
4397 <<aHref('exits off', 'EXITS OFF', 'Turn off all exit lists')>>
4398 turns off both kinds of exit lists."
4399 ;
4400
4401 undoTip: Tip
4402 "If this didn't turn out quite the way you expected, note that you
4403 can always take back a turn by typing <<aHref('undo', 'UNDO',
4404 'Take back the most recent command')>>. You can even use
4405 UNDO repeatedly to take back several turns in a row. "
4406 ;
4407
4408
4409 /* ------------------------------------------------------------------------ */
4410 /*
4411 * Listers
4412 */
4413
4414 /*
4415 * The basic "room lister" object - this is the object that we use by
4416 * default with showList() to construct the listing of the portable
4417 * items in a room when displaying the room's description.
4418 */
4419 roomLister: Lister
4420 /* show the prefix/suffix in wide mode */
4421 showListPrefixWide(itemCount, pov, parent) { "{You/he} {sees} "; }
4422 showListSuffixWide(itemCount, pov, parent) { " {|t}here. "; }
4423
4424 /* show the tall prefix */
4425 showListPrefixTall(itemCount, pov, parent) { "{You/he} {sees}:"; }
4426 ;
4427
4428 /*
4429 * The basic room lister for dark rooms
4430 */
4431 darkRoomLister: Lister
4432 showListPrefixWide(itemCount, pov, parent)
4433 { "In the darkness {you/he} {can} see "; }
4434
4435 showListSuffixWide(itemCount, pov, parent) { ". "; }
4436
4437 showListPrefixTall(itemCount, pov, parent)
4438 { "In the darkness {you/he} {sees}:"; }
4439 ;
4440
4441 /*
4442 * A "remote room lister". This is used to describe the contents of an
4443 * adjoining room. For example, if an actor is standing in one room,
4444 * and can see into a second top-level room through a window, we'll use
4445 * this lister to describe the objects the actor can see through the
4446 * window.
4447 */
4448 class RemoteRoomLister: Lister
4449 construct(room) { remoteRoom = room; }
4450
4451 showListPrefixWide(itemCount, pov, parent)
4452 { "\^<<remoteRoom.inRoomName(pov)>>, {you/he} {sees} "; }
4453 showListSuffixWide(itemCount, pov, parent)
4454 { ". "; }
4455
4456 showListPrefixTall(itemCount, pov, parent)
4457 { "\^<<remoteRoom.inRoomName(pov)>>, {you/he} {sees}:"; }
4458
4459 /* the remote room we're viewing */
4460 remoteRoom = nil
4461 ;
4462
4463 /*
4464 * A simple customizable room lister. This can be used to create custom
4465 * listers for things like remote room contents listings. We act just
4466 * like any ordinary room lister, but we use custom prefix and suffix
4467 * strings provided during construction.
4468 */
4469 class CustomRoomLister: Lister
4470 construct(prefix, suffix)
4471 {
4472 prefixStr = prefix;
4473 suffixStr = suffix;
4474 }
4475
4476 showListPrefixWide(itemCount, pov, parent) { "<<prefixStr>> "; }
4477 showListSuffixWide(itemCount, pov, parent) { "<<suffixStr>> "; }
4478 showListPrefixTall(itemCount, pov, parent) { "<<prefixStr>>:"; }
4479
4480 /* our prefix and suffix strings */
4481 prefixStr = nil
4482 suffixStr = nil
4483 ;
4484
4485 /*
4486 * Single-list inventory lister. This shows the inventory listing as a
4487 * single list, with worn items mixed in among the other inventory items
4488 * and labeled "(being worn)".
4489 */
4490 actorSingleInventoryLister: InventoryLister
4491 showListPrefixWide(itemCount, pov, parent)
4492 { "<<buildSynthParam('The/he', parent)>> {is} carrying "; }
4493 showListSuffixWide(itemCount, pov, parent)
4494 { ". "; }
4495
4496 showListPrefixTall(itemCount, pov, parent)
4497 { "<<buildSynthParam('The/he', parent)>> {is} carrying:"; }
4498 showListContentsPrefixTall(itemCount, pov, parent)
4499 { "<<buildSynthParam('A/he', parent)>>, who {is} carrying:"; }
4500
4501 showListEmpty(pov, parent)
4502 { "<<buildSynthParam('The/he', parent)>> {is} empty-handed. "; }
4503 ;
4504
4505 /*
4506 * Standard inventory lister for actors - this will work for the player
4507 * character and NPC's as well. This lister uses a "divided" format,
4508 * which segregates the listing into items being carried and items being
4509 * worn. We'll combine the two lists into a single sentence if the
4510 * overall list is short, otherwise we'll show two separate sentences for
4511 * readability.
4512 */
4513 actorInventoryLister: DividedInventoryLister
4514 /*
4515 * Show the combined inventory listing, putting together the raw
4516 * lists of the items being carried and the items being worn.
4517 */
4518 showCombinedInventoryList(parent, carrying, wearing)
4519 {
4520 /* if one or the other sentence is empty, the format is simple */
4521 if (carrying == '' && wearing == '')
4522 {
4523 /* the parent is completely empty-handed */
4524 showInventoryEmpty(parent);
4525 }
4526 else if (carrying == '')
4527 {
4528 /* the whole list is being worn */
4529 showInventoryWearingOnly(parent, wearing);
4530 }
4531 else if (wearing == '')
4532 {
4533 /* the whole list is being carried */
4534 showInventoryCarryingOnly(parent, carrying);
4535 }
4536 else
4537 {
4538 /*
4539 * Both listings are populated. Count the number of
4540 * comma-separated or semicolon-separated phrases in each
4541 * list. This will give us an estimate of the grammatical
4542 * complexity of each list. If we have very short lists, a
4543 * single sentence will be easier to read; if the lists are
4544 * long, we'll show the lists in separate sentences.
4545 */
4546 if (countPhrases(carrying) + countPhrases(wearing)
4547 <= singleSentenceMaxNouns)
4548 {
4549 /* short enough: use a single-sentence format */
4550 showInventoryShortLists(parent, carrying, wearing);
4551 }
4552 else
4553 {
4554 /* long: use a two-sentence format */
4555 showInventoryLongLists(parent, carrying, wearing);
4556 }
4557 }
4558 }
4559
4560 /*
4561 * Count the noun phrases in a string. We'll count the number of
4562 * elements in the list as indicated by commas and semicolons. This
4563 * might not be a perfect count of the actual number of noun phrases,
4564 * since we could have commas setting off some other kind of clauses,
4565 * but it nonetheless will give us a good estimate of the overall
4566 * complexity of the text, which is what we're really after. The
4567 * point is that we want to break up the listings if they're long,
4568 * but combine them into a single sentence if they're short.
4569 */
4570 countPhrases(txt)
4571 {
4572 local cnt;
4573
4574 /* if the string is empty, there are no phrases at all */
4575 if (txt == '')
4576 return 0;
4577
4578 /* a non-empty string has at least one phrase */
4579 cnt = 1;
4580
4581 /* scan for commas and semicolons */
4582 for (local startIdx = 1 ;;)
4583 {
4584 local idx;
4585
4586 /* find the next phrase separator */
4587 idx = rexSearch(phraseSepPat, txt, startIdx);
4588
4589 /* if we didn't find it, we're done */
4590 if (idx == nil)
4591 break;
4592
4593 /* count it */
4594 ++cnt;
4595
4596 /* continue scanning after the separator */
4597 startIdx = idx[1] + idx[2];
4598 }
4599
4600 /* return the count */
4601 return cnt;
4602 }
4603
4604 phraseSepPat = static new RexPattern(',(?! and )|;| and |<rparen>')
4605
4606 /*
4607 * Once we've made up our mind about the format, we'll call one of
4608 * these methods to show the final sentence. These are all separate
4609 * methods so that the individual formats can be easily tweaked
4610 * without overriding the whole combined-inventory-listing method.
4611 */
4612 showInventoryEmpty(parent)
4613 {
4614 /* empty inventory */
4615 "<<buildSynthParam('The/he', parent)>> {is} empty-handed. ";
4616 }
4617 showInventoryWearingOnly(parent, wearing)
4618 {
4619 /* we're carrying nothing but wearing some items */
4620 "<<buildSynthParam('The/he', parent)>> {is} carrying nothing,
4621 and {is} wearing <<wearing>>. ";
4622 }
4623 showInventoryCarryingOnly(parent, carrying)
4624 {
4625 /* we have only carried items to report */
4626 "<<buildSynthParam('The/he', parent)>> {is} carrying <<carrying>>. ";
4627 }
4628 showInventoryShortLists(parent, carrying, wearing)
4629 {
4630 local nm = gSynthMessageParam(parent);
4631
4632 /* short lists - combine carried and worn in a single sentence */
4633 "<<buildParam('The/he', nm)>> {is} carrying <<carrying>>,
4634 and <<buildParam('it\'s', nm)>>{subj} wearing <<wearing>>. ";
4635 }
4636 showInventoryLongLists(parent, carrying, wearing)
4637 {
4638 local nm = gSynthMessageParam(parent);
4639
4640 /* long lists - show carried and worn in separate sentences */
4641 "<<buildParam('The/he', nm)>> {is} carrying <<carrying>>.
4642 <<buildParam('It\'s', nm)>> wearing <<wearing>>. ";
4643 }
4644
4645 /*
4646 * For 'tall' listings, we'll use the standard listing style, so we
4647 * need to provide the framing messages for the tall-mode listing.
4648 */
4649 showListPrefixTall(itemCount, pov, parent)
4650 { "<<buildSynthParam('The/he', parent)>> {is} carrying:"; }
4651 showListContentsPrefixTall(itemCount, pov, parent)
4652 { "<<buildSynthParam('A/he', parent)>>, who {is} carrying:"; }
4653 showListEmpty(pov, parent)
4654 { "<<buildSynthParam('The/he', parent)>> {is} empty-handed. "; }
4655 ;
4656
4657 /*
4658 * Special inventory lister for non-player character descriptions - long
4659 * form lister. This is used to display the inventory of an NPC as part
4660 * of the full description of the NPC.
4661 *
4662 * This long form lister is meant for actors with lengthy descriptions.
4663 * We start the inventory listing on a new line, and use the actor's
4664 * full name in the list preface.
4665 */
4666 actorHoldingDescInventoryListerLong: actorInventoryLister
4667 showInventoryEmpty(parent)
4668 {
4669 /* empty inventory - saying nothing in an actor description */
4670 }
4671 showInventoryWearingOnly(parent, wearing)
4672 {
4673 /* we're carrying nothing but wearing some items */
4674 "<.p><<buildSynthParam('The/he', parent)>> {is}
4675 wearing <<wearing>>. ";
4676 }
4677 showInventoryCarryingOnly(parent, carrying)
4678 {
4679 /* we have only carried items to report */
4680 "<.p><<buildSynthParam('The/he', parent)>> {is} carrying
4681 <<carrying>>. ";
4682 }
4683 showInventoryShortLists(parent, carrying, wearing)
4684 {
4685 local nm = gSynthMessageParam(parent);
4686
4687 /* short lists - combine carried and worn in a single sentence */
4688 "<.p><<buildParam('The/he', nm)>> {is} carrying <<carrying>>,
4689 and <<buildParam('it\'s', nm)>>{subj} wearing <<wearing>>. ";
4690 }
4691 showInventoryLongLists(parent, carrying, wearing)
4692 {
4693 local nm = gSynthMessageParam(parent);
4694
4695 /* long lists - show carried and worn in separate sentences */
4696 "<.p><<buildParam('The/he', nm)>> {is} carrying <<carrying>>.
4697 <<buildParam('It\'s', nm)>> wearing <<wearing>>. ";
4698 }
4699 ;
4700
4701 /* short form of non-player character description inventory lister */
4702 actorHoldingDescInventoryListerShort: actorInventoryLister
4703 showInventoryEmpty(parent)
4704 {
4705 /* empty inventory - saying nothing in an actor description */
4706 }
4707 showInventoryWearingOnly(parent, wearing)
4708 {
4709 /* we're carrying nothing but wearing some items */
4710 "<<buildSynthParam('It/he', parent)>> {is} wearing <<wearing>>. ";
4711 }
4712 showInventoryCarryingOnly(parent, carrying)
4713 {
4714 /* we have only carried items to report */
4715 "<<buildSynthParam('It/he', parent)>> {is} carrying <<carrying>>. ";
4716 }
4717 showInventoryShortLists(parent, carrying, wearing)
4718 {
4719 local nm = gSynthMessageParam(parent);
4720
4721 /* short lists - combine carried and worn in a single sentence */
4722 "<<buildParam('It/he', nm)>> {is} carrying <<carrying>>, and
4723 <<buildParam('it\'s', nm)>>{subj} wearing <<wearing>>. ";
4724 }
4725 showInventoryLongLists(parent, carrying, wearing)
4726 {
4727 local nm = gSynthMessageParam(parent);
4728
4729 /* long lists - show carried and worn in separate sentences */
4730 "<<buildParam('It/he', nm)>> {is} carrying <<carrying>>.
4731 <<buildParam('It\'s', nm)>> wearing <<wearing>>. ";
4732 }
4733 ;
4734
4735 /*
4736 * Base contents lister for things. This is used to display the contents
4737 * of things shown in room and inventory listings; we subclass this for
4738 * various purposes
4739 */
4740 class BaseThingContentsLister: Lister
4741 showListPrefixWide(itemCount, pov, parent)
4742 { "\^<<parent.nameVerb('contain')>> "; }
4743 showListSuffixWide(itemCount, pov, parent)
4744 { ". "; }
4745 showListPrefixTall(itemCount, pov, parent)
4746 { "\^<<parent.nameVerb('contain')>>:"; }
4747 showListContentsPrefixTall(itemCount, pov, parent)
4748 { "<<parent.aName>>, which contain<<parent.verbEndingSEd>>:"; }
4749 ;
4750
4751 /*
4752 * Contents lister for things. This is used to display the second-level
4753 * contents lists for things listed in the top-level list for a room
4754 * description, inventory listing, or object description.
4755 */
4756 thingContentsLister: ContentsLister, BaseThingContentsLister
4757 ;
4758
4759 /*
4760 * Contents lister for descriptions of things - this is used to display
4761 * the contents of a thing as part of the long description of the thing
4762 * (in response to an "examine" command); it differs from a regular
4763 * thing contents lister in that we use a pronoun to refer to the thing,
4764 * rather than its full name, since the full name was probably just used
4765 * in the basic long description.
4766 */
4767 thingDescContentsLister: DescContentsLister, BaseThingContentsLister
4768 showListPrefixWide(itemCount, pov, parent)
4769 { "\^<<parent.itVerb('contain')>> "; }
4770 ;
4771
4772 /*
4773 * Contents lister for openable things.
4774 */
4775 openableDescContentsLister: thingDescContentsLister
4776 showListEmpty(pov, parent)
4777 {
4778 "\^<<parent.openStatus>>. ";
4779 }
4780 showListPrefixWide(itemCount, pov, parent)
4781 {
4782 "\^<<parent.openStatus>>, and contain<<parent.verbEndingSEd>> ";
4783 }
4784 ;
4785
4786 /*
4787 * Base contents lister for "LOOK <PREP>" commands (LOOK IN, LOOK UNDER,
4788 * LOOK BEHIND, etc). This can be subclasses for the appropriate LOOK
4789 * <PREP> command matching the container type - LOOK UNDER for
4790 * undersides, LOOK BEHIND for rear containers, etc. To use this class,
4791 * combine it via multiple inheritance with the appropriate
4792 * Base<Prep>ContentsLister for the preposition type.
4793 */
4794 class LookWhereContentsLister: DescContentsLister
4795 showListEmpty(pov, parent)
4796 {
4797 /* show a default message indicating the surface is empty */
4798 gMessageParams(parent);
4799 defaultDescReport('{You/he} {sees} nothing ' + parent.objInPrep
4800 + ' {the parent/him}. ');
4801 }
4802 ;
4803
4804 /*
4805 * Contents lister for descriptions of things whose contents are
4806 * explicitly inspected ("look in"). This differs from a regular
4807 * contents lister in that we explicitly say that the object is empty if
4808 * it's empty.
4809 */
4810 thingLookInLister: LookWhereContentsLister, BaseThingContentsLister
4811 showListEmpty(pov, parent)
4812 {
4813 /*
4814 * Indicate that the list is empty, but make this a default
4815 * descriptive report. This way, if we report any special
4816 * descriptions for items contained within the object, we'll
4817 * suppress this default description that there's nothing to
4818 * describe, which is clearly wrong if there are
4819 * specially-described contents.
4820 */
4821 gMessageParams(parent);
4822 defaultDescReport('{You/he} {sees} nothing unusual
4823 in {the parent/him}. ');
4824 }
4825 ;
4826
4827 /*
4828 * Default contents lister for newly-revealed objects after opening a
4829 * container.
4830 */
4831 openableOpeningLister: BaseThingContentsLister
4832 showListEmpty(pov, parent) { }
4833 showListPrefixWide(itemCount, pov, parent)
4834 {
4835 /*
4836 * This list is, by default, generated as a replacement for the
4837 * default "Opened" message in response to an OPEN command. We
4838 * therefore need different messages for PC and NPC actions,
4839 * since this serves as the description of the entire action.
4840 *
4841 * Note that if you override the Open action response for a given
4842 * object, you might want to customize this lister as well, since
4843 * the message we generate (especially for an NPC action)
4844 * presumes that we'll be the only response the command.
4845 */
4846 gMessageParams(pov, parent);
4847 if (pov.isPlayerChar())
4848 "Opening {the parent/him} reveal{s|ed} ";
4849 else
4850 "{The pov/he} open{s/ed} {the parent/him}, revealing ";
4851 }
4852 ;
4853
4854 /*
4855 * Base contents lister. This class handles contents listings for most
4856 * kinds of specialized containers - Surfaces, RearConainers,
4857 * RearSurfaces, and Undersides. The main variation in the contents
4858 * listings for these various types of containers is simply the
4859 * preposition that's used to describe the relationship between the
4860 * container and the contents, and for this we can look to the objInPrep
4861 * property of the container.
4862 */
4863 class BaseContentsLister: Lister
4864 showListPrefixWide(itemCount, pov, parent)
4865 {
4866 "\^<<parent.objInPrep>> <<parent.theNameObj>>
4867 <<itemCount == 1 ? tSel('is', 'was') : tSel('are', 'were')>> ";
4868 }
4869 showListSuffixWide(itemCount, pov, parent)
4870 {
4871 ". ";
4872 }
4873 showListPrefixTall(itemCount, pov, parent)
4874 {
4875 "\^<<parent.objInPrep>> <<parent.theNameObj>>
4876 <<itemCount == 1 ? tSel('is', 'was') : tSel('are', 'were')>>:";
4877 }
4878 showListContentsPrefixTall(itemCount, pov, parent)
4879 {
4880 "<<parent.aName>>, <<parent.objInPrep>> which
4881 <<itemCount == 1 ? tSel('is', 'was') : tSel('are', 'were')>>:";
4882 }
4883 ;
4884
4885
4886 /*
4887 * Base class for contents listers for a surface
4888 */
4889 class BaseSurfaceContentsLister: BaseContentsLister
4890 ;
4891
4892 /*
4893 * Contents lister for a surface
4894 */
4895 surfaceContentsLister: ContentsLister, BaseSurfaceContentsLister
4896 ;
4897
4898 /*
4899 * Contents lister for explicitly looking in a surface
4900 */
4901 surfaceLookInLister: LookWhereContentsLister, BaseSurfaceContentsLister
4902 ;
4903
4904 /*
4905 * Contents lister for a surface, used in a long description.
4906 */
4907 surfaceDescContentsLister: DescContentsLister, BaseSurfaceContentsLister
4908 ;
4909
4910 /*
4911 * Contents lister for room parts
4912 */
4913 roomPartContentsLister: surfaceContentsLister
4914 isListed(obj)
4915 {
4916 /* list the object if it's listed in the room part */
4917 return obj.isListedInRoomPart(part_);
4918 }
4919
4920 /* the part I'm listing */
4921 part_ = nil
4922 ;
4923
4924 /*
4925 * contents lister for room parts, used in a long description
4926 */
4927 roomPartDescContentsLister: surfaceDescContentsLister
4928 isListed(obj)
4929 {
4930 /* list the object if it's listed in the room part */
4931 return obj.isListedInRoomPart(part_);
4932 }
4933
4934 part_ = nil
4935 ;
4936
4937 /*
4938 * Look-in lister for room parts. Most room parts act like surfaces
4939 * rather than containers, so base this lister on the surface lister.
4940 */
4941 roomPartLookInLister: surfaceLookInLister
4942 isListed(obj)
4943 {
4944 /* list the object if it's listed in the room part */
4945 return obj.isListedInRoomPart(part_);
4946 }
4947
4948 part_ = nil
4949 ;
4950
4951 /*
4952 * Base class for contents listers for an Underside.
4953 */
4954 class BaseUndersideContentsLister: BaseContentsLister
4955 ;
4956
4957 /* basic contents lister for an Underside */
4958 undersideContentsLister: ContentsLister, BaseUndersideContentsLister
4959 ;
4960
4961 /* contents lister for explicitly looking under an Underside */
4962 undersideLookUnderLister: LookWhereContentsLister, BaseUndersideContentsLister
4963 ;
4964
4965 /* contents lister for moving an Underside and abandoning its contents */
4966 undersideAbandonContentsLister: undersideLookUnderLister
4967 showListEmpty(pov, parent) { }
4968 showListPrefixWide(itemCount, pov, parent)
4969 { "Moving <<parent.theNameObj>> reveal<<tSel('s', 'ed')>> "; }
4970 showListSuffixWide(itemCount, pov, parent)
4971 { " underneath. "; }
4972 showListPrefixTall(itemCount, pov, parent)
4973 { "Moving <<parent.theNameObj>> reveal<<tSel('s', 'ed')>>:"; }
4974 ;
4975
4976 /* contents lister for an Underside, used in a long description */
4977 undersideDescContentsLister: DescContentsLister, BaseUndersideContentsLister
4978 showListPrefixWide(itemCount, pov, parent)
4979 {
4980 "Under <<parent.theNameObj>>
4981 <<itemCount == 1 ? tSel('is', 'was')
4982 : tSel('are', 'were')>> ";
4983 }
4984 ;
4985
4986 /*
4987 * Base class for contents listers for an RearContainer or RearSurface
4988 */
4989 class BaseRearContentsLister: BaseContentsLister
4990 ;
4991
4992 /* basic contents lister for a RearContainer or RearSurface */
4993 rearContentsLister: ContentsLister, BaseRearContentsLister
4994 ;
4995
4996 /* contents lister for explicitly looking behind a RearContainer/Surface */
4997 rearLookBehindLister: LookWhereContentsLister, BaseRearContentsLister
4998 ;
4999
5000 /* lister for moving a RearContainer/Surface and abandoning its contents */
5001 rearAbandonContentsLister: undersideLookUnderLister
5002 showListEmpty(pov, parent) { }
5003 showListPrefixWide(itemCount, pov, parent)
5004 { "Moving <<parent.theNameObj>> reveal<<tSel('s', 'ed')>> "; }
5005 showListSuffixWide(itemCount, pov, parent)
5006 { " behind <<parent.itObj>>. "; }
5007 showListPrefixTall(itemCount, pov, parent)
5008 { "Moving <<parent.theNameObj>> reveal<<tSel('s', 'ed')>>:"; }
5009 ;
5010
5011 /* long-description contents lister for a RearContainer/Surface */
5012 rearDescContentsLister: DescContentsLister, BaseRearContentsLister
5013 showListPrefixWide(itemCount, pov, parent)
5014 {
5015 "Behind <<parent.theNameObj>>
5016 <<itemCount == 1 ? tSel('is', 'was')
5017 : tSel('are', 'were')>> ";
5018 }
5019 ;
5020
5021
5022 /*
5023 * Base class for specialized in-line contents listers. This shows the
5024 * list in the form "(<prep> which is...)", with the preposition obtained
5025 * from the container's objInPrep property.
5026 */
5027 class BaseInlineContentsLister: ContentsLister
5028 showListEmpty(pov, parent) { }
5029 showListPrefixWide(cnt, pov, parent)
5030 {
5031 " (<<parent.objInPrep>> which <<
5032 cnt == 1 ? tSel('is', 'was') : tSel('are', 'were')>> ";
5033 }
5034 showListSuffixWide(itemCount, pov, parent)
5035 { ")"; }
5036 ;
5037
5038 /*
5039 * Contents lister for a generic in-line list entry. We customize the
5040 * wording slightly here: rather than saying "(in which...)" as the base
5041 * class would, we use the slightly more readable "(which contains...)".
5042 */
5043 inlineListingContentsLister: BaseInlineContentsLister
5044 showListPrefixWide(cnt, pov, parent)
5045 { " (which contain<<parent.verbEndingSEd>> "; }
5046 ;
5047
5048 /* in-line contents lister for a surface */
5049 surfaceInlineContentsLister: BaseInlineContentsLister
5050 ;
5051
5052 /* in-line contents lister for an Underside */
5053 undersideInlineContentsLister: BaseInlineContentsLister
5054 ;
5055
5056 /* in-line contents lister for a RearContainer/Surface */
5057 rearInlineContentsLister: BaseInlineContentsLister
5058 ;
5059
5060 /*
5061 * Contents lister for keyring list entry. This is used to display a
5062 * keyring's contents in-line with the name of the keyring,
5063 * parenthetically.
5064 */
5065 keyringInlineContentsLister: inlineListingContentsLister
5066 showListPrefixWide(cnt, pov, parent)
5067 { " (with "; }
5068 showListSuffixWide(cnt, pov, parent)
5069 { " attached)"; }
5070 ;
5071
5072
5073 /*
5074 * Contents lister for "examine <keyring>"
5075 */
5076 keyringExamineContentsLister: DescContentsLister
5077 showListEmpty(pov, parent)
5078 {
5079 "\^<<parent.nameIs>> empty. ";
5080 }
5081 showListPrefixWide(cnt, pov, parent)
5082 {
5083 "Attached to <<parent.theNameObj>>
5084 <<cnt == 1 ? tSel('is', 'was')
5085 : tSel('are', 'were')>> ";
5086 }
5087 showListSuffixWide(itemCount, pov, parent)
5088 {
5089 ". ";
5090 }
5091 ;
5092
5093 /*
5094 * Lister for actors aboard a traveler. This is used to list the actors
5095 * on board a vehicle when the vehicle arrives or departs a location.
5096 */
5097 aboardVehicleLister: Lister
5098 showListPrefixWide(itemCount, pov, parent)
5099 { " (carrying "; }
5100 showListSuffixWide(itemCount, pov, parent)
5101 { ")"; }
5102
5103 /* list anything whose isListedAboardVehicle returns true */
5104 isListed(obj) { return obj.isListedAboardVehicle; }
5105 ;
5106
5107 /*
5108 * A simple lister to show the objects to which a given Attachable
5109 * object is attached. This shows the objects which have symmetrical
5110 * attachment relationships to the given parent object, or which are
5111 * "major" items to which the parent is attached.
5112 */
5113 class SimpleAttachmentLister: Lister
5114 construct(parent) { parent_ = parent; }
5115
5116 showListEmpty(pov, parent)
5117 { /* say nothing when there are no attachments */ }
5118
5119 showListPrefixWide(cnt, pov, parent)
5120 { "<.p>\^<<parent.nameIs>> attached to "; }
5121 showListSuffixWide(cnt, pov, parent)
5122 { ". "; }
5123
5124 /* ask the parent if we should list each item */
5125 isListed(obj) { return parent_.isListedAsAttachedTo(obj); }
5126
5127 /*
5128 * the parent object - this is the object whose attachments are being
5129 * listed
5130 */
5131 parent_ = nil
5132 ;
5133
5134 /*
5135 * The "major" attachment lister. This lists the objects which are
5136 * attached to a given parent Attachable, and for which the parent is
5137 * the "major" item in the relationship. The items in the list are
5138 * described as being attached to the parent.
5139 */
5140 class MajorAttachmentLister: SimpleAttachmentLister
5141 showListPrefixWide(cnt, pov, parent) { "<.p>\^"; }
5142 showListSuffixWide(cnt, pov, parent)
5143 {
5144 " <<cnt == 1 ? tSel('is', 'was')
5145 : tSel('are', 'were')>>
5146 attached to <<parent.theNameObj>>. ";
5147 }
5148
5149 /* ask the parent if we should list each item */
5150 isListed(obj) { return parent_.isListedAsMajorFor(obj); }
5151 ;
5152
5153 /*
5154 * Finish Options lister. This lister is used to offer the player
5155 * options in finishGame().
5156 */
5157 finishOptionsLister: Lister
5158 showListPrefixWide(cnt, pov, parent)
5159 {
5160 "<.p>Would you like to ";
5161 }
5162 showListSuffixWide(cnt, pov, parent)
5163 {
5164 /* end the question, add a blank line, and show the ">" prompt */
5165 "?\b&gt;";
5166 }
5167
5168 isListed(obj) { return obj.isListed; }
5169 listCardinality(obj) { return 1; }
5170
5171 showListItem(obj, options, pov, infoTab)
5172 {
5173 /* obj is a FinishOption object; show its description */
5174 obj.desc;
5175 }
5176
5177 showListSeparator(options, curItemNum, totalItems)
5178 {
5179 /*
5180 * for the last separator, show "or" rather than "and"; for
5181 * others, inherit the default handling
5182 */
5183 if (curItemNum + 1 == totalItems)
5184 {
5185 if (totalItems == 2)
5186 " or ";
5187 else
5188 ", or ";
5189 }
5190 else
5191 inherited(options, curItemNum, totalItems);
5192 }
5193 ;
5194
5195 /*
5196 * Equivalent list state lister. This shows a list of state names for a
5197 * set of otherwise indistinguishable items. We show the state names in
5198 * parentheses, separated by commas only (i.e., no "and" separating the
5199 * last two items); we use this less verbose format so that we blend
5200 * into the larger enclosing list more naturally.
5201 *
5202 * The items to be listed are EquivalentStateInfo objects.
5203 */
5204 equivalentStateLister: Lister
5205 showListPrefixWide(cnt, pov, parent) { " ("; }
5206 showListSuffixWide(cnt, pov, parent) { ")"; }
5207 isListed(obj) { return true; }
5208 listCardinality(obj) { return 1; }
5209 showListItem(obj, options, pov, infoTab)
5210 {
5211 "<<spellIntBelow(obj.getEquivCount(), 100)>> <<obj.getName()>>";
5212 }
5213 showListSeparator(options, curItemNum, totalItems)
5214 {
5215 if (curItemNum < totalItems)
5216 ", ";
5217 }
5218 ;
5219
5220 /* in case the exits module isn't included in the build */
5221 property destName_, destIsBack_, others_, enableHyperlinks;
5222
5223 /*
5224 * Basic room exit lister. This shows a list of the apparent exits from
5225 * a location.
5226 *
5227 * The items to be listed are DestInfo objects.
5228 */
5229 class ExitLister: Lister
5230 showListPrefixWide(cnt, pov, parent)
5231 {
5232 if (cnt == 1)
5233 "The only obvious exit {leads|led} ";
5234 else
5235 "Obvious exits {lead|led} ";
5236 }
5237 showListSuffixWide(cnt, pov, parent) { ". "; }
5238
5239 isListed(obj) { return true; }
5240 listCardinality(obj) { return 1; }
5241
5242 showListItem(obj, options, pov, infoTab)
5243 {
5244 /*
5245 * Show the back-to-direction prefix, if we don't know the
5246 * destination name but this is the back-to direction: "back to
5247 * the north" and so on.
5248 */
5249 if (obj.destIsBack_ && obj.destName_ == nil)
5250 say(obj.dir_.backToPrefix + ' ');
5251
5252 /* show the direction */
5253 showListItemDirName(obj, nil);
5254
5255 /* if the destination is known, show it as well */
5256 if (obj.destName_ != nil)
5257 {
5258 /*
5259 * if we have a list of other directions going to the same
5260 * place, show it parenthetically
5261 */
5262 otherExitLister.showListAll(obj.others_, 0, 0);
5263
5264 /*
5265 * Show our destination name. If we know the "back to"
5266 * destination name, show destination names in the format
5267 * "east, to the living room" so that they are consistent
5268 * with "west, back to the dining room". Otherwise, just
5269 * show "east to the living room".
5270 */
5271 if ((options & hasBackNameFlag) != 0)
5272 ",";
5273
5274 /* if this is the way back, say so */
5275 if (obj.destIsBack_)
5276 " back";
5277
5278 /* show the destination */
5279 " to <<obj.destName_>>";
5280 }
5281 }
5282 showListSeparator(options, curItemNum, totalItems)
5283 {
5284 /*
5285 * if we have a "back to" name, use the "long" notation - this is
5286 * important because we'll use commas in the directions with
5287 * known destination names
5288 */
5289 if ((options & hasBackNameFlag) != 0)
5290 options |= ListLong;
5291
5292 /*
5293 * for a two-item list, if either item has a destination name,
5294 * show a comma or semicolon (depending on 'long' vs 'short' list
5295 * mode) before the "and"; for anything else, use the default
5296 * handling
5297 */
5298 if (curItemNum == 1
5299 && totalItems == 2
5300 && (options & hasDestNameFlag) != 0)
5301 {
5302 if ((options & ListLong) != 0)
5303 "; and ";
5304 else
5305 ", and ";
5306 }
5307 else
5308 inherited(options, curItemNum, totalItems);
5309 }
5310
5311 /* show a direction name, hyperlinking it if appropriate */
5312 showListItemDirName(obj, initCap)
5313 {
5314 local dirname;
5315
5316 /* get the name */
5317 dirname = obj.dir_.name;
5318
5319 /* capitalize the first letter, if desired */
5320 if (initCap)
5321 dirname = dirname.substr(1,1).toUpper() + dirname.substr(2);
5322
5323 /* show the name with a hyperlink or not, as configured */
5324 if (libGlobal.exitListerObj.enableHyperlinks)
5325 say(aHref(dirname, dirname));
5326 else
5327 say(dirname);
5328 }
5329
5330 /* this lister shows destination names */
5331 listerShowsDest = true
5332
5333 /*
5334 * My special options flag: at least one object in the list has a
5335 * destination name. The caller should set this flag in our options
5336 * if applicable.
5337 */
5338 hasDestNameFlag = ListerCustomFlag(1)
5339 hasBackNameFlag = ListerCustomFlag(2)
5340 nextCustomFlag = ListerCustomFlag(3)
5341 ;
5342
5343 /*
5344 * Show a list of other exits to a given destination. We'll show the
5345 * list parenthetically, if there's a list to show. The objects to be
5346 * listed are Direction objects.
5347 */
5348 otherExitLister: Lister
5349 showListPrefixWide(cnt, pov, parent) { " (or "; }
5350 showListSuffixWide(cnt, pov, parent) { ")"; }
5351
5352 isListed(obj) { return true; }
5353 listCardinality(obj) { return 1; }
5354
5355 showListItem(obj, options, pov, infoTab)
5356 {
5357 if (libGlobal.exitListerObj.enableHyperlinks)
5358 say(aHref(obj.name, obj.name));
5359 else
5360 say(obj.name);
5361 }
5362 showListSeparator(options, curItemNum, totalItems)
5363 {
5364 /*
5365 * simply show "or" for all items (these lists are usually
5366 * short, so omit any commas)
5367 */
5368 if (curItemNum != totalItems)
5369 " or ";
5370 }
5371 ;
5372
5373 /*
5374 * Show room exits as part of a room description, using the "verbose"
5375 * sentence-style notation.
5376 */
5377 lookAroundExitLister: ExitLister
5378 showListPrefixWide(cnt, pov, parent)
5379 {
5380 /* add a paragraph break before the exit listing */
5381 "<.roompara>";
5382
5383 /* inherit default handling */
5384 inherited(cnt, pov, parent);
5385 }
5386 ;
5387
5388 /*
5389 * Show room exits as part of a room description, using the "terse"
5390 * notation.
5391 */
5392 lookAroundTerseExitLister: ExitLister
5393 showListPrefixWide(cnt, pov, parent)
5394 {
5395 "<.roompara><.parser>Obvious exits: ";
5396 }
5397 showListItem(obj, options, pov, infoTab)
5398 {
5399 /* show the direction name */
5400 showListItemDirName(obj, true);
5401 }
5402 showListSuffixWide(cnt, pov, parent)
5403 {
5404 "<./parser> ";
5405 }
5406 showListSeparator(options, curItemNum, totalItems)
5407 {
5408 /* just show a comma between items */
5409 if (curItemNum != totalItems)
5410 ", ";
5411 }
5412
5413 /* this lister does not show destination names */
5414 listerShowsDest = nil
5415 ;
5416
5417 /*
5418 * Show room exits in response to an explicit request (such as an EXITS
5419 * command).
5420 */
5421 explicitExitLister: ExitLister
5422 showListEmpty(pov, parent)
5423 {
5424 "There {are|were} no obvious exits. ";
5425 }
5426 ;
5427
5428 /*
5429 * Show room exits in the status line (used in HTML mode only)
5430 */
5431 statuslineExitLister: ExitLister
5432 showListEmpty(pov, parent)
5433 {
5434 "<<statusHTML(3)>><b>Exits:</b> <i>None</i><<statusHTML(4)>>";
5435 }
5436 showListPrefixWide(cnt, pov, parent)
5437 {
5438 "<<statusHTML(3)>><b>Exits:</b> ";
5439 }
5440 showListSuffixWide(cnt, pov, parent)
5441 {
5442 "<<statusHTML(4)>>";
5443 }
5444 showListItem(obj, options, pov, infoTab)
5445 {
5446 "<<aHref(obj.dir_.name, obj.dir_.name, 'Go ' + obj.dir_.name,
5447 AHREF_Plain)>>";
5448 }
5449 showListSeparator(options, curItemNum, totalItems)
5450 {
5451 /* just show a space between items */
5452 if (curItemNum != totalItems)
5453 " &nbsp; ";
5454 }
5455
5456 /* this lister does not show destination names */
5457 listerShowsDest = nil
5458 ;
5459
5460 /*
5461 * Implied action announcement grouper. This takes a list of
5462 * ImplicitActionAnnouncement reports and returns a single message string
5463 * describing the entire list of actions.
5464 */
5465 implicitAnnouncementGrouper: object
5466 /*
5467 * Configuration option: keep all failures in a list of implied
5468 * announcements. If this is true, then we'll write things like
5469 * "trying to unlock the door and then open it"; if nil, we'll
5470 * instead write simply "trying to unlock the door".
5471 *
5472 * By default, we keep only the first of a group of failures. A
5473 * group of failures is always recursively related, so the first
5474 * announcement refers to the command that actually failed; the rest
5475 * of the announcements are for the enclosing actions that triggered
5476 * the first action. All of the enclosing actions failed as well,
5477 * but only because the first action failed.
5478 *
5479 * Announcing all of the actions is too verbose for most tastes,
5480 * which is why we set the default here to nil. The fact that the
5481 * first action in the group failed means that we necessarily won't
5482 * carry out any of the enclosing actions, so the enclosing
5483 * announcements don't tell us much. All they really tell us is why
5484 * we're running the action that actually failed, but that's almost
5485 * always obvious, so suppressing them is usually fine.
5486 */
5487 keepAllFailures = nil
5488
5489 /* build the composite message */
5490 compositeMessage(lst)
5491 {
5492 local txt;
5493 local ctx = new ListImpCtx();
5494
5495 /* add the text for each item in the list */
5496 for (txt = '', local i = 1, local len = lst.length() ; i <= len ; ++i)
5497 {
5498 local curTxt;
5499
5500 /* get this item */
5501 local cur = lst[i];
5502
5503 /* we're not in a 'try' or 'ask' sublist yet */
5504 ctx.isInSublist = nil;
5505
5506 /* set the underlying context according to this item */
5507 ctx.setBaseCtx(cur);
5508
5509 /*
5510 * Generate the announcement for this element. Generate the
5511 * announcement from the message property for this item using
5512 * our running list context.
5513 */
5514 curTxt = cur.getMessageText(
5515 cur.getAction().getOriginalAction(), ctx);
5516
5517 /*
5518 * If this one is an attempt only, and it's followed by one
5519 * or more other attempts, the attempts must all be
5520 * recursively related (in other words, the first attempt was
5521 * an implied action required by the second attempt, which
5522 * was required by the third, and so on). They have to be
5523 * recursively related, because otherwise we wouldn't have
5524 * kept trying things after the first failed attempt.
5525 *
5526 * To make the series of failed attempts sound more natural,
5527 * group them into a single "trying to", and keep only the
5528 * first failure: rather than "trying to unlock the door,
5529 * then trying to open the door", write "trying to unlock the
5530 * door and then open it".
5531 *
5532 * An optional configuration setting makes us keep only the
5533 * first failed operation, so we'd instead write simply
5534 * "trying to unlock the door".
5535 *
5536 * Do the same grouping for attempts interrupted for an
5537 * interactive question.
5538 */
5539 while ((cur.justTrying && i < len && lst[i+1].justTrying)
5540 || (cur.justAsking && i < len && lst[i+1].justAsking))
5541 {
5542 local addTxt;
5543
5544 /*
5545 * move on to the next item - we're processing it here,
5546 * so we don't need to handle it again in the main loop
5547 */
5548 ++i;
5549 cur = lst[i];
5550
5551 /* remember that we're in a try/ask sublist */
5552 ctx.isInSublist = true;
5553
5554 /* add the list entry for this action, if desired */
5555 if (keepAllFailures)
5556 {
5557 /* get the added text */
5558 addTxt = cur.getMessageText(
5559 cur.getAction().getOriginalAction(), ctx);
5560
5561 /*
5562 * if both the text so far and the added text are
5563 * non-empty, string them together with 'and then';
5564 * if one or the other is empty, use the non-nil one
5565 */
5566 if (addTxt != '' && curTxt != '')
5567 curTxt += ' and then ' + addTxt;
5568 else if (addTxt != '')
5569 curTxt = addTxt;
5570 }
5571 }
5572
5573 /* add a separator before this item if it isn't the first */
5574 if (txt != '' && curTxt != '')
5575 txt += ', then ';
5576
5577 /* add the current item's text */
5578 txt += curTxt;
5579 }
5580
5581 /* if we ended up with no text, the announcement is silent */
5582 if (txt == '')
5583 return '';
5584
5585 /* wrap the whole list in the usual full standard phrasing */
5586 return standardImpCtx.buildImplicitAnnouncement(txt);
5587 }
5588 ;
5589
5590 /*
5591 * Suggested topic lister.
5592 */
5593 class SuggestedTopicLister: Lister
5594 construct(asker, askee, explicit)
5595 {
5596 /* remember the actors */
5597 askingActor = asker;
5598 targetActor = askee;
5599
5600 /* remember whether this is explicit or implicit */
5601 isExplicit = explicit;
5602
5603 /* cache the actor's scope list */
5604 scopeList = asker.scopeList();
5605 }
5606
5607 showListPrefixWide(cnt, pov, parent)
5608 {
5609 /* add the asking and target actors as global message parameters */
5610 gMessageParams(askingActor, targetActor);
5611
5612 /* show the prefix; include a paren if not in explicit mode */
5613 "<<isExplicit ? '' : '('>>{You askingActor/he} could ";
5614 }
5615 showListSuffixWide(cnt, pov, parent)
5616 {
5617 /* end the sentence; include a paren if not in explicit mode */
5618 ".<<isExplicit? '' : ')'>> ";
5619 }
5620 showListEmpty(pov, parent)
5621 {
5622 /*
5623 * say that the list is empty if it was explicitly requested;
5624 * say nothing if the list is being added by the library
5625 */
5626 if (isExplicit)
5627 {
5628 gMessageParams(askingActor, targetActor);
5629 "<<isExplicit ? '' : '('>>{You askingActor/he} {have} nothing
5630 specific in mind {right now|just then} to discuss with
5631 {the targetActor/him}.<<isExplicit ? '' : ')'>> ";
5632 }
5633 }
5634
5635 showListSeparator(options, curItemNum, totalItems)
5636 {
5637 /* use "or" as the conjunction */
5638 if (curItemNum + 1 == totalItems)
5639 ", or ";
5640 else
5641 inherited(options, curItemNum, totalItems);
5642 }
5643
5644 /* list suggestions that are currently active */
5645 isListed(obj) { return obj.isSuggestionActive(askingActor, scopeList); }
5646
5647 /* each item counts as one item grammatically */
5648 listCardinality(obj) { return 1; }
5649
5650 /* suggestions have no contents */
5651 contentsListed(obj) { return nil; }
5652
5653 /* get the list group */
5654 listWith(obj) { return obj.suggestionGroup; }
5655
5656 /* mark as seen - nothing to do for suggestions */
5657 markAsSeen(obj, pov) { }
5658
5659 /* show the item - show the suggestion's theName */
5660 showListItem(obj, options, pov, infoTab)
5661 {
5662 /* note that we're showing the suggestion */
5663 obj.noteSuggestion();
5664
5665 /* show the name */
5666 say(obj.fullName);
5667 }
5668
5669 /* don't use semicolons, even in long lists */
5670 longListSepTwo { listSepTwo; }
5671 longListSepMiddle { listSepMiddle; }
5672 longListSepEnd { listSepEnd; }
5673
5674 /* flag: this is an explicit listing (i.e., a TOPICS command) */
5675 isExplicit = nil
5676
5677 /* the actor who's asking for the topic list (usually the PC) */
5678 askingActor = nil
5679
5680 /* the actor we're talking to */
5681 targetActor = nil
5682
5683 /* our cached scope list for the actor */
5684 scopeList = nil
5685 ;
5686
5687 /* ASK/TELL suggestion list group base class */
5688 class SuggestionListGroup: ListGroupPrefixSuffix
5689 showGroupItem(sublister, obj, options, pov, infoTab)
5690 {
5691 /*
5692 * show the short name of the item - the group prefix will have
5693 * shown the appropriate long name
5694 */
5695 say(obj.name);
5696 }
5697 ;
5698
5699 /* ASK ABOUT suggestion list group */
5700 suggestionAskGroup: SuggestionListGroup
5701 groupPrefix = "ask {it targetActor/him} about "
5702 ;
5703
5704 /* TELL ABOUT suggestion list group */
5705 suggestionTellGroup: SuggestionListGroup
5706 groupPrefix = "tell {it targetActor/him} about "
5707 ;
5708
5709 /* ASK FOR suggestion list group */
5710 suggestionAskForGroup: SuggestionListGroup
5711 groupPrefix = "ask {it targetActor/him} for "
5712 ;
5713
5714 /* GIVE TO suggestions list group */
5715 suggestionGiveGroup: SuggestionListGroup
5716 groupPrefix = "give {it targetActor/him} "
5717 ;
5718
5719 /* SHOW TO suggestions */
5720 suggestionShowGroup: SuggestionListGroup
5721 groupPrefix = "show {it targetActor/him} "
5722 ;
5723
5724 /* YES/NO suggestion group */
5725 suggestionYesNoGroup: SuggestionListGroup
5726 showGroupList(pov, lister, lst, options, indent, infoTab)
5727 {
5728 /*
5729 * if we have one each of YES and NO responses, make the entire
5730 * list "say yes or no"; otherwise, use the default behavior
5731 */
5732 if (lst.length() == 2
5733 && lst.indexWhich({x: x.ofKind(SuggestedYesTopic)}) != nil
5734 && lst.indexWhich({x: x.ofKind(SuggestedNoTopic)}) != nil)
5735 {
5736 /* we have a [yes, no] group - use the simple message */
5737 "say yes or no";
5738 }
5739 else
5740 {
5741 /* inherit the default behavior */
5742 inherited(pov, lister, lst, options, indent, infoTab);
5743 }
5744 }
5745 groupPrefix = "say";
5746 ;