home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume10 / gb3 / patch2b < prev    next >
Encoding:
Internet Message Format  |  1990-08-28  |  59.3 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i040:  gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2b
  5. Message-ID: <6227@tekred.CNA.TEK.COM>
  6. Date: 28 Aug 90 19:34:58 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 2081
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 11, Issue 40
  13. Archive-name: gb3/Patch2b
  14. Patch-To: gb3: Volume 10, Issue 1-14
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 2 (of 9)."
  25. # Contents:  patches02b server/patchlevel.h
  26. # Wrapped by billr@saab on Tue Aug 28 08:54:53 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patches02b' -a "${1}" != "-c" ; then 
  29.   echo shar: Renaming existing file \"'patches02b'\" to \"'patches02b.orig'\"
  30.   mv -f 'patches02b' 'patches02b.orig'
  31. fi
  32. echo shar: Extracting \"'patches02b'\" \(56321 characters\)
  33. sed "s/^X//" >'patches02b' <<'END_OF_FILE'
  34. X*** /usr/cna/billr/games/gb3/server/dosector.c    Wed May 30 15:13:03 1990
  35. X--- server/dosector.c    Thu Aug 23 16:54:49 1990
  36. X***************
  37. X*** 31,41 ****
  38. X  reg struct plinfo *pinf;
  39. X  reg int new;
  40. X  
  41. X- if(s->resource < 0)
  42. X-   s->resource = -s->resource;
  43. X- 
  44. X       check(planet,20);
  45. X!      factor = .4 * log10(1.0+(double)s->eff) * s->resource
  46. X           * races[s->owner-1]->metabolism;
  47. X       pinf = &planet->info[s->owner-1];
  48. X  
  49. X--- 31,38 ----
  50. X  reg struct plinfo *pinf;
  51. X  reg int new;
  52. X  
  53. X       check(planet,20);
  54. X!      factor = .4 * log10(1.0+(double)s->eff) * s->resource * (1+(planet->type==TYPE_EARTH))
  55. X           * races[s->owner-1]->metabolism;
  56. X       pinf = &planet->info[s->owner-1];
  57. X  
  58. X***************
  59. X*** 51,56 ****
  60. X--- 48,61 ----
  61. X         pdes = round_rand( factor * DEST_PRODUCTION
  62. X              * s->mobilization );
  63. X       prod_destruct[s->owner-1] += pdes;
  64. X+ 
  65. X+ 
  66. X+ /* try to find crystals */
  67. X+ /* chance of digging out a crystal depends on efficiency */
  68. X+     if(s->crystals && int_rand(1,100) < s->eff) {    
  69. X+             prod_crystals[s->owner-1]++;
  70. X+             s->crystals--;
  71. X+                     }
  72. X  
  73. X          /* increase mobilization to planetary quota */
  74. X       if (s->mobilization < pinf->mob_set) {
  75. X*** /usr/cna/billr/games/gb3/server/enrol.c    Wed May 30 15:13:07 1990
  76. X--- server/enrol.c    Fri Aug 24 15:10:01 1990
  77. X***************
  78. X*** 19,24 ****
  79. X--- 19,25 ----
  80. X  #include "buffers.h"
  81. X  extern int errno;
  82. X  char desshow();
  83. X+ racetype *Race;
  84. X  
  85. X  struct stype {
  86. X      char here;
  87. X***************
  88. X*** 29,44 ****
  89. X  
  90. X  /* racial types (10 racial types ) */
  91. X  int Thing[RACIAL_TYPES] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0};
  92. X! float db_Mass[RACIAL_TYPES] = {1.0, 1.5, 2.0, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
  93. X  float db_Birthrate[RACIAL_TYPES] = {0.8, 0.8, 0.9, 0.4, 0.4, 0.4, 0.4, 0.5, 0.5, 0.5};
  94. X  int db_Fighters[RACIAL_TYPES] = {6, 7, 8, 2, 3, 3, 4, 4, 5, 5};
  95. X  int db_Intelligence[RACIAL_TYPES] = {80, 70, 60, 190, 180, 170, 160, 150, 140, 130};
  96. X! float db_Adventurism[RACIAL_TYPES] = {0.89, 0.89, 0.89, .5, .5, .5, .6, .6, .7, .8};
  97. X  int Min_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 2, 2, 2, 2, 2};
  98. X  int Max_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 4, 4, 4, 4, 4};
  99. X  float db_Metabolism[RACIAL_TYPES] = {1.3, 1.3, 1.3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
  100. X  
  101. X! #define RMass(x) (db_Mass[(x)] + .01*(float)int_rand(-25, 25))
  102. X  #define Birthrate(x) (db_Birthrate[(x)] + .01*(float)int_rand(-10, 10))
  103. X  #define Fighters(x) (db_Fighters[(x)] + int_rand(-1, 1))
  104. X  #define Intelligence(x) (db_Intelligence[(x)] + int_rand(-10, 10))
  105. X--- 30,45 ----
  106. X  
  107. X  /* racial types (10 racial types ) */
  108. X  int Thing[RACIAL_TYPES] = {1, 1, 1, 0, 0, 0, 0, 0, 0, 0};
  109. X! float db_Mass[RACIAL_TYPES] = {.1,.15,.2,.125,.125,.125,.125,.125,.125,.125};
  110. X  float db_Birthrate[RACIAL_TYPES] = {0.8, 0.8, 0.9, 0.4, 0.4, 0.4, 0.4, 0.5, 0.5, 0.5};
  111. X  int db_Fighters[RACIAL_TYPES] = {6, 7, 8, 2, 3, 3, 4, 4, 5, 5};
  112. X  int db_Intelligence[RACIAL_TYPES] = {80, 70, 60, 190, 180, 170, 160, 150, 140, 130};
  113. X! float db_Adventurism[RACIAL_TYPES] = {0.89, 0.89, 0.89, .6, .65, .7, .7, .75, .75, .8};
  114. X  int Min_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 2, 2, 2, 2, 2};
  115. X  int Max_Sexes[RACIAL_TYPES] = {1, 1, 1, 2, 2, 4, 4, 4, 4, 4};
  116. X  float db_Metabolism[RACIAL_TYPES] = {1.3, 1.3, 1.3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
  117. X  
  118. X! #define RMass(x) (db_Mass[(x)] + .001*(float)int_rand(-25, 25))
  119. X  #define Birthrate(x) (db_Birthrate[(x)] + .01*(float)int_rand(-10, 10))
  120. X  #define Fighters(x) (db_Fighters[(x)] + int_rand(-1, 1))
  121. X  #define Intelligence(x) (db_Intelligence[(x)] + int_rand(-10, 10))
  122. X***************
  123. X*** 90,107 ****
  124. X          Two[i]=2*Two[i-1];
  125. X  
  126. X   if ( (Playernum=Numraces()+1) >= MAXPLAYERS) {
  127. X!     printf("There are already %d players; No more allowed.\n",MAXPLAYERS);
  128. X      exit(-1);
  129. X   }
  130. X  
  131. X  /*printf("Enter racial type to be created (1-%d):", RACIAL_TYPES);
  132. X  scanf("%d", &idx);
  133. X  getchr();
  134. X  idx -= 1;
  135. X  */
  136. X! idx = int_rand(3,10);
  137. X  
  138. X! if(idx < 0 || idx > RACIAL_TYPES-1) {
  139. X      printf("Bad racial index.\n");
  140. X      exit(1);
  141. X      }
  142. X--- 91,109 ----
  143. X          Two[i]=2*Two[i-1];
  144. X  
  145. X   if ( (Playernum=Numraces()+1) >= MAXPLAYERS) {
  146. X!     printf("There are already %d players; No more allowed.\n",MAXPLAYERS-1);
  147. X      exit(-1);
  148. X   }
  149. X  
  150. X+ 
  151. X  /*printf("Enter racial type to be created (1-%d):", RACIAL_TYPES);
  152. X  scanf("%d", &idx);
  153. X  getchr();
  154. X  idx -= 1;
  155. X  */
  156. X! idx = int_rand(3,9);
  157. X  
  158. X! if(idx < 0 || idx >= RACIAL_TYPES) {
  159. X      printf("Bad racial index.\n");
  160. X      exit(1);
  161. X      }
  162. X***************
  163. X*** 134,140 ****
  164. X  
  165. X   bzero((char *)not_found, sizeof(not_found));
  166. X   do {
  167. X- /*
  168. X      printf("\nLive on what type planet:(e)arth, (g)asgiant, (a)irless, (i)ce, (w)ater? ");
  169. X          c=getchr();
  170. X      getchr();
  171. X--- 136,141 ----
  172. X***************
  173. X*** 154,162 ****
  174. X           exit(-1);
  175. X           break;
  176. X      }
  177. X- */
  178. X  
  179. X!     switch(int_rand(1,4)) {
  180. X          case 1 : ppref = TYPE_EARTH; break;
  181. X          case 2 : ppref = TYPE_AIRLESS; break;
  182. X          case 3 : ppref = TYPE_ICEBALL; break;
  183. X--- 155,162 ----
  184. X           exit(-1);
  185. X           break;
  186. X      }
  187. X  
  188. X! /*    switch(int_rand(1,4)) {
  189. X          case 1 : ppref = TYPE_EARTH; break;
  190. X          case 2 : ppref = TYPE_AIRLESS; break;
  191. X          case 3 : ppref = TYPE_ICEBALL; break;
  192. X***************
  193. X*** 165,171 ****
  194. X           exit(-1);
  195. X           break;
  196. X          }
  197. X! 
  198. X      printf("Looking for type %d planet...\n", ppref);
  199. X  
  200. X      /* find first planet of right type */
  201. X--- 165,172 ----
  202. X           exit(-1);
  203. X           break;
  204. X          }
  205. X! */
  206. X!     
  207. X      printf("Looking for type %d planet...\n", ppref);
  208. X  
  209. X      /* find first planet of right type */
  210. X***************
  211. X*** 175,185 ****
  212. X    for (star=0; star<Sdata.numstars && !found && count < 100; ) {
  213. X  
  214. X      check = 1;
  215. X!       /* skip over uninhabited stars */
  216. X      if (Stars[star]->inhabited)
  217. X              check = 0;
  218. X  
  219. X!       /* look for unihabited planets */
  220. X       if (check) {
  221. X        pnum = 0;
  222. X        while (!found && pnum<Stars[star]->numplanets) {
  223. X--- 176,186 ----
  224. X    for (star=0; star<Sdata.numstars && !found && count < 100; ) {
  225. X  
  226. X      check = 1;
  227. X!       /* skip over inhabited stars */
  228. X      if (Stars[star]->inhabited)
  229. X              check = 0;
  230. X  
  231. X!       /* look for uninhabited planets */
  232. X       if (check) {
  233. X        pnum = 0;
  234. X        while (!found && pnum<Stars[star]->numplanets) {
  235. X***************
  236. X*** 238,248 ****
  237. X      c=getchr();
  238. X      getchr();
  239. X  
  240. X-  if (c=='y') 
  241. X-     Race->God=1;
  242. X- else 
  243. X-     Race->God=0;
  244. X  
  245. X  
  246. X   printf("\n\nEnter a name for your race:");
  247. X   dots(RNAMESIZE);
  248. X--- 239,246 ----
  249. X      c=getchr();
  250. X      getchr();
  251. X  
  252. X  
  253. X+     Race->God = (c=='y');
  254. X  
  255. X   printf("\n\nEnter a name for your race:");
  256. X   dots(RNAMESIZE);
  257. X***************
  258. X*** 254,259 ****
  259. X--- 252,258 ----
  260. X   Race->homelevel = Race->deflevel = LEVEL_PLAN;
  261. X   Race->homesystem = Race->defsystem = star;
  262. X   Race->homeplanetnum = Race->defplanetnum = pnum;
  263. X+  Race->highlight = Playernum;
  264. X  
  265. X      /* make conditions preferred by your people set to (more or less) 
  266. X         those of the planet : higher the concentration of gas, the higher
  267. X***************
  268. X*** 274,279 ****
  269. X--- 273,279 ----
  270. X  /* assign racial characteristics */
  271. X  
  272. X      Race->tech = 0;
  273. X+ do {
  274. X      Race->overbirthrate = float_rand() * 0.01;
  275. X          /* your race is like "the Thing" */
  276. X          Race->Thing = Thing[idx];
  277. X***************
  278. X*** 294,299 ****
  279. X--- 294,304 ----
  280. X      printf("            Mass: %.2f\n",Race->mass);
  281. X      printf(" Number of sexes: %d (min req'd for colonization)\n",Race->number_sexes);
  282. X  
  283. X+     printf("\n\nLook OK(y/n)\?");
  284. X+     if(gets(str)==NULL)
  285. X+         exit(1);
  286. X+     } while (str[0] != 'y');
  287. X+ 
  288. X   bzero((char *)secttypes, sizeof(secttypes));
  289. X  
  290. X   opensectdata(&enroll_sectdata);
  291. X***************
  292. X*** 369,375 ****
  293. X      s.build_type = OTYPE_GOV;
  294. X      s.armor = Shipdata[OTYPE_GOV][ABIL_ARMOR];
  295. X      s.guns = Shipdata[OTYPE_GOV][ABIL_GUNS];
  296. X-     s.size = Shipdata[OTYPE_GOV][ABIL_TARGET];
  297. X      s.max_crew = Shipdata[OTYPE_GOV][ABIL_MAXCREW];
  298. X      s.max_destruct = Shipdata[OTYPE_GOV][ABIL_DESTCAP];
  299. X      s.max_resource = Shipdata[OTYPE_GOV][ABIL_CARGO];
  300. X--- 374,379 ----
  301. X***************
  302. X*** 376,381 ****
  303. X--- 380,388 ----
  304. X      s.max_fuel = Shipdata[OTYPE_GOV][ABIL_FUELCAP];
  305. X      s.max_speed = Shipdata[OTYPE_GOV][ABIL_SPEED];
  306. X      s.build_cost = Shipdata[OTYPE_GOV][ABIL_COST];
  307. X+     s.size = 0.1*s.guns + .1*s.max_crew + .03*s.max_resource + .03*s.max_fuel 
  308. X+         + .03*s.max_destruct;
  309. X+ ;
  310. X      s.base_mass = MAX(1.0, (float)s.armor + (float)s.size/10.0 + (float)s.guns/10.0);
  311. X      sprintf(s.class, "Standard");
  312. X  
  313. X***************
  314. X*** 401,407 ****
  315. X      s.rad = 0;
  316. X      s.damage = 0;    /*Shipdata[s.type][ABIL_DAMAGE];*/
  317. X          /* (first capitol is 100% efficient */
  318. X! 
  319. X      s.object.number = 0;
  320. X      s.object.number2 = 0;
  321. X      s.object.number3 = 0;
  322. X--- 408,415 ----
  323. X      s.rad = 0;
  324. X      s.damage = 0;    /*Shipdata[s.type][ABIL_DAMAGE];*/
  325. X          /* (first capitol is 100% efficient */
  326. X!     s.retaliate = 0;
  327. X!     
  328. X      s.object.number = 0;
  329. X      s.object.number2 = 0;
  330. X      s.object.number3 = 0;
  331. X***************
  332. X*** 410,416 ****
  333. X      s.on = 1;
  334. X  
  335. X      s.name[0] = '\0';
  336. X! 
  337. X      putship(enroll_shdata, &s, shipno);
  338. X      close_file(enroll_shdata);
  339. X  
  340. X--- 418,425 ----
  341. X      s.on = 1;
  342. X  
  343. X      s.name[0] = '\0';
  344. X!     s.mission[0] = '\0';
  345. X!     
  346. X      putship(enroll_shdata, &s, shipno);
  347. X      close_file(enroll_shdata);
  348. X  
  349. X***************
  350. X*** 487,492 ****
  351. X--- 496,508 ----
  352. X  
  353. X  void notify(who, msg)
  354. X  int who;
  355. X+ char *msg;
  356. X+ {
  357. X+ /* this is a dummy routine */
  358. X+ }
  359. X+ 
  360. X+ void push_message(what, who, msg)
  361. X+ int what, who;
  362. X  char *msg;
  363. X  {
  364. X  /* this is a dummy routine */
  365. X*** /usr/cna/billr/games/gb3/server/enslave.c    Wed May 30 15:13:08 1990
  366. X--- server/enslave.c    Thu Aug 23 16:54:54 1990
  367. X***************
  368. X*** 25,30 ****
  369. X--- 25,31 ----
  370. X  planettype *p;
  371. X  int sh,shipno,i,mask,aliens=0,def=0,attack=0;
  372. X  double Dist;
  373. X+ racetype *Race;
  374. X  
  375. X  enslave_shdata = enslave_pdata = NEUTRAL_FD;
  376. X  
  377. X***************
  378. X*** 39,48 ****
  379. X--- 40,51 ----
  380. X  
  381. X    if (s->owner!=Playernum) {
  382. X      DontOwnErr(Playernum,shipno);
  383. X+     free(s);
  384. X      return; 
  385. X   }
  386. X  
  387. X    if (testship(Playernum,s, shipno)) {
  388. X+     free(s);
  389. X      return;
  390. X      }
  391. X  
  392. X***************
  393. X*** 49,77 ****
  394. X    if (s->type != STYPE_ASS) {
  395. X      sprintf(buf,"This ship is not an %s.\n", Shipnames[STYPE_ASS]);
  396. X          notify(Playernum, buf);
  397. X      return;
  398. X    }
  399. X    if (s->whatorbits!=LEVEL_PLAN) {
  400. X      sprintf(buf,"%s #%d doesn't orbit a planet.\n", Shipnames[s->type],shipno);
  401. X          notify(Playernum, buf);
  402. X      return;
  403. X    }
  404. X  
  405. X    if (!enufAP(Playernum,Stars[s->storbits]->AP[Playernum-1], APcount)) { 
  406. X!     return;
  407. X      }
  408. X  
  409. X! free(Race);
  410. X! openracedata(&enslave_racedata);
  411. X! getrace(enslave_racedata, &Race, Playernum); 
  412. X! close_file(enslave_racedata);
  413. X  
  414. X-  openpdata(&enslave_pdata);
  415. X-   getplanet(enslave_pdata,&p,Stars[s->storbits]->planetpos[s->pnumorbits]);
  416. X- close_file(enslave_pdata);
  417. X    if (p->info[Playernum-1].numsectsowned==0) {
  418. X      sprintf(buf,"You don't have a garrison on the planet.\n");
  419. X          notify(Playernum, buf);
  420. X      return;
  421. X    }
  422. X  
  423. X--- 52,82 ----
  424. X    if (s->type != STYPE_ASS) {
  425. X      sprintf(buf,"This ship is not an %s.\n", Shipnames[STYPE_ASS]);
  426. X          notify(Playernum, buf);
  427. X+     free(s);
  428. X      return;
  429. X    }
  430. X+ 
  431. X    if (s->whatorbits!=LEVEL_PLAN) {
  432. X      sprintf(buf,"%s #%d doesn't orbit a planet.\n", Shipnames[s->type],shipno);
  433. X          notify(Playernum, buf);
  434. X+     free(s);
  435. X      return;
  436. X    }
  437. X  
  438. X    if (!enufAP(Playernum,Stars[s->storbits]->AP[Playernum-1], APcount)) { 
  439. X!       free(s);
  440. X!       return;
  441. X      }
  442. X  
  443. X!      openpdata(&enslave_pdata);
  444. X!       getplanet(enslave_pdata,&p,Stars[s->storbits]->planetpos[s->pnumorbits]);
  445. X!     close_file(enslave_pdata);
  446. X  
  447. X    if (p->info[Playernum-1].numsectsowned==0) {
  448. X      sprintf(buf,"You don't have a garrison on the planet.\n");
  449. X          notify(Playernum, buf);
  450. X+     free(s);
  451. X+     free(p);
  452. X      return;
  453. X    }
  454. X  
  455. X***************
  456. X*** 86,94 ****
  457. X--- 91,105 ----
  458. X    if (!aliens) {
  459. X      sprintf(buf,"There is no one else on this planet to enslave!\n");
  460. X          notify(Playernum, buf);
  461. X+     free(s);
  462. X+     free(p);
  463. X      return;
  464. X    }
  465. X  
  466. X+ openracedata(&enslave_racedata);
  467. X+ getrace(enslave_racedata, &Race, Playernum); 
  468. X+ close_file(enslave_racedata);
  469. X+ 
  470. X    sh = p->ships;
  471. X    openshdata(&enslave_shdata);
  472. X    while (sh) {
  473. X***************
  474. X*** 164,171 ****
  475. X      if (p->info[i-1].numsectsowned && i!=Playernum)
  476. X          notify(i, telegram_buf);
  477. X  
  478. X!   free(p);
  479. X! 
  480. X  }
  481. X  
  482. X  
  483. X--- 175,183 ----
  484. X      if (p->info[i-1].numsectsowned && i!=Playernum)
  485. X          notify(i, telegram_buf);
  486. X  
  487. X! free(p);
  488. X! free(s);
  489. X! free(Race);
  490. X  }
  491. X  
  492. X  
  493. X*** /usr/cna/billr/games/gb3/server/examine.c    Wed May 30 15:13:09 1990
  494. X--- server/examine.c    Thu Aug 23 16:54:55 1990
  495. X***************
  496. X*** 41,51 ****
  497. X--- 41,53 ----
  498. X      if (ship->whatorbits==LEVEL_UNIV || isclr(Stars[ship->storbits]->inhabited, Playernum)) {
  499. X      sprintf(buf,"That ship it not visible to you.\n");
  500. X          notify(Playernum, buf);
  501. X+     free(ship);
  502. X      return;
  503. X      }
  504. X  
  505. X      if ((fd=fopen(EXAM_FL, "r"))==NULL) {
  506. X      perror(EXAM_FL);
  507. X+     free(ship);
  508. X      return;
  509. X      }
  510. X  
  511. X*** /usr/cna/billr/games/gb3/server/explore.c    Wed May 30 15:13:10 1990
  512. X--- server/explore.c    Thu Aug 23 16:54:56 1990
  513. X***************
  514. X*** 25,34 ****
  515. X  int inhab = 0;
  516. X  int stardata,pdata;
  517. X  char str[200];
  518. X  
  519. X   Num_races = Numraces();
  520. X  
  521. X- free(Race);
  522. X  openracedata(&explore_racedata);
  523. X  getrace(explore_racedata, &Race, Playernum);
  524. X  close_file(explore_racedata);
  525. X--- 25,34 ----
  526. X  int inhab = 0;
  527. X  int stardata,pdata;
  528. X  char str[200];
  529. X+ racetype *Race;
  530. X  
  531. X   Num_races = Numraces();
  532. X  
  533. X  openracedata(&explore_racedata);
  534. X  getrace(explore_racedata, &Race, Playernum);
  535. X  close_file(explore_racedata);
  536. X***************
  537. X*** 38,47 ****
  538. X   openpdata(&pdata);
  539. X   sprintf(buf,"             ========== Colonization Report ==========\n\n");
  540. X      notify(Playernum, buf); 
  541. X! sprintf(buf,"       Planet        res  des fuel tox sects tech  mob       Type       Aliens\n");
  542. X      notify(Playernum, buf);
  543. X   for (star=0; star<Sdata.numstars; star++) {
  544. X!     getstar(stardata, &(Stars[star]), star);
  545. X      if (isset(Stars[star]->explored,Playernum)) {
  546. X          for (i=0; i<Stars[star]->numplanets; i++) {
  547. X             getplanet(pdata,&pl,Stars[star]->planetpos[i]);
  548. X--- 38,48 ----
  549. X   openpdata(&pdata);
  550. X   sprintf(buf,"             ========== Colonization Report ==========\n\n");
  551. X      notify(Playernum, buf); 
  552. X! sprintf(buf,"       Planet    xtl res  des fuel tox sects tech  mob       Type       Aliens\n");
  553. X      notify(Playernum, buf);
  554. X   for (star=0; star<Sdata.numstars; star++) {
  555. X!     free(Stars[star]);
  556. X!         getstar(stardata, &(Stars[star]), star);
  557. X      if (isset(Stars[star]->explored,Playernum)) {
  558. X          for (i=0; i<Stars[star]->numplanets; i++) {
  559. X             getplanet(pdata,&pl,Stars[star]->planetpos[i]);
  560. X***************
  561. X*** 54,61 ****
  562. X              Stars[star]->pnames[i],
  563. X              (pl->info[Playernum-1].autorep ? "*" : ""));
  564. X  
  565. X!         sprintf(buf,"%19s%5d%5d%5d %3d%% %4d %3d  %2d(%2d)",
  566. X!                str,pl->info[Playernum-1].resource,
  567. X                 pl->info[Playernum-1].destruct,
  568. X                 pl->info[Playernum-1].fuel,pl->conditions[TOXIC],
  569. X                 pl->info[Playernum-1].numsectsowned,
  570. X--- 55,64 ----
  571. X              Stars[star]->pnames[i],
  572. X              (pl->info[Playernum-1].autorep ? "*" : ""));
  573. X  
  574. X!         sprintf(buf,"%16.16s %2d%5d%5d%5d %3d%% %4d %3d  %2d(%2d)",
  575. X!                str,
  576. X!                pl->info[Playernum-1].crystals,
  577. X!                pl->info[Playernum-1].resource,
  578. X                 pl->info[Playernum-1].destruct,
  579. X                 pl->info[Playernum-1].fuel,pl->conditions[TOXIC],
  580. X                 pl->info[Playernum-1].numsectsowned,
  581. X***************
  582. X*** 92,97 ****
  583. X--- 95,101 ----
  584. X   }
  585. X   close_file(stardata);
  586. X   close_file(pdata);
  587. X+ free(Race);
  588. X  }
  589. X  
  590. X  
  591. X***************
  592. X*** 105,114 ****
  593. X  placetype where;
  594. X  int inhab = 0;
  595. X  int stardata,pdata;
  596. X  
  597. X   Num_races = Numraces();
  598. X  
  599. X!     starq = 0;
  600. X  
  601. X  if(argn==2) {
  602. X      where = Getplace(Playernum,args[1],0);
  603. X--- 109,119 ----
  604. X  placetype where;
  605. X  int inhab = 0;
  606. X  int stardata,pdata;
  607. X+ racetype *Race;
  608. X  
  609. X   Num_races = Numraces();
  610. X  
  611. X!     starq = -1;
  612. X  
  613. X  if(argn==2) {
  614. X      where = Getplace(Playernum,args[1],0);
  615. X***************
  616. X*** 120,126 ****
  617. X      starq = where.snum;
  618. X      }
  619. X  
  620. X- free(Race);
  621. X  openracedata(&explore_racedata);
  622. X  getrace(explore_racedata, &Race, Playernum);
  623. X  close_file(explore_racedata);
  624. X--- 125,130 ----
  625. X***************
  626. X*** 135,141 ****
  627. X  sprintf(buf," Star  (stability)[AP]   #  Planet [Attributes] Type (Compatibility)\n");
  628. X              notify(Playernum, buf);
  629. X   for (star=0; star<Sdata.numstars; star++)
  630. X!      if((starq ==0) || (starq  && starq == star)) {
  631. X      getstar(stardata, &(Stars[star]), star);
  632. X      if (isset(Stars[star]->explored,Playernum)) {
  633. X          for (i=0; i<Stars[star]->numplanets; i++) {
  634. X--- 139,146 ----
  635. X  sprintf(buf," Star  (stability)[AP]   #  Planet [Attributes] Type (Compatibility)\n");
  636. X              notify(Playernum, buf);
  637. X   for (star=0; star<Sdata.numstars; star++)
  638. X!      if((starq == -1) || (starq == star)) {
  639. X!         free(Stars[star]);
  640. X      getstar(stardata, &(Stars[star]), star);
  641. X      if (isset(Stars[star]->explored,Playernum)) {
  642. X          for (i=0; i<Stars[star]->numplanets; i++) {
  643. X***************
  644. X*** 142,163 ****
  645. X             getplanet(pdata,&pl,Stars[star]->planetpos[i]);
  646. X             if (i == 0)
  647. X                  if (Race->tech >= TECH_SEE_STABILITY){
  648. X!                     sprintf(buf,"\n%13s (%2d)[%2d]",Stars[star]->name,Stars[star]->stability,Stars[star]->AP[Playernum-1]);
  649. X              notify(Playernum, buf);
  650. X      } else {
  651. X!                     sprintf(buf,"\n%13s (??)[%2d]",Stars[star]->name,Stars[star]->stability,Stars[star]->AP[Playernum-1]);
  652. X          notify(Playernum, buf);
  653. X!     } else {
  654. X!                 sprintf(buf,"\t\t      ");
  655. X!         notify(Playernum, buf);
  656. X!         }
  657. X             sprintf(buf,"  #%d. %-15s [ ",i+1,Stars[star]->pnames[i]);
  658. X          notify(Playernum, buf);
  659. X             if (pl->info[Playernum-1].explored)  {
  660. X!                 sprintf(buf,"Expl ");
  661. X          notify(Playernum, buf);
  662. X                  if (pl->info[Playernum-1].autorep) {
  663. X!         sprintf(buf,"Report ");
  664. X          notify(Playernum, buf);
  665. X              }
  666. X                  if (pl->info[Playernum-1].numsectsowned) {
  667. X--- 147,169 ----
  668. X             getplanet(pdata,&pl,Stars[star]->planetpos[i]);
  669. X             if (i == 0)
  670. X                  if (Race->tech >= TECH_SEE_STABILITY){
  671. X!                     sprintf(buf,"\n%13s (%2d)[%2d]\n",Stars[star]->name,Stars[star]->stability,Stars[star]->AP[Playernum-1]);
  672. X              notify(Playernum, buf);
  673. X      } else {
  674. X!                     sprintf(buf,"\n%13s (??)[%2d]\n",Stars[star]->name,Stars[star]->stability,Stars[star]->AP[Playernum-1]);
  675. X          notify(Playernum, buf);
  676. X!     } 
  677. X! 
  678. X!           sprintf(buf,"\t\t      ");
  679. X!     notify(Playernum, buf);
  680. X! 
  681. X             sprintf(buf,"  #%d. %-15s [ ",i+1,Stars[star]->pnames[i]);
  682. X          notify(Playernum, buf);
  683. X             if (pl->info[Playernum-1].explored)  {
  684. X!                 sprintf(buf,"Ex ");
  685. X          notify(Playernum, buf);
  686. X                  if (pl->info[Playernum-1].autorep) {
  687. X!         sprintf(buf,"Rep ");
  688. X          notify(Playernum, buf);
  689. X              }
  690. X                  if (pl->info[Playernum-1].numsectsowned) {
  691. X***************
  692. X*** 197,204 ****
  693. X         free(pl);
  694. X          }
  695. X      }
  696. X!  }
  697. X   close_file(stardata);
  698. X   close_file(pdata);
  699. X  }
  700. X  
  701. X--- 203,212 ----
  702. X         free(pl);
  703. X          }
  704. X      }
  705. X! }
  706. X   close_file(stardata);
  707. X   close_file(pdata);
  708. X+ free(Race);
  709. X  }
  710. X+ 
  711. X  
  712. X*** /usr/cna/billr/games/gb3/server/files.c    Wed May 30 15:13:10 1990
  713. X--- server/files.c    Thu Aug 23 16:54:56 1990
  714. X***************
  715. X*** 27,31 ****
  716. X      DFILE(Tele),
  717. X      DFILE(Tele/tele),
  718. X      DFILE(power),
  719. X!     DFILE(LOCK)
  720. X! };
  721. X--- 27,36 ----
  722. X      DFILE(Tele),
  723. X      DFILE(Tele/tele),
  724. X      DFILE(power),
  725. X!     DFILE(LOCK),
  726. X!     DFILE(News),
  727. X!     DFILE(News/declaration),
  728. X!     DFILE(News/transfer),
  729. X!         DFILE(News/combat),
  730. X!     DFILE(News/announce)
  731. X!     };
  732. X*** /usr/cna/billr/games/gb3/server/files_rw.c    Wed May 30 15:13:11 1990
  733. X--- server/files_rw.c    Thu Aug 23 16:54:57 1990
  734. X***************
  735. X*** 65,75 ****
  736. X  int n2;
  737. X  int i;
  738. X  
  739. X- Num_races=Numraces();
  740. X- 
  741. X-  
  742. X- /* printf(" fd =%d writing %d bytes to %s posn %d.\n",fd,num,file,posn); */
  743. X- 
  744. X   if (lseek(fd, posn, L_SET) < 0) {
  745. X      char buf[100];
  746. X      sprintf(buf,"%s: err %d",file,errno);
  747. X--- 65,70 ----
  748. X*** /usr/cna/billr/games/gb3/server/files_shl.c    Wed May 30 15:13:13 1990
  749. X--- server/files_shl.c    Fri Aug 24 15:14:32 1990
  750. X***************
  751. X*** 37,42 ****
  752. X--- 37,43 ----
  753. X  #include "ships.h"
  754. X  #include "races.h"
  755. X  #include "power.h"
  756. X+ #include "buffers.h"
  757. X  #include <strings.h>
  758. X  #include <sys/stat.h>
  759. X  #include <signal.h>
  760. X***************
  761. X*** 109,119 ****
  762. X  }
  763. X  
  764. X  
  765. X! getrace(fd, r,rnum)
  766. X  int fd;
  767. X  racetype **r;
  768. X  int rnum;
  769. X  {
  770. X   *r = (racetype *)malloc(sizeof(racetype));
  771. X   Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
  772. X              (rnum-1)*sizeof(racetype) );
  773. X--- 110,121 ----
  774. X  }
  775. X  
  776. X  
  777. X! getrace(fd, r, rnum)
  778. X  int fd;
  779. X  racetype **r;
  780. X  int rnum;
  781. X  {
  782. X+ 
  783. X   *r = (racetype *)malloc(sizeof(racetype));
  784. X   Fileread(fd, (char *)*r, sizeof(racetype), RACEDATAFL,
  785. X              (rnum-1)*sizeof(racetype) );
  786. X***************
  787. X*** 295,302 ****
  788. X   struct stat buf;
  789. X  
  790. X  fstat(fd,&buf);
  791. X- 
  792. X- /* printf("numships %d\n",(int)(buf.st_size / sizeof(shiptype)) ); */
  793. X  return( (int)(buf.st_size / sizeof(shiptype)) );
  794. X  }
  795. X  
  796. X--- 297,302 ----
  797. X*** /usr/cna/billr/games/gb3/server/fix.c    Wed May 30 15:13:16 1990
  798. X--- server/fix.c    Fri Aug 24 15:15:15 1990
  799. X***************
  800. X*** 29,36 ****
  801. X  #include <signal.h>
  802. X  int fix_stardata,fix_shdata,fix_pdata,fix_sectdata, fix_racedata;
  803. X  char s[40];
  804. X! 
  805. X! boolean fix_mod;
  806. X  int Playernum;
  807. X  
  808. X  main(argc, argv)
  809. X--- 29,37 ----
  810. X  #include <signal.h>
  811. X  int fix_stardata,fix_shdata,fix_pdata,fix_sectdata, fix_racedata;
  812. X  char s[40];
  813. X! char z;                                                    /*nicgj3*/
  814. X! racetype *Race;
  815. X! int fix_mod;
  816. X  int Playernum;
  817. X  
  818. X  main(argc, argv)
  819. X***************
  820. X*** 45,65 ****
  821. X  sectortype *sect;
  822. X  shiptype *sh;
  823. X  int fix_handler();
  824. X  
  825. X  fix_mod = 0;
  826. X  fix_stardata = fix_shdata = fix_pdata = fix_sectdata = NEUTRAL_FD;
  827. X      /* so closure does not cause wanted files to close (like stdin 
  828. X          or stdout) -- should not cause probs most vers. of UNIX */
  829. X- 
  830. X  printf("Enter race number: ");
  831. X  scanf("%d", &Playernum);
  832. X  
  833. X! openracedata(&fix_racedata);
  834. X! free(Race);
  835. X! getrace(fix_racedata, &Race, Playernum);
  836. X! close_file(fix_racedata);
  837. X  
  838. X! if (!strcmp(argv[1], "race", strlen(argv[1]))) {
  839. X      query(FLOAT,"tech",&Race->tech,0,0,0,0);
  840. X      query(FLOAT,"birthrate",&Race->birthrate,0,0,0,0);
  841. X      query(FLOAT,"mass",&Race->mass,0,0,0,0);
  842. X--- 46,80 ----
  843. X  sectortype *sect;
  844. X  shiptype *sh;
  845. X  int fix_handler();
  846. X+ int numraces;                                             /*nicgj3*/
  847. X  
  848. X  fix_mod = 0;
  849. X  fix_stardata = fix_shdata = fix_pdata = fix_sectdata = NEUTRAL_FD;
  850. X      /* so closure does not cause wanted files to close (like stdin 
  851. X          or stdout) -- should not cause probs most vers. of UNIX */
  852. X  printf("Enter race number: ");
  853. X  scanf("%d", &Playernum);
  854. X  
  855. X! openracedata(&fix_racedata);                                          /*nicgj3*/
  856. X! /*free(Race);   (freeing a pointer never allocated??)            */
  857. X! getrace(fix_racedata, &Race, Playernum);                       /*nicgj3*/
  858. X! close_file(fix_racedata);                               /*nicgj3*/
  859. X! numraces=Numraces();                                   /*nicgj3*/
  860. X  
  861. X! if(argc < 2) {
  862. X!     printf("You have to do 'fix <what>'!\n");
  863. X!     exit(0);
  864. X!     }
  865. X! 
  866. X! if ((argc==2) && (!strcmp(argv[1], "race"))) {                        /*nicgj3*/
  867. X!         getchr();                                         /*nicgj3*/
  868. X!     for(i=1;i<=numraces;i++){                                     /*nicgj3*/
  869. X!       if (i!=Playernum) {                                         /*nicgj3*/
  870. X!         printf("Player %d ",i);                                   /*nicgj3*/
  871. X!         query(CHAR,"Relations",0,0,&Race->translate[i-1],0,0);    /*nicgj3*/
  872. X!         }
  873. X!       }
  874. X!     query(SHORT,"God",0,0,0,&Race->God,0);                        /*nicgj3*/
  875. X      query(FLOAT,"tech",&Race->tech,0,0,0,0);
  876. X      query(FLOAT,"birthrate",&Race->birthrate,0,0,0,0);
  877. X      query(FLOAT,"mass",&Race->mass,0,0,0,0);
  878. X***************
  879. X*** 90,101 ****
  880. X      query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
  881. X      query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
  882. X      query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
  883. X!     if (fix_mod){
  884. X          printf("saving");
  885. X!         putrace(Race);}
  886. X  } else {
  887. X!   where = Getplace(Playernum,argv[1],0);    /* do not ignore the fact that you've not
  888. X!                     explored the place */
  889. X    if (where.err) {
  890. X      sprintf(buf,"cs: bad scope.\n");
  891. X          notify(Playernum, buf);
  892. X--- 105,125 ----
  893. X      query(CHAR, "Sulfur",0,0,&Race->conditions[SULFUR],0,0);
  894. X      query(CHAR, "Helium",0,0,&Race->conditions[HELIUM],0,0);
  895. X      query(CHAR, "Other",0,0,&Race->conditions[OTHER],0,0);
  896. X!     if (fix_mod!=0){
  897. X          printf("saving");
  898. X!         openracedata(&fix_racedata);                   /*nicgj3*/
  899. X!         putrace(fix_racedata,Race);                             /*nicgj3*/
  900. X!         close_file(fix_racedata);                         /*nicgj3*/
  901. X!         }
  902. X  } else {
  903. X!   openstardata(&fix_stardata);                              /*nicgj3*/
  904. X!   getsdata(fix_stardata, &Sdata);                            /*nicgj3*/
  905. X!   for (z=0; z<Sdata.numstars; z++) {                            /*nicgj3*/
  906. X!     getstar(fix_stardata,&(Stars[z]),z);                         /*nicgj3*/
  907. X!     }                                         /*nicgj3*/
  908. X!   close(fix_stardata);                                 /*nicgj3*/
  909. X!  
  910. X!   where = Getplace(Playernum,argv[1],1);
  911. X    if (where.err) {
  912. X      sprintf(buf,"cs: bad scope.\n");
  913. X          notify(Playernum, buf);
  914. X***************
  915. X*** 106,112 ****
  916. X    case LEVEL_UNIV:
  917. X      openstardata(&fix_stardata);
  918. X      getsdata(fix_stardata, &Sdata);
  919. X! 
  920. X      query(CHAR, "ActionPoints",0,0,&Sdata.AP[Playernum-1],0,0);
  921. X      query(SHORT, "shiplist start",0,0,0,&Sdata.ships,0);
  922. X      /*for (ch=MAXUSHIPS-1; ch>1 && Sdata.shipnums[ch]; ch--) ;
  923. X--- 130,136 ----
  924. X    case LEVEL_UNIV:
  925. X      openstardata(&fix_stardata);
  926. X      getsdata(fix_stardata, &Sdata);
  927. X!     getchr();                                           /*nicgj3*/
  928. X      query(CHAR, "ActionPoints",0,0,&Sdata.AP[Playernum-1],0,0);
  929. X      query(SHORT, "shiplist start",0,0,0,&Sdata.ships,0);
  930. X      /*for (ch=MAXUSHIPS-1; ch>1 && Sdata.shipnums[ch]; ch--) ;
  931. X***************
  932. X*** 128,133 ****
  933. X--- 152,158 ----
  934. X  
  935. X      printf("Star #%d : %s\n\n", where.snum, Stars[where.snum]->name );
  936. X  
  937. X+     getchr();                                /*nicgj3*/
  938. X      query(SHORT, "shiplist start",0,0,0,&Stars[where.snum]->ships,0);
  939. X      query(CHAR, "ActionPoints",0,0,&Stars[where.snum]->AP[Playernum-1],0,0);
  940. X  
  941. X***************
  942. X*** 146,152 ****
  943. X      ch = Stars[where.snum]->nova_stage;
  944. X      query(CHAR, "nova stage",0,0,&ch,0,0);
  945. X          Stars[where.snum]->nova_stage = ch;
  946. X!      printf("(limit %d) ",MAXPLANETS);
  947. X      query(CHAR, "# planets",0,0,&Stars[where.snum]->numplanets,0,0);
  948. X      for (i=0; i<Stars[where.snum]->numplanets; i++) {
  949. X          printf("Planet #%d (%s) ", i, Stars[where.snum]->pnames[i]);
  950. X--- 171,177 ----
  951. X      ch = Stars[where.snum]->nova_stage;
  952. X      query(CHAR, "nova stage",0,0,&ch,0,0);
  953. X          Stars[where.snum]->nova_stage = ch;
  954. X!         printf("(limit %d) ",MAXPLANETS);
  955. X      query(CHAR, "# planets",0,0,&Stars[where.snum]->numplanets,0,0);
  956. X      for (i=0; i<Stars[where.snum]->numplanets; i++) {
  957. X          printf("Planet #%d (%s) ", i, Stars[where.snum]->pnames[i]);
  958. X***************
  959. X*** 170,175 ****
  960. X--- 195,201 ----
  961. X          printf("\nPlanet / %s / %s\n", Stars[where.snum]->name, 
  962. X                  Stars[where.snum]->pnames[where.pnum]);
  963. X          unl = p->info[Playernum-1].resource;
  964. X+         getchr();                             /*nicgj3*/
  965. X          query(LONG, "\nstockpile resources",0,0,0,0,&unl);
  966. X              p->info[Playernum-1].resource = unl;
  967. X          unl = p->info[Playernum-1].destruct;
  968. X***************
  969. X*** 287,293 ****
  970. X      query(CHAR, "owner",0,0,&ch,0,0);
  971. X          sh->owner = ch;
  972. X  
  973. X!      unl = sh->type;
  974. X      query(LONG, "type",0,0,0,0,&unl);
  975. X       sh->type = unl;
  976. X      query(FLOAT,"technology",&sh->tech,0,0,0,0);
  977. X--- 313,320 ----
  978. X      query(CHAR, "owner",0,0,&ch,0,0);
  979. X          sh->owner = ch;
  980. X  
  981. X!     unl = sh->type;
  982. X!     getchr();                                         /*nicgj3*/
  983. X      query(LONG, "type",0,0,0,0,&unl);
  984. X       sh->type = unl;
  985. X      query(FLOAT,"technology",&sh->tech,0,0,0,0);
  986. X***************
  987. X*** 297,314 ****
  988. X  
  989. X      query(FLOAT,"fuel",&sh->fuel,0,0,0,0);
  990. X       unl = sh->destruct;
  991. X!     query(LONG, "destruct cap",0,0,0,0,&unl);
  992. X       sh->destruct = unl;
  993. X       unl = sh->resource;
  994. X!     query(LONG, "resource",0,0,0,0,&unl);
  995. X       sh->resource = unl;
  996. X       unl = sh->popn;
  997. X      query(LONG, "crew",0,0,0,0,&unl);
  998. X       sh->popn = unl;
  999. X  
  1000. X       unl = sh->rad;
  1001. X      query(LONG, "irradiated",0,0,0,0,&unl);
  1002. X       sh->rad = unl;
  1003. X  
  1004. X       unl = sh->damage;
  1005. X      query(LONG, "damage",0,0,0,0,&unl);
  1006. X--- 324,366 ----
  1007. X  
  1008. X      query(FLOAT,"fuel",&sh->fuel,0,0,0,0);
  1009. X       unl = sh->destruct;
  1010. X!     query(LONG, "destruct",0,0,0,0,&unl);
  1011. X       sh->destruct = unl;
  1012. X       unl = sh->resource;
  1013. X!     query(LONG, "resources",0,0,0,0,&unl);
  1014. X       sh->resource = unl;
  1015. X       unl = sh->popn;
  1016. X      query(LONG, "crew",0,0,0,0,&unl);
  1017. X       sh->popn = unl;
  1018. X+      unl = sh->crystals;
  1019. X+     query(LONG, "crystals",0,0,0,0,&unl);
  1020. X+      sh->crystals = unl;
  1021. X+      unl = sh->hyper_drive.has;
  1022. X+     query(LONG, "hyper drive?",0,0,0,0,&unl);
  1023. X+      sh->hyper_drive.has = unl;
  1024. X  
  1025. X+      unl = sh->max_destruct;
  1026. X+     query(LONG, "max destruct",0,0,0,0,&unl);
  1027. X+      sh->max_destruct = unl;
  1028. X+      unl = sh->max_fuel;
  1029. X+     query(LONG, "max fuel",0,0,0,0,&unl);
  1030. X+      sh->max_fuel = unl;
  1031. X+      unl = sh->max_resource;
  1032. X+     query(LONG, "max resources",0,0,0,0,&unl);
  1033. X+      sh->max_resource = unl;
  1034. X+      unl = sh->max_crew;
  1035. X+     query(LONG, "max crew",0,0,0,0,&unl);
  1036. X+      sh->max_crew = unl;
  1037. X+      unl = sh->build_cost;
  1038. X+     query(LONG, "build cost",0,0,0,0,&unl);
  1039. X+      sh->build_cost = unl;
  1040. X+ 
  1041. X       unl = sh->rad;
  1042. X      query(LONG, "irradiated",0,0,0,0,&unl);
  1043. X       sh->rad = unl;
  1044. X+      unl = sh->active;
  1045. X+     query(LONG, "active",0,0,0,0,&unl);
  1046. X+      sh->active = unl;
  1047. X  
  1048. X       unl = sh->damage;
  1049. X      query(LONG, "damage",0,0,0,0,&unl);
  1050. X***************
  1051. X*** 351,360 ****
  1052. X      query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
  1053. X      query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
  1054. X  
  1055. X!       query(SHORT, "object:number",0,0,0,&sh->object.number,0);
  1056. X!       query(SHORT, "object:number2",0,0,0,&sh->object.number2,0);
  1057. X!       query(SHORT, "object:number3",0,0,0,&sh->object.number3,0);
  1058. X!       query(SHORT, "object:number4",0,0,0,&sh->object.number4,0);
  1059. X  
  1060. X  
  1061. X      if (fix_mod) {
  1062. X--- 403,412 ----
  1063. X      query(SHORT, "abil_max crew",0,0,0,&sh->abils[ABIL_MAXCREW],0);
  1064. X      query(SHORT, "abil_armor",0,0,0,&sh->abils[ABIL_ARMOR],0);*/
  1065. X  
  1066. X!     query(SHORT, "object:number1",0,0,0,&sh->object.number,0);
  1067. X!     query(SHORT, "object:number2",0,0,0,&sh->object.number2,0);
  1068. X!     query(SHORT, "object:number3",0,0,0,&sh->object.number3,0);
  1069. X!     query(SHORT, "object:number4",0,0,0,&sh->object.number4,0);
  1070. X  
  1071. X  
  1072. X      if (fix_mod) {
  1073. X***************
  1074. X*** 365,377 ****
  1075. X      break;
  1076. X  
  1077. X  
  1078. X   }
  1079. X  }
  1080. X  
  1081. X  
  1082. X- }
  1083. X- 
  1084. X- 
  1085. X  query( kind, quest, fprev, iprev, cprev, sprev, lprev)
  1086. X  int kind;
  1087. X  char *quest;
  1088. X--- 417,427 ----
  1089. X      break;
  1090. X  
  1091. X  
  1092. X+      }
  1093. X   }
  1094. X  }
  1095. X  
  1096. X  
  1097. X  query( kind, quest, fprev, iprev, cprev, sprev, lprev)
  1098. X  int kind;
  1099. X  char *quest;
  1100. X***************
  1101. X*** 441,446 ****
  1102. X--- 491,504 ----
  1103. X  printf("%s\n", temp);
  1104. X  }
  1105. X  
  1106. X+ void push_message(what, who, msg, type)
  1107. X+ int what, who;
  1108. X+ char *msg;
  1109. X+ int type;
  1110. X+ {
  1111. X+ /* this is a dummy routine */
  1112. X+ }
  1113. X+ 
  1114. X  fix_handler()
  1115. X  {
  1116. X   close_file(fix_stardata);
  1117. X***************
  1118. X*** 448,454 ****
  1119. X   close_file(fix_pdata);
  1120. X   close_file(fix_sectdata);
  1121. X  }
  1122. X- 
  1123. X- 
  1124. X- 
  1125. X  
  1126. X--- 506,509 ----
  1127. X*** /usr/cna/billr/games/gb3/server/getplace.c    Wed May 30 15:13:18 1990
  1128. X--- server/getplace.c    Thu Aug 23 16:55:04 1990
  1129. X***************
  1130. X*** 29,42 ****
  1131. X   boolean error;
  1132. X   int getplace_shdata;
  1133. X   placetype where;    /* return value */
  1134. X! 
  1135. X   Bzero(where);
  1136. X  
  1137. X! free(Race);
  1138. X  openracedata(&getplace_racedata);
  1139. X  getrace(getplace_racedata, &Race, Playernum);
  1140. X  close_file(getplace_racedata);
  1141. X! 
  1142. X  where.err = 0;
  1143. X  
  1144. X   switch (*string) {
  1145. X--- 29,46 ----
  1146. X   boolean error;
  1147. X   int getplace_shdata;
  1148. X   placetype where;    /* return value */
  1149. X!  racetype *Race;
  1150. X!  int God;
  1151. X!  
  1152. X   Bzero(where);
  1153. X  
  1154. X! 
  1155. X  openracedata(&getplace_racedata);
  1156. X  getrace(getplace_racedata, &Race, Playernum);
  1157. X  close_file(getplace_racedata);
  1158. X! God = Race->God;
  1159. X! free(Race);
  1160. X!  
  1161. X  where.err = 0;
  1162. X  
  1163. X   switch (*string) {
  1164. X***************
  1165. X*** 44,50 ****
  1166. X             where.level=LEVEL_UNIV;    /* scope = root (universe) */
  1167. X             where.snum=0;
  1168. X             where.pnum= where.shipno=0;
  1169. X!            return(Getplace2(Playernum, string+1,&where,ignoreexpl,Race->God));
  1170. X       case '#':
  1171. X             sscanf(++string,"%hd",&where.shipno);
  1172. X             openshdata(&getplace_shdata);
  1173. X--- 48,54 ----
  1174. X             where.level=LEVEL_UNIV;    /* scope = root (universe) */
  1175. X             where.snum=0;
  1176. X             where.pnum= where.shipno=0;
  1177. X!            return(Getplace2(Playernum, string+1,&where,ignoreexpl,God));
  1178. X       case '#':
  1179. X             sscanf(++string,"%hd",&where.shipno);
  1180. X             openshdata(&getplace_shdata);
  1181. X***************
  1182. X*** 55,62 ****
  1183. X              return where;
  1184. X             }
  1185. X             close_file(getplace_shdata);
  1186. X!            if ( (where.shipptr->owner==Playernum || ignoreexpl || Race->God)
  1187. X!                 && (where.shipptr->is_alive || Race->God)) {
  1188. X  /*               if (!where.shipptr->is_alive)
  1189. X                  printf("Ship is dead.\n"); */
  1190. X                 where.level = LEVEL_SHIP;
  1191. X--- 59,67 ----
  1192. X              return where;
  1193. X             }
  1194. X             close_file(getplace_shdata);
  1195. X!            if ( (where.shipptr->owner==Playernum || ignoreexpl
  1196. X!              || God)
  1197. X!                 && (where.shipptr->is_alive || God)) {
  1198. X  /*               if (!where.shipptr->is_alive)
  1199. X                  printf("Ship is dead.\n"); */
  1200. X                 where.level = LEVEL_SHIP;
  1201. X***************
  1202. X*** 65,79 ****
  1203. X              /* where.shipno already taken care of */
  1204. X                 while (isdigit(*string)) 
  1205. X                  string++;
  1206. X!                if (*string=='/')
  1207. X!                  return Getplace2(Playernum, string+1,&where, ignoreexpl,Race->God);
  1208. X!                else
  1209. X!                  return where;
  1210. X!            } else {
  1211. X              where.err = 1;
  1212. X              if (where.shipptr->is_alive)
  1213. X                  DontOwnErr(Playernum,where.shipno);
  1214. X- 
  1215. X              return where;
  1216. X             }
  1217. X  
  1218. X--- 70,84 ----
  1219. X              /* where.shipno already taken care of */
  1220. X                 while (isdigit(*string)) 
  1221. X                  string++;
  1222. X!                if (*string=='/') {
  1223. X!                    return Getplace2(Playernum, string+1,&where, ignoreexpl,God);
  1224. X!                } else {
  1225. X!                    return where;
  1226. X!                  }
  1227. X!                  } else {
  1228. X              where.err = 1;
  1229. X              if (where.shipptr->is_alive)
  1230. X                  DontOwnErr(Playernum,where.shipno);
  1231. X              return where;
  1232. X             }
  1233. X  
  1234. X***************
  1235. X*** 80,86 ****
  1236. X       case '-':
  1237. X              /* no destination */
  1238. X             where.level = LEVEL_UNIV;
  1239. X!            return where;
  1240. X  
  1241. X      default:
  1242. X              /* copy current scope to scope */
  1243. X--- 85,91 ----
  1244. X       case '-':
  1245. X              /* no destination */
  1246. X             where.level = LEVEL_UNIV;
  1247. X!             return where;
  1248. X  
  1249. X      default:
  1250. X              /* copy current scope to scope */
  1251. X***************
  1252. X*** 93,104 ****
  1253. X                 getship(getplace_shdata,&(where.shipptr),where.shipno);
  1254. X                 close_file(getplace_shdata);
  1255. X             }
  1256. X!            if (*string==CHAR_CURR_SCOPE)
  1257. X!             return where;
  1258. X!            else 
  1259. X!             return Getplace2(Playernum, string,&where, ignoreexpl,Race->God);
  1260. X!  }
  1261. X! 
  1262. X  }
  1263. X  
  1264. X  
  1265. X--- 98,109 ----
  1266. X                 getship(getplace_shdata,&(where.shipptr),where.shipno);
  1267. X                 close_file(getplace_shdata);
  1268. X             }
  1269. X!            if (*string==CHAR_CURR_SCOPE) {
  1270. X!                return where;
  1271. X!            } else {
  1272. X!                return Getplace2(Playernum, string,&where, ignoreexpl,God);
  1273. X!             }
  1274. X!             }
  1275. X  }
  1276. X  
  1277. X  
  1278. X***************
  1279. X*** 117,124 ****
  1280. X  int shdata,tick;
  1281. X  int getplace2_pdata;
  1282. X  
  1283. X- /* printf("getplace2:looking for '%s'\n",string); */
  1284. X- 
  1285. X   if (where->err || *string=='\0' || *string=='\n')
  1286. X      return(*where);        /* base cases */
  1287. X  
  1288. X--- 122,127 ----
  1289. X***************
  1290. X*** 139,147 ****
  1291. X      }
  1292. X   } else {
  1293. X          /* is a char string, name of something */
  1294. X!     /*printf("before scanf str=`%s`\n",string);*/
  1295. X!     sscanf(string,"%[^/ \n]",substr);
  1296. X!     /*printf("after scanf sub=`%s`\n",substr);*/
  1297. X  
  1298. X      do {
  1299. X         /*if (isupper(*string) )
  1300. X--- 142,148 ----
  1301. X      }
  1302. X   } else {
  1303. X          /* is a char string, name of something */
  1304. X!       sscanf(string,"%[^/ \n]",substr);
  1305. X  
  1306. X      do {
  1307. X         /*if (isupper(*string) )
  1308. X***************
  1309. X*** 155,161 ****
  1310. X         if (!strncmp(substr,Stars[i]->name,l)) {
  1311. X           where->level=LEVEL_STAR;
  1312. X           where->snum = i;
  1313. X!          if (ignoreexpl || isset(Stars[where->snum]->explored, Playernum) || God) {
  1314. X               tick = (*string=='/');
  1315. X               return(Getplace2(Playernum, string+tick, where, ignoreexpl, God));
  1316. X           }
  1317. X--- 156,163 ----
  1318. X         if (!strncmp(substr,Stars[i]->name,l)) {
  1319. X           where->level=LEVEL_STAR;
  1320. X           where->snum = i;
  1321. X!          if (ignoreexpl ||
  1322. X!              isset(Stars[where->snum]->explored, Playernum) || God) {
  1323. X               tick = (*string=='/');
  1324. X               return(Getplace2(Playernum, string+tick, where, ignoreexpl, God));
  1325. X           }
  1326. X***************
  1327. X*** 196,202 ****
  1328. X          where->err=1;
  1329. X          return(*where);
  1330. X      }
  1331. X!     } else if (where->level==LEVEL_PLAN) {
  1332. X      sprintf(buf,"Can't descend to %s.\n",substr);
  1333. X              notify(Playernum, buf);
  1334. X      where->err=1;
  1335. X--- 198,204 ----
  1336. X          where->err=1;
  1337. X          return(*where);
  1338. X      }
  1339. X!     } else {
  1340. X      sprintf(buf,"Can't descend to %s.\n",substr);
  1341. X              notify(Playernum, buf);
  1342. X      where->err=1;
  1343. X***************
  1344. X*** 256,262 ****
  1345. X              notify(Playernum, buf);
  1346. X      r = 1;
  1347. X     } 
  1348. X!    if (!s->popn && Max_crew(s)) {
  1349. X      sprintf(buf,"%s #%d %s has no crew and is not a robotic ship.\n", 
  1350. X          Shipnames[s->type], n, s->name );
  1351. X              notify(Playernum, buf);
  1352. X--- 258,264 ----
  1353. X              notify(Playernum, buf);
  1354. X      r = 1;
  1355. X     } 
  1356. X!    if (!s->popn && s->max_crew) {
  1357. X      sprintf(buf,"%s #%d %s has no crew and is not a robotic ship.\n", 
  1358. X          Shipnames[s->type], n, s->name );
  1359. X              notify(Playernum, buf);
  1360. X*** /usr/cna/billr/games/gb3/server/makeplanet.c    Wed May 30 15:13:26 1990
  1361. X--- server/makeplanet.c    Thu Aug 23 16:55:10 1990
  1362. X***************
  1363. X*** 334,339 ****
  1364. X--- 334,349 ----
  1365. X  
  1366. X   }
  1367. X  
  1368. X+ /* make crystal deposits */
  1369. X+   for (y=0; y<planet.Maxy; y++)
  1370. X+      for (x=0; x<planet.Maxx; x++) {
  1371. X+     s = &Sector(planet,x,y);
  1372. X+ if(!int_rand(0, 200))
  1373. X+         s->crystals=int_rand(1,5);
  1374. X+ else
  1375. X+         s->crystals = 0;
  1376. X+     }
  1377. X+ 
  1378. X   return planet;
  1379. X  
  1380. X  }
  1381. X*** /usr/cna/billr/games/gb3/server/orbit.c    Wed May 30 15:13:38 1990
  1382. X--- server/orbit.c    Thu Aug 23 16:55:20 1990
  1383. X***************
  1384. X*** 27,32 ****
  1385. X--- 27,33 ----
  1386. X  float Lastx, Lasty, Zoom;
  1387. X  int SCALE = 100;
  1388. X  int orbit_racedata;
  1389. X+ racetype *Race;
  1390. X  
  1391. X  orbit(Playernum, APcount, argn, args)
  1392. X  int Playernum;
  1393. X***************
  1394. X*** 47,57 ****
  1395. X  
  1396. X   DontDispPlanets = DontDispShips = DontDispStars = 0;
  1397. X  
  1398. X-  free(Race);
  1399. X- openracedata(&orbit_racedata);
  1400. X- getrace(orbit_racedata, &Race, Playernum);
  1401. X- close_file(orbit_racedata);
  1402. X- 
  1403. X   /* find options, set flags accordingly */
  1404. X   for (flag=1; flag<=argn-1; flag++)
  1405. X      if (*args[flag]=='-') {
  1406. X--- 48,53 ----
  1407. X***************
  1408. X*** 93,98 ****
  1409. X--- 89,98 ----
  1410. X      /* orbit type of map */
  1411. X      sprintf(output, "#");
  1412. X  
  1413. X+ openracedata(&orbit_racedata);
  1414. X+ getrace(orbit_racedata, &Race, Playernum);
  1415. X+ close_file(orbit_racedata);
  1416. X+ 
  1417. X    switch (where.level) {
  1418. X      case LEVEL_UNIV:
  1419. X        for (i=0; i<Sdata.numstars; i++)
  1420. X***************
  1421. X*** 123,130 ****
  1422. X      str_cat(output, buf);
  1423. X  
  1424. X        openpdata(&orbit_pdata);
  1425. X- 
  1426. X- 
  1427. X        for (i=0; i<Stars[where.snum]->numplanets; i++)
  1428. X       if (DontDispNum!=i) {
  1429. X         getplanet(orbit_pdata,&p,Stars[where.snum]->planetpos[i]);
  1430. X--- 123,128 ----
  1431. X***************
  1432. X*** 133,140 ****
  1433. X          str_cat(output, buf);
  1434. X         free(p);
  1435. X       }
  1436. X!  
  1437. X!       close_file(orbit_pdata);
  1438. X  
  1439. X  /* check to see if you have ships at orbiting the star, if so you can
  1440. X  see enemy ships */
  1441. X--- 131,137 ----
  1442. X          str_cat(output, buf);
  1443. X         free(p);
  1444. X       }
  1445. X!        close_file(orbit_pdata);
  1446. X  
  1447. X  /* check to see if you have ships at orbiting the star, if so you can
  1448. X  see enemy ships */
  1449. X***************
  1450. X*** 143,149 ****
  1451. X      openshdata(&orbit_shdata);
  1452. X      while (sh && !iq) {
  1453. X         (void)getship(orbit_shdata, &s, sh);
  1454. X!         if(s->owner == Playernum && Shipdata[s->type][ABIL_SIGHT])
  1455. X              iq = 1; /* you are there to sight, need a crew */
  1456. X          sh = s->nextship;
  1457. X          free(s);
  1458. X--- 140,146 ----
  1459. X      openshdata(&orbit_shdata);
  1460. X      while (sh && !iq) {
  1461. X         (void)getship(orbit_shdata, &s, sh);
  1462. X!         if(s->owner == Playernum && Sight(s))
  1463. X              iq = 1; /* you are there to sight, need a crew */
  1464. X          sh = s->nextship;
  1465. X          free(s);
  1466. X***************
  1467. X*** 188,194 ****
  1468. X      openshdata(&orbit_shdata);
  1469. X      while (sh && !iq) {
  1470. X         (void)getship(orbit_shdata, &s, sh);
  1471. X!         if(s->owner == Playernum && Shipdata[s->type][ABIL_SIGHT])
  1472. X              iq = 1; /* you are there to sight, need a crew */
  1473. X          sh = s->nextship;
  1474. X          free(s);
  1475. X--- 185,191 ----
  1476. X      openshdata(&orbit_shdata);
  1477. X      while (sh && !iq) {
  1478. X         (void)getship(orbit_shdata, &s, sh);
  1479. X!         if(s->owner == Playernum && Sight(s))
  1480. X              iq = 1; /* you are there to sight, need a crew */
  1481. X          sh = s->nextship;
  1482. X          free(s);
  1483. X***************
  1484. X*** 220,229 ****
  1485. X  
  1486. X     default:
  1487. X        notify(Playernum,"Bad scope.\n");
  1488. X!     return;     
  1489. X    }
  1490. X  
  1491. X      notify(Playernum, output);
  1492. X  }
  1493. X  
  1494. X  
  1495. X--- 217,229 ----
  1496. X  
  1497. X     default:
  1498. X        notify(Playernum,"Bad scope.\n");
  1499. X!       free(Race);
  1500. X!       return;     
  1501. X!     break;
  1502. X    }
  1503. X  
  1504. X      notify(Playernum, output);
  1505. X+ free(Race);
  1506. X  }
  1507. X  
  1508. X  
  1509. X***************
  1510. X*** 285,291 ****
  1511. X  /* check to see if the any planets are populated here. If so,
  1512. X      standout() the name of it */
  1513. X  
  1514. X!     sprintf(temp, "%d %s ;",isset(star->inhabited, Playernum), star->name);
  1515. X      str_cat(string, temp);
  1516. X         }
  1517. X  }
  1518. X--- 285,291 ----
  1519. X  /* check to see if the any planets are populated here. If so,
  1520. X      standout() the name of it */
  1521. X  
  1522. X!     sprintf(temp, "%d %s ;",!!isset(star->inhabited, Playernum), star->name);
  1523. X      str_cat(string, temp);
  1524. X         }
  1525. X  }
  1526. X***************
  1527. X*** 436,445 ****
  1528. X  
  1529. X                  /* (magnification) */
  1530. X      if (x>=0 && y>=0) {
  1531. X!     if(ship->owner==Playernum)stand=1;
  1532. X      else stand = 0;
  1533. X  
  1534. X      sprintf(string, "%d %d %d %d %c %d %d;",stand,x,y,wm,Shipltrs[ship->type],stand,shipno);
  1535. X      }
  1536. X      break;
  1537. X  
  1538. X--- 436,451 ----
  1539. X  
  1540. X                  /* (magnification) */
  1541. X      if (x>=0 && y>=0) {
  1542. X! 
  1543. X!     if(Race->color) {
  1544. X!     sprintf(string, "%c %d %d %d %c %c %d;",(char)(ship->owner+48),x,y,wm,
  1545. X!         Shipltrs[ship->type],(char)(ship->owner+48),shipno);
  1546. X!     } else {
  1547. X!     if(ship->owner==Race->highlight)stand=1;
  1548. X      else stand = 0;
  1549. X  
  1550. X      sprintf(string, "%d %d %d %d %c %d %d;",stand,x,y,wm,Shipltrs[ship->type],stand,shipno);
  1551. X+     }
  1552. X      }
  1553. X      break;
  1554. X  
  1555. X***************
  1556. X*** 459,469 ****
  1557. X          xa = int_rand(x - (int)fac, x + (int)fac);
  1558. X          ya = int_rand(y - (int)fac, y + (int)fac);
  1559. X          if (xa>=0 && ya>=0) {
  1560. X!         if(ship->owner==Playernum)stand=1;
  1561. X              else stand = 0;
  1562. X      sprintf(temp, "%d %d %d %d %c %d %d;",stand,xa,ya,wm,Shipltrs[ship->type],
  1563. X                  stand,shipno);
  1564. X! 
  1565. X      str_cat(string, temp);
  1566. X          }
  1567. X           }
  1568. X--- 465,480 ----
  1569. X          xa = int_rand(x - (int)fac, x + (int)fac);
  1570. X          ya = int_rand(y - (int)fac, y + (int)fac);
  1571. X          if (xa>=0 && ya>=0) {
  1572. X! 
  1573. X!         if(Race->color) {
  1574. X!     sprintf(temp, "%c %d %d %d %c %c %d;",(char)(ship->owner+48),xa,ya,wm,
  1575. X!                 Shipltrs[ship->type], (char)(ship->owner+48),shipno);
  1576. X!         } else {
  1577. X!         if(ship->owner==Race->highlight)stand=1;
  1578. X              else stand = 0;
  1579. X      sprintf(temp, "%d %d %d %d %c %d %d;",stand,xa,ya,wm,Shipltrs[ship->type],
  1580. X                  stand,shipno);
  1581. X!         }
  1582. X      str_cat(string, temp);
  1583. X          }
  1584. X           }
  1585. X***************
  1586. X*** 476,485 ****
  1587. X      wm=0;
  1588. X      if (ship->whatorbits!=LEVEL_UNIV || (ship->owner == Playernum || God))
  1589. X         if (x>=0 && y>=0) {
  1590. X!         if(ship->owner==Playernum)stand=1;
  1591. X              else stand = 0;
  1592. X      sprintf(string, "%d %d %d %d %c %d %d;",stand,x,y,wm,Shipltrs[ship->type],stand,shipno);
  1593. X! 
  1594. X         }
  1595. X      break;
  1596. X   }
  1597. X--- 487,501 ----
  1598. X      wm=0;
  1599. X      if (ship->whatorbits!=LEVEL_UNIV || (ship->owner == Playernum || God))
  1600. X         if (x>=0 && y>=0) {
  1601. X! 
  1602. X!     if(Race->color) {
  1603. X!     sprintf(string, "%c %d %d %d %c %c %d;",(char)(ship->owner+48),x,y,wm,
  1604. X!         Shipltrs[ship->type],(char)(ship->owner+48),shipno);
  1605. X!     } else {
  1606. X!         if(ship->owner==Race->highlight)stand=1;
  1607. X              else stand = 0;
  1608. X      sprintf(string, "%d %d %d %d %c %d %d;",stand,x,y,wm,Shipltrs[ship->type],stand,shipno);
  1609. X!     }
  1610. X         }
  1611. X      break;
  1612. X   }
  1613. X*** /usr/cna/billr/games/gb3/server/order.c    Wed May 30 15:13:40 1990
  1614. X--- server/order.c    Thu Aug 23 16:55:22 1990
  1615. X***************
  1616. X*** 115,121 ****
  1617. X      Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1618. X       close_file(pdata);
  1619. X            shipno = p->ships;
  1620. X!           break; 
  1621. X     case LEVEL_STAR:
  1622. X            shipno = Stars[Dir[Playernum-1].snum]->ships;
  1623. X            break; 
  1624. X--- 115,122 ----
  1625. X      Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1626. X       close_file(pdata);
  1627. X            shipno = p->ships;
  1628. X!     free(p);
  1629. X!     break; 
  1630. X     case LEVEL_STAR:
  1631. X            shipno = Stars[Dir[Playernum-1].snum]->ships;
  1632. X            break; 
  1633. X***************
  1634. X*** 204,210 ****
  1635. X      i=strlen(args[2]);
  1636. X  
  1637. X         if (!strncmp(args[2],"defense",i)) {
  1638. X!         if (can_bombard(ship) || ship->type == OTYPE_GR) {
  1639. X              if(!strncmp(args[3],"off", strlen(args[3]))) {
  1640. X                  ship->protect.planet = 0;
  1641. X                  notify(Playernum, "Planetary defense canceled.\n");
  1642. X--- 205,211 ----
  1643. X      i=strlen(args[2]);
  1644. X  
  1645. X         if (!strncmp(args[2],"defense",i)) {
  1646. X!         if (can_bombard(ship)) {
  1647. X              if(!strncmp(args[3],"off", strlen(args[3]))) {
  1648. X                  ship->protect.planet = 0;
  1649. X                  notify(Playernum, "Planetary defense canceled.\n");
  1650. X***************
  1651. X*** 218,224 ****
  1652. X                  return;
  1653. X          }
  1654. X           } else if (!strncmp(args[2],"jump",i)) {
  1655. X!         if(Shipdata[ship->type][ABIL_JUMP]) {
  1656. X              if(!strncmp(args[3],"off", strlen(args[3]))) {
  1657. X                  ship->hyper_drive.on = 0;
  1658. X                  notify(Playernum, "Hyper drive turned off.\n");
  1659. X--- 219,225 ----
  1660. X                  return;
  1661. X          }
  1662. X           } else if (!strncmp(args[2],"jump",i)) {
  1663. X!         if(ship->hyper_drive.has) {
  1664. X              if(!strncmp(args[3],"off", strlen(args[3]))) {
  1665. X                  ship->hyper_drive.on = 0;
  1666. X                  notify(Playernum, "Hyper drive turned off.\n");
  1667. X***************
  1668. X*** 230,235 ****
  1669. X--- 231,242 ----
  1670. X                          }
  1671. X                  ship->hyper_drive.on = 1;
  1672. X                  ship->navigate.on = 0;
  1673. X+ 
  1674. X+             if(ship->hyper_drive.mounted) {
  1675. X+                 ship->hyper_drive.charge = 1;
  1676. X+                 ship->hyper_drive.ready = 1;
  1677. X+                     }
  1678. X+ 
  1679. X                  notify(Playernum, "Hyper drive engine's activated.\n");
  1680. X  /* estimate how much fuel it will cost for this ship to get there */
  1681. X                  }
  1682. X***************
  1683. X*** 241,247 ****
  1684. X  
  1685. X           } else if (!strncmp(args[2],"protect",i)) {
  1686. X  
  1687. X!     sscanf(args[3]+(args[3][0]=='#'),"%d",&j);
  1688. X  
  1689. X          if(j < 0 || j > n_ships || j==shipno) {
  1690. X                  notify(Playernum, "You can't protect that!\n");
  1691. X--- 248,257 ----
  1692. X  
  1693. X           } else if (!strncmp(args[2],"protect",i)) {
  1694. X  
  1695. X!     if(argn>3)
  1696. X!         sscanf(args[3]+(args[3][0]=='#'),"%d",&j);
  1697. X!     else
  1698. X!         j = 0;
  1699. X  
  1700. X          if(j < 0 || j > n_ships || j==shipno) {
  1701. X                  notify(Playernum, "You can't protect that!\n");
  1702. X***************
  1703. X*** 248,254 ****
  1704. X                  free(ship);
  1705. X                  return;
  1706. X              }
  1707. X!           if (can_bombard(ship) || ship->type==OTYPE_GR) {
  1708. X                  if(!j) {
  1709. X                      ship->protect.on = 0;
  1710. X                      notify(Playernum, "Protection orders halted.\n");
  1711. X--- 258,264 ----
  1712. X                  free(ship);
  1713. X                  return;
  1714. X              }
  1715. X!           if (can_bombard(ship)) {
  1716. X                  if(!j) {
  1717. X                      ship->protect.on = 0;
  1718. X                      notify(Playernum, "Protection orders halted.\n");
  1719. X***************
  1720. X*** 324,329 ****
  1721. X--- 334,347 ----
  1722. X                      ship->destshipno = where.shipno;
  1723. X                  ship->whatdest = LEVEL_SHIP;
  1724. X              } else {
  1725. X+ /* to foil cheaters */
  1726. X+           if(((ship->storbits != where.snum) && where.level != LEVEL_STAR)
  1727. X+                    && isclr(Stars[where.snum]->explored, ship->owner)){
  1728. X+                  notify(Playernum, "You haven't explored this system.\n");
  1729. X+                  free(ship);
  1730. X+                  return;            
  1731. X+                     }
  1732. X+ 
  1733. X                  ship->whatdest = where.level;
  1734. X                  ship->deststar = where.snum;
  1735. X                  ship->destpnum = where.pnum;
  1736. X***************
  1737. X*** 375,381 ****
  1738. X          }
  1739. X         } else if (!strncmp(args[2],"retaliate",i)) {
  1740. X          if (ship->type!=OTYPE_OMCL) {
  1741. X!             if (can_bombard(ship) || ship->type==OTYPE_GR) {
  1742. X              if(!strncmp(args[3],"off",strlen(args[3]))) {
  1743. X                  ship->protect.self = 0;
  1744. X                  notify(Playernum, "Retaliation option turned off.\n");                
  1745. X--- 393,399 ----
  1746. X          }
  1747. X         } else if (!strncmp(args[2],"retaliate",i)) {
  1748. X          if (ship->type!=OTYPE_OMCL) {
  1749. X!             if (can_bombard(ship)) {
  1750. X              if(!strncmp(args[3],"off",strlen(args[3]))) {
  1751. X                  ship->protect.self = 0;
  1752. X                  notify(Playernum, "Retaliation option turned off.\n");                
  1753. X***************
  1754. X*** 388,393 ****
  1755. X--- 406,430 ----
  1756. X              notify(Playernum, "This type of ship cannot be set to retaliate.\n");
  1757. X              }
  1758. X          }
  1759. X+        } else if (!strncmp(args[2],"laser",i)) {
  1760. X+         if(ship->laser) {
  1761. X+             if (can_bombard(ship)) {
  1762. X+             if(ship->hyper_drive.mounted) {
  1763. X+             if(!strncmp(args[3],"on",strlen(args[3]))) {
  1764. X+                 ship->fire_laser = atoi(args[4]);
  1765. X+                 sprintf(buf, "Combat lasers activated to attack with strength %d\n",
  1766. X+                     ship->fire_laser);                
  1767. X+                 notify(Playernum, buf);                
  1768. X+             } else {
  1769. X+                 ship->fire_laser = 0;
  1770. X+                 notify(Playernum, "Combat lasers deactivated.\n");
  1771. X+             }
  1772. X+             } else
  1773. X+                 notify(Playernum, "You do not have a crystal mounted.\n");
  1774. X+             } else
  1775. X+             notify(Playernum, "This type of ship cannot be set to retaliate.\n");
  1776. X+         } else
  1777. X+             notify(Playernum, "This ship is not equipped with combat lasers.\n");
  1778. X         } else if (!strncmp(args[2],"speed",i)) {
  1779. X          if (speed_rating(ship)) {
  1780. X              j = atoi(args[3]);            
  1781. X***************
  1782. X*** 408,431 ****
  1783. X              return;
  1784. X          }
  1785. X  
  1786. X!       } else if(!strncmp(args[2], "explosive", i)) {
  1787. X!         if(ship->type==STYPE_MINE) {
  1788. X!             ship->mine.mode = 1;
  1789. X!             notify(Playernum, "This mine is set for explosive mode.\n");
  1790. X          } else {
  1791. X!             notify(Playernum, "This ship cannot be set for this.\n");
  1792. X              free(ship);
  1793. X              return;
  1794. X          }
  1795. X        } else if(!strncmp(args[2], "radiative", i)) {
  1796. X!         if(ship->type==STYPE_MINE) {
  1797. X!             ship->mine.mode = 0;
  1798. X!             notify(Playernum, "This mine is set for radiation mode.\n");
  1799. X!         } else {
  1800. X!             notify(Playernum, "This ship cannot be set for this.\n");
  1801. X!             free(ship);
  1802. X!             return;
  1803. X!         }
  1804. X        } else if(!strncmp(args[2], "move", i)) {
  1805. X          if (ship->type==OTYPE_TERRA) {
  1806. X              ship->object.number = atoi(args[3]);
  1807. X--- 445,500 ----
  1808. X              return;
  1809. X          }
  1810. X  
  1811. X!       } else if(!strncmp(args[2], "salvo", i)) {
  1812. X!         if (can_bombard(ship)) {
  1813. X!             j = atoi(args[3]);            
  1814. X!             if(j < 0) {
  1815. X!                 notify(Playernum, "Specify a positive number of guns.\n");
  1816. X!                 free(ship);
  1817. X!                 return;
  1818. X!             } else {
  1819. X!                 if(j > ship->guns) j = ship->guns;
  1820. X!                 ship->retaliate = j;
  1821. X!                 sprintf(buf, "Retaliation strength set at %d.\n", j);
  1822. X!                 notify(Playernum, buf);
  1823. X!             }
  1824. X! 
  1825. X          } else {
  1826. X!             notify(Playernum, "This ship cannot be set to retaliate.\n");
  1827. X              free(ship);
  1828. X              return;
  1829. X          }
  1830. X+ 
  1831. X+       } else if(!strncmp(args[2], "explosive", i)) {
  1832. X+         switch(ship->type) {
  1833. X+                 case STYPE_MINE:
  1834. X+                     ship->mode = 1;
  1835. X+                     notify(Playernum, "This mine is set for explosive mode.\n");
  1836. X+                     break;
  1837. X+                 case OTYPE_GR:
  1838. X+                     ship->mode = 1;
  1839. X+                     notify(Playernum, "Will inflict structural damage.\n");
  1840. X+                     break;
  1841. X+                 default:
  1842. X+                     notify(Playernum, "This ship cannot be set for this.\n");
  1843. X+                     free(ship);
  1844. X+                     return;
  1845. X+                 }
  1846. X        } else if(!strncmp(args[2], "radiative", i)) {
  1847. X!         switch(ship->type) {
  1848. X!                 case STYPE_MINE:
  1849. X!                     ship->mode = 0;
  1850. X!                     notify(Playernum, "This mine is set for radiative mode.\n");
  1851. X!                     break;
  1852. X!                 case OTYPE_GR:
  1853. X!                     ship->mode = 0;
  1854. X!                     notify(Playernum, "Will inflict radiation damage.\n");
  1855. X!                     break;
  1856. X!                 default:
  1857. X!                     notify(Playernum, "This ship cannot be set for this.\n");
  1858. X!                     free(ship);
  1859. X!                     return;
  1860. X!                 }
  1861. X        } else if(!strncmp(args[2], "move", i)) {
  1862. X          if (ship->type==OTYPE_TERRA) {
  1863. X              ship->object.number = atoi(args[3]);
  1864. X***************
  1865. X*** 534,540 ****
  1866. X          close_file(order_pdata);
  1867. X  
  1868. X      if(planet->info[Playernum-1].resource < 2*ship->build_cost) {
  1869. X!         sprintf(buf, "You don't have %s resources on the planet to activate this factory.\n",
  1870. X                  2*ship->build_cost);
  1871. X          notify(Playernum, buf);
  1872. X          free(ship);
  1873. X--- 603,609 ----
  1874. X          close_file(order_pdata);
  1875. X  
  1876. X      if(planet->info[Playernum-1].resource < 2*ship->build_cost) {
  1877. X!         sprintf(buf, "You don't have %d resources on the planet to activate this factory.\n",
  1878. X                  2*ship->build_cost);
  1879. X          notify(Playernum, buf);
  1880. X          free(ship);
  1881. X***************
  1882. X*** 655,661 ****
  1883. X              close_file(sdata);    /* don't need to care about Stars */
  1884. X              sprintf(buf, "Surveyed, distance %g.\n",dist);
  1885. X              notify(Playernum, buf);
  1886. X!         } else {
  1887. X              sprintf(buf, "Too far to see (%g, max %g).\n", 
  1888. X                          dist, tele_range(s->type, s->tech) );
  1889. X              notify(Playernum, buf);
  1890. X--- 724,731 ----
  1891. X              close_file(sdata);    /* don't need to care about Stars */
  1892. X              sprintf(buf, "Surveyed, distance %g.\n",dist);
  1893. X              notify(Playernum, buf);
  1894. X!             free(str);
  1895. X!             } else {
  1896. X              sprintf(buf, "Too far to see (%g, max %g).\n", 
  1897. X                          dist, tele_range(s->type, s->tech) );
  1898. X              notify(Playernum, buf);
  1899. X***************
  1900. X*** 672,679 ****
  1901. X              p->info[Playernum-1].explored = 1;
  1902. X              openpdata(&pdata);
  1903. X              putplanet(pdata, p, str->planetpos[s->aimed_at.pnum]);
  1904. X!         close_file(pdata);
  1905. X!             free(p);
  1906. X              sprintf(buf, "Surveyed, distance %g.\n", dist);
  1907. X              notify(Playernum, buf);
  1908. X          } else {
  1909. X--- 742,748 ----
  1910. X              p->info[Playernum-1].explored = 1;
  1911. X              openpdata(&pdata);
  1912. X              putplanet(pdata, p, str->planetpos[s->aimed_at.pnum]);
  1913. X!             close_file(pdata);
  1914. X              sprintf(buf, "Surveyed, distance %g.\n", dist);
  1915. X              notify(Playernum, buf);
  1916. X          } else {
  1917. X***************
  1918. X*** 681,686 ****
  1919. X--- 750,756 ----
  1920. X                          dist, tele_range(s->type, s->tech) );
  1921. X              notify(Playernum, buf);
  1922. X          }
  1923. X+         free(p);
  1924. X          break;
  1925. X      case LEVEL_SHIP:
  1926. X          sprintf(buf, "You can't see anything of use there.\n");
  1927. X***************
  1928. X*** 692,698 ****
  1929. X  DispOrdersHeader(Playernum)
  1930. X  int Playernum;
  1931. X  {
  1932. X! notify(Playernum, "            name          destination     orbits     spd   options\n"); 
  1933. X  }
  1934. X  
  1935. X  DispOrders(Playernum, sh, next, check)
  1936. X--- 762,768 ----
  1937. X  DispOrdersHeader(Playernum)
  1938. X  int Playernum;
  1939. X  {
  1940. X! notify(Playernum, "            name          orbits     destination     spd   options\n"); 
  1941. X  }
  1942. X  
  1943. X  DispOrders(Playernum, sh, next, check)
  1944. X***************
  1945. X*** 703,708 ****
  1946. X--- 773,779 ----
  1947. X  {
  1948. X  int order_shdata, in_list;
  1949. X  shiptype *ship;
  1950. X+ float distfac;
  1951. X  char temp[128];
  1952. X  
  1953. X  openshdata(&order_shdata);
  1954. X***************
  1955. X*** 732,739 ****
  1956. X          }
  1957. X          }
  1958. X  
  1959. X!     sprintf(buf, "%4d %c %14s %15s %15s %1d ", sh, Shipltrs[ship->type], ship->name, 
  1960. X!         prin_ship_dest(Playernum, ship), prin_ship_orbits(ship),  ship->speed);
  1961. X  
  1962. X  if(ship->hyper_drive.on) {
  1963. X      sprintf(temp, "/jump %s %d", (ship->hyper_drive.ready ? "ready" : "charging"),
  1964. X--- 803,810 ----
  1965. X          }
  1966. X          }
  1967. X  
  1968. X!     sprintf(buf, "%4d %c %14.14s %15.15s %15.15s %1d ", sh, Shipltrs[ship->type], ship->name, 
  1969. X!         prin_ship_orbits(ship), prin_ship_dest(Playernum, ship),  ship->speed);
  1970. X  
  1971. X  if(ship->hyper_drive.on) {
  1972. X      sprintf(temp, "/jump %s %d", (ship->hyper_drive.ready ? "ready" : "charging"),
  1973. X***************
  1974. X*** 740,746 ****
  1975. X          ship->hyper_drive.charge);
  1976. X      strcat(buf, temp);
  1977. X      }
  1978. X! if(ship->protect.self) strcat(buf, "/retal");
  1979. X  if(ship->protect.planet) strcat(buf, "/defense");
  1980. X  if(ship->protect.on) {
  1981. X          sprintf(temp, "/prot %d", ship->protect.ship);
  1982. X--- 811,830 ----
  1983. X          ship->hyper_drive.charge);
  1984. X      strcat(buf, temp);
  1985. X      }
  1986. X! if(ship->protect.self) {
  1987. X! sprintf(temp, "/retal");
  1988. X! strcat(buf, temp);
  1989. X! }
  1990. X! 
  1991. X! if(ship->fire_laser) {
  1992. X! sprintf(temp, "/laser %d", ship->fire_laser);
  1993. X! strcat(buf, temp);
  1994. X! }
  1995. X! 
  1996. X! if(ship->retaliate) {
  1997. X! sprintf(temp, "/salvo %d", ship->retaliate);
  1998. X! strcat(buf, temp);
  1999. X! }
  2000. X  if(ship->protect.planet) strcat(buf, "/defense");
  2001. X  if(ship->protect.on) {
  2002. X          sprintf(temp, "/prot %d", ship->protect.ship);
  2003. X***************
  2004. X*** 756,763 ****
  2005. X      }
  2006. X  if(ship->protect.evade) strcat(buf, "/evade");
  2007. X  if(ship->bombard) strcat(buf, "/bomb");
  2008. X! if(ship->type==STYPE_MINE) {
  2009. X!     if(ship->mine.mode) strcat(buf, "/explode");
  2010. X      else strcat(buf, "/radiate");
  2011. X      }
  2012. X  if(ship->type==OTYPE_TERRA) {
  2013. X--- 840,847 ----
  2014. X      }
  2015. X  if(ship->protect.evade) strcat(buf, "/evade");
  2016. X  if(ship->bombard) strcat(buf, "/bomb");
  2017. X! if(ship->type==STYPE_MINE || ship->type==OTYPE_GR) {
  2018. X!     if(ship->mode) strcat(buf, "/explode");
  2019. X      else strcat(buf, "/radiate");
  2020. X      }
  2021. X  if(ship->type==OTYPE_TERRA) {
  2022. X***************
  2023. X*** 781,793 ****
  2024. X  notify(Playernum, buf);
  2025. X  /* if hyper space is on estimate how much fuel it will cost to get to the destination */
  2026. X      if(ship->hyper_drive.on) {
  2027. X!     double dist, fuse;
  2028. X  
  2029. X       dist = sqrt( Distsq(ship->xpos, ship->ypos, Stars[ship->deststar]->xpos, 
  2030. X                  Stars[ship->deststar]->ypos));
  2031. X!      fuse = HYPER_DRIVE_FUEL_USE * ship->mass 
  2032. X!             * (dist/HYPER_DIST_FACTOR) * (dist/HYPER_DIST_FACTOR);
  2033. X!             sprintf(buf, "    *** jump will cost %.1ff ***\n", fuse);
  2034. X              notify(Playernum, buf);
  2035. X      if(ship->max_fuel < fuse)
  2036. X              notify(Playernum, "Your ship cannot carry enough fuel to do this jump.\n");
  2037. X--- 865,884 ----
  2038. X  notify(Playernum, buf);
  2039. X  /* if hyper space is on estimate how much fuel it will cost to get to the destination */
  2040. X      if(ship->hyper_drive.on) {
  2041. X!     float dist, fuse;
  2042. X  
  2043. X       dist = sqrt( Distsq(ship->xpos, ship->ypos, Stars[ship->deststar]->xpos, 
  2044. X                  Stars[ship->deststar]->ypos));
  2045. X!     distfac = HYPER_DIST_FACTOR * (ship->tech + 100.0);
  2046. X!     if(ship->hyper_drive.mounted && dist > distfac) {
  2047. X!         fuse = HYPER_DRIVE_FUEL_USE * sqrt(ship->mass)
  2048. X!             * (dist/distfac);
  2049. X!     } else {
  2050. X!         fuse = HYPER_DRIVE_FUEL_USE * sqrt(ship->mass)
  2051. X!             * (dist/distfac) * (dist/distfac);
  2052. X!             }
  2053. X! 
  2054. X!             sprintf(buf, "    *** distance %.0f - jump will cost %.1ff ***\n", dist, fuse);
  2055. X              notify(Playernum, buf);
  2056. X      if(ship->max_fuel < fuse)
  2057. X              notify(Playernum, "Your ship cannot carry enough fuel to do this jump.\n");
  2058. END_OF_FILE
  2059. if test 56321 -ne `wc -c <'patches02b'`; then
  2060.     echo shar: \"'patches02b'\" unpacked with wrong size!
  2061. fi
  2062. # end of 'patches02b'
  2063. if test -f 'server/patchlevel.h' -a "${1}" != "-c" ; then 
  2064.   echo shar: Renaming existing file \"'server/patchlevel.h'\" to \"'server/patchlevel.h.orig'\"
  2065.   mv -f 'server/patchlevel.h' 'server/patchlevel.h.orig'
  2066. fi
  2067. echo shar: Extracting \"'server/patchlevel.h'\" \(21 characters\)
  2068. sed "s/^X//" >'server/patchlevel.h' <<'END_OF_FILE'
  2069. X#define PATCHLEVEL    2
  2070. END_OF_FILE
  2071. if test 21 -ne `wc -c <'server/patchlevel.h'`; then
  2072.     echo shar: \"'server/patchlevel.h'\" unpacked with wrong size!
  2073. fi
  2074. # end of 'server/patchlevel.h'
  2075. echo shar: End of archive 2 \(of 9\).
  2076. cp /dev/null ark2isdone
  2077. MISSING=""
  2078. for I in 1 2 3 4 5 6 7 8 9 ; do
  2079.     if test ! -f ark${I}isdone ; then
  2080.     MISSING="${MISSING} ${I}"
  2081.     fi
  2082. done
  2083. if test "${MISSING}" = "" ; then
  2084.     echo You have unpacked all 9 archives.
  2085.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2086. else
  2087.     echo You still need to unpack the following archives:
  2088.     echo "        " ${MISSING}
  2089. fi
  2090. ##  End of shell archive.
  2091. exit 0
  2092.