store.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: store.h
  4. *
  5. * DESCRIPTION:
  6. * This module contaions functions to handle the locations found on the home
  7. * level and in the dungeon.
  8. *
  9. * =============================================================================
  10. * EXPORTED VARIABLES
  11. *
  12. * None
  13. *
  14. * =============================================================================
  15. * EXPORTED FUNCTIONS
  16. *
  17. * dndstore : Handles entering the DND store
  18. * oschool : Handles entering the college of larn
  19. * obank : Handles entering the bank of larn
  20. * obank2 : Handles entering the 8th branch of the bank of larn
  21. * ointerest : Calculates interest on bank accounts
  22. * item_value : Calculates the value of an item as per the trading post
  23. * otradepost : Handles entering the trading post.
  24. * olrs : Handles entering the Larn Revenue Service
  25. * opad : Handles enetering dealer McDope's pad.
  26. * ohome : Handes the player returning home.
  27. * write_store : Writes all shop data to the save file
  28. * read_store : Reads all shop data from the save file
  29. *
  30. * =============================================================================
  31. */
  32. #ifndef __STORE_H
  33. #define __STORE_H
  34. #include "itm.h"
  35. /* the tax rate for the LRS = 5% */
  36. #define TAXRATE (0.05)
  37. /* =============================================================================
  38. * FUNCTION: dndstore
  39. *
  40. * DESCRIPTION:
  41. * Function for handling entering the DND store.
  42. *
  43. * PARAMETERS:
  44. *
  45. * None.
  46. *
  47. * RETURN VALUE:
  48. *
  49. * None.
  50. */
  51. void dndstore(void);
  52. /* =============================================================================
  53. * FUNCTION: oschool
  54. *
  55. * DESCRIPTION:
  56. * Function for handling entering the college of larn.
  57. *
  58. * PARAMETERS:
  59. *
  60. * None.
  61. *
  62. * RETURN VALUE:
  63. *
  64. * None.
  65. */
  66. void oschool(void);
  67. /* =============================================================================
  68. * FUNCTION: obank
  69. *
  70. * DESCRIPTION:
  71. * Function for handling the bank of larn.
  72. *
  73. * PARAMETERS:
  74. *
  75. * None.
  76. *
  77. * RETURN VALUE:
  78. *
  79. * None.
  80. */
  81. void obank(void);
  82. /* =============================================================================
  83. * FUNCTION: obanks
  84. *
  85. * DESCRIPTION:
  86. * Function for handling the 8th branch of the bank of larn.
  87. *
  88. * PARAMETERS:
  89. *
  90. * None.
  91. *
  92. * RETURN VALUE:
  93. *
  94. * None.
  95. */
  96. void obank2(void);
  97. /* =============================================================================
  98. * FUNCTION: ointerest
  99. *
  100. * DESCRIPTION:
  101. * Function for calculating bank interest.
  102. * Updates the player's bank account for interest earned since the last call.
  103. *
  104. * PARAMETERS:
  105. *
  106. * None.
  107. *
  108. * RETURN VALUE:
  109. *
  110. * None.
  111. */
  112. void ointerest(void);
  113. /* =============================================================================
  114. * FUNCTION: item_value
  115. *
  116. * DESCRIPTION:
  117. * Function for calculating the calue of an item according to the trading post.
  118. *
  119. * PARAMETERS:
  120. *
  121. * it : The item to be valued
  122. *
  123. * itarg : The items arg (# plusses etc).
  124. *
  125. * RETURN VALUE:
  126. *
  127. * The value of the item in gold.
  128. */
  129. int item_value(int it, int itarg);
  130. /* =============================================================================
  131. * FUNCTION: otradepost
  132. *
  133. * DESCRIPTION:
  134. * Function for handling entering the trading post.
  135. *
  136. * PARAMETERS:
  137. *
  138. * None.
  139. *
  140. * RETURN VALUE:
  141. *
  142. * None.
  143. */
  144. void otradepost(void);
  145. /* =============================================================================
  146. * FUNCTION: olrs
  147. *
  148. * DESCRIPTION:
  149. * Function for handling entering the larn revenue service.
  150. *
  151. * PARAMETERS:
  152. *
  153. * None.
  154. *
  155. * RETURN VALUE:
  156. *
  157. * None.
  158. */
  159. void olrs(void);
  160. /* =============================================================================
  161. * FUNCTION: opad
  162. *
  163. * DESCRIPTION:
  164. * Function to handle entering dealer McDope's pad.
  165. *
  166. * PARAMETERS:
  167. *
  168. * None.
  169. *
  170. * RETURN VALUE:
  171. *
  172. * None.
  173. */
  174. void opad(void);
  175. /* =============================================================================
  176. * FUNCTION: ohome
  177. *
  178. * DESCRIPTION:
  179. * Function to handle the player returning home.
  180. *
  181. * PARAMETERS:
  182. *
  183. * None.
  184. *
  185. * RETURN VALUE:
  186. *
  187. * None.
  188. */
  189. void ohome(void);
  190. /* =============================================================================
  191. * FUNCTION: write_store
  192. *
  193. * DESCRIPTION:
  194. * Function to write the store data to the save file.
  195. *
  196. * PARAMETERS:
  197. *
  198. * fp : File pointer to the save file being written.
  199. *
  200. * RETURN VALUE:
  201. *
  202. * None.
  203. */
  204. void write_store(FILE *fp);
  205. /* =============================================================================
  206. * FUNCTION: read_store
  207. *
  208. * DESCRIPTION:
  209. * Function to read the store data from the save file.
  210. *
  211. * PARAMETERS:
  212. *
  213. * fp : Pointer to the save file being read.
  214. *
  215. * RETURN VALUE:
  216. *
  217. * None.
  218. */
  219. void read_store(FILE *fp);
  220. #endif