newbiegrammar.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. !---------------------------------------------------------------------------
  2. ! NewbieGrammar.h, by Emily Short (emshort@mindspring.com)
  3. !
  4. ! Being grammar statements and a couple of verbs to accomodate and
  5. ! respond to nonstandard kinds of input. It interprets who and what
  6. ! questions, as well as correcting some standard errors and redirecting
  7. ! other questions to Help.
  8. !
  9. ! The current contents of this file are dictated by people's r*if posts about
  10. ! their frustrations with early attempts to play IF, and on the messages
  11. ! log on phpZork, which reveals what an assortment of random players
  12. ! have been known to attempt.
  13. !
  14. ! Note that the general trend of these grammar lines are to catch things that
  15. ! are not what one might consider "legitimate" IF commands, or could not
  16. ! be translated easily into another IF action. There is a separate library,
  17. ! called ExpertGrammar, that provides some extra verb synonyms and equivalencies
  18. ! -- many of which were also suggested by analysis of newbie commands.
  19. ! The two libraries are separated because it is possible that one will want
  20. ! the ExpertGrammar without all the extra encumbrances of this library file.
  21. !
  22. ! Version 0.6 -- still imperfect. If you have suggestions about
  23. ! more things the library should handle, please contact me to
  24. ! suggest them.
  25. !
  26. ! Thanks to Roger Firth for his corrections.
  27. !
  28. ! 5/21/03
  29. !
  30. !
  31. !
  32. ! RIGHTS:
  33. !
  34. ! This library file may be treated as public domain. It may be
  35. ! included with or without credit to the original author. It may be
  36. ! modified at the user's discretion. It may be freely redistributed.
  37. !
  38. ! CONTENTS:
  39. !
  40. ! Parsing for the following forms:
  41. !
  42. ! PLEASE... <anything> calls TooPolite, which tells the player such
  43. ! forms are not necessary
  44. !
  45. ! I AM, YOU ARE, HE/SHE/IT IS... calls NewbieGrammar, which reminds
  46. ! the player to use imperative verbs.
  47. !
  48. ! WHO AM I? calls MustXMe, which teaches the syntax for EXAMINE ME,
  49. ! then executes that command.
  50. !
  51. ! WHO ARE YOU? calls ParserHelp, which explains the parser a bit.
  52. !
  53. ! WHERE AM I? calls MustLook, which teaches LOOK, then executes that
  54. ! command.
  55. !
  56. ! WHERE DO I FIND MORE GAMES LIKE THIS (and a wide range of variants)
  57. ! calls ArchiveIntro, which explains about the IF archive.
  58. !
  59. ! WHERE CAN I GO NOW? (and variants) calls Exits, which is defined
  60. ! in this file just to tell the player to look around. If you
  61. ! would like to improve the functionality, you might want to look
  62. ! at one of the libraries that handles an EXITS command.
  63. !
  64. ! WHAT DO I DO NEXT? (and a wide range of variants) calls
  65. ! Help.
  66. !
  67. ! WALK TO (and variants) calls LocalGo, which tells you
  68. ! that movement within a room is unnecessary.
  69. !
  70. ! GO BACK (and variants) calls NoReturn, which tells you
  71. ! to be specific about which direction you want to return.
  72. !
  73. ! CHECK FOR, LOOK FOR (and variants) calls SpecificSearch, which
  74. ! tells you to be specific about how to search for something
  75. !
  76. ! Moreover, there is a catch-all, omnipresent item, which
  77. ! goes everywhere the player goes and reacts to
  78. !
  79. ! -- attempts to use body parts to do things. This is to counteract
  80. ! newbie commands such as
  81. ! OPEN DOOR WITH FOOT, INFLATE RAFT WITH MOUTH, etc.
  82. ! -- vague instructions, such as KILL SOMEONE or TAKE SOMETHING
  83. ! -- vague locations such as HERE or ANYWHERE
  84. !
  85. ! POSSIBLE DIRECTIONS:
  86. !
  87. ! A couple of things one might also do if one really wanted to take this
  88. ! further:
  89. !
  90. ! -- Use the UnknownVerb entrypoint to try to catch cases where the player is
  91. ! using a known noun to begin a sentence. Call NewbieGrammar in this case.
  92. !
  93. ! -- Use ChooseObjects to make the allbodyparts item dispreferred in any
  94. ! disambiguation
  95. !
  96. ! -- Use BeforeParsing to look for certain standard adverbs, or else modify
  97. ! the "I only understood you as far as..." library message to remind the
  98. ! player that adverbs are not allowed. Many of the defective commands
  99. ! found in a study of newbie command structure included things such as
  100. !
  101. ! >SWIM ANYWAY
  102. ! >JUMP ACROSS
  103. ! >HELP PLEASE
  104. !
  105. ! -- Implement a fully functioning "GO BACK" verb that would return the
  106. ! player to his previous location. A. O. Muniz has already released
  107. ! a library to do this with Platypus; with the standard Inform library
  108. ! it is a bit more challenging, but not impossible.
  109. !
  110. !
  111. ! INSTALLATION:
  112. !
  113. ! Include "NewbieGrammar" after Grammar in your gamefile.
  114. !
  115. ! Note that if you are actually using who, what, or where verbs in your
  116. ! gave for legitimate purposes, you will need to change the grammar
  117. ! lines accordingly.
  118. !
  119. ! Set a ChooseObjects to make sure that allbodyparts doesn't show up
  120. ! on commands like GET ALL.
  121. !
  122. ! It is also suggested that you Replace HelpSub before including this
  123. ! file. What is here is pretty minimal. If you wish to avoid compiling
  124. ! the grammar lines for 'help' (perhaps because you plan to use something
  125. ! else), define the constant NO_HELP_GRAMMAR before including this file.
  126. !
  127. !---------------------------------------------------------------------------
  128. Object allbodyparts,
  129. with
  130. short_name [;
  131. print "that";
  132. rtrue;
  133. ],
  134. number 0,
  135. source 0,
  136. parse_name
  137. [ i j w;
  138. for (::)
  139. {
  140. j = 0; w = NextWord();
  141. if ((self.number == 0 or 1) &&
  142. ((w == 'my' or 'head' or 'hands' or 'hand' or 'ear' or 'ears') ||
  143. (w == 'fist' or 'fists' or 'finger' or 'fingers' or 'thumb' or 'thumbs') ||
  144. (w == 'arm' or 'arms' or 'leg' or 'legs' or 'foot' or 'feet') ||
  145. (w == 'eye' or 'eyes' or 'face' or 'nose' or 'mouth' or 'teeth') ||
  146. (w == 'tooth' or 'tongue' or 'lips' or 'lip')))
  147. { self.number = 1; j = 1;
  148. }
  149. if ((self.number == 0 or 2) &&
  150. (w == 'someone' or 'something' or 'anyone' or 'anything'))
  151. { self.number = 2; j = 1;
  152. }
  153. if ((self.number == 0 or 3) &&
  154. (w == 'here' or 'everywhere'))
  155. { self.number = 3; j = 1;
  156. }
  157. if (j~=0) i++; else return i;
  158. }
  159. ],
  160. found_in [;
  161. rtrue;
  162. ],
  163. react_before [;
  164. if ((noun && noun == self) || (second && second == self))
  165. {
  166. self.message(self.number);
  167. self.number = 0;
  168. rtrue;
  169. }
  170. rfalse;
  171. ],
  172. message [ x;
  173. switch(x)
  174. {
  175. 1: "Generally speaking, there is no need to refer to your body
  176. parts individually in interactive fiction. WEAR SHOES ON FEET
  177. will not necessarily be implemented, for instance; WEAR SHOES
  178. is enough. And unless you get some hint to the contrary,
  179. you probably cannot OPEN DOOR WITH FOOT or
  180. PUT THE SAPPHIRE RING IN MY MOUTH.";
  181. 2: "The game will not arbitrarily guess what you want. Be specific --
  182. use a noun for an object you can see around you.";
  183. 3: switch(action)
  184. {
  185. ##Look, ##Search: <<look>>;
  186. default: "You don't really need to refer to places in the game
  187. this way.";
  188. }
  189. }
  190. ],
  191. has proper scenery;
  192. [ IsAmAre;
  193. if (NextWord()=='is' or 'am' or 'are' or 'was' or 'were')
  194. return GPR_PREPOSITION;
  195. return GPR_FAIL;
  196. ];
  197. [ DoCan;
  198. if (NextWord()=='do' or 'does' or 'would' or 'will' or 'shall' or
  199. 'can' or 'could' or 'should' or 'may' or 'must')
  200. return GPR_PREPOSITION;
  201. return GPR_FAIL;
  202. ];
  203. [ Anybody;
  204. if (NextWord()=='I//' or 'me' or 'he' or 'she' or 'it' or
  205. 'we' or 'you' or 'they' or 'person' or 'one' or
  206. 'someone' or 'somebody' or 'anyone' or 'anybody')
  207. return GPR_PREPOSITION;
  208. return GPR_FAIL;
  209. ];
  210. [ More;
  211. if (NextWord()=='more' or 'other' or 'another' or 'others')
  212. return GPR_PREPOSITION;
  213. return GPR_FAIL;
  214. ];
  215. [ SomeDirection w flag num;
  216. for(::)
  217. {
  218. w = NextWord();
  219. if (w==0)
  220. {
  221. if (flag)
  222. { return GPR_PREPOSITION;
  223. }
  224. return GPR_FAIL;
  225. }
  226. if (w == 'left' or 'right' or 'straight' or 'ahead' or 'back'
  227. or 'backwards' or 'forward' or 'backward' or 'forwards' or 'on'
  228. or 'onward' or 'onwards' or 'around')
  229. { flag = 1; num++;
  230. }
  231. }
  232. ];
  233. [ InternalNouns w flag num;
  234. for(::)
  235. {
  236. w = NextWord();
  237. if (w==0)
  238. {
  239. if (flag)
  240. { return GPR_PREPOSITION;
  241. }
  242. return GPR_FAIL;
  243. }
  244. if (w == 'song' or 'music' or 'songs')
  245. { flag = 1; num++;
  246. }
  247. if (w == 'thought' or 'idea' or 'concept')
  248. { flag = 1; num++;
  249. }
  250. if (w == 'the' or 'a' or 'some' or 'any')
  251. { flag = 0; num++;
  252. }
  253. }
  254. ];
  255. [ ThePoint w flag num;
  256. for(::)
  257. {
  258. w = NextWord();
  259. if (w==0)
  260. {
  261. if (flag)
  262. { return GPR_PREPOSITION;
  263. }
  264. return GPR_FAIL;
  265. }
  266. if (w == 'point' or 'point?' or 'idea' or 'idea?' or 'goal'
  267. or 'goal?' or 'purpose' or 'purpose?')
  268. { flag = 1; num++;
  269. }
  270. else
  271. { if (w == 'the' or 'a')
  272. { flag = 0; num++;
  273. }
  274. else
  275. { if (flag)
  276. { return GPR_PREPOSITION;
  277. }
  278. return GPR_FAIL;
  279. }
  280. }
  281. }
  282. ];
  283. [ IsThisGame w flag num;
  284. for(::)
  285. {
  286. w = NextWord();
  287. if (w==0)
  288. {
  289. if (flag)
  290. { return GPR_PREPOSITION;
  291. }
  292. return GPR_FAIL;
  293. }
  294. if (w == 'this' or 'these' or 'this?' or 'these?')
  295. { flag = 1; num++;
  296. }
  297. if (w == 'kind' or 'kinds' or 'of' or 'sort' or 'sorts' or 'like'
  298. or 'such' or 'a' or 'as' or 'all' or 'is' or 'are')
  299. { flag = 0; num++;
  300. }
  301. if (w == 'game' or 'games' or 'story' or 'stories'
  302. or 'game?' or 'games?' or 'story?' or 'stories?' or
  303. 'interactive' or 'fiction' or 'text' or 'adventure'
  304. or 'adventures' or 'fiction?' or 'adventures?')
  305. { flag = 1; num++;
  306. }
  307. }
  308. ];
  309. [ ThisGame w flag num;
  310. for(::)
  311. {
  312. w = NextWord();
  313. if (w==0)
  314. {
  315. if (flag)
  316. { return GPR_PREPOSITION;
  317. }
  318. return GPR_FAIL;
  319. }
  320. if (w == 'this' or 'these' or 'this?' or 'these?')
  321. { flag = 1; num++;
  322. }
  323. if (w == 'kind' or 'kinds' or 'of' or 'sort' or 'sorts' or 'like'
  324. or 'such' or 'a' or 'as' or 'all')
  325. { flag = 0; num++;
  326. }
  327. if (w == 'game' or 'games' or 'story' or 'stories'
  328. or 'game?' or 'games?' or 'story?' or 'stories?' or
  329. 'interactive' or 'fiction' or 'text' or 'adventure'
  330. or 'adventures' or 'fiction?' or 'adventures?')
  331. { flag = 1; num++;
  332. }
  333. }
  334. ];
  335. [ GetFind;
  336. if (NextWord()=='get' or 'find' or 'acquire')
  337. return GPR_PREPOSITION;
  338. return GPR_FAIL;
  339. ];
  340. [ HelpName;
  341. if (NextWord()=='help' or 'assistance' or 'instructions'
  342. or 'help?' or 'assistance?' or 'instructions?')
  343. return GPR_PREPOSITION;
  344. return GPR_FAIL;
  345. ];
  346. [ Meant;
  347. if (NextWord()=='supposed' or 'meant' or 'intended')
  348. return GPR_PREPOSITION;
  349. return GPR_FAIL;
  350. ];
  351. [ NextThing;
  352. if (NextWord()=='now' or 'now?' or 'next' or 'next?'
  353. or 'here' or 'here?')
  354. return GPR_PREPOSITION;
  355. return GPR_FAIL;
  356. ];
  357. [ PlayUse;
  358. if (NextWord()=='play' or 'play?' or 'use' or 'use?' or 'operate' or 'operate?'
  359. or 'type' or 'type?' or 'do' or 'do?' or 'understand' or 'understand?'
  360. or 'learn' or 'learn?' or 'work' or 'work?')
  361. return GPR_PREPOSITION;
  362. return GPR_FAIL;
  363. ];
  364. Verb meta 'hello' 'hi' 'howdy' 'greetings'
  365. * -> HelloThere;
  366. Verb meta 'you' 'he' 'she' 'it' 'they' 'we' 'its' 'theyre' 'were'
  367. 'youre' 'hes' 'shes'
  368. * topic -> NewbieGrammar;
  369. Verb meta 'who' 'wh' 'whos'
  370. * IsAmAre 'I'/'I?' -> MustXMe
  371. * IsAmAre 'you'/'you?' -> ParserHelp
  372. * IsAmAre noun -> Examine;
  373. Verb meta 'where'
  374. * IsAmAre 'I'/'I?'/'this'/'here'/'this?'/'here?' ->MustLook
  375. * IsAmAre noun -> RightHere
  376. * IsAmAre ThePoint ThisGame -> BoredHelp
  377. * IsAmAre topic -> SpecificSearch
  378. * DoCan Anybody 'go'/'go?' -> Exits
  379. * DoCan Anybody 'go' NextThing -> Exits
  380. * DoCan Anybody GetFind ThisGame ->
  381. ArchiveIntro
  382. * DoCan Anybody GetFind More ThisGame ->
  383. ArchiveIntro
  384. * DoCan Anybody 'look' 'for' ThisGame ->
  385. ArchiveIntro
  386. * DoCan Anybody 'look' 'for' More ThisGame ->
  387. ArchiveIntro
  388. * DoCan Anybody GetFind HelpName -> OutsideHelp
  389. * DoCan Anybody GetFind HelpName 'with'/'for'/'on' ThisGame -> OutsideHelp ;
  390. Verb meta 'wheres'
  391. * 'here' -> MustLook
  392. * IsAmAre ThePoint ThisGame -> Help;
  393. Verb meta 'what'
  394. * NextThing -> Help
  395. * IsAmAre 'I'/'I?' -> MustXMe
  396. * IsAmAre 'you'/'you?' -> ParserHelp
  397. * IsAmAre 'here'/'here?' -> MustLook
  398. * IsAmAre 'this'/'this?' -> Help
  399. * IsAmAre Anybody Meant 'to' PlayUse -> Help
  400. * IsAmAre Anybody Meant 'to' PlayUse
  401. NextThing -> Help
  402. * IsAmAre Anybody Meant 'to' PlayUse
  403. 'in'/'on'/'for'/'with' ThisGame -> Help
  404. * IsAmAre noun -> Examine
  405. * IsAmAre ThePoint -> BoredHelp
  406. * IsAmAre ThePoint ThisGame -> BoredHelp
  407. * IsAmAre ThisGame 'about'/'about?'/'for?'/'for' -> BoredHelp
  408. * IsAmAre ThisGame 'about'/'about?'/'for?'/'for' -> BoredHelp
  409. * IsAmAre 'I' topic -> Help
  410. * IsThisGame -> IntroHelp
  411. * DoCan Anybody PlayUse -> VerbHelp
  412. * DoCan Anybody PlayUse NextThing -> VerbHelp
  413. * DoCan Anybody PlayUse
  414. 'in'/'on'/'for'/'with' ThisGame -> VerbHelp
  415. * IsAmAre ThisGame -> IntroHelp;
  416. Verb meta 'whats'
  417. * 'here' -> MustLook
  418. * noun -> Examine
  419. * ThePoint ThisGame -> BoredHelp;
  420. Verb meta 'how'
  421. * DoCan Anybody PlayUse -> Help
  422. * IsAmAre Anybody Meant 'to' PlayUse -> Help
  423. * IsAmAre Anybody Meant 'to' PlayUse ThisGame -> Help
  424. * DoCan Anybody PlayUse ThisGame -> Help
  425. * DoCan Anybody GetFind ThisGame -> ArchiveIntro
  426. * DoCan Anybody GetFind More ThisGame -> ArchiveIntro
  427. * DoCan Anybody GetFind HelpName -> OutsideHelp
  428. * DoCan Anybody GetFind HelpName 'with'/'for'/'on' ThisGame -> OutsideHelp
  429. * DoCan ThisGame 'work'/'work?' -> OutsideHelp;
  430. #ifndef NO_HELP_GRAMMAR; !!! added
  431. Verb 'help' * -> Help
  432. * topic -> Help;
  433. #endif; !!! added
  434. Verb 'please' 'kindly' * topic -> TooPolite;
  435. Extend only 'i//'
  436. * topic -> NewbieGrammar;
  437. Extend 'walk' * SomeDirection -> NoReturn
  438. * 'back' noun=ADirection -> Go
  439. * 'around'/'about'/'away'
  440. -> VagueGo
  441. * 'on'/'over'/'across' noun -> Enter
  442. * 'to'/'towards'/'around'/'past'/'under' noun
  443. -> LocalGo
  444. * 'over'/'up'/'down' 'to'/'towards' noun
  445. -> LocalGo;
  446. Extend 'turn' * SomeDirection -> NoReturn;
  447. Extend 'climb' * SomeDirection -> NoReturn
  448. * 'back' noun=ADirection -> Go;
  449. Verb 'keep' * 'going'/'walking'/'heading'/'running'
  450. noun=ADirection -> NoReturn
  451. * 'going'/'walking'/'heading'/'running'
  452. noun=ADirection -> MustGo;
  453. Verb 'continue' * noun=ADirection -> MustGo
  454. * 'going'/'walking'/'heading'/'running'
  455. noun=ADirection -> MustGo;
  456. Verb 'return' 'back' * -> NoReturn
  457. * 'to' topic -> NoReturn;
  458. Extend 'check' * 'for' noun -> Examine
  459. * 'for' topic -> SpecificSearch;
  460. Extend 'look' * 'for' noun -> Examine
  461. * 'for' topic -> SpecificSearch;
  462. Extend 'search' * 'for' noun -> RightHere
  463. * 'for' topic -> SpecificSearch;
  464. Verb 'find' * noun -> RightHere
  465. * topic -> SpecificSearch;
  466. Extend 'wear' * noun 'on' noun -> Wear;
  467. Extend 'sing' * InternalNouns -> InternalAccusative;
  468. Extend 'think' * InternalNouns -> InternalAccusative;
  469. [ TooPoliteSub;
  470. "The parser does not understand polite formulations such as
  471. PLEASE LOOK AROUND NOW or KINDLY OPEN THE BOX. Start your commands
  472. with an imperative verb and they will work better.";
  473. ];
  474. [ InternalAccusativeSub;
  475. "In constructions like SING A SONG, the ~A SONG~ part is what is known
  476. as an internal accusative -- a direct object that is not actually necessary.
  477. In short: SING will do just as well. The game has difficulty with
  478. parsing abstracts like ~a song~.";
  479. ];
  480. [ MustGoSub;
  481. print "[Generally, it is necessary to phrase commands like this as a simple
  482. direction: GO NORTH, NORTH, etc., rather than KEEP GOING NORTH, HEAD BACK NORTH,
  483. etc.]^^";
  484. <<Go noun>>;
  485. ];
  486. [ RightHereSub;
  487. print "", (The) noun, " is ";
  488. if (IndirectlyContains(player, noun)) "already in your possession!";
  489. "in plain sight!";
  490. ];
  491. [ SpecificSearchSub;
  492. "If you want to look for something, try LOOK (to see
  493. the room as a whole); LOOK IN containers; LOOK UNDER large items;
  494. and SEARCH such items as piles and heaps.^^If you still can't
  495. find whatever it is, you're probably out of luck...";
  496. ];
  497. [ NoReturnSub;
  498. "The game does not keep track of your path through the rooms, nor
  499. your orientation within them. Instead, you should rely on absolute
  500. compass directions. If you
  501. wish to visit a new location or return to a previous one, you will have to
  502. type the directions to take you there -- NORTH, UP, etc.";
  503. ];
  504. [ ParserHelpSub;
  505. "The voice with which you are communicating is the narrator of the
  506. game.^^[If you are having trouble with the game, try HELP.]";
  507. ];
  508. [ NewbieGrammarSub;
  509. "If the game is not understanding you, try issuing your commands in the imperative:
  510. e.g., >THROW THE KNIFE, but not >I WOULD REALLY LIKE TO THROW THE KNIFE. Chatty sentences
  511. such as >YOU ARE A VERY STUPID GAME will only prove themselves true.^^If you really
  512. feel that the game is looking for a word that is not a verb (as the solution
  513. to a riddle, eg.) try some variations, such as SAY FLOOBLE.";
  514. ];
  515. [ MustLookSub;
  516. print "[You can do this in the future by typing LOOK, which is quicker and
  517. more standard.]^";
  518. <<Look>>;
  519. ];
  520. [ MustXMeSub;
  521. print "[You're the main character of the game. Of course, the game author may
  522. have given you a description. You can see this description in the future
  523. by typing EXAMINE ME, which is quicker and more standard.]^^";
  524. <<Examine player>>;
  525. ];
  526. Verb 'intro' * -> TotalIntro;
  527. [ TotalIntroSub;
  528. #ifdef BasicBrief;
  529. BasicBrief(); new_line;
  530. #endif;
  531. #ifdef StartingInstructions;
  532. StartingInstructions(); rtrue;
  533. #endif;
  534. "This is a work of interactive fiction. You should explore and try to do things.";
  535. ];
  536. [ BoredHelpSub;
  537. #ifdef StartingInstructions;
  538. StartingInstructions(); rtrue;
  539. #ifnot;
  540. <<Help>>;
  541. #endif;
  542. ];
  543. [ OutsideHelpSub;
  544. #ifdef OnlineHelp;
  545. OnlineHelp(); rtrue;
  546. #ifnot;
  547. <<Help>>;
  548. #endif;
  549. ];
  550. Verb 'verbs' * -> VerbHelp;
  551. [ VerbHelpSub;
  552. #ifdef StandardVerbs;
  553. StandardVerbs(); rtrue;
  554. #ifnot;
  555. <<Help>>;
  556. #endif;
  557. ];
  558. Verb 'hint' 'hints' * -> HintHelp;
  559. [ HintHelpSub;
  560. #ifdef StuckInstructions;
  561. StuckInstructions(); rtrue;
  562. #ifnot;
  563. <<Help>>;
  564. #endif;
  565. ];
  566. [ ArchiveIntroSub;
  567. #ifdef MoreGames;
  568. MoreGames(); rtrue;
  569. #ifndef MoreGames;
  570. "You can find more games like this at the Interactive Fiction archive,
  571. http://www.ifarchive.org, and a guide to the archive at
  572. http://www.wurb.com/if/.";
  573. #endif;
  574. ];
  575. [ HelloThereSub;
  576. "Hi!^^If you are new to Interactive Fiction, you may want to type HELP.";
  577. ];
  578. [ ExitsSub;
  579. "If you LOOK, you may notice some compass directions you can use to
  580. move to new rooms.";
  581. ];
  582. [ LocalGoSub;
  583. if (noun has door) <<enter noun>>;
  584. "There's no need to walk towards items that are already
  585. in your vicinity.";
  586. ];
  587. Verb 'demo' * -> Demo;
  588. [ DemoSub;
  589. #ifdef CheeseSample;
  590. CheeseSample();
  591. #ifnot;
  592. "No demo is available.";
  593. #endif;
  594. ];
  595. [ HelpSub;
  596. "If you would like a list of verbs you could try, type VERBS.^^If the problem is more
  597. that you don't know how to get going with the game, type INTRO.^^If you'd like a sample
  598. of a game being played, type DEMO.^^Finally, if you know what you want to achieve
  599. but can't figure out how to achieve it, type HINT.
  600. ^^If you are having further difficulty with IF, try looking at some of the online help sites
  601. such as http://www.brasslantern.org.";
  602. ];
  603. [ IntroHelpSub;
  604. #ifdef BasicBrief;
  605. BasicBrief(); rtrue;
  606. #ifnot;
  607. "This is a work of interactive fiction, in which you play the role of the
  608. main character. You interact by typing text at the prompt.";
  609. #endif;
  610. ];