ralphmerridew

Inform 7 std. library insert

Jul 7th, 2011
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.25 KB | None | 0 0
  1. From Standard Rules by Graham Nelson:
  2.  
  3. Inserting it into is an action applying to two things.
  4. The inserting it into action translates into I6 as "Insert".
  5.  
  6. The specification of the inserting it into action is "By this action, an actor puts
  7. something he is holding into a container: for instance, putting a coin into a
  8. collection box."
  9.  
  10. Check an actor inserting something into (this is the convert insert to drop where
  11. possible rule):
  12. if the second noun is down or the actor is in the second noun,
  13. convert to the dropping action on the noun.
  14.  
  15. Check an actor inserting something into (this is the can't insert what's not held rule):
  16. if the actor is carrying the noun, continue the action;
  17. if the actor is wearing the noun, continue the action;
  18. issue miscellaneous library message number 26 for the noun;
  19. silently try the actor taking the noun;
  20. if the actor is carrying the noun, continue the action;
  21. stop the action.
  22.  
  23. Check an actor inserting something into (this is the can't insert something into itself rule):
  24. let the noun-CPC be the component parts core of the noun;
  25. let the second-CPC be the component parts core of the second noun;
  26. let the transfer ceiling be the common ancestor of the noun-CPC with the second-CPC;
  27. if the transfer ceiling is the noun-CPC,
  28. stop the action with library message inserting it into action number 5 for
  29. the noun.
  30.  
  31. Check an actor inserting something into (this is the can't insert into closed containers rule):
  32. if the second noun is a closed container,
  33. stop the action with library message inserting it into action number 3 for
  34. the second noun.
  35.  
  36. Check an actor inserting something into (this is the can't insert into what's not a
  37. container rule):
  38. if the second noun is not a container,
  39. stop the action with library message inserting it into action number 2 for
  40. the second noun.
  41.  
  42. Check an actor inserting something into (this is the can't insert clothes being worn rule):
  43. if the actor is wearing the noun:
  44. issue library message inserting it into action number 6 for the noun;
  45. silently try the actor trying taking off the noun;
  46. if the actor is wearing the noun, stop the action;
  47.  
  48. Check an actor inserting something into (this is the can't insert if this exceeds
  49. carrying capacity rule):
  50. if the second noun provides the property carrying capacity:
  51. if the number of things in the second noun is at least the carrying capacity
  52. of the second noun,
  53. stop the action with library message inserting it into action number 7 for the second noun;
  54.  
  55. Carry out an actor inserting something into (this is the standard inserting rule):
  56. now the noun is in the second noun.
  57.  
  58. Report an actor inserting something into (this is the concise report inserting rule):
  59. if the actor is the player and the I6 parser is running multiple actions,
  60. stop the action with library message inserting it into action number 8
  61. for the noun;
  62. otherwise continue the action.
  63.  
  64. Report an actor inserting something into (this is the standard report inserting rule):
  65. if the actor is the player, issue library message inserting it into action
  66. number 9 for the noun;
  67. otherwise issue actor-based library message inserting it into action number 10 for the noun.
  68.  
  69. From Language.i6t:
  70.  
  71. Insert: switch (n) {
  72. 1: "You need to be holding ", (the) x1, " before you can put ", (itorthem) x1,
  73. " into something else.";
  74. 2: print_ret (Cthatorthose) x1, " can't contain things.";
  75. 3: print_ret (The) x1, " ", (isorare) x1, " closed.";
  76. 4: "You'll need to take ", (itorthem) x1, " off first.";
  77. 5: "You can't put something inside itself.";
  78. 6: print "(first taking ", (itorthem) x1, " off)^"; say__p = 0; return;
  79. 7: "There is no more room in ", (the) x1, ".";
  80. 8: "Done.";
  81. 9: "You put ", (the) x1, " into ", (the) second, ".";
  82. 10: print (The) actor, " puts ", (the) x1, " into ", (the) second, ".^";
  83. }
  84.  
  85. ...
  86.  
  87.  
  88. [ ItorThem obj;
  89. if (obj == player) { print "yourself"; return; }
  90. if (obj has pluralname) { print "them"; return; }
  91. if (obj has animate) {
  92. if (obj has female) { print "her"; return; }
  93. else
  94. if (obj hasnt neuter) { print "him"; return; }
  95. }
  96. print "it";
  97. ];
Advertisement
Add Comment
Please, Sign In to add comment