home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / GAMES / informosk.lha / verblib.h < prev   
Text File  |  1993-11-27  |  24KB  |  917 lines

  1. ! ----------------------------------------------------------------------------
  2. !  VERBLIB:  A library of standard verb routines which run the universe:
  3. !
  4. !    Quit, Restart, Restore, Verify, Save, ScriptOn, ScriptOff,
  5. !    Inv, Take, Drop, Remove, PutOn, Insert, Transfer, Empty,
  6. !    Enter, Exit, Go, Look, Examine, Give,
  7. !    Unlock, Lock, SwitchOn, SwitchOff, Open, Close, Disrobe, Wear, Eat;
  8. !
  9. !  and routines for verbs which by default only print a suitable reply:
  10. !
  11. !    Rhet [rhetorical answer], Burn, Pray, Wake, WakeOther [person],
  12. !    Kiss, Think, Smell, Listen, Taste, Touch, TouchThing, Dig,
  13. !    Cut, Jump [jump on the spot], JumpOver, Tie, Drink,
  14. !    Fill, Sorry, Strong [swear word], Mild [swear word], Attack, Swim,
  15. !    Swing [something], Blow, Rub, Set, WaveHands [ie, just "wave"],
  16. !    Wave [something], Pull, Push, PushDir [push something in a direction],
  17. !    Turn, Squeeze, LookUnder [look underneath something], Search,
  18. !    ThrowAt, Answer, Buy, Ask, Sing, Climb, Wait, Sleep
  19. !
  20. !  and the useful routine DescribeObj which describes an object with
  21. !  its possessions.
  22. ! ----------------------------------------------------------------------------
  23. !  The SACK_OBJECT, look-modes, defaults added
  24. ! ----------------------------------------------------------------------------
  25.  
  26. Default MAX_CARRIED  100;
  27. Default MAX_SCORE    0;
  28. Default NUMBER_TASKS 1;
  29. Default OBJECT_SCORE 4;
  30. Default ROOM_SCORE   5;
  31. Default SACK_OBJECT  0;   
  32.  
  33. [ ScoreSub;
  34.   if deadflag==0
  35.   {   print "You have so far scored ";
  36.   }
  37.   if deadflag > 0 { print "In that game you scored "; }
  38.   print_num score; print " out of a possible "; print_num MAX_SCORE; 
  39.   print ", in ";
  40.   print_num turns; print " turns";
  41.  
  42.   PrintRank();
  43. ];
  44.  
  45. Global task_done data NUMBER_TASKS;
  46.  
  47. [ Achieved num;
  48.   if task_done->num==0
  49.   {   put task_done byte num 1;
  50.       score=score+task_scores->num;
  51.   }
  52. ];
  53.  
  54. [ PANum m n;
  55.   print "  ";
  56.   n=m;
  57.   if n<0 { n=0-m; n=n*10; }
  58.   if n<10 { print "   "; jump panuml; }
  59.   if n<100 { print "  "; jump panuml; }
  60.   if n<1000 { print " "; }
  61.   .panuml;
  62.   print_num m; print " ";
  63. ];
  64.  
  65. [ FullScoreSub i l;
  66.   ScoreSub();
  67.   if score==0 { rfalse; }
  68.   new_line;
  69.   if deadflag > 0 { print "The score was "; }
  70.   if deadflag ==0 { print "The score is "; }
  71.   print "made up as follows:^^";
  72.   l=NUMBER_TASKS-1;
  73.   for i 0 to l
  74.   {   if task_done->i==1 { PANum(task_scores->i); PrintTaskName(i); }
  75.   }
  76.   if things_score~=0 { PANum(things_score); print "finding sundry items^"; }
  77.   if places_score~=0 { PANum(places_score); print "visiting various places^"; }
  78.   new_line;
  79.   PANum(score); print "total (out of "; print_num MAX_SCORE; print ")^";
  80. ];
  81.  
  82. [ QuitSub i;
  83.   print "Are you sure you want to quit? ";
  84.   .QSL; read buffer parse;
  85.   i=parse-->1;
  86.   if i==#w$yes or #w$y { quit; }
  87.   if i==#w$no or #w$n { rtrue; }
  88.   print "Please answer yes or no.";
  89.   print_char '>'; print_char ' ';
  90.   jump QSL;
  91. ];
  92.  
  93. [ RestartSub i;
  94.   print "Are you sure you want to restart? ";
  95.   .RSL; read buffer parse;
  96.   i=parse-->1;
  97.   if i==#w$yes { restart; }
  98.   if i==#w$y   { restart; }
  99.   if i==#w$no  { rtrue; }
  100.   if i==#w$n   { rtrue; }
  101.   print "Please answer yes or no.";
  102.   print_char '>'; print_char ' ';
  103.   jump RSL;
  104. ];
  105.  
  106. [ RestoreSub;
  107.   restore Rmaybe;
  108.   print_ret "Failed.";
  109.   .RMaybe; print "Ok.^";
  110. ];
  111.  
  112. [ SaveSub;
  113.   save Smaybe;
  114.   print_ret "Failed.";
  115.   .Smaybe; print "Ok.^";
  116. ];
  117.  
  118. [ VerifySub;
  119.   verify Vmaybe;
  120.   jump Vwrong;
  121.   .Vmaybe; print_ret "The game file has verified as intact.";
  122.   .Vwrong;
  123.   print_ret "The game file did not verify properly, and may be corrupted \
  124.              (unless you are running it on a primitive interpreter which does not properly implement \
  125.              the VERIFY code).";
  126. ];
  127.  
  128. [ ScriptOnSub i;
  129.   if transcript_mode==1 { print_ret "Transcripting is already on."; }
  130.   transcript_mode=1;
  131.   i=(0-->8)|1;
  132.   put 0 word 8 i;
  133.   print "Start of a transcript of^";
  134.   Banner();
  135. ];
  136.  
  137. [ ScriptOffSub i;
  138.   if transcript_mode==0 { print_ret "Transcripting is already off."; }
  139.   print "^End of transcript.^";
  140.   transcript_mode=0;
  141.   i=(0-->8)&$fffe;
  142.   put 0 word 8 i;
  143. ];
  144.  
  145. [ InvSub i;
  146.   i=child(player);
  147.   if i==0
  148.   {   print_ret "You are carrying nothing."; }
  149.   print "You are carrying:^";
  150.   Inventory(player);
  151.   PostAct();
  152. ];
  153.  
  154. [ Inventory obj n o2 i;
  155.   o2=1;
  156.   if n~=0
  157.   {   for i 1 to n { print "  "; }
  158.       o2=DescribeObj(obj,0); new_line;
  159.   }
  160.   if o2==0 { rtrue; }
  161.  
  162.   o2=child(obj);
  163.   while o2~=0
  164.   {   Inventory(o2,n+1); o2=sibling(o2);
  165.   }
  166. ];
  167.  
  168. [ TakeSub i;
  169.   i=RTakeSub(location);
  170.   if i~=0  { rtrue; }
  171.   if 1==PostAct() { rtrue; }
  172.   notheld_mode=onotheld_mode;
  173.   if notheld_mode==0 { print "Taken.^"; }
  174. ];
  175.  
  176. [ RTakeSub fromobj i j k;
  177.   if inp1==player
  178.   {   print_ret "As the bishop said to the actress."; }
  179.   if inp1 has animate
  180.   {   print "I don't suppose "; DefArt(inp1);
  181.       print_ret " would care for that.";
  182.   }
  183.   i=parent(inp1);
  184.   if i==player
  185.   {   print_ret "You already have that."; }
  186.   while i~=fromobj
  187.   {   if i hasnt container
  188.       {   if i hasnt supporter { print_ret "That isn't available."; } }
  189.       if i has container
  190.       {   if i hasnt open
  191.           { print "Unfortunately the "; print_obj i; print_ret " isn't open."; }
  192.       }
  193.       i=parent(i);
  194.       if i==player { i=fromobj; }
  195.   }
  196.   if inp1 has scenery { print_ret "That's hardly portable."; }
  197.   if inp1 has static { print_ret "Fixed in place."; }
  198.   j=child(player); k=0; while j~=0 { if j hasnt worn { k=k+1; } j=sibling(j); }
  199.   if k>=MAX_CARRIED
  200.   {   if SACK_OBJECT~=0
  201.       {   if parent(SACK_OBJECT)~=player
  202.           { print_ret "You're carrying too many things already."; }
  203.           k=child(player); j=0;
  204.           while k~=0
  205.           {   if k~=SACK_OBJECT { if k hasnt worn { if k hasnt light { j=k; } } }
  206.               k=sibling(k);
  207.           }
  208.           if j~=0
  209.           {   print "(putting "; DefArt(j); print " into ";
  210.               DefArt(SACK_OBJECT); print " to make room)^";
  211.               remove_obj j; insert_obj j SACK_OBJECT;
  212.           }
  213.           else { print_ret "You're carrying too many things already."; }
  214.       }
  215.       else { print_ret "You're carrying too many things already."; }
  216.   }
  217.   move inp1 to player;
  218.   if inp1 hasnt moved
  219.   {   give inp1 moved;
  220.       if inp1 has scored { score=score+OBJECT_SCORE;
  221.                            things_score=things_score+OBJECT_SCORE; }
  222.   }
  223.   rfalse;
  224. ];
  225.  
  226. [ DropSub i;
  227.   i=parent(inp1);
  228.   if i==location
  229.   {   print_ret "Already on the floor."; }
  230.   if i~=player
  231.   {   print_ret "You haven't got that."; }
  232.   if inp1 has worn
  233.   { print "(First taking it off)^"; give inp1 ~worn; }
  234.   move inp1 to parent(player);
  235.   if 1==PostAct() { rtrue; }
  236.   print "Dropped.^";
  237. ];
  238.  
  239. [ RemoveSub i;
  240.   i=parent(inp1);
  241.   if i has container
  242.   {   if i hasnt open { print_ret "Alas, it is closed."; }
  243.   }
  244.   if i~=inp2 { print_ret "But it isn't there now."; }
  245.   if inp2 has worn { print_ret "You'll need to take it off first."; }
  246.   i=RTakeSub(inp2);
  247.   if i~=0  { rtrue; }
  248.   action=#a$TakeSub;
  249.   if 1==PostAct() { rtrue; }
  250.   action=#a$RemoveSub;
  251.   if 1==PostAct() { rtrue; }
  252.   print "Removed.^";
  253. ];
  254.  
  255. [ PutOnSub k p;
  256.   if inp2==d_obj  { action=#a$DropSub; Process(inp1,0); rfalse; }
  257.   if parent(inp1)~=player
  258.   {   print_ret "You need to be holding it before you can put it onto \
  259.           something else."; }
  260.   if inp2 hasnt supporter { print "Putting things on "; DefArt(inp2);
  261.       print_ret " would achieve nothing."; }
  262.   if parent(inp2)==player { print_ret "You lack the dexterity."; } 
  263.   if inp1 has worn { print "(first taking it off)^"; give inp1 ~worn; }
  264.   k=0; p=child(inp2); while p~=0 { p=sibling(p); inc k; }
  265.   if k>=prop(inp2,capacity) { print "There is no more room on ";
  266.       DefArt(inp2); print_ret "."; }
  267.  
  268.   move inp1 to inp2;
  269.  
  270.   if 1==PostAct() { rtrue; }
  271.   if multiflag==1 { print_ret "Done."; }
  272.   print "You put the "; print_obj inp1; print " on ";
  273.   DefArt(inp2); print_ret ".";
  274. ];
  275.  
  276. [ InsertSub k p;
  277.   if inp2==d_obj  { action=#a$DropSub; Process(inp1,0); rfalse; }
  278.   if parent(inp1)~=player
  279.   {   print_ret "You need to be holding it before you can put it into \
  280.           something else."; }
  281.   if inp2 hasnt container { print_ret "That can't contain things."; }
  282.   if inp2 hasnt open { print_ret "Alas, it is closed."; }
  283.   if inp2 has worn { print_ret "You'll need to take it off first."; }
  284.   if inp1 has worn { print "(first taking it off)^"; give inp1 ~worn; }
  285.   k=0; p=child(inp2); while p~=0 { p=sibling(p); inc k; }
  286.   if k>=prop(inp2,capacity) { print "There is no more room in ";
  287.       DefArt(inp2); print_ret "."; }
  288.   move inp1 to inp2;
  289.  
  290.   if 1==PostAct() { rtrue; }
  291.   if multiflag==1 { print_ret "Done."; }
  292.   print "You put the "; print_obj inp1; print " into ";
  293.   DefArt(inp2); print_ret ".";
  294. ];
  295.  
  296. [ TransferSub i a;
  297.   a=#a$DropSub;
  298.   if inp2 has container { a=#a$InsertSub; }
  299.   else { if inp2 has supporter { a=#a$PutOnSub; } }
  300.   i=parent(inp1);
  301.   if i~=player
  302.   {   while i~=0
  303.       {   if i hasnt open { print_ret "That isn't in your possession."; }
  304.           i=parent(i);
  305.           if i==player { jump Segue; }
  306.       }
  307.       print_ret "First pick that up.";
  308.   }
  309.   .Segue; move inp1 to player;
  310.   Process(inp1,inp2,a); rfalse;
  311. ];
  312.  
  313. [ EmptySub;
  314.   inp2=d_obj; EmptyTSub();
  315. ];
  316.  
  317. [ EmptyTSub i j;
  318.   if inp1 hasnt container { CDefArt(inp1);
  319.       print_ret " can't contain things."; }
  320.   if inp1 hasnt open { CDefArt(inp1); print_ret " is closed."; }
  321.   if inp2~=d_obj
  322.   {   if inp2 hasnt container
  323.       { CDefArt(inp2); print_ret " can't contain things."; }
  324.       if inp2 hasnt open { CDefArt(inp2); print_ret " is closed."; }
  325.   }
  326.   i=child(inp1);
  327.   if i==0 { DefArt(inp1); print_ret " is empty already."; }
  328.   while i~=0
  329.   {   j=sibling(i);
  330.       print_obj i; print ": ";
  331.       Process(i,inp2,#a$TransferSub);
  332.       i=j;
  333.   }
  334. ];
  335.  
  336. [ EnterSub i;
  337.   if inp1 has portal { GoSub(); rtrue; }
  338.   i=parent(player);
  339.   if i~=location
  340.   { print "But you're already in the "; print_obj i; print_ret "."; }
  341.   if inp1 hasnt enterable { print_ret "A surreal idea."; }
  342.   i=parent(inp1);
  343.   if i==compass { GoSub(); rtrue; }
  344.   if i~=location { print_ret "You can only get into something on the floor."; }
  345.   move player to inp1;
  346.   print "You get into the "; print_obj inp1; print ".^";
  347.   Locale(inp1);
  348. ];
  349.  
  350. [ ExitSub;
  351.   if parent(player)==location
  352.   {   print_ret "But you're aren't in anything at the moment."; }
  353.   move player to location;
  354.   print "You are on your own two feet again.^"; LookSub(1);
  355.   PostAct();
  356. ];
  357.  
  358. [ VagueGoSub;
  359.   print_ret "You'll have to say which compass direction to go in.";
  360. ];
  361.  
  362. [ GoSub i j df movewith;
  363.  
  364.   movewith=0;
  365.   i=parent(player);
  366.   if location~=thedark
  367.   {   if i~=location
  368.       {   j=prop(i,preroutine);
  369.           if j~=$ffff
  370.           {   if indirect(j)~=0
  371.               {   movewith=i; i=parent(i);
  372.                   jump gotroom;
  373.               }
  374.           }
  375.           print "You'll have to get out of "; DefArt(i);
  376.           print_ret " first.";
  377.       }
  378.   }
  379.   .gotroom;
  380.   j=prop(i, prop(inp1, dirprop));
  381.   if j==0
  382.   {   i=prop(i,cantgo); print_paddr i; new_line; rfalse;
  383.   }
  384.   if j has portal
  385.   {   if j has concealed { print_ret "You can't go that way."; }
  386.       if j hasnt open
  387.       {   if inp1==u_obj
  388.           {   print "You are unable to climb "; Defart(j); print_ret "."; }
  389.           if inp1==d_obj
  390.           {   print "You are unable to descend "; Defart(j); print_ret "."; }
  391.           print "You can't, since "; Defart(j); print_ret " is in the way.";
  392.       }
  393.       j=prop(j,portalto);
  394.       if j==0 { print "You can't, since "; Defart(j);
  395.           print_ret " leads nowhere."; }
  396.   }
  397.   if movewith==0  {  move player to j;  }
  398.   if movewith~=0  {  move movewith to j;  }
  399.  
  400.   df=OffersLight(j);
  401.  
  402.   if df~=0 { location=j; lightflag=1; }
  403.   if df==0
  404.   {   if location==thedark
  405.       {   DarkToDark();
  406.       }
  407.       location=thedark; lightflag=0;
  408.   }
  409.  
  410.   if 1==LPostAct() { rtrue; }
  411.  
  412.   LookSub(1);
  413. ];
  414.  
  415. [ SayWhatsOn descon o p i k;
  416.   new_line;
  417.   print "On "; DefArt(descon);
  418.   k=0; p=child(descon); while p~=0 { p=sibling(p); inc k; }
  419.   if k==1 { print " is "; } else { print " are "; }
  420.   o=child(descon);
  421.   while o~=0
  422.   {   i=i+1;
  423.       DescribeObj(o,1);
  424.       if i==k-1 { print " and "; }
  425.       if i < k-1 { print ", "; }
  426.   o=sibling(o);
  427.   }
  428.   print ".^";
  429. ];
  430.  
  431. [ Locale descin o k j flag i;
  432.   o=child(descin); k=0;
  433.   while o~=0
  434.   {   if o hasnt concealed
  435.       {  if o hasnt scenery
  436.          {   give o workflag; inc k;
  437.              if o hasnt moved
  438.              {   j=prop(o,initpos);
  439.                  if o has portal
  440.                  {   if o hasnt open { j=prop(o,closedpos); }
  441.                  }
  442.                  if o has switchable
  443.                  {   if o hasnt on { j=prop(o,closedpos); }
  444.                  }
  445.                  if j~=0
  446.                  {   new_line;
  447.                      print_paddr j; new_line; flag=1;
  448.                      give o ~workflag; dec k;
  449.                      if o has supporter
  450.                      {   if child(o)~=0 { SayWhatsOn(o); }
  451.                      }
  452.                  }
  453.              }
  454.          }
  455.          else
  456.          {   if o has supporter
  457.              {   if child(o)~=0 { SayWhatsOn(o); }
  458.              }
  459.          }
  460.       }
  461.  
  462.       o=sibling(o);
  463.   }
  464.  
  465.   if k==0 { return; }
  466.   new_line;
  467.   if descin~=location { print "In "; DefArt(descin); print " you"; }
  468.   if descin==location { print "You"; }
  469.   print " can ";
  470.   if flag==1 { print "also "; }
  471.   print "see "; i=0;
  472.   o=child(descin);
  473.   while o~=0 { 
  474.    if o has workflag
  475.    {  i=i+1;
  476.       DescribeObj(o,1);
  477.       if i==k-1 { print " and "; }
  478.       if i < k-1 { print ", "; }
  479.    }
  480.    o=sibling(o);
  481.   }
  482.   if descin~=location { print ".^"; }
  483.   if descin==location { print " here.^"; }
  484. ];
  485.  
  486. [ LMode1Sub;
  487.   lookmode=1; print_paddr #Story;
  488.   print_ret " is now in its normal ~brief~ printing mode, which gives long descriptions of \
  489.              places never before visited and short descriptions otherwise.";
  490. ];
  491.  
  492. [ LMode2Sub;
  493.   lookmode=2; print_paddr #Story;
  494.   print_ret " is now in its ~verbose~ mode, which always gives long descriptions of \
  495.              locations (even if you've been there before).";
  496. ];
  497.  
  498. [ LMode3Sub;
  499.   lookmode=3; print_paddr #Story;
  500.   print_ret " is now in its ~superbrief~ mode, which always gives short descriptions of \
  501.              locations (even if you haven't been there before).";
  502. ];
  503.  
  504. [ LookSub weary i descin;
  505.   descin=location;
  506.   if descin~=lastdesc { NewRoom(); }
  507.   new_line; print_obj location; i=parent(player);
  508.   if location~=thedark
  509.   {   if i~=location { print " (in the "; print_obj i; print ")"; descin=i; }
  510.   }
  511.   new_line;
  512.  
  513.   if weary~=1 { jump YesLD; }
  514.   if lookmode==2 { jump YesLD; }
  515.   if lookmode==3 { jump NoLD; }
  516.   if location has visited
  517.   {   if weary==1 { jump NoLD; }
  518.   }
  519.   .YesLD;
  520.   i = prop(location,longdesc);
  521.   print_paddr i; new_line;
  522.   .NoLD;
  523.  
  524.   if location hasnt visited
  525.   {   give location visited;
  526.       if location has scored
  527.       {   score=score+ROOM_SCORE;
  528.           places_score=places_score+ROOM_SCORE;
  529.       }
  530.   }
  531.  
  532.   if descin~=location { Locale(location); }
  533.   Locale(descin);
  534.  
  535.   LookRoutine();
  536.   action=#a$LookSub;
  537.   if 1==LPostAct() { rtrue; }
  538. ];
  539.  
  540. [ ExamineSub i;
  541.   if location==thedark
  542.   { print_ret "Darkness, noun.  An absence of light to see by."; }
  543.  
  544.   if inp1==player { print_ret "As good-looking as ever."; }
  545.   if inp1 has autosearch { SearchSub(); rfalse; }
  546.   i=prop(inp1,longdesc);
  547.   if i==0
  548.   {   if inp1 has container { SearchSub(); rfalse; }
  549.       print "You see nothing special about "; Defart(inp1); print_ret ".";
  550.   }
  551.   print_paddr i; new_line;
  552.   if inp1 has switchable
  553.   {   print "It is currently switched ";
  554.       if inp1 has on { print "on.^"; }
  555.       if inp1 hasnt on { print "off.^"; }
  556.   }
  557.   if 1==PostAct() { rtrue; }
  558. ];
  559.  
  560. [ DescribeObj o listmode p p2 i k rval;
  561.  
  562.   if listmode ~=2 { Indefart(o); }
  563.   if listmode ==2 { Defart(o); }
  564.  
  565.   if o has light { print " (providing light)"; }
  566.   if o has worn { print " (being worn)"; }
  567.   if o has container
  568.   {   if listmode ~=2 { print " (which is "; }
  569.       if listmode ==2 { print ", which is "; }
  570.       if o hasnt open
  571.       { print "closed";
  572.         if o has interior { jump Cdone; }
  573.       }
  574.       if o has open { print "open"; }
  575.       p=child(o);
  576.       if p==0
  577.       {   print " but empty";
  578.           jump Cdone;
  579.       }
  580.       if listmode==0 { rval=1; jump Cdone; }
  581.       print " and contains ";
  582.       k=0; p2=p; while p2~=0 { p2=sibling(p2); inc k; }
  583.  
  584.       i=0; while p~=0 { inc i; DescribeObj(p,1);
  585.         if i==k-1 { print " and "; }
  586.         if i < k-1 { print ", "; }
  587.         p=sibling(p);
  588.       }
  589.       .Cdone;
  590.       if listmode ~=2 { print ")"; }
  591.   }
  592.   if o has supporter
  593.   {   p=child(o);
  594.       if p~=0
  595.       {   if listmode ~=2 { print " (on which "; }
  596.           if listmode ==2 { print ", on top of which "; }
  597.           if listmode==0 { rval=1; jump Sdone; }
  598.           k=0; p2=p;
  599.           while p2~=0
  600.           {   p2=sibling(p2); inc k; }
  601.               if k==1 { print "is "; } else { print "are "; }
  602.               i=0; while p~=0 { inc i; DescribeObj(p,1);
  603.               if i==k-1 { print " and "; }
  604.               if i < k-1 { print ", "; }
  605.               p=sibling(p);
  606.           }
  607.           .SDone;
  608.           if listmode ~=2 { print ")"; }
  609.       }
  610.   }
  611.   return rval;
  612. ];
  613.  
  614. [ GiveSub;
  615.   if Life(inp2,#a$GiveSub)~=0 { rfalse; }
  616.   print_obj inp2; print_ret " doesn't seem interested.^";
  617. ];
  618.  
  619. [ UnlockSub i;
  620.   if inp1 hasnt lockable { print_ret "I can't see how to unlock that."; }
  621.   if inp1 hasnt locked { print_ret "It is in fact unlocked now."; }
  622.   i=prop(inp1,with_key);
  623.   if i~=inp2 { print_ret "That doesn't seem to fit the lock."; }
  624.   give inp1 ~locked;
  625.   if 1==PostAct() { rtrue; }
  626.   print "You unlock the "; print_obj(inp1); print ".^";
  627. ];
  628.  
  629. [ LockSub i;
  630.   if inp1 hasnt lockable { print_ret "I can't see how to lock that."; }
  631.   if inp1 has locked { print_ret "It is in fact locked now."; }
  632.   if inp1 has open { print_ret "First you'll have to close it."; }
  633.   i=prop(inp1,with_key);
  634.   if i~=inp2 { print_ret "That doesn't seem to fit the lock."; }
  635.   give inp1 locked;
  636.   if 1==PostAct() { rtrue; }
  637.   print "You lock the "; print_obj(inp1); print ".^";
  638. ];
  639.  
  640. [ SwitchonSub;
  641.   if inp1 hasnt switchable
  642.   { print_ret "That's not something you can switch."; }
  643.   if inp1 has on { print_ret "It's already on."; }
  644.   give inp1 on;
  645.   if 1==PostAct() { rtrue; }
  646.   print "You switch the "; print_obj(inp1); print " on.^";
  647. ];
  648.  
  649. [ SwitchoffSub;
  650.   if inp1 hasnt switchable
  651.   { print_ret "That's not something you can switch."; }
  652.   if inp1 hasnt on { print_ret "It's already off."; }
  653.   give inp1 ~on;
  654.   if 1==PostAct() { rtrue; }
  655.   print "You switch the "; print_obj(inp1); print " off.^";
  656. ];
  657.  
  658. [ OpenSub;
  659.   if inp1 hasnt openable { print_ret "That's not something you can open."; }
  660.   if inp1 has locked { print_ret "It seems to be locked."; }
  661.   if inp1 has open { print_ret "It's already open."; }
  662.   give inp1 open;
  663.   if 1==PostAct() { rtrue; }
  664.   print "You open the "; print_obj(inp1); print ".^";
  665. ];
  666.  
  667. [ CloseSub;
  668.   if inp1 hasnt openable { print_ret "That's not something you can close."; }
  669.   if inp1 hasnt open { print_ret "It's already closed."; }
  670.   give inp1 ~open;
  671.   if 1==PostAct() { rtrue; }
  672.   print "You close the "; print_obj(inp1); print ".^";
  673. ];
  674.  
  675. [ DisrobeSub;
  676.   if inp1 hasnt worn { print_ret "You're not wearing that."; }
  677.   give inp1 ~worn;
  678.   if 1==PostAct() { rtrue; }
  679.   print "You take off the "; print_obj(inp1); print ".^";
  680. ];
  681.  
  682. [ WearSub i;
  683.   if inp1 hasnt clothing { print_ret "You can't wear that!"; }
  684.   i=parent(inp1);
  685.   if i~=player { print_ret "You're not holding that!"; }
  686.   give inp1 worn;
  687.   if 1==PostAct() { rtrue; }
  688.   print "You put on the "; print_obj(inp1); print ".^";
  689. ];
  690.  
  691. [ EatSub;
  692.   if inp1 hasnt edible { print_ret "No, it's plainly inedible."; }
  693.   remove inp1;
  694.   if 1==PostAct() { rtrue; }
  695.   print "You eat the "; print_obj inp1; print_ret ".  Not bad.";
  696. ];
  697.  
  698. [ RhetSub;
  699.   print_ret "That was a rhetorical question.";
  700. ];
  701.  
  702. [ BurnSub;
  703.   print_ret "In this game, arson is (usually) forbidden.";
  704. ];
  705.  
  706. [ PraySub;
  707.   print_ret "Spooky!  For a moment there, a deep voice seemed
  708.              to say ~you're on your own~.";
  709. ];
  710.  
  711. [ WakeSub;
  712.   print_ret "The dreadful truth is, this is not a dream.";
  713. ];
  714.  
  715. [ WakeOtherSub;
  716.   print_ret "That seems unnecessary.";
  717. ];
  718.  
  719. [ KissSub;
  720.   if Life(inp1,#a$KissSub)~=0 { rfalse; }
  721.   print_ret "Keep your mind on the game.";
  722. ];
  723.  
  724. [ ThinkSub;
  725.   print_ret "What a good idea.";
  726. ];
  727.  
  728. [ SmellSub;
  729.   print_ret "You smell nothing unexpected.";
  730. ];
  731.  
  732. [ ListenSub;
  733.   print_ret "You hear nothing unexpected.";
  734. ];
  735.  
  736. [ TasteSub;
  737.   print_ret "You taste nothing unexpected.";
  738. ];
  739.  
  740. [ TouchSub;
  741.   print_ret "You feel nothing unexpected.";
  742. ];
  743.  
  744. [ TouchThingSub;
  745.   if inp1 has animate { print_ret "Keep your hands to yourself!"; }
  746.   print_ret "You feel nothing unexpected.";
  747. ];
  748.  
  749. [ DigSub;
  750.   print_ret "The ground is unsuitable for digging here.";
  751. ];
  752.  
  753. [ CutSub;
  754.   print_ret "In this game, cutting things up is never helpful.";
  755. ];
  756.  
  757. [ JumpSub;
  758.   print_ret "You jump on the spot, fruitlessly.";
  759. ];
  760.  
  761. [ JumpOverSub;
  762.   print_ret "In this game, it is never useful to jump over things.";
  763. ];
  764.  
  765. [ TieSub;
  766.   print_ret "In this game, it is never useful to tie things.";
  767. ];
  768.  
  769. [ DrinkSub;
  770.   print_ret "There's nothing suitable to drink here.";
  771. ];
  772.  
  773. [ FillSub;
  774.   print_ret "But there's no water here to carry.";
  775. ];
  776.  
  777. [ SorrySub;
  778.   print_ret "Oh, don't apologise.";
  779. ];
  780.  
  781. [ StrongSub;
  782.   print_ret "Disgraceful!  Once upon a time adventurers had moral standards.";
  783. ];
  784.  
  785. [ MildSub;
  786.   print_ret "Quite.";
  787. ];
  788.  
  789. [ AttackSub;
  790.   if inp1 has animate
  791.   {   if Life(inp1,#a$AttackSub)~=0 { rfalse; } }
  792.   print_ret "Violence isn't the answer, you know.";
  793. ];
  794.  
  795. [ SwimSub;
  796.   print_ret "There's not enough water to swim in.";
  797. ];
  798.  
  799. [ SwingSub;
  800.   print_ret "There's nothing sensible to swing here.";
  801. ];
  802.  
  803. [ BlowSub;
  804.   print_ret "You can't usefully blow that.";
  805. ];
  806.  
  807. [ RubSub;
  808.   print_ret "You achieve nothing by this.";
  809. ];
  810.  
  811. [ SetSub;
  812.   print_ret "No, you can't set that.";
  813. ];
  814.  
  815. [ WaveHandsSub;
  816.   print_ret "You wave, feeling foolish.";
  817. ];
  818.  
  819. [ WaveSub i;
  820.   i=parent(inp1);
  821.   if i~=player { print_ret "But you aren't holding it."; }
  822.   print "You look ridiculous waving the "; print_obj inp1;
  823.   print_ret ".";
  824. ];
  825.  
  826. [ PullSub;
  827.   if inp1 has static { print_ret "It is fixed in place."; }
  828.   if inp1 has scenery { print_ret "You are unable to."; }
  829.   print_ret "Nothing obvious happens.";
  830. ];
  831.  
  832. [ PushSub;
  833.   if inp1 has static { print_ret "It is fixed in place."; }
  834.   if inp1 has scenery { print_ret "You are unable to."; }
  835.   print_ret "Nothing obvious happens.";
  836. ];
  837.  
  838. [ AllowPushDir i;
  839.   i=parent(inp2);
  840.   if i~=compass { print_ret "That's not a direction."; }
  841.   if inp2==u_obj or d_obj { print_ret "Not that way you can't."; }
  842.   PostAct();
  843.   i=inp1; inp1=inp2; Process(inp1, inp2, #a$GoSub);
  844.   remove_obj i; insert_obj i location;
  845. ];
  846.  
  847. [ PushDirSub;          
  848.   print_ret "Is that the best you can think of?";
  849. ];
  850.  
  851. [ TurnSub;
  852.   if inp1 has static { print_ret "It is fixed in place."; }
  853.   if inp1 has scenery { print_ret "You are unable to."; }
  854.   print_ret "Nothing obvious happens.";
  855. ];
  856.  
  857. [ SqueezeSub;
  858.   if inp1 has animate { print_ret "Keep your hands to yourself."; }
  859.   print_ret "You achieve nothing by this.";
  860. ];
  861.  
  862. [ LookUnderSub;
  863.   print_ret "You find nothing of interest.";
  864. ];
  865.  
  866. [ SearchSub;
  867.   if inp1 hasnt container
  868.   {   print_ret "You find nothing of interest."; }
  869.   if inp1 has interior
  870.   {   if inp1 hasnt open
  871.       {   print_ret "You can't see inside, since it is closed."; }
  872.   }
  873.   if 1==PostAct() { rtrue; }
  874.   print "You peer at ";
  875.   DescribeObj(inp1,2); print_ret ".";
  876. ];
  877.  
  878. [ ThrowAtSub;
  879.   if inp2 hasnt animate { print_ret "Futile."; }
  880.   if Life(inp2,#a$ThrowAtSub)~=0 { rfalse; }
  881.   print_ret "You lack the nerve when it comes to the crucial moment.";
  882. ];
  883.  
  884. [ AnswerSub;
  885.   if Life(inp2,#a$AnswerSub)~=0 { rfalse; }
  886.   print_ret "No reply.";
  887. ];  
  888.  
  889. [ BuySub;
  890.   print_ret "Nothing is on sale.";
  891. ];
  892.  
  893. [ AskSub;
  894.   if Life(inp1,#a$AskSub)~=0 { rfalse; }
  895.   print_ret "No reply.";
  896. ];  
  897.  
  898. [ SingSub;
  899.   if random(2)==1 { print "Your yodelling "; }
  900.   else { print "Your singing "; }
  901.   print_ret "is atrocious, if you say so yourself.";
  902. ];
  903.  
  904. [ ClimbSub;
  905.   print_ret "I don't think much is to be achieved by that.";
  906. ];  
  907.  
  908. [ WaitSub;
  909.   if 1==LPostAct() { rtrue; }
  910.   print_ret "Time passes.";
  911. ];  
  912.  
  913. [ SleepSub;
  914.   print_ret "You must have slept yourself out.  \
  915.              You certainly aren't drowsy now.";
  916. ];
  917.