home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / rozrywka / rpg / amigamud / src / basics / verbs.m < prev   
Text File  |  1997-08-07  |  85KB  |  3,285 lines

  1. /*
  2.  * Amiga MUD
  3.  *
  4.  * Copyright (c) 1997 by Chris Gray
  5.  */
  6.  
  7. /*
  8.  * verbs.m - define the standard verbs (commands).
  9.  *    This normally follows after 'base.m', 'util1.m' and 'util2.m'.
  10.  */
  11.  
  12. private tp_verbs CreateTable()$
  13. use tp_verbs
  14.  
  15. /* All of the separator words that we will use */
  16.  
  17. ignore Word(G, "to")$
  18. ignore Word(G, "at")$
  19. ignore Word(G, "around")$
  20. ignore Word(G, "from")$
  21. ignore Word(G, "on")$
  22. ignore Word(G, "onto")$
  23. ignore Word(G, "do")$
  24.  
  25. /* Also used, but are defined as verbs.
  26.  
  27.     "in"/"into"/"inside"/"inwards", "out"/"outside",
  28.     "up", "down", "with", "off"
  29.  
  30. */
  31.  
  32. /* Need to define 'off' early */
  33.  
  34. define tp_verbs proc v_quit()bool:
  35.     /* Bit of a nuisance - the server handles the messages for coming and
  36.        going from the world, and it knows nothing of p_pHidden. Oh well. */
  37.     Quit();
  38.     ClearFollowers(Me());
  39.     false
  40. corp;
  41.  
  42. Verb0(G, "quit", 0, v_quit)$
  43. Synonym(G, "quit", "bye")$
  44. Verb0(G, "off", 0, v_quit)$    /* used separately */
  45.  
  46. /* routines for going in specific directions (these are actual verbs) */
  47.  
  48. define tp_verbs proc v_north()bool:
  49.     UserMove(D_NORTH)
  50. corp;
  51. define tp_verbs proc v_south()bool:
  52.     UserMove(D_SOUTH)
  53. corp;
  54. define tp_verbs proc v_east()bool:
  55.     UserMove(D_EAST)
  56. corp;
  57. define tp_verbs proc v_west()bool:
  58.     UserMove(D_WEST)
  59. corp;
  60. define tp_verbs proc v_northEast()bool:
  61.     UserMove(D_NORTHEAST)
  62. corp;
  63. define tp_verbs proc v_northWest()bool:
  64.     UserMove(D_NORTHWEST)
  65. corp;
  66. define tp_verbs proc v_southEast()bool:
  67.     UserMove(D_SOUTHEAST)
  68. corp;
  69. define tp_verbs proc v_southWest()bool:
  70.     UserMove(D_SOUTHWEST)
  71. corp;
  72. define tp_verbs proc v_up()bool:
  73.     UserMove(D_UP)
  74. corp;
  75. define tp_verbs proc v_down()bool:
  76.     UserMove(D_DOWN)
  77. corp;
  78. define tp_verbs proc v_enter()bool:
  79.     UserMove(D_ENTER)
  80. corp;
  81. define tp_verbs proc v_exit()bool:
  82.     UserMove(D_EXIT)
  83. corp;
  84.  
  85. /* define the actual movement verbs */
  86.  
  87. Verb0(G, "north", 0, v_north)$
  88. Verb0(G, "south", 0, v_south)$
  89. Verb0(G, "east", 0, v_east)$
  90. Verb0(G, "west", 0, v_west)$
  91. Verb0(G, "northeast", 0, v_northEast)$
  92. Verb0(G, "northwest", 0, v_northWest)$
  93. Verb0(G, "southeast", 0, v_southEast)$
  94. Verb0(G, "southwest", 0, v_southWest)$
  95. Verb0(G, "up", 0, v_up)$
  96. Verb0(G, "down", 0, v_down)$
  97. Verb0(G, "enter", 0, v_enter)$
  98. Verb0(G, "exit", 0, v_exit)$    /* no synonyms - is used elsewhere */
  99.  
  100. Synonym(G, "north", "n")$
  101. Synonym(G, "south", "s")$
  102. Synonym(G, "east", "e")$
  103. Synonym(G, "west", "w")$
  104. Synonym(G, "northeast", "ne")$
  105. Synonym(G, "northeast", "north-east")$
  106. Synonym(G, "northwest", "nw")$
  107. Synonym(G, "northwest", "north-west")$
  108. Synonym(G, "southeast", "se")$
  109. Synonym(G, "southeast", "south-east")$
  110. Synonym(G, "southwest", "sw")$
  111. Synonym(G, "southwest", "south-west")$
  112. Synonym(G, "up", "u")$
  113. Synonym(G, "down", "d")$
  114. Verb0(G, "in", 0, v_enter)$    /* also used elsewhere */
  115. Synonym(G, "in", "inside")$
  116. Synonym(G, "in", "into")$
  117. Synonym(G, "in", "inwards")$
  118. Verb0(G, "out", 0, v_exit)$    /* also used elsewhere */
  119. Synonym(G, "out", "outside")$
  120. Verb0(G, "leave", 0, v_exit)$
  121.  
  122. define tp_verbs proc v_go(string where)bool:
  123.  
  124.     if where = "" then
  125.     Print("You must specify a direction to " + Verb() + ".\n");
  126.     false
  127.     elif DirMatch(where) ~= -1 then
  128.     if Punctuation() ~= " " then
  129.         where := where + Punctuation();
  130.     fi;
  131.     Parse(G, where) ~= 0
  132.     else
  133.     Print("I don't know how to " + Verb() + " \"" +
  134.         FormatName(where) + "\".\n");
  135.     false
  136.     fi
  137. corp;
  138.  
  139. Verb1(G, "go", FindAnyWord(G, "to"), v_go)$
  140. Synonym(G, "go", "walk")$
  141. Synonym(G, "go", "climb")$
  142. Synonym(G, "go", "jump")$
  143. Synonym(G, "go", "move")$
  144. Synonym(G, "go", "head")$
  145. Synonym(G, "go", "run")$
  146. Synonym(G, "go", "crawl")$
  147. Synonym(G, "go", "trot")$    /* canter, gallop, slither, ...? - nah! */
  148.  
  149.  
  150. /* This verb is defined early, so we can use "with" for other verbs. */
  151.  
  152. define tp_verbs proc v_with()bool:
  153.     string what, whatName;
  154.     status st;
  155.     thing object;
  156.     grammar g;
  157.  
  158.     what := GetNounPhrase(G, GetTail(), FindAnyWord(G, "do"));
  159.     if what = "" then
  160.     Print("You must specify what you want to do something with.\n");
  161.     false
  162.     else
  163.     if GetWord() ~= "do" then
  164.         Print("Use the form: with <object> do <command>\n");
  165.         false
  166.     else
  167.         whatName := FormatName(what);
  168.         st := FindName(Me()@p_pCarrying, p_oName, what);
  169.         if st = succeed then
  170.         object := FindResult();
  171.         g := object@p_oSpecialGrammar;
  172.         if g = nil then
  173.             Print("The " + whatName + " has no special actions.\n");
  174.             false
  175.         else
  176.             what := GetTail();
  177.             if what = "" then
  178.             Print("You must specify what you want to do with the "+
  179.                 whatName + ".\n");
  180.             false
  181.             else
  182.             /* This is the magic here. Take the remainder of
  183.                the player's command line ("GetTail()"), and
  184.                parse it against the grammar retrieved from the
  185.                special object. */
  186.             SetIt(object);
  187.             what := GetTail();
  188.             if Punctuation() ~= " " then
  189.                 what := what + Punctuation();
  190.             fi;
  191.             Parse(g, what) ~= 0
  192.             fi
  193.         fi
  194.         elif st = continue then
  195.         Print(Capitalize(whatName) + " is ambiguous.\n");
  196.         false
  197.         else
  198.         Print(AAn("You are not carrying", whatName) + ".\n");
  199.         false
  200.         fi
  201.     fi
  202.     fi
  203. corp;
  204.  
  205. VerbTail(G, "with", v_with)$
  206.  
  207. /* create a little toy to test 'with' */
  208.  
  209. /*
  210. define tp_verbs o_toy CreateThing(nil)$
  211. SetupObject(o_toy, r_arrivals, "toy;with",
  212.     "The toy is here for testing the 'with' command only.")$
  213. o_toy@p_oSpecialGrammar := CreateGrammar()$
  214. define tp_verbs proc tv_hello()bool:
  215.     Print("The toy says hello back.\n");
  216.     true
  217. corp;
  218. define tp_verbs proc tv_hi()bool:
  219.     Print("The toy says hi back.\n");
  220.     true
  221. corp;
  222. define tp_verbs proc tv_echo()bool:
  223.     Print("Toy: " + GetTail() + "\n");
  224.     true
  225. corp;
  226. Verb0(o_toy@p_oSpecialGrammar, "hello", 0, tv_hello)$
  227. Verb0(o_toy@p_oSpecialGrammar, "hi", 0, tv_hi)$
  228. VerbTail(o_toy@p_oSpecialGrammar, "echo", tv_echo)$
  229. */
  230.  
  231.  
  232. /*
  233.  * now some silly verbs for people to play with
  234.  */
  235.  
  236. define tp_verbs proc doPosition(string what; int pos)bool:
  237.     thing me, here, it;
  238.     status st;
  239.     string s1, s2, whatName;
  240.     property int countProp;
  241.     int n;
  242.     action a;
  243.  
  244.     me := Me();
  245.     here := Here();
  246.     case pos
  247.     incase POS_SIT_IN:
  248.     s1 := "sit";
  249.     s2 := "in";
  250.     countProp := p_oCanSitIn;
  251.     incase POS_SIT_ON:
  252.     s1 := "sit";
  253.     s2 := "on";
  254.     countProp := p_oCanSitOn;
  255.     incase POS_LIE_IN:
  256.     s1 := "lie";
  257.     s2 := "in";
  258.     countProp := p_oCanLieIn;
  259.     incase POS_LIE_ON:
  260.     s1 := "lie";
  261.     s2 := "on";
  262.     countProp := p_oCanLieOn;
  263.     incase POS_STAND_IN:
  264.     s1 := "stand";
  265.     s2 := "in";
  266.     countProp := p_oCanStandIn;
  267.     incase POS_STAND_ON:
  268.     s1 := "stand";
  269.     s2 := "on";
  270.     countProp := p_oCanStandOn;
  271.     esac;
  272.     if me@p_pPosition ~= POS_NONE then
  273.     Print("You are still " + ShowPosition(me) + "\n");
  274.     false
  275.     elif what = "" or what == "down" then
  276.     Print("You must say what you want to " + s1 + " " + s2 + ".\n");
  277.     false
  278.     else
  279.     whatName := FormatName(what);
  280.     st := FindName(here@p_rContents, p_oName, what);
  281.     if st = succeed then
  282.         whatName := " the " + whatName;
  283.         it := FindResult();
  284.         n := it@countProp;
  285.         if n = 0 then
  286.         Print("You can't " + s1 + " " + s2 + whatName + ".\n");
  287.         false
  288.         elif n = 1 then
  289.         Print("There is no room " + s2 + whatName + ".\n");
  290.         false
  291.         else
  292.         st := continue;
  293.         SetIt(it);
  294.         a := it@p_oPositionChecker;
  295.         if a ~= nil then
  296.             st := call(a, status)(pos);
  297.         fi;
  298.         if st ~= fail then
  299.             if st = continue then
  300.             Print("You " + s1 + " " + s2 + whatName + ".\n");
  301.             if not me@p_pHidden and CanSee(here, me) then
  302.                 OPrint(Capitalize(CharacterNameS(me)) + " " +
  303.                 s1 + "s " + s2 + whatName + ".\n");
  304.             fi;
  305.             fi;
  306.             me@p_pPosition := pos;
  307.             me@p_pWhere := it;
  308.             it@countProp := n - 1;
  309.             true
  310.         else
  311.             false
  312.         fi
  313.         fi
  314.     elif st = continue then
  315.         Print(Capitalize(whatName) + " is ambiguous here.\n");
  316.         false
  317.     else
  318.         if MatchName(here@p_rScenery, what) ~= -1 then
  319.         Print("You can't " + s1 + " " + s2 + " the " + whatName+".\n");
  320.         else
  321.         Print(IsAre("There", "no", whatName, "here.\n"));
  322.         fi;
  323.         false
  324.     fi
  325.     fi
  326. corp;
  327.  
  328. define tp_misc proc PositionProp(int posCode)property int:
  329.  
  330.     case posCode
  331.     incase POS_SIT_IN:
  332.     p_oCanSitIn
  333.     incase POS_SIT_ON:
  334.     p_oCanSitOn
  335.     incase POS_LIE_IN:
  336.     p_oCanLieIn
  337.     incase POS_LIE_ON:
  338.     p_oCanLieOn
  339.     incase POS_STAND_IN:
  340.     p_oCanStandIn
  341.     incase POS_STAND_ON:
  342.     p_oCanStandOn
  343.     default:
  344.     Print("*** Invalid code to PositionProp ***\n");
  345.     p_oCanSitIn
  346.     esac
  347. corp;
  348.  
  349. define tp_verbs proc unPos()bool:
  350.     string name, where;
  351.     int pos;
  352.     thing me, it;
  353.     property int prop;
  354.     bool others;
  355.  
  356.     me := Me();
  357.     pos := me@p_pPosition;
  358.     others := not me@p_pHidden and CanSee(Here(), me);
  359.     name := Capitalize(CharacterNameS(me));
  360.     where := FormatName(me@p_pWhere@p_oName);
  361.     if pos = POS_SIT_IN or pos = POS_STAND_IN or pos = POS_LIE_IN then
  362.     Print("You get out of the " + where + ".\n");
  363.     if others then
  364.         OPrint(name + " gets out of the " + where + ".\n");
  365.     fi;
  366.     elif pos = POS_SIT_ON or pos = POS_LIE_ON then
  367.     Print("You stand up.\n");
  368.     if others then
  369.         OPrint(name + " stands up.\n");
  370.     fi;
  371.     else
  372.     Print("You get down from the " + where + ".\n");
  373.     if others then
  374.         OPrint(name + " gets down from the " + where + ".\n");
  375.     fi;
  376.     fi;
  377.     me@p_pPosition := POS_NONE;
  378.     it := me@p_pWhere;
  379.     me@p_pWhere := me;        /* free any reference! */
  380.     prop := PositionProp(pos);
  381.     it@(prop) := it@(prop) + 1;
  382.     true
  383. corp;
  384.  
  385. define tp_verbs proc v_standUp()bool:
  386.  
  387.     if Me()@p_pPosition = POS_NONE then
  388.     Print("You are already standing up.\n");
  389.     false
  390.     else
  391.     unPos()
  392.     fi
  393. corp;
  394.  
  395. define tp_verbs proc v_getOff()bool:
  396.  
  397.     if Me()@p_pPosition = POS_NONE then
  398.     Print("You are not on anything.\n");
  399.     false
  400.     else
  401.     unPos()
  402.     fi
  403. corp;
  404.  
  405. define tp_verbs proc v_getOut()bool:
  406.  
  407.     if Me()@p_pPosition = POS_NONE then
  408.     Print("You are not in anything.\n");
  409.     false
  410.     else
  411.     unPos()
  412.     fi
  413. corp;
  414.  
  415. define tp_verbs proc v_sitLieStand()bool:
  416.     string v, w, np;
  417.  
  418.     v := Verb();
  419.     w := GetWord();
  420.     if w == "down" then
  421.     w := GetWord();
  422.     fi;
  423.     np := GetTail();
  424.     if v == "stand" and w == "up" then
  425.     v_standUp()
  426.     elif np = "" then
  427.     if w = "" then
  428.         w := "on";
  429.     fi;
  430.     Print("You must say what you want to " + v + " " + w + ".\n");
  431.     false
  432.     else
  433.     np := GetNounPhrase(G, np, 0);
  434.     if w == "in" then
  435.         if v == "sit" then
  436.         doPosition(np, POS_SIT_IN)
  437.         elif v == "stand" then
  438.         doPosition(np, POS_STAND_IN)
  439.         else
  440.         doPosition(np, POS_LIE_IN)
  441.         fi
  442.     elif w == "on" then
  443.         if v == "sit" then
  444.         doPosition(np, POS_SIT_ON)
  445.         elif v == "stand" then
  446.         doPosition(np, POS_STAND_ON)
  447.         else
  448.         doPosition(np, POS_LIE_ON)
  449.         fi
  450.     else
  451.         Print("I don't know how to " + v + " " + w + " something.\n");
  452.         false
  453.     fi
  454.     fi
  455. corp;
  456.  
  457. VerbTail(G, "sit", v_sitLieStand)$
  458. VerbTail(G, "lie", v_sitLieStand)$
  459. VerbTail(G, "lay", v_sitLieStand)$
  460. VerbTail(G, "stand", v_sitLieStand)$
  461. Verb0(G, "standup", 0, v_standUp)$
  462. Verb0(G, "get", FindAnyWord(G, "off"), v_getOff)$
  463. Verb0(G, "get", FindAnyWord(G, "down"), v_getOff)$
  464. Verb0(G, "get", FindAnyWord(G, "out"), v_getOut)$
  465.  
  466.  
  467. /* some standard verb routines and the corresponding verbs */
  468.  
  469. /*
  470.  * lookAtObject - common code to do the looking at a normal object.
  471.  */
  472.  
  473. define tp_verbs proc lookAtObject(thing object)bool:
  474.     status st;
  475.     action a;
  476.     string s;
  477.  
  478.     st := continue;
  479.     a := object@p_oDescCheck;
  480.     if a ~= nil then
  481.     st := call(a, status)();
  482.     fi;
  483.     if st ~= fail then
  484.     a := object@p_oDescAction;
  485.     if a = nil then
  486.         s := object@p_oDesc;
  487.         if s = "" then
  488.         Print("You see nothing special about the " +
  489.             FormatName(object@p_oName) + ".\n");
  490.         else
  491.         NPrint(s);
  492.         fi;
  493.     else
  494.         SetIt(object);
  495.         Print(call(a, string)() + "\n");
  496.     fi;
  497.     if object@p_Image ~= "" then
  498.         ShowImage(object@p_Image);
  499.     fi;
  500.     true
  501.     else
  502.     false
  503.     fi
  504. corp;
  505.  
  506. define tp_verbs proc v_look(string what)bool:
  507.     thing here, me, object;
  508.     string ambig, name, s;
  509.     action a;
  510.     status st;
  511.     int dir;
  512.     bool wasScenery;
  513.  
  514.     here := Here();
  515.     me := Me();
  516.     if what = "" then
  517.     Print("You must specify what you want to look at.\n");
  518.     false
  519.     elif not CanSee(here, me) then
  520.     Print("It is dark here.\n");
  521.     false
  522.     elif what == "all" then
  523.     st := DoAll(here@p_rContents, lookAtObject);
  524.     if st = fail then
  525.         Print("There are no obvious things here to look at.\n");
  526.         false
  527.     else
  528.         st = continue
  529.     fi
  530.     else
  531.     object := FindAgent(what);
  532.     if object ~= nil then
  533.         /* player is examining another player or a monster */
  534.         LookAtCharacter(object)
  535.     else
  536.         dir := DirMatch(what);
  537.         if dir ~= -1 then
  538.         /* looking in a given direction */
  539.         s := here@(DirDesc(dir));
  540.         if s = "" then
  541.             Print("You see nothing special in that direction.\n");
  542.         else
  543.             NPrint(s);
  544.         fi;
  545.         s := here@(DirImage(dir));
  546.         if s ~= "" then
  547.             ShowImage(s);
  548.         fi;
  549.         true
  550.         else
  551.         /* player is examining an object */
  552.         name := FormatName(what);
  553.         object := nil;
  554.         wasScenery := false;
  555.         ambig := " is ambiguous here.\n";
  556.         st := FindName(me@p_pCarrying, p_oName, what);
  557.         if st = fail then
  558.             st := FindName(here@p_rContents, p_oName, what);
  559.             if st = fail and here@p_rBuyList ~= nil then
  560.             st := FindName(here@p_rBuyList, p_oName, what);
  561.             fi;
  562.             if st = fail then
  563.             if MatchName(here@p_rScenery, what) ~= -1 then
  564.                 Print("You see nothing special about the " +
  565.                 name + ".\n");
  566.                 wasScenery := true;
  567.             else
  568.                 Print(IsAre("There", "no", name, "here.\n"));
  569.             fi;
  570.             elif st = continue then
  571.             Print(Capitalize(name));
  572.             Print(ambig);
  573.             else
  574.             object := FindResult();
  575.             fi;
  576.         elif st = continue then
  577.             Print(Capitalize(name));
  578.             Print(ambig);
  579.         else
  580.             object := FindResult();
  581.         fi;
  582.         if object = nil then
  583.             wasScenery
  584.         else
  585.             lookAtObject(object)
  586.         fi
  587.         fi
  588.     fi
  589.     fi
  590. corp;
  591.  
  592. define tp_verbs proc v_lookInwards()bool:
  593.     v_look("in")
  594. corp;
  595.  
  596. /*
  597.  * Note that the code here is very similar to that in EnterRoom in util1.m
  598.  * This is as desired - the same stuff should be seen.
  599.  */
  600.  
  601. define tp_verbs proc v_lookAround()bool:
  602.     thing me;
  603.  
  604.     me := Me();
  605.     if not CanSee(Here(), me) then
  606.     Print("It is dark here.\n");
  607.     false
  608.     else
  609.     if ShowRoomToMe(true) then
  610.         if not me@p_pHidden then
  611.         OPrint(Capitalize(CharacterNameS(me)) + " looks around.\n");
  612.         fi;
  613.         true
  614.     else
  615.         false
  616.     fi
  617.     fi
  618. corp;
  619.  
  620. define tp_verbs proc v_exits()bool:
  621.     ShowExits(Here());
  622.     true
  623. corp;
  624.  
  625. Verb1(G, "look", FindAnyWord(G, "at"), v_look)$
  626. /* Do the "around" one first, so that just "look" gets it. */
  627. Verb0(G, "look", FindAnyWord(G, "around"), v_lookAround)$
  628. /* Special case to enable "look inwards" */
  629. Verb0(G, "look", FindAnyWord(G, "in"), v_lookInwards)$
  630. Synonym(G, "look", "examine")$
  631. Synonym(G, "look", "l")$
  632. Verb0(G, "exits", 0, v_exits)$
  633. Synonym(G, "exits", "x")$
  634.  
  635.  
  636. define tp_verbs proc readObject(thing object)bool:
  637.     action a;
  638.  
  639.     SetIt(object);
  640.     a := object@p_oReadAction;
  641.     if a ~= nil then
  642.     Paginate(call(a, string)());
  643.     elif object@p_oReadString ~= "" then
  644.     Paginate(object@p_oReadString);
  645.     else
  646.     Print("There is nothing to read on the " +
  647.         FormatName(object@p_oName) + ".\n");
  648.     fi;
  649.     true
  650. corp;
  651.  
  652. define tp_verbs proc doReadObject(thing object)bool:
  653.  
  654.     ignore readObject(object);
  655.     true
  656. corp;
  657.  
  658. define tp_verbs proc v_read(string what)bool:
  659.     thing me, here, object;
  660.     status st;
  661.     action a;
  662.     string name, ambig;
  663.     bool wasScenery;
  664.  
  665.     me := Me();
  666.     here := Here();
  667.     if what = "" then
  668.     Print("You must specify what you want to read.\n");
  669.     false
  670.     elif not CanSee(here, me) then
  671.     Print("It is dark here.\n");
  672.     false
  673.     else
  674.     st := continue;
  675.     a := me@p_pReadChecker;
  676.     if a ~= nil then
  677.         st := call(a, status)();
  678.     fi;
  679.     if st = continue then
  680.         if what == "all" then
  681.         st := DoAll(me@p_pCarrying, readObject);
  682.         if st ~= succeed then
  683.             st := DoAll(here@p_rContents, doReadObject);
  684.             if st = fail then
  685.             st := continue;
  686.             fi;
  687.         fi;
  688.         if st = fail then
  689.             Print("There are no obvious things here to read.\n");
  690.             false
  691.         else
  692.             st = continue
  693.         fi
  694.         else
  695.         name := FormatName(what);
  696.         object := FindAgent(what);
  697.         if object ~= nil then
  698.             readObject(object)
  699.         else
  700.             object := nil;
  701.             wasScenery := false;
  702.             ambig := " is ambiguous here.\n";
  703.             st := FindName(me@p_pCarrying, p_oName, what);
  704.             if st = fail then
  705.             st := FindName(here@p_rContents, p_oName, what);
  706.             if st = fail then
  707.                 if here@p_rBuyList ~= nil and
  708.                 FindName(here@p_rBuyList, p_oName,what) ~= fail
  709.                 then
  710.                 Print("You should buy the " + name +
  711.                     " before you try to read it.\n");
  712.                 elif MatchName(here@p_rScenery, what) ~= -1 then
  713.                 Print("There is nothing to read on the " +
  714.                     name + ".\n");
  715.                 wasScenery := true;
  716.                 else
  717.                 Print(IsAre("There", "no", name, "here.\n"));
  718.                 fi;
  719.             elif st = continue then
  720.                 Print(Capitalize(name));
  721.                 Print(ambig);
  722.             else
  723.                 object := FindResult();
  724.             fi;
  725.             elif st = continue then
  726.             Print(Capitalize(name));
  727.             Print(ambig);
  728.             else
  729.             object := FindResult();
  730.             fi;
  731.             if object = nil then
  732.             wasScenery
  733.             else
  734.             readObject(object)
  735.             fi
  736.         fi
  737.         fi
  738.     else
  739.         st ~= fail
  740.     fi
  741.     fi
  742. corp;
  743. Verb1(G, "read", 0, v_read)$
  744.  
  745.  
  746. define tp_verbs proc v_inventory()bool:
  747.     int cash;
  748.     thing me;
  749.  
  750.     me := Me();
  751.     cash := me@p_pMoney;
  752.     if cash = 0 then
  753.     Print("You are broke.\n");
  754.     else
  755.     Print("You have ");
  756.     IPrint(cash);
  757.     if cash = 1 then
  758.         Print(" bluto.\n");
  759.     else
  760.         Print(" blutos.\n");
  761.     fi;
  762.     fi;
  763.     if ShowList(me@p_pCarrying, "You are carrying:\n") then
  764.     Print("You are not carrying anything.\n");
  765.     fi;
  766.     if not me@p_pHidden and CanSee(Here(), me) then
  767.     OPrint(Capitalize(CharacterNameS(me)) + " takes inventory.\n");
  768.     fi;
  769.     true
  770. corp;
  771.  
  772. Verb0(G, "inventory", 0, v_inventory)$
  773. Synonym(G, "inventory", "inv")$
  774. Synonym(G, "inventory", "i")$
  775.  
  776.  
  777. define t_base p_oNotGetString CreateStringProp()$
  778.  
  779. define t_util proc public DoGet(thing where, who, what)status:
  780.     action a;
  781.     string whatName;
  782.     status st;
  783.  
  784.     whatName := FormatName(what@p_oName);
  785.     if what@p_oNotGetString ~= "" then
  786.     Print(what@p_oNotGetString + "\n");
  787.     fail
  788.     elif what@p_oNotGettable then
  789.     Print("You cannot get the " + whatName + ".\n");
  790.     fail
  791.     else
  792.     a := what@p_oGetChecker;
  793.     st := continue;
  794.     if a ~= nil then
  795.         SetIt(what);
  796.         st := call(a, status)(what);
  797.     fi;
  798.     if st = continue then
  799.         /* object not chained to floor or anything */
  800.         st := DoRoomGetChecks(where, what);
  801.         if st = continue then
  802.         /* room floor isn't a pool of glue or anything */
  803.         if CarryItem(what) then
  804.             DelElement(where@p_rContents, what);
  805.             what -- p_oWhere;
  806.             SPrint(who, whatName + ": taken.\n");
  807.             if CanSee(where, who) then
  808.             if who@p_pHidden then
  809.                 ABPrint(where, who, who, "The " + whatName +
  810.                     " rises and vanishes from view\n");
  811.             else
  812.                 ABPrint(where, who, who,
  813.                 Capitalize(CharacterNameG(who)) +
  814.                 " has taken the " + whatName + ".\n");
  815.             fi;
  816.             fi;
  817.             succeed
  818.         else
  819.             fail
  820.         fi
  821.         else
  822.         st
  823.         fi
  824.     else
  825.         st
  826.     fi
  827.     fi
  828. corp;
  829.  
  830. define tp_verbs proc getAllStub(thing object)bool:
  831.  
  832.     DoGet(Here(), Me(), object) ~= fail
  833. corp;
  834.  
  835. define tp_verbs proc v_get(string what)bool:
  836.     string verb, whatName;
  837.     thing me, here, object;
  838.     status st;
  839.  
  840.     verb := Verb();
  841.     here := Here();
  842.     me := Me();
  843.     if what = "" then
  844.     Print("You must specify what you want to " + Verb() + ".\n");
  845.     false
  846.     elif what == "inventory" and verb == "take" then
  847.     v_inventory()
  848.     elif what == "exit" and verb == "take" then
  849.     v_exit()
  850.     elif what == "entrance" and verb == "take" then
  851.     v_enter()
  852.     elif what == "up" and verb == "get" then
  853.     v_standUp()
  854.     elif what == "all" then
  855.     st := DoAll(here@p_rContents, getAllStub);
  856.     if st = fail then
  857.         Print("There are no obvious things here to get.\n");
  858.         false
  859.     else
  860.         st = continue
  861.     fi
  862.     else
  863.     whatName := FormatName(what);
  864.     st := FindName(here@p_rContents, p_oName, what);
  865.     if st = succeed then
  866.         object := FindResult();
  867.         DoGet(here, me, object) ~= fail
  868.     elif st = continue then
  869.         Print(Capitalize(whatName) + " is ambiguous here.\n");
  870.         false
  871.     else
  872.         if here@p_rBuyList ~= nil and
  873.         FindName(here@p_rBuyList, p_oName, what) ~= fail
  874.         then
  875.         Print("You should buy the " + whatName +
  876.             " before you take it.\n");
  877.         elif FindAgent(what) ~= nil then
  878.         Print("You can't get " + whatName + ".\n");
  879.         else
  880.         if FindName(me@p_pCarrying, p_oName, what) ~= fail then
  881.             Print("You are already carrying the " + whatName + ".\n");
  882.         else
  883.             if MatchName(here@p_rScenery, what) ~= -1 then
  884.             Print("You can't get the " + whatName + ".\n");
  885.             else
  886.             Print(IsAre("There", "no", whatName, "here.\n"));
  887.             fi;
  888.         fi;
  889.         fi;
  890.         false
  891.     fi
  892.     fi
  893. corp;
  894.  
  895. Verb1(G, "pick", FindAnyWord(G, "up"), v_get)$
  896. Verb1(G, "get", 0, v_get)$
  897. Synonym(G, "get", "pickup")$
  898. Synonym(G, "get", "take")$
  899.  
  900.  
  901. /* this is public since it is used in the build code */
  902.  
  903. public proc public DoDrop(thing where, who, what)status:
  904.     action a;
  905.     string whatName;
  906.     status st;
  907.  
  908.     /* NOTE: we do any object-specific stuff first. The mixture of the
  909.        fighting stuff and the garbage room relies on this. */
  910.     st := continue;
  911.     a := what@p_oUnGetChecker;
  912.     if a ~= nil then
  913.     SetIt(what);
  914.     st := call(a, status)(what);
  915.     fi;
  916.     if st = continue then
  917.     a := what@p_oDropChecker;
  918.     if a ~= nil then
  919.         SetIt(what);
  920.         st := call(a, status)(what);
  921.     fi;
  922.     fi;
  923.     if st = continue then
  924.     /* it wasn't a bomb that blew up or anything */
  925.     st := DoRoomDropChecks(where, what);
  926.     if st = continue then
  927.         /* nothing funny about dropping things here */
  928.         AddTail(where@p_rContents, what);
  929.         DelElement(who@p_pCarrying, what);
  930.         what -- p_oCarryer;
  931.         what@p_oWhere := where;
  932.         whatName := FormatName(what@p_oName);
  933.         SPrint(who, whatName + ": dropped.\n");
  934.         if CanSee(where, who) then
  935.         if who@p_pHidden then
  936.             ABPrint(where, who, who, "The " + whatName +
  937.                 " appears from nowhere and drops.\n");
  938.         else
  939.             ABPrint(where, who, who,
  940.                 Capitalize(CharacterNameG(who)) +
  941.                 " has dropped the " + whatName + ".\n");
  942.         fi;
  943.         fi;
  944.         continue
  945.     else
  946.         st
  947.     fi
  948.     else
  949.     st
  950.     fi
  951. corp;
  952.  
  953. define tp_verbs proc dropAllStub(thing object)bool:
  954.  
  955.     DoDrop(Here(), Me(), object) ~= fail
  956. corp;
  957.  
  958. define tp_verbs proc v_drop(string what)bool:
  959.     thing me, object;
  960.     string whatName;
  961.     status st;
  962.  
  963.     me := Me();
  964.     if what = "" then
  965.     Print("You must specify what you want to drop.\n");
  966.     false
  967.     elif what == "all" then
  968.     st := DoAll(me@p_pCarrying, dropAllStub);
  969.     if st = fail then
  970.         Print("You are not carrying anything obvious to drop.\n");
  971.         false
  972.     else
  973.         st = continue
  974.     fi
  975.     else
  976.     whatName := FormatName(what);
  977.     st := FindName(me@p_pCarrying, p_oName, what);
  978.     if st = succeed then
  979.         object := FindResult();
  980.         DoDrop(Here(), me, object) ~= fail
  981.     elif st = continue then
  982.         Print(Capitalize(whatName) + " is ambiguous.\n");
  983.         false
  984.     else
  985.         Print(AAn("You are not carrying", whatName) + ".\n");
  986.         false
  987.     fi
  988.     fi
  989. corp;
  990.  
  991. Verb1(G, "put", FindAnyWord(G, "down"), v_drop)$
  992. Verb1(G, "drop", 0, v_drop)$
  993.  
  994.  
  995. /* the fancy Verb2 ones */
  996.  
  997. define tp_verbs proc v_give(string what, toWho)bool:
  998.     string whatName, whoName, myName;
  999.     status st;
  1000.     thing me, here, item, who;
  1001.     action a;
  1002.     character ch;
  1003.     int len;
  1004.  
  1005.     whatName := FormatName(what);
  1006.     whoName := FormatName(toWho);
  1007.     me := Me();
  1008.     here := Here();
  1009.     myName := Capitalize(CharacterNameS(me));
  1010.     who := FindAgent(toWho);
  1011.     if who = me then
  1012.     Print("There is no point in giving to yourself.\n");
  1013.     false
  1014.     elif who = nil then
  1015.     if MatchName(here@p_rScenery, toWho) ~= -1 then
  1016.         Print("You can't give things to the scenery!\n");
  1017.     else
  1018.         Print(whoName + " is not here!\n");
  1019.     fi;
  1020.     false
  1021.     elif Count(who@p_pCarrying) >= MAX_CARRY then
  1022.     Print(whoName + " can't carry anything else.\n");
  1023.     false
  1024.     else
  1025.     st := FindName(me@p_pCarrying, p_oName, what);
  1026.     if st = succeed then
  1027.         item := FindResult();
  1028.         SetIt(item);
  1029.         st := continue;
  1030.         a := item@p_oUnGetChecker;
  1031.         if a ~= nil then
  1032.         st := call(a, status)(item);
  1033.         fi;
  1034.         if st = continue then
  1035.         a := who@p_pGivePre;
  1036.         if a ~= nil then
  1037.             st := ForceAction(who, a);
  1038.         fi;
  1039.         fi;
  1040.         if st = continue then
  1041.         a := item@p_oGiveChecker;
  1042.         if a ~= nil then
  1043.             st := call(a, status)(who);
  1044.         fi;
  1045.         fi;
  1046.         if st = continue then
  1047.         a := who@p_pGivePost;
  1048.         if a ~= nil then
  1049.             st := ForceAction(who, a);
  1050.         fi;
  1051.         fi;
  1052.         if st = continue then
  1053.         /* cannot use CarryItem here - wrong person is running */
  1054.         whatName := FormatName(item@p_oName);
  1055.         AddTail(who@p_pCarrying, item);
  1056.         DelElement(me@p_pCarrying, item);
  1057.         item@p_oCarryer := who;
  1058.         ch := ThingCharacter(who);
  1059.         if item@p_oCreator = me and ch ~= nil then
  1060.             item@p_oCreator := who;
  1061.         fi;
  1062.         if Owner(item) = MeCharacter() then
  1063.             if ch = nil then
  1064.             ch := SysAdmin;
  1065.             fi;
  1066.             GiveThing(item, ch);
  1067.         fi;
  1068.         Print("You give the " + whatName + " to " + whoName + ".\n");
  1069.         if not me@p_pHidden and CanSee(here, who) then
  1070.             SPrint(who, AAn(myName + " gives you", whatName) + ".\n");
  1071.             ABPrint(here, me, who, AAn(myName + " gives", whatName) +
  1072.             " to " + whoName + ".\n");
  1073.         else
  1074.             SPrint(who, AAn("Someone gives you", whatName) + ".\n");
  1075.         fi;
  1076.         true
  1077.         else
  1078.         st = succeed
  1079.         fi
  1080.     elif st = continue then
  1081.         Print(Capitalize(whatName) + " is ambiguous.\n");
  1082.         false
  1083.     else
  1084.         if SubString(what, 0, 5) == "bluto" then
  1085.         len := Length(what) - 5;
  1086.         what := SubString(what, 5, len);
  1087.         if SubString(what, 0, 1) == "s" then
  1088.             len := len - 1;
  1089.             what := SubString(what, 1, len);
  1090.         fi;
  1091.         if SubString(what, 0, 1) == ";" then
  1092.             len := len - 1;
  1093.             what := SubString(what, 1, len);
  1094.         fi;
  1095.         if len = 0 then
  1096.             Print("You must say how many blutos to give.\n");
  1097.             false
  1098.         else
  1099.             len := StringToInt(what);
  1100.             if len < 0 then
  1101.             Print("Invalid bluto count.\n");
  1102.             false
  1103.             else
  1104.             if len > me@p_pMoney then
  1105.                 Print("You don't have that many!\n");
  1106.                 false
  1107.             else
  1108.                 if not me@p_pHidden and CanSee(here, who) then
  1109.                 if len = 1 then
  1110.                     Print("You give one bluto to " +
  1111.                     whoName + ".\n");
  1112.                     SPrint(who, myName +
  1113.                     " gives you one bluto.\n");
  1114.                 else
  1115.                     Print("You give " + IntToString(len) +
  1116.                     " blutos to " + whoName + ".\n");
  1117.                     SPrint(who, myName + " gives you " +
  1118.                     IntToString(len) + " blutos.\n");
  1119.                 fi;
  1120.                 ABPrint(here, me, who,
  1121.                     " gives some blutos to " + whoName +
  1122.                     ".\n");
  1123.                 else
  1124.                 if len = 1 then
  1125.                     SPrint(who,
  1126.                     "Someone gives you one bluto.\n");
  1127.                 else
  1128.                     SPrint(who, "Someone gives you " +
  1129.                     IntToString(len) + " blutos.\n");
  1130.                 fi;
  1131.                 fi;
  1132.                 me@p_pMoney := me@p_pMoney - len;
  1133.                 who@p_pMoney := who@p_pMoney + len;
  1134.                 true
  1135.             fi
  1136.             fi
  1137.         fi
  1138.         else
  1139.         Print(AAn("You are not carrying", whatName) + ".\n");
  1140.         false
  1141.         fi
  1142.     fi
  1143.     fi
  1144. corp;
  1145.  
  1146. Verb2(G, "give", FindAnyWord(G, "to"), v_give)$
  1147. Synonym(G, "give", "donate")$
  1148. Synonym(G, "give", "grant")$
  1149.  
  1150.  
  1151. define tp_verbs proc v_putIn(string itemRaw, containerRaw)bool:
  1152.     string itemName, containerName;
  1153.     thing me, here, item, container;
  1154.     status st;
  1155.     list thing lt;
  1156.     action a;
  1157.  
  1158.     itemName := FormatName(itemRaw);
  1159.     containerName := FormatName(containerRaw);
  1160.     me := Me();
  1161.     st := FindName(me@p_pCarrying, p_oName, itemRaw);
  1162.     if st = fail then
  1163.     Print(AAn("You aren't carrying", itemName) + ".\n");
  1164.     false
  1165.     elif st = continue then
  1166.     Print(Capitalize(itemName) + " is ambiguous.\n");
  1167.     false
  1168.     else
  1169.     item := FindResult();
  1170.     itemName := FormatName(item@p_oName);
  1171.     st := FindName(me@p_pCarrying, p_oName, containerRaw);
  1172.     if st = fail then
  1173.         st := FindName(Here()@p_rContents, p_oName, containerRaw);
  1174.     fi;
  1175.     if st = fail then
  1176.         here := Here();
  1177.         if here@p_rBuyList ~= nil and
  1178.         FindName(here@p_rBuyList, p_oName, containerRaw) ~= fail
  1179.         then
  1180.         Print("You should buy the " + containerName +
  1181.             " before you try to put things into it.\n");
  1182.         elif MatchName(here@p_rScenery, containerRaw) ~= -1 then
  1183.         Print("You can't put things into the " +containerName + ".\n");
  1184.         else
  1185.         Print("There is no " + containerName + " here.\n");
  1186.         fi;
  1187.         false
  1188.     elif st = continue then
  1189.         Print(Capitalize(containerName) + " is ambiguous.\n");
  1190.         false
  1191.     else
  1192.         container := FindResult();
  1193.         containerName := FormatName(container@p_oName);
  1194.         lt := container@p_oContents;
  1195.         if lt = nil then
  1196.         Print("You can't put things into the " +containerName + ".\n");
  1197.         false
  1198.         elif item = container then
  1199.         Print("You can't put the " + itemName + " into itself!\n");
  1200.         false
  1201.         else
  1202.         st := continue;
  1203.         a := item@p_oUnGetChecker;
  1204.         if a ~= nil then
  1205.             st := call(a, status)(item);
  1206.         fi;
  1207.         if st = continue then
  1208.             a := item@p_oPutMeInChecker;
  1209.             if a ~= nil then
  1210.             st := call(a, status)(item, container);
  1211.             fi;
  1212.         fi;
  1213.         if st = continue then
  1214.             a := container@p_oPutInMeChecker;
  1215.             if a ~= nil then
  1216.             st := call(a, status)(item, container);
  1217.             elif Count(lt) >= container@p_oCapacity then
  1218.             Print("There is no room in the " + containerName +
  1219.                 " for the " + itemName + ".\n");
  1220.             st := fail;
  1221.             fi;
  1222.         fi;
  1223.         if st = continue then
  1224.             AddTail(lt, item);
  1225.             DelElement(me@p_pCarrying, item);
  1226.             item -- p_oCarryer;
  1227.             item@p_oWhere := container;
  1228.             Print("You put the " + itemName + " into the " +
  1229.             containerName + ".\n");
  1230.             true
  1231.         else
  1232.             st ~= fail
  1233.         fi
  1234.         fi
  1235.     fi
  1236.     fi
  1237. corp;
  1238.  
  1239. define tp_verbs proc v_takeFrom(string itemRaw, containerRaw)bool:
  1240.     string itemName, containerName;
  1241.     thing me, here, item, container;
  1242.     status st;
  1243.     list thing lt;
  1244.     action a;
  1245.  
  1246.     itemName := FormatName(itemRaw);
  1247.     containerName := FormatName(containerRaw);
  1248.     me := Me();
  1249.     st := FindName(me@p_pCarrying, p_oName, containerRaw);
  1250.     if st = fail then
  1251.     st := FindName(Here()@p_rContents, p_oName, containerRaw);
  1252.     fi;
  1253.     if st = fail then
  1254.     here := Here();
  1255.     if here@p_rBuyList ~= nil and
  1256.         FindName(here@p_rBuyList, p_oName, containerRaw) ~= fail
  1257.     then
  1258.         Print("You should buy the " + containerName +
  1259.         " before you try to take things from it.\n");
  1260.     elif MatchName(here@p_rScenery, containerRaw) ~= -1 then
  1261.         Print("You can't take things from the " + containerName + ".\n");
  1262.     else
  1263.         Print("There is no " + containerName + " here.\n");
  1264.     fi;
  1265.     false
  1266.     elif st = continue then
  1267.     Print(Capitalize(containerName) + " is ambiguous.\n");
  1268.     false
  1269.     else
  1270.     container := FindResult();
  1271.     containerName := FormatName(container@p_oName);
  1272.     lt := container@p_oContents;
  1273.     if lt = nil then
  1274.         Print("There is nothing in the " + containerName + ".\n");
  1275.         false
  1276.     else
  1277.         st := FindName(container@p_oContents, p_oName, itemRaw);
  1278.         if st = fail then
  1279.         Print("There is no " + itemName + " in the " + containerName +
  1280.             ".\n");
  1281.         false
  1282.         elif st = continue then
  1283.         Print(Capitalize(itemName) + " is ambiguous.\n");
  1284.         false
  1285.         elif Count(me@p_pCarrying) >= MAX_CARRY then
  1286.         Print("You can't carry anything else.\n");
  1287.         false
  1288.         else
  1289.         item := FindResult();
  1290.         itemName := FormatName(item@p_oName);
  1291.         st := continue;
  1292.         a := item@p_oTakeMeFromChecker;
  1293.         if a ~= nil then
  1294.             st := call(a, status)(item, container);
  1295.         fi;
  1296.         if st = continue then
  1297.             a := container@p_oTakeFromMeChecker;
  1298.             if a ~= nil then
  1299.             st := call(a, status)(item, container);
  1300.             fi;
  1301.         fi;
  1302.         if st = continue then
  1303.             a := item@p_oGetChecker;
  1304.             if a ~= nil then
  1305.             st := call(a, status)(item);
  1306.             fi;
  1307.         fi;
  1308.         if st = continue then
  1309.             AddTail(me@p_pCarrying, item);
  1310.             DelElement(container@p_oContents, item);
  1311.             item -- p_oWhere;
  1312.             item@p_oCarryer := me;
  1313.             Print("You take the " + itemName + " from the " +
  1314.             containerName + ".\n");
  1315.             true
  1316.         else
  1317.             st ~= fail
  1318.         fi
  1319.         fi
  1320.     fi
  1321.     fi
  1322. corp;
  1323.  
  1324. define tp_verbs proc v_lookIn(string containerRaw)bool:
  1325.     string containerName;
  1326.     thing me, here, container;
  1327.     status st;
  1328.     list thing lt;
  1329.     string str;
  1330.     action a;
  1331.  
  1332.     if containerRaw = "" then
  1333.     Print("You must specify what you want to look in.\n");
  1334.     false
  1335.     else
  1336.     me := Me();
  1337.     here := Here();
  1338.     containerName := FormatName(containerRaw);
  1339.     st := FindName(me@p_pCarrying, p_oName, containerRaw);
  1340.     if st = fail then
  1341.         st := FindName(here@p_rContents, p_oName, containerRaw);
  1342.     fi;
  1343.     if st = fail then
  1344.         if here@p_rBuyList ~= nil and
  1345.         FindName(here@p_rBuyList, p_oName, containerRaw) ~= fail
  1346.         then
  1347.         Print("You should buy the " + containerName + " first.\n");
  1348.         elif MatchName(here@p_rScenery, containerRaw) ~= -1 then
  1349.         if not CanSee(here, me) then
  1350.             Print("It is dark.\n");
  1351.         else
  1352.             Print("There is nothing to see in the " + containerName +
  1353.             ".\n");
  1354.         fi;
  1355.         else
  1356.         Print("There is no " + containerName + " here.\n");
  1357.         fi;
  1358.         false
  1359.     elif st = continue then
  1360.         Print(Capitalize(containerName) + " is ambiguous.\n");
  1361.         false
  1362.     else
  1363.         /* do this BEFORE calling CanSee! */
  1364.         container := FindResult();
  1365.         if not CanSee(here, me) then
  1366.         Print("It is dark.\n");
  1367.         false
  1368.         else
  1369.         containerName := FormatName(container@p_oName);
  1370.         lt := container@p_oContents;
  1371.         if lt = nil then
  1372.             str := container@p_oLookInString;
  1373.             if str ~= "" then
  1374.             Print(str + "\n");
  1375.             true
  1376.             else
  1377.             a := container@p_oLookInAction;
  1378.             if a ~= nil then
  1379.                 Print(call(a, string)(container) + "\n");
  1380.                 true
  1381.             else
  1382.                 Print("There is nothing in the " +
  1383.                 containerName + ".\n");
  1384.                 false
  1385.             fi
  1386.             fi
  1387.         else
  1388.             if ShowList(lt, "The " + containerName + " contains:\n")
  1389.             then
  1390.             Print("The " + containerName + " is empty.\n");
  1391.             fi;
  1392.             true
  1393.         fi
  1394.         fi
  1395.     fi
  1396.     fi
  1397. corp;
  1398.  
  1399. define tp_verbs proc v_insert0(string what)bool:
  1400.  
  1401.     Print("You must say what you want to insert the " + FormatName(what) +
  1402.     " into.\n");
  1403.     false
  1404. corp;
  1405.  
  1406. Verb2(G, "put", FindAnyWord(G, "in"), v_putIn)$
  1407. Verb2(G, "put", FindAnyWord(G, "on"), v_putIn)$
  1408. /* Need to do separate verb for "insert", rather than making it a
  1409.    synonym of "put", since you cannot have something be both a synonym
  1410.    and a verb in its own right. */
  1411. Verb1(G, "insert", 0, v_insert0)$
  1412. Verb2(G, "insert", FindAnyWord(G, "in"), v_putIn)$
  1413. Verb2(G, "get", FindAnyWord(G, "from"), v_takeFrom)$
  1414. Verb2(G, "remove", FindAnyWord(G, "from"), v_takeFrom)$
  1415. /* get will use synonyms for the other 'get' */
  1416. Verb1(G, "look", FindAnyWord(G, "in"), v_lookIn)$
  1417.  
  1418.  
  1419. define tp_verbs proc v_fillFrom(string containerRaw, itemRaw)bool:
  1420.     string itemName, containerName;
  1421.     thing me, here, item, container;
  1422.     status st;
  1423.     action a;
  1424.  
  1425.     containerName := FormatName(containerRaw);
  1426.     itemName := FormatName(itemRaw);
  1427.     me := Me();
  1428.     st := FindName(me@p_pCarrying, p_oName, containerRaw);
  1429.     if st = fail then
  1430.     Print(AAn("You aren't carrying", containerName) + ".\n");
  1431.     false
  1432.     elif st = continue then
  1433.     Print(Capitalize(containerName) + " is ambiguous.\n");
  1434.     false
  1435.     else
  1436.     container := FindResult();
  1437.     containerName := FormatName(container@p_oName);
  1438.     st := FindName(me@p_pCarrying, p_oName, itemRaw);
  1439.     if st = fail then
  1440.         st := FindName(Here()@p_rContents, p_oName, itemRaw);
  1441.     fi;
  1442.     if st = fail then
  1443.         here := Here();
  1444.         if here@p_rBuyList ~= nil and
  1445.         FindName(here@p_rBuyList, p_oName, itemRaw) ~= fail
  1446.         then
  1447.         Print("You should buy the " + itemName +
  1448.             " before you try to put it into something.\n");
  1449.         elif MatchName(here@p_rScenery, itemRaw) ~= -1 then
  1450.         Print("You can't fill the " + containerName + " from the " +
  1451.             itemName + ".\n");
  1452.         else
  1453.         Print("There is no " + itemName + " here.\n");
  1454.         fi;
  1455.         false
  1456.     elif st = continue then
  1457.         Print(Capitalize(itemName) + " is ambiguous.\n");
  1458.         false
  1459.     else
  1460.         item := FindResult();
  1461.         itemName := FormatName(item@p_oName);
  1462.         a := container@p_oFillMeWithChecker;
  1463.         if a = nil then
  1464.         Print("You can't fill the " + containerName + ".\n");
  1465.         false
  1466.         elif item = container then
  1467.         Print("You can't fill the " + itemName + " from itself!\n");
  1468.         false
  1469.         else
  1470.         st := call(a, status)(container, item);
  1471.         if st = continue then
  1472.             a := item@p_oFillWithMeChecker;
  1473.             if a ~= nil then
  1474.             st := call(a, status)(container, item);
  1475.             fi;
  1476.         fi;
  1477.         if st = continue then
  1478.             Print("You fill the " + containerName + " from the " +
  1479.             itemName + ".\n");
  1480.             true
  1481.         elif st = fail then
  1482.             Print("You can't fill the " + containerName +
  1483.             " from the " + itemName + ".\n");
  1484.             false
  1485.         else
  1486.             true
  1487.         fi
  1488.         fi
  1489.     fi
  1490.     fi
  1491. corp;
  1492.  
  1493. Verb2(G, "fill", FindAnyWord(G, "from"), v_fillFrom)$
  1494. Verb2(G, "fill", FindAnyWord(G, "with"), v_fillFrom)$
  1495.  
  1496. define tp_verbs proc v_empty(string containerRaw)bool:
  1497.     string containerName;
  1498.     thing me, container;
  1499.     status st;
  1500.     action a;
  1501.  
  1502.     containerName := FormatName(containerRaw);
  1503.     me := Me();
  1504.     st := FindName(me@p_pCarrying, p_oName, containerRaw);
  1505.     if st = fail then
  1506.     Print(AAn("You aren't carrying", containerName) + ".\n");
  1507.     false
  1508.     elif st = continue then
  1509.     Print(Capitalize(containerName) + " is ambiguous.\n");
  1510.     false
  1511.     else
  1512.     container := FindResult();
  1513.     containerName := FormatName(container@p_oName);
  1514.     a := container@p_oEmptyChecker;
  1515.     if a = nil then
  1516.         if container@p_oContents ~= nil then
  1517.         Print("Empty the " + containerName +
  1518.             " by taking things out of it.\n");
  1519.         else
  1520.         Print("You can't empty the " + containerName + ".\n");
  1521.         fi;
  1522.         false
  1523.     else
  1524.         st := call(a, status)(container);
  1525.         if st = continue then
  1526.         Print("You empty the " + containerName + ".\n");
  1527.         true
  1528.         elif st = fail then
  1529.         Print("You can't empty the " + containerName + ".\n");
  1530.         false
  1531.         else
  1532.         true
  1533.         fi
  1534.     fi
  1535.     fi
  1536. corp;
  1537.  
  1538. Verb1(G, "empty", 0, v_empty)$
  1539.  
  1540.  
  1541. define tp_verbs proc v_unlock(string lockRaw, keyRaw)bool:
  1542.     string keyName, lockName, str;
  1543.     thing me, here, key, lock;
  1544.     status st;
  1545.     list thing lt;
  1546.     action a;
  1547.  
  1548.     lockName := FormatName(lockRaw);
  1549.     keyName := FormatName(keyRaw);
  1550.     me := Me();
  1551.     here := Here();
  1552.     st := FindName(here@p_rContents, p_oName, lockRaw);
  1553.     if st = fail then
  1554.     st := FindName(me@p_pCarrying, p_oName, lockRaw);
  1555.     fi;
  1556.     if st = fail then
  1557.     if here@p_rBuyList ~= nil and
  1558.         FindName(here@p_rBuyList, p_oName, lockRaw) ~= fail
  1559.     then
  1560.         Print("You should buy the " + lockName +
  1561.         " before you try to unlock it.\n");
  1562.     elif MatchName(here@p_rScenery, lockRaw) ~= -1 then
  1563.         Print("You can't unlock the " + lockName + ".\n");
  1564.     else
  1565.         Print("There is no " + lockName + " here.\n");
  1566.     fi;
  1567.     false
  1568.     elif st = continue then
  1569.     Print(Capitalize(lockName) + " is ambiguous.\n");
  1570.     false
  1571.     else
  1572.     lock := FindResult();
  1573.     lockName := FormatName(lock@p_oName);
  1574.     if lock@p_oNotLockable then
  1575.         Print("You can't unlock the " + lockName + ".\n");
  1576.         false
  1577.     else
  1578.         st := FindName(me@p_pCarrying, p_oName, keyRaw);
  1579.         if st = fail then
  1580.         Print(AAn("You aren't carrying", keyName) + ".\n");
  1581.         false
  1582.         elif st = continue then
  1583.         Print(Capitalize(keyName) + " is ambiguous.\n");
  1584.         false
  1585.         else
  1586.         key := FindResult();
  1587.         keyName := FormatName(key@p_oName);
  1588.         a := lock@p_oUnlockMeWithChecker;
  1589.         if a = nil then
  1590.             if lock@p_oNotUnlockString ~= "" then
  1591.             Print(lock@p_oNotUnlockString + "\n");
  1592.             else
  1593.             Print("You can't unlock the " + lockName + ".\n");
  1594.             fi;
  1595.             false
  1596.         elif key = lock then
  1597.             Print("You can't unlock the " + lockName +
  1598.             " with itself!\n");
  1599.             false
  1600.         else
  1601.             st := call(a, status)(lock, key);
  1602.             if st = continue then
  1603.             a := key@p_oUnlockWithMeChecker;
  1604.             if a ~= nil then
  1605.                 st := call(a, status)(lock, key);
  1606.             fi;
  1607.             fi;
  1608.             if st = continue then
  1609.             if lock@p_oLocked then
  1610.                 Print("You unlock the " + lockName + " with the " +
  1611.                 keyName + ".\n");
  1612.                 lock@p_oLocked := false;
  1613.                 true
  1614.             else
  1615.                 Print("The " + lockName+" is already unlocked.\n");
  1616.                 false
  1617.             fi
  1618.             elif st = fail then
  1619.             Print("You can't unlock the " + lockName +
  1620.                 " with the " + keyName + ".\n");
  1621.             false
  1622.             else
  1623.             true
  1624.             fi
  1625.         fi
  1626.         fi
  1627.     fi
  1628.     fi
  1629. corp;
  1630.  
  1631. Verb2(G, "unlock", FindAnyWord(G, "with"), v_unlock)$
  1632.  
  1633. define tp_verbs proc v_lock(string lockRaw, keyRaw)bool:
  1634.     string keyName, lockName, str;
  1635.     thing me, here, key, lock;
  1636.     status st;
  1637.     list thing lt;
  1638.     action a;
  1639.  
  1640.     lockName := FormatName(lockRaw);
  1641.     keyName := FormatName(keyRaw);
  1642.     me := Me();
  1643.     here := Here();
  1644.     st := FindName(here@p_rContents, p_oName, lockRaw);
  1645.     if st = fail then
  1646.     st := FindName(me@p_pCarrying, p_oName, lockRaw);
  1647.     fi;
  1648.     if st = fail then
  1649.     if here@p_rBuyList ~= nil and
  1650.         FindName(here@p_rBuyList, p_oName, lockRaw) ~= fail
  1651.     then
  1652.         Print("You should buy the " + lockName +
  1653.         " before you try to lock it.\n");
  1654.     elif MatchName(here@p_rScenery, lockRaw) ~= -1 then
  1655.         Print("You can't lock the " + lockName + ".\n");
  1656.     else
  1657.         Print("There is no " + lockName + " here.\n");
  1658.     fi;
  1659.     false
  1660.     elif st = continue then
  1661.     Print(Capitalize(lockName) + " is ambiguous.\n");
  1662.     false
  1663.     else
  1664.     lock := FindResult();
  1665.     lockName := FormatName(lock@p_oName);
  1666.     if lock@p_oNotLockable then
  1667.         Print("You can't lock the " + lockName + ".\n");
  1668.         false
  1669.     else
  1670.         st := FindName(me@p_pCarrying, p_oName, keyRaw);
  1671.         if st = fail then
  1672.         Print(AAn("You aren't carrying", keyName) + ".\n");
  1673.         false
  1674.         elif st = continue then
  1675.         Print(Capitalize(keyName) + " is ambiguous.\n");
  1676.         false
  1677.         else
  1678.         key := FindResult();
  1679.         keyName := FormatName(key@p_oName);
  1680.         a := lock@p_oLockMeWithChecker;
  1681.         if a = nil then
  1682.             if lock@p_oNotLockString ~= "" then
  1683.             Print(lock@p_oNotLockString + "\n");
  1684.             else
  1685.             Print("You can't lock the " + lockName + ".\n");
  1686.             fi;
  1687.             false
  1688.         elif key = lock then
  1689.             Print("You can't lock the " + lockName +
  1690.             " with itself!\n");
  1691.             false
  1692.         else
  1693.             st := call(a, status)(lock, key);
  1694.             if st = continue then
  1695.             a := key@p_oLockWithMeChecker;
  1696.             if a ~= nil then
  1697.                 st := call(a, status)(lock, key);
  1698.             fi;
  1699.             fi;
  1700.             if st = continue then
  1701.             if lock@p_oLocked then
  1702.                 Print("The " + lockName + " is already locked.\n");
  1703.                 false
  1704.             else
  1705.                 Print("You lock the " + lockName + " with the " +
  1706.                 keyName + ".\n");
  1707.                 lock@p_oLocked := true;
  1708.                 true
  1709.             fi
  1710.             elif st = fail then
  1711.             Print("You can't lock the " + lockName +
  1712.                 " with the " + keyName + ".\n");
  1713.             false
  1714.             else
  1715.             true
  1716.             fi
  1717.         fi
  1718.         fi
  1719.     fi
  1720.     fi
  1721. corp;
  1722.  
  1723. Verb2(G, "lock", FindAnyWord(G, "with"), v_lock)$
  1724.  
  1725. /* create some stuff to test the above */
  1726.  
  1727. /*
  1728. define tp_verbs o_testLock1 CreateThing(nil)$
  1729. SetupObject(o_testLock1, r_arrivals, "lock;red,test",
  1730.     "Use a test key to lock and unlock this lock.\n")$
  1731. o_testLock1@p_oNotGettable := true$
  1732. o_testLock1@p_oLocked := true$
  1733. define tp_verbs o_testLock2 CreateThing(nil)$
  1734. SetupObject(o_testLock2, r_arrivals, "lock;blue,test",
  1735.     "Use a test key to lock and unlock this lock.\n")$
  1736. o_testLock2@p_oNotGettable := true$
  1737. o_testLock2@p_oLocked := true$
  1738. define tp_verbs o_testKey1 CreateThing(nil)$
  1739. SetupObject(o_testKey1, r_arrivals, "key;yellow,test",
  1740.     "Use this key to lock and unlock a test lock.")$
  1741. define tp_verbs o_testKey2 CreateThing(nil)$
  1742. SetupObject(o_testKey2, r_arrivals, "key;green,test",
  1743.     "Use this key to lock and unlock a test lock.")$
  1744. define tp_verbs proc checkTestLock(thing theLock, theKey)status:
  1745.     if theLock = o_testLock1 and theKey = o_testKey1 then
  1746.     continue
  1747.     elif theLock = o_testLock2 and theKey = o_testKey2 then
  1748.     continue
  1749.     else
  1750.     fail
  1751.     fi
  1752. corp;
  1753. o_testLock1@p_oUnlockMeWithChecker := checkTestLock$
  1754. o_testLock1@p_oLockMeWithChecker := checkTestLock$
  1755. o_testLock2@p_oUnlockMeWithChecker := checkTestLock$
  1756. o_testLock2@p_oLockMeWithChecker := checkTestLock$
  1757. define tp_verbs o_otherKey CreateThing(nil)$
  1758. SetupObject(o_otherKey, r_arrivals, "key;other", "This key doesn't work.")$
  1759. define tp_verbs o_testGizmo CreateThing(nil)$
  1760. SetupObject(o_testGizmo, r_arrivals, "gizmo;test",
  1761.     "This gizmo cannot be locked or unlocked.")$
  1762. o_testGizmo@p_oNotGettable := true$
  1763. o_testGizmo@p_oNotLockable := true$
  1764. define tp_verbs o_testThingy CreateThing(nil)$
  1765. SetupObject(o_testThingy, r_arrivals, "thingy;test",
  1766.     "This thingy refuses to be unlocked or locked.")$
  1767. o_testThingy@p_oNotGettable := true$
  1768. o_testThingy@p_oNotUnlockString :=
  1769.     "No matter how hard you try, or what you try with, you cannot manage "
  1770.     "to unlock this thingy."$
  1771. o_testThingy@p_oNotLockString :=
  1772.     "There is nothing that looks even vaguely like a lock on the thingy, "
  1773.     "so there is no way you can lock it."$
  1774. */
  1775.  
  1776.  
  1777. define tp_verbs proc v_follow(string name)bool:
  1778.     thing me, who;
  1779.  
  1780.     me := Me();
  1781.     if name = "" then
  1782.     who := me@p_pFollowing;
  1783.     if who ~= nil then
  1784.         name := CharacterNameG(who);
  1785.         Print("You are currently following " + name + ".\n");
  1786.         true
  1787.     else
  1788.         Print("You must specify who you want to follow.\n");
  1789.         Print("Use 'unfollow', or just move, to stop following.\n");
  1790.         false
  1791.     fi
  1792.     else
  1793.     who := FindAgent(name);
  1794.     name := FormatName(name);
  1795.     if who = me then
  1796.         Print("You can't follow yourself.\n");
  1797.         false
  1798.     elif who = nil then
  1799.         if MatchName(Here()@p_rScenery, name) ~= -1 then
  1800.         Print("You can't follow the scenery!\n");
  1801.         else
  1802.         Print(name + " is not here!\n");
  1803.         fi;
  1804.         false
  1805.     else
  1806.         UnFollow();
  1807.         Follow(who);
  1808.         Print("You are now following " + name + ".\n");
  1809.         true
  1810.     fi
  1811.     fi
  1812. corp;
  1813.  
  1814. Verb1(G, "follow", 0, v_follow)$
  1815.  
  1816. define tp_verbs proc v_unfollow()bool:
  1817.  
  1818.     if Me()@p_pFollowing = nil then
  1819.     Print("You are not following anyone.\n");
  1820.     false
  1821.     else
  1822.     UnFollow();
  1823.     true
  1824.     fi
  1825. corp;
  1826.  
  1827. Verb0(G, "unfollow", 0, v_unfollow)$
  1828.  
  1829.  
  1830. /* a few utility-type commands */
  1831.  
  1832. define tp_verbs proc v_time()bool:
  1833.     Print("The time and date at the server is: " + Date() + ".\n");
  1834.     true
  1835. corp;
  1836.  
  1837. Verb0(G, "time", 0, v_time)$
  1838. Verb0(G, "date", 0, v_time)$
  1839.  
  1840. define tp_verbs proc v_verbose()bool:
  1841.     thing me;
  1842.  
  1843.     me := Me();
  1844.     if me@p_pVerbose then
  1845.     Print("You are already getting verbose descriptions!\n");
  1846.     false
  1847.     else
  1848.     me@p_pVerbose := true;
  1849.     me@p_pSuperBrief := false;
  1850.     Print("Verbose desciptions turned on.\n");
  1851.     true
  1852.     fi
  1853. corp;
  1854.  
  1855. Verb0(G, "verbose", 0, v_verbose)$
  1856.  
  1857. define tp_verbs proc v_terse()bool:
  1858.     thing me;
  1859.  
  1860.     me := Me();
  1861.     if me@p_pSuperBrief then
  1862.     me@p_pSuperBrief := false;
  1863.     Print("Superterse mode turned off.\n");
  1864.     true
  1865.     elif me@p_pVerbose then
  1866.     me@p_pVerbose := false;
  1867.     Print("Verbose descriptions turned off.\n");
  1868.     true
  1869.     else
  1870.     Print("You are already in terse mode!\n");
  1871.     false
  1872.     fi
  1873. corp;
  1874.  
  1875. Verb0(G, "terse", 0, v_terse)$
  1876. Synonym(G, "terse", "brief")$
  1877.  
  1878. define tp_verbs proc v_superterse()bool:
  1879.     thing me;
  1880.  
  1881.     me := Me();
  1882.     if me@p_pSuperBrief then
  1883.     Print("You are already in superterse mode!\n");
  1884.     false
  1885.     else
  1886.     me@p_pVerbose := false;
  1887.     me@p_pSuperBrief := true;
  1888.     Print("Superterse mode enabled.\n");
  1889.     true
  1890.     fi
  1891. corp;
  1892.  
  1893. Verb0(G, "superterse", 0, v_superterse)$
  1894. Synonym(G, "superterse", "superbrief")$
  1895.  
  1896. define tp_verbs proc v_echo()bool:
  1897.     thing me;
  1898.  
  1899.     me := Me();
  1900.     if me@p_pEchoPose then
  1901.     me@p_pEchoPose := false;
  1902.     Print("Say/whisper/pose/emits will no longer be echoed to you.\n");
  1903.     else
  1904.     me@p_pEchoPose := true;
  1905.     Print("Say/whisper/pose/emits will now be echoed to you.\n");
  1906.     fi;
  1907.     true
  1908. corp;
  1909.  
  1910. Verb0(G, "echo", 0, v_echo)$
  1911.  
  1912. define tp_verbs proc v_ats()bool:
  1913.     bool oldValue;
  1914.  
  1915.     oldValue := PrintNoAts(true);
  1916.     if oldValue then
  1917.     Print("Non-wizard output will now be identified by leading '@'s.\n");
  1918.     ignore PrintNoAts(false);
  1919.     else
  1920.     Print(
  1921. "Non-wizard output will no longer be identified by leading '@'s. You are "
  1922. "warned that unscrupulous apprentices may attempt to trick you by printing "
  1923. "false messages indistinguishable from normal messages. E.g.\n\n"
  1924. "SysAdmin gives you 10000 blutos.\n\n"
  1925. "Beware of this type of \"spoofing\".\n");
  1926.     ignore PrintNoAts(true);
  1927.     fi;
  1928.     true
  1929. corp;
  1930.  
  1931. Verb0(G, "ats", 0, v_ats)$
  1932.  
  1933. define tp_verbs proc v_wizard()bool:
  1934.     if not WizardMode() then
  1935.     Print("Sorry, you can't go into wizard mode.\n");
  1936.     false
  1937.     else
  1938.     true
  1939.     fi
  1940. corp;
  1941.  
  1942. Verb0(G, "wizard", 0, v_wizard)$
  1943.  
  1944. define tp_verbs proc v_hide()bool:
  1945.     thing me;
  1946.  
  1947.     me := Me();
  1948.     if IsWizard() then
  1949.     if me@p_pHidden then
  1950.         Print("You are now visible to others.\n");
  1951.         me@p_pHidden := false;
  1952.         OPrint(Capitalize(CharacterNameS(me)) + " fades into view.\n");
  1953.         ForEachAgent(Here(), ShowIconOnce);
  1954.     else
  1955.         Print("You are no longer visible to others.\n");
  1956.         me@p_pHidden := true;
  1957.         OPrint(Capitalize(CharacterNameS(me)) + " fades out of view.\n");
  1958.         ForEachAgent(Here(), UnShowIconOnce);
  1959.         ClearFollowers(me);
  1960.     fi;
  1961.     true
  1962.     else
  1963.     Print("Hide? This isn't a game of hide and seek!\n");
  1964.     false
  1965.     fi
  1966. corp;
  1967.  
  1968. Verb0(G, "hide", 0, v_hide)$
  1969.  
  1970. define tp_verbs proc v_password()bool:
  1971.     NewCharacterPassword();
  1972.     true
  1973. corp;
  1974.  
  1975. Verb0(G, "password", 0, v_password)$
  1976.  
  1977. define tp_verbs proc v_prompt()bool:
  1978.     string w;
  1979.  
  1980.     w := GetWord();
  1981.     Print("Setting prompt to " + w + ".\n");
  1982.     ignore SetPrompt(w);
  1983.     true
  1984. corp;
  1985.  
  1986. VerbTail(G, "prompt", v_prompt)$
  1987.  
  1988. define tp_verbs proc v_name(string newName)bool:
  1989.     thing me;
  1990.     string oldName, desc;
  1991.     int len;
  1992.  
  1993.     me := Me();
  1994.     if Character(me@p_pName) = nil then
  1995.     OPrint(Capitalize(CharacterNameS(me)) + " is confused.\n");
  1996.     false
  1997.     elif newName = "" then
  1998.     Print("You must give the new name you want to use.\n");
  1999.     false
  2000.     else
  2001.     SetTail(newName);
  2002.     ignore GetWord();
  2003.     if GetWord() ~= "" then
  2004.         Print("Sorry, no spaces in character names.\n");
  2005.         false
  2006.     elif Character(newName) ~= nil then
  2007.         Print("Sorry, character name '" + newName +
  2008.         "' is already in use.\n");
  2009.         false
  2010.     else
  2011.         oldName := Capitalize(me@p_pName);
  2012.         ChangeName(newName);
  2013.         Print("Your name is now " + newName + ".\n");
  2014.         APrint(oldName + " is now called " + newName + ".\n");
  2015.         desc := me@p_pDesc;
  2016.         len := Length(oldName);
  2017.         if SubString(desc, 0, len) == oldName then
  2018.         me@p_pDesc := Capitalize(newName) +
  2019.             SubString(desc, len, Length(desc) - len);
  2020.         fi;
  2021.         true
  2022.     fi
  2023.     fi
  2024. corp;
  2025.  
  2026. Verb1(G, "name", 0, v_name)$
  2027.  
  2028. /*
  2029.  * v_say - handler for speaking. Attempt to catch the likely forms.
  2030.  *    say hello => hello
  2031.  *    say to fred hello => fred hello
  2032.  *    tell joe to blah blah => joe blah blah
  2033.  */
  2034.  
  2035. define tp_verbs proc v_say()bool:
  2036.     string word1, word2, tail;
  2037.  
  2038.     word1 := GetWord();
  2039.     if word1 = "" then
  2040.     Print("Put what you want to say after the 'say'.\n");
  2041.     else
  2042.     word2 := GetWord();
  2043.     tail := GetTail();
  2044.     if word2 == "to" then
  2045.         if tail = "" then
  2046.         DoSay(word1);
  2047.         else
  2048.         DoSay(word1 + " " + tail);
  2049.         fi;
  2050.     else
  2051.         if tail = "" then
  2052.         if word2 = "" then
  2053.             DoSay(word1);
  2054.         else
  2055.             DoSay(word1 + " " + word2);
  2056.         fi;
  2057.         else
  2058.         DoSay(word1 + " " + word2 + " " + tail);
  2059.         fi;
  2060.     fi;
  2061.     fi;
  2062.     true
  2063. corp;
  2064.  
  2065. VerbTail(G, "say", v_say)$
  2066. Synonym(G, "say", "\"")$
  2067. Synonym(G, "say", "tell")$
  2068.  
  2069. /*
  2070.  * showAliases - used in 'v_alias' and in v_aliases.
  2071.  */
  2072.  
  2073. define tp_verbs proc showAliases(list thing aliases)void:
  2074.     thing alias;
  2075.     int count;
  2076.  
  2077.     if aliases = nil then
  2078.     Print("You have no command aliases.\n");
  2079.     else
  2080.     count := Count(aliases);
  2081.     Print("Command aliases:\n");
  2082.     while count ~= 0 do
  2083.         count := count - 1;
  2084.         alias := aliases[count];
  2085.         Print("  ");
  2086.         Print(alias@p_sAliasKey);
  2087.         Print(" => ");
  2088.         Print(alias@p_sAliasValue);
  2089.         Print("\n");
  2090.     od;
  2091.     fi;
  2092. corp;
  2093.  
  2094. define tp_verbs proc v_aliases()bool:
  2095.  
  2096.     showAliases(Me()@p_pAliases);
  2097.     true
  2098. corp;
  2099.  
  2100. define tp_verbs proc v_alias()bool:
  2101.     list thing aliases;
  2102.     thing alias;
  2103.     string word, contents;
  2104.     int count;
  2105.     bool found;
  2106.  
  2107.     word := GetWord();
  2108.     aliases := Me()@p_pAliases;
  2109.     if word = "" then
  2110.     showAliases(aliases);
  2111.     else
  2112.     Print("Command alias '");
  2113.     Print(word);
  2114.     Print("' ");
  2115.     found := false;
  2116.     if aliases ~= nil then
  2117.         count := Count(aliases);
  2118.         while count ~= 0 and not found do
  2119.         count := count - 1;
  2120.         alias := aliases[count];
  2121.         if alias@p_sAliasKey == word then
  2122.             found := true;
  2123.         fi;
  2124.         od;
  2125.     fi;
  2126.     contents := GetTail();
  2127.     if contents = "" then
  2128.         if found then
  2129.         DelElement(aliases, alias);
  2130.         Print("removed.\n");
  2131.         else
  2132.         Print("does not exist.\n");
  2133.         fi;
  2134.     else
  2135.         if SubString(contents, 0, 1) = "\"" then
  2136.         contents := SubString(contents, 1, Length(contents) - 2);
  2137.         fi;
  2138.         if found then
  2139.         alias@p_sAliasValue := contents;
  2140.         Print("updated.\n");
  2141.         else
  2142.         if aliases = nil then
  2143.             aliases := CreateThingList();
  2144.             Me()@p_pAliases := aliases;
  2145.         fi;
  2146.         alias := CreateThing(nil);
  2147.         alias@p_sAliasKey := word;
  2148.         alias@p_sAliasValue := contents;
  2149.         AddTail(aliases, alias);
  2150.         Print("added.\n");
  2151.         fi;
  2152.     fi;
  2153.     fi;
  2154.     true
  2155. corp;
  2156.  
  2157. Verb0(G, "aliases", 0, v_aliases)$
  2158. VerbTail(G, "alias", v_alias)$
  2159. Synonym(G, "alias", "a")$
  2160.  
  2161.  
  2162. define tp_verbs proc DoBackup(thing obj)void:
  2163.  
  2164.     /* We want to schedule the next backup before we actually do this one,
  2165.        so that the timekeeper will have us on its list in the backup! */
  2166.     if GlobalThing@p_BackupInterval ~= 0 then
  2167.     DoAfter(GlobalThing@p_BackupInterval * 60, GlobalThing, DoBackup);
  2168.     fi;
  2169.     if GlobalThing@p_FlushNeeded then
  2170.     /* clear flag *before* doing backup, so are clean after restore */
  2171.     GlobalThing@p_FlushNeeded := false;
  2172.     Log("Starting automatic backup, interval = " +
  2173.         IntToString(GlobalThing@p_BackupInterval) + " minutes\n");
  2174.     APrint("\n * Timed database backup starting - please wait. *\n");
  2175.     Flush();
  2176.     Execute("copy MUD.#? backup");
  2177.     APrint(" * Backup complete. *\n\n");
  2178.     fi;
  2179. corp;
  2180.  
  2181. define tp_verbs proc v_backup(string arg)bool:
  2182.     int n;
  2183.  
  2184.     if Me() ~= CharacterThing(SysAdmin) then
  2185.     Print("Only SysAdmin can use the 'backup' command.\n");
  2186.     false
  2187.     else
  2188.     if arg = "" then
  2189.         /* do it unconditionally */
  2190.         Print("Doing one-shot backup.\n");
  2191.         APrint("\n * Database being backed up - please wait. *\n");
  2192.         Flush();
  2193.         Execute("copy MUD.#? backup");
  2194.         APrint(" * Backup complete. *\n\n");
  2195.         true
  2196.     else
  2197.         n := StringToInt(arg);
  2198.         if n = 0 then
  2199.         GlobalThing@p_BackupInterval := 0;
  2200.         ignore CancelDoAfter(GlobalThing, DoBackup);
  2201.         Print("Automated backups cancelled.\n");
  2202.         true
  2203.         elif n > 0 then
  2204.         if n > 0x7fffffff / 60 then
  2205.             n := 0x7fffffff / 60;
  2206.         fi;
  2207.         GlobalThing@p_BackupInterval := n;
  2208.         Print("Backup interval set to " + IntToString(n) +
  2209.             " minutes.\n");
  2210.         ignore CancelDoAfter(GlobalThing, DoBackup);
  2211.         DoAfter(n * 60, GlobalThing, DoBackup);
  2212.         Print("Next backup will occur that interval from now.\n");
  2213.         true
  2214.         else
  2215.         Print("Expecting minute count with 'backup'.\n");
  2216.         false
  2217.         fi
  2218.     fi
  2219.     fi
  2220. corp;
  2221.  
  2222. Verb1(G, "backup", 0, v_backup)$
  2223.  
  2224.  
  2225. define tp_verbs proc v_shutdown()bool:
  2226.     string message, m;
  2227.  
  2228.     if Me() ~= CharacterThing(SysAdmin) then
  2229.     Print("Only SysAdmin can use the 'shutdown' command.\n");
  2230.     false
  2231.     else
  2232.     message := "\n\n**** ";
  2233.     m := GetTail();
  2234.     if m ~= "" then
  2235.         message := message + m + "\n";
  2236.     fi;
  2237.     message := message +
  2238.         "SysAdmin has started shutdown of the MUD. ****\n\n\n";
  2239.     APrint(message);
  2240.     ignore ShutDown(true);
  2241.     true
  2242.     fi
  2243. corp;
  2244.  
  2245. VerbTail(G, "shutdown", v_shutdown)$
  2246.  
  2247.  
  2248. define tp_verbs proc v_freeposes()bool:
  2249.     string errorMessage, yesNo;
  2250.  
  2251.     if Me() ~= CharacterThing(SysAdmin) then
  2252.     Print("Only SysAdmin can use the 'freeposes' command.\n");
  2253.     false
  2254.     else
  2255.     yesNo := GetWord();
  2256.     if yesNo = "" then
  2257.         yesNo := "y";
  2258.     fi;
  2259.     errorMessage := "Use is: freeposes [y|n]\n";
  2260.     if GetWord() ~= "" then
  2261.         Print(errorMessage);
  2262.         false
  2263.     elif isYes(yesNo) then
  2264.         GlobalThing@p_FreePoses := true;
  2265.         Print("Free user poses enabled.\n");
  2266.         true
  2267.     elif isNo(yesNo) then
  2268.         GlobalThing@p_FreePoses := false;
  2269.         Print("Free user poses disabled.\n");
  2270.         true
  2271.     else
  2272.         Print(errorMessage);
  2273.         false
  2274.     fi
  2275.     fi
  2276. corp;
  2277.  
  2278. define tp_verbs proc v_freebuilding()bool:
  2279.     string errorMessage, yesNo;
  2280.  
  2281.     if Me() ~= CharacterThing(SysAdmin) then
  2282.     Print("Only SysAdmin can use the 'freebuilding' command.\n");
  2283.     false
  2284.     else
  2285.     yesNo := GetWord();
  2286.     if yesNo = "" then
  2287.         yesNo := "y";
  2288.     fi;
  2289.     errorMessage := "Use is: freebuilding [y|n]\n";
  2290.     if GetWord() ~= "" then
  2291.         Print(errorMessage);
  2292.         false
  2293.     elif isYes(yesNo) then
  2294.         GlobalThing@p_FreeBuilding := true;
  2295.         Print("All new characters will now be builders.\n");
  2296.         true
  2297.     elif isNo(yesNo) then
  2298.         GlobalThing@p_FreeBuilding := false;
  2299.         Print("New characters will no longer be builders.\n");
  2300.         true
  2301.     else
  2302.         Print(errorMessage);
  2303.         false
  2304.     fi
  2305.     fi
  2306. corp;
  2307.  
  2308. define tp_verbs proc v_makeapprentice()bool:
  2309.     string name;
  2310.     character who;
  2311.  
  2312.     if Me() ~= CharacterThing(SysAdmin) then
  2313.     Print("Only SysAdmin can use the 'makeapprentice' command.\n");
  2314.     false
  2315.     else
  2316.     name := GetWord();
  2317.     if name = "" or GetWord() ~= "" then
  2318.         Print("Use is: makeapprentice <player-name>\n");
  2319.         false
  2320.     else
  2321.         who := Character(name);
  2322.         if who = nil then
  2323.         Print("'" + name + "' is not a character.\n");
  2324.         false
  2325.         else
  2326.         MakeApprentice(who, false);
  2327.         Print("'" + name + "' is now an apprentice.\n");
  2328.         true
  2329.         fi
  2330.     fi
  2331.     fi
  2332. corp;
  2333.  
  2334. VerbTail(G, "freeposes", v_freeposes)$
  2335. VerbTail(G, "freebuilding", v_freebuilding)$
  2336. VerbTail(G, "makeapprentice", v_makeapprentice)$
  2337.  
  2338.  
  2339. define tp_verbs proc v_characters(string form)bool:
  2340.  
  2341.     if form == "long" or form == "l" then
  2342.     ignore ShowCharacters(true);
  2343.     true
  2344.     elif form = "" or form == "short" or form == "s" then
  2345.     ignore ShowCharacters(false);
  2346.     true
  2347.     else
  2348.     Print("You must use either \"short\" or \"long\".\n");
  2349.     false
  2350.     fi
  2351. corp;
  2352.  
  2353. Verb1(G, "characters", 0, v_characters)$
  2354. Synonym(G, "characters", "chars")$
  2355. Synonym(G, "characters", "ch")$
  2356. Synonym(G, "characters", "players")$
  2357. Synonym(G, "characters", "pl")$
  2358.  
  2359. define tp_verbs proc v_clients(string form)bool:
  2360.  
  2361.     if form == "long" or form == "l" then
  2362.     ignore ShowClients(true);
  2363.     true
  2364.     elif form = "" or form == "short" or form == "s" then
  2365.     ignore ShowClients(false);
  2366.     true
  2367.     else
  2368.     Print("You must use either \"short\" or \"long\".\n");
  2369.     false
  2370.     fi
  2371. corp;
  2372.  
  2373. Verb1(G, "clients", 0, v_clients)$
  2374. Synonym(G, "clients", "cl")$
  2375.  
  2376. define tp_verbs proc v_character(string who)bool:
  2377.     character ch;
  2378.  
  2379.     if who = "" then
  2380.     Print("You must specify a character to check on.\n");
  2381.     false
  2382.     else
  2383.     ch := Character(who);
  2384.     if ch = nil then
  2385.         ch := Character(Capitalize(who));
  2386.     fi;
  2387.     if ch = nil then
  2388.         Print(who + " is not a character. Make sure you have the spelling "
  2389.         "and capitalization correct.\n");
  2390.     else
  2391.         ShowCharacter(ch);
  2392.     fi;
  2393.     true
  2394.     fi
  2395. corp;
  2396.  
  2397. Verb1(G, "character", 0, v_character)$
  2398. Synonym(G, "character", "player")$
  2399. Synonym(G, "character", "char")$
  2400.  
  2401. define tp_verbs proc v_who()bool:
  2402.     Print("Use 'characters [long|short]' to see existing characters.\n"
  2403.     "Use 'clients [long|short]' to see current clients.\n"
  2404.     "Use 'character <name>, ...' to see given characters.\n");
  2405.     true
  2406. corp;
  2407.  
  2408. Verb0(G, "who", 0, v_who)$
  2409.  
  2410. define tp_verbs proc v_width(string newWidth)bool:
  2411.     int width;
  2412.  
  2413.     if newWidth = "" then
  2414.     width := TextWidth(0);
  2415.     Print("Current display width is " + IntToString(width) + ".\n");
  2416.     else
  2417.     Print("Old width was " +
  2418.         IntToString(TextWidth(StringToInt(newWidth))) + ".\n");
  2419.     fi;
  2420.     true
  2421. corp;
  2422.  
  2423. Verb1(G, "width", 0, v_width)$
  2424.  
  2425. define tp_verbs proc v_height(string newHeight)bool:
  2426.     int height;
  2427.  
  2428.     if newHeight = "" then
  2429.     height := TextHeight(0);
  2430.     Print("Current display height is " + IntToString(height) + ".\n");
  2431.     else
  2432.     Print("Old height was " +
  2433.         IntToString(TextHeight(StringToInt(newHeight))) + ".\n");
  2434.     fi;
  2435.     true
  2436. corp;
  2437.  
  2438. Verb1(G, "height", 0, v_height)$
  2439.  
  2440. define tp_verbs proc v_volume()bool:
  2441.     string error, which, volString;
  2442.     int newVolume;
  2443.  
  2444.     error := "Use is: volume {sound | voice | music} <value:0-100>\n";
  2445.     which := GetWord();
  2446.     volString := GetWord();
  2447.     newVolume := StringToInt(volString);
  2448.     if newVolume >= 0 and newVolume <= 100 then
  2449.     newVolume := newVolume * 100;
  2450.     if which == "sound" then
  2451.         SVolume(nil, newVolume);
  2452.         true
  2453.     elif which == "voice" then
  2454.         VVolume(nil, newVolume);
  2455.         true
  2456.     elif which == "music" then
  2457.         MVolume(nil, newVolume);
  2458.         true
  2459.     else
  2460.         Print(error);
  2461.         false
  2462.     fi
  2463.     else
  2464.     Print(error);
  2465.     false
  2466.     fi
  2467. corp;
  2468.  
  2469. VerbTail(G, "volume", v_volume)$
  2470.  
  2471. define tp_verbs proc showHelpHelp()void:
  2472.     Print(
  2473. "Use 'help <topic>' or '? <topic>' for specific help.\n"
  2474. "(Do not type the apostrophes (') or the < and >.)\n\n"
  2475. "Help topics: mouse, move, graphics, objects\n"
  2476.     );
  2477. corp;
  2478.  
  2479. define tp_verbs proc v_helphelp()bool:
  2480.  
  2481.     showHelpHelp();
  2482.     true
  2483. corp;
  2484.  
  2485. Verb0(G, "helphelp", 0, v_helphelp)$
  2486. Synonym(G, "helphelp", "??")$
  2487.  
  2488. define tp_verbs proc v_help(string what)bool:
  2489.  
  2490.     if what = "" then
  2491.     Print(
  2492. "Use 'help help' or '??' to see more help topics.\n\n"
  2493. "Standard commands available in this starter game:\n"
  2494. "    [go] north/south.../n/s/...enter/exit/up/down...\n"
  2495. "    look [around]; look at XXX, YYY, ...; examine XXX; look <direction>\n"
  2496. "    inventory/inv/i\n"
  2497. "    pick up XXX, YYY, ...; get/g XXX, YYY, ...\n"
  2498. "    put/p [down] XXX, YYY, ...; drop XXX, YYY, ...\n"
  2499. "    say XXX; \"xxx; smile, wave, ...; quests [who]\n"
  2500. "    quit; verbose; terse; password; prompt; name; who; height; width;\n"
  2501. "    play; erase; eat; use; wear; read; touch; smell; open; close;\n"
  2502. "    push; pull; turn; chat; pose; echo; follow; etc.\n"
  2503. "plus others as the game features require.\n"
  2504.     );
  2505.     elif what == "help" or what = "?" or what == "topics" or what == "topic"
  2506.     then
  2507.     showHelpHelp();
  2508.     elif what == "mouse" then
  2509.     if GOn(nil) then
  2510.         Print(
  2511. "The mouse can be used instead of typing to enter some commands. The right "
  2512. "half of the graphics area usually contains a number of \"buttons\" that you "
  2513. "can click on. For example, clicking on the 'L' button is equivalent to "
  2514. "typing \"look around\" or just \"l\". You can also click in the left hand "
  2515. "half of the graphics area. Doing so will attempt to generate a command to "
  2516. "move your character one room towards where you click. Note that you can only "
  2517. "move in the 8 compass directions doing this. You cannot drag your character "
  2518. "around - you must move in single-room steps, in order to properly allow "
  2519. "interaction with other characters in the game. You also cannot just point to "
  2520. "something on the display and try to move to it - the movement is only in "
  2521. "single-room steps in the compass direction closest to what you select.\n"
  2522.         );
  2523.     else
  2524.         Print(
  2525. "Since you do not currently have graphics enabled, it is likely that you are "
  2526. "not using the custom AmigaMUD client program. In that case, you cannot use "
  2527. "your mouse for anything specific to playing in AmigaMUD, other than normal "
  2528. "use within your normal user interface.\n"
  2529.         );
  2530.     fi;
  2531.     elif what == "move" then
  2532.     if GOn(nil) then
  2533.         Print(
  2534. "There are several ways to move around. The quickest, once you get used to "
  2535. "it, is to use the numeric keypad. If you imagine your character cursor on "
  2536. "top of the '5' key, then the 1, 2, 3, 4, 6, 7, 8, and 9 keys will try to "
  2537. "move your character one room in the corresponding compass direction. For "
  2538. "example, typing the '7' key on the numeric keypad will attempt to move your "
  2539. "character one room to the north-west. This is equivalent to typing the "
  2540. "command   northwest   or just   nw. Typing the '5' key itself is the same as "
  2541. "using the   look around   command. You can also use '+' and '-' keys if you "
  2542. "have them, to move up and down.\n\n"
  2543. "Movement in this game is through a set of distinct \"rooms\". You cannot "
  2544. "move to arbitrary positions, only to the few positions that the game has "
  2545. "predefined. The graphics you see on your screen are only pictures - they do "
  2546. "not define what you can do. To see how the simpler graphics work, try going "
  2547. "into the playpen in the Builder's Guild, and building your own rooms. You "
  2548. "can do this by clicking on the '@' button that will appear, and then on the "
  2549. "'Rooms' button that will appear.\n"
  2550.         );
  2551.     else
  2552.         Print(
  2553. "Since you do not currently have graphics enabled, it is likely that you are "
  2554. "not using the custom AmigaMUD client program. In that case, you must move "
  2555. "around by typing individual movement commands. These commands are the eight "
  2556. "compass directions: north, northeast, east, southeast, south, southwest, "
  2557. "west and northwest, or their abbreviations: n, ne, e, se, s, sw, w, nw. You "
  2558. "can also move up (u) or down (d) and in or out.\n"
  2559.         );
  2560.     fi;
  2561.     elif what == "graphics" or what == "graphic" then
  2562.     if GOn(nil) then
  2563.         Print(
  2564. "The graphics displayed by AmigaMUD should not be interpreted literally. They "
  2565. "are sketches only. Even when you see a bitmap image, it is only meant to "
  2566. "guide your imagination as to what your character can currently see. The fact "
  2567. "that the picture shows a tree or fountain or road, does not mean that the "
  2568. "game has such a thing that you can do things to. In a game of this type, you "
  2569. "can only move among a fixed set of \"rooms\" - you cannot walk up to "
  2570. "everything you see in pictures, since some of them are scenery only. Pay "
  2571. "close attention to the textual description of things - it will more "
  2572. "accurately show what things have actually been built in the world, and will "
  2573. "also contains hints about things you can do. The words are the key to the "
  2574. "game - the pictures and sounds are usually only decorations.\n"
  2575.         );
  2576.     else
  2577.         Print(
  2578. "Since you do not currently have graphics enabled, graphics is not relevant "
  2579. "to you. Graphics are only available when you are using the custom AmigaMUD "
  2580. "client program.\n"
  2581.         );
  2582.     fi;
  2583.     elif what == "objects" or what == "object" then
  2584.     Print(
  2585. "Objects are very important in games of this type. When the text you see when "
  2586. "you enter a room shows something being there, it is a good idea to look at "
  2587. "that object and remember where you saw it - it may be important to you. You "
  2588. "can carry objects around with you, but only so many of them. Also, some "
  2589. "objects cannot be picked up. When you see an object named, you can refer to "
  2590. "it in commands by that name, but you can also usually leave off the "
  2591. "adjectives - they are only needed if you have to choose from more than one "
  2592. "object of the same kind. Some commands useful with objects include get, "
  2593. "drop, look at, look in, fill, empty, read, etc. For example, if the room "
  2594. "you have just walked into contains a universal carryall and a delicious red "
  2595. "apple, you can probably do:\n\n"
  2596. "    get carryall\n"
  2597. "    g apple\n"
  2598. "    l in carryall\n"
  2599. "    put apple in carryall\n\n"
  2600. "etc. The game accepts simple abbreviations for most command words, and can "
  2601. "also handle longer, more grammatically correct forms of commands. It can "
  2602. "also work with multiple objects at once. For example:\n\n"
  2603. "    Pick up the universal carryall and the delicious red apple.\n"
  2604. "    Look inside the univeral carryall.\n"
  2605. "    Put the delicious red apple into the universal carryall.\n\n"
  2606. "Most people don't have the patience for such long forms, however!\n\n"
  2607. "Sometimes, the objects in a room will be \"hidden\" from you, in that they "
  2608. "will not explicitly show up. You have to read the room description, and find "
  2609. "out what is real, and what is just scenery.\n"
  2610.     );
  2611.     else
  2612.     Print("Unknown help topic. Type 'help help' or '??' for topics.\n");
  2613.     fi;
  2614.     true
  2615. corp;
  2616.  
  2617. Verb1(G, "help", 0, v_help)$
  2618. Synonym(G, "help", "?")$
  2619.  
  2620. define tp_verbs proc v_words()bool:
  2621.     ShowWords(G);
  2622.     true
  2623. corp;
  2624.  
  2625. Verb0(G, "words", 0, v_words)$
  2626.  
  2627.  
  2628. /* use the generic verb stuff for some typical verbs */
  2629.  
  2630. define t_base p_oPlayString CreateStringProp()$
  2631. define t_base p_oPlayChecker CreateActionProp()$
  2632. define t_base p_pPlayChecker CreateActionProp()$
  2633. define t_base p_oEraseString CreateStringProp()$
  2634. define t_base p_oEraseChecker CreateActionProp()$
  2635. define t_base p_pEraseChecker CreateActionProp()$
  2636. define t_base p_oEatString CreateStringProp()$
  2637. define t_base p_oEatChecker CreateActionProp()$
  2638. define t_base p_pEatChecker CreateActionProp()$
  2639. define t_base p_oUseString CreateStringProp()$
  2640. define t_base p_oUseChecker CreateActionProp()$
  2641. define t_base p_pUseChecker CreateActionProp()$
  2642. define t_base p_oActivateString CreateStringProp()$
  2643. define t_base p_oActivateChecker CreateActionProp()$
  2644. define t_base p_pActivateChecker CreateActionProp()$
  2645. define t_base p_oDeActivateString CreateStringProp()$
  2646. define t_base p_oDeActivateChecker CreateActionProp()$
  2647. define t_base p_pDeActivateChecker CreateActionProp()$
  2648. define t_base p_oLightString CreateStringProp()$
  2649. define t_base p_oLightChecker CreateActionProp()$
  2650. define t_base p_pLightChecker CreateActionProp()$
  2651. define t_base p_oExtinguishString CreateStringProp()$
  2652. define t_base p_oExtinguishChecker CreateActionProp()$
  2653. define t_base p_pExtinguishChecker CreateActionProp()$
  2654. define t_base p_oWearString CreateStringProp()$
  2655. define t_base p_oWearChecker CreateActionProp()$
  2656. define t_base p_pWearChecker CreateActionProp()$
  2657. define t_base p_oTouchString CreateStringProp()$
  2658. define t_base p_oTouchChecker CreateActionProp()$
  2659. define t_base p_pTouchChecker CreateActionProp()$
  2660. define t_base p_oSmellString CreateStringProp()$
  2661. define t_base p_oSmellChecker CreateActionProp()$
  2662. define t_base p_pSmellChecker CreateActionProp()$
  2663. define t_base p_oListenString CreateStringProp()$
  2664. define t_base p_oListenChecker CreateActionProp()$
  2665. define t_base p_pListenChecker CreateActionProp()$
  2666. define t_base p_oOpenString CreateStringProp()$
  2667. define t_base p_oOpenChecker CreateActionProp()$
  2668. define t_base p_pOpenChecker CreateActionProp()$
  2669. define t_base p_oCloseString CreateStringProp()$
  2670. define t_base p_oCloseChecker CreateActionProp()$
  2671. define t_base p_pCloseChecker CreateActionProp()$
  2672. define t_base p_oPushString CreateStringProp()$
  2673. define t_base p_oPushChecker CreateActionProp()$
  2674. define t_base p_pPushChecker CreateActionProp()$
  2675. define t_base p_oPullString CreateStringProp()$
  2676. define t_base p_oPullChecker CreateActionProp()$
  2677. define t_base p_pPullChecker CreateActionProp()$
  2678. define t_base p_oTurnString CreateStringProp()$
  2679. define t_base p_oTurnChecker CreateActionProp()$
  2680. define t_base p_pTurnChecker CreateActionProp()$
  2681. define t_base p_oLiftString CreateStringProp()$
  2682. define t_base p_oLiftChecker CreateActionProp()$
  2683. define t_base p_pLiftChecker CreateActionProp()$
  2684. define t_base p_oLowerString CreateStringProp()$
  2685. define t_base p_oLowerChecker CreateActionProp()$
  2686. define t_base p_pLowerChecker CreateActionProp()$
  2687.  
  2688. define t_base proc utility public GetVerbStringProp(string verb)
  2689.     property string:
  2690.     case MatchName(
  2691.     "play."
  2692.     "erase."
  2693.     "eat,lick,taste,drink,quaff,imbibe."
  2694.     "use,apply."
  2695.     "activate."
  2696.     "deactivate."
  2697.     "light."
  2698.     "extinguish."
  2699.     "wear."
  2700.     "touch,feel,pet."
  2701.     "smell,sniff."
  2702.     "listen."
  2703.     "open."
  2704.     "close,shut."
  2705.     "push,shove."
  2706.     "pull,yank,jerk,tug."
  2707.     "turn,twist,rotate,spin."
  2708.     "lift,raise."
  2709.     "lower."
  2710.     "get,take."
  2711.     "unlock"
  2712.     , verb)
  2713.     incase 0:
  2714.     p_oPlayString
  2715.     incase 1:
  2716.     p_oEraseString
  2717.     incase 2:
  2718.     p_oEatString
  2719.     incase 3:
  2720.     p_oUseString
  2721.     incase 4:
  2722.     p_oActivateString
  2723.     incase 5:
  2724.     p_oDeActivateString
  2725.     incase 6:
  2726.     p_oLightString
  2727.     incase 7:
  2728.     p_oExtinguishString
  2729.     incase 8:
  2730.     p_oWearString
  2731.     incase 9:
  2732.     p_oTouchString
  2733.     incase 10:
  2734.     p_oSmellString
  2735.     incase 11:
  2736.     p_oListenString
  2737.     incase 12:
  2738.     p_oOpenString
  2739.     incase 13:
  2740.     p_oCloseString
  2741.     incase 14:
  2742.     p_oPushString
  2743.     incase 15:
  2744.     p_oPullString
  2745.     incase 16:
  2746.     p_oTurnString
  2747.     incase 17:
  2748.     p_oLiftString
  2749.     incase 18:
  2750.     p_oLowerString
  2751.     incase 19:
  2752.     p_oNotGetString
  2753.     incase 20:
  2754.     p_oNotUnlockString
  2755.     default:
  2756.     nil
  2757.     esac
  2758. corp;
  2759.  
  2760. define t_base proc utility public GetVerbCheckerProp(string verb)
  2761.     property action:
  2762.     case MatchName(
  2763.     "play."
  2764.     "erase."
  2765.     "eat,lick,taste,drink,quaff,imbibe."
  2766.     "use,apply."
  2767.     "activate."
  2768.     "deactivate."
  2769.     "light."
  2770.     "extinguish."
  2771.     "wear."
  2772.     "touch,feel,pet."
  2773.     "smell,sniff."
  2774.     "listen."
  2775.     "open."
  2776.     "close,shut."
  2777.     "push,shove."
  2778.     "pull,yank,jerk,tug."
  2779.     "turn,twist,rotate,spin."
  2780.     "lift,raise."
  2781.     "lower"
  2782.     , verb)
  2783.     incase 0:
  2784.     p_oPlayChecker
  2785.     incase 1:
  2786.     p_oEraseChecker
  2787.     incase 2:
  2788.     p_oEatChecker
  2789.     incase 3:
  2790.     p_oUseChecker
  2791.     incase 4:
  2792.     p_oActivateChecker
  2793.     incase 5:
  2794.     p_oDeActivateChecker
  2795.     incase 6:
  2796.     p_oLightChecker
  2797.     incase 7:
  2798.     p_oExtinguishChecker
  2799.     incase 8:
  2800.     p_oWearChecker
  2801.     incase 9:
  2802.     p_oTouchChecker
  2803.     incase 10:
  2804.     p_oSmellChecker
  2805.     incase 11:
  2806.     p_oListenChecker
  2807.     incase 12:
  2808.     p_oOpenChecker
  2809.     incase 13:
  2810.     p_oCloseChecker
  2811.     incase 14:
  2812.     p_oPushChecker
  2813.     incase 15:
  2814.     p_oPullChecker
  2815.     incase 16:
  2816.     p_oTurnChecker
  2817.     incase 17:
  2818.     p_oLiftChecker
  2819.     incase 18:
  2820.     p_oLowerChecker
  2821.     default:
  2822.     nil
  2823.     esac
  2824. corp;
  2825.  
  2826. define tp_verbs proc v_play(string what)bool:
  2827.     VerbHere("play", p_oPlayString, p_oPlayChecker, p_pPlayChecker,
  2828.          "You cannot play", what)
  2829. corp;
  2830. define tp_verbs proc v_erase(string what)bool:
  2831.     VerbHere("erase", p_oEraseString, p_oEraseChecker, p_pEraseChecker,
  2832.          "You cannot erase", what)
  2833. corp;
  2834. /* want eat/drink to be VerbHere so can drink from streams, etc. */
  2835. define tp_verbs proc v_eat(string what)bool:
  2836.     VerbHere("eat", p_oEatString, p_oEatChecker, p_pEatChecker,
  2837.          "YECH! You cannot eat", what)
  2838. corp;
  2839. define tp_verbs proc v_drink(string what)bool:
  2840.     VerbHere("drink", p_oEatString, p_oEatChecker, p_pEatChecker,
  2841.          "YUCK! You cannot drink", what)
  2842. corp;
  2843. define tp_verbs proc v_use(string what)bool:
  2844.     VerbCarry("use", p_oUseString, p_oUseChecker, p_pUseChecker,
  2845.           "You cannot use", what)
  2846. corp;
  2847. define tp_verbs proc v_activate(string what)bool:
  2848.     VerbHere("activate", p_oActivateString, p_oActivateChecker,
  2849.          p_pActivateChecker, "You cannot activate", what)
  2850. corp;
  2851. define tp_verbs proc v_deactivate(string what)bool:
  2852.     VerbHere("deactivate", p_oDeActivateString, p_oDeActivateChecker,
  2853.          p_pDeActivateChecker, "You cannot deactivate", what)
  2854. corp;
  2855. define tp_verbs proc v_light(string what)bool:
  2856.     VerbHere("light", p_oLightString, p_oLightChecker, p_pLightChecker,
  2857.          "You cannot light", what)
  2858. corp;
  2859. define tp_verbs proc v_extinguish(string what)bool:
  2860.     VerbHere("extinguish", p_oExtinguishString, p_oExtinguishChecker,
  2861.          p_pExtinguishChecker, "You cannot extinguish", what)
  2862. corp;
  2863. define tp_verbs proc v_wear(string what)bool:
  2864.     VerbCarry("wear", p_oWearString, p_oWearChecker, p_pWearChecker,
  2865.           "You cannot wear", what)
  2866. corp;
  2867. define tp_verbs proc v_touch(string what)bool:
  2868.     VerbHere("touch", p_oTouchString, p_oTouchChecker, p_pTouchChecker,
  2869.          "You feel nothing special about", what)
  2870. corp;
  2871. define tp_verbs proc v_smell(string what)bool:
  2872.     VerbHere("smell", p_oSmellString, p_oSmellChecker, p_pSmellChecker,
  2873.          "You smell nothing special about", what)
  2874. corp;
  2875. r_indoors@p_oSmellString :=
  2876.     "The air here is not bad, but not as good as outdoors air."$
  2877. r_tunnel@p_oSmellString := "The tunnel air is somewhat stale."$
  2878. r_outdoors@p_oSmellString := "The air here is fairly fresh and pleasant."$
  2879. r_path@p_oSmellString := "There is a very faint dusty smell here."$
  2880. r_road@p_oSmellString := "There is a faint dusty smell here."$
  2881. r_forest@p_oSmellString := "The air here smells of growing plants."$
  2882. r_field@p_oSmellString := "The air here smells of grass and flowers."$
  2883. r_sidewalk@p_oSmellString := "The air here smells a bit from the nearby road."$
  2884. r_park@p_oSmellString := "The park air is fresher than typical outdoors air."$
  2885. define tp_verbs proc v_listen(string what)bool:
  2886.     VerbHere("listen to", p_oListenString, p_oListenChecker, p_pListenChecker,
  2887.          "You hear nothing special from", what)
  2888. corp;
  2889. r_indoors@p_oListenString := "You hear nothing special here."$
  2890. r_outdoors@p_oListenString := "You hear nothing special here."$
  2891. r_path@p_oListenString :=
  2892.     "You hear the gentle sound of a breeze in the greenery."$
  2893. r_forest@p_oListenString :=
  2894.     "You hear the gentle rustle of a breeze in the trees."$
  2895. r_field@p_oListenString :=
  2896.     "You hear the murmur of a breeze and occasional insect sounds."$
  2897. r_park@p_oListenString :=
  2898.     "You can hear the sound of a breeze in the greenery."$
  2899. r_tunnel@p_oListenString :=
  2900.     "You hear nothing here but the slight murmur of air moving, and an "
  2901.     "occasional drop of water falling."$
  2902. define tp_verbs proc v_open(string what)bool:
  2903.     VerbHere("open", p_oOpenString, p_oOpenChecker, p_pOpenChecker,
  2904.          "You cannot open", what)
  2905. corp;
  2906. define tp_verbs proc v_close(string what)bool:
  2907.     VerbHere("close", p_oCloseString, p_oCloseChecker, p_pCloseChecker,
  2908.          "You cannot close", what)
  2909. corp;
  2910. define tp_verbs proc v_push(string what)bool:
  2911.     VerbHere("push", p_oPushString, p_oPushChecker, p_pPushChecker,
  2912.          "You cannot push", what)
  2913. corp;
  2914. define tp_verbs proc v_pull(string what)bool:
  2915.     VerbHere("pull", p_oPullString, p_oPullChecker, p_pPullChecker,
  2916.          "You cannot pull", what)
  2917. corp;
  2918. define tp_verbs proc v_turn(string what)bool:
  2919.     VerbHere("turn", p_oTurnString, p_oTurnChecker, p_pTurnChecker,
  2920.          "You cannot turn", what)
  2921. corp;
  2922. define tp_verbs proc v_lift(string what)bool:
  2923.     VerbHere("lift", p_oLiftString, p_oLiftChecker, p_pLiftChecker,
  2924.          "You cannot lift", what)
  2925. corp;
  2926. define tp_verbs proc v_lower(string what)bool:
  2927.     VerbHere("lower", p_oLowerString, p_oLowerChecker, p_pLowerChecker,
  2928.          "You cannot lower", what)
  2929. corp;
  2930.  
  2931. Verb1(G, "play", 0, v_play)$
  2932. Verb1(G, "erase", 0, v_erase)$
  2933. Verb1(G, "eat", 0, v_eat)$
  2934. Synonym(G, "eat", "lick")$
  2935. Synonym(G, "eat", "taste")$
  2936. Verb1(G, "drink", 0, v_drink);
  2937. Synonym(G, "drink", "quaff")$
  2938. Synonym(G, "drink", "imbibe")$
  2939. Verb1(G, "use", 0, v_use)$
  2940. Synonym(G, "use", "apply")$
  2941. Verb1(G, "activate", 0, v_activate)$
  2942. Verb1(G, "turn", FindAnyWord(G, "on"), v_activate)$
  2943. Verb1(G, "deactivate", 0, v_deactivate)$
  2944. Synonym(G, "deactivate", "inactivate")$
  2945. Verb1(G, "turn", FindAnyWord(G, "off"), v_deactivate)$
  2946. Verb1(G, "light", 0, v_light)$
  2947. Synonym(G, "light", "ignite")$
  2948. Verb1(G, "extinguish", 0, v_extinguish)$
  2949. Synonym(G, "extinguish", "douse")$
  2950. Verb1(G, "wear", 0, v_wear)$
  2951. Verb1(G, "touch", 0, v_touch)$
  2952. Synonym(G, "touch", "feel")$
  2953. Synonym(G, "touch", "pet")$
  2954. Verb1(G, "smell", 0, v_smell)$
  2955. Synonym(G, "smell", "sniff")$
  2956. Verb1(G, "listen", FindAnyWord(G, "to"), v_listen)$
  2957. Verb1(G, "listen", FindAnyWord(G, "at"), v_listen)$
  2958. Verb1(G, "open", 0, v_open)$
  2959. Verb1(G, "close", 0, v_close)$
  2960. Synonym(G, "close", "shut")$
  2961. Verb1(G, "push", FindAnyWord(G, "on"), v_push)$
  2962. Synonym(G, "push", "shove")$
  2963. Verb1(G, "pull", FindAnyWord(G, "on"), v_pull)$
  2964. Synonym(G, "pull", "yank")$
  2965. Synonym(G, "pull", "jerk")$
  2966. Synonym(G, "pull", "tug")$
  2967. Verb1(G, "turn", 0, v_turn)$
  2968. Synonym(G, "turn", "rotate")$
  2969. Synonym(G, "turn", "twist")$
  2970. Synonym(G, "turn", "spin")$
  2971. Synonym(G, "turn", "crank")$
  2972. Synonym(G, "turn", "wind")$
  2973. Verb1(G, "lift", FindAnyWord(G, "up"), v_lift)$
  2974. Synonym(G, "lift", "raise")$
  2975. Verb1(G, "lower", 0, v_lower)$
  2976.  
  2977.  
  2978. /* properties associated with specific commands ('register', 'buy') */
  2979.  
  2980. define t_base p_rRegisterAction CreateActionProp()$
  2981. define t_base p_rHintAction CreateActionProp()$
  2982. define t_base p_rHintString CreateStringProp()$
  2983. define t_base p_rInfoAction CreateActionProp()$
  2984. define t_base p_rInfoString CreateStringProp()$
  2985.  
  2986. /* and other verbs that use actions attached to locations */
  2987.  
  2988. define tp_verbs proc v_register()bool:
  2989.     action a;
  2990.  
  2991.     a := Here()@p_rRegisterAction;
  2992.     if a = nil then
  2993.     Print("There is nothing to register at here.\n");
  2994.     false
  2995.     else
  2996.     call(a, bool)()
  2997.     fi
  2998. corp;
  2999.  
  3000. Verb0(G, "register", 0, v_register)$
  3001. Synonym(G, "register", "reg")$
  3002. Synonym(G, "register", "r")$
  3003.  
  3004. define tp_verbs proc v_buy(string what)bool:
  3005.     action a;
  3006.  
  3007.     if what = "" then
  3008.     Print("You must specify what you want to buy.\n");
  3009.     false
  3010.     else
  3011.     a := Here()@p_rBuyAction;
  3012.     if a = nil then
  3013.         Print("There is nothing here to buy.\n");
  3014.         false
  3015.     else
  3016.         call(a, bool)(what)
  3017.     fi
  3018.     fi
  3019. corp;
  3020.  
  3021. Verb1(G, "buy", 0, v_buy)$
  3022. Synonym(G, "buy", "purchase")$
  3023.  
  3024. define tp_verbs proc v_shop()bool:
  3025.     ShowForSale();
  3026.     true
  3027. corp;
  3028.  
  3029. Verb0(G, "shop", 0, v_shop)$
  3030. Synonym(G, "shop", "price")$
  3031. Synonym(G, "shop", "prices")$
  3032. Synonym(G, "shop", "cost")$
  3033.  
  3034.  
  3035. define tp_verbs proc v_hint(string what)bool:
  3036.     action a;
  3037.     string st;
  3038.  
  3039.     a := Here()@p_rHintAction;
  3040.     if a = nil then
  3041.     st := Here()@p_rHintString;
  3042.     if st = "" then
  3043.         Print("There are no hints here.\n");
  3044.         false
  3045.     else
  3046.         Print(st + "\n");
  3047.         true
  3048.     fi
  3049.     else
  3050.     call(a, bool)(what)
  3051.     fi
  3052. corp;
  3053.  
  3054. Verb1(G, "hint", 0, v_hint)$
  3055.  
  3056. define tp_verbs proc v_info(string what)bool:
  3057.     action a;
  3058.     string st;
  3059.  
  3060.     a := Here()@p_rInfoAction;
  3061.     if a = nil then
  3062.     st := Here()@p_rInfoString;
  3063.     if st = "" then
  3064.         Print("There is no info to give here.\n");
  3065.         false
  3066.     else
  3067.         Print(st + "\n");
  3068.         true
  3069.     fi
  3070.     else
  3071.     call(a, bool)(what)
  3072.     fi
  3073. corp;
  3074.  
  3075. Verb1(G, "info", 0, v_hint)$
  3076. Synonym(G, "info", "information")$
  3077.  
  3078. /* some commands for folks to complain to SysAdmin */
  3079.  
  3080. define tp_verbs proc complain(string kind)bool:
  3081.  
  3082.     Log(kind + ": '" + Here()@p_rName + "' owner " +
  3083.     CharacterThing(Owner(Here()))@p_pName + ": " +
  3084.     GetTail() + "\n");
  3085.     Print(kind + " logged.\n");
  3086.     true
  3087. corp;
  3088.  
  3089. define tp_verbs proc v_typo()bool:
  3090.     complain("Typo")
  3091. corp;
  3092.  
  3093. define tp_verbs proc v_bug()bool:
  3094.     complain("Bug")
  3095. corp;
  3096.  
  3097. define tp_verbs proc v_gripe()bool:
  3098.     complain("Gripe")
  3099. corp;
  3100.  
  3101. VerbTail(G, "typo", v_typo)$
  3102. VerbTail(G, "bug", v_bug)$
  3103. VerbTail(G, "gripe", v_gripe)$
  3104. Synonym(G, "gripe", "complain")$
  3105. Synonym(G, "gripe", "bitch")$
  3106.  
  3107.  
  3108. /* In order to use this 'cast' verb (as in casting magic spells), the
  3109.    character must have the verbs defined in his/her private table. They
  3110.    are looked up there and executed. Source file 'st:extras/spells.m'
  3111.    will give some handy spells to whatever wizard sources it. There is
  3112.    a "spells" spell there which lists the ones it creates. The build
  3113.    code also creates spells 'makebuilder' and 'unmakebuilder' for
  3114.    SysAdmin. */
  3115.  
  3116. define tp_verbs proc v_cast()bool:
  3117.     table tb;
  3118.     string what;
  3119.     action a;
  3120.  
  3121.     tb := LookupTable(PrivateTable(), "t_spells");
  3122.     if tb = nil then
  3123.     Print("You have no spells to cast.\n");
  3124.     false
  3125.     else
  3126.     what := GetWord();
  3127.     if what = "" then
  3128.         Print("You must specify the spell you want to cast.\n");
  3129.         false
  3130.     else
  3131.         a := LookupAction(tb, what);
  3132.         if a = nil then
  3133.         Print("You know no spell by that name.\n");
  3134.         false
  3135.         else
  3136.         call(a, void)();
  3137.         true
  3138.         fi
  3139.     fi
  3140.     fi
  3141. corp;
  3142.  
  3143. VerbTail(G, "cast", v_cast)$
  3144.  
  3145.  
  3146. define tp_verbs proc setTextColours(int colour0, colour1, colour2,colour3)bool:
  3147.     thing me;
  3148.  
  3149.     me := Me();
  3150.     me@p_pTextColours[0] := colour0;
  3151.     me@p_pTextColours[1] := colour1;
  3152.     me@p_pTextColours[2] := colour2;
  3153.     me@p_pTextColours[3] := colour3;
  3154.     GSetTextColour(nil, 0, colour0);
  3155.     GSetTextColour(nil, 1, colour1);
  3156.     GSetTextColour(nil, 2, colour2);
  3157.     GSetTextColour(nil, 3, colour3);
  3158.     true
  3159. corp;
  3160.  
  3161. define tp_verbs proc v_brightGold()bool:
  3162.     setTextColours(0x000, 0xda0, 0xb80, 0xfc0)
  3163. corp;
  3164.  
  3165. define tp_verbs proc v_normalGold()bool:
  3166.     setTextColours(0x000, 0xb80, 0xa60, 0xda0)
  3167. corp;
  3168.  
  3169. define tp_verbs proc v_dimGold()bool:
  3170.     setTextColours(0x000, 0xa60, 0x850, 0xb80)
  3171. corp;
  3172.  
  3173. define tp_verbs proc v_brightGrey()bool:
  3174.     setTextColours(0x000, 0xddd, 0xbbb, 0xeee)
  3175. corp;
  3176.  
  3177. define tp_verbs proc v_normalGrey()bool:
  3178.     setTextColours(0x000, 0xbbb, 0x999, 0xddd)
  3179. corp;
  3180.  
  3181. define tp_verbs proc v_dimGrey()bool:
  3182.     setTextColours(0x000, 0x999, 0x777, 0xbbb)
  3183. corp;
  3184.  
  3185. define tp_verbs proc v_blueGrey()bool:
  3186.     setTextColours(0xbbb, 0x06b, 0x03a, 0x000)
  3187. corp;
  3188.  
  3189. define tp_verbs proc v_reverseGrey()bool:
  3190.     setTextColours(0xddd, 0x999, 0x777, 0x000)
  3191. corp;
  3192.  
  3193. define tp_verbs proc v_textcolours()bool:
  3194.     int colour0, colour1, colour2, colour3;
  3195.     thing me;
  3196.  
  3197.     colour0 := StringToInt(GetWord());
  3198.     colour1 := StringToInt(GetWord());
  3199.     colour2 := StringToInt(GetWord());
  3200.     colour3 := StringToInt(GetWord());
  3201.     if colour0 < 0 or colour1 < 0 or colour2 < 0 or colour3 < 0 or
  3202.     GetWord() ~= ""
  3203.     then
  3204.     me := Me();
  3205.     Print("Use is: textcolours <colour> <colour> <colour> <colour>\n");
  3206.     Print("  <colour> values are for pens 0, 1, 2, and 3 respectively.\n");
  3207.     Print("  <colour> values must be positive decimal numbers.\n");
  3208.     Print("  Current values are: " +
  3209.         IntToString(me@p_pTextColours[0]) + " " +
  3210.         IntToString(me@p_pTextColours[1]) + " " +
  3211.         IntToString(me@p_pTextColours[2]) + " " +
  3212.         IntToString(me@p_pTextColours[3]) + "\n");
  3213.     false
  3214.     else
  3215.     setTextColours(colour0, colour1, colour2, colour3)
  3216.     fi
  3217. corp;
  3218.  
  3219. Verb0(G, "brightgold", 0, v_brightGold)$
  3220. Verb0(G, "normalgold", 0, v_normalGold)$
  3221. Verb0(G, "dimgold", 0, v_dimGold)$
  3222. Verb0(G, "brightgrey", 0, v_brightGrey)$
  3223. Verb0(G, "normalgrey", 0, v_normalGrey)$
  3224. Verb0(G, "dimgrey", 0, v_dimGrey)$
  3225. Verb0(G, "bluegrey", 0, v_blueGrey)$
  3226. Verb0(G, "reversegrey", 0, v_reverseGrey)$
  3227. VerbTail(G, "textcolours", v_textcolours)$
  3228.  
  3229. define tp_verbs proc v_cursor(string colour)bool:
  3230.     int which;
  3231.  
  3232.     if colour = "" then
  3233.     Print("Use is: cursor <colour-name>\n");
  3234.     ShowKnownColours();
  3235.     false
  3236.     else
  3237.     which := ColourMatch(colour);
  3238.     if which = -1 then
  3239.         Print("Colour " + FormatName(colour) + " not known.\n");
  3240.         false
  3241.     else
  3242.         Me()@p_pCursorColour := which;
  3243.         SetCursorPen(which);
  3244.         true
  3245.     fi
  3246.     fi    
  3247. corp;
  3248.  
  3249. define tp_verbs proc v_icons(string colour)bool:
  3250.     int which;
  3251.  
  3252.     if colour = "" then
  3253.     Print("Use is: icons <colour-name>\n");
  3254.     ShowKnownColours();
  3255.     false
  3256.     else
  3257.     which := ColourMatch(colour);
  3258.     if which = -1 then
  3259.         Print("Colour " + FormatName(colour) + " not known.\n");
  3260.         false
  3261.     else
  3262.         Me()@p_pIconColour := which;
  3263.         GSetIconPen(nil, which);
  3264.         true
  3265.     fi
  3266.     fi
  3267. corp;
  3268.  
  3269. Verb1(G, "cursor", 0, v_cursor)$
  3270. Verb1(G, "icon", 0, v_icons)$
  3271. Synonym(G, "icon", "icons")$
  3272.  
  3273. define tp_verbs proc v_colours()bool:
  3274.     Print("Commands relating to colours: brightgold, normalgold, dimgold,\n"
  3275.     "    brightgrey, normalgrey, dimgrey, bluegrey, reversegrey,\n"
  3276.     "    textcolours, cursor, icons\n");
  3277.     true
  3278. corp;
  3279.  
  3280. Verb0(G, "colour", 0, v_colours)$
  3281. Synonym(G, "colour", "colours")$
  3282.  
  3283.  
  3284. unuse tp_verbs
  3285.