home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch6d < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  43.5 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i035:  conquer4 - middle earth multi-player game (V4), Patch6d
  5. Message-ID: <4603@tekred.CNA.TEK.COM>
  6. Date: 21 Sep 89 13:16:30 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1529
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  12. Posting-number: Volume 8, Issue 35
  13. Archive-name: conquer4/Patch6d
  14. Patch-To: conquer4: Volume 6, Issue 83-96
  15.  
  16.  
  17. #!/bin/sh
  18. # this is part 4 of a multipart archive
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file patchV4.6 continued
  21. #
  22. CurArch=4
  23. if test ! -r s2_seq_.tmp
  24. then echo "Please unpack part 1 first!"
  25.      exit 1; fi
  26. ( read Scheck
  27.   if test "$Scheck" != $CurArch
  28.   then echo "Please unpack part $Scheck next!"
  29.        exit 1;
  30.   else exit 0; fi
  31. ) < s2_seq_.tmp || exit 1
  32. sed 's/^X//' << 'SHAR_EOF' >> patchV4.6
  33. X                      case CH_MOVEMENT:
  34. X!                         mvaddstr(ypos++,COLS/2+5,"  -     --------");
  35. X                          continue;
  36. X                      case CH_REPRO:
  37. X                          x = 2*Munits[i]*Mvalues[i];
  38. X***************
  39. X*** 927,933 ****
  40. X                  if(sct[i][j].altitude==WATER) temp++;
  41. X              if(temp>=7) placed=0;
  42. X          }
  43. X!         teraform( x,y,1,25 );
  44. X          break;
  45. X      case RANDOM:
  46. X          while ((placed == 0)&&(n++<2000)){
  47. X--- 929,935 ----
  48. X                  if(sct[i][j].altitude==WATER) temp++;
  49. X              if(temp>=7) placed=0;
  50. X          }
  51. X!         if(placed) teraform( x,y,1,25 );
  52. X          break;
  53. X      case RANDOM:
  54. X          while ((placed == 0)&&(n++<2000)){
  55. X***************
  56. X*** 960,966 ****
  57. X              for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  58. X                  if(sct[i][j].owner!=0) placed=0;
  59. X          }
  60. X!         teraform( x,y,1,40 );
  61. X          break;
  62. X      case FAIR:
  63. X          while ((placed == 0)&&(n++<2000)) {
  64. X--- 962,968 ----
  65. X              for(i=x-1;i<=x+1;i++) for(j=y-1;j<=y+1;j++)
  66. X                  if(sct[i][j].owner!=0) placed=0;
  67. X          }
  68. X!         if(placed) teraform( x,y,1,40 );
  69. X          break;
  70. X      case FAIR:
  71. X          while ((placed == 0)&&(n++<2000)) {
  72. X***************
  73. X*** 1012,1018 ****
  74. X              }
  75. X          }
  76. X  
  77. X!         teraform( x,y,1,65 );
  78. X          break;
  79. X      case GREAT:
  80. X          placed = 0;
  81. X--- 1014,1020 ----
  82. X              }
  83. X          }
  84. X  
  85. X!         if(placed) teraform( x,y,1,65 );
  86. X          break;
  87. X      case GREAT:
  88. X          placed = 0;
  89. X***************
  90. X*** 1069,1075 ****
  91. X                  if(temp>=15) placed=0;
  92. X              }
  93. X          }
  94. X!         teraform( x,y,1,100 );
  95. X      }
  96. X  
  97. X      /*done with one try*/
  98. X--- 1071,1077 ----
  99. X                  if(temp>=15) placed=0;
  100. X              }
  101. X          }
  102. X!         if(placed) teraform( x,y,1,100 );
  103. X      }
  104. X  
  105. X      /*done with one try*/
  106. X***************
  107. X*** 1222,1228 ****
  108. X      short ypos=4;
  109. X      int i,j;
  110. X      
  111. X!     mvprintw(ypos,0,"The List of Possible Nation Classes:");
  112. X      ypos+=2;
  113. X      mvprintw(ypos++,0,"     %-8s %4s   %15s %8s %4s", "class", "who",
  114. X          "", "magic", "cost");
  115. X--- 1224,1230 ----
  116. X      short ypos=4;
  117. X      int i,j;
  118. X      
  119. X!     mvaddstr(ypos,0,"The List of Possible Nation Classes:");
  120. X      ypos+=2;
  121. X      mvprintw(ypos++,0,"     %-8s %4s   %15s %8s %4s", "class", "who",
  122. X          "", "magic", "cost");
  123. X***************
  124. X*** 1244,1250 ****
  125. X      }
  126. X      ypos++;
  127. X      while(chk==FALSE){
  128. X!         mvprintw(ypos,0,"Enter the number of your choice: ");
  129. X          clrtoeol();
  130. X          refresh();
  131. X          tmp = get_number();
  132. X--- 1246,1252 ----
  133. X      }
  134. X      ypos++;
  135. X      while(chk==FALSE){
  136. X!         mvaddstr(ypos,0,"Enter the number of your choice: ");
  137. X          clrtoeol();
  138. X          refresh();
  139. X          tmp = get_number();
  140. X*** odisplay.c    Wed Sep 20 21:40:54 1989
  141. X--- display.c    Wed Sep 20 21:41:33 1989
  142. X***************
  143. X*** 345,351 ****
  144. X          mvaddch(y,2*x,ch);
  145. X          if ( otherdismode > 0 ) {
  146. X              highlight(x,y,otherhilmode);
  147. X!             ch=get_display_for(x,y,otherdismode,otherhilmode);
  148. X              mvaddch(y,2*x+1,ch);
  149. X          }
  150. X      }
  151. X--- 345,351 ----
  152. X          mvaddch(y,2*x,ch);
  153. X          if ( otherdismode > 0 ) {
  154. X              highlight(x,y,otherhilmode);
  155. X!             ch=get_display_for(x,y,otherdismode);
  156. X              mvaddch(y,2*x+1,ch);
  157. X          }
  158. X      }
  159. X*** omain.c    Wed Sep 20 21:40:55 1989
  160. X--- main.c    Wed Sep 20 21:41:34 1989
  161. X***************
  162. X*** 19,25 ****
  163. X  #include    <signal.h>
  164. X  #include    <pwd.h>
  165. X  
  166. X! extern    int armornvy;
  167. X  
  168. X  char    fison[FILELTH];
  169. X  char    *getpass();
  170. X--- 19,25 ----
  171. X  #include    <signal.h>
  172. X  #include    <pwd.h>
  173. X  
  174. X! extern    int armornvy,roads_this_turn,terror_adj;
  175. X  
  176. X  char    fison[FILELTH];
  177. X  char    *getpass();
  178. X***************
  179. X*** 388,397 ****
  180. X      /* check if user is super-user nation[0] */
  181. X      /*    else setup cursor to capitol*/
  182. X      if((country==0)||(ismonst(ntn[country].active))) {
  183. X!         xcurs=LINES/2;
  184. X!         xoffset=0;
  185. X!         ycurs=COLS/4;
  186. X!         yoffset=0;
  187. X          redraw=FULL;
  188. X          /* create gods lock file but do not limit access */
  189. X          (void) aretheyon();
  190. X--- 388,395 ----
  191. X      /* check if user is super-user nation[0] */
  192. X      /*    else setup cursor to capitol*/
  193. X      if((country==0)||(ismonst(ntn[country].active))) {
  194. X!         xcurs=MAPX/2-1;
  195. X!         ycurs=MAPY/2-1;
  196. X          redraw=FULL;
  197. X          /* create gods lock file but do not limit access */
  198. X          (void) aretheyon();
  199. X***************
  200. X*** 398,404 ****
  201. X      } else {
  202. X          if(curntn->active==INACTIVE) {
  203. X              standout(); 
  204. X!             mvprintw(LINES-2,0,"Sorry, for some reason, your country no longer exists.");
  205. X              mvprintw(LINES-1,0,"If there is a problem, please send mail to %s", LOGIN);
  206. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  207. X                  printw(" or %s",ntn[0].leader);
  208. X--- 396,402 ----
  209. X      } else {
  210. X          if(curntn->active==INACTIVE) {
  211. X              standout(); 
  212. X!             mvaddstr(LINES-2,0,"Sorry, for some reason, your country no longer exists.");
  213. X              mvprintw(LINES-1,0,"If there is a problem, please send mail to %s", LOGIN);
  214. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  215. X                  printw(" or %s",ntn[0].leader);
  216. X***************
  217. X*** 411,418 ****
  218. X              bye(TRUE);
  219. X          }
  220. X          if(aretheyon()==TRUE) {
  221. X!             mvprintw(LINES-2,0,"Sorry, country is already logged in.");
  222. X!             mvprintw(LINES-1,0,"Please try again later.");
  223. X              beep();
  224. X              refresh();
  225. X              getch();
  226. X--- 409,416 ----
  227. X              bye(TRUE);
  228. X          }
  229. X          if(aretheyon()==TRUE) {
  230. X!             mvaddstr(LINES-2,0,"Sorry, country is already logged in.");
  231. X!             mvaddstr(LINES-1,0,"Please try again later.");
  232. X              beep();
  233. X              refresh();
  234. X              getch();
  235. X***************
  236. X*** 422,442 ****
  237. X  #ifdef TRADE
  238. X          checktrade();
  239. X  #endif TRADE
  240. X!         if(curntn->capx>15) {
  241. X!             xcurs=15;
  242. X!             xoffset= ((int)curntn->capx-15);
  243. X!         } else {
  244. X!             xcurs= curntn->capx;
  245. X!             xoffset= 0;
  246. X!         }
  247. X!         if(curntn->capy>10) {
  248. X!             ycurs=10;
  249. X!             yoffset= ((int)curntn->capy-10);
  250. X!         } else {
  251. X!             yoffset= 0;
  252. X!             ycurs= curntn->capy;
  253. X!         }
  254. X      }
  255. X      updmove(curntn->race,country);
  256. X  
  257. X      /* open output for future printing*/
  258. X--- 420,431 ----
  259. X  #ifdef TRADE
  260. X          checktrade();
  261. X  #endif TRADE
  262. X!         xcurs = curntn->capx;
  263. X!         ycurs = curntn->capy;
  264. X      }
  265. X+     xoffset = 0;
  266. X+     yoffset = 0;
  267. X+     centermap();
  268. X      updmove(curntn->race,country);
  269. X  
  270. X      /* open output for future printing*/
  271. X***************
  272. X*** 468,474 ****
  273. X          (void) strcpy(sysmail,getenv("MAIL"));
  274. X      }
  275. X  #endif SYSMAIL
  276. X!     mvprintw(LINES-1, COLS-20, "PRESS ANY KEY");
  277. X      refresh();
  278. X      getch();        /* get response from copyscreen */
  279. X  
  280. X--- 457,463 ----
  281. X          (void) strcpy(sysmail,getenv("MAIL"));
  282. X      }
  283. X  #endif SYSMAIL
  284. X!     mvaddstr(LINES-1, COLS-20, "PRESS ANY KEY");
  285. X      refresh();
  286. X      getch();        /* get response from copyscreen */
  287. X  
  288. X***************
  289. X*** 556,568 ****
  290. X      switch(ch) {
  291. X      case EXT_CMD:    /* extended command */
  292. X          ext_cmd( -1 );
  293. X          curntn->tgold -= MOVECOST;
  294. X          return(TRUE);
  295. X          break;
  296. X      case ' ':    /* redraw the screen */
  297. X-         whatcansee();    /* what can they see */
  298. X          centermap();
  299. X-         clear();
  300. X          redraw=FULL;
  301. X          break;
  302. X  #ifdef DEBUG
  303. X--- 545,557 ----
  304. X      switch(ch) {
  305. X      case EXT_CMD:    /* extended command */
  306. X          ext_cmd( -1 );
  307. X+         makebottom();
  308. X+         refresh();
  309. X          curntn->tgold -= MOVECOST;
  310. X          return(TRUE);
  311. X          break;
  312. X      case ' ':    /* redraw the screen */
  313. X          centermap();
  314. X          redraw=FULL;
  315. X          break;
  316. X  #ifdef DEBUG
  317. X***************
  318. X*** 574,580 ****
  319. X          break;
  320. X  #endif /* DEBUG */
  321. X      case 'a':    /*army report*/
  322. X!         redraw=PART;
  323. X          armyrpt(0);
  324. X          curntn->tgold -= MOVECOST;
  325. X          break;
  326. X--- 563,569 ----
  327. X          break;
  328. X  #endif /* DEBUG */
  329. X      case 'a':    /*army report*/
  330. X!         redraw=FULL;
  331. X          armyrpt(0);
  332. X          curntn->tgold -= MOVECOST;
  333. X          break;
  334. X***************
  335. X*** 602,608 ****
  336. X          break;
  337. X      case 'd':    /*change display*/
  338. X          newdisplay();
  339. X-         curntn->tgold -= MOVECOST;
  340. X          break;
  341. X      case 'D':    /*draft*/
  342. X          draft();
  343. X--- 591,596 ----
  344. X***************
  345. X*** 676,681 ****
  346. X--- 664,670 ----
  347. X          break;
  348. X      case 'm':    /*move selected item to new x,y */
  349. X          mymove();
  350. X+         makebottom();
  351. X          curntn->tgold -= MOVECOST;
  352. X          return(TRUE);
  353. X          break;
  354. X***************
  355. X*** 793,798 ****
  356. X--- 782,800 ----
  357. X          curntn->tgold -= MOVECOST;
  358. X          wmessage();
  359. X          break;
  360. X+     case 'X': /*jump to capitol*/
  361. X+         redraw = PART;
  362. X+         pager=0;
  363. X+         selector=0;
  364. X+         jump_to(TRUE);
  365. X+         break;
  366. X+     case 'x': /*jump to a location*/
  367. X+         redraw=PART;
  368. X+         pager=0;
  369. X+         selector=0;
  370. X+         jump_to(FALSE);
  371. X+         makebottom();
  372. X+         break;
  373. X      case '7':
  374. X      case 'y':    /*move north-west*/
  375. X          pager=0;
  376. X***************
  377. X*** 808,813 ****
  378. X--- 810,816 ----
  379. X          break;
  380. X      case 'Z':    /*move civilians up to 2 spaces*/
  381. X          moveciv();
  382. X+         makebottom();
  383. X          curntn->tgold -= MOVECOST;
  384. X          break;
  385. X      case 'z':    /*login as new user */
  386. X***************
  387. X*** 816,822 ****
  388. X              ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
  389. X  #endif
  390. X          clear();
  391. X!         redraw=PART;
  392. X          if(country != 0) {
  393. X          fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  394. X              XNAGOLD ,country,curntn->tgold,"null");
  395. X--- 819,825 ----
  396. X              ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
  397. X  #endif
  398. X          clear();
  399. X!         redraw=FULL;
  400. X          if(country != 0) {
  401. X          fprintf(fexe,"L_NGOLD\t%d \t%d \t%ld \t0 \t0 \t%s\n",
  402. X              XNAGOLD ,country,curntn->tgold,"null");
  403. X***************
  404. X*** 881,886 ****
  405. X--- 884,891 ----
  406. X          curntn = &ntn[country];
  407. X  
  408. X          fprintf(stderr,"\n");
  409. X+         roads_this_turn=0;
  410. X+         terror_adj=0;
  411. X          readdata();
  412. X          execute(FALSE);
  413. X  
  414. X***************
  415. X*** 888,912 ****
  416. X          updmove(curntn->race,country);
  417. X          /*go to that nations capitol*/
  418. X          if((country==0)||(!isntn(ntn[country].active))) {
  419. X!             xcurs=15; xoffset=15;
  420. X!             ycurs=15; yoffset=15;
  421. X          } else {
  422. X!             if(curntn->capx>15) {
  423. X!                 xcurs=15;
  424. X!                 xoffset= ((int)curntn->capx-15);
  425. X!             } else {
  426. X!                 xcurs= curntn->capx;
  427. X!                 xoffset= 0;
  428. X!             }
  429. X!             if(curntn->capy>10) {
  430. X!                 ycurs=10;
  431. X!                 yoffset= ((int)curntn->capy-10);
  432. X!             } else {
  433. X!                 yoffset= 0;
  434. X!                 ycurs= curntn->capy;
  435. X!             }
  436. X          }
  437. X!         whatcansee();
  438. X          redraw=PART;
  439. X          break;
  440. X      case '?':    /*display help screen*/
  441. X--- 893,906 ----
  442. X          updmove(curntn->race,country);
  443. X          /*go to that nations capitol*/
  444. X          if((country==0)||(!isntn(ntn[country].active))) {
  445. X!             xcurs=MAPX/2-1;
  446. X!             ycurs=MAPY/2-1;
  447. X          } else {
  448. X!             xcurs=curntn->capx;
  449. X!             ycurs=curntn->capy;
  450. X          }
  451. X!         xoffset = yoffset = 0;
  452. X!         centermap();
  453. X          redraw=PART;
  454. X          break;
  455. X      case '?':    /*display help screen*/
  456. X***************
  457. X*** 1300,1306 ****
  458. X          fclose(timefp);
  459. X      }
  460. X  #endif /* TIMELOG */
  461. X!     mvprintw(LINES-1, COLS-20, "PLEASE WAIT");
  462. X      refresh();
  463. X  }
  464. X  
  465. X--- 1294,1300 ----
  466. X          fclose(timefp);
  467. X      }
  468. X  #endif /* TIMELOG */
  469. X!     mvaddstr(LINES-1, COLS-20, "PLEASE WAIT");
  470. X      refresh();
  471. X  }
  472. X  
  473. X***************
  474. X*** 1398,1404 ****
  475. X      /* other information */
  476. X      mvprintw(LINES-6,0,"The Diety: %s", LOGIN);
  477. X      if (strcmp(LOGIN,ntn[0].leader)==0) {
  478. X!         mvprintw(LINES-5,0,"The Demi-God: [none]");
  479. X      } else {
  480. X          mvprintw(LINES-5,0,"The Demi-God: %s", ntn[0].leader);
  481. X      }
  482. X--- 1392,1398 ----
  483. X      /* other information */
  484. X      mvprintw(LINES-6,0,"The Diety: %s", LOGIN);
  485. X      if (strcmp(LOGIN,ntn[0].leader)==0) {
  486. X!         mvaddstr(LINES-5,0,"The Demi-God: [none]");
  487. X      } else {
  488. X          mvprintw(LINES-5,0,"The Demi-God: %s", ntn[0].leader);
  489. X      }
  490. X*** onpc.c    Wed Sep 20 21:40:59 1989
  491. X--- npc.c    Wed Sep 20 21:41:34 1989
  492. X***************
  493. X*** 840,862 ****
  494. X              curntn->dstatus[x]=HOSTILE;
  495. X              fprintf(fnews,"2.\tnation %s and %s announce ceasefire\n",curntn->name,ntn[x].name);
  496. X              if( isnotpc(ntn[x].active) ) continue;
  497. X!             mailopen(x);
  498. X!             fprintf(fm,"nation %s and you negotiate a ceasefire\n",curntn->name);
  499. X!             mailclose();
  500. X          } else if((oldstat[x]==WAR)&&(curntn->dstatus[x]==WAR)){
  501. X              fprintf(fnews,"2.\tnation %s stays at war with %s\n",curntn->name,ntn[x].name);
  502. X          } else if((oldstat[x]<WAR)&&(curntn->dstatus[x]==WAR)){
  503. X              fprintf(fnews,"2.\tnation %s goes to war with %s\n",curntn->name,ntn[x].name);
  504. X              if( isnotpc(ntn[x].active) ) continue;
  505. X!             mailopen(x);
  506. X!             fprintf(fm,"nation %s goes to war with you\n",curntn->name);
  507. X!             mailclose();
  508. X          } else if((oldstat[x]!=JIHAD)&&(curntn->dstatus[x]==JIHAD)){
  509. X              fprintf(fnews,"2.\tnation %s announces a jihad with %s\n",curntn->name,ntn[x].name);
  510. X              if( isnotpc(ntn[x].active) ) continue;
  511. X!             mailopen(x);
  512. X!             fprintf(fm,"nation %s announces a jihad with you\n",curntn->name);
  513. X!             mailclose();
  514. X          }
  515. X      }
  516. X  }
  517. X--- 840,868 ----
  518. X              curntn->dstatus[x]=HOSTILE;
  519. X              fprintf(fnews,"2.\tnation %s and %s announce ceasefire\n",curntn->name,ntn[x].name);
  520. X              if( isnotpc(ntn[x].active) ) continue;
  521. X!             if (mailopen(x)!=(-1)) {
  522. X!                 fprintf(fm,"Message from Conquer\n\n");
  523. X!                 fprintf(fm,"Nation %s and you negotiate a ceasefire\n",curntn->name);
  524. X!                 mailclose(x);
  525. X!             }
  526. X          } else if((oldstat[x]==WAR)&&(curntn->dstatus[x]==WAR)){
  527. X              fprintf(fnews,"2.\tnation %s stays at war with %s\n",curntn->name,ntn[x].name);
  528. X          } else if((oldstat[x]<WAR)&&(curntn->dstatus[x]==WAR)){
  529. X              fprintf(fnews,"2.\tnation %s goes to war with %s\n",curntn->name,ntn[x].name);
  530. X              if( isnotpc(ntn[x].active) ) continue;
  531. X!             if (mailopen(x)!=(-1)) {
  532. X!                 fprintf(fm,"Message from Conquer\n\n");
  533. X!                 fprintf(fm,"Nation %s goes to war with you\n",curntn->name);
  534. X!                 mailclose(x);
  535. X!             }
  536. X          } else if((oldstat[x]!=JIHAD)&&(curntn->dstatus[x]==JIHAD)){
  537. X              fprintf(fnews,"2.\tnation %s announces a jihad with %s\n",curntn->name,ntn[x].name);
  538. X              if( isnotpc(ntn[x].active) ) continue;
  539. X!             if(mailopen(x)!=(-1)) {
  540. X!                 fprintf(fm,"Message from Conquer\n\n");
  541. X!                 fprintf(fm,"nation %s announces a jihad with you\n",curntn->name);
  542. X!                 mailclose(x);
  543. X!             }
  544. X          }
  545. X      }
  546. X  }
  547. X***************
  548. X*** 865,884 ****
  549. X  /* Find the average world food value per sector
  550. X   * and the average tradegood value per sector.
  551. X   * This is used for unseen sectors and unseen
  552. X!  * armies.                                                    */
  553. X  static void
  554. X  find_avg_sector ()
  555. X  {
  556. X!                 int            armynum;
  557. X!                 int            i;
  558. X!                 int            nation;
  559. X!                 int            repeat;
  560. X!     struct        s_sector    *sptr;        /*    used to speed up this function    */
  561. X!     register    int            x,y;
  562. X!     register    long        total_food   = 0;
  563. X!                 int            total_sectors;
  564. X!     register    long        total_tg     = 0;
  565. X!     register    long        useable_land = 0;
  566. X  
  567. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) {
  568. X          sptr = &sct[x][y];    
  569. X--- 871,886 ----
  570. X  /* Find the average world food value per sector
  571. X   * and the average tradegood value per sector.
  572. X   * This is used for unseen sectors and unseen
  573. X!  * armies.
  574. X!  */
  575. X  static void
  576. X  find_avg_sector ()
  577. X  {
  578. X!     int armynum, i, nation, repeat, total_sectors, total_food = 0;
  579. X!     struct s_sector *sptr;    /* used to speed up this function */
  580. X!     register int  x,y;
  581. X!     register long total_tg = 0;
  582. X!     register long useable_land = 0;
  583. X  
  584. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) {
  585. X          sptr = &sct[x][y];    
  586. X***************
  587. X*** 892,905 ****
  588. X              }
  589. X          }
  590. X      }
  591. X!     Avg_food = total_food / useable_land;
  592. X!     Avg_tradegood = total_tg / useable_land;
  593. X  
  594. X      for(nation=1;nation<NTOTAL;nation++) {
  595. X          if(isntn(ntn[nation].active)
  596. X          && !COUNT_ARMIES(nation,country)) { 
  597. X              /* Count the number of sectors which are occupied by each
  598. X!              * nation's armies.                                            */
  599. X              total_sectors = 0;
  600. X              for(armynum=1;armynum<MAXARM;armynum++)
  601. X                  if(ntn[nation].arm[armynum].sold > 0) {
  602. X--- 894,914 ----
  603. X              }
  604. X          }
  605. X      }
  606. X!     if (useable_land>0) {
  607. X!         Avg_food = total_food / useable_land;
  608. X!         Avg_tradegood = total_tg / useable_land;
  609. X!     } else {
  610. X!         /* for stupidities sake */
  611. X!         Avg_food = 0;
  612. X!         Avg_tradegood = 0;
  613. X!     }
  614. X  
  615. X      for(nation=1;nation<NTOTAL;nation++) {
  616. X          if(isntn(ntn[nation].active)
  617. X          && !COUNT_ARMIES(nation,country)) { 
  618. X              /* Count the number of sectors which are occupied by each
  619. X!              * nation's armies.
  620. X!              */
  621. X              total_sectors = 0;
  622. X              for(armynum=1;armynum<MAXARM;armynum++)
  623. X                  if(ntn[nation].arm[armynum].sold > 0) {
  624. X***************
  625. X*** 913,923 ****
  626. X                      if (!repeat) 
  627. X                          total_sectors++;
  628. X                  }
  629. X! 
  630. X!             Avg_soldiers[nation] = ntn[nation].tmil / total_sectors;
  631. X          }
  632. X      }
  633. X  }
  634. X  void
  635. X  nationrun()
  636. X  {
  637. X--- 922,934 ----
  638. X                      if (!repeat) 
  639. X                          total_sectors++;
  640. X                  }
  641. X!             if (total_sectors > 0)
  642. X!                 Avg_soldiers[nation] = ntn[nation].tmil / total_sectors;
  643. X!             else Avg_soldiers[nation] = 0;
  644. X          }
  645. X      }
  646. X  }
  647. X+ 
  648. X  void
  649. X  nationrun()
  650. X  {
  651. X***************
  652. X*** 927,933 ****
  653. X      float    hunger;
  654. X      long zz;
  655. X      check();
  656. X!     prep(country,FALSE,FALSE);
  657. X  
  658. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) attr[x][y]=0;
  659. X  
  660. X--- 938,944 ----
  661. X      float    hunger;
  662. X      long zz;
  663. X      check();
  664. X!     prep(country,FALSE);
  665. X  
  666. X      for(x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) attr[x][y]=0;
  667. X  
  668. X***************
  669. X*** 967,978 ****
  670. X          if((curntn->dstatus[x] >= HOSTILE) 
  671. X          && (ispc(ntn[x].active))) 
  672. X          if (rand()%4 == 0) {    /* send the message!! */
  673. X!             printf("Sent message to %s\n",ntn[x].name);
  674. X!             mailopen(x);
  675. X!             fprintf(fm,"Message to %s from %s (%s of year %d)\n\n"
  676. X!              ,ntn[x].name,curntn->name,PSEASON(TURN),YEAR(TURN));
  677. X!             makemess(rand()%5 +1,fm);
  678. X!             mailclose();
  679. X          }
  680. X      }
  681. X  #endif SPEW
  682. X--- 978,990 ----
  683. X          if((curntn->dstatus[x] >= HOSTILE) 
  684. X          && (ispc(ntn[x].active))) 
  685. X          if (rand()%4 == 0) {    /* send the message!! */
  686. X!             if (mailopen(x)!=(-1)) {
  687. X!                 fprintf(fm,"Message to %s from %s (%s of year %d)\n\n"
  688. X!                        ,ntn[x].name,curntn->name,PSEASON(TURN),YEAR(TURN));
  689. X!                 makemess(rand()%5 +1,fm);
  690. X!                 mailclose(x);
  691. X!                 printf("Sent message to %s\n",ntn[x].name);
  692. X!             }
  693. X          }
  694. X      }
  695. X  #endif SPEW
  696. X***************
  697. X*** 1287,1293 ****
  698. X  register short natn;
  699. X  {
  700. X      register    int        i,j;
  701. X!                 int        repeat;
  702. X      register    int        x,y;
  703. X  
  704. X      if (COUNT_ARMIES(natn,country)) {
  705. X--- 1299,1305 ----
  706. X  register short natn;
  707. X  {
  708. X      register    int        i,j;
  709. X!     int        repeat;
  710. X      register    int        x,y;
  711. X  
  712. X      if (COUNT_ARMIES(natn,country)) {
  713. X***************
  714. X*** 1336,1341 ****
  715. X--- 1348,1354 ----
  716. X              if(ISCITY(sct[x][y].designation))
  717. X                  attr[x][y] += 50;
  718. X              /* should spread 3000 points over country */
  719. X+             if (ntn[country].tciv>0)
  720. X              attr[x][y]+=3000*sct[x][y].people/ntn[country].tciv;
  721. X          }
  722. X      }
  723. X*** otrade.c    Wed Sep 20 21:41:00 1989
  724. X--- trade.c    Wed Sep 20 21:41:35 1989
  725. X***************
  726. X*** 71,76 ****
  727. X--- 71,77 ----
  728. X      long lvar1[MAXITM], lvar2[MAXITM], holdlong, holdlong2, armyvalue();
  729. X      void tradeerr(), setaside(), takeback();
  730. X      
  731. X+     clear();
  732. X      while (done==FALSE) {
  733. X          itemnum=0;
  734. X          done=TRUE;
  735. X***************
  736. X*** 90,96 ****
  737. X              }
  738. X          }
  739. X          if (notopen==FALSE) fclose(tfile);
  740. X!         clear();
  741. X          /* display header */
  742. X          standout();
  743. X          mvaddstr(0,27,"COMMODITIES EXCHANGE");
  744. X--- 91,98 ----
  745. X              }
  746. X          }
  747. X          if (notopen==FALSE) fclose(tfile);
  748. X!         move(0,0);
  749. X!         clrtobot();
  750. X          /* display header */
  751. X          standout();
  752. X          mvaddstr(0,27,"COMMODITIES EXCHANGE");
  753. X***************
  754. X*** 97,103 ****
  755. X          mvaddstr(1,20,"No Guarantees... All Trades Final");
  756. X          standend();
  757. X          count=3;
  758. X!         mvprintw(count,0,"    Nation                       Item            Price");
  759. X          /* give some minor items for purchase */
  760. X          mvprintw(++count,0,"%2d) %-20s",GETFOOD,"Merchants Guild");
  761. X          mvprintw(count,30,"%9ld %s",GODFOOD,commodities[TDFOOD]);
  762. X--- 99,105 ----
  763. X          mvaddstr(1,20,"No Guarantees... All Trades Final");
  764. X          standend();
  765. X          count=3;
  766. X!         mvaddstr(count,0,"    Nation                       Item            Price");
  767. X          /* give some minor items for purchase */
  768. X          mvprintw(++count,0,"%2d) %-20s",GETFOOD,"Merchants Guild");
  769. X          mvprintw(count,30,"%9ld %s",GODFOOD,commodities[TDFOOD]);
  770. X***************
  771. X*** 147,153 ****
  772. X                      standout();
  773. X                      mvaddstr(0,27,"COMMODITIES EXCHANGE");
  774. X                      standend();
  775. X!                         mvprintw(2,0,"    Nation                       Item            Minimum Price");
  776. X                      count=2;
  777. X                  }
  778. X              }
  779. X--- 149,155 ----
  780. X                      standout();
  781. X                      mvaddstr(0,27,"COMMODITIES EXCHANGE");
  782. X                      standend();
  783. X!                         mvaddstr(2,0,"    Nation                       Item            Minimum Price");
  784. X                      count=2;
  785. X                  }
  786. X              }
  787. X***************
  788. X*** 364,370 ****
  789. X                  }
  790. X                  break;
  791. X              case TDLAND:
  792. X!                 mvprintw(count++,0,"What Y position? ");
  793. X                  refresh();
  794. X                  extint = get_number();
  795. X                  if (extint < 0) {
  796. X--- 366,372 ----
  797. X                  }
  798. X                  break;
  799. X              case TDLAND:
  800. X!                 mvaddstr(count++,0,"What Y position? ");
  801. X                  refresh();
  802. X                  extint = get_number();
  803. X                  if (extint < 0) {
  804. X*** otxt0    Wed Sep 20 21:41:01 1989
  805. X--- txt0    Wed Sep 20 21:41:36 1989
  806. X***************
  807. X*** 1,25 ****
  808. X!                        CONQUER COMMAND HELP SCREEN
  809. X  
  810. X!      SELECTIVE                 MOVEMENT                   CIVIL
  811. X! 'o': pick previous unit    'h': move west          'r': redesignate
  812. X! 'p': pick next unit        'y': move north-west    't': transport via ship
  813. X! 'G': go to next army       'k': move north         'C': construct
  814. X! 'F': go to next fleet      'u': move north-east    'D': draft armies
  815. X! 'm': move selected unit    'l': move east          'Z': move civilians
  816. X!                            'n': move south-east
  817. X!        FORMS               'j': move south             COMMUNICATIVE
  818. X! 'c': administrative        'b': move south-west    'R': read mail messages
  819. X! 's': world score list      'J': scroll south       'N': read newspaper
  820. X! 'B': budget status         'K': scroll north       'T': trade with players
  821. X! 'I': campaign info         'L': scroll east        'W': write mail messages
  822. X! 'M': magic screen          'H': scroll west
  823. X! 'P': production status                                   MILITARY
  824. X! 'S': diplomacy status        MISC COMMANDS         'a': army report
  825. X!                            'q': quit and save      'f': fleet report
  826. X        VISUAL               'v': version credits    'g': group army report
  827. X  'd': change display        '!': repeat unit cmd    'w': wizardry commands
  828. X  'cntrl-L': redraw          '?': help screens     'ESC': extra commands
  829. X  END
  830. X                        CONQUER EXTENDED COMMANDS
  831. X  
  832. X     All of the extended commands are accessed by typing the ESC key and
  833. X--- 1,46 ----
  834. X!                         CONQUER COMMAND HELP SCREEN
  835. X  
  836. X!       SELECTIVE                  MOVEMENT                 CIVIL
  837. X! 'o': pick previous unit    'x': jump to sector     'r': redesignate
  838. X! 'p': pick next unit        'X': jump to capitol    't': transport via ship
  839. X! 'G': go to next army       'h','H': move west      'C': construct
  840. X! 'F': go to next fleet      'y': move north-west    'D': draft armies
  841. X! 'm': move selected unit    'k','K': move north     'Z': move civilians
  842. X!                            'u': move north-east
  843. X!        FORMS               'l','L': move east          COMMUNICATIVE
  844. X! 'c': administrative        'n': move south-east    'R': read mail messages
  845. X! 's': world score list      'j','J': move south     'N': read newspaper
  846. X! 'B': budget status         'b': move south-west    'T': trade with players
  847. X! 'I': campaign info                                 'W': write mail messages
  848. X! 'M': magic screen             MISC COMMANDS
  849. X! 'P': production status     'Q': quit and save            MILITARY
  850. X! 'S': diplomacy status      'q': quit and save      'a': army report
  851. X!                            'z': change login       'f': fleet report
  852. X        VISUAL               'v': version credits    'g': group army report
  853. X  'd': change display        '!': repeat unit cmd    'w': wizardry commands
  854. X  'cntrl-L': redraw          '?': help screens     'ESC': extra commands
  855. X  END
  856. X+                        CONQUER CURSOR MOVEMENT
  857. X+ 
  858. X+                                NORTH
  859. X+ 
  860. X+                                 (K)
  861. X+                           y,7   k,8   u,9
  862. X+                              \   |   /
  863. X+                                \ | /
  864. X+           WEST      (H) h,4 ---- 0 ---- l,6 (L)       EAST
  865. X+                                / | \
  866. X+                              /   |   \
  867. X+                           b,1   j,2   n,3
  868. X+                                 (J)
  869. X+ 
  870. X+                                SOUTH
  871. X+ 
  872. X+                Figures in parenthesis indicate scrolling
  873. X+            Note either numeric keypad OR vi keys can be used
  874. X+ 
  875. X+                 <cntrl>-L will redraw the screen
  876. X+ END
  877. X                        CONQUER EXTENDED COMMANDS
  878. X  
  879. X     All of the extended commands are accessed by typing the ESC key and
  880. X***************
  881. X*** 99,125 ****
  882. X        Perhaps god is looking for people to run his worlds.  Send mail
  883. X  to XLOGIN and you may find out.
  884. X  END
  885. X-                        CONQUER CURSOR MOVEMENT
  886. X- 
  887. X-                                NORTH
  888. X- 
  889. X-                                 (K)
  890. X-                           y,7   k,8   u,9
  891. X-                              \   |   /
  892. X-                                \ | /
  893. X-           WEST      (H) h,4 ---- 0 ---- l,6 (L)       EAST
  894. X-                                / | \
  895. X-                              /   |   \
  896. X-                           b,1   j,2   n,3
  897. X-                                 (J)
  898. X- 
  899. X-                                SOUTH
  900. X- 
  901. X-                Figures in parenthesis indicate scrolling
  902. X-            Note either numeric keypad OR vi keys can be used
  903. X- 
  904. X-                 <cntrl>-L will redraw the screen
  905. X- END
  906. X                          CONQUER COMMANDS -- lower case commands
  907. X  
  908. X  'a': army report:    Gives an army's details & permits changing army status,
  909. X--- 120,125 ----
  910. X***************
  911. X*** 194,200 ****
  912. X  
  913. X  To my knowledge Conquer runs well on UNIX (SYS V or BSD 4.3) systems.  The
  914. X  game treats turns like a hidden move wargame would...  you enter all your
  915. X! moves into the program and conquer tells you what happens.  Like wargames, 
  916. X  there is no turning back.  Every move you make will be saved when you quit.
  917. X  If you goof up real bad, you need to go to the administrator, and have him
  918. X  log in (as god) and fix whatever you did.  Of course, bribery will probably
  919. X--- 194,200 ----
  920. X  
  921. X  To my knowledge Conquer runs well on UNIX (SYS V or BSD 4.3) systems.  The
  922. X  game treats turns like a hidden move wargame would...  you enter all your
  923. X! moves into the program and conquer tells you what happens.  Like wargames,
  924. X  there is no turning back.  Every move you make will be saved when you quit.
  925. X  If you goof up real bad, you need to go to the administrator, and have him
  926. X  log in (as god) and fix whatever you did.  Of course, bribery will probably
  927. X*** otxt1    Wed Sep 20 21:41:01 1989
  928. X--- txt1    Wed Sep 20 21:41:36 1989
  929. X***************
  930. X*** 125,132 ****
  931. X  handle poor or low value sectors.  Sum the numbers found below.  The result
  932. X  is the relative "attractiveness" of a sector.
  933. X  
  934. X! General Modifiers:   Goldmine: XGOLDATTR / jewels   Farm: XFARMATTR / food value  Other: XOTHRATTR
  935. X!   Trade Good: XTGATTR     Mine: XMINEATTR / metals       Town: XTOWNATTR             City: XCAPATTR
  936. X  
  937. X                                  Racial Modifiers
  938. X  Race        Mtn    Hill   Clear  Forest    Wood    City    Mine Gldmine
  939. X--- 125,132 ----
  940. X  handle poor or low value sectors.  Sum the numbers found below.  The result
  941. X  is the relative "attractiveness" of a sector.
  942. X  
  943. X! General Modifiers:   Goldmine: XGOLDATTR * jewels   Farm: XFARMATTR * food value  Other: XOTHRATTR
  944. X!   Trade Good: XTGATTR     Mine: XMINEATTR * metals       Town: XTOWNATTR             City: XCAPATTR
  945. X  
  946. X                                  Racial Modifiers
  947. X  Race        Mtn    Hill   Clear  Forest    Wood    City    Mine Gldmine
  948. X*** otxt4    Wed Sep 20 21:41:01 1989
  949. X--- txt4    Wed Sep 20 21:41:37 1989
  950. X***************
  951. X*** 27,34 ****
  952. X  ZCAPITOL  and can build ships here.  Town tax=rate*XTAXTOWN talons/person and
  953. X         City tax=rate*XTAXCITY talons/person.  Both cost a lot to redesignate
  954. X         AND take metal to create.  They are captured only if you are the ONLY
  955. X!        occupant of the sector when the world is updated.  NPC nations are
  956. X!        destroyed if they lose their capitol.  Cities, Towns, and Capitols
  957. X         add to many of a nations characteristics.
  958. X  ZMINE  Mine:  Produce (tax/100)*XTAXMETAL*Metal*People Talons & Produces
  959. X         Metal Ores.  Each mine you own adds to your nations mine_ability.
  960. X--- 27,34 ----
  961. X  ZCAPITOL  and can build ships here.  Town tax=rate*XTAXTOWN talons/person and
  962. X         City tax=rate*XTAXCITY talons/person.  Both cost a lot to redesignate
  963. X         AND take metal to create.  They are captured only if you are the ONLY
  964. X!        occupant of the sector when the world is updated.  Nations become
  965. X!        depleted if they lose their capitol.  Cities, Towns, and Capitols
  966. X         add to many of a nations characteristics.
  967. X  ZMINE  Mine:  Produce (tax/100)*XTAXMETAL*Metal*People Talons & Produces
  968. X         Metal Ores.  Each mine you own adds to your nations mine_ability.
  969. X***************
  970. X*** 36,43 ****
  971. X         Each farm you own adds to your nations farm_ability.
  972. X  ZGOLD  Produces (tax/100)*XTAXGOLD*Gold*People Talons & Produces Jewels
  973. X  ZDEVASTATED  Devastated sector.  People dont like to live where devastated.
  974. X! ZRUIN  Ruins are devastated Cities.  They may be rebuilt at 1/2 price.
  975. X!        They can't be redesignated to anything other than a city.
  976. X  END
  977. X                        DESIGNATION DESCRIPTIONS              pg.2
  978. X  
  979. X--- 36,43 ----
  980. X         Each farm you own adds to your nations farm_ability.
  981. X  ZGOLD  Produces (tax/100)*XTAXGOLD*Gold*People Talons & Produces Jewels
  982. X  ZDEVASTATED  Devastated sector.  People dont like to live where devastated.
  983. X! ZRUIN  Ruins are devastated Cities.  They may be rebuilt to cities at
  984. X!        half cost or for XREBUILDCOST talons may be redesignated otherwise.
  985. X  END
  986. X                        DESIGNATION DESCRIPTIONS              pg.2
  987. X  
  988. X*** otxt5    Wed Sep 20 21:41:01 1989
  989. X--- txt5    Wed Sep 20 21:41:37 1989
  990. X***************
  991. X*** 177,184 ****
  992. X  same race as you.
  993. X    
  994. X  # STARTING VALUES
  995. X! reputation = prestige = 50         knowledge = mine ability = farm ability=10
  996. X! eatrate     = 1.00                 tax rate=10%              poverty = 95%
  997. X  END
  998. X                  FORMULAE USED FOR NATION ATTRIBUTES          pg. 2
  999. X  
  1000. X--- 177,184 ----
  1001. X  same race as you.
  1002. X    
  1003. X  # STARTING VALUES
  1004. X! reputation = prestige = 50     knowledge = mine ability = farm ability = 10
  1005. X! eatrate     = 1.00             tax rate=10%               poverty = 95%
  1006. X  END
  1007. X                  FORMULAE USED FOR NATION ATTRIBUTES          pg. 2
  1008. X  
  1009. X***************
  1010. X*** 199,210 ****
  1011. X  END
  1012. X                  FORMULAE USED FOR NATION ATTRIBUTES          pg. 3
  1013. X  
  1014. X! poverty     : is funny.  You can give charity to the poor to lower the poverty
  1015. X!               rate but the equilibrium level with no charity will be about
  1016. X!               100-wealth/4.  Charity is a user paramter, which indicates the
  1017. X!               percent of your NET income to go to the poor.  Giving twice your
  1018. X!               population in talons will reduce poverty by one.
  1019. X! wealth      : see elsewhere.
  1020. X  END
  1021. X                  ADDITIONAL MODIFIERS TO NATIONAL ATTRIBUTES
  1022. X  
  1023. X--- 199,222 ----
  1024. X  END
  1025. X                  FORMULAE USED FOR NATION ATTRIBUTES          pg. 3
  1026. X  
  1027. X! charity     = Is the percent of net gold given directly to the general
  1028. X!               population.  This has a direct effect of reducing poverty
  1029. X!               by 1% for every two talons given to each person.
  1030. X! poverty     = Poverty is a relative value of the number of talons you have
  1031. X!               per each civilian.  The inital value is determined as:
  1032. X!                 talons/civilian  poverty       talons/civilian  poverty
  1033. X!                       < 0          95%             80-120       40%-30%
  1034. X!                      0-30        95%-65%          120-200       30%-20%
  1035. X!                     30-80        65%-40%           > 200          20%
  1036. X!               Poverty is then modified directly by the amount of talons given
  1037. X!               directly to the people through charity.
  1038. X! inflation   = inflation is an indicator as to the actual value of the national
  1039. X!               talon.  If inflation is zero percent, then it is 1:1.
  1040. X!               Inflation is calculated as:
  1041. X!                   between 25%-125% of the tax rate [randomly determined]
  1042. X!                   plus (poverty - 50)/2 and is then adjusted by the ratio of
  1043. X!                   military to civilians.
  1044. X! wealth      = see elsewhere.
  1045. X  END
  1046. X                  ADDITIONAL MODIFIERS TO NATIONAL ATTRIBUTES
  1047. X  
  1048. X*** opsmap.c    Wed Sep 20 21:41:00 1989
  1049. X--- psmap.c    Wed Sep 20 21:41:39 1989
  1050. X***************
  1051. X*** 104,115 ****
  1052. X  isinstr(string, word)
  1053. X      char *string, *word;
  1054. X  {
  1055. X!     while ((c = index(string, *word)) != 0)
  1056. X!     if (!strncmp((char *) c, word, strlen(word))) {
  1057. X!         return (TRUE);
  1058. X!     } else
  1059. X!         string = (char *) c + 1;
  1060. X!     return (FALSE);
  1061. X  }
  1062. X  
  1063. X  int
  1064. X--- 104,119 ----
  1065. X  isinstr(string, word)
  1066. X      char *string, *word;
  1067. X  {
  1068. X!     int i,l1=strlen(string),l2=strlen(word);
  1069. X!     
  1070. X!     if (l1 < l2) return(FALSE);
  1071. X!     for(i = 0; i < l1; i++ ) {
  1072. X!         if (l1-i<l2) break;
  1073. X!         if (string[i] == word[0]) {
  1074. X!             if (strncmp(string+i,word,l2)==0) return(TRUE);
  1075. X!         }
  1076. X!     }
  1077. X!     return(FALSE);
  1078. X  }
  1079. X  
  1080. X  int
  1081. X*** patchlevel.h.orig    Thu Sep 21 05:54:43 1989
  1082. X--- patchlevel.h    Thu Sep 21 06:08:15 1989
  1083. X***************
  1084. X*** 1 ****
  1085. X! #define PATCHLEVEL    5
  1086. X--- 1 ----
  1087. X! #define PATCHLEVEL    6
  1088. SHAR_EOF
  1089. chmod 0644 patchV4.6 || echo "restore of patchV4.6 fails"
  1090. sed 's/^X//' << 'SHAR_EOF' > sunconqrast.h &&
  1091. X/*********************************************************************
  1092. X*                                                                    *
  1093. X* Header file for sun version of conqrast                            *
  1094. X*                                                                    *
  1095. X*********************************************************************/
  1096. X
  1097. X#define driver_version "1"
  1098. X#define conqrast_name "Sunconqrast"
  1099. X
  1100. X#include <pixrect/pixrect_hs.h>
  1101. X
  1102. Xtypedef struct pixrect * bitmap;
  1103. Xtypedef char * screen_type;
  1104. Xtypedef struct pixfont * font;
  1105. X
  1106. X#define initialise_bitmaps() /* EMPTY */
  1107. X#define finish_bitmaps() /* EMPTY */
  1108. X
  1109. X#define is_screenname(mapname) (!strncmp(mapname,"/dev/",5))
  1110. X#define get_default_screen_name() "/dev/fb"
  1111. X#define screen_named(name) (name)
  1112. X#define get_screen_bitmap(screen) (pr_open(screen))
  1113. X#define create_bitmap(width,height) (mem_create(width,height,1))
  1114. X#define destroy_bitmap(bitmap) pr_close(bitmap)
  1115. X#define font_named(name) pf_open(name)
  1116. X#define bad_font(font) ((font)==NULL)
  1117. X#define font_height(font) ((font->pf_defaultsize).y)
  1118. X#define font_width(font) ((font->pf_defaultsize).x)
  1119. X#define font_baseline(font) (0-(font->pf_char)['A'].pc_home.y+1)
  1120. X
  1121. X#define BLACK PIX_SET
  1122. X#define WHITE PIX_CLR
  1123. X#define DRAW_BLACK (PIX_DST|PIX_SRC)
  1124. X#define DRAW_WHITE (PIX_DST&PIX_NOT(PIX_SRC))
  1125. X
  1126. X#define set_bit(bitmap,x,y,val) pr_put(bitmap,x,y,val)
  1127. X#define draw_line(bitmap,x1,y1,x2,y2,colour) pr_vector(bitmap,x1,y1,x2,y2,colour,0)
  1128. SHAR_EOF
  1129. chmod 0644 sunconqrast.h || echo "restore of sunconqrast.h fails"
  1130. sed 's/^X//' << 'SHAR_EOF' > sunstuff.c &&
  1131. X#include <stdio.h>
  1132. X#include "sunconqrast.h"
  1133. X
  1134. Xstruct                /* maps from size of map to the font */
  1135. X                /* to use */
  1136. X    {                /* if size > mag use font */
  1137. X    int mag;
  1138. X    char *font,*bold;
  1139. X    } fonts[] =
  1140. X        {
  1141. X    9,  "/usr/lib/fonts/fixedwidthfonts/screen.r.7", NULL,
  1142. X    11, "/usr/lib/fonts/fixedwidthfonts/cour.r.10",
  1143. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.10",
  1144. X    12, "/usr/lib/fonts/fixedwidthfonts/cour.r.12",
  1145. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.12",
  1146. X    14, "/usr/lib/fonts/fixedwidthfonts/cour.r.14",
  1147. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.14",
  1148. X    16, "/usr/lib/fonts/fixedwidthfonts/cour.r.16",
  1149. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.16",
  1150. X    18, "/usr/lib/fonts/fixedwidthfonts/cour.r.18",
  1151. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.18",
  1152. X    22, "/usr/lib/fonts/fixedwidthfonts/cour.r.24",
  1153. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.24",
  1154. X    999999, NULL
  1155. X    };
  1156. X
  1157. Xstatic int encoding_type = RT_STANDARD ;
  1158. X
  1159. Xint
  1160. Xargument_parse(argv)
  1161. X
  1162. Xchar *argv[];
  1163. X
  1164. X{
  1165. Xif ( !strcmp(*argv,"-compact"))
  1166. X    {
  1167. X    encoding_type = RT_BYTE_ENCODED ;
  1168. X    return 1;
  1169. X    }
  1170. Xelse
  1171. X    return 0;
  1172. X}
  1173. X
  1174. X/*ARGSUSED*/
  1175. Xint
  1176. Xwrite_bitmap(bm,file,width,height)
  1177. X
  1178. Xbitmap bm;
  1179. Xchar *file;
  1180. Xint width,height;
  1181. X
  1182. X{
  1183. X    FILE *f;
  1184. X
  1185. X    if ((f=fopen(file,"w"))==NULL)
  1186. X        ioerror("Can't open output file %s",file);
  1187. X
  1188. X    return pr_dump( bm, f, RMT_NONE, encoding_type,0);
  1189. X    }
  1190. X
  1191. X
  1192. X
  1193. Xvoid
  1194. Xdisplay_bitmap(bm,x,y,w,h)
  1195. X
  1196. Xbitmap bm;
  1197. Xint x,y,w,h;
  1198. X
  1199. X{
  1200. X    struct pixrect *screen=pr_open("/dev/fb");
  1201. X
  1202. X    pr_rop(screen,x,y,w,h,PIX_SRC,bm,0,0);
  1203. X
  1204. X    }
  1205. X
  1206. Xbitmap_text(pr,x,y,colour,pf,str)
  1207. X
  1208. Xbitmap pr;
  1209. Xint x,y;
  1210. Xint colour;
  1211. Xfont pf;
  1212. Xchar *str;
  1213. X
  1214. X{
  1215. X    struct pr_prpos pos;
  1216. X  
  1217. X    pos.pos.x=x;
  1218. X    pos.pos.y=y;
  1219. X    pos.pr=pr;
  1220. X
  1221. X    pf_text(pos,colour,pf,str);
  1222. X    }
  1223. X
  1224. SHAR_EOF
  1225. chmod 0644 sunstuff.c || echo "restore of sunstuff.c fails"
  1226. sed 's/^X//' << 'SHAR_EOF' > util.c &&
  1227. X#include <stdio.h>
  1228. X#include <sgtty.h>
  1229. X
  1230. X/*********************************************************************
  1231. X*                                                                    *
  1232. X* various utility bits split off to try and get conqrast.c down to a *
  1233. X* reasonable size                                                    *
  1234. X*                                                                    *
  1235. X*********************************************************************/
  1236. X
  1237. X
  1238. X/*********************************************************************
  1239. X*                                                                    *
  1240. X* routine to build the dither matrix used to shade                   *
  1241. X*                                                                    *
  1242. X*********************************************************************/
  1243. X
  1244. X#define MAXDITHER 4        /* don't touch this */
  1245. X
  1246. Xshort dit[1<<MAXDITHER][1<<MAXDITHER];
  1247. X
  1248. Xvoid
  1249. Xbuild_dither_matrix(depth)
  1250. X
  1251. Xint depth;
  1252. X
  1253. X{
  1254. X    register int d,i,j,p;
  1255. X    depth= 1<<depth;
  1256. X
  1257. X    dit[0][0]=0; dit[1][0]=2;
  1258. X
  1259. X    dit[0][1]=3; dit[1][1]=1;
  1260. X
  1261. X    for(d=2;d<depth;d=d<<1)
  1262. X    for(i=0;i<d;i++)
  1263. X        for(j=0;j<d;j++)
  1264. X        {
  1265. X        p= (dit[i][j] *=4);
  1266. X        dit[d+i][j] = p+2;
  1267. X        dit[i][d+j] = p+3;
  1268. X        dit[d+i][d+j] = p+1;
  1269. X        }
  1270. X
  1271. X    if (depth != 16 )
  1272. X    for(i=0;i<depth;i++)
  1273. X        for (j=0;j<depth;j++)
  1274. X        dit[i][j] = (dit[i][j]*256)/d/d;
  1275. X
  1276. X    }
  1277. X
  1278. X/*********************************************************************
  1279. X*                                                                    *
  1280. X* disconnect from controlling tty                                    *
  1281. X*                                                                    *
  1282. X*********************************************************************/
  1283. X
  1284. Xvoid
  1285. Xdisconnect()
  1286. X
  1287. X{
  1288. X    int tty;
  1289. X
  1290. X    tty=open("/dev/tty",0);
  1291. X
  1292. X    ioctl(tty,TIOCNOTTY,0);
  1293. X
  1294. X    close(tty);
  1295. X    }
  1296. X
  1297. X/*********************************************************************
  1298. X*                                                                    *
  1299. X* go into background                                                 *
  1300. X*                                                                    *
  1301. X*********************************************************************/
  1302. X
  1303. Xvoid
  1304. Xbackground()
  1305. X
  1306. X{
  1307. X    switch (fork())
  1308. X    {
  1309. X    case 0: break;
  1310. X
  1311. X    default: exit(0);
  1312. X    }
  1313. X    printf("(%d)\n",getpid());
  1314. X    }
  1315. X
  1316. X/*********************************************************************
  1317. X*                                                                    *
  1318. X* Print a useage message and exit. This needs to be expanded.        *
  1319. X*                                                                    *
  1320. X*********************************************************************/
  1321. X
  1322. Xvoid
  1323. Xhelp_message(me)
  1324. X
  1325. Xchar *me;
  1326. X
  1327. X{
  1328. X    printf("%s: Usage --\n",me);
  1329. X    printf("\n%s\t\t-o <file-or-display>\n",me);
  1330. X    printf("\t\t-N <nation>\n");
  1331. X    printf("\t\t-D <game-directory>\n");
  1332. X    printf("\t\t-c<contour-character> <brightness>\n");
  1333. X    printf("\t\t-f <which-font> <font>\n");
  1334. X    printf("\t\t-d -n{a} -b{a} -m <magnification> -a -bg -l -t -v\n");
  1335. X    exit(1);
  1336. X    }
  1337. X
  1338. SHAR_EOF
  1339. chmod 0644 util.c || echo "restore of util.c fails"
  1340. sed 's/^X//' << 'SHAR_EOF' > xconqrast.h &&
  1341. X
  1342. X/* header for X */
  1343. X
  1344. X#define driver_version "preliminary"
  1345. X#define conqrast_name "Xconqrast"
  1346. X
  1347. X#include <X11/Xlib.h>
  1348. X
  1349. Xtypedef Drawable bitmap ;
  1350. Xtypedef Display *screen_type;
  1351. Xtypedef char *font;        /* this needs doing */
  1352. X
  1353. X#define is_screenname(name) (index(name,':')!=NULL) /* I think */
  1354. X#define get_default_screen_name() NULL /* I have no idea */
  1355. X
  1356. Xscreen_type screen_named();
  1357. X
  1358. Xbitmap get_screen_bitmap();
  1359. Xbitmap create_bitmap();
  1360. X
  1361. X#define destroy_bitmap(bm)    /* I don't know how to */
  1362. X#define font_named(name) (name)    /* ditto */
  1363. X#define bad_font(font) ((font)==NULL) /* ??? */
  1364. X#define font_height(font) (0)    /* ??? */
  1365. X#define font_width(font) (0)    /* ??? */
  1366. X#define font_baseline(font) (0) /* ??? */
  1367. X
  1368. X#define BLACK (1)
  1369. X#define WHITE (0)        /* guessing */
  1370. X#define DRAW_BLACK (1)        /* ?? */
  1371. X#define DRAW_WHITE (2)
  1372. X
  1373. Xvoid set_bit();
  1374. X
  1375. X#define draw_line(bitmap,x1,y1,x2,y2,colour) /* again no idea! */
  1376. X
  1377. X
  1378. SHAR_EOF
  1379. chmod 0644 xconqrast.h || echo "restore of xconqrast.h fails"
  1380. sed 's/^X//' << 'SHAR_EOF' > xstuff.c &&
  1381. X#include <stdio.h>
  1382. X#include "xconqrast.h"
  1383. X
  1384. X/* utilities for X */
  1385. X
  1386. XDisplay *display;
  1387. XDrawable root;
  1388. Xint screen;
  1389. XGC gc;
  1390. Xshort greyscale;
  1391. X
  1392. Xstruct                /* maps from size of map to the font */
  1393. X                /* to use */
  1394. X    {                /* if size > mag use font */
  1395. X    int mag;
  1396. X    char *font,*bold;
  1397. X    } fonts[] =            /* copied from the sun driver! need replacing */
  1398. X        {
  1399. X    9,  "/usr/lib/fonts/fixedwidthfonts/screen.r.7", NULL,
  1400. X    11, "/usr/lib/fonts/fixedwidthfonts/cour.r.10",
  1401. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.10",
  1402. X    12, "/usr/lib/fonts/fixedwidthfonts/cour.r.12",
  1403. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.12",
  1404. X    14, "/usr/lib/fonts/fixedwidthfonts/cour.r.14",
  1405. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.14",
  1406. X    16, "/usr/lib/fonts/fixedwidthfonts/cour.r.16",
  1407. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.16",
  1408. X    18, "/usr/lib/fonts/fixedwidthfonts/cour.r.18",
  1409. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.18",
  1410. X    22, "/usr/lib/fonts/fixedwidthfonts/cour.r.24",
  1411. X        "/usr/lib/fonts/fixedwidthfonts/cour.b.24",
  1412. X    999999, NULL
  1413. X    };
  1414. X
  1415. Xint
  1416. Xargument_parse(argv)
  1417. X
  1418. Xchar *argv[];
  1419. X
  1420. X{
  1421. Xreturn 0;
  1422. X}
  1423. X
  1424. Xvoid
  1425. Xinitialise_bitmaps()
  1426. X
  1427. X
  1428. X
  1429. X
  1430. X{
  1431. X    }
  1432. X
  1433. Xscreen_type
  1434. Xscreen_named(name)
  1435. X
  1436. Xchar *name;
  1437. X
  1438. X{
  1439. Xint sc;
  1440. X
  1441. Xif ((display=XOpenDisplay(name)) == NULL)
  1442. X    error("No X server!");
  1443. X
  1444. Xroot=XDefaultRootWindow(display);
  1445. Xsc=XDefaultScreen(display);
  1446. Xgc=XDefaultGC(display,sc);
  1447. X
  1448. Xreturn display;
  1449. X}
  1450. X
  1451. Xbitmap
  1452. Xget_screen_bitmap(screen)
  1453. X
  1454. Xscreen_type screen;
  1455. X
  1456. X{
  1457. Xint sc;
  1458. Xreturn root;
  1459. X}
  1460. X
  1461. Xbitmap
  1462. Xcreate_bitmap(width,height)
  1463. X
  1464. Xint width,height;
  1465. X
  1466. X{
  1467. Xint depth=1;
  1468. X
  1469. Xif ( depth != 1 )
  1470. X    greyscale=1;
  1471. X
  1472. Xreturn XCreatePixmap(display,root,width,height,depth);
  1473. X}
  1474. X
  1475. Xvoid
  1476. Xset_bit(bm,x,y,val)
  1477. X
  1478. Xbitmap bm;
  1479. Xint x,y;
  1480. Xint val;
  1481. X
  1482. X{
  1483. X
  1484. Xif (!greyscale )
  1485. X    {
  1486. X    XSetForeground(display,gc,(unsigned long)val);
  1487. X    XDrawPoint(display,bm,gc,x,y);
  1488. X    }
  1489. Xelse    
  1490. X    if (val)
  1491. X        XDrawPoint(display,bm,gc,x,y);
  1492. X}
  1493. X
  1494. Xvoid
  1495. Xdisplay_bitmap( bm,x,y,width,height)
  1496. X
  1497. Xbitmap bm;
  1498. Xint x,y,width,height;
  1499. X
  1500. X{
  1501. XXCopyArea(display,bm,root,gc,0,0,width,height,x,y);
  1502. X    }
  1503. X
  1504. Xint 
  1505. Xwrite_bitmap(bm,file,width,height)
  1506. X
  1507. Xbitmap bm;
  1508. Xchar *file;
  1509. Xint width,height;
  1510. X{
  1511. X
  1512. Xreturn XWriteBitmapFile(display,file,bm,width,height,-1,-1);
  1513. X    }
  1514. X
  1515. X
  1516. Xvoid
  1517. Xfinish_bitmaps()
  1518. X
  1519. X{
  1520. XXCloseDisplay(display);
  1521. X}
  1522. X
  1523. Xbitmap_text(bm,x,y,colour,pf,str)
  1524. X
  1525. Xbitmap bm;
  1526. Xint x,y;
  1527. Xint colour;
  1528. Xfont pf;
  1529. Xchar *str;
  1530. X
  1531. X{
  1532. X                /* ??? */
  1533. X    }
  1534. X
  1535. SHAR_EOF
  1536. chmod 0644 xstuff.c || echo "restore of xstuff.c fails"
  1537. rm -f s2_seq_.tmp
  1538. echo "You have unpacked the last part"
  1539. exit 0
  1540.