billr@saab.CNA.TEK.COM (Bill Randle) (07/12/89)
Submitted-by: adb@bu-cs.bu.edu (Adam Bryant)
Posting-number: Volume 7, Issue 10
Archive-name: conquer4/Patch2a
Patch-To: conquer4: Volume 6, Issue 83-96
[Feed this file directly to patch(1). -br]
[[This is patch number two to conquer version 4.0.
(making it conquer version 4.2!)
see notes.v4 for changes.
Part 1 is a patch file.
Part 2 is a new Makefile. [Just replace the
current Makefile with it.]
adam]]
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: patches02a
# Wrapped by billr@saab on Wed Jul 12 06:35:06 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'patches02a' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'patches02a'\"
else
echo shar: Extracting \"'patches02a'\" \(54373 characters\)
sed "s/^X//" >'patches02a' <<'END_OF_FILE'
X*** opatchlevel.h
X--- patchlevel.h
X**************
X*** 1
X! #define PATCHLEVEL 1
X--- 1 -----
X! #define PATCHLEVEL 2
X*** onotes.v4
X--- notes.v4
X**************
X*** 18,23
X 9. merged do_lizard() and updlizard(). [used name do_lizard()].
X 10. fixed bug with getchar querys in makeworl.c.
X 11. fixed bug with y < MAPX mistype in randeven.c.
X
X -------------------------------------------------------------------------
X | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4 |
X--- 18,45 -----
X 9. merged do_lizard() and updlizard(). [used name do_lizard()].
X 10. fixed bug with getchar querys in makeworl.c.
X 11. fixed bug with y < MAPX mistype in randeven.c.
X+ ===4.0 patch number one released => 4.1 ==========================
X+ 12. fixed underflow problems with unsigned chars xloc,yloc,xcap,ycap.
X+ 13. misc.c(834): changed "owner=DCAPITOL" to "designation=DCAPITOL".
X+ 14. npc.c(171,172): changed rand()%2-1 to rand()%3-1.
X+ 15. randeven.c: put #ifdef MONSTER around nomad raid section.
X+ 16. reports.c(618): changed flthold() to fltmhold().
X+ 17. combat.c(488,510): changed "-=0" to "=0".
X+ 18. newlogin.c(507): changed temp < points to temp > points.
X+ 19. newlogin.c(795): added "& MAPY > 24".
X+ 20. extcmds.c(365): fixed check on same location for merging groups.
X+ 21. newhelp.c(163): added #ifdef for RANEVENT to newhelp.c.
X+ 22. altered map printing routines to send to stdout, and have stderr be
X+ for communicating with the user. so now "conqrun -p > foo" works.
X+ 23. removed password checking under -p option. would only be useful if
X+ OGOD was defined, and if that was the case, only god could get
X+ to that point anyway.
X+ 24. made copyright screen variable with screen size.
X+ 25. added TIMELOG feature to use system date command to show last update time.
X+ 26. made errormsg display on COLS-20 instead of 60. fixed up display bugs.
X+ 27. added more names to rebel name list.
X+ 28. worked on Makefile. [made sure of parallelism; ready to distribute]
X+ 29. reworded treasury display on budget screen for clarity.
X
X -------------------------------------------------------------------------
X | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4 |
X**************
X*** 22,27
X -------------------------------------------------------------------------
X | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4 |
X -------------------------------------------------------------------------
X o fix the helpfiles to reflect current changes in game as noted later in this
X file.
X o there is some overflow somewhere, which creates a huge amount of gold
X--- 44,52 -----
X -------------------------------------------------------------------------
X | 1.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4 |
X -------------------------------------------------------------------------
X+ o make land capture only occur during update.
X+ o make the create world routine interactive with curses display.
X+ o make the newlogin routine interactive with curses display.
X o fix the helpfiles to reflect current changes in game as noted later in this
X file.
X o there is some overflow somewhere, which creates a huge amount of gold
X**************
X*** 32,38
X o adjust spew.c and write new rules files for
X 1) random npc mail
X 2) npc delcarations of war
X! o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
X o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
X o implement sacking of capitol instead of destruction of nation. This
X should award all iron, gold and jewels to the successor, but leave
X--- 57,63 -----
X o adjust spew.c and write new rules files for
X 1) random npc mail
X 2) npc delcarations of war
X! o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
X o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
X o implement new method for detection of captured lands. if any allies of
X sector owner in sector, prevent taking of sector; otherwise, award
X**************
X*** 34,43
X 2) npc delcarations of war
X o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
X o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
X- o implement sacking of capitol instead of destruction of nation. This
X- should award all iron, gold and jewels to the successor, but leave
X- food (or a good portion of it) with the nation owner. This should
X- be implemented on all nations, including pcs.
X o implement new method for detection of captured lands. if any allies of
X sector owner in sector, prevent taking of sector; otherwise, award
X sector to nation with more troops if troops are twice the remaining
X--- 59,64 -----
X 2) npc delcarations of war
X o Treaty war delcarations only last one turn ???? It seems to revert sometimes.
X o reward for killing monsters 10K Gold and 1K Jewels per 50 men-equivalent.
X o implement new method for detection of captured lands. if any allies of
X sector owner in sector, prevent taking of sector; otherwise, award
X sector to nation with more troops if troops are twice the remaining
X**************
X*** 57,63
X in a city will have a 50% (+5% for added leader) chance of stopping a bad
X event.
X o All units should have loyalty ratings, and can revolt.
X- o Newlogin setup should be revamped to use curses display. Better control.
X o Revamp user help interface to allow searching through help files.
X o leader experience. mail to nation if happen. This has untold impacts on
X combat... and i dont want to touch it yet. sorry.
X--- 78,83 -----
X in a city will have a 50% (+5% for added leader) chance of stopping a bad
X event.
X o All units should have loyalty ratings, and can revolt.
X o Revamp user help interface to allow searching through help files.
X o leader experience. mail to nation if happen. This has untold impacts on
X combat... and i dont want to touch it yet. sorry.
X*** oheader.h
X--- header.h
X**************
X*** 49,54
X #define SPOOLDIR "/usr/spool/mail" /* location of mail spool */
X #define FILELOCK /* if your system supports BSD flock() */
X /* other file locking is not well implemented */
X
X #define NTOTAL 25 /* max # of nations ( player + npc + monster ) */
X #define MAXPTS 65 /* points for players to buy stuff with at start*/
X--- 49,55 -----
X #define SPOOLDIR "/usr/spool/mail" /* location of mail spool */
X #define FILELOCK /* if your system supports BSD flock() */
X /* other file locking is not well implemented */
X+ #define TIMELOG /* if your system has the date command */
X
X #define NTOTAL 25 /* max # of nations ( player + npc + monster ) */
X #define MAXPTS 65 /* points for players to buy stuff with at start*/
X*** odata.h
X--- data.h
X**************
X*** 900,906
X extern int unitmove[], unitattack[], unitdefend[];
X
X /* file name definitions */
X! extern char *sortname,*exefile,*datafile,*msgfile,*helpfile,*newsfile,*isonfile;
X
X #ifdef CONQUER
X extern int conq_mail_status;
X--- 900,907 -----
X extern int unitmove[], unitattack[], unitdefend[];
X
X /* file name definitions */
X! extern char *sortname,*exefile,*datafile,*msgfile;
X! extern char *helpfile,*newsfile,*isonfile,*timefile;
X
X #ifdef CONQUER
X extern int conq_mail_status;
X*** oadmin.c
X--- admin.c
X**************
X*** 178,195
X unlink(string);
X exit(SUCCESS);
X } else if (pflag) { /* print a map of the game */
X! #ifdef OGOD
X! if(strncmp(crypt(getpass("\nwhat is conquer super user password:"),SALT),ntn[0].passwd,PASSLTH)!=0) {
X! printf("sorry, must be super user to get map\n");
X! exit(FAIL);
X! }
X! #endif OGOD
X! printf("For Convienience, output is to stderr\n");
X! printf("what type of map\noptions are\n");
X! printf("\t1) altitudes\n\t2) vegetations\n");
X! printf("\t3) nations\n\n");
X! printf("\tINPUT:");
X! scanf("%hd",&dismode);
X if(dismode==1) printele();
X else if(dismode==2) printveg();
X else pr_ntns();
X--- 178,191 -----
X unlink(string);
X exit(SUCCESS);
X } else if (pflag) { /* print a map of the game */
X! fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
X! fprintf(stderr,"while the maps will be sent to stdout.\n\n");
X! fprintf(stderr,"\tThe valid options are,\n");
X! fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
X! fprintf(stderr,"\t\t3) nations\n\n");
X! fprintf(stderr,"\tWhat type of map? ");
X! scanf("%hd", &dismode);
X! fprintf(stderr,"\n");
X if(dismode==1) printele();
X else if(dismode==2) printveg();
X else pr_ntns();
X**************
X*** 222,227
X update();
X writedata();
X unlink(string);
X exit(SUCCESS);
X }
X printf("error: must specify an option\n");
X--- 218,227 -----
X update();
X writedata();
X unlink(string);
X+ #ifdef TIMELOG
X+ sprintf(string, "date > %s", timefile);
X+ system(string);
X+ #endif /* TIMELOG */
X exit(SUCCESS);
X }
X printf("error: must specify an option\n");
X*** oextcmds.c
X--- extcmds.c
X**************
X*** 269,276
X return;
X }
X
X! oldx=P_AXLOC;
X! oldy=P_AYLOC;
X army2=armynum;
X
X armynum=(-1);
X--- 269,276 -----
X return;
X }
X
X! oldx=(int)P_AXLOC;
X! oldy=(int)P_AYLOC;
X army2=armynum;
X
X armynum=(-1);
X**************
X*** 317,323
X {
X mvaddstr(LINES-1, 0, str);
X clrtoeol();
X! mvaddstr(LINES-1, 60, "PRESS ANY KEY");
X beep();
X refresh();
X getch();
X--- 317,323 -----
X {
X mvaddstr(LINES-1, 0, str);
X clrtoeol();
X! mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY");
X beep();
X refresh();
X getch();
X**************
X*** 362,368
X return;
X }
X if((P_AXLOC != curntn->arm[group].xloc)
X! &&(P_AXLOC != curntn->arm[group].xloc)){
X errormsg("units are not in same sector");
X return;
X }
X--- 362,368 -----
X return;
X }
X if((P_AXLOC != curntn->arm[group].xloc)
X! ||(P_AYLOC != curntn->arm[group].yloc)){
X errormsg("units are not in same sector");
X return;
X }
X*** omakeworl.c
X--- makeworl.c
X**************
X*** 45,51
X int rflag; /* TRUE if you wish to read in a map from mapfiles */
X {
X char passwd[PASSLTH+1],*getpass();
X! char newstring[100];
X FILE *fopen();
X
X /*abort if datafile currently exists*/
X--- 45,51 -----
X int rflag; /* TRUE if you wish to read in a map from mapfiles */
X {
X char passwd[PASSLTH+1],*getpass();
X! char newstring[200];
X FILE *fopen();
X
X /*abort if datafile currently exists*/
X**************
X*** 70,76
X
X printf("First, we must zero extraneous files from prior games\n");
X printf("\tignore any errors this causes\n");
X! sprintf(newstring,"rm -f %s* %s* %s* %s* %s 2> /dev/null",exefile,msgfile,newsfile,isonfile,tradefile);
X printf("\t%s\n",newstring);
X system(newstring);
X printf("OK This has been done, Now to set up a new world\n\n");
X--- 70,77 -----
X
X printf("First, we must zero extraneous files from prior games\n");
X printf("\tignore any errors this causes\n");
X! sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null",
X! exefile, msgfile, newsfile, isonfile, tradefile, timefile);
X printf("\t%s\n",newstring);
X system(newstring);
X printf("OK This has been done, Now to set up a new world\n\n");
X*** osort.c
X--- sort.c
X**************
X*** 27,32
X * Initial Revision: (adb@bucsf.bu.edu)
X * Tuesday March 21th, 1989 - Began the program at 23:26 EST
X * Wednesday March 22nd, 1989 - Finished the initial version 11:29 EST
X */
X
X #include <stdio.h>
X--- 27,33 -----
X * Initial Revision: (adb@bucsf.bu.edu)
X * Tuesday March 21th, 1989 - Began the program at 23:26 EST
X * Wednesday March 22nd, 1989 - Finished the initial version 11:29 EST
X+ * Wednesday July 5th, 1989 - Stopped use of sysexits.h 7:22 EST
X */
X
X #include <stdio.h>
X**************
X*** 30,38
X */
X
X #include <stdio.h>
X- #ifndef HPUX
X- #include <sysexits.h>
X- #endif HPUX
X #include <ctype.h>
X
X /* system definitions just in case */
X--- 31,36 -----
X */
X
X #include <stdio.h>
X #include <ctype.h>
X
X /* system definitions just in case */
X**************
X*** 39,45
X #ifndef FALSE
X #define FALSE (0)
X #define TRUE (1)
X! #endif
X
X /* check for system exit definitions */
X #ifndef EX_OK
X--- 37,43 -----
X #ifndef FALSE
X #define FALSE (0)
X #define TRUE (1)
X! #endif /* FALSE */
X
X /* system exit definitions from sysexits.h on BSD machines */
X #ifndef EX_OK
X**************
X*** 41,47
X #define TRUE (1)
X #endif
X
X! /* check for system exit definitions */
X #ifndef EX_OK
X #define EX_OK 0 /* successful termination */
X #define EX_USAGE 64 /* invalid command line format */
X--- 39,45 -----
X #define TRUE (1)
X #endif /* FALSE */
X
X! /* system exit definitions from sysexits.h on BSD machines */
X #ifndef EX_OK
X #define EX_OK 0 /* successful termination */
X #define EX_USAGE 64 /* invalid command line format */
X**************
X*** 48,54
X #define EX_NOINPUT 66 /* could not open input file */
X #define EX_SOFTWARE 70 /* software error; couldn't malloc */
X #define EX_CANTCREAT 73 /* could not create output file */
X! #endif
X
X /* number of characters to compare by default */
X #define DEFAULT_COMP 2
X--- 46,52 -----
X #define EX_NOINPUT 66 /* could not open input file */
X #define EX_SOFTWARE 70 /* software error; couldn't malloc */
X #define EX_CANTCREAT 73 /* could not create output file */
X! #endif /* EX_OK */
X
X /* number of characters to compare by default */
X #define DEFAULT_COMP 2
X*** orandeven.c
X--- randeven.c
X**************
X*** 5,11
X #include "data.h"
X
X #ifdef RANEVENT
X- #ifdef ADMIN
X char *names[] = { /* must end in single character name */
X "groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
X "lynn","zorb","theed","urda","X"
X--- 5,10 -----
X #include "data.h"
X
X #ifdef RANEVENT
X char *names[] = { /* must end in single character name */
X "groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
X "lynn","zorb","theed","urda","anima","bedlam","delos","quin",
X**************
X*** 8,14
X #ifdef ADMIN
X char *names[] = { /* must end in single character name */
X "groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
X! "lynn","zorb","theed","urda","X"
X };
X
X extern FILE *fnews;
X--- 7,14 -----
X #ifdef RANEVENT
X char *names[] = { /* must end in single character name */
X "groo","brok","vul","poin","srop","hoga","nobi","bonz","gail",
X! "lynn","zorb","theed","urda","anima","bedlam","delos","quin",
X! "xynd","putz","erde","clym","fanz","ilth","X"
X };
X
X extern FILE *fnews;
X**************
X*** 556,561
X curntn->jewels+=longval;
X break;
X case 25:
X /*nomad raid -- put large nomad army in area*/
X for( holdval=1;holdval<NTOTAL;holdval++ )
X if( ntn[holdval].active==NPC_NOMAD ) break;
X--- 556,562 -----
X curntn->jewels+=longval;
X break;
X case 25:
X+ #ifdef MONSTER
X /*nomad raid -- put large nomad army in area*/
X for( holdval=1;holdval<NTOTAL;holdval++ )
X if( ntn[holdval].active==NPC_NOMAD ) break;
X**************
X*** 591,596
X }
X done=TRUE;
X break;
X case 26:
X /*town burns -- reduce fort and redesignate*/
X holdval=0;
X--- 592,598 -----
X }
X done=TRUE;
X break;
X+ #endif MONSTER
X case 26:
X /*town burns -- reduce fort and redesignate*/
X holdval=0;
X**************
X*** 1105,1109
X weather()
X {
X }
X- #endif ADMIN
X #endif RANEVENT
X--- 1107,1110 -----
X weather()
X {
X }
X #endif RANEVENT
X*** omisc.c
X--- misc.c
X**************
X*** 831,837
X } else if(isnpc(curntn->active)) {
X if(sct[curntn->capx][curntn->capy].owner==country) {
X /* reset capitol for npcs */
X! sct[curntn->capx][curntn->capy].owner=DCAPITOL;
X if(sct[curntn->capx][curntn->capy].fortress<1)
X sct[curntn->capx][curntn->capy].fortress=1;
X }
X--- 831,837 -----
X } else if(isnpc(curntn->active)) {
X if(sct[curntn->capx][curntn->capy].owner==country) {
X /* reset capitol for npcs */
X! sct[curntn->capx][curntn->capy].designation=DCAPITOL;
X if(sct[curntn->capx][curntn->capy].fortress<1)
X sct[curntn->capx][curntn->capy].fortress=1;
X }
X*** oreports.c
X--- reports.c
X**************
X*** 91,98
X standend();
X mvprintw(ypos+1,xpos,"%ld",P_ASOLD);
X mvprintw(ypos+2,xpos,"%d",P_AMOVE);
X! mvprintw(ypos+3,xpos,"%d",P_AXLOC);
X! mvprintw(ypos+4,xpos,"%d",P_AYLOC);
X if(P_ASTAT>=NUMSTATUS)
X mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS);
X else
X--- 91,98 -----
X standend();
X mvprintw(ypos+1,xpos,"%ld",P_ASOLD);
X mvprintw(ypos+2,xpos,"%d",P_AMOVE);
X! mvprintw(ypos+3,xpos,"%d",(int)P_AXLOC);
X! mvprintw(ypos+4,xpos,"%d",(int)P_AYLOC);
X if(P_ASTAT>=NUMSTATUS)
X mvprintw(ypos+5,xpos,"group %d",P_ASTAT-NUMSTATUS);
X else
X**************
X*** 328,334
X standout();
X mvprintw(3,0, "nation name is......%s",curntn->name);
X standend();
X! mvprintw(4,0, "talons in treasury.$%ld",startgold);
X mvprintw(5,0, "number of sectors...%d",spread.sectors);
X if(curntn->tfood<2*curntn->tciv) standout();
X mvprintw(7,0, "granary holds.....%8ld",curntn->tfood);
X--- 328,334 -----
X standout();
X mvprintw(3,0, "nation name is......%s",curntn->name);
X standend();
X! mvprintw(4,0, "starting treasury..$%ld",startgold);
X mvprintw(5,0, "number of sectors...%d",spread.sectors);
X if(curntn->tfood<2*curntn->tciv) standout();
X mvprintw(7,0, "granary holds.....%8ld",curntn->tfood);
X**************
X*** 355,361
X money=spread.gold - curntn->tgold - money; /* net income */
X standend();
X mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
X! mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*curntn->charity)/100,0));
X standout();
X mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100-curntn->charity)/100);
X
X--- 355,361 -----
X money=spread.gold - curntn->tgold - money; /* net income */
X standend();
X mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
X! mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*(long)curntn->charity)/100L,0L));
X standout();
X mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100L-(long)curntn->charity)/100L);
X
X**************
X*** 357,363
X mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
X mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*curntn->charity)/100,0));
X standout();
X! mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100-curntn->charity)/100);
X
X mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
X mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
X--- 357,363 -----
X mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
X mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*(long)curntn->charity)/100L,0L));
X standout();
X! mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100L-(long)curntn->charity)/100L);
X
X mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
X mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
X**************
X*** 408,414
X standout();
X mvprintw(4,0, "nation name is....%s",curntn->name);
X standend();
X! mvprintw(5,0, "talons in treasury..$%ld",startgold);
X mvaddstr(7,0, "FOOD PRODUCTION");
X mvprintw(9,0, "granary now holds.........%8ld tons",curntn->tfood);
X mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood);
X--- 408,414 -----
X standout();
X mvprintw(4,0, "nation name is....%s",curntn->name);
X standend();
X! mvprintw(5,0, "talons in treasury..$%ld",curntn->tgold);
X mvaddstr(7,0, "FOOD PRODUCTION");
X mvprintw(9,0, "granary now holds.........%8ld tons",curntn->tfood);
X mvprintw(10,0, "%8ld people in farms..%8ld tons",spread.infarm,spread.food - curntn->tfood);
X**************
X*** 615,621
X crew = flthold(nvynum)*P_NCREW;
X people = fltmhold(nvynum)*P_NPEOP;
X crew += flthold(newnavy)*curntn->nvy[newnavy].crew;
X! people += flthold(newnavy)*curntn->nvy[newnavy].people;
X for(i=N_LIGHT;i<=N_HEAVY;i++) {
X (void) addwships(newnavy,i,P_NWAR(i));
X (void) addmships(newnavy,i,P_NMER(i));
X--- 615,621 -----
X crew = flthold(nvynum)*P_NCREW;
X people = fltmhold(nvynum)*P_NPEOP;
X crew += flthold(newnavy)*curntn->nvy[newnavy].crew;
X! people += fltmhold(newnavy)*curntn->nvy[newnavy].people;
X for(i=N_LIGHT;i<=N_HEAVY;i++) {
X (void) addwships(newnavy,i,P_NWAR(i));
X (void) addmships(newnavy,i,P_NMER(i));
X*** ocombat.c
X--- combat.c
X**************
X*** 484,491
X Aloss+=loss;
X ntn[owner[i]].arm[unit[i]].sold-=loss;
X if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==ATKR)) {
X! sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
X! ntn[owner[i]].arm[unit[i]].sold-=0;
X }
X }
X } else if(side[i]==DFND){
X--- 484,491 -----
X Aloss+=loss;
X ntn[owner[i]].arm[unit[i]].sold-=loss;
X if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==ATKR)) {
X! sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
X! ntn[owner[i]].arm[unit[i]].sold=0;
X }
X }
X } else if(side[i]==DFND){
X**************
X*** 506,513
X Dloss+=loss;
X ntn[owner[i]].arm[unit[i]].sold-=loss;
X if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==DFND)) {
X! sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
X! ntn[owner[i]].arm[unit[i]].sold-=0;
X }
X }
X }
X--- 506,513 -----
X Dloss+=loss;
X ntn[owner[i]].arm[unit[i]].sold-=loss;
X if((ntn[owner[i]].arm[unit[i]].unittyp==A_MILITIA)&&(retreatside==DFND)) {
X! sct[ntn[owner[i]].arm[unit[i]].xloc][ntn[owner[i]].arm[unit[i]].yloc].people += ntn[owner[i]].arm[unit[i]].sold;
X! ntn[owner[i]].arm[unit[i]].sold=0;
X }
X }
X }
X*** omove.c
X--- move.c
X**************
X*** 165,171
X }
X for(i=0;i<MAXARM;i++) if(curntn->arm[i].sold>0){
X standout();
X! see(curntn->arm[i].xloc-xoffset,curntn->arm[i].yloc-yoffset);
X }
X for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
X standout();
X--- 165,171 -----
X }
X for(i=0;i<MAXARM;i++) if(curntn->arm[i].sold>0){
X standout();
X! see((int)curntn->arm[i].xloc-xoffset,(int)curntn->arm[i].yloc-yoffset);
X }
X for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
X standout();
X**************
X*** 169,175
X }
X for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
X standout();
X! see(curntn->nvy[i].xloc-xoffset,curntn->nvy[i].yloc-yoffset);
X
X }
X } else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X--- 169,175 -----
X }
X for(i=0;i<MAXNAVY;i++) if(curntn->nvy[i].merchant+curntn->nvy[i].warships+curntn->nvy[i].galleys!=0){
X standout();
X! see((int)curntn->nvy[i].xloc-xoffset,(int)curntn->nvy[i].yloc-yoffset);
X
X }
X } else for(i=XREAL-xoffset-1;i<=XREAL-xoffset+1;i++){
X*** oupdate.c
X--- update.c
X**************
X*** 271,280
X ||( P_ATYPE>=MINLEADER)) menok=TRUE;
X else menok=FALSE;
X /* range of 4 if menok is FALSE else 2 */
X! for(x=P_AXLOC-4+menok*2;x<=P_AXLOC+4-menok*2;x++)
X! for(y=P_AYLOC-4+menok*2;y<=P_AYLOC+4-menok*2;y++) if(ONMAP(x,y))
X! if( menok==TRUE || ISCITY(sct[x][y].designation) )
X! sum+=attr[x][y];
X }
X
X if(sum==0) {
X--- 271,283 -----
X ||( P_ATYPE>=MINLEADER)) menok=TRUE;
X else menok=FALSE;
X /* range of 4 if menok is FALSE else 2 */
X! for(x=(int)P_AXLOC-4+menok*2;x<=(int)P_AXLOC+4-menok*2;x++)
X! for(y=(int)P_AYLOC-4+menok*2;y<=(int)P_AYLOC+4-menok*2;y++) {
X! if(ONMAP(x,y)) {
X! if( menok==TRUE || ISCITY(sct[x][y].designation) )
X! sum+=attr[x][y];
X! }
X! }
X }
X
X if(sum==0) {
X**************
X*** 313,320
X } else {
X where=rand()%sum;
X /* range of 4 if menok is FALSE else 2 */
X! for(x=P_AXLOC-4+menok*2;x<=P_AXLOC+4-menok*2;x++)
X! for(y=P_AYLOC-4+menok*2;y<=P_AYLOC+4-menok*2;y++) if(ONMAP(x,y)){
X if( menok==TRUE || ISCITY(sct[x][y].designation) )
X where -= attr[x][y];
X if( (where < 0 )
X--- 316,324 -----
X } else {
X where=rand()%sum;
X /* range of 4 if menok is FALSE else 2 */
X! for(x=(int)P_AXLOC-4+menok*2;x<=(int)P_AXLOC+4-menok*2;x++)
X! for(y=(int)P_AYLOC-4+menok*2;y<=(int)P_AYLOC+4-menok*2;y++)
X! if(ONMAP(x,y)){
X if( menok==TRUE || ISCITY(sct[x][y].designation) )
X where -= attr[x][y];
X if( (where < 0 )
X**************
X*** 320,326
X if( (where < 0 )
X && movecost[x][y]>=1
X && movecost[x][y]<=P_AMOVE
X! &&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X P_AYLOC=y;
X if(P_ATYPE == getleader(curntn->class)-1 ){
X--- 324,330 -----
X if( (where < 0 )
X && movecost[x][y]>=1
X && movecost[x][y]<=P_AMOVE
X! &&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X P_AYLOC=y;
X if(P_ATYPE == getleader(curntn->class)-1 ){
X**************
X*** 355,361
X
X /*do again - have this block if lots of bad terrain*/
X /*what could happen is that it won't find a move first time*/
X! for(x=P_AXLOC-2;x<=P_AXLOC+2;x++) for(y=P_AYLOC-2;y<=P_AYLOC+2;y++) {
X if(!ONMAP(x,y))
X continue;
X
X--- 359,366 -----
X
X /*do again - have this block if lots of bad terrain*/
X /*what could happen is that it won't find a move first time*/
X! for(x=(int)P_AXLOC-2;x<=(int)P_AXLOC+2;x++)
X! for(y=(int)P_AYLOC-2;y<=(int)P_AYLOC+2;y++) {
X if(!ONMAP(x,y))
X continue;
X
X**************
X*** 613,620
X }
X
X /*if near capitol add to attr*/
X! for(x=curntn->capx-2;x<=curntn->capx+2;x++)
X! for(y=curntn->capy-2;y<=curntn->capy+2;y++)
X if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
X
X /*MOVE CIVILIANS based on the ratio of attractivenesses
X--- 618,625 -----
X }
X
X /*if near capitol add to attr*/
X! for(x=(int)curntn->capx-2;x<=(int)curntn->capx+2;x++)
X! for(y=(int)curntn->capy-2;y<=(int)curntn->capy+2;y++)
X if((ONMAP(x,y))&&(attr[x][y]>0)) attr[x][y]+=20;
X
X /*MOVE CIVILIANS based on the ratio of attractivenesses
X**************
X*** 695,702
X /* try to relieve sieges */
X if(P_ASTAT!=SIEGED
X && ntn[country].arm[armynum-1].stat!=SIEGED) {
X! for(i=ntn[country].arm[armynum-1].xloc-1;i<=ntn[country].arm[armynum-1].xloc+1;i++) {
X! for(j=ntn[country].arm[armynum-1].yloc-1;j<=ntn[country].arm[armynum-1].yloc+1;j++) {
X if(ONMAP(i,j)
X &&(sct[i][j].altitude!=WATER)
X &&(sct[i][j].altitude!=PEAK)
X--- 700,707 -----
X /* try to relieve sieges */
X if(P_ASTAT!=SIEGED
X && ntn[country].arm[armynum-1].stat!=SIEGED) {
X! for(i=(int)ntn[country].arm[armynum-1].xloc-1;i<=ntn[country].arm[armynum-1].xloc+1;i++) {
X! for(j=(int)ntn[country].arm[armynum-1].yloc-1;j<=ntn[country].arm[armynum-1].yloc+1;j++) {
X if(ONMAP(i,j)
X &&(sct[i][j].altitude!=WATER)
X &&(sct[i][j].altitude!=PEAK)
X**************
X*** 804,810
X fprintf(fm,"Message from Conquer\n\n");
X fprintf(fm,"\tYour Scouting Unit %d was captured\n");
X fprintf(fm,"\t by %s military in sector %d,%d\n",
X! ntn[occval].name,P_AXLOC,P_AYLOC);
X mailclose();
X }
X if (ispc(ntn[occval].active)) {
X--- 809,815 -----
X fprintf(fm,"Message from Conquer\n\n");
X fprintf(fm,"\tYour Scouting Unit %d was captured\n");
X fprintf(fm,"\t by %s military in sector %d,%d\n",
X! ntn[occval].name,(int)P_AXLOC,(int)P_AYLOC);
X mailclose();
X }
X if (ispc(ntn[occval].active)) {
X**************
X*** 811,817
X mailopen(occval);
X fprintf(fm,"Message from Conquer\n\n");
X fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
X! fprintf(fm,"\t in sector %d,%d.\n",P_AXLOC,P_AYLOC);
X mailclose();
X }
X }
X--- 816,822 -----
X mailopen(occval);
X fprintf(fm,"Message from Conquer\n\n");
X fprintf(fm,"\tA Scout from nation %s was captured\n",curntn->name);
X! fprintf(fm,"\t in sector %d,%d.\n",(int)P_AXLOC,(int)P_AYLOC);
X mailclose();
X }
X }
X*** ocommands.c
X--- commands.c
X**************
X*** 875,881
X if(isgod==TRUE) reset_god();
X return;
X } else if(i_cost > curntn->metals) {
X! mvprintw(LINES-2,0,"You don't have %ld metal",i_cost);
X clrtoeol();
X refresh();
X getch();
X--- 875,882 -----
X if(isgod==TRUE) reset_god();
X return;
X } else if(i_cost > curntn->metals) {
X! mvprintw(LINES-1,0,"You don't have %ld metal",i_cost);
X! mvprintw(LINES-1,COLS-20,"PRESS ANY KEY");
X clrtoeol();
X refresh();
X getch();
X**************
X*** 959,965
X P_AYLOC = ntn[i].capy;
X P_AXLOC = ntn[i].capx;
X mvprintw(LINES-2,0,"The Spy Starts in %s's Capitol (%d,%d)",
X! ntn[i].name,P_AXLOC,P_AYLOC);
X clrtoeol();
X } else {
X clear_bottom(0);
X--- 960,966 -----
X P_AYLOC = ntn[i].capy;
X P_AXLOC = ntn[i].capx;
X mvprintw(LINES-2,0,"The Spy Starts in %s's Capitol (%d,%d)",
X! ntn[i].name,(int)P_AXLOC,(int)P_AYLOC);
X clrtoeol();
X } else {
X clear_bottom(0);
X**************
X*** 973,979
X P_AYLOC = YREAL;
X P_AXLOC = XREAL;
X mvprintw(LINES-2,0,"Intelligence indicates that %s lies to the %s",ntn[i].name,
X! *(directions+compass(P_AXLOC,P_AYLOC,ntn[i].capx,ntn[i].capy)));
X clrtoeol();
X }
X errormsg("");
X--- 974,981 -----
X P_AYLOC = YREAL;
X P_AXLOC = XREAL;
X mvprintw(LINES-2,0,"Intelligence indicates that %s lies to the %s",ntn[i].name,
X! *(directions+compass((int)P_AXLOC,(int)P_AYLOC,
X! (int)ntn[i].capx,(int)ntn[i].capy)));
X clrtoeol();
X }
X errormsg("");
X**************
X*** 1294,1301
X if(P_ASOLD <= 0) return(0);
X }
X /*move to correct location*/
X! xcurs = P_AXLOC - xoffset;
X! ycurs = P_AYLOC - yoffset;
X coffmap();
X
X /*select correct unit*/
X--- 1296,1303 -----
X if(P_ASOLD <= 0) return(0);
X }
X /*move to correct location*/
X! xcurs = (int)P_AXLOC - xoffset;
X! ycurs = (int)P_AYLOC - yoffset;
X coffmap();
X
X /*select correct unit*/
X*** oio.c
X--- io.c
X**************
X*** 47,53
X printele()
X {
X register int X, Y;
X! printf("doing print of altitude\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) putc(sct[X][Y].altitude,stdout);
X putc('\n',stdout);
X--- 47,53 -----
X printele()
X {
X register int X, Y;
X! fprintf(stderr,"doing print of altitude\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) putc(sct[X][Y].altitude,stdout);
X putc('\n',stdout);
X**************
X*** 62,68
X pr_ntns()
X {
X register int X, Y;
X! printf("doing print of nations\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if(sct[X][Y].owner==0)
X--- 62,68 -----
X pr_ntns()
X {
X register int X, Y;
X! fprintf(stderr,"doing print of nations\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if(sct[X][Y].owner==0)
X**************
X*** 66,73
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if(sct[X][Y].owner==0)
X! putc(sct[X][Y].altitude,stderr);
X! else putc(ntn[sct[X][Y].owner].mark,stderr);
X }
X putc('\n',stderr);
X }
X--- 66,73 -----
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if(sct[X][Y].owner==0)
X! putc(sct[X][Y].altitude,stdout);
X! else putc(ntn[sct[X][Y].owner].mark,stdout);
X }
X putc('\n',stdout);
X }
X**************
X*** 69,75
X putc(sct[X][Y].altitude,stderr);
X else putc(ntn[sct[X][Y].owner].mark,stderr);
X }
X! putc('\n',stderr);
X }
X }
X #endif ADMIN
X--- 69,75 -----
X putc(sct[X][Y].altitude,stdout);
X else putc(ntn[sct[X][Y].owner].mark,stdout);
X }
X! putc('\n',stdout);
X }
X }
X #endif ADMIN
X**************
X*** 124,130
X
X /*read in existing nation army and navy data*/
X /*check if file openable*/
X! printf("reading data file\n");
X if( (fd = open(datafile,0)) < 0 ) {
X fprintf( stderr, "can not open %s \n", datafile );
X fprintf( stderr, "for help with conquer, type conquer -h\n");
X--- 124,130 -----
X
X /*read in existing nation army and navy data*/
X /*check if file openable*/
X! fprintf(stderr,"reading data file\n");
X if( (fd = open(datafile,0)) < 0 ) {
X fprintf( stderr, "can not open %s \n", datafile );
X fprintf( stderr, "for help with conquer, type conquer -h\n");
X**************
X*** 176,182
X printveg()
X {
X register int X, Y;
X! printf("doing print of vegetation\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stderr);
X putc('\n',stderr);
X--- 176,182 -----
X printveg()
X {
X register int X, Y;
X! fprintf(stderr,"doing print of vegetation\n");
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stdout);
X putc('\n',stdout);
X**************
X*** 178,185
X register int X, Y;
X printf("doing print of vegetation\n");
X for(Y=0;Y<MAPY;Y++) {
X! for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stderr);
X! putc('\n',stderr);
X }
X }
X #endif ADMIN
X--- 178,185 -----
X register int X, Y;
X fprintf(stderr,"doing print of vegetation\n");
X for(Y=0;Y<MAPY;Y++) {
X! for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stdout);
X! putc('\n',stdout);
X }
X }
X #endif ADMIN
X**************
X*** 268,273
X {
X int i;
X int nationid; /*current nation id */
X
X printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
X PSEASON(TURN),YEAR(TURN), TURN);
X--- 268,277 -----
X {
X int i;
X int nationid; /*current nation id */
X+ #ifdef TIMELOG
X+ FILE *timefp, *fopen();
X+ char timestr[80];
X+ #endif /* TIMELOG */
X
X printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
X PSEASON(TURN),YEAR(TURN), TURN);
X**************
X*** 271,276
X
X printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
X PSEASON(TURN),YEAR(TURN), TURN);
X printf("id name race class align score talons military civilians sect\n");
X for (nationid=1; nationid<NTOTAL; nationid++) {
X if(!isntn(ntn[nationid].active)) continue;
X--- 275,287 -----
X
X printf("Conquer %s.%d: %s of Year %d, Turn %d\n",VERSION,PATCHLEVEL,
X PSEASON(TURN),YEAR(TURN), TURN);
X+ #ifdef TIMELOG
X+ if ((timefp=fopen(timefile,"r"))!=NULL) {
X+ fgets(timestr, 50, timefp);
X+ printf("Last Update: %s", timestr);
X+ fclose(timefp);
X+ }
X+ #endif /* TIMELOG */
X printf("id name race class align score talons military civilians sect\n");
X for (nationid=1; nationid<NTOTAL; nationid++) {
X if(!isntn(ntn[nationid].active)) continue;
X*** onewhelp.c
X--- newhelp.c
X**************
X*** 160,165
X fprintf(fp,"s/ZSTOCKCOST/%d/g\n",STOCKCOST);
X
X /* other defines */
X fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
X fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
X fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
X--- 160,166 -----
X fprintf(fp,"s/ZSTOCKCOST/%d/g\n",STOCKCOST);
X
X /* other defines */
X+ #ifdef RANEVENT
X fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
X #else
X fprintf(fp,"s/XNORANDEVENTS/0/g\n");
X**************
X*** 161,166
X
X /* other defines */
X fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
X fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
X fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
X fprintf(fp,"s/XARMYSEE/%d/g\n",ARMYSEE);
X--- 162,170 -----
X /* other defines */
X #ifdef RANEVENT
X fprintf(fp,"s/XNORANDEVENTS/%d/g\n",RANEVENT);
X+ #else
X+ fprintf(fp,"s/XNORANDEVENTS/0/g\n");
X+ #endif
X fprintf(fp,"s/XLANDSEE/%d/g\n",LANDSEE);
X fprintf(fp,"s/XNAVYSEE/%d/g\n",NAVYSEE);
X fprintf(fp,"s/XARMYSEE/%d/g\n",ARMYSEE);
X*** odata.c
X--- data.c
X**************
X*** 181,186
X char *exefile = "exec";
X char *datafile = "data";
X char *msgfile = "mesg";
X char *sortname = "conqsort";
X
X #ifdef ADMIN
X--- 181,187 -----
X char *exefile = "exec";
X char *datafile = "data";
X char *msgfile = "mesg";
X+ char *timefile = "timelog";
X char *sortname = "conqsort";
X
X #ifdef ADMIN
X*** omagic.c
X--- magic.c
X**************
X*** 377,384
X if(newpower==DESTROYER) {
X /* this ifdef is so that destroyer only takes place in an update */
X #ifdef ADMIN
X! for(x=curntn->capx-3;x<=curntn->capx+3;x++) {
X! for(y=curntn->capy-3;y<=curntn->capy+3;y++){
X if((ONMAP(x,y))
X &&(sct[x][y].altitude!=WATER)
X #ifdef DERVDESG
X--- 377,384 -----
X if(newpower==DESTROYER) {
X /* this ifdef is so that destroyer only takes place in an update */
X #ifdef ADMIN
X! for(x=(int)curntn->capx-3;x<=(int)curntn->capx+3;x++) {
X! for(y=(int)curntn->capy-3;y<=(int)curntn->capy+3;y++){
X if((ONMAP(x,y))
X &&(sct[x][y].altitude!=WATER)
X #ifdef DERVDESG
X**************
X*** 723,730
X return;
X }
X if(oldpower==DESTROYER) {
X! for(x=curntn->capx-3;x<=curntn->capx+3;x++) {
X! for(y=curntn->capy-3;y<=curntn->capy+3;y++){
X if((ONMAP(x,y))
X &&(sct[x][y].altitude!=WATER)
X &&((x!=curntn->capx)
X--- 723,730 -----
X return;
X }
X if(oldpower==DESTROYER) {
X! for(x=(int)curntn->capx-3;x<=(int)curntn->capx+3;x++) {
X! for(y=(int)curntn->capy-3;y<=(int)curntn->capy+3;y++){
X if((ONMAP(x,y))
X &&(sct[x][y].altitude!=WATER)
X &&((x!=curntn->capx)
X*** onewlogin.c
X--- newlogin.c
X**************
X*** 504,510
X printf("how many purchasing points to spend?:");
X scanf("%d",&temp);
X putchar('\n');
X! if(temp < points) {
X printf("You don't have enough points left");
X } else if (temp < 0) {
X printf("Negative, huh? Who you trying to kid?");
X--- 504,510 -----
X printf("how many purchasing points to spend?:");
X scanf("%d",&temp);
X putchar('\n');
X! if(temp > points) {
X printf("You don't have enough points left");
X } else if (temp < 0) {
X printf("Negative, huh? Who you trying to kid?");
X**************
X*** 792,798
X &&( sct[i][j].owner!=0)) placed=0;
X }
X } else {
X! if(MAPX>24){
X x = rand()%(MAPX-24)+12;
X y = rand()%(MAPY-24)+12;
X }else {
X--- 792,798 -----
X &&( sct[i][j].owner!=0)) placed=0;
X }
X } else {
X! if(MAPX>24 && MAPY>24){
X x = rand()%(MAPX-24)+12;
X y = rand()%(MAPY-24)+12;
X }else {
X*** odisplay.c
X--- display.c
X**************
X*** 408,415
X
X for(nvynum=0;nvynum<MAXNAVY;nvynum++)
X if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0))
X! for(i=P_NXLOC-xoffset-NAVYSEE;i<=P_NXLOC-xoffset+NAVYSEE;i++)
X! for(j=P_NYLOC-yoffset-NAVYSEE;j<=P_NYLOC-yoffset+NAVYSEE;j++)
X if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X
X--- 408,415 -----
X
X for(nvynum=0;nvynum<MAXNAVY;nvynum++)
X if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0))
X! for(i=(int)P_NXLOC-xoffset-NAVYSEE;i<=(int)P_NXLOC-xoffset+NAVYSEE;i++)
X! for(j=(int)P_NYLOC-yoffset-NAVYSEE;j<=(int)P_NYLOC-yoffset+NAVYSEE;j++)
X if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X
X**************
X*** 415,422
X
X for(armynum=0;armynum<MAXARM;armynum++)
X if(P_ASOLD>0)
X! for(i=P_AXLOC-xoffset-ARMYSEE;i<=P_AXLOC-xoffset+ARMYSEE;i++)
X! for(j=P_AYLOC-yoffset-ARMYSEE;j<=P_AYLOC-yoffset+ARMYSEE;j++)
X if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X
X--- 415,422 -----
X
X for(armynum=0;armynum<MAXARM;armynum++)
X if(P_ASOLD>0)
X! for(i=(int)P_AXLOC-xoffset-ARMYSEE;i<=(int)P_AXLOC-xoffset+ARMYSEE;i++)
X! for(j=(int)P_AYLOC-yoffset-ARMYSEE;j<=(int)P_AYLOC-yoffset+ARMYSEE;j++)
X if(i>=0 && j>=0 && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X
X*** omain.c
X--- main.c
X**************
X*** 211,222
X }
X
X initscr(); /* SET UP THE SCREEN */
X- copyscreen(); /* copyright screen */
X- /* note the getch() later - everything between
X- now and then is non-interactive */
X- init_hasseen(); /* now we know how big the screen is,
X- we can init that array! */
X-
X /* check terminal size */
X if (COLS<80 || LINES<24) {
X fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
X--- 211,216 -----
X }
X
X initscr(); /* SET UP THE SCREEN */
X /* check terminal size */
X if (COLS<80 || LINES<24) {
X fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
X**************
X*** 222,228
X fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
X fprintf(stderr,"please try again with a different setup\n");
X beep();
X- refresh();
X getch();
X bye(FALSE);
X }
X--- 216,221 -----
X fprintf(stderr,"%s: terminal should be at least 80x24\n",argv[0]);
X fprintf(stderr,"please try again with a different setup\n");
X beep();
X getch();
X bye(FALSE);
X }
X**************
X*** 227,232
X bye(FALSE);
X }
X
X strcpy(fison,"START"); /* just in case you abort early */
X crmode(); /* cbreak mode */
X
X--- 220,231 -----
X bye(FALSE);
X }
X
X+ copyscreen(); /* copyright screen */
X+ /* note the getch() later - everything between
X+ now and then is non-interactive */
X+ init_hasseen(); /* now we know how big the screen is,
X+ we can init that array! */
X+
X strcpy(fison,"START"); /* just in case you abort early */
X crmode(); /* cbreak mode */
X
X**************
X*** 263,269
X #endif TRADE
X if(curntn->capx>15) {
X xcurs=15;
X! xoffset= (curntn->capx-15);
X } else {
X xcurs= curntn->capx;
X xoffset= 0;
X--- 262,268 -----
X #endif TRADE
X if(curntn->capx>15) {
X xcurs=15;
X! xoffset= ((int)curntn->capx-15);
X } else {
X xcurs= curntn->capx;
X xoffset= 0;
X**************
X*** 270,276
X }
X if(curntn->capy>10) {
X ycurs=10;
X! yoffset= (curntn->capy-10);
X } else {
X yoffset= 0;
X ycurs= curntn->capy;
X--- 269,275 -----
X }
X if(curntn->capy>10) {
X ycurs=10;
X! yoffset= ((int)curntn->capy-10);
X } else {
X yoffset= 0;
X ycurs= curntn->capy;
X**************
X*** 692,698
X } else {
X if(curntn->capx>15) {
X xcurs=15;
X! xoffset= (curntn->capx-15);
X } else {
X xcurs= curntn->capx;
X xoffset= 0;
X--- 691,697 -----
X } else {
X if(curntn->capx>15) {
X xcurs=15;
X! xoffset= ((int)curntn->capx-15);
X } else {
X xcurs= curntn->capx;
X xoffset= 0;
X**************
X*** 699,705
X }
X if(curntn->capy>10) {
X ycurs=10;
X! yoffset= (curntn->capy-10);
X } else {
X yoffset= 0;
X ycurs= curntn->capy;
X--- 698,704 -----
X }
X if(curntn->capy>10) {
X ycurs=10;
X! yoffset= ((int)curntn->capy-10);
X } else {
X yoffset= 0;
X ycurs= curntn->capy;
X**************
X*** 1012,1017
X void
X copyscreen()
X {
X clear();
X standout();
X mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
X--- 1011,1021 -----
X void
X copyscreen()
X {
X+ #ifdef TIMELOG
X+ FILE *timefp, *fopen();
X+ char string[80];
X+ #endif /* TIMELOG */
X+
X clear();
X standout();
X mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
X**************
X*** 1014,1020
X {
X clear();
X standout();
X! mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
X standend();
X mvaddstr(10,19, "Copyright (c) 1988 by Edward M Barlow");
X mvaddstr(11,18,"Written Edward M Barlow and Adam Bryant");
X--- 1018,1024 -----
X
X clear();
X standout();
X! mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
X standend();
X mvaddstr(10,COLS/2-21, "Copyright (c) 1988 by Edward M Barlow");
X mvaddstr(11,COLS/2-22,"Written Edward M Barlow and Adam Bryant");
X**************
X*** 1016,1029
X standout();
X mvprintw(8,28,"Conquer %s.%d",VERSION,PATCHLEVEL);
X standend();
X! mvaddstr(10,19, "Copyright (c) 1988 by Edward M Barlow");
X! mvaddstr(11,18,"Written Edward M Barlow and Adam Bryant");
X! mvaddstr(12,26,"All Rights Reserved");
X! mvaddstr(LINES-7,19,"This version is for personal use only");
X! mvaddstr(LINES-5,8,"It is expressly forbidden port this software to any form of");
X! mvaddstr(LINES-4,8,"Personal Computer or to redistribute this software without");
X! mvaddstr(LINES-3,14,"the permission of Edward Barlow or Adam Bryant");
X! mvprintw(LINES-1, 60, "PRESS ANY KEY");
X refresh();
X }
X
X--- 1020,1040 -----
X standout();
X mvprintw(8,COLS/2-12,"Conquer %s.%d",VERSION,PATCHLEVEL);
X standend();
X! mvaddstr(10,COLS/2-21, "Copyright (c) 1988 by Edward M Barlow");
X! mvaddstr(11,COLS/2-22,"Written Edward M Barlow and Adam Bryant");
X! mvaddstr(12,COLS/2-12,"All Rights Reserved");
X! mvaddstr(LINES-8,COLS/2-21,"This version is for personal use only");
X! mvaddstr(LINES-6,COLS/2-32,"It is expressly forbidden port this software to any form of");
X! mvaddstr(LINES-5,COLS/2-32,"Personal Computer or to redistribute this software without");
X! mvaddstr(LINES-4,COLS/2-26,"the permission of Edward Barlow or Adam Bryant");
X! #ifdef TIMELOG
X! if ((timefp=fopen(timefile,"r"))!=NULL) {
X! fgets(string, 50, timefp);
X! mvprintw(LINES-1, 0, "Last Update: %s", string);
X! fclose(timefp);
X! }
X! #endif /* TIMELOG */
X! mvprintw(LINES-1, COLS-20, "PRESS ANY KEY");
X refresh();
X }
X
X*** onpc.c
X--- npc.c
X**************
X*** 29,35
X int x,y;
X /* FOR TESTING OF WHAT THE ATTRACTIVENESS ENDS UP LIKE */
X printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
X! for(y=curntn->capy-3;y<curntn->capy+4;y++) {
X printf("\n");
X for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X--- 29,35 -----
X int x,y;
X /* FOR TESTING OF WHAT THE ATTRACTIVENESS ENDS UP LIKE */
X printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
X! for(y=(int)curntn->capy-3;y<(int)curntn->capy+4;y++) {
X printf("\n");
X for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X**************
X*** 31,37
X printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
X for(y=curntn->capy-3;y<curntn->capy+4;y++) {
X printf("\n");
X! for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X printf("[%2d,%2d] ",x,y);
X }
X--- 31,37 -----
X printf("Attractiveness for sectors around CAPITAL at %d %d veg alt des\n",curntn->capx,curntn->capy);
X for(y=(int)curntn->capy-3;y<(int)curntn->capy+4;y++) {
X printf("\n");
X! for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X printf("[%2d,%2d] ",x,y);
X }
X**************
X*** 37,43
X }
X }
X printf("\n");
X! for(x=curntn->capx-3;x<curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X printf("%5d %c%c%c "
X ,attr[x][y]
X--- 37,43 -----
X }
X }
X printf("\n");
X! for(x=(int)curntn->capx-3;x<(int)curntn->capx+4;x++) if(ONMAP(x,y)) {
X if( sct[x][y].altitude != WATER ) {
X printf("%5d %c%c%c "
X ,attr[x][y]
X**************
X*** 111,118
X }
X count=0;
X while( TRUE ) {
X! x=P_AXLOC+rand()%5-2;
X! y=P_AYLOC+rand()%5-2;
X
X if( count++ > 100 ) {
X P_ASOLD=0;
X--- 111,118 -----
X }
X count=0;
X while( TRUE ) {
X! x=(int)P_AXLOC+rand()%5-2;
X! y=(int)P_AYLOC+rand()%5-2;
X
X if( count++ > 100 ) {
X P_ASOLD=0;
X**************
X*** 122,128
X if(( x==P_AXLOC && y==P_AYLOC )
X ||(!ONMAP(x,y)
X ||(!is_habitable(x,y)))
X! ||(!land_reachp(P_AXLOC,P_AYLOC,x,y,curntn->maxmove,country))) continue;
X
X P_AXLOC=x;
X P_AYLOC=y;
X--- 122,129 -----
X if(( x==P_AXLOC && y==P_AYLOC )
X ||(!ONMAP(x,y)
X ||(!is_habitable(x,y)))
X! ||(!land_reachp((int)P_AXLOC,(int)P_AYLOC,
X! x,y,curntn->maxmove,country))) continue;
X
X P_AXLOC=x;
X P_AYLOC=y;
X**************
X*** 167,174
X P_ASOLD /= 100;
X }
X P_AMOVE=(curntn->maxmove * *(unitmove+P_ATYPE%UTYPE))/10;
X! x=P_AXLOC+rand()%2-1;
X! y=P_AYLOC+rand()%2-1;
X if(ONMAP(x,y)&&(is_habitable(x,y))
X &&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X--- 168,175 -----
X P_ASOLD /= 100;
X }
X P_AMOVE=(curntn->maxmove * *(unitmove+P_ATYPE%UTYPE))/10;
X! x=(int)P_AXLOC+rand()%3-1;
X! y=(int)P_AYLOC+rand()%3-1;
X if(ONMAP(x,y)&&(is_habitable(x,y))
X &&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X**************
X*** 170,176
X x=P_AXLOC+rand()%2-1;
X y=P_AYLOC+rand()%2-1;
X if(ONMAP(x,y)&&(is_habitable(x,y))
X! &&(land_reachp(P_AXLOC,P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X P_AYLOC=y;
X /*if owned & unoccupied you take & people flee*/
X--- 171,177 -----
X x=(int)P_AXLOC+rand()%3-1;
X y=(int)P_AYLOC+rand()%3-1;
X if(ONMAP(x,y)&&(is_habitable(x,y))
X! &&(land_reachp((int)P_AXLOC,(int)P_AYLOC,x,y,P_AMOVE,country))){
X P_AXLOC=x;
X P_AYLOC=y;
X /*if owned & unoccupied you take & people flee*/
X**************
X*** 244,251
X for(y=0;y<MAXNAVY;y++)
X if(ntn[x].nvy[y].warships!=0 || ntn[x].nvy[y].merchant!=0
X || ntn[x].nvy[y].galleys!=0) {
X! if((abs(ntn[x].nvy[y].xloc-P_NXLOC)<=PRTZONE)
X! &&(abs(ntn[x].nvy[y].yloc-P_NYLOC)<=PRTZONE)) {
X P_NXLOC= ntn[x].nvy[y].xloc;
X P_NYLOC= ntn[x].nvy[y].yloc;
X }
X--- 245,252 -----
X for(y=0;y<MAXNAVY;y++)
X if(ntn[x].nvy[y].warships!=0 || ntn[x].nvy[y].merchant!=0
X || ntn[x].nvy[y].galleys!=0) {
X! if((abs((int)ntn[x].nvy[y].xloc-(int)P_NXLOC)<=PRTZONE)
X! &&(abs((int)ntn[x].nvy[y].yloc-(int)P_NYLOC)<=PRTZONE)) {
X P_NXLOC= ntn[x].nvy[y].xloc;
X P_NYLOC= ntn[x].nvy[y].yloc;
X }
X**************
X*** 359,366
X for(armynum=1;armynum<MAXARM;armynum++) if(P_ASOLD>0){
X /* move army back if too far out */
X ok = 0;
X! for(x=P_AXLOC-3;x<=P_AXLOC+3;x++)
X! for(y=P_AYLOC-3;y<=P_AYLOC+3;y++)
X if((ONMAP(x,y))&&(sct[x][y].owner==country)) ok=1;
X if(ok==0){
X P_AXLOC=curntn->capx;
X--- 360,367 -----
X for(armynum=1;armynum<MAXARM;armynum++) if(P_ASOLD>0){
X /* move army back if too far out */
X ok = 0;
X! for(x=(int)P_AXLOC-3;x<=(int)P_AXLOC+3;x++)
X! for(y=(int)P_AYLOC-3;y<=(int)P_AYLOC+3;y++)
X if((ONMAP(x,y))&&(sct[x][y].owner==country)) ok=1;
X if(ok==0){
X P_AXLOC=curntn->capx;
X**************
X*** 727,734
X hostile-=20;
X }
X /* if next to capitol, they dont like you */
X! for(X=curntn->capx-1;X<=curntn->capx+1;X++)
X! for(Y=curntn->capy-1;Y<=curntn->capy+1;Y++) if(ONMAP(X,Y)) {
X if(sct[X][Y].owner == x) {
X friendly-=10;
X hostile +=10;
X--- 728,736 -----
X hostile-=20;
X }
X /* if next to capitol, they dont like you */
X! for(X=(int)curntn->capx-1;X<=(int)curntn->capx+1;X++)
X! for(Y=(int)curntn->capy-1;Y<=(int)curntn->capy+1;Y++)
X! if(ONMAP(X,Y)) {
X if(sct[X][Y].owner == x) {
X friendly-=10;
X hostile +=10;
X**************
X*** 840,846
X endy=MAPY;
X } else {
X if( curntn->capx > NPCTOOFAR )
X! stx=curntn->capx-NPCTOOFAR;
X else stx=0;
X if( curntn->capy > NPCTOOFAR )
X sty=curntn->capy-NPCTOOFAR;
X--- 842,848 -----
X endy=MAPY;
X } else {
X if( curntn->capx > NPCTOOFAR )
X! stx=(int)curntn->capx-NPCTOOFAR;
X else stx=0;
X if( curntn->capy > NPCTOOFAR )
X sty=(int)curntn->capy-NPCTOOFAR;
X**************
X*** 843,849
X stx=curntn->capx-NPCTOOFAR;
X else stx=0;
X if( curntn->capy > NPCTOOFAR )
X! sty=curntn->capy-NPCTOOFAR;
X else sty=0;
X if( curntn->capx + NPCTOOFAR < MAPX )
X endx=curntn->capx+NPCTOOFAR;
X--- 845,851 -----
X stx=(int)curntn->capx-NPCTOOFAR;
X else stx=0;
X if( curntn->capy > NPCTOOFAR )
X! sty=(int)curntn->capy-NPCTOOFAR;
X else sty=0;
X if( (int)curntn->capx + NPCTOOFAR < MAPX )
X endx=(int)curntn->capx+NPCTOOFAR;
X**************
X*** 845,852
X if( curntn->capy > NPCTOOFAR )
X sty=curntn->capy-NPCTOOFAR;
X else sty=0;
X! if( curntn->capx + NPCTOOFAR < MAPX )
X! endx=curntn->capx+NPCTOOFAR;
X else endx=MAPX;
X if( curntn->capy + NPCTOOFAR < MAPY )
X endy=curntn->capy+NPCTOOFAR;
X--- 847,854 -----
X if( curntn->capy > NPCTOOFAR )
X sty=(int)curntn->capy-NPCTOOFAR;
X else sty=0;
X! if( (int)curntn->capx + NPCTOOFAR < MAPX )
X! endx=(int)curntn->capx+NPCTOOFAR;
X else endx=MAPX;
X if( (int)curntn->capy + NPCTOOFAR < MAPY )
X endy=(int)curntn->capy+NPCTOOFAR;
X**************
X*** 848,855
X if( curntn->capx + NPCTOOFAR < MAPX )
X endx=curntn->capx+NPCTOOFAR;
X else endx=MAPX;
X! if( curntn->capy + NPCTOOFAR < MAPY )
X! endy=curntn->capy+NPCTOOFAR;
X else endy=MAPY;
X }
X
X--- 850,857 -----
X if( (int)curntn->capx + NPCTOOFAR < MAPX )
X endx=(int)curntn->capx+NPCTOOFAR;
X else endx=MAPX;
X! if( (int)curntn->capy + NPCTOOFAR < MAPY )
X! endy=(int)curntn->capy+NPCTOOFAR;
X else endy=MAPY;
X }
X
X**************
X*** 1099,1106
X for(x=stx;x<endx;x++) for(y=sty;y<endy;y++) {
X if((sct[x][y].owner != country )
X &&( sct[x][y].owner != 0 )
X! &&( abs(x-curntn->capx)>2 )
X! &&( abs(y-curntn->capy)>2 )
X &&( ntn[country].dstatus[sct[x][y].owner]<WAR)
X &&( ntn[sct[x][y].owner].dstatus[country]<WAR)
X &&( ntn[country].dstatus[sct[x][y].owner]>ALLIED))
X--- 1101,1108 -----
X for(x=stx;x<endx;x++) for(y=sty;y<endy;y++) {
X if((sct[x][y].owner != country )
X &&( sct[x][y].owner != 0 )
X! &&( abs(x-(int)curntn->capx)>2 )
X! &&( abs(y-(int)curntn->capy)>2 )
X &&( ntn[country].dstatus[sct[x][y].owner]<WAR)
X &&( ntn[sct[x][y].owner].dstatus[country]<WAR)
X &&( ntn[country].dstatus[sct[x][y].owner]>ALLIED))
X**************
X*** 1126,1133
X register int x,y;
X
X /* around capitol */
X! for(x=curntn->capx-4;x<=curntn->capx+4;x++){
X! for(y=curntn->capy-4;y<=curntn->capy+4;y++){
X if((ONMAP(x,y))&&(sct[x][y].owner==0)) {
X attr[x][y] += 700;
X }
X--- 1128,1135 -----
X register int x,y;
X
X /* around capitol */
X! for(x=(int)curntn->capx-4;x<=(int)curntn->capx+4;x++){
X! for(y=(int)curntn->capy-4;y<=(int)curntn->capy+4;y++){
X if((ONMAP(x,y))&&(sct[x][y].owner==0)) {
X attr[x][y] += 700;
X }
X**************
X*** 1167,1174
X ntn[natn].arm[x].sold/10;
X
X /*plus 80 if near your capitol */
X! for(x=curntn->capx-1;x<=curntn->capy+1;x++){
X! for(y=curntn->capy-1;y<=curntn->capy+1;y++){
X if(ONMAP(x,y)) attr[x][y]+=80;
X }
X }
X--- 1169,1176 -----
X ntn[natn].arm[x].sold/10;
X
X /*plus 80 if near your capitol */
X! for(x=(int)curntn->capx-1;x<=(int)curntn->capy+1;x++){
X! for(y=(int)curntn->capy-1;y<=(int)curntn->capy+1;y++){
X if(ONMAP(x,y)) attr[x][y]+=80;
X }
X }
X
END_OF_FILE
if test 54373 -ne `wc -c <'patches02a'`; then
echo shar: \"'patches02a'\" unpacked with wrong size!
fi
# end of 'patches02a'
fi
echo shar: End of shell archive.
exit 0