home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / games / saga / source / saga.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-08-03  |  8.5 KB  |  282 lines

  1. /* 1. KEYWORDS -----------------------------------------------------------
  2.  
  3. Defined by AmigaOS are: IMPORT, UBYTE, UWORD, ULONG.
  4.  
  5. AGLOBAL is considered obsolete; use of EXPORT is preferred. */
  6.  
  7. #define AUTO         auto    /* automatic (function-scope) */
  8. #define AGLOBAL              /* global (project-scope) */
  9. #define EXPORT               /* global (project-scope) */
  10. #define MODULE       static  /* external static (file-scope) */
  11. #define PERSIST      static  /* internal static (function-scope) */
  12. typedef signed char  FLAG;   /* 8-bit signed quantity (replaces BOOL) */
  13. typedef signed char  SBYTE;  /* 8-bit signed quantity (replaces Amiga BYTE) */
  14. typedef signed short SWORD;  /* 16-bit signed quantity (replaces Amiga WORD) */
  15. typedef signed long  SLONG;  /* 32-bit signed quantity (same as LONG) */
  16. #define elif         else if
  17.  
  18. // 2. DEFINES ------------------------------------------------------------
  19.  
  20. #define LEFTSIDE         0
  21. #define RIGHTSIDE        1
  22. #define MAXLINES        47
  23.  
  24. #define NONE             0
  25. #define HUMAN            1
  26. #define AMIGA            2
  27.  
  28. #define AMSIR            0
  29. #define EON              1
  30. #define GEOFU            2
  31. #define ING              3
  32. #define OGAL             4
  33. #define SYGIL            5
  34.  
  35. #define LAND             0
  36. #define SEA              1
  37. #define ISLE             2
  38. #define PENINSULA        3
  39.  
  40. #define BALMUNG         0
  41. #define DRAGVENDILL     1
  42. #define GRAM            2
  43. #define HRUNTING        3
  44. #define LOVI            4
  45. #define TYRFING         5
  46.  
  47. #define TURNS           20
  48.  
  49. #define RUNES            5
  50.  
  51. #define BROSUNGNECKLACE  0
  52. #define FREYFAXI         1
  53. #define MAGICSHIRT       2
  54. #define MAILCOAT         3
  55. #define HEALINGPOTION    4
  56. #define TELEPORTSCROLL   5
  57.  
  58. #define BEOWULF          0
  59. #define BRUNHILD         1
  60. #define EGIL             2
  61. #define RAGNAR           3
  62. #define SIEGFRIED        4
  63. #define STARKAD          5
  64.  
  65. #define MULTIKEYBOARD    0
  66. #define COUNTRY          1
  67. #define COUNTER          2
  68. #define ANYKEY           3
  69. #define YNKEYBOARD       4
  70. #define GLKEYBOARD       5
  71. #define WRKEYBOARD       6
  72.  
  73. #define ONEKEY_YES       0
  74. #define ONEKEY_NO        1
  75. #define ONEKEY_WITHDRAW  2
  76. #define ONEKEY_RESTART   3
  77. #define ONEKEY_TRANSFER  4
  78. #define ONEKEY_GLORY     5
  79. #define ONEKEY_LUCK      6
  80. #define ONEKEYS          ONEKEY_LUCK
  81.  
  82. #define FREY             0
  83. #define LOKI             1
  84. #define NJORD            2
  85. #define ODIN             3
  86. #define THOR             4
  87. #define TYR              5
  88.  
  89. #define UPPER            0
  90. #define LOWER            1
  91.  
  92. #define COUNTERWIDTH     2 // in words (24 pixels, rounded up)
  93. #define COUNTERHEIGHT   24 // in pixels
  94. #define DEPTH            7 // in bitplanes
  95. #define CONNECTIONS      7
  96. #define TBSIZE          11
  97.  
  98. // double buffering subsystem
  99. #define OK_REDRAW        1
  100. #define OK_SWAPIN        2
  101.  
  102. // types of things
  103. #define HERO       0
  104. #define JARL       1
  105. #define MONSTER    2
  106. #define TREASURE   3
  107. #define SORD       4
  108. #define KINGDOM    5
  109.  
  110. // quantities of things, counting from 0
  111. #define HEROES     5
  112. #define JARLS     17
  113. // @@: #define MONSTERS  26
  114. #define MONSTERS  30
  115. #define SORDS      5
  116. // @@: #define TREASURES  3
  117. #define TREASURES  5
  118.  
  119. #define FACEUP     0
  120. #define FACEDOWN   1
  121.  
  122. #define SCREENXPIXEL 640
  123. #define SCREENYPIXEL 512
  124. #define ABOUTXPIXEL  312
  125. #define ABOUTYPIXEL   76
  126.  
  127. #define SLOTS      (HEROES + 1 + JARLS + 1 + MONSTERS + 1 + TREASURES + 1 + SORDS + 1 - 1)
  128. #define ATTACKS    (HEROES + 1 + JARLS + 1 + MONSTERS + 1 + 36)
  129.  
  130. // 3. GLOBAL FUNCTIONS ---------------------------------------------------
  131.  
  132. // from system.c
  133. AGLOBAL void cleanexit(SLONG rc);
  134. AGLOBAL void screenoff(void);
  135. AGLOBAL void screenon(void);
  136. AGLOBAL void darken(void);
  137. AGLOBAL void say(SLONG position);
  138. AGLOBAL void hint(STRPTR thehint1, STRPTR thehint2);
  139. AGLOBAL SLONG getevent(SLONG mode, SLONG* countertype);
  140.  
  141. // from map1.c
  142. AGLOBAL void drawmap(void);
  143.  
  144. // from map2.c
  145. AGLOBAL void drawmap2(void);
  146.  
  147. // from gfx.c
  148. AGLOBAL void drawabout(void);
  149. AGLOBAL void drawlogo(void);
  150. AGLOBAL void boingball(void);
  151. AGLOBAL void unboingball(void);
  152. AGLOBAL void preboingball(void);
  153. AGLOBAL void DrawGels(void);
  154. AGLOBAL WORD bounceORoutine(struct AnimOb *anOb);
  155. /* This is an oroutine so parameters are fixed;
  156. it needs global exposure as it is called directly by AmigaDOS. */
  157.  
  158. // from engine.c
  159. AGLOBAL void place_monsters(void);
  160. AGLOBAL void showcountry(SLONG country);
  161. AGLOBAL void withdraw(SLONG whichhero);
  162. AGLOBAL void phase1(void);
  163. AGLOBAL void phase2(void);
  164. AGLOBAL void phase3(void);
  165. AGLOBAL void saywho(SLONG countertype, SLONG counter, FLAG comma, FLAG lowercase);
  166. AGLOBAL void place_jarls(void);
  167. AGLOBAL void print_paralyzed(SLONG paralyzed_value, SLONG index);
  168. AGLOBAL void print_location(SLONG whichcountry, SLONG index);
  169. AGLOBAL void print_sea(SLONG sea_value, SLONG index);
  170. AGLOBAL void print_hagall(SLONG hagall_value, SLONG index);
  171. AGLOBAL void print_routed(SLONG routed_value, SLONG index);
  172. AGLOBAL void promote(SLONG whichhero, SLONG whichjarl);
  173. AGLOBAL SLONG getusualmoves(SLONG countertype, SLONG whichcounter);
  174. AGLOBAL void faxi_disappear(void);
  175. AGLOBAL void pad(STRPTR thestring);
  176. AGLOBAL SLONG getstrength(SLONG countertype, SLONG counter, FLAG defending);
  177. AGLOBAL void newhero(SLONG whichhero, FLAG givesord);
  178. AGLOBAL void anykey(void);
  179. AGLOBAL void treasure_disappear(SLONG whichtreasure);
  180.  
  181. // from counters.c
  182. AGLOBAL void init_counters(void);
  183. AGLOBAL void move_hero(SLONG whichhero, FLAG display);
  184. AGLOBAL void move_jarl(SLONG whichjarl, FLAG display);
  185. AGLOBAL void move_monster(SLONG whichmonster, FLAG display);
  186. AGLOBAL void move_treasure(SLONG whichtreasure, FLAG display);
  187. AGLOBAL void move_sord(SLONG whichsord, FLAG display);
  188. AGLOBAL void createcounters(void);
  189. AGLOBAL void destroycounters(void);
  190. AGLOBAL void revealjarl(SLONG whichjarl, FLAG display);
  191. AGLOBAL void hidejarl(SLONG whichjarl, FLAG display);
  192. AGLOBAL void unslot_hero(SLONG whichhero);
  193. AGLOBAL void unslot_jarl(SLONG whichjarl);
  194. AGLOBAL void unslot_monster(SLONG whichmonster);
  195. AGLOBAL void unslot_treasure(SLONG whichtreasure);
  196. AGLOBAL void unslot_sord(SLONG whichsord);
  197. AGLOBAL SLONG checkcounters(SWORD mousex, SWORD mousey, SLONG* countertype);
  198. AGLOBAL void select_hero(SLONG whichhero, FLAG display);
  199. AGLOBAL void deselect_hero(SLONG whichhero, FLAG display);
  200. AGLOBAL void select_jarl(SLONG whichjarl, FLAG display);
  201. AGLOBAL void deselect_jarl(SLONG whichjarl, FLAG display);
  202. AGLOBAL void select_monster(SLONG whichmonster, FLAG display);
  203. AGLOBAL void deselect_monster(SLONG whichmonster, FLAG display);
  204. AGLOBAL void remove_hero(SLONG whichhero, FLAG display);
  205. AGLOBAL void remove_jarl(SLONG whichjarl, FLAG display);
  206. AGLOBAL void remove_monster(SLONG whichmonster, FLAG display);
  207. AGLOBAL void remove_treasure(SLONG whichtreasure, FLAG display);
  208. AGLOBAL void remove_sord(SLONG whichsord, FLAG display);
  209. AGLOBAL void refreshcounters(void);
  210. AGLOBAL void reset_images(void);
  211. AGLOBAL void hero_to_jarl(SLONG whichhero, SLONG whichjarl);
  212. AGLOBAL void info(SLONG countertype, SLONG counter);
  213. AGLOBAL void doc(SLONG number);
  214.  
  215. // 4. GLOBAL STRUCTURES --------------------------------------------------
  216.  
  217. AGLOBAL struct WorldStruct
  218. {   // initialized
  219.  
  220.     SLONG  centrex, centrey, tax, type;
  221.     STRPTR name;
  222.     SLONG  connection[CONNECTIONS + 1];
  223.  
  224.     // uninitialized
  225.     SLONG  hero;
  226.     FLAG   is, slot[SLOTS + 1], visited;
  227. };
  228. AGLOBAL struct RuneStruct
  229. {   STRPTR name, desc;
  230. };
  231. AGLOBAL struct HeroStruct
  232. {   // all uninitialized
  233.  
  234.     STRPTR name;
  235.     SLONG  strength, moves, glory, luck, control, sword, where, homewhere,
  236.            wealth, slot, promoted, rune, god, sea, maidens;
  237.     FLAG   alive, verydead, wounded, foundbob, moved, loseturn, hagall,
  238.            routed, attacking, defending;
  239.     SLONG  attacked[ATTACKS + 1], attacktype[ATTACKS + 1];
  240. };
  241. AGLOBAL struct JarlStruct
  242. {   // initialized
  243.     SLONG  strength,
  244.            moves;
  245.     STRPTR name;
  246.  
  247.     // uninitialized
  248.     FLAG   taken, alive, foundbob, recruitable, loseturn, hagall, routed,
  249.            attacking, defending;
  250.     SLONG  where, homewhere, wealth, face, hero, slot, sea,
  251.            attacked[ATTACKS + 1], attacktype[ATTACKS + 1];
  252. };
  253. AGLOBAL struct MonsterStruct
  254. {   // initialized
  255.     SLONG  species, strength, moves;
  256.     STRPTR name;
  257.  
  258.     // uninitialized
  259.     FLAG   taken, alive, foundbob, hagall;
  260.     SLONG  where, slot, wealth, sea;
  261. };
  262. AGLOBAL struct TreasureStruct
  263. {   // initialized
  264.     STRPTR name;
  265.     SWORD  y;
  266.  
  267.     // uninitialized
  268.     SLONG  possessor, possessortype;
  269.     FLAG   taken, foundbob;
  270.     SLONG  where, slot;
  271. };
  272. AGLOBAL struct SordStruct
  273. {   // initialized
  274.     STRPTR name;
  275.     SWORD  y;
  276.  
  277.     // uninitialized
  278.     SLONG  possessor, possessortype;
  279.     FLAG   taken, foundbob;
  280.     SLONG  where, slot;
  281. };
  282.