home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / gb2 / patch1a < prev    next >
Encoding:
Text File  |  1989-09-18  |  55.3 KB  |  1,888 lines

  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: v08i026:  GB2 - Galactic Bloodshed, an empire-like war game [Ver. 1.0], Patch1a
  5. Message-ID: <4575@tekred.CNA.TEK.COM>
  6. Date: 15 Sep 89 15:22:21 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1877
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 8, Issue 26
  13. Archive-name: GB2/Patch1a
  14. Patch-To: GB2: Volume 7, Issue 44-51
  15.  
  16.     [This patch brings the Ohio State version of GB upto version
  17.      1.1.  As Garrett mentioned in another newsgroup, the complete
  18.      source can still be obtained directly from him for a period
  19.      of time.  The original GB2 posting is, of course, available
  20.      from any of the c.s.g. archive sites....    -br]
  21.  
  22. #! /bin/sh
  23. # This is a shell archive.  Remove anything before this line, then unpack
  24. # it by saving it into a file and typing "sh file".  To overwrite existing
  25. # files, type "sh file -c".  You can also feed this as standard input via
  26. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  27. # will see the following message at the end:
  28. #        "End of archive 1 (of 4)."
  29. # Contents:  patches01a
  30. # Wrapped by billr@saab on Fri Sep 15 08:21:43 1989
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'patches01a' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'patches01a'\"
  34. else
  35. echo shar: Extracting \"'patches01a'\" \(52745 characters\)
  36. sed "s/^X//" >'patches01a' <<'END_OF_FILE'
  37. X*** ../../GB2/GB.c    Wed Jul  5 15:14:58 1989
  38. X--- GB.c    Fri Sep 15 07:27:43 1989
  39. X***************
  40. X*** 23,34 ****
  41. X  
  42. X  main()
  43. X  {
  44. X! int notified=0,s,i;
  45. X  char c,commstr[MAXCOMMSTRSIZE];
  46. X  int maim_handler();
  47. X  int maim_stardata;
  48. X  
  49. X- 
  50. X      setegid(PLAYER_GROUP_ID);
  51. X  
  52. X      srandom(getpid());
  53. X--- 23,33 ----
  54. X  
  55. X  main()
  56. X  {
  57. X! int notified=0, s, i;
  58. X  char c,commstr[MAXCOMMSTRSIZE];
  59. X  int maim_handler();
  60. X  int maim_stardata;
  61. X  
  62. X      setegid(PLAYER_GROUP_ID);
  63. X  
  64. X      srandom(getpid());
  65. X***************
  66. X*** 53,75 ****
  67. X      close(maim_stardata);
  68. X  
  69. X      passwd = getpwuid(geteuid());
  70. X      if (!strcmp(passwd->pw_name, PLAYER_GOD)) {
  71. X  
  72. X      printf("Enter password: ");
  73. X      scanf("%s",commstr);
  74. X          getchr();
  75. X  
  76. X!     if(!strcmp(commstr, GOD_PASSWORD)){
  77. X  
  78. X!         God = 1;
  79. X!         printf("Login as what player? ");
  80. X          scanf("%s",commstr);
  81. X          getchr();
  82. X  
  83. X!         } else 
  84. X!             sprintf(commstr,"%s", passwd->pw_name);
  85. X!     }else
  86. X!         sprintf(commstr,"%s", passwd->pw_name);
  87. X  
  88. X      i = Getracenum(commstr);
  89. X  
  90. X--- 52,72 ----
  91. X      close(maim_stardata);
  92. X  
  93. X      passwd = getpwuid(geteuid());
  94. X+ 
  95. X      if (!strcmp(passwd->pw_name, PLAYER_GOD)) {
  96. X  
  97. X      printf("Enter password: ");
  98. X      scanf("%s",commstr);
  99. X          getchr();
  100. X+         }
  101. X  
  102. X!     if(!strcmp(commstr, GOD_PASSWORD)) God = 1;
  103. X  
  104. X!         printf("Who are you (this is/will (be) your password)? ");
  105. X          scanf("%s",commstr);
  106. X          getchr();
  107. X  
  108. X! /*            sprintf(commstr,"%s", passwd->pw_name); */
  109. X  
  110. X      i = Getracenum(commstr);
  111. X  
  112. X***************
  113. X*** 78,84 ****
  114. X       else 
  115. X          getrace(&Race,i);
  116. X      Playernum = Race->Playernum;
  117. X!     if (God)
  118. X          printf("Logging in as player %d.\n",Playernum);
  119. X  
  120. X      if(God) {
  121. X--- 75,81 ----
  122. X       else 
  123. X          getrace(&Race,i);
  124. X      Playernum = Race->Playernum;
  125. X! 
  126. X          printf("Logging in as player %d.\n",Playernum);
  127. X  
  128. X      if(God) {
  129. X*** ../../GB2/Makefile    Thu Jul  6 07:32:22 1989
  130. X--- Makefile    Fri Sep 15 07:29:04 1989
  131. X***************
  132. X*** 1,5 ****
  133. X  # Galactic Bloodshed (Robert Chansky, smq@b)
  134. X! # Makefile              (modified by billr@saab.cna.tek.com, 4/26/89)
  135. X  
  136. X  # what version of UNIX we are running on.
  137. X  UV = VER_4_3
  138. X--- 1,5 ----
  139. X  # Galactic Bloodshed (Robert Chansky, smq@b)
  140. X! # Makefile
  141. X  
  142. X  # what version of UNIX we are running on.
  143. X  UV = VER_4_3
  144. X***************
  145. X*** 6,19 ****
  146. X  #UV = VER_4_2
  147. X  # You might want to get rid of the -pipe -g, since these are for development. 
  148. X  CFLAGS = -D$(UV) -pipe -g 
  149. X! #CFLAGS = -D$(UV) -g 
  150. X! #CFLAGS = -D$(UV) -O
  151. X  
  152. X- # destination directories
  153. X- # GLIB should match the directory in the PATH macro of files.h
  154. X- GBIN = /usr/games
  155. X- GLIB = /usr/games/lib/GB
  156. X- 
  157. X  # objects for shell
  158. X  SHOBJS =  getplace.o    \
  159. X      read_teleg.o    \
  160. X--- 6,13 ----
  161. X  #UV = VER_4_2
  162. X  # You might want to get rid of the -pipe -g, since these are for development. 
  163. X  CFLAGS = -D$(UV) -pipe -g 
  164. X! #-D$(UV) -O
  165. X  
  166. X  # objects for shell
  167. X  SHOBJS =  getplace.o    \
  168. X      read_teleg.o    \
  169. X***************
  170. X*** 20,26 ****
  171. X      autoreport.o    \
  172. X      shootblast.o    \
  173. X      docommand.o    \
  174. X-     explore.o    \
  175. X      telegram.o    \
  176. X      mobiliz.o    \
  177. X      shlmisc.o    \
  178. X--- 14,19 ----
  179. X***************
  180. X*** 30,36 ****
  181. X      autoshoot.o    \
  182. X      dosector.o    \
  183. X      relation.o    \
  184. X-     enslave.o    \
  185. X      doturn.o    \
  186. X      doship.o    \
  187. X      zoom.o        \
  188. X--- 23,28 ----
  189. X***************
  190. X*** 85,92 ****
  191. X      makeplanet.o    \
  192. X      shootblast.o    \
  193. X      autoshoot.o    \
  194. X-     moveship.o    \
  195. X-     explore.o    \
  196. X      relation.o    \
  197. X      dosector.o    \
  198. X      declare.o    \
  199. X--- 77,82 ----
  200. X***************
  201. X*** 114,120 ****
  202. X      shootblast.o    \
  203. X      makeplanet.o    \
  204. X      examine.o    \
  205. X-     enslave.o    \
  206. X      launch.o    \
  207. X      build.o        \
  208. X      order.o        \
  209. X--- 104,109 ----
  210. X***************
  211. X*** 190,200 ****
  212. X  ${VOBJS}: vars.h
  213. X  ${SHIPOBJS}: vars.h ships.h
  214. X  ${FOBJS}: files.h
  215. X- ${NOOBJS}: tweakables.h
  216. X  moveship.o : vars.h ships.h shipdata.h
  217. X  doturn.o doplanet.o power.o doship.o files_shl.o makeuniv.o : power.h
  218. X  #sizes : vars.h ships.h races.h
  219. X! #     sizes.c
  220. X  
  221. X  
  222. X  # make data files program
  223. X--- 179,188 ----
  224. X  ${VOBJS}: vars.h
  225. X  ${SHIPOBJS}: vars.h ships.h
  226. X  ${FOBJS}: files.h
  227. X  moveship.o : vars.h ships.h shipdata.h
  228. X  doturn.o doplanet.o power.o doship.o files_shl.o makeuniv.o : power.h
  229. X  #sizes : vars.h ships.h races.h
  230. X! #    cc sizes.c
  231. X  
  232. X  
  233. X  # make data files program
  234. X***************
  235. X*** 205,211 ****
  236. X  # the daemon
  237. X  GB_daemon : ${DOBJS}
  238. X      cc -o GB_daemon ${DOBJS}  -lm
  239. X! doturn.o doship.o doplanet.o moveship.o moveplanet.o : doturn.h
  240. X  
  241. X  # more clone
  242. X  mor : more.c
  243. X--- 193,199 ----
  244. X  # the daemon
  245. X  GB_daemon : ${DOBJS}
  246. X      cc -o GB_daemon ${DOBJS}  -lm
  247. X! doturn.o doship.o doplanet.o : doturn.h
  248. X  
  249. X  # more clone
  250. X  mor : more.c
  251. X***************
  252. X*** 212,218 ****
  253. X      cc -o mor more.c
  254. X  
  255. X  chmod:
  256. X-     cd $(GLIB)
  257. X      chmod ag+xs GB
  258. X      chmod g+rwx Data Data/* Data/Tele/*
  259. X      chmod a+rx Docs Docs/*
  260. X--- 200,205 ----
  261. X***************
  262. X*** 221,227 ****
  263. X  #    chmod ga+rwx Data Data/* Data/Tele/*
  264. X  
  265. X  start:
  266. X-     cd $(GLIB)
  267. X      /bin/rm -f Data/spitup
  268. X      GB_daemon \>\& Data/spitup
  269. X  
  270. X--- 208,213 ----
  271. X***************
  272. X*** 258,271 ****
  273. X  # install the game for public use.
  274. X  install:
  275. X      make
  276. X!         cp GB $(GBIN)
  277. X!         -mkdir $(GLIB)
  278. X!         cp exam.dat enroll.dat $(GLIB)
  279. X!         -mkdir $(GLIB)/Docs
  280. X!         -cp Docs/* $(GLIB)/Docs
  281. X!         -compress $(GLIB)/Docs/* $(GLIB)/enroll.dat
  282. X!         make clear
  283. X      makeuniv < planet.list
  284. X      make chmod
  285. X- 
  286. X  
  287. X--- 244,252 ----
  288. X  # install the game for public use.
  289. X  install:
  290. X      make
  291. X!     mkdir Docs
  292. X!     mv *.doc Docs
  293. X!     compress Docs/* enroll.dat
  294. X      makeuniv < planet.list
  295. X      make chmod
  296. X  
  297. X*** ../../GB2/README    Wed Jul  5 15:14:27 1989
  298. X--- README    Fri Sep 15 08:12:44 1989
  299. X***************
  300. X*** 1,3 ****
  301. X--- 1,8 ----
  302. X+     GB2 is an enhancement/bug fixed version of GB that was
  303. X+ originally written by Robert Chansky at the University of California
  304. X+ at Santa Cruz.  The enhancements and modifications were written by
  305. X+ Garrett Van Cleef at Ohio State University.  The text that
  306. X+ follows is from the original README file.
  307. X  
  308. X      This is a game of interstellar exploration/conquest.  By the time I
  309. X  realized there really wasn't going to be much fighting going on in the game, I
  310. X***************
  311. X*** 34,40 ****
  312. X  a game keeper's satisfaction.
  313. X  
  314. X  
  315. X!     GB can be found via anonymous ftp to the machine ssyx.ucsc.edu
  316. X  (128.114.133.1).  (Look in pub/games).
  317. X  
  318. X  
  319. X--- 39,45 ----
  320. X  a game keeper's satisfaction.
  321. X  
  322. X  
  323. X!     The original GB can be found via anonymous ftp to the machine ssyx.ucsc.edu
  324. X  (128.114.133.1).  (Look in pub/games).
  325. X  
  326. X  
  327. X***************
  328. X*** 128,138 ****
  329. X  but have a longer range.  range is proportional to your tech.  These
  330. X  were put in so people don't have to send ships out blindly.  Once you've
  331. X  surveyed someplace with one of these, you can then map and 'cs' to it.
  332. X-     New ships: orbital mind control lasers, some ground, sea, and air
  333. X- transportation ships (which don't work yet).
  334. X- 
  335. X-     There is now an 'enslave' command.  Check the docs.
  336. X- 
  337. X      tactical works better, it uses planets as part of its display.
  338. X      the bug where sector maps got randomly switched around sometimes
  339. X  halting the game, has been fixed.  This was a MAJOR pain, and the main problem
  340. X--- 133,138 ----
  341. X*** ../../GB2/autoreport.c    Wed Jul  5 15:15:00 1989
  342. X--- autoreport.c    Fri Sep 15 07:27:43 1989
  343. X***************
  344. X*** 1,5 ****
  345. X  
  346. X- 
  347. X  /*
  348. X   * Galactic Bloodshed (Robert Chansky, smq@b)
  349. X   * autoreport.c -- tell server to generate a report for each planet
  350. X--- 1,4 ----
  351. X*** ../../GB2/autoshoot.c    Wed Jul  5 15:15:01 1989
  352. X--- autoshoot.c    Fri Sep 15 07:27:44 1989
  353. X***************
  354. X*** 12,17 ****
  355. X--- 12,18 ----
  356. X  extern char telegram_buf[];
  357. X  extern racetype *races[];
  358. X  
  359. X+ int fire_toshdata;
  360. X  
  361. X  /* ship #shipno bombards planet, then sends telegrams alerting whom it
  362. X   *    may concern.
  363. X***************
  364. X*** 21,26 ****
  365. X--- 22,28 ----
  366. X  planettype *planet;
  367. X  {
  368. X  int x,y,oldown,numdest,found=0;
  369. X+ int i, stren, stren0, stren1, stren2, sh;
  370. X  float dist;
  371. X  char buf[200];
  372. X  bool whocares;
  373. X***************
  374. X*** 47,53 ****
  375. X    if (found) {
  376. X      placetype from,to;
  377. X      int str;
  378. X!     str = MIN(Shipdata[ship->type][ABIL_GUNS], ship->destruct);
  379. X      /* save owner of destroyed sector */
  380. X      if (str) {
  381. X          oldown = Sector(*planet,x,y).owner;
  382. X--- 49,55 ----
  383. X    if (found) {
  384. X      placetype from,to;
  385. X      int str;
  386. X!     str = MIN(Shipdata[ship->type][ABIL_GUNS]*(100-ship->damage)/100., ship->destruct);
  387. X      /* save owner of destroyed sector */
  388. X      if (str) {
  389. X          oldown = Sector(*planet,x,y).owner;
  390. X***************
  391. X*** 86,91 ****
  392. X--- 88,158 ----
  393. X          Shipnames[ship->type], shipno, x, y, numdest);
  394. X          teleg_add(buf,telegram_buf);
  395. X          teleg_send(TELEG_PLAYER_AUTO, oldown, telegram_buf);
  396. X+ 
  397. X+ /* enemy planet retaliates along with defending forces */
  398. X+ 
  399. X+ 
  400. X+     stren = 0;
  401. X+     for(i=1; i<= Numraces(); i++)
  402. X+         if(i!=Playernum && planet->info[i-1].numsectsowned) {
  403. X+             stren0 = 0;
  404. X+             stren1 = 0;
  405. X+             stren2 = 0;
  406. X+     openshdata(&fire_toshdata);
  407. X+         /* go through linked list of ships orbiting the planet */
  408. X+         /* only add ships ordered to defend planet */
  409. X+         sh = planet->ships;
  410. X+ 
  411. X+     while(sh)  {
  412. X+ 
  413. X+         free(to.shipptr);
  414. X+         (void)getship(fire_toshdata, &(to.shipptr), sh);
  415. X+         if(to.shipptr->owner == i && to.shipptr->protect.planet) {
  416. X+ 
  417. X+         stren0 = MIN(to.shipptr->destruct,
  418. X+             Shipdata[to.shipptr->type][ABIL_GUNS]*(100-to.shipptr->damage)/100.);
  419. X+         stren1 += stren0;
  420. X+         to.shipptr->destruct -= stren0;
  421. X+         putship(fire_toshdata, to.shipptr, sh);
  422. X+ 
  423. X+             }
  424. X+         sh = to.shipptr->nextship;
  425. X+         }
  426. X+         close(fire_toshdata);
  427. X+ /* add planet defense strength */
  428. X+ 
  429. X+         stren2 = planet->info[i-1].destruct;
  430. X+         if(stren2 > PLAN_FIRE_LIM)
  431. X+             stren2 = PLAN_FIRE_LIM;
  432. X+         planet->info[i-1].destruct -= stren2;
  433. X+ 
  434. X+         stren += stren1;
  435. X+         stren += stren2;
  436. X+           /* tell the involved players about it.. */
  437. X+ 
  438. X+             
  439. X+ /* execute attack */
  440. X+ 
  441. X+         numdest = shoot(to, &from, planet, (planettype *)NULL, x,y, stren, &dist, 
  442. X+         &whocares,&whocares,&whocares, 0);    /* (0=dont get smap) */
  443. X+ 
  444. X+         teleg_add("",telegram_buf);
  445. X+         sprintf(buf,"REPORT: Ship #%d Bombardment.\n\n",shipno);
  446. X+         teleg_add(buf,telegram_buf);
  447. X+     sprintf(buf,"Defending ships return fire total strength %d \n",stren1);
  448. X+     teleg_add(buf,telegram_buf);
  449. X+     sprintf(buf,"Planet returns fire with strength %d \n",stren2);
  450. X+     teleg_add(buf,telegram_buf);
  451. X+     sprintf(buf,"Total defense strength %d \n",stren);
  452. X+     teleg_add(buf,telegram_buf);
  453. X+     sprintf(buf,"%d percent damage to Ship #%d \n",numdest,shipno);
  454. X+     teleg_add(buf,telegram_buf);
  455. X+ 
  456. X+         teleg_send(TELEG_PLAYER_AUTO, ship->owner, telegram_buf);
  457. X+         teleg_send(TELEG_PLAYER_AUTO, oldown, telegram_buf);
  458. X+ 
  459. X+ 
  460. X+ }
  461. X  
  462. X      } else {
  463. X          /* no weapons! */
  464. X*** ../../GB2/build.c    Wed Jul  5 15:15:03 1989
  465. X--- build.c    Fri Sep 15 07:27:46 1989
  466. X***************
  467. X*** 171,178 ****
  468. X      /* find sector to build on (if planet) */
  469. X  
  470. X       if (Dir.level!=LEVEL_SHIP)
  471. X-     do {
  472. X  
  473. X         if (argn>1)
  474. X          sscanf(args[argn-1], "%d,%d", &x, &y);
  475. X         else
  476. X--- 171,179 ----
  477. X      /* find sector to build on (if planet) */
  478. X  
  479. X       if (Dir.level!=LEVEL_SHIP)
  480. X  
  481. X+ /*    do { */
  482. X+ {
  483. X         if (argn>1)
  484. X          sscanf(args[argn-1], "%d,%d", &x, &y);
  485. X         else
  486. X***************
  487. X*** 183,198 ****
  488. X         opensectdata(&build_sectdata);
  489. X         getsector(build_sectdata, §, planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype) );
  490. X         close(build_sectdata);
  491. X!        if (sect->owner!=Playernum) {
  492. X          printf("You don't own that sector.\n");
  493. X          if (argn>1)
  494. X              build_handler();
  495. X          exit(0);
  496. X         }
  497. X         free(sect);
  498. X  
  499. X-           } while ( sect->owner != Playernum );
  500. X  
  501. X          /* keep people from fucking up the data files */
  502. X      mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
  503. X  
  504. X--- 184,209 ----
  505. X         opensectdata(&build_sectdata);
  506. X         getsector(build_sectdata, §, planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype) );
  507. X         close(build_sectdata);
  508. X!        if (sect->owner!=Playernum && i != OTYPE_REPAIR) {
  509. X          printf("You don't own that sector.\n");
  510. X          if (argn>1)
  511. X              build_handler();
  512. X          exit(0);
  513. X         }
  514. X+        if (sect->owner == 0 && i == OTYPE_REPAIR) 
  515. X+             {
  516. X+              sect->is_wasted = 0;
  517. X+              sect->eff = 10;
  518. X+        opensectdata(&build_sectdata);
  519. X+        putsector(build_sectdata, sect, planet->sectormappos+(y*planet->Maxx+x)*sizeof(sectortype) );
  520. X+        close(build_sectdata);
  521. X+ }
  522. X         free(sect);
  523. X+ }
  524. X+ /*          } while ( sect->owner != Playernum ); */ /* do while taken out by gvc */
  525. X  
  526. X  
  527. X+ 
  528. X          /* keep people from fucking up the data files */
  529. X      mask = sigblock(SIGINT | SIGQUIT | SIGSTOP);
  530. X  
  531. X***************
  532. X*** 209,220 ****
  533. X      }
  534. X  
  535. X      s.speed = 0;
  536. X- /*    s.speed = MAX(2, Shipdata[s.type][ABIL_SPEED]); */
  537. X           /* starting speed default */
  538. X      s.owner = Playernum;
  539. X      s.mass = (float)Shipdata[i][ABIL_MASS];
  540. X      s.fuel = s.destruct = s.resource = 0;
  541. X      s.is_docked = 1;
  542. X      if (Dir.level==LEVEL_SHIP) {
  543. X          s.whatdest = LEVEL_SHIP;
  544. X          s.destshipno = Dir.shipno;
  545. X--- 220,232 ----
  546. X      }
  547. X  
  548. X      s.speed = 0;
  549. X           /* starting speed default */
  550. X      s.owner = Playernum;
  551. X      s.mass = (float)Shipdata[i][ABIL_MASS];
  552. X      s.fuel = s.destruct = s.resource = 0;
  553. X      s.is_docked = 1;
  554. X+     s.is_alive = 1;
  555. X+ 
  556. X      if (Dir.level==LEVEL_SHIP) {
  557. X          s.whatdest = LEVEL_SHIP;
  558. X          s.destshipno = Dir.shipno;
  559. X***************
  560. X*** 229,255 ****
  561. X      s.storbits = Dir.snum;
  562. X      s.pnumorbits = Dir.pnum;
  563. X      s.rad = 0;
  564. X!     if (Shipdata[s.type][ABIL_MAXCREW]==0 || s.type==OTYPE_TRANSDEV)
  565. X!         s.damage = 0;
  566. X!     else
  567. X!         s.damage = 50;
  568. X  
  569. X!     if (has_switch(&s)) {
  570. X          s.on = 0;
  571. X!     }
  572. X      switch (s.type) {
  573. X          case OTYPE_VN:
  574. X!         s.orders.object.number = 1;    /* one of them */
  575. X!         s.orders.object.number2 = 1;    /* we have an assignment */
  576. X          s.on = 1;
  577. X          break;
  578. X          case STYPE_MINE:
  579. X!         s.orders.object.number = 100;    /* trigger radius */
  580. X          printf("Mine disarmed.\nTrigger radius set to 100.\n");
  581. X          break;
  582. X          case OTYPE_TRANSDEV:
  583. X          printf("Receive OFF.  Change with order.\n");
  584. X          break;
  585. X          case OTYPE_AP:
  586. X          printf("Processor OFF.\n");
  587. X          break;
  588. X--- 241,277 ----
  589. X      s.storbits = Dir.snum;
  590. X      s.pnumorbits = Dir.pnum;
  591. X      s.rad = 0;
  592. X!     s.damage = Shipdata[s.type][ABIL_DAMAGE];
  593. X  
  594. X!     s.object.number = 0;
  595. X!     s.object.number2 = 0;
  596. X!     s.object.number3 = 0;
  597. X!     s.object.number4 = 0;
  598. X! 
  599. X!     if (has_switch(&s))
  600. X          s.on = 0;
  601. X!         printf("Ship name: ");
  602. X!         dots(11);
  603. X!         gets(s.name);
  604. X! 
  605. X      switch (s.type) {
  606. X          case OTYPE_VN:
  607. X!         s.object.number = 1;    /* one of them */
  608. X!         s.object.number2 = 1;    /* we have an assignment */
  609. X          s.on = 1;
  610. X          break;
  611. X          case STYPE_MINE:
  612. X!         s.object.number = 100;    /* trigger radius */
  613. X          printf("Mine disarmed.\nTrigger radius set to 100.\n");
  614. X          break;
  615. X          case OTYPE_TRANSDEV:
  616. X          printf("Receive OFF.  Change with order.\n");
  617. X          break;
  618. X+         case OTYPE_REPAIR:
  619. X+             s.damage = 100;
  620. X+             s.is_alive = 0;
  621. X+             s.notified = 0;
  622. X+         break;
  623. X          case OTYPE_AP:
  624. X          printf("Processor OFF.\n");
  625. X          break;
  626. X***************
  627. X*** 258,266 ****
  628. X                  planet->conditions[TOXIC]);
  629. X          if (planet->conditions[TOXIC] > 20) {
  630. X              planet->conditions[TOXIC] -= 20;
  631. X!             s.orders.object.number = 20;
  632. X          } else {
  633. X!             s.orders.object.number = planet->conditions[TOXIC];
  634. X              planet->conditions[TOXIC] = 0;
  635. X          }
  636. X          printf(" now %d.\n",planet->conditions[TOXIC]);
  637. X--- 280,288 ----
  638. X                  planet->conditions[TOXIC]);
  639. X          if (planet->conditions[TOXIC] > 20) {
  640. X              planet->conditions[TOXIC] -= 20;
  641. X!             s.object.number = 20;
  642. X          } else {
  643. X!             s.object.number = planet->conditions[TOXIC];
  644. X              planet->conditions[TOXIC] = 0;
  645. X          }
  646. X          printf(" now %d.\n",planet->conditions[TOXIC]);
  647. X***************
  648. X*** 284,295 ****
  649. X  
  650. X          /* check for dead ships in the data files */
  651. X  
  652. X-     if (Dir.level==LEVEL_SHIP)
  653. X-         Locks(1);
  654. X-     else
  655. X-         openshdata(&build_shdata);
  656. X  
  657. X!     if ( (shipno = getdeadship(build_shdata)) == -1) {
  658. X              /* otherwise recycle topmost dead ship in data file. */
  659. X              /* no dead ships to recycle */
  660. X          shipno = Numships(build_shdata) + 1;
  661. X--- 306,315 ----
  662. X  
  663. X          /* check for dead ships in the data files */
  664. X  
  665. X  
  666. X!         openshdata(&build_shdata);
  667. X!     while( (shipno = getdeadship(build_shdata)) == 0){ };
  668. X!     if ( shipno == -1) {
  669. X              /* otherwise recycle topmost dead ship in data file. */
  670. X              /* no dead ships to recycle */
  671. X          shipno = Numships(build_shdata) + 1;
  672. X***************
  673. X*** 322,328 ****
  674. X      putship(build_shdata,&s,shipno);
  675. X      close(build_shdata);
  676. X  
  677. X-     Locks(0);
  678. X      if (Dir.level==LEVEL_SHIP && dirship->whatorbits==LEVEL_UNIV)
  679. X          deductAPs(APcount, 0, 1);
  680. X      else
  681. X--- 342,347 ----
  682. X*** ../../GB2/daemon.c    Wed Jul  5 15:15:05 1989
  683. X--- daemon.c    Fri Sep 15 07:27:47 1989
  684. X***************
  685. X*** 17,23 ****
  686. X  {
  687. X   struct tm *t;
  688. X   long clk;
  689. X!  int turn=0,update=0,fd2;
  690. X   FILE *fd;
  691. X  
  692. X   if (fork()) exit();        /* detach from shell */
  693. X--- 17,23 ----
  694. X  {
  695. X   struct tm *t;
  696. X   long clk;
  697. X!  int turn=0,update=0,fd2,first;
  698. X   FILE *fd;
  699. X  
  700. X   if (fork()) exit();        /* detach from shell */
  701. X***************
  702. X*** 28,33 ****
  703. X--- 28,34 ----
  704. X    fd2 = open("/dev/tty", O_RDWR);    /* disassociate from tty */
  705. X    ioctl(fd2, TIOCNOTTY, 0);
  706. X    close(fd2);
  707. X+     first=1;
  708. X  
  709. X   while (1) {
  710. X  
  711. X***************
  712. X*** 37,43 ****
  713. X     printf("day %d,hour %d,min %d,sec %d\n",
  714. X          t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
  715. X  
  716. X!    if ( (t->tm_hour % UPDATE_TIME)==0 && update!=t->tm_hour) {
  717. X         update = t->tm_hour;
  718. X      doturn(0);    /* not from shell */
  719. X      fd = fopen(PROFDATAFL, "a");
  720. X--- 38,45 ----
  721. X     printf("day %d,hour %d,min %d,sec %d\n",
  722. X          t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec);
  723. X  
  724. X!    if ( (t->tm_hour % UPDATE_TIME)==0 && update!=t->tm_hour || first) {
  725. X!     first = 0;
  726. X         update = t->tm_hour;
  727. X      doturn(0);    /* not from shell */
  728. X      fd = fopen(PROFDATAFL, "a");
  729. X*** ../../GB2/doplanet.c    Wed Jul  5 15:15:08 1989
  730. X--- doplanet.c    Fri Sep 15 07:27:51 1989
  731. X***************
  732. X*** 1,5 ****
  733. X  /*
  734. X!  * Galactic Bloodshed (Robert Chansky, smq@b)
  735. X   *  doplanet.c -- do one turn on a planet.
  736. X   */ 
  737. X  
  738. X--- 1,5 ----
  739. X  /*
  740. X!  * galactic Bloodshed (Robert Chansky, smq@b)
  741. X   *  doplanet.c -- do one turn on a planet.
  742. X   */ 
  743. X  
  744. X***************
  745. X*** 70,80 ****
  746. X  {
  747. X  int shipno,x,y,nukex,nukey;
  748. X  int o=0,j;
  749. X  char *nukem;
  750. X  reg int i;
  751. X  sectortype *p;
  752. X  shiptype *ship;
  753. X! float madd,fadd;
  754. X  int sectdata,timer=20;
  755. X  int oldplanetpopn, oldplanetmaxpopn;
  756. X  bool allamoeba=1,allmod=0,allexp=0;
  757. X--- 70,81 ----
  758. X  {
  759. X  int shipno,x,y,nukex,nukey;
  760. X  int o=0,j;
  761. X+ int aliensects,stolenres,stolendes;
  762. X  char *nukem;
  763. X  reg int i;
  764. X  sectortype *p;
  765. X  shiptype *ship;
  766. X! float madd,fadd,stolenfuel;
  767. X  int sectdata,timer=20;
  768. X  int oldplanetpopn, oldplanetmaxpopn;
  769. X  bool allamoeba=1,allmod=0,allexp=0;
  770. X***************
  771. X*** 99,105 ****
  772. X  
  773. X    shipno = planet->ships;
  774. X    while (shipno) {
  775. X!     if ( ((ship = ships[shipno])!=NULL) && !ship->is_dead && !ship->rad) {
  776. X         if ( !(ship->is_docked && ship->whatdest==LEVEL_PLAN)) {
  777. X           /* add fuel to ships orbiting gas giants */
  778. X          if (planet->type == TYPE_GASGIANT && !is_object(ship)) {
  779. X--- 100,106 ----
  780. X  
  781. X    shipno = planet->ships;
  782. X    while (shipno) {
  783. X!     if ( ((ship = ships[shipno])!=NULL) && ship->is_alive && !ship->rad) {
  784. X         if ( !(ship->is_docked && ship->whatdest==LEVEL_PLAN)) {
  785. X           /* add fuel to ships orbiting gas giants */
  786. X          if (planet->type == TYPE_GASGIANT && !is_object(ship)) {
  787. X***************
  788. X*** 126,138 ****
  789. X          if (ship->type == OTYPE_VN) {
  790. X              /* Von Neumann machine */
  791. X           if (ship->is_docked && ship->whatdest==LEVEL_PLAN) {
  792. X!         if (ship->orders.object.number2) {
  793. X              /* we are currently trying to construct another
  794. X                 machine */
  795. X            reg int x,y,a,dum;
  796. X               /* spread VN's all over the planet */
  797. X!           for (i=1; i<253 && i<=ship->orders.object.number; i++) {
  798. X!             a = round_rand(sqrt((double)ship->orders.object.number));
  799. X              x = mod(int_rand((int)(ship->xpos-a),(int)(ship->xpos+a)),(int)planet->xpos,dum);
  800. X              y = mod(int_rand((int)(ship->ypos-a),(int)(ship->ypos+a)),(int)planet->ypos,dum);
  801. X  
  802. X--- 127,139 ----
  803. X          if (ship->type == OTYPE_VN) {
  804. X              /* Von Neumann machine */
  805. X           if (ship->is_docked && ship->whatdest==LEVEL_PLAN) {
  806. X!         if (ship->object.number2) {
  807. X              /* we are currently trying to construct another
  808. X                 machine */
  809. X            reg int x,y,a,dum;
  810. X               /* spread VN's all over the planet */
  811. X!           for (i=1; i<253 && i<=ship->object.number; i++) {
  812. X!             a = round_rand(sqrt((double)ship->object.number));
  813. X              x = mod(int_rand((int)(ship->xpos-a),(int)(ship->xpos+a)),(int)planet->xpos,dum);
  814. X              y = mod(int_rand((int)(ship->ypos-a),(int)(ship->ypos+a)),(int)planet->ypos,dum);
  815. X  
  816. X***************
  817. X*** 142,148 ****
  818. X            if (ship->resource >= Shipdata[OTYPE_VN][ABIL_COST]) {
  819. X             ship->resource -= Shipdata[OTYPE_VN][ABIL_COST];
  820. X             ship->mass -= Shipdata[OTYPE_VN][ABIL_COST]*MASS_RESOURCE;
  821. X!            if (ship->orders.object.number > int_rand(3,50)) {
  822. X              /* enough to start a new VN 'herd'. build another
  823. X                 ship. */
  824. X                    shiptype *s2;
  825. X--- 143,149 ----
  826. X            if (ship->resource >= Shipdata[OTYPE_VN][ABIL_COST]) {
  827. X             ship->resource -= Shipdata[OTYPE_VN][ABIL_COST];
  828. X             ship->mass -= Shipdata[OTYPE_VN][ABIL_COST]*MASS_RESOURCE;
  829. X!            if (ship->object.number > int_rand(3,50)) {
  830. X              /* enough to start a new VN 'herd'. build another
  831. X                 ship. */
  832. X                    shiptype *s2;
  833. X***************
  834. X*** 169,184 ****
  835. X              s2->type = OTYPE_VN;
  836. X              s2->mass = Shipdata[OTYPE_VN][ABIL_MASS];
  837. X              s2->owner = (random()&01) ? ship->owner : 1;
  838. X!             s2->orders.object.number = 1;
  839. X                  /* is not building any VN's */
  840. X                  /* no assignment now */
  841. X!             ship->orders.object.number2 = 0;
  842. X                  /* turn it on */
  843. X              s2->on = 1;
  844. X           } else {
  845. X              /* we don't have too many in this herd, so make 
  846. X                 some more */
  847. X!             ship->orders.object.number++;
  848. X           }
  849. X          } else {
  850. X              /* try and make some resources by ourselves.
  851. X--- 170,185 ----
  852. X              s2->type = OTYPE_VN;
  853. X              s2->mass = Shipdata[OTYPE_VN][ABIL_MASS];
  854. X              s2->owner = (random()&01) ? ship->owner : 1;
  855. X!             s2->object.number = 1;
  856. X                  /* is not building any VN's */
  857. X                  /* no assignment now */
  858. X!             ship->object.number2 = 0;
  859. X                  /* turn it on */
  860. X              s2->on = 1;
  861. X           } else {
  862. X              /* we don't have too many in this herd, so make 
  863. X                 some more */
  864. X!             ship->object.number++;
  865. X           }
  866. X          } else {
  867. X              /* try and make some resources by ourselves.
  868. X***************
  869. X*** 191,203 ****
  870. X             in doship */
  871. X             }
  872. X            } else {    /* orbiting a planet */
  873. X!         if (ship->orders.object.number2) {
  874. X           if (ship->whatdest==LEVEL_PLAN && ship->deststar==starnum && 
  875. X              ship->destpnum==planetnum) {
  876. X                  /* we just arrived from somewhere */
  877. X              if (planet->type==TYPE_GASGIANT) {
  878. X                if (ship->fuel >= Shipdata[OTYPE_VN][ABIL_FUELCAP])
  879. X!             ship->orders.object.number2 = 0;
  880. X                  /* gas giants are of no use to us;
  881. X                     doship() will head us somewhere else */
  882. X              } else {
  883. X--- 192,204 ----
  884. X             in doship */
  885. X             }
  886. X            } else {    /* orbiting a planet */
  887. X!         if (ship->object.number2) {
  888. X           if (ship->whatdest==LEVEL_PLAN && ship->deststar==starnum && 
  889. X              ship->destpnum==planetnum) {
  890. X                  /* we just arrived from somewhere */
  891. X              if (planet->type==TYPE_GASGIANT) {
  892. X                if (ship->fuel >= Shipdata[OTYPE_VN][ABIL_FUELCAP])
  893. X!             ship->object.number2 = 0;
  894. X                  /* gas giants are of no use to us;
  895. X                     doship() will head us somewhere else */
  896. X              } else {
  897. X***************
  898. X*** 206,213 ****
  899. X              printf(" VN finding a place to land\n");
  900. X              Getxysect(planet,&x,&y,1);
  901. X              while ((d=Getxysect(planet,&x,&y,0)) && 
  902. X!                     Sector(*planet,x,y).resource==0)
  903. X                       ;
  904. X              if (d) {
  905. X                  printf(" VN landed.\n");
  906. X                  ship->is_docked = 1;
  907. X--- 207,215 ----
  908. X              printf(" VN finding a place to land\n");
  909. X              Getxysect(planet,&x,&y,1);
  910. X              while ((d=Getxysect(planet,&x,&y,0)) && 
  911. X!                     Sector(*planet,x,y).resource == 0)
  912. X                       ;
  913. X+ 
  914. X              if (d) {
  915. X                  printf(" VN landed.\n");
  916. X                  ship->is_docked = 1;
  917. X***************
  918. X*** 218,229 ****
  919. X  
  920. X                  ship->xpos = x;
  921. X                  ship->ypos = y;
  922. X!                 ship->orders.object.number2 = 1;
  923. X                  /* number2 means we are currently
  924. X                     busy here */
  925. X              } else {
  926. X                   /* head somewhere else */
  927. X!                 ship->orders.object.number2 = 0;
  928. X                  printf("turning off; can't find place 2land\n");
  929. X              }
  930. X              }
  931. X--- 220,231 ----
  932. X  
  933. X                  ship->xpos = x;
  934. X                  ship->ypos = y;
  935. X!                 ship->object.number2 = 1;
  936. X                  /* number2 means we are currently
  937. X                     busy here */
  938. X              } else {
  939. X                   /* head somewhere else */
  940. X!                 ship->object.number2 = 0;
  941. X                  printf("turning off; can't find place 2land\n");
  942. X              }
  943. X              }
  944. X***************
  945. X*** 242,248 ****
  946. X         }
  947. X  
  948. X              /* bombard the planet */
  949. X!        if (can_bombard(ship) && ship->orders.o.bombard
  950. X              && ship->whatorbits==LEVEL_PLAN
  951. X              && ship->whatdest==LEVEL_PLAN
  952. X              && ship->deststar==starnum
  953. X--- 244,250 ----
  954. X         }
  955. X  
  956. X              /* bombard the planet */
  957. X!        if (can_bombard(ship) && ship->bombard
  958. X              && ship->whatorbits==LEVEL_PLAN
  959. X              && ship->whatdest==LEVEL_PLAN
  960. X              && ship->deststar==starnum
  961. X***************
  962. X*** 281,286 ****
  963. X--- 283,289 ----
  964. X      x = int_rand(0,planet->Maxx-1);
  965. X      y = int_rand(0,planet->Maxy-1);
  966. X      planet->info[Stinfo[starnum][planetnum].Thing_add-1].numsectsowned = 1;
  967. X+ 
  968. X      planet->info[Stinfo[starnum][planetnum].Thing_add-1].explored = 1;
  969. X      Sector(*planet,x,y).des = 
  970. X              races[Stinfo[starnum][planetnum].Thing_add]->likesbest;
  971. X***************
  972. X*** 320,326 ****
  973. X  
  974. X  /* gvc hack */
  975. X      if (planet->info[i-1].numsectsowned) {
  976. X-     printf("numsects %d %d \n",i,planet->info[i-1].numsectsowned);
  977. X          Compat[i] = compatibility(planet, races[i]);
  978. X          planet->info[i-1].numsectsowned = 0;
  979. X      }
  980. X--- 323,328 ----
  981. X***************
  982. X*** 327,334 ****
  983. X--- 329,338 ----
  984. X  
  985. X  
  986. X  printf(" while %d\n",Getxysect(planet, &x, &y, 1));    /* reset */
  987. X+ 
  988. X  while (Getxysect(planet, &x, &y, 0)) {
  989. X         p = &Sector(*planet,x,y);
  990. X+ 
  991. X         if (p->amoeba) {
  992. X          planet->info[1-1].numsectsowned++;
  993. X          allamoeba &= 1;
  994. X***************
  995. X*** 420,429 ****
  996. X         for (i=1; !Claims && !allexp && i<=Num_races; i++) {
  997. X           printf("pl %d numsects %d compat %f\n",i,planet->info[i-1].numsectsowned,Compat[i]);
  998. X           /* sectors have been modified for this player*/
  999. X!          /* & planet is compatible enough */
  1000. X!          if (planet->info[i-1].numsectsowned && Compat[i] > 40.0)
  1001. X!           while (!Claims && !allexp && --timer) {
  1002. X!          printf("exploring ... timer=%d\n",timer);
  1003. X          o = 1;
  1004. X          Getxysect(planet, &x, &y, 1);
  1005. X          while (!Claims && Getxysect(planet, &x, &y, 0)) {
  1006. X--- 424,433 ----
  1007. X         for (i=1; !Claims && !allexp && i<=Num_races; i++) {
  1008. X           printf("pl %d numsects %d compat %f\n",i,planet->info[i-1].numsectsowned,Compat[i]);
  1009. X           /* sectors have been modified for this player*/
  1010. X! 
  1011. X!          if (planet->info[i-1].numsectsowned)
  1012. X!           while (!Claims && !allexp && timer>0) {
  1013. X!         timer -= 1;
  1014. X          o = 1;
  1015. X          Getxysect(planet, &x, &y, 1);
  1016. X          while (!Claims && Getxysect(planet, &x, &y, 0)) {
  1017. X***************
  1018. X*** 433,439 ****
  1019. X              if (( (Sectinfo[x][y].explored==i) && !(random()&02) ) 
  1020. X                  && (!p->owner && !p->is_wasted && !p->amoeba && p->des==races[i]->likesbest) ) {
  1021. X                   /*  explorations have found an island */
  1022. X-             printf(" got here 2\n");
  1023. X                  printf("found island @ %d,%d\n",x,y);
  1024. X                  Claims = i;
  1025. X                   /* give them some free people there */
  1026. X--- 437,442 ----
  1027. X***************
  1028. X*** 440,447 ****
  1029. X                  p->popn = races[i]->number_sexes;
  1030. X                  p->owner = i;
  1031. X                  tot_captured = 1;
  1032. X!             } else
  1033. X                  explore(planet, p, x, y, i);
  1034. X          }
  1035. X          allexp |= o;    /* all sectors explored for this player */
  1036. X  
  1037. X--- 443,452 ----
  1038. X                  p->popn = races[i]->number_sexes;
  1039. X                  p->owner = i;
  1040. X                  tot_captured = 1;
  1041. X!             } else {
  1042. X! 
  1043. X                  explore(planet, p, x, y, i);
  1044. X+                 }
  1045. X          }
  1046. X          allexp |= o;    /* all sectors explored for this player */
  1047. X  
  1048. X***************
  1049. X*** 542,547 ****
  1050. X--- 547,591 ----
  1051. X  
  1052. X  
  1053. X     for (i=1; i<=Num_races; i++) {
  1054. X+ 
  1055. X+ /* check to see if your guys steal all alien resources on the planet,
  1056. X+     this requires that you be the only one inhabiting the planet */
  1057. X+     if(planet->info[i-1].numsectsowned > 0){
  1058. X+ 
  1059. X+         aliensects = 0;
  1060. X+         stolenres =0;
  1061. X+         stolendes =0;
  1062. X+         stolenfuel = 0.0;
  1063. X+         for (j=1; j<=Num_races; j++)
  1064. X+             if(j!=i){
  1065. X+             aliensects += planet->info[j-1].numsectsowned;
  1066. X+             stolenres += planet->info[j-1].resource;
  1067. X+             stolendes += planet->info[j-1].destruct;
  1068. X+             stolenfuel += planet->info[j-1].fuel;
  1069. X+             }
  1070. X+ 
  1071. X+         if(aliensects ==0 && (stolenres !=0 || stolendes !=0 || stolenfuel != 0.0) ) {
  1072. X+         for (j=1; j<=Num_races; j++)
  1073. X+             if(j!=i)
  1074. X+             {
  1075. X+         planet->info[j-1].resource = 0;
  1076. X+         planet->info[j-1].destruct = 0;
  1077. X+         planet->info[j-1].fuel = 0.0;
  1078. X+             }
  1079. X+         planet->info[i-1].resource += stolenres;
  1080. X+         planet->info[i-1].destruct += stolendes;
  1081. X+         planet->info[i-1].fuel += stolenfuel;
  1082. X+ /* notify player of recovered stockpiles */
  1083. X+       teleg_add("",telegram_buf);    /* clear buf */
  1084. X+       sprintf(buf,"****** Report: Planet /%s/%s ******\n\n", 
  1085. X+         Stars[starnum]->name, Stars[starnum]->pnames[planetnum] );
  1086. X+       teleg_add(buf,telegram_buf);
  1087. X+       sprintf(buf," %d resources \n %d destruct \n %4.2f fuel recovered from alien stock piles",stolenres,stolendes,stolenfuel);
  1088. X+       teleg_add(buf,telegram_buf);
  1089. X+       teleg_send(TELEG_PLAYER_AUTO, i, telegram_buf);
  1090. X+         }
  1091. X+             }
  1092. X+ 
  1093. X      Power[i].resource += planet->info[i-1].resource;
  1094. X      Power[i].destruct += planet->info[i-1].destruct;
  1095. X      Power[i].fuel += planet->info[i-1].fuel;
  1096. X***************
  1097. X*** 557,564 ****
  1098. X     }
  1099. X  
  1100. X      if(planet->maxpopn > 0)
  1101. X!    planet->conditions[TOXIC] = planet->conditions[TOXIC] + 
  1102. X               planet->popn / planet->maxpopn;
  1103. X  
  1104. X      /* deal with enslaved planets */
  1105. X     if (planet->slaved_to) {
  1106. X--- 601,609 ----
  1107. X     }
  1108. X  
  1109. X      if(planet->maxpopn > 0)
  1110. X!        planet->conditions[TOXIC] = planet->conditions[TOXIC] + 
  1111. X               planet->popn / planet->maxpopn;
  1112. X+ 
  1113. X  
  1114. X      /* deal with enslaved planets */
  1115. X     if (planet->slaved_to) {
  1116. X*** ../../GB2/dosector.c    Wed Jul  5 15:15:09 1989
  1117. X--- dosector.c    Fri Sep 15 07:27:52 1989
  1118. X***************
  1119. X*** 19,46 ****
  1120. X  reg planettype *planet;
  1121. X  reg sectortype *s;
  1122. X  {
  1123. X  reg float factor;
  1124. X  reg int eff;
  1125. X  reg struct plinfo *pinf;
  1126. X  reg int new;
  1127. X  
  1128. X  
  1129. X-      factor = logscale(s->popn) * s->resource * races[s->owner]->metabolism;
  1130. X- 
  1131. X       pinf = &planet->info[s->owner-1];
  1132. X  
  1133. X-      prod_fuel[s->owner] = round_rand( s->eff * factor * FUEL_PRODUCTION
  1134. X-           * ((planet->type==TYPE_GASGIANT)* 4+1) );
  1135. X  
  1136. X!      prod_res[s->owner] = round_rand( s->eff * factor * RESOURCE_PRODUCTION 
  1137. X!           * ((planet->type==TYPE_ASTEROID) * 1 + 1) * (100 - s->mobilization)/100.);
  1138. X  
  1139. X!      prod_destruct[s->owner] = round_rand( s->eff * factor * DEST_PRODUCTION
  1140. X!           * ((planet->type==TYPE_ASTEROID) * 1 + 1) * s->mobilization /100.);
  1141. X  
  1142. X  
  1143. X-          /* deplete resources for making weapons - removed by gvc*/
  1144. X-      tot_resdep = 0;
  1145. X  
  1146. X          /* increase mobilization to planetary quota */
  1147. X       if (s->mobilization < pinf->mob_set)
  1148. X--- 19,46 ----
  1149. X  reg planettype *planet;
  1150. X  reg sectortype *s;
  1151. X  {
  1152. X+ 
  1153. X+ int fac,ss;
  1154. X+ 
  1155. X  reg float factor;
  1156. X  reg int eff;
  1157. X  reg struct plinfo *pinf;
  1158. X  reg int new;
  1159. X  
  1160. X+      factor = .01 * log1p(1.*s->eff) * log1p(1.*s->popn) * s->resource * races[s->owner]->metabolism * ((s->des==DES_GAS)*4+1);
  1161. X  
  1162. X       pinf = &planet->info[s->owner-1];
  1163. X  
  1164. X  
  1165. X!      prod_fuel[s->owner] = round_rand( factor * FUEL_PRODUCTION
  1166. X!         * 100 * ((s->des==DES_GAS)*3+1) );
  1167. X  
  1168. X!      prod_res[s->owner] = round_rand( factor * RESOURCE_PRODUCTION 
  1169. X!             * (100 - s->mobilization) );
  1170. X  
  1171. X+      prod_destruct[s->owner] = round_rand( factor * DEST_PRODUCTION
  1172. X+             * s->mobilization );
  1173. X  
  1174. X  
  1175. X          /* increase mobilization to planetary quota */
  1176. X       if (s->mobilization < pinf->mob_set)
  1177. X***************
  1178. X*** 50,55 ****
  1179. X--- 50,62 ----
  1180. X              prod_mob++;
  1181. X           }
  1182. X  
  1183. X+         /* decrease mobilization to planetary quota */
  1184. X+      if (s->mobilization > pinf->mob_set)
  1185. X+         if (pinf->resource + prod_res[s->owner] > 0) {
  1186. X+             s->mobilization--;
  1187. X+             prod_res[s->owner] -= round_rand(MOB_COST);
  1188. X+             prod_mob++;
  1189. X+          }
  1190. X  
  1191. X  
  1192. X        /* add mobilization to get average mobilization */
  1193. X***************
  1194. X*** 62,68 ****
  1195. X          prod_eff += s->eff = 1;
  1196. X         } else {
  1197. X           prod_eff += 
  1198. X!         (eff = round_rand(races[s->owner]->metabolism*s->popn*EFF_PROD/100.0));
  1199. X          if (s->eff+eff >= 100) {
  1200. X              s->eff=100;    /* dont go past 100%*/
  1201. X              prod_eff -= s->eff+eff-100;
  1202. X--- 69,75 ----
  1203. X          prod_eff += s->eff = 1;
  1204. X         } else {
  1205. X           prod_eff += 
  1206. X!         (eff = round_rand(races[s->owner]->metabolism*5*log1p(1.*s->popn)*EFF_PROD/100.0));
  1207. X          if (s->eff+eff >= 100) {
  1208. X              s->eff=100;    /* dont go past 100%*/
  1209. X              prod_eff -= s->eff+eff-100;
  1210. X***************
  1211. X*** 72,85 ****
  1212. X         }
  1213. X      }
  1214. X  
  1215. X!       /* add population to sector */
  1216. X!      if (s->popn >= races[s->owner]->number_sexes)
  1217. X!            s->popn += round_rand((float)s->popn * races[s->owner]->birthrate
  1218. X!             * Compat[s->owner] / 100.0 
  1219. X!             * (50.0 - planet->conditions[TOXIC]) / 50.0 );
  1220. X       else
  1221. X          s->popn = round_rand(s->popn * .099);
  1222. X! 
  1223. X  }
  1224. X  
  1225. X  
  1226. X--- 79,101 ----
  1227. X         }
  1228. X      }
  1229. X  
  1230. X!      if (s->popn >= races[s->owner]->number_sexes) {
  1231. X!     fac =round_rand( .01 * (100. - planet->conditions[TOXIC])
  1232. X!         * maxsupport(races[s->owner],s,Compat[s->owner]) );
  1233. X! 
  1234. X!     ss = round_rand(
  1235. X!         races[s->owner]->birthrate * (1.*fac - 1.*s->popn) );
  1236. X! 
  1237. X!      s->popn = MAX(0, s->popn + ss);
  1238. X! 
  1239. X!     if(s->popn == 0) s->owner=0;
  1240. X! 
  1241. X!             }
  1242. X       else
  1243. X+         {
  1244. X          s->popn = round_rand(s->popn * .099);
  1245. X!         if(s->popn = 0)s->owner=0;
  1246. X!         }
  1247. X  }
  1248. X  
  1249. X  
  1250. X***************
  1251. X*** 101,113 ****
  1252. X  reg sectortype *s;
  1253. X  reg int x,y;
  1254. X  {
  1255. X! reg int peep;
  1256. X  
  1257. X  if (pl->is_sheep)
  1258. X      return;        /* no one wants to go anywhere */
  1259. X  
  1260. X     /* peep == number of people who want to move */
  1261. X! if (s->amoeba || (peep = round_rand((float)s->popn * races[s->owner]->nonhomebodies)) ) {
  1262. X   if (pl->type==TYPE_GASGIANT && s->des==DES_GAS && !int_rand(0,20)) {
  1263. X       /* random 'wind' sweeps people in this sector, somewhere else */
  1264. X        reg int x2,y2;
  1265. X--- 117,132 ----
  1266. X  reg sectortype *s;
  1267. X  reg int x,y;
  1268. X  {
  1269. X! int peep;
  1270. X  
  1271. X  if (pl->is_sheep)
  1272. X      return;        /* no one wants to go anywhere */
  1273. X  
  1274. X     /* peep == number of people who want to move */
  1275. X! 
  1276. X!     peep = round_rand((float)s->popn * races[s->owner]->nonhomebodies);
  1277. X! 
  1278. X! if (s->amoeba || peep) { 
  1279. X   if (pl->type==TYPE_GASGIANT && s->des==DES_GAS && !int_rand(0,20)) {
  1280. X       /* random 'wind' sweeps people in this sector, somewhere else */
  1281. X        reg int x2,y2;
  1282. X***************
  1283. X*** 257,263 ****
  1284. X  
  1285. X      /* explore sectors surrounding sectors currently explored. */
  1286. X   if (Sectinfo[x][y].explored) {
  1287. X- 
  1288. X      Sectinfo[mod(x-1,planet->Maxx,d)][y].explored = p;
  1289. X      Sectinfo[mod(x+1,planet->Maxx,d)][y].explored = p;
  1290. X      if (y==0) {
  1291. X--- 276,281 ----
  1292. X*** ../../GB2/doship.c    Wed Jul  5 15:15:11 1989
  1293. X--- doship.c    Fri Sep 15 07:27:54 1989
  1294. X***************
  1295. X*** 20,40 ****
  1296. X   int sh,sh2,j,shfdata;
  1297. X   char buf[300];
  1298. X  
  1299. X-  if (!ship->is_dead && (ship->owner == 0 && ship->type != OTYPE_VN
  1300. X-         && ship->type != OTYPE_AMOEBA) )
  1301. X- /* a hack by gvc to get rid of owner 0, space pod which occasionally
  1302. X- gets created for unknown reason (and consequentially causes problems) */
  1303. X-     {
  1304. X-     ship->is_dead = 1;
  1305. X-     ship->owner = 1;
  1306. X  
  1307. X! } /* used to counteract bugs */
  1308. X  
  1309. X-  if (!ship->is_dead) {
  1310. X- 
  1311. X          /* add ships, popn to total count to add AP's */
  1312. X      if (ship->type==OTYPE_VN)
  1313. X!         Power[ship->owner].ships_owned += ship->orders.object.number;
  1314. X      else
  1315. X          Power[ship->owner].ships_owned++;
  1316. X      Power[ship->owner].resource += ship->resource;
  1317. X--- 20,31 ----
  1318. X   int sh,sh2,j,shfdata;
  1319. X   char buf[300];
  1320. X  
  1321. X  
  1322. X!  if (ship->is_alive) {
  1323. X  
  1324. X          /* add ships, popn to total count to add AP's */
  1325. X      if (ship->type==OTYPE_VN)
  1326. X!         Power[ship->owner].ships_owned += ship->object.number;
  1327. X      else
  1328. X          Power[ship->owner].ships_owned++;
  1329. X      Power[ship->owner].resource += ship->resource;
  1330. X***************
  1331. X*** 46,52 ****
  1332. X           Sdatapopns[ship->owner] += ship->popn;
  1333. X      } else {
  1334. X          starnumships[ship->storbits][ship->owner] += 
  1335. X!             (ship->type==OTYPE_VN) ? ship->orders.object.number : 1;
  1336. X               /* add popn of ships to popn */
  1337. X              starpopns[ship->storbits][ship->owner] += ship->popn;
  1338. X           /* set inhabited for ship */
  1339. X--- 37,43 ----
  1340. X           Sdatapopns[ship->owner] += ship->popn;
  1341. X      } else {
  1342. X          starnumships[ship->storbits][ship->owner] += 
  1343. X!             (ship->type==OTYPE_VN) ? ship->object.number : 1;
  1344. X               /* add popn of ships to popn */
  1345. X              starpopns[ship->storbits][ship->owner] += ship->popn;
  1346. X           /* set inhabited for ship */
  1347. X***************
  1348. X*** 55,71 ****
  1349. X  
  1350. X          /* repair radiation */
  1351. X        if (ship->rad) {
  1352. X              /* kill off some people */
  1353. X!         ship->popn = round_rand(ship->popn * .90);
  1354. X          if (ship->rad > REPAIR_RATE)
  1355. X              ship->rad -= REPAIR_RATE;
  1356. X          else
  1357. X              ship->rad = 0;
  1358. X        } else {
  1359. X!         /* irradiated ships are immobile.. */
  1360. X! 
  1361. X          /* make sure of an update if someones bombarding the planet */
  1362. X!     if (can_bombard(ship) && ship->orders.o.bombard &&
  1363. X              ship->whatorbits==LEVEL_PLAN)
  1364. X          Stinfo[ship->storbits][ship->pnumorbits].inhab = 1;
  1365. X  
  1366. X--- 46,62 ----
  1367. X  
  1368. X          /* repair radiation */
  1369. X        if (ship->rad) {
  1370. X+             /* irradiated ships are immobile.. */
  1371. X              /* kill off some people */
  1372. X!         ship->popn = round_rand(ship->popn * .80);
  1373. X          if (ship->rad > REPAIR_RATE)
  1374. X              ship->rad -= REPAIR_RATE;
  1375. X          else
  1376. X              ship->rad = 0;
  1377. X        } else {
  1378. X!         
  1379. X          /* make sure of an update if someones bombarding the planet */
  1380. X!     if (can_bombard(ship) && ship->bombard &&
  1381. X              ship->whatorbits==LEVEL_PLAN)
  1382. X          Stinfo[ship->storbits][ship->pnumorbits].inhab = 1;
  1383. X  
  1384. X***************
  1385. X*** 85,91 ****
  1386. X  
  1387. X        case OTYPE_CANIST:
  1388. X         if (ship->whatorbits == LEVEL_PLAN && !ship->is_docked) { short *t;
  1389. X!           if (--ship->orders.object.number) {
  1390. X            t = &Stinfo[ship->storbits][ship->pnumorbits].temp_add;
  1391. X            if (*t - 10 < -120)
  1392. X              *t = -120;
  1393. X--- 76,82 ----
  1394. X  
  1395. X        case OTYPE_CANIST:
  1396. X         if (ship->whatorbits == LEVEL_PLAN && !ship->is_docked) { short *t;
  1397. X!           if (--ship->object.number) {
  1398. X            t = &Stinfo[ship->storbits][ship->pnumorbits].temp_add;
  1399. X            if (*t - 10 < -120)
  1400. X              *t = -120;
  1401. X***************
  1402. X*** 110,116 ****
  1403. X        case STYPE_MINE:
  1404. X          /* check around and see if we should explode. */
  1405. X         if (ship->on) {
  1406. X!         int rad=0; float xd,yd; int p;
  1407. X           if (ship->whatorbits==LEVEL_STAR)
  1408. X               sh = Stars[ship->storbits]->ships;
  1409. X           else if (ship->whatorbits==LEVEL_PLAN)
  1410. X--- 101,107 ----
  1411. X        case STYPE_MINE:
  1412. X          /* check around and see if we should explode. */
  1413. X         if (ship->on) {
  1414. X!         int rad=0; int dam=0; float xd,yd; int p;
  1415. X           if (ship->whatorbits==LEVEL_STAR)
  1416. X               sh = Stars[ship->storbits]->ships;
  1417. X           else if (ship->whatorbits==LEVEL_PLAN)
  1418. X***************
  1419. X*** 125,131 ****
  1420. X          yd = ships[sh]->ypos - ship->ypos;
  1421. X          if ( (ships[sh]->type != STYPE_MINE) &&
  1422. X              (ships[sh]->owner != Playernum) && 
  1423. X!             ( xd*xd+yd*yd < ship->orders.object.number * ship->orders.object.number) )
  1424. X              rad = 1;
  1425. X          sh = ships[sh]->nextship;
  1426. X           }
  1427. X--- 116,122 ----
  1428. X          yd = ships[sh]->ypos - ship->ypos;
  1429. X          if ( (ships[sh]->type != STYPE_MINE) &&
  1430. X              (ships[sh]->owner != Playernum) && 
  1431. X!             ( xd*xd+yd*yd < ship->object.number * ship->object.number) )
  1432. X              rad = 1;
  1433. X          sh = ships[sh]->nextship;
  1434. X           }
  1435. X***************
  1436. X*** 139,158 ****
  1437. X              xd = ships[sh2]->xpos - ship->xpos;
  1438. X              yd = ships[sh2]->ypos - ship->ypos;
  1439. X  
  1440. X              if ( ships[sh2]->popn != 0 ) {
  1441. X!                       rad = round_rand(ship->destruct
  1442. X!         * (2500/(xd*xd + yd*yd + 1.)) );
  1443. X                          if (ships[sh2]->rad + rad > 100)
  1444. X                          ships[sh2]->rad = 100;
  1445. X                        else
  1446. X                          ships[sh2]->rad += rad;
  1447. X  
  1448. X                        teleg_add("",telegram_buf);
  1449. X!                       sprintf(buf, "BULLETIN!\n ship #%d irradiated by mine at system /%s - dosage %d percent", 
  1450. X!     sh2, Stars[ship->storbits]->name, rad);
  1451. X                        teleg_add(buf, telegram_buf);
  1452. X                        teleg_send(TELEG_PLAYER_AUTO,ships[sh2]->owner,telegram_buf);
  1453. X                  }
  1454. X              sh2 = ships[sh2]->nextship;
  1455. X          }
  1456. X           }
  1457. X--- 130,178 ----
  1458. X              xd = ships[sh2]->xpos - ship->xpos;
  1459. X              yd = ships[sh2]->ypos - ship->ypos;
  1460. X  
  1461. X+         if (!ship->mine.mode) {
  1462. X              if ( ships[sh2]->popn != 0 ) {
  1463. X!                       rad = round_rand(ship->destruct * 
  1464. X!         (5./(float)Shipdata[ships[sh2]->type][ABIL_ARMOR]) * (2500/(xd*xd + yd*yd + 1.)) );
  1465. X                          if (ships[sh2]->rad + rad > 100)
  1466. X                          ships[sh2]->rad = 100;
  1467. X                        else
  1468. X                          ships[sh2]->rad += rad;
  1469. X  
  1470. X+                 if(rad)
  1471. X+                     {
  1472. X                        teleg_add("",telegram_buf);
  1473. X!                       sprintf(buf, "BULLETIN!\n %s #%d irradiated by mine at system /%s - dosage %d percent", 
  1474. X!     Shipnames[ships[sh2]->type], sh2, Stars[ship->storbits]->name, rad);
  1475. X                        teleg_add(buf, telegram_buf);
  1476. X                        teleg_send(TELEG_PLAYER_AUTO,ships[sh2]->owner,telegram_buf);
  1477. X+             }
  1478. X+ 
  1479. X+                 } /* ships radiated */
  1480. X+              } else {
  1481. X+                       rad = round_rand(ship->destruct * 
  1482. X+         (5./(float)Shipdata[ships[sh2]->type][ABIL_ARMOR]) * 
  1483. X+         (2500/(xd*xd + yd*yd + 1.)) );
  1484. X+ 
  1485. X+         dam = int_rand(0,rad);
  1486. X+ 
  1487. X+                 if(dam)
  1488. X+                     {
  1489. X+         ships[sh2]->damage += dam;
  1490. X+                     teleg_add("",telegram_buf);
  1491. X+ 
  1492. X+                       sprintf(buf, "BULLETIN!\n %s #%d damaged by mine at system /%s - %d %% damage", 
  1493. X+     Shipnames[ships[sh2]->type], sh2, Stars[ship->storbits]->name, dam);
  1494. X+                       teleg_add(buf, telegram_buf);
  1495. X+         if(ships[sh2]->damage >= 100)
  1496. X+             {
  1497. X+                 kill_ship(ships[sh2]);
  1498. X+         sprintf(buf, " %s #%d DESTROYED",Shipnames[ships[sh2]->type],sh2);
  1499. X                  }
  1500. X+                       teleg_send(TELEG_PLAYER_AUTO,ships[sh2]->owner,telegram_buf);
  1501. X+                 } /* ships attacked by explosive */
  1502. X+         }
  1503. X+ 
  1504. X              sh2 = ships[sh2]->nextship;
  1505. X          }
  1506. X           }
  1507. X***************
  1508. X*** 160,179 ****
  1509. X         break;
  1510. X  
  1511. X        case STYPE_MIRROR:
  1512. X!       switch (ship->orders.aimed_at.level) {
  1513. X         case LEVEL_SHIP: /* ship aimed at is a legal ship now */
  1514. X                /* if in the same system */
  1515. X             if ( (ship->whatorbits==LEVEL_STAR || ship->whatorbits==LEVEL_PLAN)
  1516. X!             && (ships[ship->orders.aimed_at.shipno]!=NULL)
  1517. X!             && (ships[ship->orders.aimed_at.shipno]->whatorbits==LEVEL_STAR ||
  1518. X!             ships[ship->orders.aimed_at.shipno]->whatorbits==LEVEL_PLAN)
  1519. X!             && ship->storbits == ships[ship->orders.aimed_at.shipno]->storbits 
  1520. X!             && !ships[ship->orders.aimed_at.shipno]->is_dead )
  1521. X!                 ships[ship->orders.aimed_at.shipno]->damage += 10;
  1522. X          break;
  1523. X         case LEVEL_PLAN: { reg short *t; reg int i;
  1524. X!           t = &Stinfo[ship->storbits][ship->orders.aimed_at.pnum].temp_add;
  1525. X!           i = ship->orders.aimed_at.intensity;
  1526. X            if (*t + i > 120)
  1527. X              *t = 120;
  1528. X            else if (*t + i < -120)
  1529. X--- 180,199 ----
  1530. X         break;
  1531. X  
  1532. X        case STYPE_MIRROR:
  1533. X!       switch (ship->aimed_at.level) {
  1534. X         case LEVEL_SHIP: /* ship aimed at is a legal ship now */
  1535. X                /* if in the same system */
  1536. X             if ( (ship->whatorbits==LEVEL_STAR || ship->whatorbits==LEVEL_PLAN)
  1537. X!             && (ships[ship->aimed_at.shipno]!=NULL)
  1538. X!             && (ships[ship->aimed_at.shipno]->whatorbits==LEVEL_STAR ||
  1539. X!             ships[ship->aimed_at.shipno]->whatorbits==LEVEL_PLAN)
  1540. X!             && ship->storbits == ships[ship->aimed_at.shipno]->storbits 
  1541. X!             && ships[ship->aimed_at.shipno]->is_alive )
  1542. X!                 ships[ship->aimed_at.shipno]->damage += 10;
  1543. X          break;
  1544. X         case LEVEL_PLAN: { reg short *t; reg int i;
  1545. X!           t = &Stinfo[ship->storbits][ship->aimed_at.pnum].temp_add;
  1546. X!           i = ship->aimed_at.intensity;
  1547. X            if (*t + i > 120)
  1548. X              *t = 120;
  1549. X            else if (*t + i < -120)
  1550. X***************
  1551. X*** 183,191 ****
  1552. X          }
  1553. X          break;
  1554. X         case LEVEL_STAR:
  1555. X!         if (ship->orders.aimed_at.snum>0 && 
  1556. X!             ship->orders.aimed_at.snum<Sdata.numstars)
  1557. X!             Stars[ship->orders.aimed_at.snum]->stability += random()&01;
  1558. X          break;
  1559. X         case LEVEL_UNIV:
  1560. X          break;
  1561. X--- 203,211 ----
  1562. X          }
  1563. X          break;
  1564. X         case LEVEL_STAR:
  1565. X!         if (ship->aimed_at.snum>0 && 
  1566. X!             ship->aimed_at.snum<Sdata.numstars)
  1567. X!             Stars[ship->aimed_at.snum]->stability += random()&01;
  1568. X          break;
  1569. X         case LEVEL_UNIV:
  1570. X          break;
  1571. X***************
  1572. X*** 221,227 ****
  1573. X      break;
  1574. X  
  1575. X       case OTYPE_AMOEBA:      /* space amoeba */
  1576. X!     if (ship->orders.amoeba.dig) {
  1577. X          /* we are currently digesting a planet. */
  1578. X          if (planets[ship->storbits][ship->pnumorbits]->digested) {
  1579. X               reg int i,s; reg bool f=0;
  1580. X--- 241,247 ----
  1581. X      break;
  1582. X  
  1583. X       case OTYPE_AMOEBA:      /* space amoeba */
  1584. X!     if (ship->amoeba.dig) {
  1585. X          /* we are currently digesting a planet. */
  1586. X          if (planets[ship->storbits][ship->pnumorbits]->digested) {
  1587. X               reg int i,s; reg bool f=0;
  1588. X***************
  1589. X*** 252,264 ****
  1590. X              /*ship->whatorbits = LEVEL_STAR;
  1591. X              ship->whatdest = LEVEL_UNIV;*/
  1592. X               /* no longer digesting */
  1593. X!             ship->orders.amoeba.dig = 0;
  1594. X               /* find a new place to digest */
  1595. X!             ship->orders.amoeba.dest = 0;
  1596. X          }
  1597. X      } else {
  1598. X           /* we have a planet in mind. */
  1599. X!         if (!ship->orders.amoeba.dest || ship->whatdest==LEVEL_UNIV) {
  1600. X              /* we have orders; wait to get to destination */
  1601. X              if (ship->whatdest == LEVEL_PLAN && 
  1602. X                  ship->whatorbits == LEVEL_PLAN &&
  1603. X--- 272,284 ----
  1604. X              /*ship->whatorbits = LEVEL_STAR;
  1605. X              ship->whatdest = LEVEL_UNIV;*/
  1606. X               /* no longer digesting */
  1607. X!             ship->amoeba.dig = 0;
  1608. X               /* find a new place to digest */
  1609. X!             ship->amoeba.dest = 0;
  1610. X          }
  1611. X      } else {
  1612. X           /* we have a planet in mind. */
  1613. X!         if (!ship->amoeba.dest || ship->whatdest==LEVEL_UNIV) {
  1614. X              /* we have orders; wait to get to destination */
  1615. X              if (ship->whatdest == LEVEL_PLAN && 
  1616. X                  ship->whatorbits == LEVEL_PLAN &&
  1617. X***************
  1618. X*** 267,273 ****
  1619. X                  /* we just arrived at our destination. */
  1620. X                 Stinfo[ship->storbits][ship->pnumorbits].amoeba_add = 1;
  1621. X                  /* start digesting */
  1622. X!                ship->orders.amoeba.dig = 1;
  1623. X                  /* telegram people */
  1624. X                 teleg_add("", telegram_buf);
  1625. X                 teleg_add("BULLETIN!!\n\n ",telegram_buf);
  1626. X--- 287,293 ----
  1627. X                  /* we just arrived at our destination. */
  1628. X                 Stinfo[ship->storbits][ship->pnumorbits].amoeba_add = 1;
  1629. X                  /* start digesting */
  1630. X!                ship->amoeba.dig = 1;
  1631. X                  /* telegram people */
  1632. X                 teleg_add("", telegram_buf);
  1633. X                 teleg_add("BULLETIN!!\n\n ",telegram_buf);
  1634. X***************
  1635. X*** 310,319 ****
  1636. X              ship->destpnum =
  1637. X                  int_rand(0,Stars[ship->deststar]->numplanets-1);
  1638. X               ship->whatdest = LEVEL_PLAN;
  1639. X!             ship->orders.amoeba.dest = 1;
  1640. X             } else {
  1641. X              /* no good; find someplace else. */
  1642. X!             ship->orders.amoeba.dest = 0;
  1643. X             }
  1644. X             ship->speed = 1;    /* amoebae are very fastidious,too */
  1645. X             fprintf(stderr,"amoeba #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum);
  1646. X--- 330,339 ----
  1647. X              ship->destpnum =
  1648. X                  int_rand(0,Stars[ship->deststar]->numplanets-1);
  1649. X               ship->whatdest = LEVEL_PLAN;
  1650. X!             ship->amoeba.dest = 1;
  1651. X             } else {
  1652. X              /* no good; find someplace else. */
  1653. X!             ship->amoeba.dest = 0;
  1654. X             }
  1655. X             ship->speed = 1;    /* amoebae are very fastidious,too */
  1656. X             fprintf(stderr,"amoeba #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum);
  1657. X***************
  1658. X*** 333,341 ****
  1659. X  
  1660. X       case OTYPE_OMCL:
  1661. X       /* orbital mind control laser */
  1662. X!     if (ship->orders.aimed_at.level==LEVEL_PLAN && ship->on &&
  1663. X          ship->speed==1) {
  1664. X!         planets[ship->orders.aimed_at.snum][ship->orders.aimed_at.pnum]
  1665. X              ->is_sheep = 1;
  1666. X      }
  1667. X      break;
  1668. X--- 353,361 ----
  1669. X  
  1670. X       case OTYPE_OMCL:
  1671. X       /* orbital mind control laser */
  1672. X!     if (ship->aimed_at.level==LEVEL_PLAN && ship->on &&
  1673. X          ship->speed==1) {
  1674. X!         planets[ship->aimed_at.snum][ship->aimed_at.pnum]
  1675. X              ->is_sheep = 1;
  1676. X      }
  1677. X      break;
  1678. X***************
  1679. X*** 400,406 ****
  1680. X  
  1681. X     }
  1682. X  
  1683. X!  } else if (ship->owner ==0 || !ship->notified) {
  1684. X      /* ship is dead -- add to shipfree file, remove from all lists. */
  1685. X      /* if notified, this means it's already been deleted and written. */
  1686. X      ship->notified = 1;
  1687. X--- 420,426 ----
  1688. X  
  1689. X     }
  1690. X  
  1691. X!  } else if (!ship->is_alive && !ship->notified) {
  1692. X      /* ship is dead -- add to shipfree file, remove from all lists. */
  1693. X      /* if notified, this means it's already been deleted and written. */
  1694. X      ship->notified = 1;
  1695. X***************
  1696. X*** 413,419 ****
  1697. X  
  1698. X  
  1699. X  do_VN(ship,shipno)
  1700. X! shiptype *ship;
  1701. X  int shipno;
  1702. X  {
  1703. X  int r; 
  1704. X--- 433,440 ----
  1705. X  
  1706. X  
  1707. X  do_VN(ship,shipno)
  1708. X! struct ship *ship;
  1709. X! /* shiptype *ship; */
  1710. X  int shipno;
  1711. X  {
  1712. X  int r; 
  1713. X***************
  1714. X*** 430,436 ****
  1715. X          /* make sure the planet is updated */
  1716. X      Stinfo[ship->storbits][ship->pnumorbits].inhab = 1;
  1717. X         /* try to launch it */
  1718. X!     if (ship->orders.object.number2 == 0) {    /* launch if no assignment */
  1719. X        /* steal some fuel from other players,telegram */
  1720. X          int f=0;
  1721. X          if (ship->fuel < Shipdata[OTYPE_VN][ABIL_COST]) {
  1722. X--- 451,457 ----
  1723. X          /* make sure the planet is updated */
  1724. X      Stinfo[ship->storbits][ship->pnumorbits].inhab = 1;
  1725. X         /* try to launch it */
  1726. X!     if (ship->object.number2 == 0) {    /* launch if no assignment */
  1727. X        /* steal some fuel from other players,telegram */
  1728. X          int f=0;
  1729. X          if (ship->fuel < Shipdata[OTYPE_VN][ABIL_COST]) {
  1730. X***************
  1731. X*** 450,456 ****
  1732. X              teleg_add(buf,telegram_buf);
  1733. X                  teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf);
  1734. X          
  1735. X!         ship->orders.object.number2 = 0; /* no current assignment */
  1736. X          ship->xpos = Stars[ship->storbits]->xpos + planets[ship->storbits][ship->pnumorbits]->xpos + int_rand(-10,10);
  1737. X          ship->ypos = Stars[ship->storbits]->ypos + planets[ship->storbits][ship->pnumorbits]->ypos + int_rand(-10,10);
  1738. X          ship->is_docked = 0;
  1739. X--- 471,477 ----
  1740. X              teleg_add(buf,telegram_buf);
  1741. X                  teleg_send(TELEG_PLAYER_AUTO, f, telegram_buf);
  1742. X          
  1743. X!         ship->object.number2 = 0; /* no current assignment */
  1744. X          ship->xpos = Stars[ship->storbits]->xpos + planets[ship->storbits][ship->pnumorbits]->xpos + int_rand(-10,10);
  1745. X          ship->ypos = Stars[ship->storbits]->ypos + planets[ship->storbits][ship->pnumorbits]->ypos + int_rand(-10,10);
  1746. X          ship->is_docked = 0;
  1747. X***************
  1748. X*** 473,479 ****
  1749. X              if (p->info[nums[i]-1].resource)
  1750. X                  f = nums[i];
  1751. X          if (f) {
  1752. X!               p->info[f-1].resource -= Shipdata[OTYPE_VN][ABIL_COST];
  1753. X              ship->resource += Shipdata[OTYPE_VN][ABIL_COST];
  1754. X              ship->mass += Shipdata[OTYPE_VN][ABIL_COST] * MASS_RESOURCE;
  1755. X              teleg_add("",telegram_buf);
  1756. X--- 494,502 ----
  1757. X              if (p->info[nums[i]-1].resource)
  1758. X                  f = nums[i];
  1759. X          if (f) {
  1760. X!               p->info[f-1].resource -= 
  1761. X!                 MIN( p->info[f-1].resource, 
  1762. X!                 Shipdata[OTYPE_VN][ABIL_COST]);
  1763. X              ship->resource += Shipdata[OTYPE_VN][ABIL_COST];
  1764. X              ship->mass += Shipdata[OTYPE_VN][ABIL_COST] * MASS_RESOURCE;
  1765. X              teleg_add("",telegram_buf);
  1766. X***************
  1767. X*** 493,499 ****
  1768. X      }
  1769. X    } else {
  1770. X      /* we are not landed */
  1771. X!     if (ship->orders.object.number2) {
  1772. X          /* we've arrived from somewhere -- look for a place to land.  
  1773. X             this is done on planet turn */
  1774. X      } else {
  1775. X--- 516,522 ----
  1776. X      }
  1777. X    } else {
  1778. X      /* we are not landed */
  1779. X!     if (ship->object.number2) {
  1780. X          /* we've arrived from somewhere -- look for a place to land.  
  1781. X             this is done on planet turn */
  1782. X      } else {
  1783. X***************
  1784. X*** 518,527 ****
  1785. X              ship->destpnum =
  1786. X                  int_rand(0,Stars[ship->deststar]->numplanets-1);
  1787. X               ship->whatdest = LEVEL_PLAN;
  1788. X!             ship->orders.object.number2 = 1;
  1789. X          } else {
  1790. X              /* no good; find someplace else. */
  1791. X!             ship->orders.object.number2 = 0;
  1792. X          }
  1793. X          ship->speed = 1;    /* VN's are very fastidious */
  1794. X          fprintf(stderr,"VN #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum);
  1795. X--- 541,550 ----
  1796. X              ship->destpnum =
  1797. X                  int_rand(0,Stars[ship->deststar]->numplanets-1);
  1798. X               ship->whatdest = LEVEL_PLAN;
  1799. X!             ship->object.number2 = 1;
  1800. X          } else {
  1801. X              /* no good; find someplace else. */
  1802. X!             ship->object.number2 = 0;
  1803. X          }
  1804. X          ship->speed = 1;    /* VN's are very fastidious */
  1805. X          fprintf(stderr,"VN #%d headed for star %d, pl %d.\n",shipno,ship->deststar, ship->destpnum);
  1806. X*** ../../GB2/doturn.c    Wed Jul  5 15:15:12 1989
  1807. X--- doturn.c    Fri Sep 15 07:27:56 1989
  1808. X***************
  1809. X*** 62,72 ****
  1810. X--- 62,74 ----
  1811. X   ships = (shiptype **)malloc(sizeof(shiptype *) * Num_ships);
  1812. X   for (i=1; i<=Num_ships; i++) {
  1813. X      getship(shdata,&ships[i],i);
  1814. X+ 
  1815. X      if (ships[i]->whatorbits >= LEVEL_STAR)
  1816. X          StarsInhab[ships[i]->storbits] = 1;
  1817. X   }
  1818. X   close(shdata);
  1819. X  
  1820. X+ 
  1821. X      /* get all stars & planets */
  1822. X   openstardata(&stardata);
  1823. X   getsdata(stardata,&Sdata);
  1824. X***************
  1825. X*** 86,91 ****
  1826. X--- 88,95 ----
  1827. X  
  1828. X  
  1829. X  races[0] = (racetype *)NULL;    /* for maxsupport() */
  1830. X+ 
  1831. X+ 
  1832. X  for (i=1; i<=Num_races; i++) {
  1833. X      getrace(&(races[i]),i);
  1834. X              /* increase tech; change to something else */
  1835. X***************
  1836. X*** 110,115 ****
  1837. X--- 114,121 ----
  1838. X  
  1839. X       /* insert ship into the list of wherever it might be */
  1840. X   for (i=Num_ships; i>=1; i--) {
  1841. X+     if( !(ships[i]->type == STYPE_FIGHTER &&
  1842. X+         ships[i]->object.number4) )
  1843. X      insert_sh(&Sdata, Stars[ships[i]->storbits], 
  1844. X          planets[ships[i]->storbits][ships[i]->pnumorbits], 
  1845. X          ships[i], i);
  1846. X***************
  1847. X*** 135,140 ****
  1848. X--- 141,147 ----
  1849. X            for (pppp=0; pppp<Stars[star]->numplanets; pppp++)
  1850. X             printf(" 8Pointer %d,%d= %x\n",ppp,pppp,planets[ppp][pppp]);*/
  1851. X  
  1852. X+     printf("%s %d\n",Stars[star]->name,i);
  1853. X      if (doplanet(star, planets[star][i], i, command)) {
  1854. X      /* save smap gotten & altered by doplanet only if the planet is expl*/
  1855. X          opensectdata(§data);
  1856. X*** ../../GB2/doturn.h    Wed Jul  5 15:14:53 1989
  1857. X--- doturn.h    Fri Sep 15 07:27:36 1989
  1858. X***************
  1859. X*** 34,37 ****
  1860. X  extern int tot_resdep, prod_eff, prod_res[MAXPLAYERS],
  1861. X      prod_fuel[MAXPLAYERS], prod_destruct[MAXPLAYERS], 
  1862. X      tot_captured, prod_mob;
  1863. X- 
  1864. X--- 34,36 ----
  1865. END_OF_FILE
  1866. if test 52745 -ne `wc -c <'patches01a'`; then
  1867.     echo shar: \"'patches01a'\" unpacked with wrong size!
  1868. fi
  1869. # end of 'patches01a'
  1870. fi
  1871. echo shar: End of archive 1 \(of 4\).
  1872. cp /dev/null ark1isdone
  1873. MISSING=""
  1874. for I in 1 2 3 4 ; do
  1875.     if test ! -f ark${I}isdone ; then
  1876.     MISSING="${MISSING} ${I}"
  1877.     fi
  1878. done
  1879. if test "${MISSING}" = "" ; then
  1880.     echo You have unpacked all 4 archives.
  1881.     rm -f ark[1-9]isdone
  1882. else
  1883.     echo You still need to unpack the following archives:
  1884.     echo "        " ${MISSING}
  1885. fi
  1886. ##  End of shell archive.
  1887. exit 0
  1888.