action.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: action.h
  4. *
  5. * DESCRIPTION:
  6. * This module contains functions to process the player's actions.
  7. *
  8. * =============================================================================
  9. * EXPORTED VARIABLES
  10. *
  11. * None
  12. *
  13. * =============================================================================
  14. * EXPORTED FUNCTIONS
  15. *
  16. * run : Move in a direction until something interesting happens
  17. * wield : Wield an item
  18. * wear : Wear armour or shield
  19. * dropobj : Drop an object
  20. * readsrc : Read a scroll ot a book for the inventory
  21. * eatcookie : Eat a cookie in inventory, and display fortune if possible.
  22. * quaff : Drink a potion in inventory
  23. * opendoor : Open a closed door (enhanced interface only)
  24. * closedoor : Close an open door
  25. * openchest : Open a chest at the current location (enhanced interface only)
  26. * quit : Asks if really want to quit.
  27. * do_create : Create an item (wizard only)
  28. *
  29. * =============================================================================
  30. */
  31. #ifndef __ACTION_H
  32. #define __ACTION_H
  33. /* =============================================================================
  34. * FUNCTION: run
  35. *
  36. * DESCRIPTION:
  37. * Move the player in the input direction until something interesting is
  38. * reached.
  39. *
  40. * PARAMETERS:
  41. *
  42. * dir : The direction to move the player.
  43. *
  44. * RETURN VALUE:
  45. *
  46. * None.
  47. */
  48. void run(int dir);
  49. /* =============================================================================
  50. * FUNCTION: wield
  51. *
  52. * DESCRIPTION:
  53. * Function to wield a weapon.
  54. * Asks the player what to wield and changes the that item.
  55. *
  56. * PARAMETERS:
  57. *
  58. * None
  59. *
  60. * RETURN VALUE:
  61. *
  62. * None.
  63. */
  64. void wield(void);
  65. /* =============================================================================
  66. * FUNCTION: wear
  67. *
  68. * DESCRIPTION:
  69. * Function to wear armour or a shield.
  70. *
  71. * PARAMETERS:
  72. *
  73. * None
  74. *
  75. * RETURN VALUE:
  76. *
  77. * None.
  78. */
  79. void wear(void);
  80. /* =============================================================================
  81. * FUNCTION: dropobj
  82. *
  83. * DESCRIPTION:
  84. * Function to drop an object from the player's inventory.
  85. *
  86. * PARAMETERS:
  87. *
  88. * None.
  89. *
  90. * RETURN VALUE:
  91. *
  92. * None.
  93. */
  94. void dropobj(void);
  95. /* =============================================================================
  96. * FUNCTION: readscr
  97. *
  98. * DESCRIPTION:
  99. * Read a scroll or book being carried.
  100. * ASks for what to read then performs appropriate processing for the item
  101. * selected.
  102. *
  103. * PARAMETERS:
  104. *
  105. * None.
  106. *
  107. * RETURN VALUE:
  108. *
  109. * None.
  110. */
  111. void readscr(void);
  112. /* =============================================================================
  113. * FUNCTION: eatcookie
  114. *
  115. * DESCRIPTION:
  116. * Function to eat a cookie one is carrying.
  117. *
  118. * PARAMETERS:
  119. *
  120. * None.
  121. *
  122. * RETURN VALUE:
  123. *
  124. * None.
  125. */
  126. void eatcookie(void);
  127. /* =============================================================================
  128. * FUNCTION: quaff
  129. *
  130. * DESCRIPTION:
  131. * Function to quaff a potion being carried.
  132. *
  133. * PARAMETERS:
  134. *
  135. * None.
  136. *
  137. * RETURN VALUE:
  138. *
  139. * None.
  140. */
  141. void quaff(void);
  142. /* =============================================================================
  143. * FUNCTION: opendoor
  144. *
  145. * DESCRIPTION:
  146. * Function to open a closed door near the player's current location.
  147. * Asks for the direction to the door and opens the door at that location
  148. * (if any).
  149. *
  150. * PARAMETERS:
  151. *
  152. * None.
  153. *
  154. * RETURN VALUE:
  155. *
  156. * None.
  157. */
  158. void opendoor(void);
  159. /* =============================================================================
  160. * FUNCTION: closedoor
  161. *
  162. * DESCRIPTION:
  163. * Function to close an open door at the player's current location.
  164. *
  165. * PARAMETERS:
  166. *
  167. * None.
  168. *
  169. * RETURN VALUE:
  170. *
  171. * None.
  172. */
  173. void closedoor(void);
  174. /* =============================================================================
  175. * FUNCTION: openchest
  176. *
  177. * DESCRIPTION:
  178. * Function to open a chest at the player's current location.
  179. *
  180. * PARAMETERS:
  181. *
  182. * None.
  183. *
  184. * RETURN VALUE:
  185. *
  186. * None.
  187. */
  188. void openchest(void);
  189. /* =============================================================================
  190. * FUNCTION: quit
  191. *
  192. * DESCRIPTION:
  193. * Function to ask if the player really wants to quit.
  194. *
  195. * PARAMETERS:
  196. *
  197. * None.
  198. *
  199. * RETURN VALUE:
  200. *
  201. * None.
  202. */
  203. void quit(void);
  204. /* =============================================================================
  205. * FUNCTION: do_create
  206. *
  207. * DESCRIPTION:
  208. * Function to create an item by the player (wizard only)).
  209. *
  210. * PARAMETERS:
  211. *
  212. * None.
  213. *
  214. * RETURN VALUE:
  215. *
  216. * None.
  217. */
  218. void do_create(void);
  219. #endif