home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch3b < prev    next >
Encoding:
Internet Message Format  |  1989-07-20  |  57.7 KB

  1. Path: uunet!zephyr!tektronix!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v07i053:  conquer4 - middle earth multi-player game (V4), Patch3b
  5. Message-ID: <4292@tekred.CNA.TEK.COM>
  6. Date: 19 Jul 89 17:56:53 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1863
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@bu-cs.bu.edu>
  12. Posting-number: Volume 7, Issue 53
  13. Archive-name: conquer4/Patch3b
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16.  
  17.  
  18. #!/bin/sh
  19. # this is part 2 of a multipart archive
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file oMakefile continued
  22. #
  23. CurArch=2
  24. if test ! -r s2_seq_.tmp
  25. then echo "Please unpack part 1 first!"
  26.      exit 1; fi
  27. ( read Scheck
  28.   if test "$Scheck" != $CurArch
  29.   then echo "Please unpack part $Scheck next!"
  30.        exit 1;
  31.   else exit 0; fi
  32. ) < s2_seq_.tmp || exit 1
  33. sed 's/^X//' << 'SHAR_EOF' >> oMakefile
  34. X    $(CC) $(CFLAGS) -DADMIN -c data.c
  35. X    mv data.o dataA.o
  36. Xdisplay.o:    data.h header.h display.c
  37. X    $(CC) $(CFLAGS) -DCONQUER -c display.c
  38. Xreports.o:    data.h header.h reports.c
  39. X    $(CC) $(CFLAGS) -DCONQUER -c reports.c
  40. Xmove.o:    data.h header.h move.c
  41. X    $(CC) $(CFLAGS) -DCONQUER -c move.c
  42. Xmain.o:    data.h header.h main.c
  43. X    $(CC) $(CFLAGS) -DCONQUER -c main.c
  44. Xforms.o:    data.h header.h forms.c
  45. X    $(CC) $(CFLAGS) -DCONQUER -c forms.c
  46. Xcommands.o:    data.h header.h commands.c
  47. X    $(CC) $(CFLAGS) -DCONQUER -c commands.c
  48. Xcheck.o:    data.h header.h check.c
  49. X    $(CC) $(CFLAGS) -c check.c
  50. Xtrade.o:    data.h header.h trade.c
  51. X    $(CC) $(CFLAGS) -DCONQUER -c trade.c
  52. XtradeA.o:    data.h header.h trade.c
  53. X    $(CC) $(CFLAGS) -DADMIN -c trade.c
  54. X    mv trade.o tradeA.o
  55. XnavyA.o:    data.h header.h navy.c
  56. X    $(CC) $(CFLAGS) -DADMIN -c navy.c
  57. X    mv navy.o navyA.o
  58. Xnavy.o:    data.h header.h trade.c
  59. X    $(CC) $(CFLAGS) -DCONQUER -c navy.c
  60. Xnewhelp:    data.o header.h data.h newhelp.c
  61. X    @echo Compiling the help program
  62. X    $(CC) $(CFLAGS) newhelp.c data.o -o newhelp
  63. SHAR_EOF
  64. chmod 0644 oMakefile || echo "restore of oMakefile fails"
  65. sed 's/^X//' << 'SHAR_EOF' > patchV4.03 &&
  66. X*** opatchlevel.h    Tue Jul 18 22:04:44 1989
  67. X--- patchlevel.h    Tue Jul 18 22:04:54 1989
  68. X***************
  69. X*** 1 ****
  70. X! #define PATCHLEVEL    2
  71. X--- 1 ----
  72. X! #define PATCHLEVEL    3
  73. X*** onotes.v4    Tue Jul 18 22:04:43 1989
  74. X--- notes.v4    Tue Jul 18 22:04:54 1989
  75. X***************
  76. X*** 1,10 ****
  77. X  ------------------------------------------------------------------------------
  78. X  | THIS FILE CONTAINS RELEASE NOTES FOR CONQUER V4.0                  |
  79. X  | It is broken into 3 sections.  Section 3 reflects changes from v3.5 to v4. |
  80. X! | Section 1 reflects bugs in v4.0.  Section 2 reflects. Future ideas.        |
  81. X  ------------------------------------------------------------------------------
  82. X  -------------------------------------------------------------------------
  83. X! | == Bugs Fixed From Conquer Version 4.0 ============================== |
  84. X  -------------------------------------------------------------------------
  85. X    1. increased newstring[] array from 40 to 100 in makeworl.c.
  86. X    2. corrected a mispelling of irrigation.
  87. X--- 1,10 ----
  88. X  ------------------------------------------------------------------------------
  89. X  | THIS FILE CONTAINS RELEASE NOTES FOR CONQUER V4.0                  |
  90. X  | It is broken into 3 sections.  Section 3 reflects changes from v3.5 to v4. |
  91. X! | Section 1 reflects bugs in v4.0.  Section 2 reflects future ideas.         |
  92. X  ------------------------------------------------------------------------------
  93. X  -------------------------------------------------------------------------
  94. X! | 1.0 == Bugs Fixed From Conquer Version 4.0 ========================== |
  95. X  -------------------------------------------------------------------------
  96. X    1. increased newstring[] array from 40 to 100 in makeworl.c.
  97. X    2. corrected a mispelling of irrigation.
  98. X***************
  99. X*** 40,48 ****
  100. X   27. added more names to rebel name list.
  101. X   28. worked on Makefile.  [made sure of parallelism; ready to distribute]
  102. X   29. reworded treasury display on budget screen for clarity.
  103. X  
  104. X  -------------------------------------------------------------------------
  105. X! | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4        |
  106. X  -------------------------------------------------------------------------
  107. X  o make land capture only occur during update.
  108. X  o make the create world routine interactive with curses display.
  109. X--- 40,110 ----
  110. X   27. added more names to rebel name list.
  111. X   28. worked on Makefile.  [made sure of parallelism; ready to distribute]
  112. X   29. reworded treasury display on budget screen for clarity.
  113. X+ ===4.0 patch number two released => 4.2 ==========================
  114. X+  30. worked more on Makefile.  trying to fix others problems with .SUFFIXES.
  115. X+  31. line 142 of commands.c:  fixed bug with assignment of designation.
  116. X+  32. main.c: added environment variable CONQ_NATION.  overridden by '-n'.
  117. X+  33. main.c: added environment variable CONQ_DATA. overridden by '-d'.
  118. X+  34. patch to magic.c to extend printable user magics.  [Bob Earl].
  119. X+  35. added BIGLTH, and FILELTH character string size constants.
  120. X+  36. made NPC a number as with MONSTER.
  121. X+  37. added new option '-G' for gaudy news country highlights.  [T. Kivinen].
  122. X+  38. fixed bug with clearing WAR declarations in destroy. [T. Kivinen].
  123. X+  39. Added a CONQ_OPTS environment variable... can contain many options.
  124. X+     Format:   setenv CONQ_OPTS "G,nation=foo,data=1"
  125. X+     so far only G (Gaudy News), nation, and data supported, may now
  126. X+     remove the redundant CONQ_NATION, CONQ_DATA.
  127. X+  40. patched newlogin.c to fix check of new nation name [Bob Earl].
  128. X+  41. added LOCKF portion to FILELOCK for NFS systems [Richard Caley].
  129. X+  42. added routine to print designations with '-p' [Richard Caley].
  130. X+  43. added variations on 'data' or 'nation' to CONQ_OPTS (ex. 'name').
  131. X+  44. NEAT NEW FEATURE!  DEMI-GOD! Now, ntn[0].leader holds the login name
  132. X+     of a user who has update and god priveledge on that data file.
  133. X+     It is set during world creation and changable from the 'c' command
  134. X+     during the game.  ['c' for nation '0' to view name].
  135. X+     This allows people to run their own games without owning conquer.
  136. X+  45. Neatened the nation mark selection display in newlogin.c.
  137. X+  46. Decided to remove default setting of nation mark.... always ask now.
  138. X+  47. Fixed bugs in newlogin: 'points <= 0' where it should be 'temp <= 0'.
  139. X+  48. Shortened name of monsters to 7 characters to prevent screen wrap.
  140. X+  49. newlogin.c (916): decreased amount allocated for population dispersal.
  141. X+  50. added command to select prior unit ['o'] like 'p' [Kianush Sayah-Karadji].
  142. X+  51. extcmds.c (174,178) fix to allow switching out of march.  [Kevin Murray].
  143. X+  52. added a #define XENIX for some XENIX 386 specific bugs. [Jonathan Bayer].
  144. X+  53. reworked the make new_game in the Makefile.
  145. X+  54. fixed the calculation of available nations in the campaign info screen.
  146. X+  55. made slight adjustment to required wealth for gold mines.
  147. X+  56. big redo on the Makefile.  hopefully this is now static.
  148. X+  57. completed change of Barbarians to Savages.  Only makeworl.c vars now.
  149. X+  58. removed the CONQ_DATA and CONQ_NATION environment variables since
  150. X+     the CONQ_OPTS covers them and can even be expanded more later.
  151. X+  59. big revamp of the helpfiles.  caught a few errors.
  152. X+  60. added ntn[0].leader to the 'please contact' messages in admin and main.
  153. X+  61. added monsters and peasants to the '-s' display.  [Doesn't show size].
  154. X+  62. changed get_number() to return -1 for no input... fixed all occurances.
  155. X+  63. reinstated ship and food trading.  NOTE!!! Nothing has really been
  156. X+     done to fix it... use at own risk.  Perhaps someone will find the
  157. X+     bugs and fix them. [these trading routines are only temp anyway.]
  158. X+  64. added CONQ_OPTS to admin.c, ignore everything but "datadir=".
  159. X+  65. spent ENTIRE weekend and rewrote newlogin.c.  NEW NEWLOGIN HAS:
  160. X+     - curses screen interface.
  161. X+     - entire input is character by character.
  162. X+     - nice sliding arrow menu selection for final menu.
  163. X+     - may add or subtract from final menu.
  164. X+     - information on each selection is available via '?'.
  165. X+     - move up and down via 'hjkl', 'DEL', or 'RET'.
  166. X+     - in order to weaken orc population a little, set max repro.
  167. X+       during nation build to 12.  [May still reach 14 through magic].
  168. X+     - almost all selections are handled in the same manor, this.
  169. X+       allows for easier debugging and better code.
  170. X+     - the following routines will be available for a future makeworld.
  171. X+       interface:  newinit(), newbye(), newmsg(), newerror(), newreset().
  172. X+  66. rewrote all routines that were called during a newlogin so that print
  173. X+     statments use the newerror() or newmsg() interface.
  174. X+ ===4.0 patch number three released => 4.3 ==========================
  175. X  
  176. X  -------------------------------------------------------------------------
  177. X! | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4             |
  178. X  -------------------------------------------------------------------------
  179. X  o make land capture only occur during update.
  180. X  o make the create world routine interactive with curses display.
  181. X***************
  182. X*** 66,72 ****
  183. X  o provide a way for displaying monster nations properly... must also assure
  184. X      accurate information in tmil and tciv.
  185. X  --------------------------------------------------------------------------
  186. X! | 2) The Following are Good Ideas, But are not going to be done soon     |
  187. X  --------------------------------------------------------------------------
  188. X  o Ruling leaders can ruthlesly supress revolts... 
  189. X  
  190. X--- 128,134 ----
  191. X  o provide a way for displaying monster nations properly... must also assure
  192. X      accurate information in tmil and tciv.
  193. X  --------------------------------------------------------------------------
  194. X! | 2.5 The Following are Good Ideas, But are not going to be done soon     |
  195. X  --------------------------------------------------------------------------
  196. X  o Ruling leaders can ruthlesly supress revolts... 
  197. X  
  198. X***************
  199. X*** 180,186 ****
  200. X      percent less).  
  201. X  
  202. X  -----------------------------------------------------------------
  203. X! | 3) Release notes for V4.0.  Changes from v3.5            |
  204. X  -----------------------------------------------------------------
  205. X  1) gave god NINJA power to see troops on the map
  206. X  2) fixed message bug (printed blanks).
  207. X--- 242,248 ----
  208. X      percent less).  
  209. X  
  210. X  -----------------------------------------------------------------
  211. X! | 3.0 Release notes for V4.0.  Changes from v3.5        |
  212. X  -----------------------------------------------------------------
  213. X  1) gave god NINJA power to see troops on the map
  214. X  2) fixed message bug (printed blanks).
  215. X*** header.h.orig    Wed Jul 12 06:47:18 1989
  216. X--- header.h    Wed Jul 19 10:48:54 1989
  217. X***************
  218. X*** 42,54 ****
  219. X  #define SYSV        /* uncomment this line on a UNIX SYSV machine    */
  220. X  /* #define BSD        /* uncomment this line on a BSD machine        */
  221. X  /* #define HPUX        /* uncomment for HP-UNIX            */
  222. X  /* #define SYSMAIL    /* if your system supports mail            */
  223. X              /* conquer will notify you about system mail    */
  224. X  
  225. X! /* -------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-------------    */
  226. X  #define SPOOLDIR "/usr/spool/mail"    /* location of mail spool    */
  227. X  /* #define FILELOCK    /* if your system supports BSD flock()        */
  228. X              /* other file locking is not well implemented    */
  229. X  #define TIMELOG    /* if your system has the date command        */
  230. X  
  231. X  #define NTOTAL 25    /* max # of nations ( player + npc + monster )    */
  232. X--- 42,56 ----
  233. X  #define SYSV        /* uncomment this line on a UNIX SYSV machine    */
  234. X  /* #define BSD        /* uncomment this line on a BSD machine        */
  235. X  /* #define HPUX        /* uncomment for HP-UNIX            */
  236. X+ /*#define XENIX               /* this plus SYSV for XENIX machines, untested  */
  237. X  /* #define SYSMAIL    /* if your system supports mail            */
  238. X              /* conquer will notify you about system mail    */
  239. X  
  240. X! /* -------------------MODIFICATION IS OPTIONAL ON THE FOLLOWING-----------*/
  241. X  #define SPOOLDIR "/usr/spool/mail"    /* location of mail spool    */
  242. X  /* #define FILELOCK    /* if your system supports BSD flock()        */
  243. X              /* other file locking is not well implemented    */
  244. X+ /*#define LOCKF               /* in addition to FILELOCK if you have lockf    */
  245. X  #define TIMELOG    /* if your system has the date command        */
  246. X  
  247. X  #define NTOTAL 25    /* max # of nations ( player + npc + monster )    */
  248. X***************
  249. X*** 66,79 ****
  250. X  #define JEWELPCT 33    /* percent of tradegoods that are luxury items    */
  251. X  #define HIDELOC        /* defined if news is not to report sectors    */
  252. X  
  253. X! #define OGOD        /* defined if you wish to enhance god powers.  This
  254. X!                should not be defined on the pc as there is no
  255. X!                /etc/passwd file to read info from        */
  256. X  
  257. X  #define DERVDESG    /* allow DERVISH to redesignate in a DESERT/ICE    */
  258. X! #define MONSTER    45    /* defined if pirates/barbarians/nomads/lzard exist.
  259. X                 represents # of sectors of land that need to be
  260. X!                in world per pirate/barbarian/nomad nation    */
  261. X  #define CHEAT        /* npcs will cheat to keep up - this is a very weak
  262. X                 form of cheating.  I use good npc algorithms 
  263. X                 (i think... comments)            */
  264. X--- 68,82 ----
  265. X  #define JEWELPCT 33    /* percent of tradegoods that are luxury items    */
  266. X  #define HIDELOC        /* defined if news is not to report sectors    */
  267. X  
  268. X! #define OGOD        /* defined if you wish to enhance god powers.   */
  269. X  
  270. X  #define DERVDESG    /* allow DERVISH to redesignate in a DESERT/ICE    */
  271. X! #define MONSTER    45    /* defined if pirates/savages/nomads/lzard exist.
  272. X                 represents # of sectors of land that need to be
  273. X!                in world per pirate/savage/nomad nation    */
  274. X! #define NPC    45    /* defined if NPC nations should exist. The numeric
  275. X!                represents # of sectors of land that need to be
  276. X!                in world per non-player character nation    */
  277. X  #define CHEAT        /* npcs will cheat to keep up - this is a very weak
  278. X                 form of cheating.  I use good npc algorithms 
  279. X                 (i think... comments)            */
  280. X***************
  281. X*** 87,94 ****
  282. X  #define PMOUNT 40    /* % of land that is mountains            */
  283. X  #define PSTORM 3    /* % chance that a storm will strike a fleet    */
  284. X              /* unless it is in harbor            */
  285. X! #define NPC        /* defined if non player country exists at start*/
  286. X! #define CMOVE        /* Defined if you wish the computer to move
  287. X                 for Player nations if they forget to move    */
  288. X  #define BEEP        /* defined if you wish terminal to beep        */
  289. X  #define HILIGHT        /* defined if terminals support inverse video    */
  290. X--- 90,96 ----
  291. X  #define PMOUNT 40    /* % of land that is mountains            */
  292. X  #define PSTORM 3    /* % chance that a storm will strike a fleet    */
  293. X              /* unless it is in harbor            */
  294. X! #define CMOVE        /* #ifdef NPC; defined for the computer to move
  295. X                 for Player nations if they forget to move    */
  296. X  #define BEEP        /* defined if you wish terminal to beep        */
  297. X  #define HILIGHT        /* defined if terminals support inverse video    */
  298. X***************
  299. X*** 100,106 ****
  300. X              /* a turn is 1 season and 25% is a large value    */
  301. X  #define    SPEW        /* spew random messages from npcs         */
  302. X  
  303. X! /* ---BELOW THIS POINT ARE PARAMETERS YOU MIGHT OPTIONALLY WISH TO CHANGE---    */
  304. X  
  305. X  /* making these numbers large takes more CPU time            */
  306. X  #define LANDSEE 2    /* how far you can see from your land        */
  307. X--- 102,108 ----
  308. X              /* a turn is 1 season and 25% is a large value    */
  309. X  #define    SPEW        /* spew random messages from npcs         */
  310. X  
  311. X! /* -BELOW THIS POINT ARE PARAMETERS YOU MIGHT OPTIONALLY WISH TO CHANGE-*/
  312. X  
  313. X  /* making these numbers large takes more CPU time            */
  314. X  #define LANDSEE 2    /* how far you can see from your land        */
  315. X*** odata.h    Tue Jul 18 22:04:40 1989
  316. X--- data.h    Tue Jul 18 22:04:55 1989
  317. X***************
  318. X*** 21,31 ****
  319. X  #define    SCREEN_X_SIZE    (( COLS - 21) / 2)    /* divide by two as only 1/2 
  320. X                             sectors will be shown */
  321. X  #define    SCREEN_Y_SIZE    ( LINES - 5 )
  322. X! #define HAS_SEEN(x,y)    hasseen[(x)+((y)*((COLS-10)/2))]
  323. X! #define    PASSLTH        7    /*one less than the characters in the password*/
  324. X! #define    NAMELTH        9    /*one less than the characters in the name*/
  325. X! #define    LEADERLTH    9    /*one less than the characters in the leader*/
  326. X  
  327. X  /*simple contour map definitions*/
  328. X  #define    WATER        (*(ele+0))
  329. X  #define    PEAK        (*(ele+1))
  330. X--- 21,38 ----
  331. X  #define    SCREEN_X_SIZE    (( COLS - 21) / 2)    /* divide by two as only 1/2 
  332. X                             sectors will be shown */
  333. X  #define    SCREEN_Y_SIZE    ( LINES - 5 )
  334. X! #define    HAS_SEEN(x,y)    hasseen[(x)+((y)*((COLS-10)/2))]
  335. X! #define    PASSLTH        7    /* the number of characters in the passwd*/
  336. X! #define    NAMELTH        9    /* the number of characters in the name*/
  337. X! #define    LEADERLTH    9    /* the number of characters in the leader*/
  338. X! #define    FILELTH        80    /*length for filename holders*/
  339. X! #define    LINELTH        80    /*length for input string lines*/
  340. X! #define    BIGLTH        256    /*length for large storage strings*/
  341. X! #define    NUMCLASS    11    /*number of nation classes */
  342. X  
  343. X+ /* environment variable strings to check */
  344. X+ #define    ENVIRON_OPTS    "CONQ_OPTS"
  345. X+ 
  346. X  /*simple contour map definitions*/
  347. X  #define    WATER        (*(ele+0))
  348. X  #define    PEAK        (*(ele+1))
  349. X***************
  350. X*** 41,47 ****
  351. X  #define    LIZARD        'L'
  352. X  #define    HUMAN        'H'
  353. X  #define    PIRATE        'P'
  354. X! #define    BARBARIAN    'B'
  355. X  #define    NOMAD        'N'
  356. X  #define    TUNKNOWN    '?'
  357. X  
  358. X--- 48,54 ----
  359. X  #define    LIZARD        'L'
  360. X  #define    HUMAN        'H'
  361. X  #define    PIRATE        'P'
  362. X! #define    SAVAGE        'S'
  363. X  #define    NOMAD        'N'
  364. X  #define    TUNKNOWN    '?'
  365. X  
  366. X***************
  367. X*** 236,242 ****
  368. X  #define NPC_PIRATE    18
  369. X  #define NPC_LIZARD    19
  370. X  #define NPC_NOMAD    20
  371. X! #define NPC_BARBARIAN    21
  372. X  
  373. X  #define    ispc(x)        (((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
  374. X  #define    npctype(x)    (ispc(x) ? (x) : (x)/4)
  375. X--- 243,249 ----
  376. X  #define NPC_PIRATE    18
  377. X  #define NPC_LIZARD    19
  378. X  #define NPC_NOMAD    20
  379. X! #define NPC_SAVAGE    21
  380. X  
  381. X  #define    ispc(x)        (((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
  382. X  #define    npctype(x)    (ispc(x) ? (x) : (x)/4)
  383. X***************
  384. X*** 611,617 ****
  385. X  extern int    fltghold(),fltwhold(),fltmhold(),flthold(),compass();
  386. X  extern int    get_country(),check_lock(),doclass();
  387. X  extern unsigned short    fltspeed();
  388. X! extern void    do_pirate(), do_nomad(), do_barbarian(), do_lizard();
  389. X  extern void    getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
  390. X  extern struct    s_sector *rand_sector();
  391. X  extern void    subgships(),submships(),subwships(),getspace(),sackem();
  392. X--- 618,624 ----
  393. X  extern int    fltghold(),fltwhold(),fltmhold(),flthold(),compass();
  394. X  extern int    get_country(),check_lock(),doclass();
  395. X  extern unsigned short    fltspeed();
  396. X! extern void    do_pirate(), do_nomad(), do_savage(), do_lizard();
  397. X  extern void    getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
  398. X  extern struct    s_sector *rand_sector();
  399. X  extern void    subgships(),submships(),subwships(),getspace(),sackem();
  400. X***************
  401. X*** 622,627 ****
  402. X--- 629,635 ----
  403. X  extern void    errormsg(), clear_bottom(), addgroup(),ext_cmd();
  404. X  extern void    randomevent(), wdisaster(), weather(), deplete();
  405. X  extern void    verify_ntn(), verify_sct(), verifydata(), prep();
  406. X+ extern void    newbye(), newreset(), newmsg(), newerror(), newinit();
  407. X  extern void    destroy(), updmove(), spreadsheet(), mailopen(), mailclose();
  408. X  extern void    updexecs(), updcapture(), updsectors();
  409. X  extern void    updmil(), updcomodities(), updleader();
  410. X*** oadmin.c    Tue Jul 18 22:04:39 1989
  411. X--- admin.c    Tue Jul 18 22:04:55 1989
  412. X***************
  413. X*** 46,53 ****
  414. X  int argc;
  415. X  char **argv;
  416. X  {
  417. X!     int geteuid(), getuid(), setuid();
  418. X!     register int i;
  419. X      char *name;
  420. X      void srand();
  421. X      int getopt();
  422. X--- 46,53 ----
  423. X  int argc;
  424. X  char **argv;
  425. X  {
  426. X!     int geteuid(), getuid(), setuid(), realuser, l;
  427. X!     register int i,j;
  428. X      char *name;
  429. X      void srand();
  430. X      int getopt();
  431. X***************
  432. X*** 55,71 ****
  433. X      /* mflag = makeworld, a=add player, x=execute, p=print */
  434. X      /* rflag = make world from read in files */
  435. X      int mflag, aflag, xflag, pflag, rflag;
  436. X!     char string[80];
  437. X      extern char *optarg;
  438. X!     char defaultdir[256];
  439. X      struct passwd *getpwnam();
  440. X  
  441. X      mflag = aflag = xflag = pflag = rflag = 0;
  442. X      srand((unsigned) time((long *) 0));
  443. X!     strcpy(defaultdir, DEFAULTDIR);
  444. X      name = string;
  445. X      *name = 0;
  446. X  
  447. X      /* process the command line arguments */
  448. X      while((i=getopt(argc,argv,"maxpr:d:"))!=EOF) switch(i){
  449. X      /* process the command line arguments */
  450. X--- 55,133 ----
  451. X      /* mflag = makeworld, a=add player, x=execute, p=print */
  452. X      /* rflag = make world from read in files */
  453. X      int mflag, aflag, xflag, pflag, rflag;
  454. X!     char string[FILELTH];
  455. X      extern char *optarg;
  456. X!     char defaultdir[BIGLTH],cq_opts[BIGLTH];
  457. X      struct passwd *getpwnam();
  458. X  
  459. X      mflag = aflag = xflag = pflag = rflag = 0;
  460. X      srand((unsigned) time((long *) 0));
  461. X!     strcpy(cq_opts,"");
  462. X      name = string;
  463. X      *name = 0;
  464. X  
  465. X+     /* check conquer options */
  466. X+     if (getenv(ENVIRON_OPTS)!=NULL) {
  467. X+         strncpy(cq_opts, getenv(ENVIRON_OPTS), BIGLTH-1);
  468. X+     }
  469. X+     if (cq_opts[0] != '\0') {
  470. X+         l = strlen(cq_opts);
  471. X+         for(i=0; i<l; i++) {
  472. X+             switch(cq_opts[i]) {
  473. X+             case 'G':
  474. X+                 /* ignore Gaudy display */
  475. X+                 break;
  476. X+             case 'N':
  477. X+             case 'n':
  478. X+                 /* ignore nation name */
  479. X+                 for (;i<l && cq_opts[i]!=',';i++);
  480. X+                 break;
  481. X+             case 'D':
  482. X+             case 'd':
  483. X+                 /* check for data directory */
  484. X+                 if (strncmp(cq_opts+i+1,"ata=",4)==0) {
  485. X+                     i += 5;
  486. X+                 } else if (strncmp(cq_opts+i+1,"atadir=",7)==0) {
  487. X+                     i += 8;
  488. X+                 } else if (strncmp(cq_opts+i+1,"irectory=",9)==0) {
  489. X+                     i += 10;
  490. X+                 } else if (strncmp(cq_opts+i+1,"ir=",3)==0) {
  491. X+                     i += 4;
  492. X+                 } else {
  493. X+                     fprintf(stderr,"conquer: invalid environment\n");
  494. X+                     fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
  495. X+                     fprintf(stderr,"\texpected <data=NAME>\n");
  496. X+                     exit(FAIL);
  497. X+                 }
  498. X+                 if (i<l) {
  499. X+                     /* grab the data directory */
  500. X+                     for (j=0; j<l-i && cq_opts[i+j]!=',';j++) {
  501. X+                         defaultdir[j] = cq_opts[i+j];
  502. X+                     }
  503. X+                     defaultdir[j]='\0';
  504. X+                     i += j-1;
  505. X+                 }
  506. X+                 break;
  507. X+             case ' ':
  508. X+             case ',':
  509. X+                 /* ignore commas and spaces */
  510. X+                 break;
  511. X+             default:
  512. X+                 /* complain */
  513. X+                 fprintf(stderr,"conquer: invalid environment\n");
  514. X+                 fprintf(stderr,"\t%s = %s\n",ENVIRON_OPTS,cq_opts);
  515. X+                 fprintf(stderr,"\tunexpected option <%c>\n",cq_opts[i]);
  516. X+                 exit(FAIL);
  517. X+                 break;
  518. X+             }
  519. X+          }
  520. X+     }
  521. X+ 
  522. X+     /* set the default data directory */
  523. X+     if (defaultdir[0] == '\0') {
  524. X+         strcpy(defaultdir, DEFAULTDIR);
  525. X+     }
  526. X+ 
  527. X      /* process the command line arguments */
  528. X      while((i=getopt(argc,argv,"maxpr:d:"))!=EOF) switch(i){
  529. X      /* process the command line arguments */
  530. X***************
  531. X*** 90,100 ****
  532. X          strcpy(scenario, optarg);
  533. X          break;
  534. X      case 'd':
  535. X!         if(optarg[0]!='/') {
  536. X!             sprintf(defaultdir, "%s/%s", DEFAULTDIR, optarg);
  537. X!         } else {
  538. X!             strcpy(defaultdir, optarg);
  539. X!         }
  540. X          break;
  541. X      case '?': /*  print out command line arguments */
  542. X          printf("Command line format: %s [-maxp -dDIR -rSCENARIO]\n",argv[0]);
  543. X--- 152,158 ----
  544. X          strcpy(scenario, optarg);
  545. X          break;
  546. X      case 'd':
  547. X!         strcpy(defaultdir, optarg);
  548. X          break;
  549. X      case '?': /*  print out command line arguments */
  550. X          printf("Command line format: %s [-maxp -dDIR -rSCENARIO]\n",argv[0]);
  551. X***************
  552. X*** 107,123 ****
  553. X          exit(SUCCESS);
  554. X      };
  555. X  
  556. X! #ifdef OGOD
  557. X!     if(((getuid())!=(getpwnam(LOGIN)->pw_uid))&&(!aflag))
  558. X!     {
  559. X!          printf("Sorry -- you can not administrate conquer\n");
  560. X!          printf("you need to be logged in as %s\n",LOGIN);
  561. X!          exit(FAIL);
  562. X!     }
  563. X      /* may now replace user identity */
  564. X      (void) setuid (geteuid ()) ;
  565. X- #endif OGOD
  566. X  
  567. X      /* now that we have parsed the args, we can got to the
  568. X       * dir where the files are kept and do some work.
  569. X       */
  570. X--- 165,180 ----
  571. X          exit(SUCCESS);
  572. X      };
  573. X  
  574. X!     realuser = getuid();
  575. X      /* may now replace user identity */
  576. X      (void) setuid (geteuid ()) ;
  577. X  
  578. X+     /* set proper defaultdir */
  579. X+     if (defaultdir[0] != '/') {
  580. X+         strcpy(cq_opts, defaultdir);
  581. X+         sprintf(defaultdir, "%s/%s", DEFAULTDIR, cq_opts);
  582. X+     }
  583. X+ 
  584. X      /* now that we have parsed the args, we can got to the
  585. X       * dir where the files are kept and do some work.
  586. X       */
  587. X***************
  588. X*** 126,131 ****
  589. X--- 183,196 ----
  590. X          exit(FAIL);
  591. X      }
  592. X      if((mflag)||(rflag)) {
  593. X+         if(realuser!=(getpwnam(LOGIN)->pw_uid)) {
  594. X+             printf("Sorry -- you can not create a world\n");
  595. X+             printf("you need to be logged in as %s",LOGIN);
  596. X+             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  597. X+                 printf(" or %s",ntn[0].leader);
  598. X+             }
  599. X+             printf("\n");
  600. X+         }
  601. X          sprintf(string,"%sup",isonfile);
  602. X          unlink(string);
  603. X          makeworld(rflag);
  604. X***************
  605. X*** 177,200 ****
  606. X          newlogin();
  607. X          unlink(string);
  608. X          exit(SUCCESS);
  609. X!     } else if (pflag) {    /* print a map of the game */
  610. X          fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
  611. X          fprintf(stderr,"while the maps will be sent to stdout.\n\n");
  612. X          fprintf(stderr,"\tThe valid options are,\n");
  613. X          fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
  614. X!         fprintf(stderr,"\t\t3) nations\n\n");
  615. X          fprintf(stderr,"\tWhat type of map? ");
  616. X          scanf("%hd", &dismode);
  617. X          fprintf(stderr,"\n");
  618. X          if(dismode==1) printele();
  619. X          else if(dismode==2) printveg();
  620. X!         else pr_ntns();
  621. X          exit(SUCCESS);
  622. X      } else if (xflag) {    /* update the game */
  623. X  #ifndef OGOD
  624. X!         if ( getuid() != (getpwnam(LOGIN))->pw_uid ){
  625. X              printf("sorry -- your uid is invalid for updating\n");
  626. X!             printf("you need to be logged in as %s\n",LOGIN);
  627. X              exit(FAIL);
  628. X          }
  629. X  #endif OGOD
  630. X--- 242,291 ----
  631. X          newlogin();
  632. X          unlink(string);
  633. X          exit(SUCCESS);
  634. X!     }
  635. X! 
  636. X! #ifdef OGOD
  637. X!     if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
  638. X!        (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
  639. X!         printf("Sorry -- you can not administrate conquer\n");
  640. X!         printf("you need to be logged in as %s",LOGIN);
  641. X!         if (strcmp(LOGIN, ntn[0].leader)!=0) {
  642. X!             printf(" or %s",ntn[0].leader);
  643. X!         }
  644. X!         printf("\n");
  645. X!         exit(FAIL);
  646. X!     }
  647. X! #endif OGOD
  648. X! 
  649. X!     if (pflag) {    /* print a map of the game */
  650. X          fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
  651. X          fprintf(stderr,"while the maps will be sent to stdout.\n\n");
  652. X          fprintf(stderr,"\tThe valid options are,\n");
  653. X          fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
  654. X!         fprintf(stderr,"\t\t3) nations\n");
  655. X!         fprintf(stderr,"\t\t4) designations\n\n");
  656. X          fprintf(stderr,"\tWhat type of map? ");
  657. X          scanf("%hd", &dismode);
  658. X          fprintf(stderr,"\n");
  659. X          if(dismode==1) printele();
  660. X          else if(dismode==2) printveg();
  661. X!         else if(dismode==3) pr_ntns();
  662. X!         else if(dismode==4) pr_desg();
  663. X!         else {
  664. X!              fprintf(stderr,"must be 1-4\n");
  665. X!              exit(FAIL);
  666. X!         }
  667. X          exit(SUCCESS);
  668. X      } else if (xflag) {    /* update the game */
  669. X  #ifndef OGOD
  670. X!         if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
  671. X!            (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
  672. X              printf("sorry -- your uid is invalid for updating\n");
  673. X!             printf("you need to be logged in as %s",LOGIN);
  674. X!             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  675. X!                 printf(" or %s",ntn[0].leader);
  676. X!             }
  677. X!             printf("\n");
  678. X              exit(FAIL);
  679. X          }
  680. X  #endif OGOD
  681. X*** oextcmds.c    Tue Jul 18 22:04:41 1989
  682. X--- extcmds.c    Tue Jul 18 22:04:56 1989
  683. X***************
  684. X*** 174,184 ****
  685. X      }
  686. X      /* eliminate half starting movement if start out on march */
  687. X      if( P_ASTAT==MARCH && new_stat!=MARCH ) {
  688. X!         if(P_AMOVE<(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/5){
  689. X              errormsg("That troop has gone too far to stop marching");
  690. X              return;
  691. X          }
  692. X!         P_AMOVE-=(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/5;
  693. X          AADJMOV;
  694. X      }
  695. X      if(new_stat == SCOUT) {
  696. X--- 174,184 ----
  697. X      }
  698. X      /* eliminate half starting movement if start out on march */
  699. X      if( P_ASTAT==MARCH && new_stat!=MARCH ) {
  700. X!         if(P_AMOVE<(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/50){
  701. X              errormsg("That troop has gone too far to stop marching");
  702. X              return;
  703. X          }
  704. X!         P_AMOVE-=(curntn->maxmove * *(unitmove+(P_ATYPE%UTYPE)))/50;
  705. X          AADJMOV;
  706. X      }
  707. X      if(new_stat == SCOUT) {
  708. X***************
  709. X*** 308,313 ****
  710. X--- 308,316 ----
  711. X      mvaddstr(LINES-2, 0, "How many men to split? ");
  712. X      refresh();
  713. X      men = get_number();
  714. X+     if(men <= 0) {
  715. X+         return;
  716. X+     }
  717. X      reducearmy(armynum,men);
  718. X  }
  719. X  
  720. X***************
  721. X*** 357,363 ****
  722. X      mvaddstr(LINES-4,0,"enter a valid leader unit/army group id: ");
  723. X      refresh();
  724. X      group = get_number();
  725. X!     if( group < 0 || group > MAXARM || curntn->arm[group].sold <=0){
  726. X          errormsg("invalid unit number");
  727. X          return;
  728. X      }
  729. X--- 360,369 ----
  730. X      mvaddstr(LINES-4,0,"enter a valid leader unit/army group id: ");
  731. X      refresh();
  732. X      group = get_number();
  733. X!     if(group < 0) {
  734. X!         return;
  735. X!     }
  736. X!     if(group > MAXARM || curntn->arm[group].sold <=0){
  737. X          errormsg("invalid unit number");
  738. X          return;
  739. X      }
  740. X*** omakeworl.c    Tue Jul 18 22:04:42 1989
  741. X--- makeworl.c    Tue Jul 18 22:04:56 1989
  742. X***************
  743. X*** 45,51 ****
  744. X  int    rflag;        /* TRUE if you wish to read in a map from mapfiles */
  745. X  {
  746. X      char passwd[PASSLTH+1],*getpass();
  747. X!     char newstring[200];
  748. X      FILE *fopen();
  749. X  
  750. X      /*abort if datafile currently exists*/
  751. X--- 45,51 ----
  752. X  int    rflag;        /* TRUE if you wish to read in a map from mapfiles */
  753. X  {
  754. X      char passwd[PASSLTH+1],*getpass();
  755. X!     char newstring[BIGLTH];
  756. X      FILE *fopen();
  757. X  
  758. X      /*abort if datafile currently exists*/
  759. X***************
  760. X*** 87,93 ****
  761. X--- 87,112 ----
  762. X        }
  763. X  
  764. X      strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH);
  765. X+ 
  766. X+     /* finally ask for the secondary administrator */
  767. X+     printf("\nYou may now designate an alternate ruler for this world.");
  768. X      while(TRUE) {
  769. X+         printf("\nWhat demi-god shall rule this world? ");
  770. X+         gets( newstring );
  771. X+         if (strlen(newstring)==0) {
  772. X+             printf("\nGod blesses this world with his presense!\n");
  773. X+             (void) strcpy(ntn[0].leader,LOGIN);
  774. X+             break;
  775. X+         } else if (strlen(newstring) <= LEADERLTH) {
  776. X+             /* HOW DO YOU VERIFY THAT IT IS AN ACTUAL USER? */
  777. X+             printf("\nThe demi-god %s may administrate this new world.\n",newstring);
  778. X+             (void) strncpy(ntn[0].leader,newstring,LEADERLTH);
  779. X+             break;
  780. X+         }
  781. X+         printf("\nName too long.");
  782. X+     }
  783. X+ 
  784. X+     while(TRUE) {
  785. X          printf("\nplease enter the size of the world\n");
  786. X  
  787. X          printf("values should be divisible by 8 & greater than 23\n");
  788. X***************
  789. X*** 126,131 ****
  790. X--- 145,151 ----
  791. X      if( rflag==FALSE ) createworld();
  792. X      else readmap();    /* read map in from mapfiles */
  793. X      rawmaterials();
  794. X+ 
  795. X      verifydata(__FILE__,__LINE__);
  796. X      writedata();
  797. X  
  798. X***************
  799. X*** 712,724 ****
  800. X      short    npirates=0,nbarbarians=0,nnomads=0,nlizards=0;
  801. X  
  802. X      FILE *fp, *fopen();
  803. X!     char line[80],allign;
  804. X!     char fname[80];
  805. X  
  806. X!     /*set up god but dont place*/
  807. X      curntn = &ntn[0];
  808. X      strcpy(curntn->name,"unowned");
  809. X-     strcpy(curntn->leader,"god");
  810. X      curntn->race=GOD;
  811. X      curntn->location=GOD;
  812. X      curntn->powers=KNOWALL;    /* so god can see the map */
  813. X--- 732,743 ----
  814. X      short    npirates=0,nbarbarians=0,nnomads=0,nlizards=0;
  815. X  
  816. X      FILE *fp, *fopen();
  817. X!     char line[LINELTH+1],allign;
  818. X!     char fname[FILELTH];
  819. X  
  820. X!     /*set up god but dont place -- do not change leader name*/
  821. X      curntn = &ntn[0];
  822. X      strcpy(curntn->name,"unowned");
  823. X      curntn->race=GOD;
  824. X      curntn->location=GOD;
  825. X      curntn->powers=KNOWALL;    /* so god can see the map */
  826. X***************
  827. X*** 757,764 ****
  828. X          } else if( country==NTOTAL-2 ) {
  829. X              strcpy(curntn->name,"savages");
  830. X              strcpy(curntn->leader,"shaman");
  831. X!             curntn->active=NPC_BARBARIAN;
  832. X!             curntn->race=BARBARIAN;
  833. X          } else if( country==NTOTAL-3 ) {
  834. X              strcpy(curntn->name,"nomad");
  835. X              strcpy(curntn->leader,"khan");
  836. X--- 776,783 ----
  837. X          } else if( country==NTOTAL-2 ) {
  838. X              strcpy(curntn->name,"savages");
  839. X              strcpy(curntn->leader,"shaman");
  840. X!             curntn->active=NPC_SAVAGE;
  841. X!             curntn->race=SAVAGE;
  842. X          } else if( country==NTOTAL-3 ) {
  843. X              strcpy(curntn->name,"nomad");
  844. X              strcpy(curntn->leader,"khan");
  845. X***************
  846. X*** 800,806 ****
  847. X              } else    if(nnomads < MAXARM )    nnomads++;
  848. X              break;
  849. X      }
  850. X!     printf("placing %d lizards, %d pirates, %d barbarians, and %d nomads\n",
  851. X          nlizards,npirates,nbarbarians,nnomads);
  852. X  
  853. X      while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
  854. X--- 819,825 ----
  855. X              } else    if(nnomads < MAXARM )    nnomads++;
  856. X              break;
  857. X      }
  858. X!     printf("placing %d lizards, %d pirates, %d savages, and %d nomads\n",
  859. X          nlizards,npirates,nbarbarians,nnomads);
  860. X  
  861. X      while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
  862. X***************
  863. X*** 810,816 ****
  864. X              armynum=lizarmy;
  865. X          } else    if( nbarbarians>0 ) {    
  866. X              for(country=1;country<NTOTAL;country++)
  867. X!                 if( ntn[country].active==NPC_BARBARIAN ) break;
  868. X              armynum=barbarmy;
  869. X          } else    if( nnomads>0 )     {    
  870. X              for(country=1;country<NTOTAL;country++)
  871. X--- 829,835 ----
  872. X              armynum=lizarmy;
  873. X          } else    if( nbarbarians>0 ) {    
  874. X              for(country=1;country<NTOTAL;country++)
  875. X!                 if( ntn[country].active==NPC_SAVAGE ) break;
  876. X              armynum=barbarmy;
  877. X          } else    if( nnomads>0 )     {    
  878. X              for(country=1;country<NTOTAL;country++)
  879. X***************
  880. X*** 933,939 ****
  881. X              P_ATYPE=defaultunit(country);
  882. X              nomadarmy++;
  883. X              break;
  884. X!         case NPC_BARBARIAN:
  885. X              nbarbarians--;
  886. X              P_AXLOC=x;
  887. X              P_AYLOC=y;
  888. X--- 952,958 ----
  889. X              P_ATYPE=defaultunit(country);
  890. X              nomadarmy++;
  891. X              break;
  892. X!         case NPC_SAVAGE:
  893. X              nbarbarians--;
  894. X              P_AXLOC=x;
  895. X              P_AYLOC=y;
  896. X***************
  897. X*** 947,953 ****
  898. X  
  899. X      /* put random monsters around the world */
  900. X      for(country=1;country<NTOTAL;country++) {
  901. X!         if( ntn[country].active != NPC_BARBARIAN ) continue;
  902. X          curntn = &ntn[country];
  903. X          armynum=barbarmy;
  904. X          while(armynum<MAXARM) {
  905. X--- 966,972 ----
  906. X  
  907. X      /* put random monsters around the world */
  908. X      for(country=1;country<NTOTAL;country++) {
  909. X!         if( ntn[country].active != NPC_SAVAGE ) continue;
  910. X          curntn = &ntn[country];
  911. X          armynum=barbarmy;
  912. X          while(armynum<MAXARM) {
  913. X***************
  914. X*** 999,1008 ****
  915. X          }
  916. X      }
  917. X      printf("reading npc nation data from file: %s\n",npcsfile);
  918. X!     printf("and adding 1 nation per %d land sectors\n",MONSTER);
  919. X  
  920. X      cnum=1;
  921. X!     while(fgets(line,80,fp)!=NULL) {
  922. X          /*read and parse a new line*/
  923. X          if(line[0]!='#') {
  924. X              xloc = yloc = -1;
  925. X--- 1018,1027 ----
  926. X          }
  927. X      }
  928. X      printf("reading npc nation data from file: %s\n",npcsfile);
  929. X!     printf("and adding 1 nation per %d land sectors\n",NPC);
  930. X  
  931. X      cnum=1;
  932. X!     while(fgets(line,LINELTH,fp)!=NULL) {
  933. X          /*read and parse a new line*/
  934. X          if(line[0]!='#') {
  935. X              xloc = yloc = -1;
  936. X***************
  937. X*** 1015,1021 ****
  938. X  
  939. X              country=cnum;
  940. X              curntn = &ntn[country];
  941. X!             if( cnum > MAPX*MAPY/MONSTER*(100-pwater)/100 ) {
  942. X                  printf("world too small to add npc nation %d %s\n",cnum,curntn->name);
  943. X                  continue;
  944. X              } 
  945. X--- 1034,1040 ----
  946. X  
  947. X              country=cnum;
  948. X              curntn = &ntn[country];
  949. X!             if( cnum > MAPX*MAPY/NPC*(100-pwater)/100 ) {
  950. X                  printf("world too small to add npc nation %d %s\n",cnum,curntn->name);
  951. X                  continue;
  952. X              } 
  953. X*** orandeven.c    Tue Jul 18 22:04:44 1989
  954. X--- randeven.c    Tue Jul 18 22:04:57 1989
  955. X***************
  956. X*** 14,20 ****
  957. X  extern FILE *fnews;
  958. X  extern short country;
  959. X  
  960. X! char eventstr[80];
  961. X  int xpos,ypos;        /* saved x and y position */
  962. X  
  963. X  char *randevents[] = {
  964. X--- 14,20 ----
  965. X  extern FILE *fnews;
  966. X  extern short country;
  967. X  
  968. X! char eventstr[LINELTH+1];
  969. X  int xpos,ypos;        /* saved x and y position */
  970. X  
  971. X  char *randevents[] = {
  972. X***************
  973. X*** 47,53 ****
  974. X  /* 26 */ "fire ravishes town",
  975. X  /* 27 */ "black plague rages",
  976. X  /* 28 */ "pirates raid",
  977. X! /* 29 */ "barbarian raid",
  978. X  /* 30 */ "wizard grants power",
  979. X  /* 31 */ "magic item grants magic power",
  980. X  /* 32 */ "ores in one mine run out",
  981. X--- 47,53 ----
  982. X  /* 26 */ "fire ravishes town",
  983. X  /* 27 */ "black plague rages",
  984. X  /* 28 */ "pirates raid",
  985. X! /* 29 */ "savages raid",
  986. X  /* 30 */ "wizard grants power",
  987. X  /* 31 */ "magic item grants magic power",
  988. X  /* 32 */ "ores in one mine run out",
  989. X***************
  990. X*** 645,651 ****
  991. X          case 28: /*pirate raid on harbor*/
  992. X              done=FALSE;
  993. X              break;
  994. X!         case 29: /*barbarian raid*/
  995. X              done=FALSE;
  996. X              break;
  997. X          case 30: /*new magician + RANDOM POWER*/
  998. X--- 645,651 ----
  999. X          case 28: /*pirate raid on harbor*/
  1000. X              done=FALSE;
  1001. X              break;
  1002. X!         case 29: /*savages raid*/
  1003. X              done=FALSE;
  1004. X              break;
  1005. X          case 30: /*new magician + RANDOM POWER*/
  1006. X*** ocexecute.c    Tue Jul 18 22:04:39 1989
  1007. X--- cexecute.c    Tue Jul 18 22:04:57 1989
  1008. X***************
  1009. X*** 29,42 ****
  1010. X  {
  1011. X      FILE *fp, *fopen();
  1012. X      int cmd,savectry;
  1013. X!     char comment[20];
  1014. X!     char temp[10];
  1015. X      long longvar,long2var;
  1016. X      int armynum;
  1017. X      short int x,y;
  1018. X      int execed=0;
  1019. X      int done=FALSE;
  1020. X!     char line[80];
  1021. X  
  1022. X      /* initialize startgold */
  1023. X      if( isupdate==0) startgold = curntn->tgold;
  1024. X--- 29,42 ----
  1025. X  {
  1026. X      FILE *fp, *fopen();
  1027. X      int cmd,savectry;
  1028. X!     char comment[LINELTH];
  1029. X!     char temp[LINELTH];
  1030. X      long longvar,long2var;
  1031. X      int armynum;
  1032. X      short int x,y;
  1033. X      int execed=0;
  1034. X      int done=FALSE;
  1035. X!     char line[BIGLTH];
  1036. X  
  1037. X      /* initialize startgold */
  1038. X      if( isupdate==0) startgold = curntn->tgold;
  1039. X*** oforms.c    Tue Jul 18 22:04:41 1989
  1040. X--- forms.c    Tue Jul 18 22:04:58 1989
  1041. X***************
  1042. X*** 19,24 ****
  1043. X--- 19,25 ----
  1044. X  extern FILE    *fexe, *fnews;
  1045. X  extern short    country,redraw;
  1046. X  extern long    startgold;
  1047. X+ extern short    Gaudy;
  1048. X  
  1049. X  static char helplist[MAXHELP][20]={"Commands", "General Info",
  1050. X      "Military","Magic","Designations","Other"};
  1051. X***************
  1052. X*** 119,125 ****
  1053. X  diploscrn()
  1054. X  {
  1055. X      int i,j;
  1056. X!     char k,name[20];
  1057. X      short nation, offset, count, count2, temp;
  1058. X      short isgod=FALSE;
  1059. X      long    bribecost;
  1060. X--- 120,126 ----
  1061. X  diploscrn()
  1062. X  {
  1063. X      int i,j;
  1064. X!     char k,name[LINELTH];
  1065. X      short nation, offset, count, count2, temp;
  1066. X      short isgod=FALSE;
  1067. X      long    bribecost;
  1068. X***************
  1069. X*** 283,291 ****
  1070. X              mvaddstr(j++,0,"INPUT:");
  1071. X              refresh();
  1072. X              temp = get_number();
  1073. X              if((temp<=UNMET)||(temp>JIHAD)
  1074. X              ||((isgod==FALSE)&&(temp==UNMET))){
  1075. X!                 mvprintw(23,0,"SORRY, Invalid inputs -- hit return");
  1076. X                  refresh();
  1077. X                  getch();
  1078. X                  if(isgod==TRUE) reset_god();
  1079. X--- 284,296 ----
  1080. X              mvaddstr(j++,0,"INPUT:");
  1081. X              refresh();
  1082. X              temp = get_number();
  1083. X+             if(temp<0) {
  1084. X+                 if(isgod==TRUE) reset_god();
  1085. X+                 return;
  1086. X+             }
  1087. X              if((temp<=UNMET)||(temp>JIHAD)
  1088. X              ||((isgod==FALSE)&&(temp==UNMET))){
  1089. X!                 mvprintw(LINES-1,0,"SORRY, Invalid inputs -- hit return");
  1090. X                  refresh();
  1091. X                  getch();
  1092. X                  if(isgod==TRUE) reset_god();
  1093. X***************
  1094. X*** 345,351 ****
  1095. X  change()
  1096. X  {
  1097. X      float temp;
  1098. X!     char string[10], command[80];
  1099. X      int i, intval;
  1100. X      long    cost,men;
  1101. X      short armynum;
  1102. X--- 350,356 ----
  1103. X  change()
  1104. X  {
  1105. X      float temp;
  1106. X!     char string[LINELTH], command[BIGLTH];
  1107. X      int i, intval;
  1108. X      long    cost,men;
  1109. X      short armynum;
  1110. X***************
  1111. X*** 355,361 ****
  1112. X  #ifdef OGOD
  1113. X      FILE *ftmp;
  1114. X  #endif OGOD
  1115. X!     char filename[80];
  1116. X  
  1117. X      if(country==0) {
  1118. X          isgod=TRUE;
  1119. X--- 360,366 ----
  1120. X  #ifdef OGOD
  1121. X      FILE *ftmp;
  1122. X  #endif OGOD
  1123. X!     char filename[FILELTH];
  1124. X  
  1125. X      if(country==0) {
  1126. X          isgod=TRUE;
  1127. X***************
  1128. X*** 381,387 ****
  1129. X      standend();
  1130. X      mvprintw(10,0,"capitol loc: x is %d",curntn->capx);
  1131. X      mvprintw(11,0,"             y is %d",curntn->capy);
  1132. X-     mvprintw(12,0,"leader is %s",curntn->leader);
  1133. X      mvprintw(13,0,"class is %s",*(Class+curntn->class));
  1134. X      if(ispc( curntn->active ) )
  1135. X          addstr(" (PC)");
  1136. X--- 386,391 ----
  1137. X***************
  1138. X*** 426,436 ****
  1139. X--- 430,442 ----
  1140. X      fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  1141. X  
  1142. X      if (country!=0) {
  1143. X+         mvprintw(12,0,"leader is %s",curntn->leader);
  1144. X          mvprintw(16,0,"score currently...%ld",curntn->score);
  1145. X          mvprintw(3,COLS-30, "attack bonus.........%+4d%%",curntn->aplus);
  1146. X          mvprintw(4,COLS-30, "defense bonus........%+4d%%",curntn->dplus);
  1147. X          mvprintw(12,COLS-30,"total soldiers....%8ld",curntn->tmil);
  1148. X      } else {
  1149. X+         mvprintw(12,0,"demigod is %s",curntn->leader);
  1150. X          mvprintw(16,0,"turn currently....%ld",TURN);
  1151. X          mvprintw(3,COLS-30, "mercs attack bonus....+%2d%%",MERCATT);
  1152. X          mvprintw(4,COLS-30, "mercs defense bonus...+%2d%%",MERCDEF);
  1153. X***************
  1154. X*** 463,471 ****
  1155. X      addstr(" 7) TOGGLE PC <-> NPC");
  1156. X  
  1157. X  #ifdef OGOD
  1158. X!      if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION OR 9 TO CHANGE COMMODITY");
  1159. X  #else OGOD
  1160. X!       if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-11,"HIT 8 TO DESTROY NATION");
  1161. X  #endif OGOD
  1162. X      else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
  1163. X      standend();
  1164. X--- 469,477 ----
  1165. X      addstr(" 7) TOGGLE PC <-> NPC");
  1166. X  
  1167. X  #ifdef OGOD
  1168. X!     if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-33,"HIT 8 TO DESTROY, 9 TO CHANGE COMMODITY OR '0' TO CHANGE DEMI-GOD");
  1169. X  #else OGOD
  1170. X!     if(isgod==TRUE) mvaddstr(LINES-3,COLS/2-24,"HIT 8 TO DESTROY NATION, OR '0' TO CHANGE DEMI-GOD");
  1171. X  #endif OGOD
  1172. X      else mvaddstr(LINES-3,COLS/2-14,"HIT ANY OTHER KEY TO CONTINUE");
  1173. X      standend();
  1174. X***************
  1175. X*** 534,540 ****
  1176. X          refresh();
  1177. X          intval = get_number();
  1178. X          if( intval < 0 )
  1179. X!             errormsg("ERROR - negative tax rate");
  1180. X          else if( intval > 20 )
  1181. X              errormsg("NO WAY! the peasants will revolt!!!");
  1182. X          else if( intval > 10 && (curntn->tsctrs<20 || curntn->score<20) )
  1183. X--- 540,546 ----
  1184. X          refresh();
  1185. X          intval = get_number();
  1186. X          if( intval < 0 )
  1187. X!             break;
  1188. X          else if( intval > 20 )
  1189. X              errormsg("NO WAY! the peasants will revolt!!!");
  1190. X          else if( intval > 10 && (curntn->tsctrs<20 || curntn->score<20) )
  1191. X***************
  1192. X*** 550,556 ****
  1193. X          standend();
  1194. X          refresh();
  1195. X          intval = get_number();
  1196. X!         if(( intval < 0 ) ||( intval > 100 ))
  1197. X              errormsg("ERROR - invalid charity rate");
  1198. X          /* this will protect from both underflow and overflow */
  1199. X          else if((int)curntn->popularity + 2*(intval - (int)curntn->charity)>100)
  1200. X--- 556,564 ----
  1201. X          standend();
  1202. X          refresh();
  1203. X          intval = get_number();
  1204. X!         if (intval < 0) {
  1205. X!             break;
  1206. X!         } else if( intval > 100 )
  1207. X              errormsg("ERROR - invalid charity rate");
  1208. X          /* this will protect from both underflow and overflow */
  1209. X          else if((int)curntn->popularity + 2*(intval - (int)curntn->charity)>100)
  1210. X***************
  1211. X*** 571,577 ****
  1212. X          refresh();
  1213. X          intval = get_number();
  1214. X          if( intval < 0 )
  1215. X!             errormsg("ERROR - negative input");
  1216. X          else if( intval+curntn->terror > 100 )
  1217. X              errormsg("Cant go over 100 terror!!!");
  1218. X          else if((intval > curntn->popularity )
  1219. X--- 579,585 ----
  1220. X          refresh();
  1221. X          intval = get_number();
  1222. X          if( intval < 0 )
  1223. X!             break;
  1224. X          else if( intval+curntn->terror > 100 )
  1225. X              errormsg("Cant go over 100 terror!!!");
  1226. X          else if((intval > curntn->popularity )
  1227. X***************
  1228. X*** 683,688 ****
  1229. X--- 691,697 ----
  1230. X                  mvaddstr(LINES-1,0,"WHAT IS NEW VALUE FOR TREASURY? ");
  1231. X                  refresh();
  1232. X                  curntn->tgold = (long) get_number();
  1233. X+                 if (curntn->tgold < 0L) curntn->tgold=0L;
  1234. X                  fprintf(ftmp,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAGOLD ,country,curntn->tgold,"null");
  1235. X                  break;
  1236. X              case '2':
  1237. X***************
  1238. X*** 689,694 ****
  1239. X--- 698,704 ----
  1240. X                  mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF JEWELS? ");
  1241. X                  refresh();
  1242. X                  curntn->jewels = (long) get_number();
  1243. X+                 if (curntn->jewels < 0L) curntn->jewels=0L;
  1244. X                  fprintf(ftmp,"L_NJWLS\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNARGOLD ,country,curntn->jewels,"null");
  1245. X                  break;
  1246. X              case '3':
  1247. X***************
  1248. X*** 695,700 ****
  1249. X--- 705,711 ----
  1250. X                  mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF METAL? ");
  1251. X                  refresh();
  1252. X                  curntn->metals = (long) get_number();
  1253. X+                 if (curntn->metals < 0L) curntn->metals=0L;
  1254. X                  fprintf(ftmp,"L_NMETAL\t%d \t%d \t%ld \t0 \t0 \t%s\n", XNAMETAL ,country,curntn->metals,"null");
  1255. X                  break;
  1256. X              case '4':
  1257. X***************
  1258. X*** 701,706 ****
  1259. X--- 712,718 ----
  1260. X                  mvaddstr(LINES-1,0,"WHAT IS NEW AMOUNT OF FOOD? ");
  1261. X                  refresh();
  1262. X                  curntn->tfood = (long) get_number();
  1263. X+                 if (curntn->tfood < 0L) curntn->tfood = 0L;
  1264. X                  break;
  1265. X              default:
  1266. X                  break;
  1267. X***************
  1268. X*** 709,714 ****
  1269. X--- 721,741 ----
  1270. X          }
  1271. X          break;
  1272. X  #endif OGOD
  1273. X+     case '0':
  1274. X+         if(isgod==TRUE) {
  1275. X+             mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
  1276. X+             refresh();
  1277. X+             getstr(string);
  1278. X+             strcpy(passwd,crypt(string,SALT));
  1279. X+             if(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0) break;
  1280. X+             mvaddstr(LINES-1,0,"PROMOTE WHAT USER TO DEMI-GOD? ");
  1281. X+             refresh();
  1282. X+             get_nname(string);
  1283. X+             if (strlen(string)!=0) {
  1284. X+                 strncpy(ntn[0].leader,string,LEADERLTH);
  1285. X+             }
  1286. X+         }
  1287. X+         break;
  1288. X      case 'p':
  1289. X      case 'P': produce(); fclose(fp); return;
  1290. X      case 'b':
  1291. X***************
  1292. X*** 729,735 ****
  1293. X      int lineno;
  1294. X      FILE *fp, *fopen();
  1295. X      int i,xcnt,ycnt,done=FALSE;
  1296. X!     char line[80],fname[80];
  1297. X  
  1298. X      /*find out which helpfile to read in */
  1299. X      clear_bottom(0);
  1300. X--- 756,762 ----
  1301. X      int lineno;
  1302. X      FILE *fp, *fopen();
  1303. X      int i,xcnt,ycnt,done=FALSE;
  1304. X!     char line[LINELTH],fname[FILELTH];
  1305. X  
  1306. X      /*find out which helpfile to read in */
  1307. X      clear_bottom(0);
  1308. X***************
  1309. X*** 798,803 ****
  1310. X--- 825,852 ----
  1311. X      fclose(fp);
  1312. X  }
  1313. X  
  1314. X+ /* routine to highlight a line for news display */
  1315. X+ /* if country name is mentioned.  By T. Kivinen */
  1316. X+ mvaddstrnahil(li,col,p)
  1317. X+      int li;
  1318. X+      int col;
  1319. X+      char *p;
  1320. X+ {
  1321. X+     int i,j;
  1322. X+     move(li,col);
  1323. X+     for (i=0;p[i];i++) {
  1324. X+         for (j=0;p[i+j]==ntn[country].name[j];j++);
  1325. X+         if (ntn[country].name[j]==0 && p[i+j]!='-') {
  1326. X+             standout();
  1327. X+             addstr(ntn[country].name);
  1328. X+             standend();
  1329. X+             i+=j-1;
  1330. X+         }
  1331. X+         else
  1332. X+             addch(p[i]);
  1333. X+     }
  1334. X+ }
  1335. X+ 
  1336. X  void
  1337. X  newspaper()
  1338. X  {
  1339. X***************
  1340. X*** 806,812 ****
  1341. X      int newpage,choice,done=FALSE;
  1342. X      short pagenum=1;
  1343. X      int i,ydist,xdist;
  1344. X!     char line[80],name[80];
  1345. X  
  1346. X      /* check to make sure that there are newspapers */
  1347. X      if (TURN==0) {
  1348. X--- 855,861 ----
  1349. X      int newpage,choice,done=FALSE;
  1350. X      short pagenum=1;
  1351. X      int i,ydist,xdist;
  1352. X!     char line[LINELTH],name[FILELTH];
  1353. X  
  1354. X      /* check to make sure that there are newspapers */
  1355. X      if (TURN==0) {
  1356. X***************
  1357. X*** 874,881 ****
  1358. X              mvprintw(3,37-strlen(name)/2,"%s",name+2);
  1359. X              standend();
  1360. X              /* display any pending non-blank lines */
  1361. X!             if(strcmp(line,name)!=0 && strlen(line)>2)
  1362. X!                 mvaddstr(lineno++,0,line+2);
  1363. X          } else if(fgets(line,80,fp)==NULL) done=TRUE;
  1364. X          else {
  1365. X              if(line[1]!='.') {
  1366. X--- 923,932 ----
  1367. X              mvprintw(3,37-strlen(name)/2,"%s",name+2);
  1368. X              standend();
  1369. X              /* display any pending non-blank lines */
  1370. X!             if(strcmp(line,name)!=0 && strlen(line)>2) {
  1371. X!                 if (Gaudy) mvaddstrnahil(lineno++,0,line+2);
  1372. X!                 else mvaddstr(lineno++,0,line+2);
  1373. X!             }
  1374. X          } else if(fgets(line,80,fp)==NULL) done=TRUE;
  1375. X          else {
  1376. X              if(line[1]!='.') {
  1377. X***************
  1378. X*** 888,894 ****
  1379. X                      pagenum=todigit(line[0]);
  1380. X                  }
  1381. X                  else if(lineno>LINES-4) newpage=FALSE;
  1382. X!                 else if(strlen(line)>2) mvaddstr(lineno++,0,line+2);
  1383. X              }
  1384. X          }
  1385. X          if(newpage==FALSE||done==TRUE){
  1386. X--- 939,948 ----
  1387. X                      pagenum=todigit(line[0]);
  1388. X                  }
  1389. X                  else if(lineno>LINES-4) newpage=FALSE;
  1390. X!                 else if(strlen(line)>2) {
  1391. X!                     if (Gaudy) mvaddstrnahil(lineno++,0,line+2);
  1392. X!                     else mvaddstr(lineno++,0,line+2);
  1393. X!                 }
  1394. X              }
  1395. X          }
  1396. X          if(newpage==FALSE||done==TRUE){
  1397. X*** omisc.c    Tue Jul 18 22:04:42 1989
  1398. X--- misc.c    Tue Jul 18 22:04:58 1989
  1399. X***************
  1400. X*** 41,47 ****
  1401. X  } /* move_file() */
  1402. X  #endif CONQUER
  1403. X  
  1404. X! #ifdef CONQUER
  1405. X  long
  1406. X  get_number()
  1407. X  {
  1408. X--- 41,48 ----
  1409. X  } /* move_file() */
  1410. X  #endif CONQUER
  1411. X  
  1412. X! /* returns integer input greater than zero or */
  1413. X! /* -1 for no input.                           */
  1414. X  long
  1415. X  get_number()
  1416. X  {
  1417. X***************
  1418. X*** 51,57 ****
  1419. X      /* this routine totally redone to allow deleting */
  1420. X      while(!done) {
  1421. X          ch=getch();
  1422. X!         if(isdigit(ch)) {
  1423. X              /* only print numbers to the screen */
  1424. X              addch(ch);
  1425. X              refresh();
  1426. X--- 52,58 ----
  1427. X      /* this routine totally redone to allow deleting */
  1428. X      while(!done) {
  1429. X          ch=getch();
  1430. X!         if(isdigit(ch) && count<12) {
  1431. X              /* only print numbers to the screen */
  1432. X              addch(ch);
  1433. X              refresh();
  1434. X***************
  1435. X*** 70,80 ****
  1436. X          } else if((ch=='\n')||(ch=='\r')) {
  1437. X              done=TRUE;
  1438. X          }
  1439. X-         if( count >= 12 ) done=TRUE;
  1440. X      }
  1441. X      return( sum );
  1442. X  }
  1443. X- #endif CONQUER
  1444. X  
  1445. X  #define INFINITE    1000
  1446. X  
  1447. X--- 71,82 ----
  1448. X          } else if((ch=='\n')||(ch=='\r')) {
  1449. X              done=TRUE;
  1450. X          }
  1451. X      }
  1452. X+     if (count==0) {
  1453. X+         return(-1);
  1454. X+     }
  1455. X      return( sum );
  1456. X  }
  1457. X  
  1458. X  #define INFINITE    1000
  1459. X  
  1460. X***************
  1461. X*** 935,941 ****
  1462. X  {
  1463. X      short armynum, nvynum;
  1464. X      int i, x, y;
  1465. X!     char buf[20];
  1466. X      struct s_nation    *nptr;
  1467. X  
  1468. X      nptr = &ntn[country];
  1469. X--- 937,943 ----
  1470. X  {
  1471. X      short armynum, nvynum;
  1472. X      int i, x, y;
  1473. X!     char buf[LINELTH];
  1474. X      struct s_nation    *nptr;
  1475. X  
  1476. X      nptr = &ntn[country];
  1477. X***************
  1478. X*** 968,974 ****
  1479. X          ntn[i].dstatus[country]=UNMET;
  1480. X          nptr->dstatus[i]=UNMET;
  1481. X      }
  1482. X! 
  1483. X      /*if take them you get their gold*/
  1484. X      if(country!=sct[nptr->capx][nptr->capy].owner){
  1485. X          if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
  1486. X--- 970,982 ----
  1487. X          ntn[i].dstatus[country]=UNMET;
  1488. X          nptr->dstatus[i]=UNMET;
  1489. X      }
  1490. X! #ifdef MONSTER
  1491. X!     for(i=NTOTAL-4;i<NTOTAL;i++) {
  1492. X!             ntn[i].dstatus[country]=WAR;
  1493. X!         nptr->dstatus[i]=WAR;
  1494. X!     }
  1495. X! #endif
  1496. X!     
  1497. X      /*if take them you get their gold*/
  1498. X      if(country!=sct[nptr->capx][nptr->capy].owner){
  1499. X          if(nptr->tgold>0) ntn[sct[nptr->capx][nptr->capy].owner].tgold+=nptr->tgold;
  1500. X***************
  1501. X*** 1302,1309 ****
  1502. X      spread.gold += spread.revfood + spread.revjewels + spread.revmetal + spread.revcity + spread.revcap + spread.revothr;
  1503. X  }
  1504. X  
  1505. X- #ifdef CONQUER
  1506. X- 
  1507. X  /* string inputing routine to allow deleting */
  1508. X  void
  1509. X  get_nname(str)
  1510. X--- 1310,1315 ----
  1511. X***************
  1512. X*** 1338,1343 ****
  1513. X--- 1344,1351 ----
  1514. X      str[count] = '\0';
  1515. X  }
  1516. X  
  1517. X+ 
  1518. X+ #ifdef CONQUER
  1519. X  /* routine to find a nation number using name or number  */
  1520. X  /* returns NTOTAL+1 if input is invalid; -1 for no input */
  1521. X  int
  1522. X***************
  1523. X*** 1441,1447 ****
  1524. X  void
  1525. X  mailopen(to)
  1526. X  {
  1527. X!     char    line[20];
  1528. X      if(mailok == TRUE) mailclose();
  1529. X  
  1530. X      if (to != -2)
  1531. X--- 1449,1455 ----
  1532. X  void
  1533. X  mailopen(to)
  1534. X  {
  1535. X!     char    line[LINELTH];
  1536. X      if(mailok == TRUE) mailclose();
  1537. X  
  1538. X      if (to != -2)
  1539. X***************
  1540. X*** 1474,1507 ****
  1541. X  int prtflag;    /* if true printf reason */
  1542. X  {
  1543. X      register int i;
  1544. X  
  1545. X      if((isprint(mark)==0)||(isspace(mark)!=0)) {
  1546. X!         if(prtflag) printf("%c is white space\n",mark);
  1547. X          return(FALSE);
  1548. X      }
  1549. X  
  1550. X      for(i=0;ele[i]!='0';i++) if(mark==(*(ele+i))) {
  1551. X!         if(prtflag) printf("%c is elevation character\n",mark);
  1552. X          return(FALSE);
  1553. X      }
  1554. X  
  1555. X      for(i=0;veg[i]!='0';i++) if(mark==(*(veg+i))) {
  1556. X!         if(prtflag) printf("%c is vegetition character\n",mark);
  1557. X          return(FALSE);
  1558. X      }
  1559. X  
  1560. X!     for(i=1;i<NTOTAL;i++) if(ntn[i].mark==mark) {
  1561. X!         if(prtflag) printf("%c is already used\n",mark);
  1562. X          return(FALSE);
  1563. X      }
  1564. X  
  1565. X      if(mark=='*') {
  1566. X!         if(prtflag) printf("%c is *\n",mark);
  1567. X          return(FALSE);
  1568. X      }
  1569. X  
  1570. X      if(!isalpha(mark)) {
  1571. X!         if(prtflag) printf("%c is not an alpha character\n",mark);
  1572. X          return(FALSE);
  1573. X      }
  1574. X      return(TRUE);
  1575. X--- 1482,1534 ----
  1576. X  int prtflag;    /* if true printf reason */
  1577. X  {
  1578. X      register int i;
  1579. X+     char temp[LINELTH];
  1580. X  
  1581. X      if((isprint(mark)==0)||(isspace(mark)!=0)) {
  1582. X!         if(prtflag) {
  1583. X!             sprintf(temp,"%c is white space",mark);
  1584. X!             newerror(temp);
  1585. X!         }
  1586. X          return(FALSE);
  1587. X      }
  1588. X  
  1589. X      for(i=0;ele[i]!='0';i++) if(mark==(*(ele+i))) {
  1590. X!         if(prtflag) {
  1591. X!             sprintf(temp,"%c is an elevation character",mark);
  1592. X!             newerror(temp);
  1593. X!         }
  1594. X          return(FALSE);
  1595. X      }
  1596. X  
  1597. X      for(i=0;veg[i]!='0';i++) if(mark==(*(veg+i))) {
  1598. X!         if(prtflag) {
  1599. X!             sprintf(temp,"%c is a vegetation character",mark);
  1600. X!             newerror(temp);
  1601. X!         }
  1602. X          return(FALSE);
  1603. X      }
  1604. X  
  1605. X!     for(i=1;i<NTOTAL;i++) if(isactive(ntn[i].active) && ntn[i].mark==mark) {
  1606. X!         if(prtflag) {
  1607. X!             sprintf(temp,"%c is already used",mark);
  1608. X!             newerror(temp);
  1609. X!         }
  1610. X          return(FALSE);
  1611. X      }
  1612. X  
  1613. X      if(mark=='*') {
  1614. X!         if(prtflag) {
  1615. X!             sprintf(temp,"%c is used by Monsters",mark);
  1616. X!             newerror(temp);
  1617. X!         }
  1618. X          return(FALSE);
  1619. X      }
  1620. X  
  1621. X      if(!isalpha(mark)) {
  1622. X!         if(prtflag) {
  1623. X!             sprintf(temp,"%c is not an alpha character",mark);
  1624. X!             newerror(temp);
  1625. X!         }
  1626. X          return(FALSE);
  1627. X      }
  1628. X      return(TRUE);
  1629. X***************
  1630. X*** 1624,1635 ****
  1631. X      case TG_silver:
  1632. X      case TG_pearls:    break;
  1633. X      case TG_dye:
  1634. X!     case TG_silk:
  1635. X!     case TG_gold:    if(ntn[nation].wealth < 5) return(0); break;
  1636. X!     case TG_rubys:
  1637. X!     case TG_ivory:    if(ntn[nation].wealth < 10) return(0); break;
  1638. X!     case TG_diamonds:
  1639. X!     case TG_platinum:    if(ntn[nation].wealth < 20) return(0); break;
  1640. X      default:        break;
  1641. X      };
  1642. X  
  1643. X--- 1651,1662 ----
  1644. X      case TG_silver:
  1645. X      case TG_pearls:    break;
  1646. X      case TG_dye:
  1647. X!     case TG_silk:    if(ntn[nation].wealth < 5) return(0); break;
  1648. X!     case TG_gold:
  1649. X!     case TG_rubys:    if(ntn[nation].wealth < 8) return(0); break;
  1650. X!     case TG_ivory:    if(ntn[nation].wealth < 15) return(0); break;
  1651. X!     case TG_diamonds:    if(ntn[nation].wealth < 20) return(0); break;
  1652. X!     case TG_platinum:    if(ntn[nation].wealth < 25) return(0); break;
  1653. X      default:        break;
  1654. X      };
  1655. X  
  1656. X*** oreports.c    Tue Jul 18 22:04:44 1989
  1657. X--- reports.c    Tue Jul 18 22:04:59 1989
  1658. X***************
  1659. X*** 171,177 ****
  1660. X                  mvaddstr(ypos++,0,"TO WHAT ARMY: ");
  1661. X                  refresh();
  1662. X                  armynum = get_number();
  1663. X! 
  1664. X                  combinearmies(armynum,oldarmy);
  1665. X                  break;
  1666. X              case '5':
  1667. X--- 171,177 ----
  1668. X                  mvaddstr(ypos++,0,"TO WHAT ARMY: ");
  1669. X                  refresh();
  1670. X                  armynum = get_number();
  1671. X!                 if (armynum < 0) break;
  1672. X                  combinearmies(armynum,oldarmy);
  1673. X                  break;
  1674. X              case '5':
  1675. X***************
  1676. X*** 270,277 ****
  1677. X                      mvaddstr(ypos++,0,"What is the New Total Soldiers: ");
  1678. X                      refresh();
  1679. X                      men = get_number();
  1680. X!                     P_ASOLD=men;
  1681. X!                     AADJMEN;
  1682. X                  }
  1683. X                  break;
  1684. X  #endif OGOD
  1685. X--- 270,279 ----
  1686. X                      mvaddstr(ypos++,0,"What is the New Total Soldiers: ");
  1687. X                      refresh();
  1688. X                      men = get_number();
  1689. X!                     if (men>0) {
  1690. X!                         P_ASOLD=men;
  1691. X!                         AADJMEN;
  1692. X!                     }
  1693. X                  }
  1694. X                  break;
  1695. X  #endif OGOD
  1696. X***************
  1697. X*** 569,574 ****
  1698. X--- 571,577 ----
  1699. X              clrtoeol();
  1700. X              refresh();
  1701. X              nvynum = get_number();
  1702. X+             if(nvynum<0) break;
  1703. X  #ifdef TRADE
  1704. X              if (curntn->nvy[nvynum].commodity==TRADED) {
  1705. X                  errormsg("Sorry - That Navy is up for trade");
  1706. X***************
  1707. X*** 593,599 ****
  1708. X                  clrtoeol();
  1709. X                  refresh();
  1710. X                  newnavy = get_number();
  1711. X!                 if(newnavy<0 || newnavy>=MAXNAVY) {
  1712. X                      errormsg("Sorry - Invalid Navy unit");
  1713. X                      break;
  1714. X                  }
  1715. X--- 596,603 ----
  1716. X                  clrtoeol();
  1717. X                  refresh();
  1718. X                  newnavy = get_number();
  1719. X!                 if(newnavy < 0) break;
  1720. X!                 if(newnavy >= MAXNAVY) {
  1721. X                      errormsg("Sorry - Invalid Navy unit");
  1722. X                      break;
  1723. X                  }
  1724. X***************
  1725. X*** 700,706 ****
  1726. X                      clrtoeol();
  1727. X                      refresh();
  1728. X                      newnavy = get_number();
  1729. X!                     if(newnavy>P_NWAR(shipsize)) newnavy=0;
  1730. X                      NSUB_WAR(newnavy);
  1731. X                      (void) addwships(navy,shipsize,newnavy);
  1732. X                  }
  1733. X--- 704,710 ----
  1734. X                      clrtoeol();
  1735. X                      refresh();
  1736. X                      newnavy = get_number();
  1737. X!                     if(newnavy>P_NWAR(shipsize)||newnavy<0) newnavy=0;
  1738. X                      NSUB_WAR(newnavy);
  1739. X                      (void) addwships(navy,shipsize,newnavy);
  1740. X                  }
  1741. X***************
  1742. X*** 709,715 ****
  1743. X                      clrtoeol();
  1744. X                      refresh();
  1745. X                      newnavy = get_number();
  1746. X!                     if(newnavy>P_NMER(shipsize)) newnavy=0;
  1747. X                      NSUB_MER(newnavy);
  1748. X                      (void) addmships(navy,shipsize,newnavy);
  1749. X                  }
  1750. X--- 713,719 ----
  1751. X                      clrtoeol();
  1752. X                      refresh();
  1753. X                      newnavy = get_number();
  1754. X!                     if(newnavy>P_NMER(shipsize)||newnavy<0) newnavy=0;
  1755. X                      NSUB_MER(newnavy);
  1756. X                      (void) addmships(navy,shipsize,newnavy);
  1757. X                  }
  1758. X***************
  1759. X*** 718,724 ****
  1760. X                      clrtoeol();
  1761. X                      refresh();
  1762. X                      newnavy = get_number();
  1763. X!                     if(newnavy>P_NGAL(shipsize)) newnavy=0;
  1764. X                      NSUB_GAL(newnavy);
  1765. X                      (void) addgships(navy,shipsize,newnavy);
  1766. X                  }
  1767. X--- 722,728 ----
  1768. X                      clrtoeol();
  1769. X                      refresh();
  1770. X                      newnavy = get_number();
  1771. X!                     if(newnavy>P_NGAL(shipsize)||newnavy<0) newnavy=0;
  1772. X                      NSUB_GAL(newnavy);
  1773. X                      (void) addgships(navy,shipsize,newnavy);
  1774. X                  }
  1775. X***************
  1776. X*** 779,785 ****
  1777. X                          clrtoeol();
  1778. X                          refresh();
  1779. X                          newnavy = get_number();
  1780. X!                         if(newnavy>N_MASK) newnavy=0;
  1781. X                          (void) NADD_WAR(newnavy);
  1782. X                      }
  1783. X                      for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
  1784. X--- 783,789 ----
  1785. X                          clrtoeol();
  1786. X                          refresh();
  1787. X                          newnavy = get_number();
  1788. X!                         if(newnavy>N_MASK||newnavy<0) newnavy=0;
  1789. X                          (void) NADD_WAR(newnavy);
  1790. X                      }
  1791. X                      for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
  1792. X***************
  1793. X*** 787,793 ****
  1794. X                          clrtoeol();
  1795. X                          refresh();
  1796. X                          newnavy = get_number();
  1797. X!                         if(newnavy>N_MASK) newnavy=0;
  1798. X                          (void) NADD_MER(newnavy);
  1799. X                      }
  1800. X                      for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
  1801. X--- 791,797 ----
  1802. X                          clrtoeol();
  1803. X                          refresh();
  1804. X                          newnavy = get_number();
  1805. X!                         if(newnavy>N_MASK||newnavy<0) newnavy=0;
  1806. X                          (void) NADD_MER(newnavy);
  1807. X                      }
  1808. X                      for(shipsize=N_LIGHT;shipsize<=N_HEAVY;shipsize++) {
  1809. X***************
  1810. X*** 795,801 ****
  1811. X                          clrtoeol();
  1812. X                          refresh();
  1813. X                          newnavy = get_number();
  1814. X!                         if(newnavy>N_MASK) newnavy=0;
  1815. X                          (void) NADD_GAL(newnavy);
  1816. X                      }
  1817. X                      NADJWAR;
  1818. X--- 799,805 ----
  1819. X                          clrtoeol();
  1820. X                          refresh();
  1821. X                          newnavy = get_number();
  1822. X!                         if(newnavy>N_MASK||newnavy<0) newnavy=0;
  1823. X                          (void) NADD_GAL(newnavy);
  1824. X                      }
  1825. X                      NADJWAR;
  1826. X***************
  1827. X*** 827,835 ****
  1828. X                      mvaddstr(ypos,0,"What value for crew/ship unit: ");
  1829. X                      refresh();
  1830. X                      crew = get_number();
  1831. X!                     if (crew>=0 && crew<=SHIPCREW)
  1832. X                          P_NCREW = crew;
  1833. X!                     NADJCRW;
  1834. X                  }
  1835. X                  break;
  1836. X  #endif OGOD
  1837. X--- 831,840 ----
  1838. X                      mvaddstr(ypos,0,"What value for crew/ship unit: ");
  1839. X                      refresh();
  1840. X                      crew = get_number();
  1841. X!                     if (crew>=0 && crew<=SHIPCREW) {
  1842. X                          P_NCREW = crew;
  1843. X!                         NADJCRW;
  1844. X!                     }
  1845. X                  }
  1846. X                  break;
  1847. X  #endif OGOD
  1848. X*** oupdate.c    Tue Jul 18 22:04:46 1989
  1849. X--- update.c    Tue Jul 18 22:05:00 1989
  1850. X***************
  1851. X*** 26,32 ****
  1852. X  void
  1853. X  update()
  1854. X  {
  1855. X!     char command[80],filename[80];
  1856. X  
  1857. X      sprintf(filename,"%s%d",newsfile,TURN);
  1858. X      if ((fnews=fopen(filename,"w"))==NULL) {
  1859. X--- 26,32 ----
  1860. X  void
  1861. X  update()
  1862. X  {
  1863. X!     char command[BIGLTH],filename[FILELTH];
  1864. X  
  1865. X      sprintf(filename,"%s%d",newsfile,TURN);
  1866. X      if ((fnews=fopen(filename,"w"))==NULL) {
  1867. X***************
  1868. X*** 217,223 ****
  1869. X      if((designation==DDEVASTATED)||(Attr<0)||(movecost[x][y]<0)) Attr=0;
  1870. SHAR_EOF
  1871. echo "End of part 2, continue with part 3"
  1872. echo "3" > s2_seq_.tmp
  1873. exit 0
  1874.