home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume2 / conquest / part05 / header.h < prev    next >
C/C++ Source or Header  |  1987-10-26  |  13KB  |  369 lines

  1. /*conquest is copyrighted 1986 by Ed Barlow.*/
  2. /*  MODIFICATION OF THIS FILE IMPLIES THAT THE MODIFIER WILL ACCEPT
  3.      A LIMITED USE COPYRIGHT AS FOLLOWS:
  4.  
  5.         1) This software is copyrighted and protected by law.  The
  6.         sole owner of this software, which hereafter is known as
  7.         "conquest" is Edward M. Barlow, who hereby grants you a 
  8.         personal, non-exclusive right to use this software.
  9.          2) conquest may not be redistributed in any form.  Any
  10.         requests for new software shall, for now, be the perogative
  11.         of the author.
  12.          3) loss or damage caused by this software shall not be
  13.         the responsibility of the author.
  14.         4) Ed Barlow shall be notified of modifications to this 
  15.         software via electronic mail (mhuxd!smile) and, if there
  16.         is no response, via US mail to:
  17.  
  18.             Ed Barlow
  19.             974 Delchester Rd
  20.             Newtown Sq. PA, 19073
  21.  
  22.         5) you agree to use your best efforts to see that any user
  23.         of conquest complies with the terms and conditions stated above.
  24. */
  25.  
  26. /*MODIFICATION IS REQUIRED OF THE FOLLOWING DEFINE STATEMENTS*/
  27.  
  28. /*file name definitions */
  29. #define EXEFILE        "/c03/smile/private/mygame/lib/.execute"
  30. #define DATAFILE     "/c03/smile/private/mygame/lib/.data"
  31. #define MSGFILE        "/c03/smile/private/mygame/lib/.messages"
  32. #define NPCSFILE     "/c03/smile/private/mygame/lib/.nations"
  33. #define HELPFILE     "/c03/smile/private/mygame/lib/.help"
  34. #define NEWSFILE     "/c03/smile/private/mygame/lib/.news"
  35.  
  36. #define OWNER    "Ed Barlow"    /*administrators name*/
  37.  
  38. /*MODIFICATION IS OPTIONAL ON THE FOLLOWING*/
  39. #define PWATER 55     /*percentage of water in the world*/
  40.  
  41. #define MAPX 48        /*Number of X Sectors on Map (divisible by 8 prefered)*/
  42.                         /*  if you change see MAXX and MAXY*/
  43. #define MAPY 48        /*Number of Y Sectors on Map (divisible by 8 prefered)*/
  44.                         /*  if you change see MAXX and MAXY*/
  45. /*the below three variables *must* be based on the above two*/
  46. /*MAXX=MAPX/8, MAXY=MAPY/8, NUMAREAS=MAXX*MAXY*/
  47. #define MAXX 6         /*Number of X areas on map*/
  48. #define MAXY 6            /*Number of Y areas on map*/ 
  49. #define NUMAREAS 36       /*total # areas, MAXX*MAXY*/
  50.  
  51. /*ALL THESE MUST BE COMMENTED OUT IF YOU WANT TO EXCLUDE THE C CODE*/
  52. #define LZARD 1        /*defined if lizard npc's exist at beginning*/
  53. #define MONSTER 1    /*defined if pirates/barbarians/nomads exist*/
  54. #define NPC 1        /*defined if non player country exists at beginning*/
  55. #define CMOVE 1        /*Comment this line out if you do not wish the computer
  56.               to move Player nations if they forget to move*/
  57. #define SYS5    1    /*comment this line out if on a BSD system*/
  58.             /*--not that it does anything at the moment*/
  59.  
  60. #define MAXNTN 28    /*number of nations (including unowned & npc ntns)*/
  61.             /*but not including pirates...*/
  62. #define NTOTAL        32 /*MAXNTN+4*/
  63. #define NLIZARD        28 /*MAXNTN+0*/
  64. #define NNOMAD        29 /*MAXNTN+1*/
  65. #define NBARBARIAN     30 /*MAXNTN+2*/
  66. #define NPIRATE        31 /*MAXNTN+3*/
  67.  
  68. #define LANDSEE 2    /*how far you can see on land, by armies, by navies*/
  69. #define NAVYSEE 1    /*making these numbers large takes CPU time*/
  70. #define ARMYSEE 2
  71.  
  72. /*Below taxation rates are in thousand dollars (US 1985) per 100 humans per 
  73.  *point of whatever -- ie 1 person in veg of 9 means produce $70x9=630K
  74.  *thousand dollars */
  75.  
  76. #define TAXDEFAULT    5555    /*percent taxes*/
  77. #define TAXFOOD        100
  78. #define TAXIRON        100
  79. #define TAXGOLD        100
  80. /*city and capital tax rates based on people only (no multipleier)*/
  81. #define TAXCAP        1000
  82. #define TAXCITY        750
  83.  
  84. #define SHIPMAINT     1000    /*ship mainatinance cost*/
  85. #define SOLDMAINT     40    /*soldier mainatinance cost*/
  86.  
  87. #define DESCOST        300    /*cost to redesignatie*/
  88.                 /*this is also the iron cost for cities*/
  89. #define FORTCOST    1000    /*cost to build a fort point*/
  90. #define ENLISTCOST     90    /*cost to enlist one troop*/
  91. #define WARSHPCOST     3000    /*cost to build one warship*/
  92. #define MERSHPCOST     2000    /*cost to build one merchant*/
  93.  
  94. #define SHIPHOLD      300    /*number of humans a ship can hold*/
  95.  
  96. #define MAXPTS        30     /*points to buy stuff with*/
  97. #define SECTSCORE     1    /*SECTSCORE points per sector*/
  98. #define CITYLIMIT     8    /*% of ntns people in sector before => city*/
  99.  
  100. #define MAXARM         32    /*maximum number of armies per nation*/
  101. #define MAXNAVY        16    /*maximum number of fleets per nation*/
  102. #define MILRATIO     5    /*ratio mil:civ for non player countries*/
  103. #define MILINCAP      5    /*ratio (mil in cap):mil for NPCs*/
  104.  
  105. #define JWL_MGK        100000L    /*jewels needed to use magic*/
  106. #define BRIBE        100000L    /*amount of gold to bribe one level*/
  107. #define IRONORE        7    /*iron per soldier needed for +1% weapons%/
  108.  
  109.  
  110. /*-----------------DO NOT ALTER BELOW THIS LINE-------------------*/
  111.  
  112. #include <curses.h>
  113. #define VERSION 1     /*version number of the game*/
  114. #define FLAT 1        /*1 if world is flat 0 if round*/
  115.  
  116. /*simple contour map definitions*/
  117. #define WATER     '~'
  118. #define PEAK     '#'    
  119. #define MOUNTAIN '^'
  120. #define HILL     '%'    
  121. #define CLEAR     '-'
  122.  
  123. /*racial types*/
  124. #define GOD     '-'
  125. #define ORC     'O'
  126. #define ELF     'E'
  127. #define DWARF     'D'
  128. #define LIZARD     'L'
  129. #define HUMAN     'H'
  130. #define PIRATE  'P'
  131. #define BARBARIAN 'B'
  132. #define NOMAD      'N'
  133. #define UNKNOWN '?'
  134.  
  135. /*designations*/
  136. #define DCITY        'c'
  137. #define DCAPITOL    'C'
  138. #define DMINE        'm'
  139. #define DFARM        'f'
  140. #define DDEVASTATED    'x'
  141. #define DGOLDMINE    '$'
  142. #define DCASTLE        '!'
  143. #define DNODESIG    '-'
  144.  
  145. #define GREAT    'G'
  146. #define FAIR    'F'
  147. #define RANDOM    'R'
  148. #define OOPS    'X'
  149.  
  150. /*vegitation types --  these are legal in designations too*/
  151. #define VOLCANO 'V'
  152. #define DESERT     'D'
  153. #define WASTE      'W'
  154. #define BARREN     '4'
  155. #define LT_VEG     '6'    
  156. #define GOOD     '9'
  157. #define WOOD     '7'
  158. #define FORREST '3'
  159. #define JUNGLE     'J'    
  160. #define SWAMP     'S'
  161. #define ICE     'I'    
  162. #define NONE     '~'
  163.  
  164. /*Diplomacy Variables*/
  165. #define JIHAD         7
  166. #define WAR         6
  167. #define HOSTILE        5
  168. #define NEUTRAL        4
  169. #define FRIENDLY    3
  170. #define ALLIED         2
  171. #define CONFEDERACY     1
  172. #define UNMET        0
  173.  
  174. /*army status*/
  175. # define MARCH         1    /*March */
  176. # define SCOUT        2    /*Scouting--will not engage enemy if possible*/
  177. # define ATTACK     3    /*Attack anybody (Hostile+) within 2 sectors*/
  178. # define DEFEND        4    /*Defend */
  179. # define GARRISON     5    /*Garrison--for a city or Capital*/
  180.  
  181.  
  182. struct s_sector
  183. {
  184.     char  designation;/*designation of sector*/
  185.     char  altitude;  /*sector altitude */
  186.     char  vegitation; /*sector vegitation  */
  187.     short owner;      /*nation id of owner, MAXNTN+? is SPECIAL*/
  188.     int   people;     /*civilians in sector*/
  189.     short gold;      /*gold production ability*/
  190.     short fortress;   /*fortification level (0 to 9)*/
  191.     short iron;      /*amount of iron produced by sector*/
  192. };
  193. #define XREAL     xcurs+xoffset
  194. #define YREAL     ycurs+yoffset
  195. #define SOWN     sct[xcurs+xoffset][ycurs+yoffset].owner
  196.  
  197. struct navy
  198. {
  199.     short warships;
  200.     short merchant;
  201.     short xloc;
  202.     short yloc;
  203.     short smove;
  204. };
  205.  
  206. struct army
  207. {
  208.     short xloc;
  209.     short yloc;
  210.     short smove;
  211.     short sold; 
  212.     short stat;
  213. };
  214.  
  215. struct     nation    /* player nation stats */
  216.         {
  217.         char   name[10];/* name */
  218.         char   passwd[8];/* password */
  219.         char   leader[10];/* leader title */
  220.         char   race;    /* national race (integer--see header.h)*/
  221.         short  class;    /* national class*/
  222. /*location could be easily changed out*/
  223.         char   location;/* location variable gfr */
  224.     char   mark;    /* unique mark for nation*/
  225.         short  capx;    /* capital x coord */
  226.         short  capy;    /* capital y coord */
  227.         short  active;    /* activity level of nation, but I am not sure if
  228.                 i have used this variable consistently:
  229.                  1 if PC NATION, 
  230.                 2+Aggressiveness if NPC, 
  231.                 0 if inactive,
  232.                 999 to represents MONSTER (pirate...)*/
  233.         short  aplus;    /* attack plus of all soldiers*/
  234.         short  dplus;    /* attack plus of all soldiers*/
  235.         short  maxmove;    /* maximum movement of soldiers*/
  236.         short  repro;    /* reproduction rate of nation*/
  237.         short  score;    /* score */
  238.         int    tgold;    /* gold in treasury */
  239.         int    jewels;    /* raw amount of gold in treasury */
  240.         int    tmil;    /* total military */
  241.         int    tciv;    /* total civilians */
  242.         int    tiron;    /* total real iron in nation*/
  243.         int    tfood;    /* total food in nation*/
  244.     long   powers;
  245.         short  tsctrs;    /* total number sectors */
  246.         short  tships;    /* number warships */
  247.     struct army arm[MAXARM];
  248.     struct navy nvy[MAXNAVY];
  249.     short  dstatus[MAXNTN+4];    /*diplomatic status*/
  250. };
  251.  
  252. #define AXLOC ntn[country].arm[armynum].xloc 
  253. #define AYLOC ntn[country].arm[armynum].yloc 
  254. #define AMOVE ntn[country].arm[armynum].smove 
  255. #define ASOLD ntn[country].arm[armynum].sold 
  256. #define ASTAT ntn[country].arm[armynum].stat 
  257. #define NWAR  ntn[country].nvy[nvynum].warships
  258. #define NMER  ntn[country].nvy[nvynum].merchant
  259. #define NXLOC ntn[country].nvy[nvynum].xloc 
  260. #define NYLOC ntn[country].nvy[nvynum].yloc 
  261. #define NMOVE ntn[country].nvy[nvynum].smove
  262.  
  263. extern struct s_sector sct[MAPX][MAPY];
  264. extern struct nation ntn[MAXNTN+4];
  265. extern short movecost[MAPX][MAPY];
  266.  
  267. /*Movement costs*/
  268. extern char *ele;
  269. extern char *veg;
  270. extern char *numbers;
  271. extern char *races[];
  272. extern char *Class[];
  273. extern char *vegname[];
  274. extern char *diploname[];
  275. extern char *soldname[];
  276.  
  277. #define AORN 0
  278. #define ARMY 1
  279. #define NAVY 2
  280.  
  281. #define XASTAT     1
  282. #define XAMEN     2
  283. #define XALOC     4
  284. #define XNLOC     5 
  285. #define XNASHP     6 
  286. #define XECNAME    8 
  287. #define XECPAS     9 
  288. #define XECMARK    10 
  289. #define XSADES     11 
  290. #define XSACIV     12 
  291. #define XSIFORT    13 
  292. #define XNAGOLD    14 
  293. #define XAMOV     15
  294. #define XNMOV     16 
  295. #define XSAOWN     17 
  296. #define EDADJ    18
  297. #define XNARGOLD 19
  298. #define XNAIRON 20
  299. #define INCAPLUS 22
  300. #define INCDPLUS 23
  301. #define CHG_MGK 24
  302.  
  303. #define CHGMGK fprintf(fexe,"MAGIC \t%d \t%hd \t%d \t%d \t0 \t%s\n",CHG_MGK,country,ntn[country].powers,x,"null")
  304. #define I_APLUS fprintf(fexe,"INC_APLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCAPLUS,country,"null")
  305. #define I_DPLUS fprintf(fexe,"INC_DPLUS \t%d \t%hd \t0 \t0 \t0 \t%s\n",INCDPLUS,country,"null")
  306. #define AADJSTAT fprintf(fexe,"A_STAT \t%d \t%hd \t%d \t%d \t0 \t%s\n",XASTAT,country,armynum,ntn[country].arm[armynum].stat,"null")
  307. #define AADJMEN  fprintf(fexe,"A_MEN \t%d \t%hd \t%d \t%d \t0 \t%s\n",XAMEN ,country,armynum,ntn[country].arm[armynum].sold,"null")
  308. #define NADJSHP  fprintf(fexe,"N_ASHP \t%d \t%hd \t%d \t%d \t%d \t%s\n",XNASHP ,country,nvynum,ntn[country].nvy[nvynum].merchant,ntn[country].nvy[nvynum].warships,"null" )
  309. #define AADJLOC  fprintf(fexe,"A_LOC \t%d \t%hd \t%d \t%d \t%d \t%s\n",XALOC ,country,armynum,ntn[country].arm[armynum].xloc,ntn[country].arm[armynum].yloc,"null")
  310. #define NADJLOC  fprintf(fexe,"N_LOC \t%d \t%hd \t%d \t%d \t%d \t%s\n",XNLOC ,country,nvynum,ntn[country].nvy[nvynum].xloc,ntn[country].nvy[nvynum].yloc ,"null")
  311. #define AADJMOV  fprintf(fexe,"A_MOV \t%d \t%hd \t%d \t%d \t0 \t%s\n",XAMOV ,country,armynum,ntn[country].arm[armynum].smove,"null")
  312. #define NADJMOV  fprintf(fexe,"N_MOV \t%d \t%hd \t%d \t%d \t0 \t%s\n",XNMOV ,country,nvynum,ntn[country].nvy[nvynum].smove,"null")
  313. #define ECHGNAME fprintf(fexe,"E_CNAME \t%d \t%hd \t0 \t0 \t0 \t%s\n",XECNAME ,country,ntn[country].name)
  314. #define ECHGPAS  fprintf(fexe,"E_CPAS \t%d \t%hd \t0 \t0 \t0 \t%s\n",XECPAS ,country,crypt(string,SALT))
  315. #define SADJDES  fprintf(fexe,"S_ADES \t%d \t%hd \t0 \t%d \t%d \t%c\n",XSADES ,country,xcurs+xoffset,ycurs+yoffset,sct[xcurs+xoffset][ycurs+yoffset].designation)
  316. #define SADJDES2  fprintf(fexe,"S_ADES \t%d \t%hd \t0 \t%d \t%d \t%c\n",XSADES ,country,x,y,sct[x][y].designation)
  317. #define SADJCIV2  fprintf(fexe,"S_ACIV \t%d \t%hd \t%d \t%d \t%d \t%s\n",XSACIV ,country,sct[i][j].people,i,j,"null")
  318. #define SADJCIV  fprintf(fexe,"S_ACIV \t%d \t%hd \t%d \t%d \t%d \t%s\n",XSACIV ,country,sct[xcurs+xoffset][ycurs+yoffset].people,xcurs+xoffset,ycurs+yoffset,"null")
  319. #define INCFORT fprintf(fexe,"SIFORT \t%d \t%hd \t0 \t%d \t%d \t%s\n",XSIFORT ,country,xcurs+xoffset,ycurs+yoffset,"null")
  320. #define SADJOWN  fprintf(fexe,"S_AOWN \t%d \t%hd \t0 \t%d \t%d \t%s\n",XSAOWN ,country,xcurs+xoffset,ycurs+yoffset,"null")
  321. #define EADJDIP  fprintf(fexe,"E_ADJ \t%d \t%hd \t%d \t%d \t0 \t%s\n",EDADJ,country,nation,ntn[country].dstatus[nation],"null")
  322.  
  323. #define    WARRIOR        2
  324. #define    CAPTAIN        3
  325. #define    WARLORD        5
  326. #define    MI_MONST    7
  327. #define    AV_MONST    11
  328. #define    MA_MONST    13
  329. #define    SPY        17
  330. #define    KNOWALL        19
  331. #define    DERVISH        23
  332. /*I CAN CHANGE DESTROYER TO NON PRIME NUMBER IN NEXT GAME*/
  333. #define    DESTROYER    29
  334. #define    HIDDEN        31
  335. #define    THE_VOID    37
  336. #define    ARCHITECT    41
  337. #define    VAMPIRE        43
  338. #define    HEALER        47
  339. #define MINER        53
  340. #define URBAN        59
  341. #define STEEL        61
  342. #define ARCHER        67
  343. #define CAVALRY        71
  344. #define BREEDER        73
  345. #define MAXPOWER    73    /*maximum power*/
  346.  
  347. #define NPCPOWERS    9    /*maximum number of powers for NPC*/
  348. #define PCPOWERS    5    /*maximum number of powers for PC */
  349.  
  350. /*my first macro: which will return 1 if the nation has that power*/
  351. #define magic(NATION,POWER)    !(ntn[NATION].powers%(POWER))  
  352.  
  353. #define beep()        putchar('')
  354.  
  355. #define FOODTHRESH 3
  356. #define GOLDTHRESH 10
  357. #define JEWELTHRESH 10
  358.     
  359. #define SALT "aa"
  360. #define PASSLTH 7
  361.  
  362. /*intialize subroutine types*/
  363. char *crypt();
  364. void exit();
  365. int rand();
  366.  
  367. extern char *strcpy(), *strncpy(), *strcat(), *strncat();
  368.  
  369.