home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / games / volume6 / conquer4 / patch4b < prev    next >
Internet Message Format  |  1989-08-08  |  55KB

  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: v08i002:  conquer4 - middle earth multi-player game (V4), Patch4b
  5. Message-ID: <4412@tekred.CNA.TEK.COM>
  6. Date: 7 Aug 89 13:51:03 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1826
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  12. Posting-number: Volume 8, Issue 2
  13. Archive-name: conquer4/Patch4b
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16.  
  17. #!/bin/sh
  18. # this is part 2 of a multipart archive
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file patchV4.04 continued
  21. #
  22. CurArch=2
  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.04
  33. X+                     mvprintw(ypos+10,xpos,"%ld",ntn[nationid].tciv);
  34. X+                     mvprintw(ypos+11,xpos,"%d",ntn[nationid].tsctrs);
  35. X+                 }
  36. X+ #else
  37. X                  mvprintw(ypos+7,xpos,"%ld",ntn[nationid].tgold);
  38. X                  mvprintw(ypos+8,xpos,"%ld",ntn[nationid].tmil);
  39. X                  mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tciv);
  40. X***************
  41. X*** 88,93 ****
  42. X--- 110,116 ----
  43. X                  if(isnpc(ntn[nationid].active))
  44. X                      mvprintw(ypos+11,xpos,"Yes");
  45. X                  else mvprintw(ypos+11,xpos,"No");
  46. X+ #endif /* NOSCORE */
  47. X                  count++;
  48. X                  if(count<MAXINSCR && count%MAXINROW==0) {
  49. X                      ypos+=RPT_LINES;
  50. X***************
  51. X*** 356,362 ****
  52. X      short armynum;
  53. X      char passwd[PASSLTH+1];
  54. X      short isgod=FALSE;
  55. X-     FILE *fp;
  56. X  #ifdef OGOD
  57. X      FILE *ftmp;
  58. X  #endif OGOD
  59. X--- 379,384 ----
  60. X***************
  61. X*** 366,378 ****
  62. X          isgod=TRUE;
  63. X          if (get_god()) return;
  64. X      }
  65. X!     fp=fopen("temp","w");
  66. X!     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  67. X      clear();
  68. X      standout();
  69. X      mvaddstr(0,(COLS/2)-10,"NATION STATS SUMMARY");
  70. X      mvprintw(3,0,"nation name is %s",curntn->name);
  71. X!     mvprintw(4,0,"allignment is %s",allignment[npctype(curntn->active)]);
  72. X      if (isgod==TRUE)
  73. X          mvprintw(5,0,"active is %d",curntn->active);
  74. X      mvprintw(6,0,"tax_rate...... %2d%%",curntn->tax_rate);
  75. X--- 388,402 ----
  76. X          isgod=TRUE;
  77. X          if (get_god()) return;
  78. X      }
  79. X!  
  80. X!     /* continuous loop */
  81. X!     while(1) {
  82. X      clear();
  83. X      standout();
  84. X      mvaddstr(0,(COLS/2)-10,"NATION STATS SUMMARY");
  85. X      mvprintw(3,0,"nation name is %s",curntn->name);
  86. X!     mvprintw(4,0,"alignment is %s",alignment[npctype(curntn->active)]);
  87. X! 
  88. X      if (isgod==TRUE)
  89. X          mvprintw(5,0,"active is %d",curntn->active);
  90. X      mvprintw(6,0,"tax_rate...... %2d%%",curntn->tax_rate);
  91. X***************
  92. X*** 393,433 ****
  93. X          addstr(" (NPC)");
  94. X      else    addstr(" (MON)");
  95. X      mvprintw(14,0,"nations mark is...%c ",curntn->mark);
  96. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  97. X      for(i=1;i<8;i++) if(curntn->race==*(races+i)[0]){
  98. X          mvprintw(15,0, "nation race is....%s  ",*(races+i));
  99. X          break;
  100. X      }
  101. X  
  102. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  103. X      mvprintw(3,COLS/2-12, "terror........ %3d",curntn->terror);
  104. X      mvprintw(4,COLS/2-12, "popularity.... %3d",curntn->popularity);
  105. X      mvprintw(5,COLS/2-12, "prestige...... %3d",curntn->prestige);
  106. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  107. X-     fflush( fp );
  108. X      mvprintw(6,COLS/2-12, "knowledge..... %3d",curntn->knowledge);
  109. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  110. X-     fflush( fp );
  111. X      temp = P_EATRATE;
  112. X      mvprintw(7,COLS/2-12, "eatrate.......%3.2f",temp);
  113. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  114. X-     fflush( fp );
  115. X      mvprintw(8,COLS/2-12, "wealth........ %3d",curntn->wealth);
  116. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  117. X-     fflush( fp );
  118. X      mvprintw(9,COLS/2-12,"charity....... %2d%%",curntn->charity);
  119. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  120. X-     fflush( fp );
  121. X      mvprintw(10,COLS/2-12,"communication.%3.2f",(float) P_NTNCOM);
  122. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  123. X      mvprintw(11,COLS/2-12,"reputation.... %3d",curntn->reputation);
  124. X      mvprintw(12,COLS/2-12,"spoilrate.....%3d%%",curntn->spoilrate);
  125. X      mvprintw(13,COLS/2-12,"farm ability.. %3d",curntn->farm_ability);
  126. X      mvprintw(14,COLS/2-12,"mine ability.. %3d",curntn->mine_ability);
  127. X      mvprintw(15,COLS/2-12,"poverty rate.. %2d%%",curntn->poverty);
  128. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  129. X      mvprintw(16,COLS/2-12,"power......... %3d",curntn->power);
  130. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  131. X  
  132. X      if (country!=0) {
  133. X          mvprintw(12,0,"leader is %s",curntn->leader);
  134. X--- 417,442 ----
  135. X***************
  136. X*** 442,448 ****
  137. X          mvprintw(4,COLS-30, "mercs defense bonus...+%2d%%",MERCDEF);
  138. X          mvprintw(12,COLS-30,"total mercs.......%8ld",MERCMEN);
  139. X      }
  140. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  141. X  
  142. X        mvprintw(5,COLS-30, "maximum move rate.......%2d",curntn->maxmove);
  143. X        mvprintw(6,COLS-30, "reproduction rate......%2d%%",curntn->repro);
  144. X--- 451,456 ----
  145. X***************
  146. X*** 450,456 ****
  147. X  
  148. X      mvprintw(9,COLS-30,"jewels ..........$%8ld",curntn->jewels);
  149. X      mvprintw(10,COLS-30,"metal & minerals..%8ld",curntn->metals);
  150. X-     fprintf(fp,"LINE %d FILE %s\n",__LINE__,__FILE__);
  151. X      if(curntn->tfood<2*curntn->tciv) standout();
  152. X      mvprintw(11,COLS-30,"food in granary...%8ld",curntn->tfood);
  153. X      standend();
  154. X--- 458,463 ----
  155. X***************
  156. X*** 479,535 ****
  157. X      switch(getch()){
  158. X      case '1': /*get name*/
  159. X          clear();
  160. X!         mvaddstr(0,0,"what name would you like:");
  161. X          clrtoeol();
  162. X          refresh();
  163. X          get_nname(string);
  164. X          if((strlen(string)<=1)||(strlen(string)>NAMELTH)){
  165. X!             errormsg("invalid name");
  166. X!             if(isgod==TRUE) reset_god();
  167. X!             return;
  168. X          }
  169. X          /*check if already used*/
  170. X          else for(i=1;i<(country-1);i++){
  171. X              if((strcmp(ntn[i].name,string)==0)&&(i!=country)) {
  172. X!                 errormsg("name already used");
  173. X!                 if(isgod==TRUE) reset_god();
  174. X!                 fclose(fp); return;
  175. X              }
  176. X          }
  177. X!         errormsg("new name can be used following next update");
  178. X          strcpy(curntn->name,string);
  179. X          ECHGNAME;
  180. X          break;
  181. X      case '2': /*change password */
  182. X          clear();
  183. X          if(isgod!=TRUE){
  184. X!             mvaddstr(0,0,"what is your current password:");
  185. X              refresh();
  186. X!             gets(command);
  187. X              strncpy(passwd,crypt(command,SALT),PASSLTH);
  188. X              if((strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)
  189. X!                 &&(strncmp(passwd,curntn->passwd,PASSLTH)!=0)){
  190. X!                 errormsg("invalid password");
  191. X!                 fclose(fp); return;
  192. X              }
  193. X          }
  194. X!         mvaddstr(2,0,"what is your new password:");
  195. X          refresh();
  196. X!         gets(command);
  197. X!         if((strlen(command)>PASSLTH)||(strlen(command)<2)) {
  198. X!             errormsg("invalid new password");
  199. X!             if(isgod==TRUE) reset_god();
  200. X!             fclose(fp); return;
  201. X          }
  202. X          strncpy(passwd,command,PASSLTH);
  203. X!         mvaddstr(4,0,"reenter your new password:");
  204. X          refresh();
  205. X!         gets(command);
  206. X          if(strncmp(passwd,command,PASSLTH)!=0) {
  207. X!             if(isgod==TRUE) reset_god();
  208. X!             fclose(fp); return;
  209. X          }
  210. X!         errormsg("new password can be used following next update");
  211. X          strncpy(curntn->passwd,crypt(command,SALT),PASSLTH);
  212. X          ECHGPAS;
  213. X          break;
  214. X--- 486,544 ----
  215. X      switch(getch()){
  216. X      case '1': /*get name*/
  217. X          clear();
  218. X!         mvaddstr(0,0,"What name would you like:");
  219. X          clrtoeol();
  220. X          refresh();
  221. X          get_nname(string);
  222. X          if((strlen(string)<=1)||(strlen(string)>NAMELTH)){
  223. X!             errormsg("Invalid name length");
  224. X!             break;
  225. X          }
  226. X          /*check if already used*/
  227. X          else for(i=1;i<(country-1);i++){
  228. X              if((strcmp(ntn[i].name,string)==0)&&(i!=country)) {
  229. X!                 errormsg("Name already used");
  230. X!                 break;
  231. X              }
  232. X          }
  233. X!         errormsg("New name can be used following next update");
  234. X          strcpy(curntn->name,string);
  235. X          ECHGNAME;
  236. X          break;
  237. X      case '2': /*change password */
  238. X          clear();
  239. X+         /* minimum password length setting */
  240. X+         if (country != 0) intval=2;
  241. X+         else intval=4;
  242. X          if(isgod!=TRUE){
  243. X!             mvaddstr(0,0,"What is your current password:");
  244. X              refresh();
  245. X!             (void) get_pass(command);
  246. X              strncpy(passwd,crypt(command,SALT),PASSLTH);
  247. X              if((strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)
  248. X!             &&(strncmp(passwd,curntn->passwd,PASSLTH)!=0)){
  249. X!                 break;
  250. X              }
  251. X          }
  252. X!         mvaddstr(2,0,"What is your new password:");
  253. X          refresh();
  254. X!         i = get_pass(command);
  255. X!         if (i<intval) {
  256. X!             errormsg("Password too short");
  257. X!             break;
  258. X!         } if (i>PASSLTH) {
  259. X!             errormsg("Password too long");
  260. X!             break;
  261. X          }
  262. X          strncpy(passwd,command,PASSLTH);
  263. X!         mvaddstr(4,0,"Reenter your new password:");
  264. X          refresh();
  265. X!         (void) get_pass(command);
  266. X          if(strncmp(passwd,command,PASSLTH)!=0) {
  267. X!             errormsg("Invalid password match; Password unchanged");
  268. X!             break;
  269. X          }
  270. X!         errormsg("New password can be used following next update");
  271. X          strncpy(curntn->passwd,crypt(command,SALT),PASSLTH);
  272. X          ECHGPAS;
  273. X          break;
  274. X***************
  275. X*** 640,653 ****
  276. X          }
  277. X          break;
  278. X      case '7':
  279. X!         if( startgold != curntn->tgold ) {
  280. X!             errormsg("Sorry: you have already made some moves this turn!");
  281. X!             break;
  282. X!         } else if(ispc(curntn->active)) {
  283. X              errormsg("Note: you get no mail while playing as an NPC!");
  284. X              curntn->active *= 4;
  285. X!         } else if(isnpc(curntn->active))
  286. X              curntn->active /= 4;
  287. X          NADJNTN;
  288. X          break;
  289. X      case '8':
  290. X--- 649,661 ----
  291. X          }
  292. X          break;
  293. X      case '7':
  294. X!         if(ispc(curntn->active)) {
  295. X              errormsg("Note: you get no mail while playing as an NPC!");
  296. X              curntn->active *= 4;
  297. X!         } else if(isnpc(curntn->active)) {
  298. X!             errormsg("Okay.... you have now come back to reality.");
  299. X              curntn->active /= 4;
  300. X+         }
  301. X          NADJNTN;
  302. X          break;
  303. X      case '8':
  304. X***************
  305. X*** 680,686 ****
  306. X                  beep();
  307. X                  errormsg("error opening country's file");
  308. X                  reset_god();
  309. X!                 fclose(fp); return;
  310. X              }
  311. X              /* adjust commodities */
  312. X              mvaddstr(LINES-2,0,"CHANGE: 1) Gold 2) Jewels 3) Iron 4) Food ?");
  313. X--- 688,694 ----
  314. X                  beep();
  315. X                  errormsg("error opening country's file");
  316. X                  reset_god();
  317. X!                 return;
  318. X              }
  319. X              /* adjust commodities */
  320. X              mvaddstr(LINES-2,0,"CHANGE: 1) Gold 2) Jewels 3) Iron 4) Food ?");
  321. X***************
  322. X*** 725,753 ****
  323. X          if(isgod==TRUE) {
  324. X              mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
  325. X              refresh();
  326. X!             getstr(string);
  327. X              strcpy(passwd,crypt(string,SALT));
  328. X              if(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0) break;
  329. X              mvaddstr(LINES-1,0,"PROMOTE WHAT USER TO DEMI-GOD? ");
  330. X              refresh();
  331. X              get_nname(string);
  332. X!             if (strlen(string)!=0) {
  333. X                  strncpy(ntn[0].leader,string,LEADERLTH);
  334. X              }
  335. X          }
  336. X          break;
  337. X      case 'p':
  338. X!     case 'P': produce(); fclose(fp); return;
  339. X      case 'b':
  340. X!     case 'B': budget(); fclose(fp); return;
  341. X      default:
  342. X          if(isgod==TRUE) reset_god();
  343. X-         fclose(fp);
  344. X          return;
  345. X      }
  346. X!     if(isgod==TRUE) reset_god();
  347. X!     fclose(fp);
  348. X!     change();
  349. X  }
  350. X  
  351. X  void
  352. X--- 733,764 ----
  353. X          if(isgod==TRUE) {
  354. X              mvaddstr(LINES-2,0,"ENTER CONQUER SUPER-USER PASSWORD:");
  355. X              refresh();
  356. X!             (void) get_pass(string);
  357. X              strcpy(passwd,crypt(string,SALT));
  358. X              if(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0) break;
  359. X              mvaddstr(LINES-1,0,"PROMOTE WHAT USER TO DEMI-GOD? ");
  360. X              refresh();
  361. X              get_nname(string);
  362. X!             if (strlen(string)!=0 && getpwnam(string)!=NULL) {
  363. X                  strncpy(ntn[0].leader,string,LEADERLTH);
  364. X              }
  365. X          }
  366. X          break;
  367. X      case 'p':
  368. X!     case 'P': 
  369. X!         produce();
  370. X!         if (isgod==TRUE) reset_god();
  371. X!         return;
  372. X      case 'b':
  373. X!     case 'B':
  374. X!         budget();
  375. X!         if(isgod==TRUE) reset_god();
  376. X!         return;
  377. X      default:
  378. X          if(isgod==TRUE) reset_god();
  379. X          return;
  380. X      }
  381. X!     } /* end of continuous loop */
  382. X  }
  383. X  
  384. X  void
  385. X*** omisc.c    Sun Aug  6 20:55:34 1989
  386. X--- misc.c    Sun Aug  6 20:55:43 1989
  387. X***************
  388. X*** 206,212 ****
  389. X              */
  390. X              /* BUG: should engage if army is hostile but does not own sector */
  391. X              /* BUG: take into account THE_VOID, HIDDEN, and NINJA */
  392. X-             /* BUG: NEUTRAL does not allow to pass */
  393. X              if( (own = sct[x][y].owner) > 0 &&
  394. X              ntn[own].dstatus[moving_country] >= WAR &&
  395. X              x != bx && y != by &&
  396. X--- 206,211 ----
  397. X***************
  398. X*** 214,219 ****
  399. X--- 213,226 ----
  400. X                  continue;    /* at war with the owner, may not pass */
  401. X              }
  402. X  
  403. X+             if( own > 0 &&
  404. X+             ntn[moving_country].dstatus[own] < WAR &&
  405. X+             ntn[own].dstatus[moving_country] > ALLIED &&
  406. X+             ntn[own].dstatus[moving_country] < WAR) {
  407. X+                 /* not at war with owner & owner is neutral,no passing*/
  408. X+                 continue;
  409. X+             }
  410. X+ 
  411. X              level++;
  412. X              if( land_2reachp( x, y, new_mp ) ) {
  413. X                  level--;
  414. X***************
  415. X*** 693,699 ****
  416. X  }
  417. X  
  418. X  /* set up occ[][] for country.
  419. X!    if leader==true, only for leader sectors plus ntn.communicatins range */
  420. X  void
  421. X  prep(country,leader)
  422. X  int country,leader;
  423. X--- 700,708 ----
  424. X  }
  425. X  
  426. X  /* set up occ[][] for country.
  427. X!  * if leader==true, only for leader sectors plus ntn.communicatins range
  428. X!  * if shipchk==true, include ships on the sector search
  429. X!  */
  430. X  void
  431. X  prep(country,leader)
  432. X  int country,leader;
  433. X***************
  434. X*** 722,728 ****
  435. X              if( leader ) {
  436. X                  if((P_ATYPE<MINLEADER)
  437. X                  ||(P_ATYPE>=MINMONSTER)
  438. X!                 ||(P_ASOLD==0)) continue;
  439. X                  i=P_AXLOC;
  440. X                  j=P_AYLOC;
  441. X                  com = P_NTNCOM; /* do communications radius */
  442. X--- 731,737 ----
  443. X              if( leader ) {
  444. X                  if((P_ATYPE<MINLEADER)
  445. X                  ||(P_ATYPE>=MINMONSTER)
  446. X!                 ||(P_ASOLD<=0)) continue;
  447. X                  i=P_AXLOC;
  448. X                  j=P_AYLOC;
  449. X                  com = P_NTNCOM; /* do communications radius */
  450. X***************
  451. X*** 967,981 ****
  452. X          NGSHP=0;
  453. X      }
  454. X      for(i=0;i<NTOTAL;i++) {
  455. X!         ntn[i].dstatus[country]=UNMET;
  456. X!         nptr->dstatus[i]=UNMET;
  457. X      }
  458. X- #ifdef MONSTER
  459. X-     for(i=NTOTAL-4;i<NTOTAL;i++) {
  460. X-             ntn[i].dstatus[country]=WAR;
  461. X-         nptr->dstatus[i]=WAR;
  462. X-     }
  463. X- #endif
  464. X      
  465. X      /*if take them you get their gold*/
  466. X      if(country!=sct[nptr->capx][nptr->capy].owner){
  467. X--- 976,989 ----
  468. X          NGSHP=0;
  469. X      }
  470. X      for(i=0;i<NTOTAL;i++) {
  471. X!         if (ntn[i].active < NPC_PEASANT ) {
  472. X!             ntn[i].dstatus[country]=UNMET;
  473. X!             nptr->dstatus[i]=UNMET;
  474. X!         } else {
  475. X!             ntn[i].dstatus[country]=WAR;
  476. X!             nptr->dstatus[i]=WAR;
  477. X!         }
  478. X      }
  479. X      
  480. X      /*if take them you get their gold*/
  481. X      if(country!=sct[nptr->capx][nptr->capy].owner){
  482. X*** oreports.c    Sun Aug  6 20:55:35 1989
  483. X--- reports.c    Sun Aug  6 20:55:43 1989
  484. X***************
  485. X*** 297,303 ****
  486. X  {
  487. X      short armynum,nvynum;
  488. X      long numship=0L,costsold=0L,numsold=0L;
  489. X!     long nummonst=0L,costmonst=0L,money;
  490. X      int isgod=FALSE;
  491. X  
  492. X      if(country==0) {
  493. X--- 297,303 ----
  494. X  {
  495. X      short armynum,nvynum;
  496. X      long numship=0L,costsold=0L,numsold=0L;
  497. X!     long nummonst=0L,costmonst=0L,money,chty;
  498. X      int isgod=FALSE;
  499. X  
  500. X      if(country==0) {
  501. X***************
  502. X*** 357,365 ****
  503. X      money=spread.gold - curntn->tgold - money;    /* net income */
  504. X      standend();
  505. X      mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
  506. X!     mvprintw(16,COLS-50,"CHARITY.......................%8ld",max((money*(long)curntn->charity)/100L,0L));
  507. X      standout();
  508. X!     mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money)*(100L-(long)curntn->charity)/100L);
  509. X  
  510. X      mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  511. X      mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
  512. X--- 357,366 ----
  513. X      money=spread.gold - curntn->tgold - money;    /* net income */
  514. X      standend();
  515. X      mvprintw(17,COLS-50,"NET INCOME....................%8ld",money);
  516. X!     chty = max((money*(long)curntn->charity)/100L,0L);
  517. X!     mvprintw(16,COLS-50,"CHARITY.......................%8ld",chty);
  518. X      standout();
  519. X!     mvprintw(18,COLS-50,"NEXT SEASON'S TREASURY........%8ld",(startgold + money-chty));
  520. X  
  521. X      mvaddstr(LINES-3,(COLS/2)-15,"HIT 'P' TO SEE PRODUCTION SCREEN");
  522. X      mvaddstr(LINES-2,(COLS/2)-15,"HIT 'C' FOR CHANGE NATION SCREEN");
  523. X***************
  524. X*** 694,699 ****
  525. X--- 695,701 ----
  526. X                      NADJMER;
  527. X                      NADJGAL;
  528. X                      NADJHLD;
  529. X+                     NADJLOC;
  530. X                      break;
  531. X                  } else if(P_NARMY!=MAXARM) {
  532. X                      errormsg("Army must be unloaded before Navy is divided");
  533. X***************
  534. X*** 738,743 ****
  535. X--- 740,746 ----
  536. X                  NADJMER;
  537. X                  NADJGAL;
  538. X                  NADJHLD;
  539. X+                 NADJLOC;
  540. X                  break;
  541. X              case '3':
  542. X                  /* DISBAND NAVY */
  543. X*** omove.c    Sun Aug  6 20:55:34 1989
  544. X--- move.c    Sun Aug  6 20:55:47 1989
  545. X***************
  546. X*** 506,511 ****
  547. X--- 506,512 ----
  548. X                      flee(XREAL,YREAL,0,FALSE);
  549. X                  }
  550. X                  mvprintw(LINES-2,0,"TAKING SECTOR");
  551. X+                 clrtoeol();
  552. X                  refresh();
  553. X                  sleep(2);
  554. X                  SOWN=country;
  555. X*** oupdate.c    Sun Aug  6 20:55:36 1989
  556. X--- update.c    Sun Aug  6 20:55:48 1989
  557. X***************
  558. X*** 308,313 ****
  559. X--- 308,314 ----
  560. X              &&( curntn->arm[x].stat!=SIEGED )
  561. X              &&( curntn->arm[x].stat!=ONBOARD )
  562. X              &&( curntn->arm[x].stat!=TRADED )
  563. X+             &&( curntn->arm[x].unittyp!=A_ZOMBIE )
  564. X              &&( P_AXLOC==curntn->arm[x].xloc )
  565. X              &&( P_AYLOC==curntn->arm[x].yloc )){
  566. X                  curntn->arm[x].stat=NUMSTATUS+armynum;
  567. X***************
  568. X*** 674,682 ****
  569. X          ntn[country].tships=0;
  570. X          ntn[country].tmil=0;
  571. X  #ifdef XENIX
  572. X!         z = ntn[country].spellpts;
  573. X!         z /= 2;
  574. X!         ntn[country].spellpts = z;
  575. X  #else
  576. X          if(rand()%4==0) ntn[country].spellpts/=2;
  577. X  #endif /*XENIX*/
  578. X--- 675,685 ----
  579. X          ntn[country].tships=0;
  580. X          ntn[country].tmil=0;
  581. X  #ifdef XENIX
  582. X!         if (rand()%4 == 0) {
  583. X!             z = ntn[country].spellpts;
  584. X!             z /= 2;
  585. X!             ntn[country].spellpts = z;
  586. X!         }
  587. X  #else
  588. X          if(rand()%4==0) ntn[country].spellpts/=2;
  589. X  #endif /*XENIX*/
  590. X***************
  591. X*** 790,796 ****
  592. X                  if(P_ASTAT==ONBOARD) continue;
  593. X                  /* may not capture water */
  594. X                  if(sct[P_AXLOC][P_AYLOC].altitude==WATER) {
  595. X!                     printf("Nation %s Army %d in Water\n",curntn->name,armynum);
  596. X                      continue;
  597. X                  }
  598. X                  if(occ[P_AXLOC][P_AYLOC] != country) continue;
  599. X--- 793,799 ----
  600. X                  if(P_ASTAT==ONBOARD) continue;
  601. X                  /* may not capture water */
  602. X                  if(sct[P_AXLOC][P_AYLOC].altitude==WATER) {
  603. X!                     fprintf(stderr,"Nation %s Army %d in Water\n",curntn->name,armynum);
  604. X                      continue;
  605. X                  }
  606. X                  if(occ[P_AXLOC][P_AYLOC] != country) continue;
  607. X***************
  608. X*** 799,822 ****
  609. X                      sptr->owner=country;
  610. X                      curntn->popularity++;
  611. X                  } else if((sptr->owner!=country)
  612. X!                 &&(curntn->dstatus[sptr->owner]>=WAR)
  613. X!                 &&(occ[P_AXLOC][P_AYLOC]==country)){
  614. X! 
  615. X!                     if((sptr->owner!=0)
  616. X!                     &&(ntn[sptr->owner].race!=curntn->race))
  617. X                          if(magic(country,SLAVER)==TRUE){
  618. X                              flee(P_AXLOC,P_AYLOC,1,TRUE);
  619. X!                         }else{
  620. X                              flee(P_AXLOC,P_AYLOC,1,FALSE);
  621. X                          }
  622. X  
  623. X!                 if((isntn( curntn->active ))
  624. X!                 &&(isntn( ntn[sptr->owner].active)))
  625. X  #ifdef HIDELOC
  626. X!                     fprintf(fnews,"3.\tarea captured by %s from %s\n",curntn->name,ntn[sptr->owner].name);
  627. X  #else
  628. X!                     fprintf(fnews,"3.\tarea %d,%d captured by %s from %s\n",P_AXLOC,P_AYLOC,curntn->name,ntn[sptr->owner].name);
  629. X  #endif HIDELOC
  630. X                      sptr->owner=country;
  631. X                      curntn->popularity++;
  632. X                  }
  633. X--- 802,823 ----
  634. X                      sptr->owner=country;
  635. X                      curntn->popularity++;
  636. X                  } else if((sptr->owner!=country)
  637. X!                 &&(curntn->dstatus[sptr->owner]>=WAR)) {
  638. X!                     if(ntn[sptr->owner].race!=curntn->race)
  639. X                          if(magic(country,SLAVER)==TRUE){
  640. X                              flee(P_AXLOC,P_AYLOC,1,TRUE);
  641. X!                         } else {
  642. X                              flee(P_AXLOC,P_AYLOC,1,FALSE);
  643. X                          }
  644. X  
  645. X!                     if((isntn( curntn->active ))
  646. X!                        &&(isntn( ntn[sptr->owner].active))) {
  647. X  #ifdef HIDELOC
  648. X!                         fprintf(fnews,"3.\tarea captured by %s from %s\n",curntn->name,ntn[sptr->owner].name);
  649. X  #else
  650. X!                         fprintf(fnews,"3.\tarea %d,%d captured by %s from %s\n",P_AXLOC,P_AYLOC,curntn->name,ntn[sptr->owner].name);
  651. X  #endif HIDELOC
  652. X+                     }
  653. X                      sptr->owner=country;
  654. X                      curntn->popularity++;
  655. X                  }
  656. X***************
  657. X*** 987,997 ****
  658. X              /* take out for charity */
  659. X              charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
  660. X  
  661. X!             if(charity > 0) curntn->tgold = spread.gold - charity;
  662. X!             else curntn->tgold = spread.gold;
  663. X              if(curntn->tciv > 0) charity /= curntn->tciv;
  664. X              else charity = 0;
  665. X  
  666. X              /* give them some benefit of the doubt */
  667. X              curntn->popularity += 5*charity;
  668. X              if(curntn->poverty < (charity+1)/2 )
  669. X--- 988,999 ----
  670. X              /* take out for charity */
  671. X              charity=((spread.gold-curntn->tgold)*curntn->charity)/100;
  672. X  
  673. X!             if(charity > 0) charity = 0;
  674. X              if(curntn->tciv > 0) charity /= curntn->tciv;
  675. X              else charity = 0;
  676. X  
  677. X+             curntn->tgold = spread.gold - charity;
  678. X+ 
  679. X              /* give them some benefit of the doubt */
  680. X              curntn->popularity += 5*charity;
  681. X              if(curntn->poverty < (charity+1)/2 )
  682. X***************
  683. X*** 1053,1059 ****
  684. X  
  685. X          dissarray=TRUE;
  686. X          for(armynum=0;armynum<MAXARM;armynum++)
  687. X!             if (P_ATYPE==(getleader(curntn->class)-1)) {
  688. X                  dissarray=FALSE;
  689. X                  break;
  690. X              }
  691. X--- 1055,1061 ----
  692. X  
  693. X          dissarray=TRUE;
  694. X          for(armynum=0;armynum<MAXARM;armynum++)
  695. X!             if (P_ATYPE==(getleader(curntn->class)-1) && P_ASOLD>0) {
  696. X                  dissarray=FALSE;
  697. X                  break;
  698. X              }
  699. X*** oio.c    Sun Aug  6 20:55:34 1989
  700. X--- io.c    Sun Aug  6 20:55:48 1989
  701. X***************
  702. X*** 34,46 ****
  703. X  void
  704. X  getspace()
  705. X  {
  706. X      sct = (struct s_sector **) m2alloc(MAPX,MAPY,sizeof(struct s_sector));
  707. X      occ = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  708. X      movecost = (short **) m2alloc(MAPX,MAPY,sizeof(short));
  709. X  }
  710. X  
  711. X! #ifdef ADMIN
  712. X  /************************************************************************/
  713. X  /*    PRINTELE() - print a sector.altitude map             */
  714. X  /************************************************************************/
  715. X  void
  716. X--- 34,108 ----
  717. X  void
  718. X  getspace()
  719. X  {
  720. X+     if (sct != NULL) free(sct);
  721. X      sct = (struct s_sector **) m2alloc(MAPX,MAPY,sizeof(struct s_sector));
  722. X+     if (occ != NULL) free(occ);
  723. X      occ = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  724. X+     if (movecost != NULL) free(movecost);
  725. X      movecost = (short **) m2alloc(MAPX,MAPY,sizeof(short));
  726. X  }
  727. X  
  728. X! #ifdef CONQUER
  729. X! char **mapseen;
  730. X! 
  731. X  /************************************************************************/
  732. X+ /*    MAPPREP() - initialize map with what can be seen by nation.    */
  733. X+ /************************************************************************/
  734. X+ void
  735. X+ mapprep()
  736. X+ {
  737. X+     int armynum, nvynum;
  738. X+     int x,y,i,j;
  739. X+ 
  740. X+     /* get space for map */
  741. X+     mapseen = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  742. X+ 
  743. X+     /* initialize the array */
  744. X+     if (country==0 || magic(country,KNOWALL)==TRUE) {
  745. X+         armynum = TRUE;
  746. X+     } else {
  747. X+         armynum = FALSE;
  748. X+     }
  749. X+     for (x=0;x<MAPX;x++) for(y=0;y<MAPY;y++) {
  750. X+         mapseen[x][y] = armynum;
  751. X+     }
  752. X+ 
  753. X+     /* done for all knowing */
  754. X+     if (country==0 || magic(country,KNOWALL)==TRUE) return;
  755. X+ 
  756. X+     /* add all visible sectors from owned land */
  757. X+     for(x = 0; x < MAPX; x++)
  758. X+     for(y = 0; y < MAPY; y++)
  759. X+     if(sct[x][y].owner==country){
  760. X+         for(i=x-LANDSEE;i<=x+LANDSEE;i++)
  761. X+         for(j=y-LANDSEE;j<=y+LANDSEE;j++)
  762. X+         if (ONMAP(i,j)) {
  763. X+             mapseen[i][j]=TRUE;
  764. X+         }
  765. X+     }
  766. X+ 
  767. X+     /* now add all visible sections from armies */
  768. X+     for(armynum=0;armynum<MAXARM;armynum++)
  769. X+     if(P_ASOLD>0) {
  770. X+         for(i=(int)P_AXLOC-ARMYSEE;i<=(int)P_AXLOC+ARMYSEE;i++)
  771. X+         for(j=(int)P_AYLOC-ARMYSEE;j<=(int)P_AYLOC+ARMYSEE;j++)
  772. X+         if (ONMAP(i,j)) {
  773. X+             mapseen[i][j]=TRUE;
  774. X+         }
  775. X+     }
  776. X+ 
  777. X+     /* now add sectors visible by navy */
  778. X+     for(nvynum=0;nvynum<MAXNAVY;nvynum++)
  779. X+     if((P_NMSHP!=0)||(P_NWSHP!=0)||(P_NGSHP!=0)) {
  780. X+         for(i=(int)P_NXLOC-NAVYSEE;i<=(int)P_NXLOC+NAVYSEE;i++)
  781. X+         for(j=(int)P_NYLOC-NAVYSEE;j<=(int)P_NYLOC+NAVYSEE;j++)
  782. X+         if (ONMAP(i,j)) {
  783. X+             mapseen[i][j]=TRUE;
  784. X+         }
  785. X+     }
  786. X+ }
  787. X+ 
  788. X+ /************************************************************************/
  789. X  /*    PRINTELE() - print a sector.altitude map             */
  790. X  /************************************************************************/
  791. X  void
  792. X***************
  793. X*** 48,60 ****
  794. X  {
  795. X      register int X, Y;
  796. X      fprintf(stderr,"doing print of altitude\n");
  797. X      for(Y=0;Y<MAPY;Y++) {
  798. X!         for(X=0;X<MAPX;X++) putc(sct[X][Y].altitude,stdout);
  799. X          putc('\n',stdout);
  800. X      }
  801. X  }
  802. X! #endif ADMIN
  803. X! #ifdef ADMIN
  804. X  /************************************************************************/
  805. X  /*    PR_NTNS() - print nation marks                    */
  806. X  /************************************************************************/
  807. X--- 110,131 ----
  808. X  {
  809. X      register int X, Y;
  810. X      fprintf(stderr,"doing print of altitude\n");
  811. X+     if (country == 0) {
  812. X+         printf("Conquer %s.%d: Altitude Map of the World on Turn %d\n",
  813. X+             VERSION, PATCHLEVEL, TURN);
  814. X+     } else {
  815. X+         printf("Conquer %s.%d: Altitude Map for Nation %s on Turn %d\n",
  816. X+             VERSION, PATCHLEVEL, curntn->name, TURN);
  817. X+     }
  818. X      for(Y=0;Y<MAPY;Y++) {
  819. X!         for(X=0;X<MAPX;X++) {
  820. X!             if(mapseen[X][Y]==TRUE) putc(sct[X][Y].altitude,stdout);
  821. X!             else putc(' ',stdout);
  822. X!         }
  823. X          putc('\n',stdout);
  824. X      }
  825. X  }
  826. X! 
  827. X  /************************************************************************/
  828. X  /*    PR_NTNS() - print nation marks                    */
  829. X  /************************************************************************/
  830. X***************
  831. X*** 63,79 ****
  832. X  {
  833. X      register int X, Y;
  834. X      fprintf(stderr,"doing print of nations\n");
  835. X      for(Y=0;Y<MAPY;Y++) {
  836. X          for(X=0;X<MAPX;X++) {
  837. X!             if(sct[X][Y].owner==0)
  838. X!                 putc(sct[X][Y].altitude,stdout);
  839. X!             else putc(ntn[sct[X][Y].owner].mark,stdout);
  840. X          }
  841. X          putc('\n',stdout);
  842. X      }
  843. X  }
  844. X! #endif ADMIN
  845. X! #ifdef ADMIN
  846. X  /************************************************************************/
  847. X  /*    PR_DESG() - print designations                    */
  848. X  /************************************************************************/
  849. X--- 134,158 ----
  850. X  {
  851. X      register int X, Y;
  852. X      fprintf(stderr,"doing print of nations\n");
  853. X+     if (country == 0) {
  854. X+         printf("Conquer %s.%d: Nation Map of the World on Turn %d\n",
  855. X+             VERSION, PATCHLEVEL, TURN);
  856. X+     } else {
  857. X+         printf("Conquer %s.%d: Nation Map for Nation %s on Turn %d\n",
  858. X+             VERSION, PATCHLEVEL, curntn->name, TURN);
  859. X+     }
  860. X      for(Y=0;Y<MAPY;Y++) {
  861. X          for(X=0;X<MAPX;X++) {
  862. X!             if(mapseen[X][Y]==TRUE) {
  863. X!                 if(sct[X][Y].owner==0)
  864. X!                     putc(sct[X][Y].altitude,stdout);
  865. X!                 else putc(ntn[sct[X][Y].owner].mark,stdout);
  866. X!             } else putc(' ',stdout);
  867. X          }
  868. X          putc('\n',stdout);
  869. X      }
  870. X  }
  871. X! 
  872. X  /************************************************************************/
  873. X  /*    PR_DESG() - print designations                    */
  874. X  /************************************************************************/
  875. X***************
  876. X*** 82,98 ****
  877. X  {
  878. X      register int X, Y;
  879. X      fprintf(stderr,"doing print of designations\n");
  880. X      for(Y=0;Y<MAPY;Y++) {
  881. X          for(X=0;X<MAPX;X++) {
  882. X!             putc(sct[X][Y].designation,stdout);
  883. X!             
  884. X          }
  885. X          putc('\n',stdout);
  886. X      }
  887. X  }
  888. X- #endif ADMIN
  889. X  
  890. X  /************************************************************************/
  891. X  /*    WRITEDATA() - write data to datafile                 */
  892. X  /*    trashes/creates datafile in the process                */
  893. X  /************************************************************************/
  894. X--- 161,215 ----
  895. X  {
  896. X      register int X, Y;
  897. X      fprintf(stderr,"doing print of designations\n");
  898. X+     if (country == 0) {
  899. X+         printf("Conquer %s.%d: Designation Map of the World on Turn %d\n",
  900. X+             VERSION, PATCHLEVEL, TURN);
  901. X+     } else {
  902. X+         printf("Conquer %s.%d: Designation Map for Nation %s on Turn %d\n",
  903. X+             VERSION, PATCHLEVEL, curntn->name, TURN);
  904. X+     }
  905. X      for(Y=0;Y<MAPY;Y++) {
  906. X          for(X=0;X<MAPX;X++) {
  907. X!             if (mapseen[X][Y]==TRUE) {
  908. X!                 if (country==0 || magic(sct[X][Y].owner,NINJA)==TRUE
  909. X!                     || magic(sct[X][Y].owner,THE_VOID)!=TRUE) {
  910. X!                     if(sct[X][Y].designation==DNODESIG)
  911. X!                         putc(sct[X][Y].altitude,stdout);
  912. X!                     else putc(sct[X][Y].designation,stdout);
  913. X!                 } else putc('?',stdout);
  914. X!             } else putc(' ',stdout);
  915. X          }
  916. X          putc('\n',stdout);
  917. X      }
  918. X  }
  919. X  
  920. X  /************************************************************************/
  921. X+ /*    PRINTVEG() -    print a vegetation map subroutine        */
  922. X+ /************************************************************************/
  923. X+ void
  924. X+ printveg()
  925. X+ {
  926. X+     register int X, Y;
  927. X+     fprintf(stderr,"doing print of vegetation\n");
  928. X+     if (country == 0) {
  929. X+         printf("Conquer %s.%d: Vegetation Map of the World on Turn %d\n",
  930. X+             VERSION, PATCHLEVEL, TURN);
  931. X+     } else {
  932. X+         printf("Conquer %s.%d: Vegetation Map for Nation %s on Turn %d\n",
  933. X+             VERSION, PATCHLEVEL, curntn->name, TURN);
  934. X+     }
  935. X+     for(Y=0;Y<MAPY;Y++) {
  936. X+         for(X=0;X<MAPX;X++) {
  937. X+             if(mapseen[X][Y]==TRUE) {
  938. X+                 putc(sct[X][Y].vegetation,stdout);
  939. X+             } else putc(' ',stdout);
  940. X+         }
  941. X+         putc('\n',stdout);
  942. X+     }
  943. X+ }
  944. X+ #endif CONQUER
  945. X+ 
  946. X+ /************************************************************************/
  947. X  /*    WRITEDATA() - write data to datafile                 */
  948. X  /*    trashes/creates datafile in the process                */
  949. X  /************************************************************************/
  950. X***************
  951. X*** 186,206 ****
  952. X      close(fd);
  953. X  } /* readdata() */
  954. X  
  955. X- #ifdef ADMIN
  956. X- /************************************************************************/
  957. X- /*    PRINTVEG() -    print a vegetation map subroutine        */
  958. X- /************************************************************************/
  959. X- void
  960. X- printveg()
  961. X- {
  962. X-     register int X, Y;
  963. X-     fprintf(stderr,"doing print of vegetation\n");
  964. X-     for(Y=0;Y<MAPY;Y++) {
  965. X-         for(X=0;X<MAPX;X++) putc(sct[X][Y].vegetation,stdout);
  966. X-         putc('\n',stdout);
  967. X-     }
  968. X- }
  969. X- #endif ADMIN
  970. X  #ifdef CONQUER
  971. X  /************************************************************************/
  972. X  /*    OFFMAP()    deal if cursor is off the map            */
  973. X--- 303,308 ----
  974. X***************
  975. X*** 276,283 ****
  976. X      }
  977. X      whatcansee();
  978. X  }
  979. X! #endif CONQUER
  980. X! #ifdef CONQUER
  981. X  /************************************************************************/
  982. X  /*    PRINTSCORE()    - like it says                    */
  983. X  /************************************************************************/
  984. X--- 378,384 ----
  985. X      }
  986. X      whatcansee();
  987. X  }
  988. X! 
  989. X  /************************************************************************/
  990. X  /*    PRINTSCORE()    - like it says                    */
  991. X  /************************************************************************/
  992. X***************
  993. X*** 314,333 ****
  994. X                      printf("%6s ",*(races+i));
  995. X          }
  996. X  
  997. X          if (isntn(ntn[nationid].active)) {
  998. X!             printf("%8s ",*(Class+ntn[nationid].class));
  999. X!             printf(" %7s ",allignment[npctype(ntn[nationid].active)]);
  1000. X              printf("%6ld  %8ld %8ld   %8ld %4d\n",
  1001. X                    ntn[nationid].score ,ntn[nationid].tgold
  1002. X                    ,ntn[nationid].tmil ,ntn[nationid].tciv
  1003. X                    ,ntn[nationid].tsctrs );
  1004. X          } else {
  1005. X-             if (ispeasant(ntn[nationid].active)) {
  1006. X-                 printf("%8s  %7s ","Peasant","Neutral");
  1007. X-                 /* info not kept track of yet */
  1008. X-             } else {
  1009. X-                 printf("%8s  %7s ","Monster","Other");
  1010. X-             }
  1011. X              printf("%6s  %8s %8s   %8s %4s\n",
  1012. X                    "---","-----","----","-----","--");
  1013. X          }
  1014. X--- 415,433 ----
  1015. X                      printf("%6s ",*(races+i));
  1016. X          }
  1017. X  
  1018. X+         printf("%8s ",*(Class+ntn[nationid].class));
  1019. X+         printf(" %7s ",alignment[npctype(ntn[nationid].active)]);
  1020. X          if (isntn(ntn[nationid].active)) {
  1021. X! #ifdef NOSCORE
  1022. X!             printf("%6ld  %8s %8s   %8s %4s\n",
  1023. X!                   ntn[nationid].score ,"-----","----" ,"-----","--");
  1024. X! #else
  1025. X              printf("%6ld  %8ld %8ld   %8ld %4d\n",
  1026. X                    ntn[nationid].score ,ntn[nationid].tgold
  1027. X                    ,ntn[nationid].tmil ,ntn[nationid].tciv
  1028. X                    ,ntn[nationid].tsctrs );
  1029. X+ #endif /* NOSCORE */
  1030. X          } else {
  1031. X              printf("%6s  %8s %8s   %8s %4s\n",
  1032. X                    "---","-----","----","-----","--");
  1033. X          }
  1034. X***************
  1035. X*** 485,488 ****
  1036. X--- 585,627 ----
  1037. X              baseaddr[j] = baseaddr[j-1] + entrysize;
  1038. X      }
  1039. X      return(baseaddr);
  1040. X+ }
  1041. X+ 
  1042. X+ /* If the string entered is too long, then a truncated */
  1043. X+ /* string is returned.  Length entered is returned.    */
  1044. X+ int
  1045. X+ get_pass(str)
  1046. X+     char *str;
  1047. X+ {
  1048. X+     char ch;
  1049. X+     int done=FALSE,count=0;
  1050. X+ 
  1051. X+     while(done==FALSE) {
  1052. X+         ch = getch();
  1053. X+         if (ch=='\b' || ch=='\177') {
  1054. X+             /* delete any entered characters */
  1055. X+             if (count > 0) {
  1056. X+                 count--;
  1057. X+             }
  1058. X+         } else if (ch=='\025') {
  1059. X+             /* make sure that ^U works */
  1060. X+             count=0;
  1061. X+         } else if (ch=='\n' || ch=='\r') {
  1062. X+             done = TRUE;
  1063. X+         } else if (ch != '\0') {
  1064. X+             /* add any other character to the string */
  1065. X+             if (count < PASSLTH) {
  1066. X+                 /* don't try adding too many */
  1067. X+                 str[count]= ch;
  1068. X+             }
  1069. X+             count++;
  1070. X+         }
  1071. X+     }
  1072. X+     /* truncate too long a password and end others properly */
  1073. X+     if (count > PASSLTH) {
  1074. X+         str[PASSLTH] = '\0';
  1075. X+     } else {
  1076. X+         str[count] = '\0';
  1077. X+     }
  1078. X+     return(count);
  1079. X  }
  1080. X*** onewhelp.c    Sun Aug  6 20:55:34 1989
  1081. X--- newhelp.c    Sun Aug  6 20:55:48 1989
  1082. X***************
  1083. X*** 198,204 ****
  1084. X--- 198,206 ----
  1085. X      fprintf(fp,"s/XTOMANYPEOPLE/%d/g\n",TOMANYPEOPLE);
  1086. X      fprintf(fp,"s/XABSMAXPEOPLE/%d/g\n",ABSMAXPEOPLE);
  1087. X      fprintf(fp,"s/XFINDPERCENT/%d/g\n",FINDPERCENT);
  1088. X+ #ifdef ORCTAKE
  1089. X      fprintf(fp,"s/XTAKEPRICE/%d/g\n",ORCTAKE);
  1090. X+ #endif ORCTAKE
  1091. X  
  1092. X      fprintf(fp,"s/XTGATTR/%d/g\n",TGATTR);
  1093. X      fprintf(fp,"s/XOTHRATTR/%d/g\n",OTHRATTR);
  1094. X*** odata.c    Sun Aug  6 20:55:34 1989
  1095. X--- data.c    Sun Aug  6 20:55:48 1989
  1096. X***************
  1097. X*** 51,59 ****
  1098. X  
  1099. X  char *directions[]= { "here", "north", "northeast", "east", "southeast",
  1100. X      "south", "southwest", "west", "northwest"};
  1101. X! char *Class[]= { "NPC", "king", "emperor", "wizard", "priest", "pirate",
  1102. X  "trader", "warlord", "demon", "dragon", "shadow"};
  1103. X! char *allignment[]= { "","Good","Neutral","Evil","Other" };
  1104. X  
  1105. X  char *unittype[]= {
  1106. X  "Militia", "Goblins", "Orcs", "Infantry", "Sailors", "Marines", "Archers",
  1107. X--- 51,59 ----
  1108. X  
  1109. X  char *directions[]= { "here", "north", "northeast", "east", "southeast",
  1110. X      "south", "southwest", "west", "northwest"};
  1111. X! char *Class[]= { "monster", "king", "emperor", "wizard", "priest", "pirate",
  1112. X  "trader", "warlord", "demon", "dragon", "shadow"};
  1113. X! char *alignment[]= { "Other","Good","Neutral","Evil","Other" };
  1114. X  
  1115. X  char *unittype[]= {
  1116. X  "Militia", "Goblins", "Orcs", "Infantry", "Sailors", "Marines", "Archers",
  1117. X*** onewlogin.c    Sun Aug  6 20:55:35 1989
  1118. X--- newlogin.c    Sun Aug  6 20:55:49 1989
  1119. X***************
  1120. X*** 253,260 ****
  1121. X      }
  1122. X  
  1123. X      /* now show the extras for the Raw Materials */
  1124. X!     printw(", %ld jewels", amount*NLJEWELS/Mvalues[CH_RAWGOODS]);
  1125. X!     printw(", and %ld metal.", amount*NLMETAL/Mvalues[CH_RAWGOODS]);
  1126. X  }
  1127. X  
  1128. X  /* show the current amount for country item */
  1129. X--- 253,262 ----
  1130. X      }
  1131. X  
  1132. X      /* now show the extras for the Raw Materials */
  1133. X!     printw(", %ld jewels", (long) (amount *
  1134. X!         ((float)NLJEWELS/Mvalues[CH_RAWGOODS])));
  1135. X!     printw(", and %ld metal.", (long) (amount *
  1136. X!         ((float)NLMETAL/Mvalues[CH_RAWGOODS])));
  1137. X  }
  1138. X  
  1139. X  /* show the current amount for country item */
  1140. X***************
  1141. X*** 277,297 ****
  1142. X      line++;
  1143. X  
  1144. X      /* now show the extras for the Raw Materials */
  1145. X!     if (NLJEWELS==NLMETAL) {
  1146. X!         sprintf(tempc,"%ld jewels & metal",
  1147. X!                spent[CH_RAWGOODS]*NLJEWELS);
  1148. X!         mvprintw(line,0,"%38s",tempc);
  1149. X!         mvprintw(line,COLS/2+10,"%ld jewels & metal",NLJEWELS);
  1150. X!     } else {
  1151. X!         sprintf(tempc,"%ld jewels",
  1152. X!                spent[CH_RAWGOODS]*NLJEWELS);
  1153. X!         mvprintw(line,0,"%38s",tempc);
  1154. X!         mvprintw(line++,COLS/2+10,"%ld jewels",NLJEWELS);
  1155. X!         sprintf(tempc,"%ld metal",
  1156. X!                spent[CH_RAWGOODS]*NLMETAL);
  1157. X!         mvprintw(line,0,"%38s",tempc);
  1158. X!         mvprintw(line,COLS/2+10,"%ld metals",NLMETAL);
  1159. X!     }
  1160. X  }
  1161. X  
  1162. X  /* convert the stored information into the nation statistics */
  1163. X--- 279,299 ----
  1164. X      line++;
  1165. X  
  1166. X      /* now show the extras for the Raw Materials */
  1167. X! #if NLJEWELS==NLMETAL
  1168. X!     sprintf(tempc,"%ld jewels & metal",
  1169. X!            spent[CH_RAWGOODS]*NLJEWELS);
  1170. X!     mvprintw(line,0,"%38s",tempc);
  1171. X!     mvprintw(line,COLS/2+10,"%ld jewels & metal",NLJEWELS);
  1172. X! #else
  1173. X!     sprintf(tempc,"%ld jewels",
  1174. X!            spent[CH_RAWGOODS]*NLJEWELS);
  1175. X!     mvprintw(line,0,"%38s",tempc);
  1176. X!     mvprintw(line++,COLS/2+10,"%ld jewels",NLJEWELS);
  1177. X!     nsprintf(tempc,"%ld metal",
  1178. X!             spent[CH_RAWGOODS]*NLMETAL);
  1179. X!     mvprintw(line,0,"%38s",tempc);
  1180. X!     mvprintw(line,COLS/2+10,"%ld metals",NLMETAL);
  1181. X! #endif
  1182. X  }
  1183. X  
  1184. X  /* convert the stored information into the nation statistics */
  1185. X***************
  1186. X*** 347,353 ****
  1187. X      int temp,ypos,xpos;
  1188. X      int more=TRUE;    /*0 if add another player*/
  1189. X      long x;
  1190. X!     char tempc[LINELTH],strin[LINELTH+1];
  1191. X      char passwd[PASSLTH+1];
  1192. X      register i;
  1193. X  
  1194. X--- 349,355 ----
  1195. X      int temp,ypos,xpos;
  1196. X      int more=TRUE;    /*0 if add another player*/
  1197. X      long x;
  1198. X!     char tempc[LINELTH];
  1199. X      char passwd[PASSLTH+1];
  1200. X      register i;
  1201. X  
  1202. X***************
  1203. X*** 432,449 ****
  1204. X              mvprintw(2,0,"Enter National Password: ");
  1205. X              clrtoeol();
  1206. X              refresh();
  1207. X!             gets(tempc);
  1208. X!             if((strlen(tempc)<2)||(strlen(tempc)>PASSLTH)) {
  1209. X!                 newerror("Invalid Password Length");
  1210. X                  continue;
  1211. X              }
  1212. X              mvprintw(2,0,"Reenter National Password: ");
  1213. X              clrtoeol();
  1214. X              refresh();
  1215. X!             gets(passwd);
  1216. X  
  1217. X!             if((strlen(tempc)<2)||(strlen(tempc)>PASSLTH)
  1218. X!                ||(strncmp(passwd,tempc,PASSLTH)!=0)){
  1219. X                  newerror("Invalid Password Match");
  1220. X              } else valid=TRUE;
  1221. X          }
  1222. X--- 434,453 ----
  1223. X              mvprintw(2,0,"Enter National Password: ");
  1224. X              clrtoeol();
  1225. X              refresh();
  1226. X!             i = get_pass(tempc);
  1227. X!             if (i < 2) {
  1228. X!                 newerror("Password Too Short");
  1229. X                  continue;
  1230. X+             } else if (i > PASSLTH) {
  1231. X+                 newerror("Password Too Long");
  1232. X+                 continue;
  1233. X              }
  1234. X              mvprintw(2,0,"Reenter National Password: ");
  1235. X              clrtoeol();
  1236. X              refresh();
  1237. X!             i = get_pass(passwd);
  1238. X  
  1239. X!             if((i<2)||(i>PASSLTH)||(strncmp(passwd,tempc,PASSLTH)!=0)){
  1240. X                  newerror("Invalid Password Match");
  1241. X              } else valid=TRUE;
  1242. X          }
  1243. X***************
  1244. X*** 595,601 ****
  1245. X                  break;
  1246. X              }
  1247. X          }
  1248. X!         mvprintw(2,COLS/2,"Alignment: %s", allignment[curntn->active]);
  1249. X          clrtoeol();
  1250. X  
  1251. X  
  1252. X--- 599,605 ----
  1253. X                  break;
  1254. X              }
  1255. X          }
  1256. X!         mvprintw(2,COLS/2,"Alignment: %s", alignment[curntn->active]);
  1257. X          clrtoeol();
  1258. X  
  1259. X  
  1260. X***************
  1261. X*** 1044,1050 ****
  1262. X                  }
  1263. X                  if(is_habitable(x,y)) placed=1;
  1264. X                  /*important that no countries near*/
  1265. X!                 for(i=x-2;i<=x+2;i++) for(j=y-2;j<=y+2;j++){
  1266. X                  if((isntn(ntn[sct[i][j].owner].active))
  1267. X                      &&(sct[i][j].owner!=0)) placed=0;
  1268. X                  }
  1269. X--- 1048,1054 ----
  1270. X                  }
  1271. X                  if(is_habitable(x,y)) placed=1;
  1272. X                  /*important that no countries near*/
  1273. X!                 for(i=x-4;i<=x+4;i++) for(j=y-4;j<=y+4;j++){
  1274. X                  if((isntn(ntn[sct[i][j].owner].active))
  1275. X                      &&(sct[i][j].owner!=0)) placed=0;
  1276. X                  }
  1277. X***************
  1278. X*** 1148,1153 ****
  1279. X--- 1152,1158 ----
  1280. X          else if (curntn->location==FAIR) t=1;
  1281. X          else if (curntn->location==GREAT) t=2;
  1282. X          else {
  1283. X+             if (ispc(curntn->active))
  1284. X              newerror("Error in finding placement");
  1285. X              t=0;
  1286. X          }
  1287. X***************
  1288. X*** 1168,1177 ****
  1289. X                  sct[i][j].people=people;
  1290. X                  sct[x][y].people-=people;
  1291. X              }
  1292. X      }
  1293. X      else {
  1294. X!         if(curntn->location==OOPS) newerror("MAJOR ERROR IN PLACEMENT");
  1295. X!         else if(curntn->location==RANDOM) {
  1296. X              newerror("Random Place Failed, trying to place again");
  1297. X              curntn->location=OOPS;
  1298. X              place(-1,-1);
  1299. X--- 1173,1193 ----
  1300. X                  sct[i][j].people=people;
  1301. X                  sct[x][y].people-=people;
  1302. X              }
  1303. X+         /* make sure status is set properly */
  1304. X+         for(i=0;i<NTOTAL;i++) {
  1305. X+             if (ntn[i].active < NPC_PEASANT) {
  1306. X+                 ntn[i].dstatus[country]=UNMET;
  1307. X+                 ntn[country].dstatus[i]=UNMET;
  1308. X+             } else {
  1309. X+                 ntn[i].dstatus[country]=WAR;
  1310. X+                 ntn[country].dstatus[i]=WAR;
  1311. X+             }
  1312. X+         }
  1313. X      }
  1314. X      else {
  1315. X!         if(curntn->location==OOPS) {
  1316. X!             newerror("MAJOR ERROR IN PLACEMENT");
  1317. X!         } else if(curntn->location==RANDOM) {
  1318. X              newerror("Random Place Failed, trying to place again");
  1319. X              curntn->location=OOPS;
  1320. X              place(-1,-1);
  1321. X***************
  1322. X*** 1292,1298 ****
  1323. X  
  1324. X      /* extra points for starting late */
  1325. X      points -= (float) (TURN-1) / LATESTART;
  1326. X!     if( (TURN-1)/LATESTART > 0.0 ) {
  1327. X          sprintf(temp,"%.1f points added for starting late",
  1328. X                 (float) (TURN-1) / LATESTART);
  1329. X          newerror(temp);
  1330. X--- 1308,1314 ----
  1331. X  
  1332. X      /* extra points for starting late */
  1333. X      points -= (float) (TURN-1) / LATESTART;
  1334. X!     if( (float)(TURN-1)/LATESTART > 0.0 ) {
  1335. X          sprintf(temp,"%.1f points added for starting late",
  1336. X                 (float) (TURN-1) / LATESTART);
  1337. X          newerror(temp);
  1338. X*** omain.c    Sun Aug  6 20:55:34 1989
  1339. X--- main.c    Sun Aug  6 20:55:49 1989
  1340. X***************
  1341. X*** 39,44 ****
  1342. X--- 39,46 ----
  1343. X  int    done=FALSE;    /* if TRUE: you are done    */
  1344. X  short    hilmode=HI_OWN;    /* hilight mode */
  1345. X  short    dismode=DI_DESI;/* display mode            */
  1346. X+ short    otherdismode= -(DI_MOVE);
  1347. X+ short    otherhilmode= HI_OWN;
  1348. X  short    selector=0;    /* selector (y vbl) for which army/navy... is "picked"*/
  1349. X  short    pager=0;    /* pager for selector 0,1,2,3*/
  1350. X  short    country=0;    /* nation id of owner*/
  1351. X***************
  1352. X*** 59,65 ****
  1353. X      int geteuid(), getuid(), setuid();
  1354. X      register int i,j;
  1355. X      char name[NAMELTH+1],filename[FILELTH];
  1356. X!     void srand(),init_hasseen();
  1357. X      int getopt();
  1358. X      char passwd[PASSLTH+1];
  1359. X      long time();
  1360. X--- 61,67 ----
  1361. X      int geteuid(), getuid(), setuid();
  1362. X      register int i,j;
  1363. X      char name[NAMELTH+1],filename[FILELTH];
  1364. X!     void srand(),init_hasseen(),mapprep();
  1365. X      int getopt();
  1366. X      char passwd[PASSLTH+1];
  1367. X      long time();
  1368. X***************
  1369. X*** 67,81 ****
  1370. X  #ifdef SYSMAIL
  1371. X      extern char sysmail[];
  1372. X  #endif SYSMAIL
  1373. X!     int sflag=FALSE,l;
  1374. X  
  1375. X      char defaultdir[BIGLTH],tmppass[PASSLTH+1];
  1376. X      char cq_opts[BIGLTH];
  1377. X!     struct passwd *getpwnam();
  1378. X  
  1379. X      owneruid=getuid();
  1380. X      srand((unsigned) time((long *) 0));
  1381. X      strcpy(name,"");
  1382. X      strcpy(cq_opts,"");
  1383. X  
  1384. X      /* check conquer options */
  1385. X--- 69,84 ----
  1386. X  #ifdef SYSMAIL
  1387. X      extern char sysmail[];
  1388. X  #endif SYSMAIL
  1389. X!     int sflag=FALSE,pflag=FALSE,l;
  1390. X  
  1391. X      char defaultdir[BIGLTH],tmppass[PASSLTH+1];
  1392. X      char cq_opts[BIGLTH];
  1393. X!     struct passwd *getpwnam(), *pwent;
  1394. X  
  1395. X      owneruid=getuid();
  1396. X      srand((unsigned) time((long *) 0));
  1397. X      strcpy(name,"");
  1398. X+     strcpy(defaultdir,"");
  1399. X      strcpy(cq_opts,"");
  1400. X  
  1401. X      /* check conquer options */
  1402. X***************
  1403. X*** 168,174 ****
  1404. X      }
  1405. X  
  1406. X      /* process the command line arguments */
  1407. X!     while((i=getopt(argc,argv,"hGn:d:s"))!=EOF) switch(i){
  1408. X      /* process the command line arguments */
  1409. X      case 'h': /* execute help program*/
  1410. X          initscr();
  1411. X--- 171,177 ----
  1412. X      }
  1413. X  
  1414. X      /* process the command line arguments */
  1415. X!     while((i=getopt(argc,argv,"Ghpn:d:s"))!=EOF) switch(i){
  1416. X      /* process the command line arguments */
  1417. X      case 'h': /* execute help program*/
  1418. X          initscr();
  1419. X***************
  1420. X*** 181,186 ****
  1421. X--- 184,192 ----
  1422. X          endwin();
  1423. X          putchar('\n');
  1424. X          exit(SUCCESS);
  1425. X+     case 'p': /* print the map*/
  1426. X+         pflag++;
  1427. X+         break;
  1428. X      case 'G':
  1429. X          Gaudy = TRUE;
  1430. X          break;
  1431. X***************
  1432. X*** 198,209 ****
  1433. X          sflag++;
  1434. X          break;
  1435. X      case '?': /*  print out command line arguments */
  1436. X!         printf("Command line format: %s [-Ghs -d DIR -nNAT]\n",argv[0]);
  1437. X!         printf("\t-G       gaudily highlight nation in news\n");
  1438. X!         printf("\t-n NAT   play as nation NAT\n");
  1439. X!         printf("\t-h       print help text\n");
  1440. X!         printf("\t-d DIR   to use play different game\n");
  1441. X!         printf("\t-s       print scores\n");
  1442. X          exit(SUCCESS);
  1443. X      };
  1444. X  
  1445. X--- 204,216 ----
  1446. X          sflag++;
  1447. X          break;
  1448. X      case '?': /*  print out command line arguments */
  1449. X!         fprintf(stderr,"Command line format: %s [-Ghps -d DIR -nNAT]\n",argv[0]);
  1450. X!         fprintf(stderr,"\t-n NAT   play as nation NAT\n");
  1451. X!         fprintf(stderr,"\t-d DIR   to use play different game\n");
  1452. X!         fprintf(stderr,"\t-G       gaudily highlight nation in news\n");
  1453. X!         fprintf(stderr,"\t-h       print help text\n");
  1454. X!         fprintf(stderr,"\t-p       print a map\n");
  1455. X!         fprintf(stderr,"\t-s       print scores\n");
  1456. X          exit(SUCCESS);
  1457. X      };
  1458. X  
  1459. X***************
  1460. X*** 211,217 ****
  1461. X       * dir where the files are kept and do some work.
  1462. X       */
  1463. X      if (chdir(defaultdir)) {
  1464. X!         printf("unable to change dir to %s\n",defaultdir);
  1465. X          exit(FAIL);
  1466. X      }
  1467. X  
  1468. X--- 218,224 ----
  1469. X       * dir where the files are kept and do some work.
  1470. X       */
  1471. X      if (chdir(defaultdir)) {
  1472. X!         fprintf(stderr,"unable to change dir to %s\n",defaultdir);
  1473. X          exit(FAIL);
  1474. X      }
  1475. X  
  1476. X***************
  1477. X*** 218,223 ****
  1478. X--- 225,231 ----
  1479. X      readdata();                /* read data*/
  1480. X      verifydata( __FILE__, __LINE__ );    /* verify data */
  1481. X  
  1482. X+     /* now print the scores */
  1483. X      if(sflag){
  1484. X          printscore();
  1485. X          exit(SUCCESS);
  1486. X***************
  1487. X*** 233,247 ****
  1488. X          (void) setuid (geteuid ()) ;
  1489. X      }
  1490. X  
  1491. X!     /* at this stage must be a normal interactive game */
  1492. X  
  1493. X-     printf("conquer %s.%d: Copyright (c) 1988 by Edward M Barlow\n",VERSION,PATCHLEVEL);
  1494. X- 
  1495. X      /* check for update in progress */
  1496. X      sprintf(filename,"%sup",isonfile);
  1497. X      if(check_lock(filename,FALSE)==TRUE) {
  1498. X!         printf("Conquer is updating\n");
  1499. X!         printf("Please try again later.\n");
  1500. X          exit(FAIL);
  1501. X      }
  1502. X  
  1503. X--- 241,253 ----
  1504. X          (void) setuid (geteuid ()) ;
  1505. X      }
  1506. X  
  1507. X!     fprintf(stderr,"conquer %s.%d: Copyright (c) 1988 by Edward M Barlow\n",VERSION,PATCHLEVEL);
  1508. X  
  1509. X      /* check for update in progress */
  1510. X      sprintf(filename,"%sup",isonfile);
  1511. X      if(check_lock(filename,FALSE)==TRUE) {
  1512. X!         fprintf(stderr,"Conquer is updating\n");
  1513. X!         fprintf(stderr,"Please try again later.\n");
  1514. X          exit(FAIL);
  1515. X      }
  1516. X  
  1517. X***************
  1518. X*** 250,268 ****
  1519. X      *     if you fail give name of administrator of game
  1520. X      */
  1521. X      if (name[0] == '\0') {
  1522. X!         printf("what nation would you like to be: ");
  1523. X          gets(name);
  1524. X      }
  1525. X  #ifdef OGOD
  1526. X      if(strcmp(name,"god")==0 || strcmp(name,"unowned")==0) {
  1527. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1528. X!             (owneruid != (getpwnam(ntn[0].leader))->pw_uid )) {
  1529. X!             printf("Sorry -- you can not login as god\n");
  1530. X!             printf("you need to be logged in as %s",LOGIN);
  1531. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1532. X!                 printf(" or %s",ntn[0].leader);
  1533. X              }
  1534. X!             printf("\n");
  1535. X              exit(FAIL);
  1536. X          }
  1537. X          strcpy(name,"unowned");
  1538. X--- 256,277 ----
  1539. X      *     if you fail give name of administrator of game
  1540. X      */
  1541. X      if (name[0] == '\0') {
  1542. X!         if (pflag != FALSE)
  1543. X!             fprintf(stderr,"Display map for what nation: ");
  1544. X!         else fprintf(stderr,"What nation would you like to be: ");
  1545. X          gets(name);
  1546. X      }
  1547. X  #ifdef OGOD
  1548. X      if(strcmp(name,"god")==0 || strcmp(name,"unowned")==0) {
  1549. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1550. X!           ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  1551. X!           owneruid != pwent->pw_uid )) {
  1552. X!             fprintf(stderr,"Sorry -- you can not login as god\n");
  1553. X!             fprintf(stderr,"you need to be logged in as %s",LOGIN);
  1554. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1555. X!                 fprintf(stderr," or %s",ntn[0].leader);
  1556. X              }
  1557. X!             fprintf(stderr,"\n");
  1558. X              exit(FAIL);
  1559. X          }
  1560. X          strcpy(name,"unowned");
  1561. X***************
  1562. X*** 276,295 ****
  1563. X          if(strcmp(name,ntn[i].name)==0) country=i;
  1564. X  
  1565. X      if(country==(-1)) {
  1566. X!         printf("Sorry, name <%s> not found\n",name);
  1567. X!         printf("\nFor rules type <conquer -h>");
  1568. X!         printf("\nFor information on conquer please contact %s.",OWNER);
  1569. X!         printf("\nTo enter this campaign please send mail to %s", LOGIN);
  1570. X          if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1571. X!             printf(" or %s",ntn[0].leader);
  1572. X          }
  1573. X!         printf(".\n");
  1574. X          return;
  1575. X!     } else if(country==0) {
  1576. X          sprintf(filename,"%sadd",isonfile);
  1577. X          if(check_lock(filename,FALSE)==TRUE) {
  1578. X!             printf("A new player is being added.\n");
  1579. X!             printf("Continue anyway? [y or n]");
  1580. X              while(((i=getchar())!='y')&&(i!='n')) ;
  1581. X              if(i!='y') exit(FAIL);
  1582. X          }
  1583. X--- 285,304 ----
  1584. X          if(strcmp(name,ntn[i].name)==0) country=i;
  1585. X  
  1586. X      if(country==(-1)) {
  1587. X!         fprintf(stderr,"Sorry, name <%s> not found\n",name);
  1588. X!         fprintf(stderr,"\nFor rules type <conquer -h>");
  1589. X!         fprintf(stderr,"\nFor information on conquer please contact %s.",OWNER);
  1590. X!         fprintf(stderr,"\nTo enter this campaign please send mail to %s", LOGIN);
  1591. X          if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1592. X!             fprintf(stderr," or %s",ntn[0].leader);
  1593. X          }
  1594. X!         fprintf(stderr,".\n");
  1595. X          return;
  1596. X!     } else if(country==0 && !pflag) {
  1597. X          sprintf(filename,"%sadd",isonfile);
  1598. X          if(check_lock(filename,FALSE)==TRUE) {
  1599. X!             fprintf(stderr,"A new player is being added.\n");
  1600. X!             fprintf(stderr,"Continue anyway? [y or n]");
  1601. X              while(((i=getchar())!='y')&&(i!='n')) ;
  1602. X              if(i!='y') exit(FAIL);
  1603. X          }
  1604. X***************
  1605. X*** 297,324 ****
  1606. X      curntn = &ntn[country];
  1607. X  
  1608. X      /*get encrypted password*/
  1609. X!     strncpy(tmppass,getpass("\nwhat is your nation's password:"),PASSLTH);
  1610. X      strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1611. X      if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1612. X      &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1613. X!         strncpy(tmppass,getpass("\nerror: reenter your nation's password:"),PASSLTH);
  1614. X          strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1615. X          if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1616. X          &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1617. X!             printf("\nSorry:");
  1618. X!             printf("\nFor rules type <conquer -h>");
  1619. X!             printf("\nFor information on conquer please contact %s.",
  1620. X                  OWNER);
  1621. X!             printf("\nTo enter this campaign please send mail to %s",
  1622. X                  LOGIN);
  1623. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1624. X!                 printf(" or %s",ntn[0].leader);
  1625. X              }
  1626. X!             printf(".\n");
  1627. X              exit(FAIL);
  1628. X          }
  1629. X      }
  1630. X  
  1631. X      initscr();        /* SET UP THE SCREEN */
  1632. X      /* check terminal size */
  1633. X      if (COLS<80 || LINES<24) {
  1634. X--- 306,371 ----
  1635. X      curntn = &ntn[country];
  1636. X  
  1637. X      /*get encrypted password*/
  1638. X!     fprintf(stderr,"\nWhat is your Nation's Password: ");
  1639. X!     strncpy(tmppass,getpass(""),PASSLTH);
  1640. X      strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1641. X      if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1642. X      &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1643. X!         fprintf(stderr,"\nError: Reenter your Nation's Password: ");
  1644. X!         strncpy(tmppass,getpass(""),PASSLTH);
  1645. X          strncpy(passwd,crypt(tmppass,SALT),PASSLTH);
  1646. X          if((strncmp(passwd,curntn->passwd,PASSLTH)!=0)
  1647. X          &&(strncmp(passwd,ntn[0].passwd,PASSLTH)!=0)) {
  1648. X!             fprintf(stderr,"\nSorry:");
  1649. X!             fprintf(stderr,"\nFor rules type <conquer -h>");
  1650. X!             fprintf(stderr,"\nFor information on conquer please contact %s.",
  1651. X                  OWNER);
  1652. X!             fprintf(stderr,"\nTo enter this campaign please send mail to %s",
  1653. X                  LOGIN);
  1654. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  1655. X!                 fprintf(stderr," or %s",ntn[0].leader);
  1656. X              }
  1657. X!             fprintf(stderr,".\n");
  1658. X              exit(FAIL);
  1659. X          }
  1660. X      }
  1661. X  
  1662. X+     /* now print the maps */
  1663. X+     if (pflag) {    /* print a map of the game */
  1664. X+         fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
  1665. X+         fprintf(stderr,"while the maps will be sent to stdout.\n\n");
  1666. X+         fprintf(stderr,"\tThe valid options are,\n");
  1667. X+         fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
  1668. X+         fprintf(stderr,"\t\t3) nations\n");
  1669. X+         fprintf(stderr,"\t\t4) designations\n\n");
  1670. X+         fprintf(stderr,"\tWhat type of map? ");
  1671. X+         scanf("%hd", &dismode);
  1672. X+         fprintf(stderr,"\n");
  1673. X+         switch(dismode) {
  1674. X+         case 1:
  1675. X+             mapprep();
  1676. X+             printele();
  1677. X+             break;
  1678. X+         case 2:
  1679. X+             mapprep();
  1680. X+             printveg();
  1681. X+             break;
  1682. X+         case 3:
  1683. X+             mapprep();
  1684. X+             pr_ntns();
  1685. X+             break;
  1686. X+         case 4:
  1687. X+             mapprep();
  1688. X+             pr_desg();
  1689. X+             break;
  1690. X+         default:
  1691. X+             fprintf(stderr,"Invalid Choice\n");
  1692. X+              exit(FAIL);
  1693. X+             break;
  1694. X+         }
  1695. X+         exit(SUCCESS);
  1696. X+     }
  1697. X+ 
  1698. X      initscr();        /* SET UP THE SCREEN */
  1699. X      /* check terminal size */
  1700. X      if (COLS<80 || LINES<24) {
  1701. X***************
  1702. X*** 410,416 ****
  1703. X      signal(SIGTERM,hangup);        /* likewise for cheats!! */
  1704. X  
  1705. X      noecho();
  1706. X!     prep(country,FALSE);        /* initialize prep array */
  1707. X      whatcansee();            /* what can they see */
  1708. X  
  1709. X      /* initialize mail files */
  1710. X--- 457,463 ----
  1711. X      signal(SIGTERM,hangup);        /* likewise for cheats!! */
  1712. X  
  1713. X      noecho();
  1714. X!     prep(country,FALSE);    /* initialize prep array */
  1715. X      whatcansee();            /* what can they see */
  1716. X  
  1717. X      /* initialize mail files */
  1718. X***************
  1719. X*** 492,497 ****
  1720. X--- 539,548 ----
  1721. X  {
  1722. X      char    name[LINELTH+1];
  1723. X      char    passwd[PASSLTH+1];
  1724. X+     struct passwd *getpwnam(), *pwent;
  1725. X+ #ifdef DEBUG
  1726. X+     void sect_info();
  1727. X+ #endif /* DEBUG */
  1728. X      int    ocountry;
  1729. X  
  1730. X      switch(getch()) {
  1731. X***************
  1732. X*** 499,508 ****
  1733. X          ext_cmd( -1 );
  1734. X          curntn->tgold -= MOVECOST;
  1735. X          break;
  1736. X!     case ' ':    /*redraw the screen*/
  1737. X          whatcansee();    /* what can they see */
  1738. X          redraw=TRUE;
  1739. X          break;
  1740. X      case 'a':    /*army report*/
  1741. X          redraw=TRUE;
  1742. X          armyrpt(0);
  1743. X--- 550,567 ----
  1744. X          ext_cmd( -1 );
  1745. X          curntn->tgold -= MOVECOST;
  1746. X          break;
  1747. X!     case ' ':    /* redraw the screen */
  1748. X          whatcansee();    /* what can they see */
  1749. X          redraw=TRUE;
  1750. X          break;
  1751. X+ #ifdef DEBUG
  1752. X+     case '\t':    /* debugging information for god and demi-god */
  1753. X+         if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1754. X+             ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid ))
  1755. X+             break;
  1756. X+         sect_info();
  1757. X+         break;
  1758. X+ #endif /* DEBUG */
  1759. X      case 'a':    /*army report*/
  1760. X          redraw=TRUE;
  1761. X          armyrpt(0);
  1762. X***************
  1763. X*** 607,613 ****
  1764. X          mymove();
  1765. X          curntn->tgold -= MOVECOST;
  1766. X          makebottom();
  1767. X!         prep(country,FALSE);
  1768. X          pager=0;
  1769. X          selector=0;
  1770. X          break;
  1771. X--- 666,675 ----
  1772. X          mymove();
  1773. X          curntn->tgold -= MOVECOST;
  1774. X          makebottom();
  1775. X!         prep(country,FALSE,TRUE);
  1776. X!         if (hilmode == HI_ARMY || hilmode == HI_YARM) {
  1777. X!             redraw = TRUE;
  1778. X!         }
  1779. X          pager=0;
  1780. X          selector=0;
  1781. X          break;
  1782. X***************
  1783. X*** 743,749 ****
  1784. X      case 'z':    /*login as new user */
  1785. X  #ifdef OGOD
  1786. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1787. X!             (owneruid != (getpwnam(ntn[0].leader))->pw_uid )) break;
  1788. X  #endif
  1789. X          clear();
  1790. X          redraw=TRUE;
  1791. X--- 805,811 ----
  1792. X      case 'z':    /*login as new user */
  1793. X  #ifdef OGOD
  1794. X          if ((owneruid != (getpwnam(LOGIN))->pw_uid ) &&
  1795. X!             ((pwent=getpwnam(ntn[0].leader))==NULL || owneruid != pwent->pw_uid )) break;
  1796. X  #endif
  1797. X          clear();
  1798. X          redraw=TRUE;
  1799. X***************
  1800. X*** 795,801 ****
  1801. X          }
  1802. X  
  1803. X          /* remove old lock file -- new one already made */
  1804. X!         sprintf(fison,"%s%s",isonfile,ocountry);
  1805. X          unlink(fison);
  1806. X  
  1807. X          fclose(fexe);
  1808. X--- 857,863 ----
  1809. X          }
  1810. X  
  1811. X          /* remove old lock file -- new one already made */
  1812. X!         sprintf(fison,"%s%d",isonfile,ocountry);
  1813. X          unlink(fison);
  1814. X  
  1815. X          fclose(fexe);
  1816. X***************
  1817. X*** 803,815 ****
  1818. X           sprintf(name,"%s%d",exefile,country);
  1819. X           if ((fexe=fopen(name,"a"))==NULL) {
  1820. X              beep();
  1821. X!             printf("error opening %s\n",name);
  1822. X              unlink(fison);
  1823. X              exit(FAIL);
  1824. X           }
  1825. X          curntn = &ntn[country];
  1826. X  
  1827. X!         printf("\n");
  1828. X          readdata();
  1829. X          execute(FALSE);
  1830. X  
  1831. X--- 865,877 ----
  1832. X           sprintf(name,"%s%d",exefile,country);
  1833. SHAR_EOF
  1834. echo "End of part 2, continue with part 3"
  1835. echo "3" > s2_seq_.tmp
  1836. exit 0
  1837.