potion.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /* =============================================================================
  2. * PROGRAM: ularn
  3. * FILENAME: potion.h
  4. *
  5. * DESCRIPTION:
  6. * This module contains definitions and functions for handling potions.
  7. *
  8. * =============================================================================
  9. * EXPORTED VARIABLES
  10. *
  11. * potionname : The name of each potion
  12. *
  13. * =============================================================================
  14. * EXPORTED FUNCTIONS
  15. *
  16. * newpotion : Function to create a new potion with the required probabilities
  17. * quaffpotion : Function to process quaffing a potion.
  18. *
  19. * =============================================================================
  20. */
  21. #ifndef __POTION_H
  22. #define __POTION_H
  23. #define MAXPOTION 35 /* maximum number of potions that are possible */
  24. /*** Potions ***/
  25. #define PSLEEP 0
  26. #define PHEALING 1
  27. #define PRAISELEVEL 2
  28. #define PINCABILITY 3
  29. #define PWISDOM 4
  30. #define PSTRENGTH 5
  31. #define PCHARISMA 6
  32. #define PDIZZINESS 7
  33. #define PLEARNING 8
  34. #define PGOLDDET 9
  35. #define PMONSTDET 10
  36. #define PFORGETFUL 11
  37. #define PWATER 12
  38. #define PBLINDNESS 13
  39. #define PCONFUSION 14
  40. #define PHEROISM 15
  41. #define PSTURDINESS 16
  42. #define PGIANTSTR 17
  43. #define PFIRERESIST 18
  44. #define PTREASURE 19
  45. #define PINSTHEAL 20
  46. #define PCUREDIANTH 21
  47. #define PPOISON 22
  48. #define PSEEINVIS 23
  49. #define P_MAX 23 /* Greatest defined potion number */
  50. /*
  51. * The amount to boost ability scores for a potion of heroism
  52. */
  53. #define PHEROISM_BOOST 11
  54. /*
  55. * The amount to boos strength for apotion of giant strength
  56. */
  57. #define PGIANTSTR_BOOST 21
  58. /*
  59. * Names of all potions
  60. */
  61. extern char *potionname[MAXPOTION];
  62. /* =============================================================================
  63. * FUNCTION: newpotion
  64. *
  65. * DESCRIPTION:
  66. * Function return a potion # created with probability of occurrence
  67. *
  68. * PARAMETERS:
  69. *
  70. * None.
  71. *
  72. * RETURN VALUE:
  73. *
  74. * The potion number as defined above.
  75. */
  76. int newpotion(void);
  77. /* =============================================================================
  78. * FUNCTION: quaffpotion
  79. *
  80. * DESCRIPTION:
  81. * Function to handle the effects of drinking a potion.
  82. *
  83. * PARAMETERS:
  84. *
  85. * pot : The potion number.
  86. *
  87. * RETURN VALUE:
  88. *
  89. * None.
  90. */
  91. void quaffpotion(int pot);
  92. #endif