billr@saab.CNA.TEK.COM (Bill Randle) (09/02/89)
Submitted-by: Adam Bryant <adb@cs.bu.edu>
Posting-number: Volume 8, Issue 15
Archive-name: conquer4/Patch5c
Patch-To: conquer4: Volume 6, Issue 83-97
#!/bin/sh
# this is part 3 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file patchV4.5 continued
#
CurArch=3
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+ * The following unseen (UNS_) value represents this.
X+ */
X+ #define UNS_CITY_VALUE 10 /* If there is an under-defended City
X+ * the value is 500
X+ */
X+
X void
X prtattr()
X {
X***************
X*** 131,137 ****
X if( ((sct[x][y].owner) == 0
X || solds_in_sector( x, y, sct[x][y].owner) == 0 )
X && (ntn[sct[x][y].owner].active!=NPC_NOMAD) ) {
X! fprintf(fnews,"3.\tnomads capture sector %d,%d\n",x,y);
X if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
X sct[x][y].owner=country;
X DEVASTATE(x,y);
X--- 169,175 ----
X if( ((sct[x][y].owner) == 0
X || solds_in_sector( x, y, sct[x][y].owner) == 0 )
X && (ntn[sct[x][y].owner].active!=NPC_NOMAD) ) {
X! fprintf(fnews,"3:\tnomads capture sector %d,%d\n",x,y);
X if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
X sct[x][y].owner=country;
X DEVASTATE(x,y);
X***************
X*** 180,186 ****
X if( ((sct[x][y].owner == 0)
X || (solds_in_sector( x, y, sct[x][y].owner) == 0))
X && (ntn[sct[x][y].owner].active != NPC_SAVAGE)) {
X! fprintf(fnews,"3.\tsavages capture sector %d,%d\n",x,y);
X if(P_ATYPE<MINLEADER) {
X if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
X sct[x][y].owner=country;
X--- 218,224 ----
X if( ((sct[x][y].owner == 0)
X || (solds_in_sector( x, y, sct[x][y].owner) == 0))
X && (ntn[sct[x][y].owner].active != NPC_SAVAGE)) {
X! fprintf(fnews,"3:\tsavages capture sector %d,%d\n",x,y);
X if(P_ATYPE<MINLEADER) {
X if(sct[x][y].owner!=0) flee(x,y,1,FALSE);
X sct[x][y].owner=country;
X***************
X*** 657,684 ****
X }
X }
X if((free==TRUE)) {
X! /* want to add ideal troops */
X! ideal = sct[x][y].people/MILINCITY - P_ASOLD;
X! ideal = min(ideal, 250);
X! if (P_ASOLD < 50) /* make the militia at least 50 */
X! ideal = max(ideal,50-P_ASOLD);
X! if (P_ASOLD + ideal < 50) /*don't let ideal bring it below 50*/
X! continue;
X if(ideal>0){
X if(magic(country,WARRIOR)==TRUE){ /* WARRIOR power */
X curntn->tgold-=
X! (ideal* *(u_encost+P_ATYPE))/2;
X } else {
X curntn->tgold-=
X! ideal* *(u_encost + P_ATYPE);
X }
X }
X- P_ASOLD+=ideal;
X- P_ATYPE=A_MILITIA;
X- P_ASTAT=MILITIA;
X #ifdef DEBUG
X! printf("\tadding %ld troops to %s army %d (now %ld men - populace %ld)\n",ideal,unittype[P_ATYPE],armynum,P_ASOLD,sct[x][y].people);
X #endif DEBUG
X }
X }
X check();
X--- 695,721 ----
X }
X }
X if((free==TRUE)) {
X! /* want to have ideal troops */
X! ideal = sct[x][y].people/MILINCITY;
X!
X! if(ideal < 50) /* make the militia at least 50 */
X! ideal = 50;
X!
X if(ideal>0){
X if(magic(country,WARRIOR)==TRUE){ /* WARRIOR power */
X curntn->tgold-=
X! ((ideal-P_ASOLD)* *(u_encost+P_ATYPE))/2;
X } else {
X curntn->tgold-=
X! (ideal-P_ASOLD)* *(u_encost + P_ATYPE);
X }
X }
X #ifdef DEBUG
X! printf("\tadding %ld troops to %s army %d (now %ld men - populace %ld)\n",ideal-P_ASOLD,unittype[P_ATYPE],armynum,ideal,sct[x][y].people);
X #endif DEBUG
X+ P_ASOLD=ideal;
X+ P_ATYPE=A_MILITIA;
X+ P_ASTAT=MILITIA;
X }
X }
X check();
X***************
X*** 824,829 ****
X--- 861,923 ----
X }
X }
X
X+
X+ /* Find the average world food value per sector
X+ * and the average tradegood value per sector.
X+ * This is used for unseen sectors and unseen
X+ * armies. */
X+ static void
X+ find_avg_sector ()
X+ {
X+ int armynum;
X+ int i;
X+ int nation;
X+ int repeat;
X+ struct s_sector *sptr; /* used to speed up this function */
X+ register int x,y;
X+ register long total_food = 0;
X+ int total_sectors;
X+ register long total_tg = 0;
X+ register long useable_land = 0;
X+
X+ for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) {
X+ sptr = &sct[x][y];
X+ if(( sptr->altitude!=WATER )&&( sptr->altitude!=PEAK )) {
X+ useable_land++;
X+ total_food += tofood(sptr,country);
X+ if(sptr->tradegood != TG_none) {
X+ if(sptr->metal != 0) total_tg +=500;
X+ else if(sptr->jewels != 0) total_tg +=500;
X+ else total_tg +=300;
X+ }
X+ }
X+ }
X+ Avg_food = total_food / useable_land;
X+ Avg_tradegood = total_tg / useable_land;
X+
X+ for(nation=1;nation<NTOTAL;nation++) {
X+ if(isntn(ntn[nation].active)
X+ && !COUNT_ARMIES(nation,country)) {
X+ /* Count the number of sectors which are occupied by each
X+ * nation's armies. */
X+ total_sectors = 0;
X+ for(armynum=1;armynum<MAXARM;armynum++)
X+ if(ntn[nation].arm[armynum].sold > 0) {
X+ x = ntn[nation].arm[armynum].xloc;
X+ y = ntn[nation].arm[armynum].yloc;
X+ repeat = FALSE;
X+ for (i=1; (i<armynum) && !repeat; ++i)
X+ if((ntn[nation].arm[i].xloc == x)
X+ && (ntn[nation].arm[i].yloc == y))
X+ repeat = TRUE;
X+ if (!repeat)
X+ total_sectors++;
X+ }
X+
X+ Avg_soldiers[nation] = ntn[nation].tmil / total_sectors;
X+ }
X+ }
X+ }
X void
X nationrun()
X {
X***************
X*** 864,869 ****
X--- 958,965 ----
X
X getdstatus();
X
X+ find_avg_sector ();
X+
X #ifdef SPEW
X for(x=1;x<NTOTAL;x++) if(isntn( ntn[x].active )) {
X /* here is the bit which will occasionally send a randomly
X***************
X*** 1141,1147 ****
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 }
X--- 1237,1243 ----
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] += 450;
X }
X }
X }
X***************
X*** 1148,1159 ****
X
X for(x=stx;x<endx;x++) {
X for(y=sty;y<endy;y++) {
X! /* add if metal high */
X! if(sct[x][y].tradegood != TG_none) {
X! if(sct[x][y].metal != 0) attr[x][y]+=500;
X! else if(sct[x][y].jewels != 0) attr[x][y]+=500;
X! else attr[x][y]+=300;
X }
X /*add to attractiveness for unowned sectors*/
X if(sct[x][y].owner == 0) {
X attr[x][y]+=300;
X--- 1244,1261 ----
X
X for(x=stx;x<endx;x++) {
X for(y=sty;y<endy;y++) {
X! if (SEE_SECTOR(x,y,country)) {
X! /* add if metal high */
X! if(sct[x][y].tradegood != TG_none) {
X! if(sct[x][y].metal != 0) attr[x][y]+=500;
X! else if(sct[x][y].jewels != 0) attr[x][y]+=500;
X! else attr[x][y]+=300;
X! }
X }
X+ else
X+ /*give some value: tradegood MIGHT be there*/
X+ attr[x][y] += Avg_tradegood;
X+
X /*add to attractiveness for unowned sectors*/
X if(sct[x][y].owner == 0) {
X attr[x][y]+=300;
X***************
X*** 1161,1167 ****
X if(ntn[sct[x][y].owner].active == NPC_NOMAD)
X attr[x][y]+=100;
X }
X! attr[x][y] += 50*tofood(&sct[x][y],country);
X
X if(!is_habitable(x,y)) {
X #ifdef XENIX
X--- 1263,1273 ----
X if(ntn[sct[x][y].owner].active == NPC_NOMAD)
X attr[x][y]+=100;
X }
X! if (SEE_SECTOR(x,y,country))
X! attr[x][y] += 50*tofood(&sct[x][y],country);
X! else
X! /* give some value: there is probably average food there */
X! attr[x][y] += 50*Avg_food;
X
X if(!is_habitable(x,y)) {
X #ifdef XENIX
X***************
X*** 1175,1192 ****
X }
X }
X }
X void
X n_defend(natn)
X register short natn;
X {
X! int x,y;
X
X! /* add 1/10th of their soldiers in sector */
X! for(x=1;x<MAXARM;x++) if(ntn[natn].arm[x].sold > 0)
X! if(sct[ntn[natn].arm[x].xloc][ntn[natn].arm[x].yloc].owner==country)
X! attr[ntn[natn].arm[x].xloc][ntn[natn].arm[x].yloc] +=
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--- 1281,1324 ----
X }
X }
X }
X+
X void
X n_defend(natn)
X register short natn;
X {
X! register int i,j;
X! int repeat;
X! register int x,y;
X
X! if (COUNT_ARMIES(natn,country)) {
X! /* add 1/10th of their soldiers in sector */
X! for(x=1;x<MAXARM;x++) if(ntn[natn].arm[x].sold > 0)
X! if(sct[ntn[natn].arm[x].xloc][ntn[natn].arm[x].yloc].owner==country)
X! attr[ntn[natn].arm[x].xloc][ntn[natn].arm[x].yloc] +=
X! ntn[natn].arm[x].sold/10;
X! }
X! else {
X! /* For every of this country's sectors that has a 'natn' army
X! * in it, add 1/10 of the average number of soldiers in that
X! * 'natn' army.
X! */
X! for(j=1;j<MAXARM;j++) if(ntn[natn].arm[j].sold > 0) {
X! x = ntn[natn].arm[j].xloc;
X! y = ntn[natn].arm[j].yloc;
X! if(sct[x][y].owner==country) {
X! /* insure the average soldiers is only added
X! * once per sector */
X! repeat = FALSE;
X! for (i=1; (i<j) && !repeat; ++i)
X! if((ntn[natn].arm[i].xloc == x)
X! && (ntn[natn].arm[i].yloc == y))
X! repeat = TRUE;
X
X+ if (!repeat)
X+ attr[x][y] += Avg_soldiers[natn]/10;
X+ }
X+ }
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***************
X*** 1218,1235 ****
X long solds; /* solds within 1 of capitol or city */
X
X for(x=stx;x<endx;x++) for(y=sty;y<endy;y++){
X! if((sct[x][y].owner==nation)&&
X! ((sct[x][y].designation==DCITY)
X! ||(sct[x][y].designation==DCAPITOL)
X! ||(sct[x][y].designation==DTOWN))){
X! solds=0;
X! for(armynum=1;armynum<MAXARM;armynum++)
X! if((ntn[country].arm[armynum].sold > 0)
X! &&(abs(AXLOC-x)<=1)
X! &&(abs(AYLOC-y)<=1)) solds+=ASOLD;
X!
X! if(solds_in_sector(x,y,nation)*2 < 3*solds)
X! attr[x][y]+=500;
X }
X }
X }
X--- 1350,1380 ----
X long solds; /* solds within 1 of capitol or city */
X
X for(x=stx;x<endx;x++) for(y=sty;y<endy;y++){
X! if(sct[x][y].owner==nation) {
X! if(SEE_CITIES(nation,country)) {
X! if (((sct[x][y].designation==DCITY)
X! ||(sct[x][y].designation==DCAPITOL)
X! ||(sct[x][y].designation==DTOWN))){
X! solds=0;
X! for(armynum=1;armynum<MAXARM;armynum++)
X! if((ntn[country].arm[armynum].sold > 0)
X! &&(abs(AXLOC-x)<=1)
X! &&(abs(AYLOC-y)<=1)) solds+=ASOLD;
X!
X! if (COUNT_ARMIES(nation,country)) {
X! if(solds_in_sector(x,y,nation)*2 < 3*solds)
X! attr[x][y]+=500;
X! }
X! else {
X! if((solds_in_sector(x,y,nation) != 0)
X! &&(Avg_soldiers[nation]*2 < 3*solds))
X! attr[x][y]+=400;
X! }
X! }
X! }
X! else
X! /* Give some value: the sector MIGHT be an under-defended city */
X! attr[x][y] += UNS_CITY_VALUE;
X }
X }
X }
X***************
X*** 1273,1278 ****
X--- 1418,1426 ----
X {
X int x1,x2,y1,y2,x,y;
X
X+ if (SEE_CITIES(nation,country)==FALSE)
X+ return;
X+
X /*plus if strategic blocking sector*/
X
X /*+60 if between the two capitol*/
X***************
X*** 1304,1311 ****
X--- 1452,1462 ----
X void
X n_survive()
X {
X+ int i;
X int nation,armynum;
X int capx,capy;
X+ int repeat;
X+ int x,y;
X
X capx=curntn->capx;
X capy=curntn->capy;
X***************
X*** 1315,1336 ****
X }
X
X /*defend your capitol if occupied, +50 more if with their army*/
X! for(nation=1;nation<NTOTAL;nation++)
X if((isntn(ntn[nation].active))
X &&((ntn[nation].dstatus[country]>=WAR)
X ||(curntn->dstatus[nation]>=WAR))){
X! for(armynum=1;armynum<MAXARM;armynum++)
X! if((ntn[nation].arm[armynum].sold > 0)
X! &&( ntn[nation].arm[armynum].xloc<=capx+2)
X! &&( ntn[nation].arm[armynum].xloc>=capx-2)
X! &&( ntn[nation].arm[armynum].yloc<=capy+2)
X! &&( ntn[nation].arm[armynum].yloc>=capy-2)){
X! if((ntn[nation].arm[armynum].xloc==capx)
X! &&(ntn[nation].arm[armynum].yloc==capy)){
X! attr[capx][capy]+=2*ntn[nation].arm[armynum].sold;
X! } else {
X! attr[ntn[nation].arm[armynum].xloc][ntn[nation].arm[armynum].yloc]+=ntn[nation].arm[armynum].sold;
X }
X }
X }
X }
X--- 1466,1520 ----
X }
X
X /*defend your capitol if occupied, +50 more if with their army*/
X! for(nation=1;nation<NTOTAL;nation++)
X if((isntn(ntn[nation].active))
X &&((ntn[nation].dstatus[country]>=WAR)
X ||(curntn->dstatus[nation]>=WAR))){
X! if (COUNT_ARMIES(nation,country)) {
X! for(armynum=1;armynum<MAXARM;armynum++)
X! if((ntn[nation].arm[armynum].sold > 0)
X! &&( ntn[nation].arm[armynum].xloc<=capx+2)
X! &&( ntn[nation].arm[armynum].xloc>=capx-2)
X! &&( ntn[nation].arm[armynum].yloc<=capy+2)
X! &&( ntn[nation].arm[armynum].yloc>=capy-2)){
X! if((ntn[nation].arm[armynum].xloc==capx)
X! &&(ntn[nation].arm[armynum].yloc==capy)){
X! attr[capx][capy]+=2*ntn[nation].arm[armynum].sold;
X! }
X! else {
X! attr[ntn[nation].arm[armynum].xloc][ntn[nation].arm[armynum].yloc]+=ntn[nation].arm[armynum].sold;
X! }
X }
X+ } else {
X+ /* The next line might be more accurate to take into account
X+ * the actual number of armies that natn has, but I don't
X+ * think that VOID or HIDDEN should allow that to be known.
X+ */
X+ for(armynum=1;armynum<MAXARM;armynum++)
X+ if(ntn[nation].arm[armynum].sold > 0) {
X+ x = ntn[nation].arm[armynum].xloc;
X+ y = ntn[nation].arm[armynum].yloc;
X+ if((capx-2<=x && x<=capx+2)
X+ &&( capy-2<=y && y<=capy+2)){
X+ /* insure the average soldiers is only added
X+ * once per sector
X+ */
X+ repeat = FALSE;
X+ for (i=1; (i<armynum) && !repeat; ++i)
X+ if((ntn[nation].arm[i].xloc == x)
X+ && (ntn[nation].arm[i].yloc == y))
X+ repeat = TRUE;
X+ if (!repeat) {
X+ if((ntn[nation].arm[armynum].xloc==capx)
X+ &&(ntn[nation].arm[armynum].yloc==capy)){
X+ attr[capx][capy]+=2* Avg_soldiers[nation];
X+ }
X+ else {
X+ attr[ntn[nation].arm[armynum].xloc][ntn[nation].arm[armynum].yloc]+= Avg_soldiers[nation];
X+ }
X+ }
X+ }
X+ }
X }
X }
X }
X***************
X*** 1399,1404 ****
X--- 1583,1589 ----
X #ifdef DEBUG
X printf("pceattr()\n");
X #endif DEBUG
X+ n_unowned();
X n_unowned();
X n_unowned();
X n_trespass();
X*** onations Sat Aug 26 19:04:07 1989
X--- nations Sat Aug 26 19:04:24 1989
X***************
X*** 50,56 ****
X #########################################################################
X argos The_Ed H A F 10 10 9 50000 1000 60 8 i -1 -1 1
X anorian Anudil E a F 30 40 8 70000 1500 60 8 g -1 -1 3
X! bobland Dogon O B G 20 0 6 12000 1500 70 13 i -1 -1 9
X darboth balrog O D R 0 0 7 70000 1500 70 12 e -1 -1 8
X edland Debbra H E R 10 15 12 30000 1000 60 8 g -1 -1 1
X fung Fungus E F G 10 40 8 50000 1000 70 8 i -1 -1 1
X--- 50,56 ----
X #########################################################################
X argos The_Ed H A F 10 10 9 50000 1000 60 8 i -1 -1 1
X anorian Anudil E a F 30 40 8 70000 1500 60 8 g -1 -1 3
X! bobland Dogon O B G 20 0 6 12000 1500 70 12 i -1 -1 9
X darboth balrog O D R 0 0 7 70000 1500 70 12 e -1 -1 8
X edland Debbra H E R 10 15 12 30000 1000 60 8 g -1 -1 1
X fung Fungus E F G 10 40 8 50000 1000 70 8 i -1 -1 1
X***************
X*** 57,69 ****
X goldor Train D G F 10 15 8 30000 1000 70 8 n -1 -1 2
X haro Cesear H H R 10 10 9 30000 1500 60 7 i -1 -1 1
X jodoba Ganalf H J R 10 10 2 30000 1500 60 8 n -1 -1 3
X! lint Lynne E L F 20 30 8 50000 1500 70 10 g -1 -1 3
X muldor Gilur D M F 10 30 6 160000 1500 70 9 n -1 -1 1
X! noria Gloin D N R 10 30 6 50000 1000 60 8 n -1 -1 1
X tokus Sumu H T R 10 10 8 30000 1000 60 8 e -1 -1 1
X! woooo Nastus O W F 10 10 10 60000 3500 75 13 e -1 -1 10
X! zaos Dragonus O Z R 20 0 8 12000 1500 70 14 e -1 -1 9
X frika Frik D f F 10 10 8 50000 1200 60 10 n -1 -1 1
X amazon Diana E X F 10 10 8 50000 1200 60 10 e -1 -1 2
X! tasman Obilisk H t F 10 10 8 50000 1200 60 10 g -1 -1 3
X sahara Barbar H S F 10 10 8 50000 1200 60 10 i -1 -1 4
X--- 57,69 ----
X goldor Train D G F 10 15 8 30000 1000 70 8 n -1 -1 2
X haro Cesear H H R 10 10 9 30000 1500 60 7 i -1 -1 1
X jodoba Ganalf H J R 10 10 2 30000 1500 60 8 n -1 -1 3
X! #lint Lynne E L F 20 30 8 50000 1500 70 10 g -1 -1 3
X muldor Gilur D M F 10 30 6 160000 1500 70 9 n -1 -1 1
X! #noria Gloin D N R 10 30 6 50000 1000 60 8 n -1 -1 1
X tokus Sumu H T R 10 10 8 30000 1000 60 8 e -1 -1 1
X! woooo Nastus O W F 10 10 10 60000 3500 75 11 e -1 -1 10
X! #zaos Dragonus O Z R 20 0 8 12000 1500 70 12 e -1 -1 9
X frika Frik D f F 10 10 8 50000 1200 60 10 n -1 -1 1
X amazon Diana E X F 10 10 8 50000 1200 60 10 e -1 -1 2
X! #tasman Obilisk H t F 10 10 8 50000 1200 60 10 g -1 -1 3
X sahara Barbar H S F 10 10 8 50000 1200 60 10 i -1 -1 4
X*** onavy.c Sat Aug 26 19:04:07 1989
X--- navy.c Sat Aug 26 19:04:25 1989
X***************
X*** 423,429 ****
X }
X P_ASTAT=DEFEND;
X P_NARMY=MAXARM;
X! P_NMOVE=0;
X NADJMOV;
X NADJHLD;
X AADJSTAT;
X--- 423,435 ----
X }
X P_ASTAT=DEFEND;
X P_NARMY=MAXARM;
X! if ((sct[XREAL][YREAL].designation!=DCITY
X! && sct[XREAL][YREAL].designation!=DCAPITOL)
X! || P_NMOVE < N_CITYCOST) {
X! P_NMOVE=0;
X! } else {
X! P_NMOVE-= N_CITYCOST;
X! }
X NADJMOV;
X NADJHLD;
X AADJSTAT;
X***************
X*** 445,451 ****
X sct[XREAL][YREAL].people += amount;
X P_NPEOP=(unsigned char)((mhold*P_NPEOP-amount)/mhold);
X NADJHLD;
X! P_NMOVE=0;
X NADJMOV;
X SADJCIV;
X }
X--- 451,463 ----
X sct[XREAL][YREAL].people += amount;
X P_NPEOP=(unsigned char)((mhold*P_NPEOP-amount)/mhold);
X NADJHLD;
X! if ((sct[XREAL][YREAL].designation!=DCITY
X! && sct[XREAL][YREAL].designation!=DCAPITOL)
X! || P_NMOVE < N_CITYCOST) {
X! P_NMOVE=0;
X! } else {
X! P_NMOVE-= N_CITYCOST;
X! }
X NADJMOV;
X SADJCIV;
X }
X***************
X*** 483,489 ****
X P_ASTAT=ONBOARD;
X P_AMOVE=0;
X P_NARMY=armynum;
X! P_NMOVE=0;
X NADJMOV;
X NADJHLD;
X AADJMOV;
X--- 495,507 ----
X P_ASTAT=ONBOARD;
X P_AMOVE=0;
X P_NARMY=armynum;
X! if ((sct[XREAL][YREAL].designation!=DCITY
X! && sct[XREAL][YREAL].designation!=DCAPITOL)
X! || P_NMOVE < N_CITYCOST) {
X! P_NMOVE=0;
X! } else {
X! P_NMOVE-= N_CITYCOST;
X! }
X NADJMOV;
X NADJHLD;
X AADJMOV;
X***************
X*** 503,509 ****
X sct[XREAL][YREAL].people -= amount;
X P_NPEOP += (unsigned char)(amount / mhold);
X SADJCIV;
X! P_NMOVE=0;
X NADJMOV;
X NADJHLD;
X }
X--- 521,533 ----
X sct[XREAL][YREAL].people -= amount;
X P_NPEOP += (unsigned char)(amount / mhold);
X SADJCIV;
X! if ((sct[XREAL][YREAL].designation!=DCITY
X! && sct[XREAL][YREAL].designation!=DCAPITOL)
X! || P_NMOVE < N_CITYCOST) {
X! P_NMOVE=0;
X! } else {
X! P_NMOVE-= N_CITYCOST;
X! }
X NADJMOV;
X NADJHLD;
X }
X*** otxt0 Sat Aug 26 19:04:08 1989
X--- txt0 Sat Aug 26 19:04:25 1989
X***************
X*** 17,23 ****
X 'S': diplomacy status MISC COMMANDS 'a': army report
X 'q': quit and save 'f': fleet report
X VISUAL 'v': version credits 'g': group army report
X! 'd': change display 'Q': quit and save 'w': wizardry commands
X 'cntrl-L': redraw '?': help screens 'ESC': extra commands
X END
X CONQUER EXTENDED COMMANDS
X--- 17,23 ----
X 'S': diplomacy status MISC COMMANDS 'a': army report
X 'q': quit and save 'f': fleet report
X VISUAL 'v': version credits 'g': group army report
X! 'd': change display '!': repeat unit cmd 'w': wizardry commands
X 'cntrl-L': redraw '?': help screens 'ESC': extra commands
X END
X CONQUER EXTENDED COMMANDS
X***************
X*** 65,74 ****
X
X To facilitate the use of conquer, the environment variable
X XCONQENV has been added to conquer to allow settings of default options
X! to conquer. Just add a line to your .cshrc or .login file with the
X! following format:
X
X! setenv XCONQENV "G,nation=MyLand,datadir=this_game"
X
X If you then type just 'conquer' to enter conquer, it will be
X equivalent to typing 'conquer -G -n MyLand -d this_game'.
X--- 65,75 ----
X
X To facilitate the use of conquer, the environment variable
X XCONQENV has been added to conquer to allow settings of default options
X! to conquer. Just add a line to your .cshrc or .login (BSD) or .profile (SYSV)
X! file with the following format:
X
X! setenv XCONQENV "G,nation=MyLand,datadir=this_game" (BSD)
X! XCONQENV="G,nation=MyLand,datadir=this_game" (SYSV)
X
X If you then type just 'conquer' to enter conquer, it will be
X equivalent to typing 'conquer -G -n MyLand -d this_game'.
X*** otxt2 Sat Aug 26 19:04:08 1989
X--- txt2 Sat Aug 26 19:04:26 1989
X***************
X*** 192,199 ****
X Medium Two +XSIZESPD 2 x Base
X Heavy Three +0 3 x Base
X
X! Ship maintenance will cost XSHIPMAINT per holding space
X! on each update.
X END
X SHIP INFORMATION
X
X--- 192,199 ----
X Medium Two +XSIZESPD 2 x Base
X Heavy Three +0 3 x Base
X
X! Ship maintenance will cost XSHIPMAINT per holding space on each update.
X! (Un)loading costs XNCITYCOST movement in cities, full movement elsewhere.
X END
X SHIP INFORMATION
X
X*** otxt5 Sat Aug 26 19:04:08 1989
X--- txt5 Sat Aug 26 19:04:26 1989
X***************
X*** 114,120 ****
X produces 3 points of popularity. Special display and redesignation options
X will help you redesignate sectors to use the tradegood you desire.
X
X! popularity fur(1,any),wool(3,farm),beer(3,farm),cloth(3,farm),wine(5,farm)
X communications mules(1,town),horses(5,town),pigeons(7,town),griffons(9,town)
X spoilrate pottery(1,town),salt(3,mine),timber(1,lumberyard),
X granite(1,mine),pine(3,lumberyd),oak(5,lumberyd),nails(7,town)
X--- 114,120 ----
X produces 3 points of popularity. Special display and redesignation options
X will help you redesignate sectors to use the tradegood you desire.
X
X! popularity fur(2,any),wool(5,farm),beer(6,farm),cloth(6,farm),wine(9,farm)
X communications mules(1,town),horses(5,town),pigeons(7,town),griffons(9,town)
X spoilrate pottery(1,town),salt(3,mine),timber(1,lumberyard),
X granite(1,mine),pine(3,lumberyd),oak(5,lumberyd),nails(7,town)
X***************
X*** 204,209 ****
X--- 204,210 ----
X 100-wealth/4. Charity is a user paramter, which indicates the
X percent of your NET income to go to the poor. Giving twice your
X population in talons will reduce poverty by one.
X+ wealth : see elsewhere.
X END
X ADDITIONAL MODIFIERS TO NATIONAL ATTRIBUTES
X
SHAR_EOF
echo "File patchV4.5 is complete"
chmod 0666 patchV4.5 || echo "restore of patchV4.5 fails"
set `wc -c patchV4.5`;Sum=$1
if test "$Sum" != "111877"
then echo original size 111877, current size $Sum;fi
echo "x - extracting psmap.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > psmap.c &&
X
X/*
X * A program to convert conquer-maps to postscript Feel free to hack'n slash
X * Comments should be sent to d8forma@dtek.chalmers.se
X *
X */
X
X#include <stdio.h>
X#include "psmap.h"
X
Xchar buffer[BUFSIZ];
Xint c, xsize, ysize;
Xint xmin, ymin, xmax, ymax, centx, centy;
XFILE *infile, *outfile, *fh, *fopen();
Xint grid = TRUE, sqsize = 9, maptype = SIMPLE, onepage = FALSE;
Xint verbose = FALSE, coords = TRUE, center = TRUE, note = FALSE;
Xint pagewidth, pageheight, xoffset, yoffset;
Xchar title[81] = "", foot[81], fontname[81];
Xchar progname[80];
X
Xint
Xparsepagesize(buf)
X char *buf;
X{
X if (!strcmp(buf, "A4"))
X return (1);
X if (!strcmp(buf, "a4"))
X return (1);
X if (!strcmp(buf, "LETTER"))
X return (2);
X if (!strcmp(buf, "letter"))
X return (2);
X return (0);
X}
X
Xvoid
Xsetpagesize(defpag)
X int defpag;
X{
X switch (defpag) {
X case 1:
X pagewidth = PAGEWIDTH_A4;
X pageheight = PAGEHEIGHT_A4;
X xoffset = XOFFSET_A4;
X yoffset = YOFFSET_A4;
X break;
X case 2:
X pagewidth = PAGEWIDTH_LETTER;
X pageheight = PAGEHEIGHT_LETTER;
X xoffset = XOFFSET_LETTER;
X yoffset = YOFFSET_LETTER;
X break;
X default:
X pagewidth = PAGEWIDTH_OTHER;
X pageheight = PAGEHEIGHT_OTHER;
X xoffset = XOFFSET_OTHER;
X yoffset = YOFFSET_OTHER;
X break;
X }
X}
X
Xvoid
Xget_pagesize()
X{
X char *buf;
X int defpag = DEFAULTPAGE;
X
X buf = (char *) getenv("CONQ_PSMAPDEFAULTPAGE");
X if (buf != NULL)
X defpag = parsepagesize(buf);
X setpagesize(defpag);
X}
X
Xvoid
Xpsstring(fh, str)
X FILE *fh;
X char *str;
X{
X fprintf(fh, "(");
X while (*str != NULL) {
X switch (*str) {
X case ('('):
X fprintf(fh, "\\(");
X break;
X case (')'):
X fprintf(fh, "\\)");
X break;
X case ('\\'):
X fprintf(fh, "\\\\");
X break;
X case ('\n'):
X case ('\f'):
X break;
X default:
X fputc(*str, fh);
X break;
X }
X str++;
X }
X fprintf(fh, ")");
X}
X
Xint
Xisinstr(string, word)
X char *string, *word;
X{
X while ((c = index(string, *word)) != 0)
X if (!strncmp((char *) c, word, strlen(word))) {
X return (TRUE);
X } else
X string = (char *) c + 1;
X return (FALSE);
X}
X
Xint
Xgetmaptype(string)
X char *string;
X{
X if (isinstr(string, "Altitude"))
X return (ALTITUDES);
X if (isinstr(string, "Designation"))
X return (DESIGNATIONS);
X if (isinstr(string, "Nation"))
X return (NATIONS);
X if (isinstr(string, "Vegetation"))
X return (VEGETATIONS);
X return (SIMPLE);
X}
X
Xvoid
Xreadmap()
X{
X int x, none;
X
X /*
X * Now we read the map. Anybody got an idea how big it is ? I don't, but
X * who cares ?
X */
X
X x = 0;
X xsize = 0;
X ysize = 0;
X xmin = 0xffffff;
X xmax = (-1);
X ymin = (-1);
X ymax = 0;
X none = TRUE;
X
X fprintf(outfile, "/Map [\n");
X
X while ((c = fgetc(infile)) != EOF) {
X switch (c) {
X case ('\n'):
X if (xsize == 0)
X xsize = x;
X if (xsize != x) {
X fprintf(stderr, "Error in map-file. Lines different length\n");
X exit(1);
X }
X x = 0;
X if ((xmax > -1) && (ymin == -1))
X ymin = ysize;
X ysize++;
X fprintf(outfile, ")\n");
X none = TRUE;
X break;
X case (' '):
X x++;
X if (none) {
X fprintf(outfile, "(");
X none = FALSE;
X }
X fprintf(outfile, " ");
X break;
X default:
X if (x < xmin)
X xmin = x;
X if (x > xmax)
X xmax = x;
X if (ysize > ymax)
X ymax = ysize;
X x++;
X if (none) {
X fprintf(outfile, "(");
X none = FALSE;
X }
X fprintf(outfile, "%c", c);
X break;
X }
X }
X
X fprintf(outfile, "] def\n\n");
X
X /* Did I get anything ? */
X if (xmax == -1) {
X fprintf(stderr, "Empty input file\n");
X exit(1);
X }
X if (verbose) {
X fprintf(stderr, "Map is %d * %d squares\n", xsize, ysize);
X fprintf(stderr, "You can see %d * %d squares\n",
X xmax - xmin + 1, ymax - ymin + 1);
X }
X}
X
Xvoid
Xbuildps()
X{
X int xbeg, ybeg, xnumb, ynumb, x, y, xpages, ypages, xcorr, ycorr;
X
X /*
X * The map should be dumped to the outfile now. Maybe we should tell the
X * printer what to do with it?
X */
X
X xpages = 1 + (xmax - xmin) * sqsize / (pagewidth - XMARGINS);
X ypages = 1 + (ymax - ymin) * sqsize / (pageheight - YMARGINS);
X
X if (verbose)
X fprintf(stderr, "The map will be %d * %d pages\n", xpages, ypages);
X
X fprintf(outfile, "/xmin %d def\n", xmin);
X fprintf(outfile, "/ymin %d def\n", ymin);
X fprintf(outfile, "/xmax %d def\n", xmax);
X fprintf(outfile, "/ymax %d def\n", ymax);
X fprintf(outfile, "/xpages %d def\n", xpages);
X fprintf(outfile, "/ypages %d def\n", ypages);
X fprintf(outfile, "/sqsize %d def\n", sqsize);
X fprintf(outfile, "/title ");
X psstring(outfile, title);
X fprintf(outfile, " def\n");
X fprintf(outfile, "/foot ");
X psstring(outfile, foot);
X fprintf(outfile, " def\n");
X fprintf(outfile, "/foot2 (ConqPS Version %s) def\n", VERSION);
X fprintf(outfile, "/PAGEWIDTH %d def\n", pagewidth);
X fprintf(outfile, "/PAGEHEIGHT %d def\n", pageheight);
X fprintf(outfile, "/XMARGINS %d def\n", XMARGINS);
X fprintf(outfile, "/YMARGINS %d def\n", YMARGINS);
X fprintf(outfile, "/XOFFSET %d def\n", xoffset);
X fprintf(outfile, "/YOFFSET %d def\n", yoffset);
X fprintf(outfile, "/maptype %d def\n", maptype);
X fprintf(outfile, "/font /%s def\n", fontname);
X fprintf(outfile, "/grid ");
X if (grid) {
X fprintf(outfile, "true def\n");
X } else
X fprintf(outfile, "false def\n");
X fprintf(outfile, "/coords ");
X if (coords) {
X fprintf(outfile, "true def\n");
X } else
X fprintf(outfile, "false def\n");
X fprintf(outfile, "/noteq ");
X if (note) {
X fprintf(outfile, "true def\n");
X } else
X fprintf(outfile, "false def\n");
X
X fprintf(outfile, "\n\n");
X
X fh = fopen(PSFILE, "r");
X
X if (fh == NULL) {
X perror(progname);
X exit(-10);
X }
X while ((c = fgetc(fh)) != EOF)
X fputc(c, outfile);
X
X fclose(fh);
X
X fprintf(outfile, "\n %% Here we start the magic\n");
X
X xnumb = (int) ((pagewidth - XMARGINS) / sqsize);
X ynumb = (int) ((pageheight - YMARGINS) / sqsize);
X
X if (center) {
X xcorr = (int) ((xpages * xnumb - (xmax - xmin)) / 2);
X ycorr = (int) ((ypages * ynumb - (ymax - ymin)) / 2);
X } else {
X xcorr = 0;
X ycorr = 0;
X }
X
X if (onepage) {
X fprintf(outfile, "%d %d %d %d %d %d DoPage\n",
X 1, 1, centx - xnumb / 2, xnumb, centy - ynumb / 2, ynumb);
X } else
X for (x = 0; x < xpages; x++)
X for (y = 0; y < ypages; y++) {
X xbeg = x * xnumb + x + xmin - xcorr;
X ybeg = y * ynumb + y + ymin - ycorr;
X fprintf(outfile, "%d %d %d %d %d %d DoPage\n",
X x + 1, y + 1, xbeg, xnumb, ybeg, ynumb);
X }
X}
X
Xmain(argc, argv)
X int argc;
X char **argv;
X{
X extern char *optarg;
X extern int optind;
X char *buf, firstline[81];
X
X strcpy(progname, argv[0]);
X infile = stdin;
X outfile = stdout;
X buf = (char *) getenv("CONQ_PSFONT");
X if (buf != NULL) {
X strncpy(fontname, buf, 80);
X fontname[79] = '\0';
X } else
X strcpy(fontname, "Times-Roman");
X get_pagesize();
X
X while ((c = getopt(argc, argv, "nuf:gs:t:vcho:p:lW:L:X:Y:")) != -1)
X switch (c) {
X case 'h':
X fprintf(stderr, "%s version %s\n", progname, VERSION);
X fprintf(stderr, "Default pagesize is ");
X switch (DEFAULTPAGE) {
X case 1:
X fprintf(stderr, "A4\n");
X break;
X case 2:
X fprintf(stderr, "LETTER\n");
X break;
X default:
X fprintf(stderr, "OTHER\n");
X break;
X }
X fprintf(stderr, USAGE, progname);
X fprintf(stderr, "\t-c Turn off coordinates\n");
X fprintf(stderr, "\t-f Set the font\n");
X fprintf(stderr, "\t-g Turn off grid\n");
X fprintf(stderr, "\t-h Show this text\n");
X fprintf(stderr, "\t-l Print large maps\n");
X fprintf(stderr, "\t-L Set the pagelength\n");
X fprintf(stderr, "\t-n Turn off map centering\n");
X fprintf(stderr, "\t-o Show one page centered around x,y\n");
X fprintf(stderr, "\t-p Set pagesize (A4,LETTER or OTHER)\n");
X fprintf(stderr, "\t-s Set size of square (default: %d)\n", sqsize);
X fprintf(stderr, "\t-t Set the title of the map\n");
X fprintf(stderr, "\t-u Force simple map output (just letters)\n");
X fprintf(stderr, "\t-v Verbose mode\n");
X fprintf(stderr, "\t-W Set the pagewidth\n");
X fprintf(stderr, "\t-X Set the X-offset\n");
X fprintf(stderr, "\t-Y Set the Y-offset\n");
X exit(1);
X case 'u':
X maptype = FORCED;
X break;
X case 'o':
X onepage = TRUE; /* Mode one of onepage */
X if (2 != sscanf(optarg, "%d,%d", ¢x, ¢y)) {
X fprintf(stderr, "Error in coordinates to o-option\n");
X exit(1);
X }
X break;
X case 'l':
X note = TRUE;
X break;
X case 'p':
X setpagesize(parsepagesize(optarg));
X break;
X case 'n':
X center = FALSE;
X break;
X case 'g':
X grid = FALSE;
X break;
X case 's':
X sscanf(optarg, "%d", &sqsize);
X break;
X case 'f':
X strncpy(fontname, optarg, 80);
X fontname[79] = '\0';
X break;
X case 't':
X strncpy(title, optarg, 80);
X title[79] = '\0';
X break;
X case 'v':
X verbose = TRUE;
X break;
X case 'c':
X coords = FALSE;
X break;
X case 'W':
X sscanf(optarg, "%d", &pagewidth);
X break;
X case 'L':
X sscanf(optarg, "%d", &pageheight);
X break;
X case 'X':
X sscanf(optarg, "%d", &xoffset);
X break;
X case 'Y':
X sscanf(optarg, "%d", &yoffset);
X break;
X default:
X fprintf(stderr, USAGE, argv[0]);
X exit(1);
X }
X if (optind < argc)
X infile = fopen(argv[optind], "r");
X
X if (infile == NULL) {
X perror(progname);
X exit(-10);
X }
X if (++optind < argc)
X outfile = fopen(argv[optind], "w");
X
X if (outfile == NULL) {
X perror(progname);
X exit(-10);
X }
X setbuf(outfile, buffer); /* They recomended this on the net today */
X
X if (++optind < argc) {
X fprintf(stderr, USAGE, argv[0]);
X exit(1);
X }
X /* If verbose identify program */
X
X if (verbose)
X fprintf(stderr, "Psmap version %s\n", VERSION);
X
X
X /* First we check if the infile is a valid conquer map file */
X
X if (NULL == fgets(firstline, 80, infile)) {
X fprintf(stderr, "Empty input file\n");
X exit(1);
X }
X if (0 != strncmp(firstline, MATCHSTRING, strlen(MATCHSTRING))) {
X fprintf(stderr, "Not a Conquer Map file\n");
X exit(1);
X }
X for (c = 0; c < strlen(firstline); c++) {
X if (firstline[c] == ':')
X break;
X }
X
X strncpy(foot, firstline, c);
X foot[c] = '\0';
X if (title[0] == '\0') {
X strncpy(title, &firstline[c + 1], 80);
X title[79] = '\0';
X }
X /* Find out which type of map it is */
X
X if (maptype != FORCED) {
X maptype = getmaptype(&firstline[c + 1]);
X } else
X maptype = SIMPLE;
X
X if (verbose) {
X fprintf(stderr, "Maptype is ");
X switch (maptype) {
X case (SIMPLE):
X fprintf(stderr, "simple\n");
X break;
X case (ALTITUDES):
X fprintf(stderr, "altitudes\n");
X break;
X case (DESIGNATIONS):
X fprintf(stderr, "designations\n");
X break;
X case (NATIONS):
X fprintf(stderr, "nations\n");
X break;
X case (VEGETATIONS):
X fprintf(stderr, "vegetations\n");
X break;
X default:
X break;
X }
X }
X /* Send the first part of the postscript file to outfile */
X
X fprintf(outfile, "%%!\n");
X fprintf(outfile, "%% Created by conqps version %s\n\n", VERSION);
X if (note)
X fprintf(outfile, "\nnote\n\n");
X fprintf(outfile, "%% Here comes the map data:\n");
X
X /* Parse the map */
X
X readmap();
X
X /* Build the last part of postscript file */
X
X buildps();
X
X /* Phu that was it. */
X
X if (infile != NULL)
X fclose(infile);
X if (outfile != NULL)
X fclose(outfile);
X
X return (0);
X}
X
SHAR_EOF
chmod 0664 psmap.c || echo "restore of psmap.c fails"
set `wc -c psmap.c`;Sum=$1
if test "$Sum" != "11406"
then echo original size 11406, current size $Sum;fi
echo "x - extracting psmap.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > psmap.h &&
X/*
X * Header file for conqps by MaF
X * Feel free to modify
X * Comments should be sent to d8forma@dtek.chalmers.se
X *
X */
X
X/* Page size hassle */
X#ifdef OTHER
X#define DEFAULTPAGE 0
X#endif
X
X#ifdef A4
X#define DEFAULTPAGE 1
X#endif
X
X#ifdef LETTER
X#define DEFAULTPAGE 2
X#endif
X
X/* Printer dependant entries */
X#define PAGEWIDTH_A4 540
X#define PAGEHEIGHT_A4 820
X#define XOFFSET_A4 30
X#define YOFFSET_A4 10
X
X#define PAGEWIDTH_LETTER 575
X#define PAGEHEIGHT_LETTER 760
X#define XOFFSET_LETTER 15
X#define YOFFSET_LETTER 10
X
X#define PAGEWIDTH_OTHER 450
X#define PAGEHEIGHT_OTHER 700
X#define XOFFSET_OTHER 40
X#define YOFFSET_OTHER 30
X
X/* Cosmetics */
X#define XMARGINS 30
X#define YMARGINS 50
X
X/* Version specific defines */
X#define VERSION "1.0"
X#define USAGE "Usage: %s [cghlnvu] [p pagesize] [f font] [o x,y] [s size]\n\t[W n] [L n] [X n] [Y n] [t title] [infile [outfile]]\n"
X#define MATCHSTRING "Conquer Version"
X
X/* Mathematical definitions */
X#define TRUE 1
X#define FALSE 0
X
X/* Types of maps possible to be printed */
X#define SIMPLE 0
X#define ALTITUDES 1
X#define DESIGNATIONS 2
X#define NATIONS 3
X#define VEGETATIONS 4
X#define FORCED 5
SHAR_EOF
chmod 0664 psmap.h || echo "restore of psmap.h fails"
set `wc -c psmap.h`;Sum=$1
if test "$Sum" != "1310"
then echo original size 1310, current size $Sum;fi
echo "x - extracting psmap.ps (Text)"
sed 's/^X//' << 'SHAR_EOF' > psmap.ps &&
X%% Postscript part of conqps
X%% Feel free to hack in it
X%% Comments should be sent to d8forma@dtek.chalmers.se
X
X% This is the user variables
X
X% This is the font sizes
X/TitleFont 13 def % For the title
X/FootFont 7 def % For the foot texts
X/CoordFont 5 def % For the coordinates
X/SquareFont 6 def % For the letters inside the squares
X
X% This is the linewidth (one unit is 1/72 inch)
X/LineWidth .3 def
X
X% This is how dark some things should be
X% 0 is black 1 is white
X/SeaCol .6 def % Colour of seas
X/KnownCol .97 def % Colour of known squares
X/SqTeCol 0 def % Colour of sector symbols
X/WNCol 0.9 def % Colour of the other pages in where square
X/WKCol 1 def % Colour of this page in where square
X
X
X%===========================================================================
X%========== Behind these walls lures the monster called PostSript ==========
X%============== If thou should choose to enter know thy enemy ==============
X%===========================================================================
X
X% This is the size of the little box showing which map this is
X/WhereSize YMARGINS 2 div def
X
X/AdjustX
X{
X /x exch def
X x 0 lt { /x x largex 1 add mod def } if
X x 0 lt { /x x largex 1 add add def } if
X x largex gt { /x x largex 1 add mod def } if
X x largex 1 add eq {/x 0 def} if
X x
X} def
X
X/AdjustY
X{
X /y exch def
X y 0 lt { /y y largey 1 add mod def } if
X y 0 lt { /y y largey 1 add add def } if
X y largey gt { /y y largey 1 add mod def } if
X y largey 1 add eq {/y 0 def} if
X y
X} def
X
X/DoCoords
X{
X newpath
X font findfont CoordFont scalefont setfont
X
X % Do Y coordiates
X XMARGINS 2 div
X YMARGINS .80 mul ydel sqsize mul add
X moveto
X ystart 1 ystart ydel add
X {
X /y exch AdjustY def
X currentpoint
X /str y (888) cvs def
X str stringwidth pop 5 add neg 2
X rmoveto
X str show
X 2 copy moveto
X xdel 1 add sqsize mul 2 add 2 rmoveto
X str show
X sqsize sub moveto
X } for
X
X % Do X coordinates
X XMARGINS 2 div
X YMARGINS .80 mul CoordFont sub 2 sub
X moveto
X xstart 1 xstart xdel add
X {
X /x exch AdjustX def
X x 0 lt { /x x largex add def } if
X x largex 1 add gt { /x x largex 1 add sub def } if
X currentpoint
X /str x (888) cvs def
X str show
X 2 copy ydel 2 add sqsize mul add 2 add moveto
X str show
X exch sqsize add exch moveto
X } for
X} def
X
X/DoGrid
X{
X newpath
X
X % Do X-lines
X XMARGINS 2 div
X YMARGINS .80 mul
X moveto
X ystart ydel add -1 ystart 1 sub
X {
X pop
X xdel 1 add sqsize mul 0
X rlineto
X xdel 1 add sqsize mul neg sqsize
X rmoveto
X } for
X
X % Do Y-lines
X XMARGINS 2 div
X YMARGINS .80 mul
X moveto
X xstart 1 xstart xdel add 1 add
X {
X pop
X 0 ydel 1 add sqsize mul
X rlineto
X sqsize ydel 1 add sqsize mul neg
X rmoveto
X } for
X
X stroke
X} def
X
X/FillSec
X{
X sqsize 0 rlineto
X 0 sqsize rlineto
X sqsize neg 0 rlineto
X closepath
X gsave
X /old currentgray def
X setgray
X fill
X old setgray
X grestore
X stroke
X}def
X
X/DoMap
X{
X /NotEmpty false def
X /c ( ) def
X font findfont SquareFont scalefont setfont
X
X 0 1 xdel
X {
X /X exch def
X 0 1 ydel
X {
X /Y exch def
X newpath
X XMARGINS 2 div X sqsize mul add
X ydel sqsize mul YMARGINS .80 mul add Y sqsize mul sub
X moveto
X /x X xstart add AdjustX def
X /y Y ystart add AdjustY def
X c 0 Map y get x get put
X c ( ) ne
X {
X /NotEmpty true def
X /NotDone true def
X gsave
X .01 setlinewidth
X currentpoint
X KnownCol FillSec
X SqTeCol setgray
X moveto
X maptype (0) ne
X {
X c (#) eq
X {
X /NotDone false def
X sqsize dup scale
X .2 .2 rmoveto
X .3 .6 rlineto
X .3 -.6 rlineto
X -.2 .4 rmoveto
X -.2 0 rlineto
X stroke
X } if
X c (^) eq
X {
X /NotDone false def
X sqsize dup scale
X .2 .2 rmoveto
X .3 .4 rlineto
X .2 -.4 rlineto
X .1 0 rmoveto
X -.1 .3 rlineto
X -.1 -.1 rlineto
X stroke
X } if
X c (%) eq
X {
X /NotDone false def
X sqsize dup scale
X currentpoint
X translate
X .2 .2 rmoveto
X .4 .2 .2 180 40 arcn
X .70 .2 moveto
X .6 .2 .10 0 180 arc
X stroke
X } if
X c (-) eq
X {
X /NotDone false def
X sqsize dup scale
X .2 .2 rmoveto
X .6 0 rlineto
X stroke
X } if
X } if
X c (~) eq
X {
X /NotDone false def
X SeaCol FillSec
X } if
X NotDone
X {
X sqsize 5 div dup rmoveto
X c show
X } if
X grestore
X } if
X } for
X } for
X} def
X
X
X/DoText
X{
X font findfont TitleFont scalefont setfont
X PAGEWIDTH title stringwidth pop sub 2 div
X YMARGINS .4 mul TitleFont 2 div sub
X moveto title show
X font findfont FootFont scalefont setfont
X foot stringwidth pop
X foot2 stringwidth pop
X gt {foot} {foot2} ifelse
X stringwidth pop
X PAGEWIDTH exch sub dup
X YMARGINS .4 mul
X moveto foot show
X YMARGINS .4 mul FootFont 1.5 mul sub
X moveto foot2 show
X} def
X
X/DrawWhere
X{
X 1 1 xpages {
X /xsq exch def
X ypages -1 1 {
X /ysq exch def
X newpath
X 0 0 moveto
X /sqxsize WhereSize xpages div def
X /sqysize WhereSize ypages div def
X xsq sqxsize mul ypages ysq sub sqysize mul
X rmoveto % Am now at top left of this square
X sqxsize 0 rlineto
X 0 sqysize rlineto
X sqxsize neg 0 rlineto
X closepath
X WNCol setgray
X xsq currx eq ysq curry eq and { WKCol setgray } if
X gsave fill grestore
X 0 setgray stroke
X } for
X } for
X} def
X
X/DoPage % currx curry xstart xdel ystart ydel
X{
X /ydel exch def
X /ystart exch def
X /xdel exch def
X /xstart exch def
X /curry exch def
X /currx exch def
X
X /largey Map length 1 sub def
X /largex Map 1 get length 1 sub def
X
X initgraphics
X XOFFSET YOFFSET translate
X noteq { 0.8544 0.9304 scale 0 YMARGINS .4 mul translate} if
X LineWidth setlinewidth
X DoText
X xpages 1 ne ypages 1 ne or {DrawWhere} if
X coords {DoCoords} if
X grid {DoGrid} if
X DoMap
X NotEmpty {showpage} if
X} def
SHAR_EOF
chmod 0664 psmap.ps || echo "restore of psmap.ps fails"
set `wc -c psmap.ps`;Sum=$1
if test "$Sum" != "6077"
then echo original size 6077, current size $Sum;fi
rm -f s2_seq_.tmp
echo "You have unpacked the last part"
exit 0