scores.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: scores.h
  4. *
  5. * DESCRIPTION:
  6. * This modules contains functions to handle the scoreboard display and
  7. * update at the end of the game.
  8. *
  9. * =============================================================================
  10. * EXPORTED VARIABLES
  11. *
  12. * None.
  13. *
  14. * =============================================================================
  15. * EXPORTED FUNCTIONS
  16. *
  17. * makeboard : Create a new scoreboard (deleting the old one)
  18. * hashewon : Checks if the player has previously won.
  19. * paytaxes : Note the payment of taxes.
  20. * showscores : Display the scoreboard
  21. * showallscores : Show scores including inventories.
  22. * endgame : Game tidyup and exit function.
  23. * died : Function to handle player dying.
  24. *
  25. * =============================================================================
  26. */
  27. #ifndef __SCORES_H
  28. #define __SCORES_H
  29. /* max number of people on a scoreboard max */
  30. #define SCORESIZE 25
  31. /* Player died reasons */
  32. typedef enum {
  33. DIED_MONSTER,
  34. DIED_QUIT,
  35. DIED_SUSPENDED,
  36. DIED_SELF_ANNIHLATED,
  37. DIED_SHOT_BY_ARROW,
  38. DIED_HIT_BY_DART,
  39. DIED_FELL_INTO_PIT,
  40. DIED_FELL_INTO_BOTTOMLESS_PIT,
  41. DIED_WINNER,
  42. DIED_TRAPPED_IN_SOLID_ROCK,
  43. DIED_MISSING_SAVE_FILE,
  44. DIED_OLD_SAVE_FILE,
  45. DIED_GREEDY_CHEATER,
  46. DIED_PROTECTED_SAVE_FILE,
  47. DIED_KILLED_FAMILY,
  48. DIED_ERASED_BY_WAYWARD_FINGER,
  49. DIED_FELL_THROUGH_BOTTOMLESS_TRAPDOOR,
  50. DIED_FELL_THROUGH_TRAPDOOR,
  51. DIED_DRANK_POISONOUS_WATER,
  52. DIED_ELECTRIC_SHOCK,
  53. DIED_SLIPPED_VOLCANO_SHAFT,
  54. DIED_STUPIDITY,
  55. DIED_ATTACKED_BY_DEMON,
  56. DIED_OWN_MAGIC,
  57. DIED_UNSEEN_ATTACKER,
  58. DIED_DREADFUL_SLEEP,
  59. DIED_EXPLODING_CHEST,
  60. DIED_INTERNAL_COMPLICATIONS,
  61. DIED_SPHERE_ANNIHILATION,
  62. DIED_POST_MORTEM_DEATH,
  63. DIED_MALLOC_FAILURE,
  64. DIED_ANNOYED_GENIE,
  65. DIED_ELEVATOR_TO_HELL,
  66. DIED_QUICK_QUIT,
  67. DIED_COUNT
  68. } DiedReasonType;
  69. /* =============================================================================
  70. * FUNCTION: makeboard
  71. *
  72. * DESCRIPTION:
  73. * Function to create a new scoreboard (wipe out old one).
  74. *
  75. * PARAMETERS:
  76. *
  77. * None
  78. *
  79. * RETURN VALUE:
  80. *
  81. * -1 if unable to write the scoreboard,
  82. * 0 if all is OK
  83. */
  84. int makeboard(void);
  85. /* =============================================================================
  86. * FUNCTION: hashewon
  87. *
  88. * DESCRIPTION:
  89. * Checks if the player has previously won the game.
  90. * This function also sets c[HARDGAME] to appropriate value -- 0 if not a
  91. * winner, otherwise the next level of difficulty listed in the winners
  92. * scoreboard. This function also sets outstanding_taxes to the value in
  93. * the winners scoreboard.
  94. *
  95. * PARAMETERS:
  96. *
  97. * None.
  98. *
  99. * RETURN VALUE:
  100. *
  101. * 1 if player has won a game before, else 0
  102. */
  103. int hashewon(void);
  104. /* =============================================================================
  105. * FUNCTION: paytaxes
  106. *
  107. * DESCRIPTION:
  108. * Function to pay taxes if any are due.
  109. *
  110. * PARAMETERS:
  111. *
  112. * x : The amount of tax to pay.
  113. *
  114. * RETURN VALUE:
  115. *
  116. * The amount of tax actually paid.
  117. */
  118. long paytaxes(long x);
  119. /* =============================================================================
  120. * FUNCTION: showscores
  121. *
  122. * DESCRIPTION:
  123. * Function to show the scoreboard.
  124. *
  125. * PARAMETERS:
  126. *
  127. * None.
  128. *
  129. * RETURN VALUE:
  130. *
  131. * None.
  132. */
  133. void showscores(void);
  134. /* =============================================================================
  135. * FUNCTION: showallscores
  136. *
  137. * DESCRIPTION:
  138. * Function to show scores and the iven lists that go with them.
  139. *
  140. * PARAMETERS:
  141. *
  142. * None.
  143. *
  144. * RETURN VALUE:
  145. *
  146. * None.
  147. */
  148. void showallscores(void);
  149. /* =============================================================================
  150. * FUNCTION: endgame
  151. *
  152. * DESCRIPTION:
  153. * Call all tidyup procedures and exit the program.
  154. *
  155. * PARAMETERS:
  156. *
  157. * None.
  158. *
  159. * RETURN VALUE:
  160. *
  161. * None.
  162. */
  163. void endgame(void);
  164. /* =============================================================================
  165. * FUNCTION: died
  166. *
  167. * DESCRIPTION:
  168. * Routine to note player death and the reason.
  169. * Called for all end game conditions, including winning.
  170. *
  171. * PARAMETERS:
  172. *
  173. * Reason : The reason the player died
  174. *
  175. * Monster : The monster involved in the player's death (if any)
  176. *
  177. * RETURN VALUE:
  178. *
  179. * None.
  180. */
  181. void died(DiedReasonType Reason, int Monster);
  182. #endif