home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
games
/
volume6
/
conquer4
/
patch5b
< prev
next >
Wrap
Internet Message Format
|
1989-09-11
|
49KB
Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
From: billr@saab.CNA.TEK.COM (Bill Randle)
Newsgroups: comp.sources.games
Subject: v08i014: conquer4 - middle earth multi-player game (V4), Patch5b
Message-ID: <4514@tekred.CNA.TEK.COM>
Date: 1 Sep 89 18:53:26 GMT
Sender: nobody@tekred.CNA.TEK.COM
Lines: 1953
Approved: billr@saab.CNA.TEK.COM
Submitted-by: Adam Bryant <adb@cs.bu.edu>
Posting-number: Volume 8, Issue 14
Archive-name: conquer4/Patch5b
Patch-To: conquer4: Volume 6, Issue 83-97
#!/bin/sh
# this is part 2 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file patchV4.5 continued
#
CurArch=2
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
exit 1; fi
( read Scheck
if test "$Scheck" != $CurArch
then echo "Please unpack part $Scheck next!"
exit 1;
else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file patchV4.5"
sed 's/^X//' << 'SHAR_EOF' >> patchV4.5
X--- 490,496 ----
X ||(sct[P_AXLOC][P_AYLOC].designation==DCAPITOL)
X ||(sct[P_AXLOC][P_AYLOC].designation==DCITY))){
X mvaddstr(LINES-2,0,"Entering Town/City sector");
X+ clrtoeol();
X refresh();
X sleep(2);
X } else if((SOWN!=country)
X***************
X*** 572,580 ****
X getch();
X }
X whatcansee();
X! redraw=FALSE;
X makemap();
X armornvy=AORN;
X }
X
X /************************************************************************/
X--- 575,587 ----
X getch();
X }
X whatcansee();
X! redraw=DONE;
X! prep(country,FALSE,TRUE);
X makemap();
X armornvy=AORN;
X+ makebottom();
X+ pager=0;
X+ selector=0;
X }
X
X /************************************************************************/
X*** oupdate.c Sat Aug 26 19:04:08 1989
X--- update.c Sat Aug 26 19:04:17 1989
X***************
X*** 10,18 ****
X * Ed
X */
X
X #include "header.h"
X #include "data.h"
X- #include <ctype.h>
X
X extern FILE *fnews;
X
X--- 10,19 ----
X * Ed
X */
X
X+ #include <ctype.h>
X+ #include <sys/file.h>
X #include "header.h"
X #include "data.h"
X
X extern FILE *fnews;
X
X***************
X*** 237,243 ****
X
X if(P_ASTAT>=NUMSTATUS) return(takesctr);
X if(P_AMOVE==0) return(takesctr);
X! /* if leader w/o group */
X if((P_ATYPE>=MINLEADER)&&(P_ATYPE<MINMONSTER)&&(P_ASTAT!=GENERAL)) {
X leadflag=TRUE;
X /* the king stays in capitol on RULE */
X--- 238,245 ----
X
X if(P_ASTAT>=NUMSTATUS) return(takesctr);
X if(P_AMOVE==0) return(takesctr);
X!
X! /* if leader w/o a group, set leadflag */
X if((P_ATYPE>=MINLEADER)&&(P_ATYPE<MINMONSTER)&&(P_ASTAT!=GENERAL)) {
X leadflag=TRUE;
X /* the king stays in capitol on RULE */
X***************
X*** 250,264 ****
X }
X
X sum=0;
X! if(leadflag) { /* find unattached soldiers & move anywhere */
X for(i=0;i<MAXARM;i++)
X if(( curntn->arm[i].unittyp<MINLEADER )
X &&( curntn->arm[i].stat!=MILITIA )
X &&( curntn->arm[i].stat!=ONBOARD )
X &&( curntn->arm[i].stat!=TRADED )
X &&( curntn->arm[i].stat<NUMSTATUS ))
X sum+=curntn->arm[i].sold;
X! } else {
X /* use menok as a temp vbl now == men in army */
X menok=0;
X if((P_ATYPE>=MINLEADER)
X--- 252,267 ----
X }
X
X sum=0;
X! if(leadflag) { /* Move based on unattached soldiers */
X for(i=0;i<MAXARM;i++)
X if(( curntn->arm[i].unittyp<MINLEADER )
X &&( curntn->arm[i].stat!=MILITIA )
X &&( curntn->arm[i].stat!=ONBOARD )
X+ &&( curntn->arm[i].stat!=GARRISON )
X &&( curntn->arm[i].stat!=TRADED )
X &&( curntn->arm[i].stat<NUMSTATUS ))
X sum+=curntn->arm[i].sold;
X! } else { /* not leader w/o group */
X /* use menok as a temp vbl now == men in army */
X menok=0;
X if((P_ATYPE>=MINLEADER)
X***************
X*** 282,288 ****
X }
X }
X
X! if(sum==0) {
X P_AXLOC=curntn->capx;
X P_AYLOC=curntn->capy;
X P_ASTAT=DEFEND;
X--- 285,291 ----
X }
X }
X
X! if(sum==0) { /* nowhere to go */
X P_AXLOC=curntn->capx;
X P_AYLOC=curntn->capy;
X P_ASTAT=DEFEND;
X***************
X*** 291,296 ****
X--- 294,300 ----
X for(x=0;x<MAXARM;x++)
X if((curntn->arm[x].unittyp<MINLEADER )
X &&( curntn->arm[x].stat!=MILITIA )
X+ &&( curntn->arm[x].stat!=GARRISON )
X &&( curntn->arm[x].stat!=ONBOARD )
X &&( curntn->arm[x].stat!=TRADED )
X &&( curntn->arm[x].stat<NUMSTATUS )){
X***************
X*** 305,311 ****
X--- 309,317 ----
X &&( curntn->arm[x].stat<NUMSTATUS )
X &&( curntn->arm[x].sold>=0 )
X &&( curntn->arm[x].stat!=MILITIA )
X+ &&( curntn->arm[x].stat!=GARRISON )
X &&( curntn->arm[x].stat!=SIEGED )
X+ &&( curntn->arm[x].stat!=SCOUT )
X &&( curntn->arm[x].stat!=ONBOARD )
X &&( curntn->arm[x].stat!=TRADED )
X &&( curntn->arm[x].unittyp!=A_ZOMBIE )
X***************
X*** 316,322 ****
X break;
X }
X }
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--- 322,328 ----
X break;
X }
X }
X! } else { /* move a normal unit */
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***************
X*** 335,341 ****
X P_AYLOC=curntn->capy;
X }
X
X! /* CHANGE SO ARMIES MOVE PSEUDO INDEPENDANTLY */
X if((sct[x][y].designation != DCITY)
X &&(sct[x][y].designation != DCAPITOL)
X &&(sct[x][y].designation != DTOWN)
X--- 341,347 ----
X P_AYLOC=curntn->capy;
X }
X
X! /* ARMIES MOVE PSEUDO INDEPENDANTLY */
X if((sct[x][y].designation != DCITY)
X &&(sct[x][y].designation != DCAPITOL)
X &&(sct[x][y].designation != DTOWN)
X***************
X*** 434,441 ****
X {
X int x,y;
X int bonus=0, count=0, npcavg, pcavg, avgscore=0;
X /* add gold */
X! for(x=1;x<NTOTAL;x++) if(isnpc(ntn[x].active)) {
X if((ntn[x].tgold<ntn[x].tciv)
X &&( rand()%5==0)){
X ntn[x].tgold+=10000;
X--- 440,459 ----
X {
X int x,y;
X int bonus=0, count=0, npcavg, pcavg, avgscore=0;
X+ char realnpc[NTOTAL],tempc[LINELTH];
X+
X+ /* take inventory of countries */
X+ for(x=1;x<NTOTAL;x++) {
X+ sprintf(tempc,"%s%d", exefile, x);
X+ if (isnpc(ntn[x].active) && access(tempc,F_OK)==0) {
X+ realnpc[x]=TRUE;
X+ } else {
X+ realnpc[x]=FALSE;
X+ }
X+ }
X+
X /* add gold */
X! for(x=1;x<NTOTAL;x++) if(realnpc[x]==TRUE) {
X if((ntn[x].tgold<ntn[x].tciv)
X &&( rand()%5==0)){
X ntn[x].tgold+=10000;
X***************
X*** 444,450 ****
X }
X
X for(x=1;x<NTOTAL;x++)
X! if(ispc(ntn[x].active)) {
X bonus+=ntn[x].aplus+ntn[x].dplus;
X avgscore+=ntn[x].score;
X count++;
X--- 462,468 ----
X }
X
X for(x=1;x<NTOTAL;x++)
X! if(realnpc[x]==FALSE) {
X bonus+=ntn[x].aplus+ntn[x].dplus;
X avgscore+=ntn[x].score;
X count++;
X***************
X*** 458,464 ****
X bonus=0;
X count=0;
X for(x=1;x<NTOTAL;x++)
X! if(isnpc(ntn[x].active)) {
X bonus+=ntn[x].aplus+ntn[x].dplus;
X count++;
X }
X--- 476,482 ----
X bonus=0;
X count=0;
X for(x=1;x<NTOTAL;x++)
X! if(realnpc[x]==TRUE) {
X bonus+=ntn[x].aplus+ntn[x].dplus;
X count++;
X }
X***************
X*** 465,471 ****
X if(count==0) return;
X npcavg = bonus / count;
X for(x=1;x<NTOTAL;x++)
X! if(isnpc(ntn[x].active )
X &&(ntn[x].score < avgscore)
X &&(ntn[x].race != ORC )
X &&(rand()%100 < (pcavg-npcavg))) {
X--- 483,489 ----
X if(count==0) return;
X npcavg = bonus / count;
X for(x=1;x<NTOTAL;x++)
X! if((realnpc[x]==TRUE)
X &&(ntn[x].score < avgscore)
X &&(ntn[x].race != ORC )
X &&(rand()%100 < (pcavg-npcavg))) {
X***************
X*** 476,483 ****
X
X /* cheat by making npc's frendlier to each other if they are */
X /* of the same race */
X! for(x=1;x<NTOTAL;x++) if(isnpc(ntn[x].active))
X! for(y=1;y<NTOTAL;y++) if(isnpc(ntn[y].active))
X if((ntn[x].dstatus[y]!=TREATY)
X &&(ntn[x].dstatus[y]!=UNMET)){
X if(ntn[x].race == ntn[y].race){
X--- 494,501 ----
X
X /* cheat by making npc's frendlier to each other if they are */
X /* of the same race */
X! for(x=1;x<NTOTAL;x++) if(realnpc[x]==TRUE)
X! for(y=1;y<NTOTAL;y++) if(realnpc[x]==TRUE)
X if((ntn[x].dstatus[y]!=TREATY)
X &&(ntn[x].dstatus[y]!=UNMET)){
X if(ntn[x].race == ntn[y].race){
X*** ocommands.c Sat Aug 26 19:04:06 1989
X--- commands.c Sat Aug 26 19:04:18 1989
X***************
X*** 241,251 ****
X }
X }
X
X if((SOWN!=country)&&(isgod==FALSE)) {
X errormsg("Hey! You don't own that sector!");
X return;
X }
X- clear_bottom(0);
X
X mvaddstr(LINES-4,0,"Possible sector designations: ");
X x = 30;
X--- 241,251 ----
X }
X }
X
X+ clear_bottom(0);
X if((SOWN!=country)&&(isgod==FALSE)) {
X errormsg("Hey! You don't own that sector!");
X return;
X }
X
X mvaddstr(LINES-4,0,"Possible sector designations: ");
X x = 30;
X***************
X*** 984,990 ****
X clrtoeol();
X }
X errormsg("");
X! redraw=TRUE;
X } else {
X P_AYLOC=YREAL;
X P_AXLOC=XREAL;
X--- 984,990 ----
X clrtoeol();
X }
X errormsg("");
X! redraw=PART;
X } else {
X P_AYLOC=YREAL;
X P_AXLOC=XREAL;
X***************
X*** 1039,1045 ****
X clear_bottom(0);
X sprintf(mesgfile,"error: %s open",tempfile);
X errormsg(mesgfile);
X! redraw=FALSE;
X makebottom();
X return;
X }
X--- 1039,1045 ----
X clear_bottom(0);
X sprintf(mesgfile,"error: %s open",tempfile);
X errormsg(mesgfile);
X! redraw=DONE;
X makebottom();
X return;
X }
X***************
X*** 1050,1056 ****
X clear_bottom(0);
X errormsg("no messages");
X makebottom();
X! redraw=FALSE;
X return;
X }
X
X--- 1050,1056 ----
X clear_bottom(0);
X errormsg("no messages");
X makebottom();
X! redraw=DONE;
X return;
X }
X
X***************
X*** 1057,1063 ****
X /*read in file a line at at time*/
X if(fgets(line,LINELTH,mesgfp)==NULL) {
X done=TRUE;
X! redraw=FALSE;
X clear_bottom(0);
X errormsg("no messages");
X makebottom();
X--- 1057,1063 ----
X /*read in file a line at at time*/
X if(fgets(line,LINELTH,mesgfp)==NULL) {
X done=TRUE;
X! redraw=DONE;
X clear_bottom(0);
X errormsg("no messages");
X makebottom();
X***************
X*** 1226,1243 ****
X
X clear_bottom(0);
X if(sct[XREAL][YREAL].owner!=country){
X! errormsg("you do not own");
X! makebottom();
X return;
X }
X else if(sct[XREAL][YREAL].people==0){
X! errormsg("nobody lives here!!!");
X! makebottom();
X return;
X }
X
X mvprintw(LINES-4,0,"Sector contains %d people [cost 50 per civilian]",sct[XREAL][YREAL].people);
X! mvaddstr(LINES-3,0,"how many people to move?");
X clrtoeol();
X refresh();
X people = get_number();
X--- 1226,1241 ----
X
X clear_bottom(0);
X if(sct[XREAL][YREAL].owner!=country){
X! errormsg("Sorry, you don't own that sector.");
X return;
X }
X else if(sct[XREAL][YREAL].people==0){
X! errormsg("Nobody lives there!!!");
X return;
X }
X
X mvprintw(LINES-4,0,"Sector contains %d people [cost 50 per civilian]",sct[XREAL][YREAL].people);
X! mvaddstr(LINES-3,0,"How many people to move?");
X clrtoeol();
X refresh();
X people = get_number();
X***************
X*** 1244,1259 ****
X if (people <= 0) {
X return;
X }
X! if((people>sct[XREAL][YREAL].people)
X! ||(people*50>curntn->tgold)){
X! errormsg("Sorry...Input error or you do not have the gold talons");
X! makebottom();
X return;
X }
X
X! mvprintw(LINES-4,0,"sector location is x=%d, y=%d",XREAL,YREAL);
X clrtoeol();
X! mvaddstr(LINES-3,0,"what x location to move to?");
X clrtoeol();
X refresh();
X i = get_number();
X--- 1242,1258 ----
X if (people <= 0) {
X return;
X }
X! if (people>sct[XREAL][YREAL].people) {
X! errormsg("Sorry, not that many people live there.");
X! }
X! if (people*50>curntn->tgold) {
X! errormsg("Sorry, you do not have enough gold talons.");
X return;
X }
X
X! mvprintw(LINES-4,0,"Sector location is x=%d, y=%d",XREAL,YREAL);
X clrtoeol();
X! mvaddstr(LINES-3,0,"What X location to move to?");
X clrtoeol();
X refresh();
X i = get_number();
X***************
X*** 1262,1273 ****
X }
X
X if((i-(XREAL))>2||(i-(XREAL))<-2) {
X! errormsg("sorry, can only move two sectors");
X! makebottom();
X return;
X }
X
X! mvaddstr(LINES-2,0,"what y location to move to?");
X clrtoeol();
X refresh();
X j = get_number();
X--- 1261,1271 ----
X }
X
X if((i-(XREAL))>2||(i-(XREAL))<-2) {
X! errormsg("Sorry, your people refuse to move more than two sectors.");
X return;
X }
X
X! mvaddstr(LINES-2,0,"What Y location to move to?");
X clrtoeol();
X refresh();
X j = get_number();
X***************
X*** 1275,1290 ****
X return;
X }
X if((j-(YREAL)>2)||((YREAL)-j>2)) {
X! errormsg("sorry, can only move two sectors");
X! }
X! else if(sct[i][j].owner!=country){
X! errormsg("sorry, you dont own it...");
X! }
X! /*need to check move cost > 0 for sector*/
X! else if(movecost[i][j]<0){
X! errormsg("you can't enter there...");
X! }
X! else if ((i!=XREAL)||(j!=YREAL)){
X curntn->tgold-=50*people;
X sct[XREAL][YREAL].people-=people;
X SADJCIV;
X--- 1273,1285 ----
X return;
X }
X if((j-(YREAL)>2)||((YREAL)-j>2)) {
X! errormsg("Sorry, your people refuse to move more than two sectors.");
X! } else if(sct[i][j].owner!=country){
X! errormsg("Sorry, you don't own that sector.");
X! } else if(movecost[i][j]<0){
X! /*need to check move cost > 0 for sector*/
X! errormsg("Sorry, your people refuse to enter that sector.");
X! } else if ((i!=XREAL)||(j!=YREAL)){
X curntn->tgold-=50*people;
X sct[XREAL][YREAL].people-=people;
X SADJCIV;
X***************
X*** 1291,1297 ****
X sct[i][j].people+=people;
X SADJCIV2;
X }
X- makebottom();
X }
X
X int
X--- 1286,1291 ----
X*** oio.c Sat Aug 26 19:04:06 1989
X--- io.c Sat Aug 26 19:04:18 1989
X***************
X*** 171,178 ****
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if (mapseen[X][Y]==TRUE) {
X! if (country==0 || magic(sct[X][Y].owner,NINJA)==TRUE
X! || magic(sct[X][Y].owner,THE_VOID)!=TRUE) {
X if(sct[X][Y].designation==DNODESIG)
X putc(sct[X][Y].altitude,stdout);
X else putc(sct[X][Y].designation,stdout);
X--- 171,180 ----
X for(Y=0;Y<MAPY;Y++) {
X for(X=0;X<MAPX;X++) {
X if (mapseen[X][Y]==TRUE) {
X! if ((country == 0)
X! || (sct[X][Y].owner == country)
X! || (magic (country, NINJA) == TRUE)
X! || (magic (sct[X][Y].owner, THE_VOID) != TRUE)) {
X if(sct[X][Y].designation==DNODESIG)
X putc(sct[X][Y].altitude,stdout);
X else putc(sct[X][Y].designation,stdout);
X***************
X*** 274,280 ****
X abrt();
X }
X #ifdef DEBUG
X! printf("reading %d bytes of world data\n",sizeof(struct s_world));
X #endif DEBUG
X
X getspace();
X--- 276,282 ----
X abrt();
X }
X #ifdef DEBUG
X! fprintf(stderr,"reading %d bytes of world data\n",sizeof(struct s_world));
X #endif DEBUG
X
X getspace();
X***************
X*** 288,294 ****
X abrt();
X }
X #ifdef DEBUG
X! printf("reading %d bytes of sector data\n",n_read);
X #endif DEBUG
X if((n_read=read(fd,ntn,NTOTAL*sizeof(struct s_nation))) == -1)
X printf("error reading s_nation data (ntn)\n");
X--- 290,296 ----
X abrt();
X }
X #ifdef DEBUG
X! fprintf(stderr,"reading %d bytes of sector data\n",n_read);
X #endif DEBUG
X if((n_read=read(fd,ntn,NTOTAL*sizeof(struct s_nation))) == -1)
X printf("error reading s_nation data (ntn)\n");
X***************
X*** 298,304 ****
X abrt();
X }
X #ifdef DEBUG
X! printf("reading %d bytes of nation data\n",n_read);
X #endif DEBUG
X close(fd);
X } /* readdata() */
X--- 300,306 ----
X abrt();
X }
X #ifdef DEBUG
X! fprintf(stderr,"reading %d bytes of nation data\n",n_read);
X #endif DEBUG
X close(fd);
X } /* readdata() */
X***************
X*** 317,323 ****
X xcurs=0;
X }
X else {
X! redraw=TRUE;
X xoffset-=15;
X xcurs+=15;
X }
X--- 319,325 ----
X xcurs=0;
X }
X else {
X! redraw=PART;
X xoffset-=15;
X xcurs+=15;
X }
X***************
X*** 324,330 ****
X }
X else if(xcurs >= (COLS-23)/2){
X if(XREAL<MAPX) {
X! redraw=TRUE;
X xoffset+=15;
X xcurs-=15;
X }
X--- 326,332 ----
X }
X else if(xcurs >= (COLS-23)/2){
X if(XREAL<MAPX) {
X! redraw=PART;
X xoffset+=15;
X xcurs-=15;
X }
X***************
X*** 339,345 ****
X xcurs=0;
X }
X else if(xcurs >= (COLS-23)/2) {
X! redraw=TRUE;
X xoffset+=15;
X xcurs-=15;
X }
X--- 341,347 ----
X xcurs=0;
X }
X else if(xcurs >= (COLS-23)/2) {
X! redraw=PART;
X xoffset+=15;
X xcurs-=15;
X }
X***************
X*** 350,356 ****
X ycurs=0;
X }
X else {
X! redraw=TRUE;
X ycurs+=15;
X yoffset-=15;
X }
X--- 352,358 ----
X ycurs=0;
X }
X else {
X! redraw=PART;
X ycurs+=15;
X yoffset-=15;
X }
X***************
X*** 357,363 ****
X }
X else if(ycurs >= SCREEN_Y_SIZE-1){
X if(YREAL<MAPY) {
X! redraw=TRUE;
X yoffset+=15;
X ycurs-=15;
X }
X--- 359,365 ----
X }
X else if(ycurs >= SCREEN_Y_SIZE-1){
X if(YREAL<MAPY) {
X! redraw=PART;
X yoffset+=15;
X ycurs-=15;
X }
X***************
X*** 372,382 ****
X ycurs=0;
X }
X else if(ycurs >= SCREEN_Y_SIZE-1) {
X! redraw=TRUE;
X yoffset+=15;
X ycurs-=15;
X }
X whatcansee();
X }
X
X /************************************************************************/
X--- 374,404 ----
X ycurs=0;
X }
X else if(ycurs >= SCREEN_Y_SIZE-1) {
X! redraw=PART;
X yoffset+=15;
X ycurs-=15;
X }
X whatcansee();
X+ }
X+
X+ /************************************************************************/
X+ /* CENTERMAP() - redraws screen so that cursor is centered */
X+ /************************************************************************/
X+ void
X+ centermap()
X+ {
X+ int xx,yy;
X+ xx=XREAL;
X+ yy=YREAL;
X+ xoffset = xx - (SCREEN_X_SIZE/2);
X+ yoffset = yy - (SCREEN_Y_SIZE/2);
X+ if (xoffset<0)
X+ xoffset=0;
X+ if (yoffset<0)
X+ yoffset=0;
X+ xcurs= xx-xoffset;
X+ ycurs= yy-yoffset;
X+ whatcansee();
X }
X
X /************************************************************************/
X*** onewhelp.c Sat Aug 26 19:04:07 1989
X--- newhelp.c Sat Aug 26 19:04:18 1989
X***************
X*** 45,50 ****
X--- 45,51 ----
X fprintf(fp,"s/XMAXNAVY/%d/g\n",MAXNAVY);
X fprintf(fp,"s/XBREAKJIHAD/%ld/g\n",BREAKJIHAD);
X fprintf(fp,"s/XCONQENV/%s/g\n",ENVIRON_OPTS);
X+ fprintf(fp,"s/XNCITYCOST/%d/g\n",N_CITYCOST);
X
X /* check all the defined options */
X #ifdef OGOD
X*** omagic.c Sat Aug 26 19:04:06 1989
X--- magic.c Sat Aug 26 19:04:18 1989
X***************
X*** 187,192 ****
X--- 187,196 ----
X {
X int county, countx, done=FALSE, loop=0, i,type;
X long price,x;
X+ #ifdef OGOD
X+ void god_magk();
X+ #endif /* OGOD */
X+
X short isgod=0;
X if(country==0) {
X isgod=TRUE;
X***************
X*** 198,204 ****
X clear();
X county=3;
X countx=0;
X! redraw=TRUE;
X standout();
X mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
X mvprintw(county++,30,"1) %d military powers: %ld jewels",
X--- 202,208 ----
X clear();
X county=3;
X countx=0;
X! redraw=FULL;
X standout();
X mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
X mvprintw(county++,30,"1) %d military powers: %ld jewels",
X***************
X*** 213,221 ****
X price = getmgkcost(M_CIV,country);
X if(price > getmgkcost(M_MGK,country))
X price = getmgkcost(M_MGK,country);
X- #ifdef OGOD
X- if (isgod==TRUE) price=0;
X- #endif OGOD
X
X standend();
X county=3;
X--- 217,222 ----
X***************
X*** 236,243 ****
X else county++;
X standout();
X mvprintw(county++,0,"YOU HAVE %ld JEWELS IN YOUR TREASURY",curntn->jewels);
X! if(price < curntn->jewels){
X! mvaddstr(county++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER (enter y or n):");
X standend();
X refresh();
X if(getch()=='y'){
X--- 237,253 ----
X else county++;
X standout();
X mvprintw(county++,0,"YOU HAVE %ld JEWELS IN YOUR TREASURY",curntn->jewels);
X! #ifdef OGOD
X! if (isgod==TRUE) {
X! mvaddstr(county++,0,"DO YOU WISH TO CHANGE THIS NATION'S POWERS? [yn]");
X! standend();
X! refresh();
X! if (getch()=='y') god_magk(FALSE);
X! } else
X! #endif OGOD
X! if(price <= curntn->jewels){
X!
X! mvaddstr(county++,0,"DO YOU WISH TO BUY A RANDOM NEW POWER? [yn]");
X standend();
X refresh();
X if(getch()=='y'){
X***************
X*** 247,255 ****
X type = getch() - '0';
X if(type==M_MIL || type==M_CIV || type==M_MGK){
X price=getmgkcost(type,country);
X- #ifdef OGOD
X- if (isgod==TRUE) price=0;
X- #endif OGOD
X if(curntn->jewels>=price) {
X loop = 0;
X while(loop++ < 500) if((x=getmagic(type))!=0){
X--- 257,262 ----
X***************
X*** 277,289 ****
X if((curntn->race==ORC)&&(curntn->jewels>=ORCTAKE)&&(curntn->spellpts>=TAKEPOINTS))
X done |= orctake(&county);
X #endif ORCTAKE
X- #ifdef OGOD
X- if (isgod==TRUE) {
X- mvaddstr(county++,0,"GOD: REMOVE A MAGIC POWER? (y or n)");
X- refresh();
X- if (getch()=='y') killmagk();
X- }
X- #endif OGOD
X }
X if(isgod==TRUE) reset_god();
X }
X--- 284,289 ----
X***************
X*** 413,421 ****
X ||(newpower==KNOWALL)
X ||(newpower==HIDDEN)
X ||(newpower==THE_VOID)
X! ||(newpower==ARCHITECT)
X! ||(newpower==MINER))
X return;
X if(newpower==VAMPIRE) {
X curntn->aplus-=35;
X curntn->dplus-=35;
X--- 413,424 ----
X ||(newpower==KNOWALL)
X ||(newpower==HIDDEN)
X ||(newpower==THE_VOID)
X! ||(newpower==ARCHITECT))
X return;
X+ if(newpower==MINER) {
X+ curntn->mine_ability+=25;
X+ return;
X+ }
X if(newpower==VAMPIRE) {
X curntn->aplus-=35;
X curntn->dplus-=35;
X***************
X*** 811,857 ****
X
X #ifdef CONQUER
X #ifdef OGOD
X! /* killmagk: this routine removes a magic power */
X! killmagk()
X {
X! int county,countx,choice,i;
X
X! clear();
X! county=3;
X! countx=0;
X! standout();
X! mvprintw(0,(COLS/2)-15,"MAGIC POWERS FOR %s",curntn->name);
X! standend();
X! i=0;
X! while( powers[i] != 0 ){
X! if(magic(country,powers[i])==TRUE) {
X! mvprintw(county,countx,"%d: power %s",i+1,*(pwrname+i));
X! county++;
X }
X! i++;
X! if (county > 18) {
X! county = 3;
X! countx = 40;
X }
X! }
X! if (countx == 40) {
X! county = 20;
X! }
X! else county++;
X! standout();
X! mvaddstr(county++,5," Which power to remove? ");
X! standend();
X! refresh();
X! choice=get_number();
X! if(choice > 0) {
X! mvprintw(county++,0," Remove magic #%d? (y or [n])",choice);
X refresh();
X! if (getch()=='y') {
X! if(magic(country,powers[choice-1])) {
X! curntn->powers ^= powers[choice-1];
X! removemgk(powers[choice-1]);
X }
X }
X }
X }
X #endif OGOD
X--- 814,899 ----
X
X #ifdef CONQUER
X #ifdef OGOD
X! /* godmagk() -- routine to allow god to selectively add or remove magic */
X! void
X! god_magk()
X {
X! int county,countx,choice;
X! int remove,i,done=FALSE;
X
X! while (done==FALSE) {
X! clear();
X! county=3;
X! countx=0;
X! standout();
X! mvaddstr(0,0,"Do you wish to (A)dd or (R)emove a power? ");
X! refresh();
X! while (done==FALSE) {
X! done=TRUE;
X! switch(getch()) {
X! case 'A':
X! case 'a':
X! remove=FALSE;
X! break;
X! case 'R':
X! case 'r':
X! remove=TRUE;
X! break;
X! default:
X! done=FALSE;
X! break;
X! }
X }
X! move(0,0);
X! clrtoeol();
X! if (remove)
X! mvprintw(0,(COLS/2)-15,"CURRENT POWERS FOR %s",curntn->name);
X! else
X! mvprintw(0,(COLS/2)-15,"LACKING POWERS FOR %s",curntn->name);
X! standend();
X! i=0;
X! while( powers[i] != 0 ){
X! if(magic(country,powers[i])==remove) {
X! mvprintw(county,countx,"%2d: %s Power",i+1,*(pwrname+i));
X! county++;
X! }
X! i++;
X! if (county > LINES-6) {
X! county = 3;
X! countx = COLS/2;
X! }
X }
X! if (countx == COLS/2) {
X! county = LINES-4;
X! }
X! else county++;
X! standout();
X! if (remove) mvaddstr(county++,0,"Which power to remove? ");
X! else mvaddstr(county++,0,"Which power to add? ");
X! standend();
X refresh();
X! choice=get_number();
X! if(choice > 0 && choice <= MAXPOWER) {
X! if (magic(country,powers[choice-1])==remove) {
X! if (remove)
X! mvprintw(county++,0,"Remove magic #%d? (y or [n])",choice);
X! else
X! mvprintw(county++,0,"Add magic #%d? (y or [n])",choice);
X! refresh();
X! if (getch()=='y') {
X! curntn->powers ^= powers[choice-1];
X! if (remove) removemgk(powers[choice-1]);
X! else exenewmgk(powers[choice-1]);
X! }
X! } else {
X! if (remove) mvaddstr(county++,0," The nation doesn't have that power.");
X! else mvaddstr(county++,0," The nation already has that power.");
X }
X }
X+ mvaddstr(county++,0,"Do you wish to add or remove another power?");
X+ done=TRUE;
X+ refresh();
X+ if (getch()=='y') done=FALSE;
X }
X }
X #endif OGOD
X*** onewlogin.c Sat Aug 26 19:04:07 1989
X--- newlogin.c Sat Aug 26 19:04:19 1989
X***************
X*** 26,32 ****
X long Classpow[]= { 0x0L, 0x0L, 0x0L, SUMMON, RELIGION, SAILOR,
X URBAN, 0x000000007L, DESTROYER, 0x00000700L, THE_VOID };
X
X! char *Mprompt[]= { "<<--", "-->>" };
X char *LType[]={ "Random", "Fair", "Great" };
X
X char *Mlabels[]= { "Population", "Treasury", "Location",
X--- 26,32 ----
X long Classpow[]= { 0x0L, 0x0L, 0x0L, SUMMON, RELIGION, SAILOR,
X URBAN, 0x000000007L, DESTROYER, 0x00000700L, THE_VOID };
X
X! char *Mprompt[]= { "<ADD", "SUB>" };
X char *LType[]={ "Random", "Fair", "Great" };
X
X char *Mlabels[]= { "Population", "Treasury", "Location",
X***************
X*** 194,202 ****
X newerror(str)
X char *str;
X {
X! mvaddstr(LINES-1,0,str);
X clrtoeol();
X! mvaddstr(LINES-1,COLS-13,"Hit Any Key");
X beep();
X refresh();
X getch();
X--- 194,202 ----
X newerror(str)
X char *str;
X {
X! mvaddstr(LINES-1, 0, str);
X clrtoeol();
X! mvaddstr(LINES-1, COLS-16, "PRESS ANY KEY");
X beep();
X refresh();
X getch();
X***************
X*** 283,289 ****
X sprintf(tempc,"%ld jewels & metal",
X spent[CH_RAWGOODS]*NLJEWELS);
X mvprintw(line,0,"%38s",tempc);
X! mvprintw(line,COLS/2+10,"%ld jewels & metal",NLJEWELS);
X #else
X sprintf(tempc,"%ld jewels",
X spent[CH_RAWGOODS]*NLJEWELS);
X--- 283,289 ----
X sprintf(tempc,"%ld jewels & metal",
X spent[CH_RAWGOODS]*NLJEWELS);
X mvprintw(line,0,"%38s",tempc);
X! mvprintw(line,COLS/2+13,"%ld jewels & metal",NLJEWELS);
X #else
X sprintf(tempc,"%ld jewels",
X spent[CH_RAWGOODS]*NLJEWELS);
X***************
X*** 292,298 ****
X nsprintf(tempc,"%ld metal",
X spent[CH_RAWGOODS]*NLMETAL);
X mvprintw(line,0,"%38s",tempc);
X! mvprintw(line,COLS/2+10,"%ld metals",NLMETAL);
X #endif
X }
X
X--- 292,298 ----
X nsprintf(tempc,"%ld metal",
X spent[CH_RAWGOODS]*NLMETAL);
X mvprintw(line,0,"%38s",tempc);
X! mvprintw(line,COLS/2+13,"%ld metals",NLMETAL);
X #endif
X }
X
X***************
X*** 457,463 ****
X valid=FALSE;
X while(valid==FALSE) {
X valid=TRUE;
X! mvprintw(2,0,"Enter the name of your country's leader (Ex. The_Ed, Gandalf, Conan)");
X clrtoeol();
X mvprintw(3,0," [maximum %d characters]: ",LEADERLTH);
X refresh();
X--- 457,463 ----
X valid=FALSE;
X while(valid==FALSE) {
X valid=TRUE;
X! mvprintw(2,0,"Enter the name of your country's leader (Ex. The Ed, Gandalf, Conan)");
X clrtoeol();
X mvprintw(3,0," [maximum %d characters]: ",LEADERLTH);
X refresh();
X***************
X*** 481,487 ****
X case 'D':
X case 'd':
X /*MINER POWER INATE TO DWARVES*/
X! newerror("Dwarves have MINING skills");
X mvprintw(3,0,"National Race: Dwarf");
X clrtoeol();
X curntn->powers=MINER;
X--- 481,487 ----
X case 'D':
X case 'd':
X /*MINER POWER INATE TO DWARVES*/
X! newmsg("Dwarves have MINING skills");
X mvprintw(3,0,"National Race: Dwarf");
X clrtoeol();
X curntn->powers=MINER;
X***************
X*** 502,508 ****
X break;
X case 'E':
X case 'e':
X! newerror("Elves are magically cloaked (VOID power)");
X mvprintw(3,0,"National Race: Elf");
X clrtoeol();
X curntn->powers=THE_VOID;
X--- 502,508 ----
X break;
X case 'E':
X case 'e':
X! newmsg("Elves are magically cloaked (VOID power)");
X mvprintw(3,0,"National Race: Elf");
X clrtoeol();
X curntn->powers=THE_VOID;
X***************
X*** 524,530 ****
X case 'O':
X case 'o':
X /*MINOR MONSTER POWER INATE TO ORCS*/
X! newerror("Your leader is a Monster!");
X mvprintw(3,0,"National Race: Orc");
X clrtoeol();
X curntn->powers=MI_MONST;
X--- 524,530 ----
X case 'O':
X case 'o':
X /*MINOR MONSTER POWER INATE TO ORCS*/
X! newmsg("Your leader is a Monster!");
X mvprintw(3,0,"National Race: Orc");
X clrtoeol();
X curntn->powers=MI_MONST;
X***************
X*** 546,552 ****
X case 'H':
X case 'h':
X curntn->race=HUMAN;
X! newerror("Humans have the combat skill of a WARRIOR");
X mvprintw(3,0,"National Race: Human");
X clrtoeol();
X curntn->powers = WARRIOR;
X--- 546,552 ----
X case 'H':
X case 'h':
X curntn->race=HUMAN;
X! newmsg("Humans have the combat skill of a WARRIOR");
X mvprintw(3,0,"National Race: Human");
X clrtoeol();
X curntn->powers = WARRIOR;
X***************
X*** 640,657 ****
X
X ypos = 6;
X mvprintw(ypos,0," %-13s %s", "ITEM", "CURRENTLY HAVE" );
X! mvprintw(ypos++,COLS/2+5,"%4s %s", "COST", "AMOUNT" );
X for(i=0; i<CH_NUMBER; i++) {
X mvprintw(ypos,0,"%-15s", Mlabels[i]);
X showitem(ypos,i);
X if (i==CH_LOCATE) {
X! mvprintw(ypos,COLS/2+5,"%3d %s", Mcost[i],
X "Better Location");
X } else {
X if (curntn->race==ORC) {
X switch(i) {
X case CH_MOVEMENT:
X! mvprintw(ypos++,COLS/2+5," - --------");
X continue;
X case CH_REPRO:
X x = 2*Munits[i]*Mvalues[i];
X--- 640,657 ----
X
X ypos = 6;
X mvprintw(ypos,0," %-13s %s", "ITEM", "CURRENTLY HAVE" );
X! mvprintw(ypos++,COLS/2+5,"%4s %s", "COST", "AMOUNT" );
X for(i=0; i<CH_NUMBER; i++) {
X mvprintw(ypos,0,"%-15s", Mlabels[i]);
X showitem(ypos,i);
X if (i==CH_LOCATE) {
X! mvprintw(ypos,COLS/2+5,"%3d %s", Mcost[i],
X "Better Location");
X } else {
X if (curntn->race==ORC) {
X switch(i) {
X case CH_MOVEMENT:
X! mvprintw(ypos++,COLS/2+5," - --------");
X continue;
X case CH_REPRO:
X x = 2*Munits[i]*Mvalues[i];
X***************
X*** 664,673 ****
X x = Munits[i]*Mvalues[i];
X break;
X }
X! mvprintw(ypos,COLS/2+5,"%3d ", Mcost[i]);
X printw(" %ld %s", x, Mitems[i]);
X } else {
X! mvprintw(ypos,COLS/2+5,"%3d ", Mcost[i]);
X printw(" %ld %s", Munits[i]*Mvalues[i], Mitems[i]);
X }
X }
X--- 664,673 ----
X x = Munits[i]*Mvalues[i];
X break;
X }
X! mvprintw(ypos,COLS/2+5,"%3d for",Mcost[i]);
X printw(" %ld %s", x, Mitems[i]);
X } else {
X! mvprintw(ypos,COLS/2+5,"%3d for",Mcost[i]);
X printw(" %ld %s", Munits[i]*Mvalues[i], Mitems[i]);
X }
X }
X***************
X*** 682,688 ****
X valid = FALSE;
X clr = 1;
X standout();
X! mvaddstr(LINES-4,0," ESC: Exit ?: Info <,+,h: left >,+,l: right k: up j: down ' ': ADD/SUB");
X standend();
X
X while(valid==FALSE) {
X--- 682,688 ----
X valid = FALSE;
X clr = 1;
X standout();
X! mvaddstr(LINES-4,2,"DONE=ESC EXEC=SPACE INFO=\"?\" ADD=\"<+h\" SUBtract=\">+l\" UP=\"k\" DOWN=\"j\"");
X standend();
X
X while(valid==FALSE) {
X***************
X*** 1274,1282 ****
X long x;
X
X /* determine number of leaders you want */
X! if((tmp == C_TRADER) || (tmp <= C_WIZARD))
X! spent[CH_LEADERS] = 5;
X! else spent[CH_LEADERS] = 7;
X
X /* assign the powers */
X x=Classpow[tmp];
X--- 1274,1284 ----
X long x;
X
X /* determine number of leaders you want */
X! if((tmp == C_TRADER) || (tmp <= C_WIZARD)) {
X! numleaders = spent[CH_LEADERS] = 5;
X! } else {
X! numleaders = spent[CH_LEADERS] = 7;
X! }
X
X /* assign the powers */
X x=Classpow[tmp];
X*** odisplay.c Sat Aug 26 19:04:06 1989
X--- display.c Sat Aug 26 19:04:19 1989
X***************
X*** 91,97 ****
X mvaddstr(LINES-1,COLS-25,odmode!=NULL?"what display?:":"display?:");
X standend();
X refresh();
X! redraw=TRUE;
X switch(getch()) {
X case '/':
X if (odmode !=NULL)
X--- 91,97 ----
X mvaddstr(LINES-1,COLS-25,odmode!=NULL?"what display?:":"display?:");
X standend();
X refresh();
X! redraw=PART;
X switch(getch()) {
X case '/':
X if (odmode !=NULL)
X***************
X*** 179,185 ****
X default:
X error:
X beep();
X! redraw=FALSE;
X }
X }
X
X--- 179,185 ----
X default:
X error:
X beep();
X! redraw=DONE;
X }
X }
X
X***************
X*** 412,422 ****
X ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX)
X ||((YREAL)>=MAPY)) offmap();
X
X! if( redraw==TRUE) {
X! clear();
X! makemap(); /* update map */
X makebottom();
X! redraw=FALSE;
X }
X move(ycurs,2*xcurs);
X makeside(FALSE); /*update side*/
X--- 412,427 ----
X ||((ycurs>=SCREEN_Y_SIZE-1))||((XREAL)>=MAPX)
X ||((YREAL)>=MAPY)) offmap();
X
X! if(redraw!=DONE) {
X! if (redraw==FULL) {
X! clear(); /* clear real screen */
X! } else {
X! move(0,0); /* clear curses screen but not real screen */
X! clrtobot();
X! }
X! makemap(); /* update map */
X makebottom();
X! redraw=DONE;
X }
X move(ycurs,2*xcurs);
X makeside(FALSE); /*update side*/
X***************
X*** 461,468 ****
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(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
X && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X--- 466,473 ----
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!=1+(int)P_NXLOC-xoffset+NAVYSEE;i++)
X! for(j=(int)P_NYLOC-yoffset-NAVYSEE;j!=1+(int)P_NYLOC-yoffset+NAVYSEE;j++)
X if(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
X && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X***************
X*** 469,476 ****
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(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
X && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X--- 474,481 ----
X
X for(armynum=0;armynum<MAXARM;armynum++)
X if(P_ASOLD>0)
X! for(i=(int)P_AXLOC-xoffset-ARMYSEE;i!=1+(int)P_AXLOC-xoffset+ARMYSEE;i++)
X! for(j=(int)P_AYLOC-yoffset-ARMYSEE;j!=1+(int)P_AYLOC-yoffset+ARMYSEE;j++)
X if(ONMAP(i+xoffset,j+yoffset) && i>=0 && j>=0
X && i<SCREEN_X_SIZE && j<SCREEN_Y_SIZE)
X HAS_SEEN(i,j)=TRUE;
X*** omain.c Sat Aug 26 19:04:07 1989
X--- main.c Sat Aug 26 19:04:19 1989
X***************
X*** 35,41 ****
X /* current cursor postion (relative to 00 in upper corner) */
X /* position is 2*x,y*/
X short xcurs=0,ycurs=0;
X! short redraw=TRUE; /* if TRUE: redraw map */
X int done=FALSE; /* if TRUE: you are done */
X short hilmode=HI_OWN; /* hilight mode */
X short dismode=DI_DESI;/* display mode */
X--- 35,41 ----
X /* current cursor postion (relative to 00 in upper corner) */
X /* position is 2*x,y*/
X short xcurs=0,ycurs=0;
X! short redraw=FULL; /* if !DONE: redraw map */
X int done=FALSE; /* if TRUE: you are done */
X short hilmode=HI_OWN; /* hilight mode */
X short dismode=DI_DESI;/* display mode */
X***************
X*** 69,75 ****
X #ifdef SYSMAIL
X extern char sysmail[];
X #endif SYSMAIL
X! int sflag=FALSE,pflag=FALSE,l;
X
X char defaultdir[BIGLTH],tmppass[PASSLTH+1];
X char cq_opts[BIGLTH];
X--- 69,75 ----
X #ifdef SYSMAIL
X extern char sysmail[];
X #endif SYSMAIL
X! int sflag=FALSE,pflag=FALSE,l,in_ch,old_ch=' ';
X
X char defaultdir[BIGLTH],tmppass[PASSLTH+1];
X char cq_opts[BIGLTH];
X***************
X*** 392,411 ****
X xoffset=0;
X ycurs=COLS/4;
X yoffset=0;
X! redraw=TRUE;
X /* create gods lock file but do not limit access */
X (void) aretheyon();
X } else {
X if(curntn->active==INACTIVE) {
X! mvprintw(LINES-3,0,"Sorry, for some reason, your country no longer exists.");
X! mvprintw(LINES-2,0,"If there is a problem, please contact %s.",
X! OWNER);
X! mvprintw(LINES-1,0,"To re-enter this campaign please send mail to %s",
X! LOGIN);
X if (strcmp(LOGIN, ntn[0].leader)!=0) {
X printw(" or %s",ntn[0].leader);
X }
X printw(".");
X beep();
X refresh();
X getch();
X--- 392,410 ----
X xoffset=0;
X ycurs=COLS/4;
X yoffset=0;
X! redraw=FULL;
X /* create gods lock file but do not limit access */
X (void) aretheyon();
X } else {
X if(curntn->active==INACTIVE) {
X! standout();
X! mvprintw(LINES-2,0,"Sorry, for some reason, your country no longer exists.");
X! mvprintw(LINES-1,0,"If there is a problem, please send mail to %s", LOGIN);
X if (strcmp(LOGIN, ntn[0].leader)!=0) {
X printw(" or %s",ntn[0].leader);
X }
X printw(".");
X+ standend();
X beep();
X refresh();
X getch();
X***************
X*** 469,481 ****
X (void) strcpy(sysmail,getenv("MAIL"));
X }
X #endif SYSMAIL
X!
X getch(); /* get response from copyscreen */
X
X while(done==FALSE) { /*main while routine*/
X coffmap(); /* check if cursor is out of bounds*/
X check_mail(); /* check for new mail */
X! parse(); /* get commands, make moves and input command*/
X }
X
X if(country==0) writedata();
X--- 468,487 ----
X (void) strcpy(sysmail,getenv("MAIL"));
X }
X #endif SYSMAIL
X! mvprintw(LINES-1, COLS-20, "PRESS ANY KEY");
X! refresh();
X getch(); /* get response from copyscreen */
X
X while(done==FALSE) { /*main while routine*/
X coffmap(); /* check if cursor is out of bounds*/
X check_mail(); /* check for new mail */
X! in_ch = getch();
X! /* get commands */
X! if (in_ch=='!') {
X! parse(old_ch);
X! } else {
X! if (parse(in_ch)) old_ch=in_ch;
X! }
X }
X
X if(country==0) writedata();
X***************
X*** 532,541 ****
X }
X
X /************************************************************************/
X! /* PARSE() - do a command */
X /************************************************************************/
X! void
X! parse()
X {
X char name[LINELTH+1];
X char passwd[PASSLTH+1];
X--- 538,549 ----
X }
X
X /************************************************************************/
X! /* PARSE() - interpret entered character */
X! /* return TRUE if command is repeatable FALSE otherwise */
X /************************************************************************/
X! int
X! parse(ch)
X! int ch;
X {
X char name[LINELTH+1];
X char passwd[PASSLTH+1];
X***************
X*** 545,558 ****
X #endif /* DEBUG */
X int ocountry;
X
X! switch(getch()) {
X case EXT_CMD: /* extended command */
X ext_cmd( -1 );
X curntn->tgold -= MOVECOST;
X break;
X case '': /* redraw the screen */
X whatcansee(); /* what can they see */
X! redraw=TRUE;
X break;
X #ifdef DEBUG
X case '\t': /* debugging information for god and demi-god */
X--- 553,569 ----
X #endif /* DEBUG */
X int ocountry;
X
X! switch(ch) {
X case EXT_CMD: /* extended command */
X ext_cmd( -1 );
X curntn->tgold -= MOVECOST;
X+ return(TRUE);
X break;
X case '': /* redraw the screen */
X whatcansee(); /* what can they see */
X! centermap();
X! clear();
X! redraw=FULL;
X break;
X #ifdef DEBUG
X case '\t': /* debugging information for god and demi-god */
X***************
X*** 563,569 ****
X break;
X #endif /* DEBUG */
X case 'a': /*army report*/
X! redraw=TRUE;
X armyrpt(0);
X curntn->tgold -= MOVECOST;
X break;
X--- 574,580 ----
X break;
X #endif /* DEBUG */
X case 'a': /*army report*/
X! redraw=PART;
X armyrpt(0);
X curntn->tgold -= MOVECOST;
X break;
X***************
X*** 575,586 ****
X ycurs++;
X break;
X case 'B': /*budget*/
X! redraw=TRUE;
X budget();
X curntn->tgold -= MOVECOST;
X break;
X case 'c': /*change nation stats*/
X! redraw=TRUE;
X change();
X curntn->tgold -= MOVECOST;
X break;
X--- 586,597 ----
X ycurs++;
X break;
X case 'B': /*budget*/
X! redraw=FULL;
X budget();
X curntn->tgold -= MOVECOST;
X break;
X case 'c': /*change nation stats*/
X! redraw=FULL;
X change();
X curntn->tgold -= MOVECOST;
X break;
X***************
X*** 597,605 ****
X draft();
X curntn->tgold -= MOVECOST;
X makebottom();
X break;
X case 'f': /*report on ships and load/unload*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X fleetrpt();
X break;
X--- 608,617 ----
X draft();
X curntn->tgold -= MOVECOST;
X makebottom();
X+ return(TRUE);
X break;
X case 'f': /*report on ships and load/unload*/
X! redraw=PART;
X curntn->tgold -= MOVECOST;
X fleetrpt();
X break;
X***************
X*** 607,613 ****
X navygoto();
X break;
X case 'g': /*group report*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X armyrpt(1);
X break;
X--- 619,625 ----
X navygoto();
X break;
X case 'g': /*group report*/
X! redraw=PART;
X curntn->tgold -= MOVECOST;
X armyrpt(1);
X break;
X***************
X*** 627,633 ****
X break;
X case 'I': /*campaign information*/
X camp_info();
X! redraw=TRUE;
X break;
X case 'J': /*scroll down*/
X pager=0;
X--- 639,645 ----
X break;
X case 'I': /*campaign information*/
X camp_info();
X! redraw=FULL;
X break;
X case 'J': /*scroll down*/
X pager=0;
X***************
X*** 665,680 ****
X case 'm': /*move selected item to new x,y */
X mymove();
X curntn->tgold -= MOVECOST;
X! makebottom();
X! prep(country,FALSE,TRUE);
X! if (hilmode == HI_ARMY || hilmode == HI_YARM) {
X! redraw = TRUE;
X! }
X! pager=0;
X! selector=0;
X break;
X case 'M': /*magic*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X domagic();
X break;
X--- 677,686 ----
X case 'm': /*move selected item to new x,y */
X mymove();
X curntn->tgold -= MOVECOST;
X! return(TRUE);
X break;
X case 'M': /*magic*/
X! redraw=FULL;
X curntn->tgold -= MOVECOST;
X domagic();
X break;
X***************
X*** 686,692 ****
X xcurs++;
X break;
X case 'N': /*read newspaper */
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X newspaper();
X break;
X--- 692,698 ----
X xcurs++;
X break;
X case 'N': /*read newspaper */
X! redraw=PART;
X curntn->tgold -= MOVECOST;
X newspaper();
X break;
X***************
X*** 715,721 ****
X }
X break;
X case 'P': /*production*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X produce();
X break;
X--- 721,727 ----
X }
X break;
X case 'P': /*production*/
X! redraw=FULL;
X curntn->tgold -= MOVECOST;
X produce();
X break;
X***************
X*** 731,743 ****
X break;
X /*list*/
X case 'R': /*Read Messages*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X rmessage();
X refresh();
X break;
X case 's': /*score*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X showscore();
X break;
X--- 737,749 ----
X break;
X /*list*/
X case 'R': /*Read Messages*/
X! redraw=PART;
X curntn->tgold -= MOVECOST;
X rmessage();
X refresh();
X break;
X case 's': /*score*/
X! redraw=FULL;
X curntn->tgold -= MOVECOST;
X showscore();
X break;
X***************
X*** 744,750 ****
X case 'S': /*diplomacy screens*/
X diploscrn();
X curntn->tgold -= MOVECOST;
X! redraw=TRUE;
X break;
X case 't': /*fleet loading*/
X loadfleet();
X--- 750,756 ----
X case 'S': /*diplomacy screens*/
X diploscrn();
X curntn->tgold -= MOVECOST;
X! redraw=FULL;
X break;
X case 't': /*fleet loading*/
X loadfleet();
X***************
X*** 751,762 ****
X curntn->tgold -= MOVECOST;
X makeside(FALSE);
X makebottom();
X break;
X #ifdef TRADE
X case 'T': /*go to commerce section*/
X trade();
X curntn->tgold -= MOVECOST;
X! redraw=TRUE;
X break;
X #endif TRADE
X case '9':
X--- 757,769 ----
X curntn->tgold -= MOVECOST;
X makeside(FALSE);
X makebottom();
X+ return(TRUE);
X break;
X #ifdef TRADE
X case 'T': /*go to commerce section*/
X trade();
X curntn->tgold -= MOVECOST;
X! redraw=FULL;
X break;
X #endif TRADE
X case '9':
X***************
X*** 774,787 ****
X break;
X case 'v': /* version credits */
X credits();
X! redraw=TRUE;
X break;
X case 'w': /* spell casting */
X wizardry();
X curntn->tgold -= MOVECOST;
X break;
X case 'W': /*message*/
X! redraw=TRUE;
X curntn->tgold -= MOVECOST;
X wmessage();
X break;
X--- 781,795 ----
X break;
X case 'v': /* version credits */
X credits();
X! redraw=FULL;
X break;
X case 'w': /* spell casting */
X wizardry();
X curntn->tgold -= MOVECOST;
X+ return(TRUE);
X break;
X case 'W': /*message*/
X! redraw=FULL;
X curntn->tgold -= MOVECOST;
X wmessage();
X break;
X***************
X*** 808,814 ****
X ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
X #endif
X clear();
X! redraw=TRUE;
X if(country != 0) {
X fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
X XNAGOLD ,country,curntn->tgold,"null");
X--- 816,822 ----
X ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
X #endif
X clear();
X! redraw=PART;
X if(country != 0) {
X fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
X XNAGOLD ,country,curntn->tgold,"null");
X***************
X*** 862,867 ****
X--- 870,876 ----
X
X fclose(fexe);
X /* open output for future printing*/
X+ sprintf(fison,"%s%d",isonfile,country);
X sprintf(name,"%s%d",exefile,country);
X if ((fexe=fopen(name,"a"))==NULL) {
X beep();
X***************
X*** 898,912 ****
X }
X }
X whatcansee();
X! redraw=TRUE;
X break;
X case '?': /*display help screen*/
X! redraw=TRUE;
X help();
X break;
X default:
X beep();
X }
X }
X
X #ifdef DEBUG
X--- 907,925 ----
X }
X }
X whatcansee();
X! redraw=PART;
X break;
X case '?': /*display help screen*/
X! redraw=PART;
X help();
X break;
X+ case ' ': /*ignore, and don't beep*/
X+ break;
X default:
X beep();
X+ break;
X }
X+ return(FALSE);
X }
X
X #ifdef DEBUG
X***************
X*** 1287,1293 ****
X fclose(timefp);
X }
X #endif /* TIMELOG */
X! mvprintw(LINES-1, COLS-20, "PRESS ANY KEY");
X refresh();
X }
X
X--- 1300,1306 ----
X fclose(timefp);
X }
X #endif /* TIMELOG */
X! mvprintw(LINES-1, COLS-20, "PLEASE WAIT");
X refresh();
X }
X
X*** onpc.c Sat Aug 26 19:04:07 1989
X--- npc.c Sat Aug 26 19:04:24 1989
X***************
X*** 21,27 ****
X--- 21,65 ----
X extern int **attr; /*sector attactiveness*/
X extern int dissarray; /* has nation lost its leader */
X int peace; /*is 8 if at peace, 12 if at war*/
X+ static int Avg_food;
X+ static int Avg_soldiers[NTOTAL];
X+ static int Avg_tradegood;
X
X+ /* macros that indicate what the country can see */
X+ #ifdef NPC_SEE_SECTORS
X+ #define SEE_SECTOR(x,y,country) TRUE
X+ #else NPC_SEE_SECTORS
X+ #define SEE_SECTOR(x,y,country) \
X+ ( (magic(sct[x][y].owner,THE_VOID)!=TRUE) \
X+ || (magic(country,NINJA)==TRUE) )
X+ #endif NPC_SEE_SECTORS
X+
X+ #ifdef NPC_SEE_CITIES
X+ #define SEE_CITIES(city_nation,country) TRUE
X+ #else NPC_SEE_CITIES
X+ #define SEE_CITIES(city_nation,country) \
X+ ( (magic(city_nation,THE_VOID)!=TRUE) \
X+ || (magic(country,NINJA)==TRUE) )
X+ #endif NPC_SEE_CITIES
X+
X+ #ifdef NPC_COUNT_ARMIES
X+ #define COUNT_ARMIES(army_nation,country) TRUE
X+ #else NPC_COUNT_ARMIES
X+ #define COUNT_ARMIES(army_nation,country) \
X+ ( ( (magic(army_nation,THE_VOID)!=TRUE) \
X+ && (magic(army_nation,HIDDEN)!=TRUE) \
X+ ) || (magic(country,NINJA)==TRUE) )
X+ #endif NPC_COUNT_ARMIES
X+
X+ /* When a sector cannot be seen by an npc nation because of
X+ * THE_VOID, a value must still be given to the
X+ * sector, because there MIGHT be something there.
SHAR_EOF
echo "End of part 2"
echo "File patchV4.5 is continued in part 3"
echo "3" > s2_seq_.tmp
exit 0