home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume17 / gbp / part19 < prev    next >
Encoding:
Internet Message Format  |  1993-03-20  |  56.6 KB

  1. Path: uunet!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v17i031:  gbp - Galactic Bloodshed+, an empire-like war game, Part19/21
  5. Message-ID: <4559@master.CNA.TEK.COM>
  6. Date: 12 Feb 93 17:33:29 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2304
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1710
  11.  
  12. Submitted-by: deragon@harpo.cs.nyu.edu (Seeker)
  13. Posting-number: Volume 17, Issue 31
  14. Archive-name: gbp/Part19
  15. Supersedes: gb3: Volume 10, Issue 1-14
  16. Environment: sockets, curses
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 19 (of 21)."
  27. # Contents:  doc/CHANGES doc/README_OLD doc/races.doc hdrs/races.h
  28. #   misc/planet.list server/Makefile.SH server/dosector.c
  29. #   user/dissolve.c user/enslave.c user/togg.c
  30. # Wrapped by billr@saab on Fri Feb 12 09:14:30 1993
  31. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  32. if test -f 'doc/CHANGES' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'doc/CHANGES'\"
  34. else
  35. echo shar: Extracting \"'doc/CHANGES'\" \(4529 characters\)
  36. sed "s/^X//" >'doc/CHANGES' <<'END_OF_FILE'
  37. X
  38. X    This file denotes changes that was made between this release
  39. Xof Galactic bloodshed and GB5.2.
  40. X
  41. X
  42. X    Version 1.1.0
  43. X    -------------
  44. X
  45. X    loginfo function --  All information that was written to stdout
  46. X    before is now written to one of 2 log files.  There are currently
  47. X    3 log files.  
  48. X
  49. X        user.log 
  50. X        error.log
  51. X        update.log
  52. X
  53. X    GB_server.c  -- Alot of function were removed from ths file and put
  54. X    in other files.  
  55. X
  56. X    psmap.c -- is now included in the utils directory.
  57. X
  58. X    togg.c vict.c zoom.c sche.c toxi.c tele.c tech.c -- These files were
  59. X    just cleaned up, and comments were added.  Eventually all the files
  60. X    will be in this format.
  61. X
  62. X    prof.c -- Fixed some formatting bugs in profile.
  63. X
  64. X    analysis.c -- Fixed some formatting bugs in analysis.
  65. X
  66. X    shootblast.c -- Fixed divide by zero error in do_critical_hits().
  67. X
  68. X    order.c build.c doplanet.c ships.h vars.h -- Added ifdefs for 
  69. X    treshload/autoscrap code.
  70. X
  71. X    shipdata.h -- added a dock field to the file, which shows if the ship
  72. X    can be loaded into hangers.  (ie: fixes floating ground telescope bug)
  73. X
  74. X    land.c -- Fixed bug that allowed ground telescopes to be launched from
  75. X    a ship at universe/star/planet level.  Any ship with max-speed of 0 cannot
  76. X    be loaded into a ship.
  77. X
  78. X    Version 1.1.1
  79. X    -------------
  80. X
  81. X    shipdata.h ship.h -- added minesweeper shiptype
  82. X
  83. X    shipdata.h tweakables.h config.h -- added ifdef for SUPER_PODS
  84. X    
  85. X    cs.c -- added Shawn Fox's fix to cs to planets via cs ../2 cs ../1
  86. X    instead of using names.
  87. X
  88. X    doplanet.c -- added Shawn Fox's est_production fix...
  89. X
  90. X
  91. X    Version 1.1.2
  92. X    -------------
  93. X
  94. X    Keesh's change to survey.c and tele.c to comply with GBII ver 2.4.6
  95. X
  96. X    Version 1.1.3
  97. X    -------------
  98. X
  99. XTues Jan 26 08:01:00 EST 1993 johnd
  100. X
  101. X    Added the CLIENT_PROTOCOL Support file to the release
  102. X
  103. X    shlmisc.c - grant now works correctly (fixed bug, that prevents subtraction
  104. X    of money from governors)
  105. X
  106. XWed Jan 27 20:07:56 EST 1993 johnd
  107. X
  108. X    shipdata.h - changed space telescope letter from \ to E and missle from
  109. X    ^ to z
  110. X        
  111. XThu Jan 28 03:49:02 EST 1993 johnd
  112. X
  113. X    GB_server.c    - Added governor logout message.
  114. X        
  115. X    GB_server.c - Added server generated password prompt for client.
  116. X
  117. X    dock.c - Fixed bug in dock(), s->whatorbits should be s2->whatorbits
  118. X
  119. X    rst.c order.c - made mod to the way xtals/hyperdrives are show.
  120. X    is ship doesnt have hyper * is shown, hyper/no xtal - is shown,
  121. X    hyper/xtal + is shown.
  122. X
  123. X    name.c chan.c GB_server.c vars.h prof.c Configure - Added multiple
  124. X    communications channel capability. Channels are numbered 1,2,3. Can
  125. X    send on any channel by using the number of the channel you wish to
  126. X    send on.  Set the default channel (for use with broadcast and ') via
  127. X    'channel <channel> default', view current channels with 'channel', set
  128. X    channels to monitor via 'channel <channel> (toggle).  You will only
  129. X    receive messages for channels you have turned on. (By default channel
  130. X    one is set upon login)
  131. X
  132. X
  133. XThu Jan 28 21:38:28 EST 1993 johnd
  134. X    
  135. X    all Makefile.SH -- Added clean targets
  136. X
  137. X    GB_server.c sche.c -- changed long to time_t for clock defs.
  138. X
  139. X    many .c's -- changed sprintf to strcat whereever possible
  140. X
  141. X    vars.h -- removed clk, added to GB_server.c and sche.c
  142. X
  143. X    tele.c -- removed ctime and fopen defs (included in time.h and stdlib.h)
  144. X
  145. X    GB_server.c -- added #include sys/stat.h
  146. X
  147. X    all *.c's -- removed #include "*.p" and moved all prototypes to
  148. X    hdrs/proto.h
  149. X
  150. X
  151. XSat Jan 30 20:28:58 EST 1993 johnd
  152. X
  153. X    lists.c -- Changes [MAXSTARS] and [MAXPLANETS] to [MAXSTARS -1] and
  154. X    [MAXPLANETS -1].
  155. X
  156. X    max.c -- compatibility() changed add from int to double.  
  157. X
  158. X    build.c -- get_build_type() removed line to init i to -1, chaned order
  159. X    of comparisions to check for (i < NUMSTYPES) first.
  160. X
  161. X    fuel.c -- was assigning information from a struct that was free'ed,
  162. X    
  163. X
  164. X    -- END OF GB+ 1.1.4
  165. X
  166. XMon Feb  1 00:26:07 EST 1993
  167. X
  168. X    -- START OF GB+ 1.2.0    
  169. X
  170. X    This version is the start serious development work, many changes started
  171. X    including closer interaction between client and server.
  172. X
  173. X    client.c -- added client.c to handle all client specific parsing and
  174. X    commands.
  175. X
  176. X    csp.h -- added csp.h.  This file should be the same in the client as
  177. X    well as the server.
  178. X
  179. X    toggle.c -- added new 'toggle client' option to use client result codes.
  180. X
  181. X    vars.h -- added #defs for UPDATE_START, UPDATE_END, SEGMENT_START,
  182. X    SEGMENT_END, RESET_START, RESET_END.
  183. X
  184. X    GB_server.c -- added CSP_process_command into process_command function.
  185. X    ** All client commands should be added to CSP_process_command.c, not in 
  186. X    process_command.
  187. X
  188. X    doship.c -- fixed bug in domine() that prevented mines from shooting
  189. X    enemy ships.
  190. X    
  191. X    -- END OF GB+ 1.2.0
  192. END_OF_FILE
  193. if test 4529 -ne `wc -c <'doc/CHANGES'`; then
  194.     echo shar: \"'doc/CHANGES'\" unpacked with wrong size!
  195. fi
  196. # end of 'doc/CHANGES'
  197. fi
  198. if test -f 'doc/README_OLD' -a "${1}" != "-c" ; then 
  199.   echo shar: Will not clobber existing file \"'doc/README_OLD'\"
  200. else
  201. echo shar: Extracting \"'doc/README_OLD'\" \(2902 characters\)
  202. sed "s/^X//" >'doc/README_OLD' <<'END_OF_FILE'
  203. X   The code is divided into two parts, GB_server.shar which contains
  204. Xthis file, and GB_client.shar. Most of the user playing the game will
  205. Xjust need the client, since the server is run at the game site and
  206. Xmanaged by the host there. Game documentation is in the file
  207. XGB_docs.shar.
  208. X
  209. X   If you wish to host a GB game, you must have GB_server.shar, GB_docs
  210. Xand GB_client.shar. After unsharing these files (they should be done in
  211. Xseparate directories!), you can compile and link them by doing
  212. X'make'. The Makefile is set up for 4.3 BSD Unix, if you are running
  213. Xon a different operating system, you may need to change the Makefile
  214. Xto suit your system.
  215. X
  216. X   Assuming all goes well, you should have several programs in the
  217. Xserver's directory, and one program in the client's directory (GB_client).
  218. XIn the server's directory:
  219. X    GB_enroll
  220. X    GB_server
  221. X    makeuniv
  222. X
  223. X   This version of the server has the update clock built into the server.
  224. XWhen starting up the server, use the following syntax:
  225. X  GB_server [port] [minutes between updates] [movement segments per update] &
  226. XFor example:
  227. X    GB_server 2010 720 6 &
  228. Xwill run the server using port 2010, 720 minutes (6 hrs) between updates, and
  229. X6 evenly spaced movement segments (note that an update is counted as a
  230. Xmovement segment). The program also supports the update password and
  231. Xsegment password as used in earlier version of the program. I would like
  232. Xto thank Dan Dickey at Cray for his help in putting the framework for this
  233. Xtogether. It is a  good idea to make your update times a factor 
  234. Xof 24 hours and the movement segment interval a factor of the update interval.
  235. XIf you want to force an update/segment just telnet to the server 
  236. Xand enter the update/segment password.
  237. X
  238. XUpdates and segments can be forced by the deity by using the '@@update'
  239. Xand '@@segment' commands. A 'fix' routine has also been installed for the
  240. Xdeity player, but still needs some work (you can customize it in shlmisc.c).
  241. X
  242. XPlayers cannot enroll by themselves in this version. The game's host
  243. Xmust do that by running 'GB_enroll' and following the instructions. It
  244. Xis a good idea to bring the game down for this (log in as a God status
  245. Xplayer and do '@@shutdown'). Always make player #1 (the first one
  246. Xenrolled God status, as many game functions default to player 1).
  247. X
  248. XTime allocation cas be set using the 'reset' command.
  249. X
  250. XBefore starting a game you must create a universe for your users to play in.
  251. XDo 'makeuniv' and follow the instructions.
  252. X
  253. XAlso, be careful about setting up your default paths correctly. Unshare the
  254. XGB_docs.shar file into a subdirectory 'Docs'.
  255. X
  256. X
  257. XThere have been ajor improvements in the game and server stability since
  258. Xthis readme file was last updated, much too numerous to expound upon. However,
  259. XI am always open for suggestions, and take a look at the program yourself
  260. Xto help me find errors :)
  261. X
  262. XGood luck,
  263. X
  264. XGarrett Warren van Cleef
  265. Xvancleef@pooh.caltech.edu
  266. X7/19/91
  267. END_OF_FILE
  268. if test 2902 -ne `wc -c <'doc/README_OLD'`; then
  269.     echo shar: \"'doc/README_OLD'\" unpacked with wrong size!
  270. fi
  271. # end of 'doc/README_OLD'
  272. fi
  273. if test -f 'doc/races.doc' -a "${1}" != "-c" ; then 
  274.   echo shar: Will not clobber existing file \"'doc/races.doc'\"
  275. else
  276. echo shar: Extracting \"'doc/races.doc'\" \(5823 characters\)
  277. sed "s/^X//" >'doc/races.doc' <<'END_OF_FILE'
  278. XRACES            Galactic Bloodshed        RACES
  279. X
  280. X
  281. XCONCEPTS
  282. X
  283. X   The creation of new races is controlled by the person hosting the game.
  284. XPlayer #1 (the first player enrolled into the game) should always be given
  285. Xdiety status, as many of the game default operations are placed in player #1's
  286. Xcontrol.  Other players may be designated as having diety status during the
  287. Xenrollment procedure, but this isn't recommended (or needed in most cases).
  288. X
  289. X   Race generation is often done using a rather complex point based system,
  290. Xthe idea being that you must spend a limited number points to get better
  291. Xattributes.  The program that you do this creation process with is called
  292. X"racegen".  There are five types of data associated with each race that the
  293. Xplayer can choose:
  294. X
  295. X* Name, password, and other profile information -- While none of these have
  296. Xany direct effect on game play, they add interest.  Name and password can be
  297. Xset with racegen before enrolling in the game.  All of the others can be
  298. Xchanged as needed; see also: name, personal, profile
  299. X
  300. X* Home planet type -- A race's home planet can drastically affect its game.
  301. XJovian home planets are the most costly type, because jovians are huge planets
  302. Xwith about half the sector area of the universe on them.  Jovians are the only
  303. Xworlds with gas sectors on them; gas tends to be resource-poor but fertile.
  304. XClass M (Earth-type) home planets are the next most useful, with a good
  305. Xbalance of fertility and resources.  Forest and water worlds are like class
  306. XM's and generally more fertile, but they are also smaller on average.  Desert
  307. Xworlds have high resource content but are not very fertile.  Iceballs and
  308. Xairless worlds are too small to make very good home planets, but they are very
  309. Xcommon in the universe as a whole.
  310. X
  311. X* Racial type -- There are two main racial types in GB: normal races (think of
  312. Xhumans, Klingons, Wookies, Pierson's Puppeteers, etc) and metamorphs (Alien,
  313. Xthe Thing, body snatchers, etc.)  The primary difference between these two
  314. Xrace classes is that only metamorphs may have pods and absorbtion as racial
  315. Xattributes.  Metamorphs are also required to have one sex, which is another
  316. Xadvantage.  A secondary difference that is rather harder to notice is that the
  317. Xprice of various attribute combinations is slightly different for normals and
  318. Xmorphs in racegen, especially for some of the attributes' extremes.
  319. X
  320. X* Compats -- The planets found in the GB universe are represented as arrays of
  321. Xsectors of various types: ice, land, sea, etc.  Various races may have varying
  322. Xdegrees of compatibility with these sector types, which will affect the amount
  323. Xof population they can grow on that sector type, and other things too.
  324. X
  325. X* Attributes -- Attributes are quantizations of a race's abilities.  Currently
  326. Xthere are 11 basic attributes for each race:
  327. X
  328. X** Absorbtion -- Only metamorphs may have this attribute, which allows them to
  329. X    absorb enemy troops and civilians in combat if the morph wins.
  330. X    Combined with pods, it allows metamorphs to replace alien population
  331. X    on planets when pods burst.
  332. X
  333. X** Adventurism -- This described what percentage of a sector's population may
  334. X    move and explore other sectors.  High value tend to settle planets on
  335. X    their own far more efficiently. If you have a low value, you can order
  336. X    movements with the 'move' option.
  337. X
  338. X** Birthrate -- This factor determines how rapidly the population in the
  339. X    sector will converge to the maximum population supportable on the
  340. X    there.  High values mean that the population multiplies faster.
  341. X
  342. X** Fertilize -- This attribute represents the percentage chance that a race
  343. X    will increase by one percent the fertility of any sector it owns.  Any
  344. X    race may take advantage of space plows for a similar effect, once it
  345. X    gets to tech level 5.
  346. X
  347. X** Fighting Ability - Higher values mean that the race is more likely to kill
  348. X    an alien than a lower value.  Races with lower values will usually need
  349. X    to have larger forces to win in direct combat over a high fighting
  350. X    ability.  It is important to note that this effects only land combat
  351. X    and ship boarding strengths, and not ship to ship fighting.
  352. X
  353. X** IQ -- The raw growth rate of a race's technology is governed by the race's
  354. X    intelligence.  The technology increase per update is IQ/100.  Addi-
  355. X    tional technology gain is available by technology investments on the
  356. X    individual planets under the race's control.
  357. X
  358. X** Collective IQ; IQ limit -- The intelligence of a race with collective IQ is
  359. X    related to the race's total population, as follows:
  360. X        IQ = IQ_limit * [ (2/PI) atan(population/50000)]^2. 
  361. X
  362. X** Mass -- Each race has a mass.  The heavier the individual, the more fuel it
  363. X    will take to launch and land ships full of the race.
  364. X
  365. X** Metabolism -- This value controls how industrious the race is.  Higher
  366. X    metabolism races will produce resources more rapidly than lower
  367. X    metabolisms, and also increase the efficiency of sectors faster.
  368. X
  369. X** Pods -- Pods are small ships, available only to metamorphs but at tech
  370. X    level 0, buildable instantly on the surface of planets.  Each one may
  371. X    carry a single crew-thing; this makes them ideal for settling other 
  372. X    planets.  Pods which enter a system after having frozen in deep
  373. X    space will warm and eventually burst, possibly leading to spores
  374. X    landing on worlds in the new system.  If a spore lands on a sector, a
  375. X    ton or more of biomass will be created, resulting in a new colony for
  376. X    the podding race.  Note that spores may never land on alien occupied
  377. X    sectors unless the podding race has absorbtion.
  378. X
  379. X** Sexes -- Each race has a number of sexes. This represent the minimum
  380. X    population that a sector must have in order to be able to reproduce.
  381. X    Lower values are preferable to high values for colonization efforts.
  382. X    It is not recommended to have more than 3 to 6 sexes at the outside,
  383. X    unless you are really looking for a challenge
  384. END_OF_FILE
  385. if test 5823 -ne `wc -c <'doc/races.doc'`; then
  386.     echo shar: \"'doc/races.doc'\" unpacked with wrong size!
  387. fi
  388. # end of 'doc/races.doc'
  389. fi
  390. if test -f 'hdrs/races.h' -a "${1}" != "-c" ; then 
  391.   echo shar: Will not clobber existing file \"'hdrs/races.h'\"
  392. else
  393. echo shar: Extracting \"'hdrs/races.h'\" \(5887 characters\)
  394. sed "s/^X//" >'hdrs/races.h' <<'END_OF_FILE'
  395. X#ident  "@(#)races.h    1.3 1/28/93 "
  396. X/*
  397. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  398. X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat.
  399. X * Restrictions in GB.c.
  400. X */
  401. X
  402. Xtypedef struct {
  403. X    char invisible;
  404. X    char standby;
  405. X    char color;            /* 1 if you are using a color client */
  406. X    char gag;
  407. X    char double_digits;
  408. X    char inverse;
  409. X    char geography;
  410. X    char autoload;
  411. X    char highlight;            /* which race to highlight */
  412. X    char compat;
  413. X} toggletype;
  414. X
  415. Xstruct race {
  416. X    int Playernum;
  417. X    char name[RNAMESIZE];       /* Racial name. */
  418. X    char password[RNAMESIZE];
  419. X    char info[PERSONALSIZE];    /* personal information */
  420. X    char motto[MOTTOSIZE];    /* for a cute message */
  421. X    unsigned char absorb;       /* Does this race absorb enemies in combat? */
  422. X    unsigned char collective_iq;/* Does this race have collective IQ? */
  423. X    unsigned char pods;         /* Can this race use pods? */
  424. X    unsigned char fighters;     /* Fight rating of this race. */
  425. X    unsigned char IQ;           
  426. X    unsigned char IQ_limit;     /* Asymtotic IQ for collective IQ races. */
  427. X    unsigned char number_sexes;
  428. X    unsigned char fertilize;    /* Chance that this race will increase the
  429. X                   fertility of its sectors by 1 each update */
  430. X    double adventurism;          
  431. X    double birthrate;
  432. X    double mass;
  433. X    double metabolism;
  434. X    short conditions[OTHER+1];    /* Atmosphere/temperature this race likes. */
  435. X    double likes[WASTED+1];    /* Sector condition compats. */
  436. X    unsigned char likesbest;    /* 100% compat sector condition for this race. */
  437. X    
  438. X    char dissolved;          /* Player has quit. */
  439. X    char God;                /* Player is a God race. */
  440. X    char Guest;              /* Player is a guest race. */
  441. X    char Metamorph;          /* Player is a morph; (for printing). */
  442. X    char monitor;            /* God is monitering this race. */
  443. X
  444. X    char translate[MAXPLAYERS];  /* translation mod for each player */
  445. X
  446. X    unsigned long atwar[2];    /* war 64 bits*/
  447. X    unsigned long allied[2];    /* allies 64 bits*/
  448. X
  449. X    unsigned short Gov_ship;    /* Shipnumber of government ship. */
  450. X    long morale;                 /* race's morale level */
  451. X    unsigned int points[MAXPLAYERS]; /* keep track of war status against
  452. X                        another player - for short reports */
  453. X    unsigned short controlled_planets;   /* Number of planets under control. */
  454. X    unsigned short victory_turns;
  455. X    unsigned short turn;
  456. X
  457. X    double tech;                 
  458. X    unsigned char discoveries[80];    /* Tech discoveries. */
  459. X    unsigned long victory_score;      /* Number of victory points. */
  460. X    unsigned long votes;
  461. X    unsigned long planet_points;      /* For the determination of global APs */
  462. X    
  463. X    char governors;
  464. X    struct gov {
  465. X    char name[RNAMESIZE];
  466. X    char password[RNAMESIZE];
  467. X    unsigned char active;
  468. X    unsigned char deflevel;
  469. X    unsigned char defsystem;
  470. X    unsigned char defplanetnum;    /* current default */
  471. X    unsigned char homelevel;
  472. X    unsigned char homesystem;
  473. X    unsigned char homeplanetnum;    /* home place */
  474. X    unsigned long newspos[4];    /* news file pointers */
  475. X    toggletype toggle;
  476. X    unsigned long money;
  477. X    unsigned long income;
  478. X    unsigned long maintain;
  479. X    unsigned long cost_tech;
  480. X    unsigned long cost_market;
  481. X    unsigned long profit_market;
  482. X    unsigned long channel[2];  /* the channel we are communicating on */
  483. X    long login;     /* last login for this governor */
  484. X    struct {
  485. X    unsigned csp_user : 1;
  486. X    unsigned empty : 7;
  487. X    } CSP_client_info;
  488. X
  489. X    } governor[MAXGOVERNORS+1];
  490. X};
  491. X
  492. X/* vote bits: */
  493. X#define    VOTE_UPDATE_GO    0x01    /* On - Go, Off - Wait */
  494. X
  495. X/* special discoveries */
  496. X#define D_HYPER_DRIVE      0 /* hyper-space capable */
  497. X#define D_LASER          1 /* can construct/operate combat lasers */
  498. X#define D_CEW          2 /* can construct/operate cews */
  499. X#define D_TRACTOR_BEAM    4 /* tractor/repulsor beam */
  500. X#define D_TRANSPORTER     5 /* tractor beam (local) */
  501. X#define D_AVPM              6 /* AVPM transporter */
  502. X#define D_CLOAK              7 /* cloaking device */
  503. X#define D_WORMHOLE        8 /* worm-hole */
  504. X#define D_CRYSTAL      9 /* crystal power */
  505. X
  506. X#define Hyper_drive(r)     ((r)->discoveries[D_HYPER_DRIVE])
  507. X#define Laser(r)    ((r)->discoveries[D_LASER])
  508. X#define Cew(r)        ((r)->discoveries[D_CEW])
  509. X#define Tractor_beam(r)    ((r)->discoveries[D_TRACTOR_BEAM])
  510. X#define Transporter(r)    ((r)->discoveries[D_TRANSPORTER])
  511. X#define Avpm(r)        ((r)->discoveries[D_AVPM])
  512. X#define Cloak(r)    ((r)->discoveries[D_CLOAK])
  513. X#define Wormhole(r)    ((r)->discoveries[D_WORMHOLE])
  514. X#define Crystal(r)    ((r)->discoveries[D_CRYSTAL])
  515. X
  516. X#define TECH_HYPER_DRIVE    50.0
  517. X#define TECH_LASER           100.0
  518. X#define TECH_CEW           150.0
  519. X#define TECH_TRACTOR_BEAM      999.0
  520. X#define TECH_TRANSPORTER       999.0
  521. X#define TECH_AVPM           250.0
  522. X#define TECH_CLOAK           999.0
  523. X#define TECH_WORMHOLE           999.0
  524. X#define TECH_CRYSTAL        50.0
  525. X
  526. Xstruct block {
  527. X    int Playernum;
  528. X    char name[RNAMESIZE];
  529. X    char motto[MOTTOSIZE];
  530. X    unsigned long invite[2];
  531. X    unsigned long pledge[2];
  532. X    unsigned long atwar[2];
  533. X    unsigned long allied[2];
  534. X    unsigned short next;
  535. X    unsigned short systems_owned;
  536. X    unsigned long VPs;
  537. X    unsigned long money;
  538. X
  539. X    unsigned long dummy[2];
  540. X};
  541. X
  542. Xstruct power_blocks {
  543. X    char time[128];
  544. X    unsigned long members[MAXPLAYERS];
  545. X    unsigned long troops[MAXPLAYERS];    /* total troops */
  546. X    unsigned long popn[MAXPLAYERS];    /* total population */
  547. X    unsigned long resource[MAXPLAYERS];    /* total resource in stock */
  548. X    unsigned long fuel[MAXPLAYERS];
  549. X    unsigned long destruct[MAXPLAYERS];    /* total dest in stock */
  550. X    unsigned short ships_owned[MAXPLAYERS];    /* # of ships owned */
  551. X    unsigned short systems_owned[MAXPLAYERS];
  552. X    unsigned long sectors_owned[MAXPLAYERS];
  553. X    unsigned long money[MAXPLAYERS];
  554. X    unsigned short VPs[MAXPLAYERS];
  555. X};
  556. X
  557. Xtypedef struct race racetype;
  558. Xtypedef struct block blocktype;
  559. XEXTERN struct block Blocks[MAXPLAYERS];
  560. XEXTERN struct power_blocks Power_blocks;
  561. X
  562. XEXTERN racetype *races[MAXPLAYERS];
  563. END_OF_FILE
  564. if test 5887 -ne `wc -c <'hdrs/races.h'`; then
  565.     echo shar: \"'hdrs/races.h'\" unpacked with wrong size!
  566. fi
  567. # end of 'hdrs/races.h'
  568. fi
  569. if test -f 'misc/planet.list' -a "${1}" != "-c" ; then 
  570.   echo shar: Will not clobber existing file \"'misc/planet.list'\"
  571. else
  572. echo shar: Extracting \"'misc/planet.list'\" \(5494 characters\)
  573. sed "s/^X//" >'misc/planet.list' <<'END_OF_FILE'
  574. XAasarus
  575. XAberius
  576. XAbyssinia
  577. XAceldama
  578. XAchates
  579. XAcheron
  580. XAchilles
  581. XAcropolis
  582. XAcrisis
  583. XAdam
  584. XAdrastea
  585. XAdreaticus
  586. XAeetes
  587. XAegea
  588. XAegir
  589. XAeneas
  590. XAeolus
  591. XAesir
  592. XAesop
  593. XAether
  594. XAgamemnon
  595. XAgnar
  596. XAgni
  597. XAiakos
  598. XAjax
  599. XAkroteri
  600. XAlbion
  601. XAlcmene
  602. XAlexander
  603. XAlfheim
  604. XAmalthea
  605. XAmaterasu
  606. XAmericos
  607. XAmphion
  608. XAnacreon
  609. XAnchises
  610. XAngakok
  611. XAngurboda
  612. XAnsu
  613. XAntaeus
  614. XAntigone
  615. XAnubis
  616. XApache
  617. XApaosha
  618. XAphrodite
  619. XApsyrtus
  620. XAragorn
  621. XArapaho
  622. XArgos
  623. XArgus
  624. XAriadne
  625. XArion
  626. XArmageddon
  627. XAsgard
  628. XAshur
  629. XAstarte
  630. XAthens
  631. XAtlantis
  632. XAtlas
  633. XAtropos
  634. XAttica
  635. XAudhumla
  636. XAvalon
  637. XAzazel
  638. XAziDahak
  639. XAzores
  640. XBaal
  641. XBabylon
  642. XBacchus
  643. XBaezelbub
  644. XBagdemagus
  645. XBalder
  646. XBakongo
  647. XBali
  648. XBan
  649. XBaugi
  650. XBedivere
  651. XBelial
  652. XBellerophon
  653. XBellona
  654. XBenkei
  655. XBergelmir
  656. XBernoulli
  657. XBerserks
  658. XBianca
  659. XBifrost
  660. XBohr
  661. XBoeotia
  662. XBohort
  663. XBora
  664. XBors
  665. XBoz
  666. XBragi
  667. XBrave
  668. XBrisingamen
  669. XBritannia
  670. XBuri
  671. XBushido
  672. XCadiz
  673. XCaeser
  674. XCain
  675. XCamelot
  676. XCamlan
  677. XCanan
  678. XCarbonek
  679. XCarme
  680. XCarthage
  681. XCelaeno
  682. XCelephais
  683. XCeleus
  684. XCelt
  685. XCerberus
  686. XCetelus
  687. XCeto
  688. XCh'eng-huang
  689. XChansky
  690. XChaos
  691. XCharon
  692. XCharybdis
  693. XCheiron
  694. XCherubim
  695. XChi'ih-yu
  696. XChimera
  697. XChiron
  698. XChow
  699. XChuai
  700. XCirrus
  701. XClaire
  702. XCleito
  703. XClotho
  704. XClytemnestra
  705. XCocytus
  706. XColchis
  707. XConiraya
  708. XCordelia
  709. XCorinth
  710. XCoriolis
  711. XCranus
  712. XCrassus
  713. XCressida
  714. XCronus
  715. XCyclops
  716. XCyzicus
  717. XDaedalus
  718. XDagon
  719. XDamon
  720. XDanae
  721. XDanaus
  722. XDannaura
  723. XDanube
  724. XDardanus
  725. XDarkalheim
  726. XDarwin
  727. XDawn
  728. XDeganus
  729. XDeimus
  730. XDelphi
  731. XDemeter
  732. XDemise
  733. XDepth
  734. XDescartes
  735. XDesdemona
  736. XDesire
  737. XDesolation
  738. XDespoina
  739. XDeucalion
  740. XDevadatta
  741. XDharma
  742. XDiana
  743. XDinka
  744. XDiogenes
  745. XDis
  746. XDjanggawul
  747. XDorian
  748. XDorus
  749. XDoula
  750. XDove
  751. XDragon
  752. XDraupnir
  753. XDrak
  754. XDream
  755. XDruj
  756. XDwarka
  757. XDyaus
  758. XEarth
  759. XEcho
  760. XEctoprimax
  761. XEctor
  762. XEddas
  763. XEdjo
  764. XEegos
  765. XEhecatl
  766. XEinstein
  767. XElara
  768. XEldorado
  769. XElectra
  770. XEleusis
  771. XEllindil
  772. XElysia
  773. XEnceladus
  774. XEndoprimax
  775. XEnkindu
  776. XEnlil
  777. XEphialtes
  778. XEphraites
  779. XEpigoni
  780. XEpimetheus
  781. XErebus
  782. XErech
  783. XErgos
  784. XErishkegal
  785. XEros
  786. XEstanatleh
  787. XEteocles
  788. XEurasia
  789. XEuripedes
  790. XEuropa
  791. XEurydice
  792. XEurytion
  793. XExcalibur
  794. XExodus
  795. XFalcha
  796. XFebrus
  797. XFeiLien
  798. XFenrir
  799. XFonLegba
  800. XFourthWorld
  801. XFreedom
  802. XFreuchen
  803. XFreyr
  804. XFrigg
  805. XFrisia
  806. XForseti
  807. XFu-hsi
  808. XFujin
  809. XFuture
  810. XGabora
  811. XGades
  812. XGadir
  813. XGaea
  814. XGalactica
  815. XGalahad
  816. XGalanopoulus
  817. XGalileo
  818. XGandalf
  819. XGanymede
  820. XGarm
  821. XGaokerena
  822. XGathas
  823. XGawain
  824. XGeirrod
  825. XGerda
  826. XGermania
  827. XGeryon
  828. XGhal
  829. XGil-galad
  830. XGilgamesh
  831. XGimli
  832. XGinnungagap
  833. XGjallarhorn
  834. XGlispa
  835. XGondor
  836. XGorgias
  837. XGorgon
  838. XGorlois
  839. XGosadaya
  840. XGraeae
  841. XGranis
  842. XGrunbunde
  843. XGuinevere
  844. XHadad
  845. XHalloway
  846. XHalvec
  847. XHaoma
  848. XHarpie
  849. XHaroeris
  850. XHathor
  851. XHeaven
  852. XHebe
  853. XHecate
  854. XHegel
  855. XHei-tiki
  856. XHeidrun
  857. XHeidegger
  858. XHeimdall
  859. XHeisenburg
  860. XHel
  861. XHelene
  862. XHell
  863. XHelle
  864. XHeracles
  865. XHermod
  866. XHesoid
  867. XHestia
  868. XHimalia
  869. XHodur
  870. XHoeinir
  871. XHomer
  872. XHope
  873. XHotei
  874. XHringhorni
  875. XHugi
  876. XHuron
  877. XHyksos
  878. XHyperion
  879. XIacchos
  880. XIapetus
  881. XIbanis
  882. XIcarus
  883. XIdun
  884. XIlliam
  885. XIllyria
  886. XImperium
  887. XInfinity
  888. XIo
  889. XIolcus
  890. XIoue
  891. XIrkalla
  892. XIsmene
  893. XIulus
  894. XIxbalanque
  895. XIxmirsis
  896. XJackal
  897. XJamsid
  898. XJataka
  899. XJazdarnil
  900. XJena
  901. XJotars
  902. XJotunheim
  903. XJuliet
  904. XJung
  905. XJurojin
  906. XK'unLun
  907. XKachinas
  908. XKadath
  909. XKalki
  910. XKamakura
  911. XKant
  912. XKaraja
  913. XKarnak
  914. XKay
  915. XKepa
  916. XKeshvar
  917. XKettoi
  918. XKhepri
  919. XKhwanirath
  920. XKierkegaard
  921. XKirin
  922. XKishijoten
  923. XKoffler
  924. XKol
  925. XKunmanggur
  926. XKuya-Shonin
  927. XKythamil
  928. XLabyrinth
  929. XLachesis
  930. XLaindjung
  931. XLaius
  932. XLancelot
  933. XLao-tze
  934. XLapiths
  935. XLares
  936. XLarissa
  937. XLarnok
  938. XLeda
  939. XLeibniz
  940. XLeinster
  941. XLemnos
  942. XLeng
  943. XLeodegrance
  944. XLethe
  945. XLeto
  946. XLeviathan
  947. XLhard
  948. XLodbrok
  949. XLodur
  950. XLogan
  951. XLogi
  952. XLoki
  953. XLot
  954. XLotan
  955. XLove
  956. XLugundum
  957. XLungshan
  958. XLuntag
  959. XLuyia
  960. XLycurgus
  961. XLysithea
  962. XMacha
  963. XMador
  964. XMaenads
  965. XMagna
  966. XMandara
  967. XManitou
  968. XMarduk
  969. XMarmora
  970. XMars
  971. XMashyane
  972. XMedea
  973. XMedusa
  974. XMeepzorp
  975. XMegara
  976. XMeneleus
  977. XMenrua
  978. XMercury
  979. XMerlin
  980. XMetis
  981. XMidas
  982. XMidgard
  983. XMimas
  984. XMimir
  985. XMinoa
  986. XMinos
  987. XMiranda
  988. XMiriam
  989. XMirkwood
  990. XMithrandir
  991. XMjolnir
  992. XModred
  993. XMoirai
  994. XMontaigne
  995. XMorrigan
  996. XMulungu
  997. XMunin
  998. XMuspellheim
  999. XNada
  1000. XNagilfar
  1001. XNaiad
  1002. XNanna
  1003. XNarcissus
  1004. XNardis
  1005. XNebo
  1006. XNelligan
  1007. XNeptune
  1008. XNereid
  1009. XNietszche
  1010. XNight
  1011. XNinhursag
  1012. XNinigi
  1013. XNirvana
  1014. XNjord
  1015. XNorn
  1016. XNu-ku
  1017. XNuba
  1018. XNuptadi
  1019. XNyambe
  1020. XNyarlathotep
  1021. XNymph
  1022. XOberon
  1023. XObolus
  1024. XOceana
  1025. XOd
  1026. XOdin
  1027. XOdysseus
  1028. XOedipus
  1029. XOeneus
  1030. XOhrmazd
  1031. XOjin
  1032. XOkesa
  1033. XOkokanoffee
  1034. XOkuninushi
  1035. XOlifat
  1036. XOliphant
  1037. XOlympus
  1038. XOphelia
  1039. XOrchomenus
  1040. XOrd
  1041. XOrestes
  1042. XOrpheus
  1043. XOro
  1044. XOrthoprimax
  1045. XOrunila
  1046. XOsirus
  1047. XOtus
  1048. XOvid
  1049. XOz
  1050. XP'an-Ku
  1051. XPachacutil
  1052. XPan
  1053. XPandora
  1054. XParshya
  1055. XParvati
  1056. XPasiphae
  1057. XPatala
  1058. XPatrise
  1059. XPelias
  1060. XPellas
  1061. XPellinore
  1062. XPeloponnesus
  1063. XPek
  1064. XPercivale
  1065. XPersphone
  1066. XPhegethon
  1067. XPhineas
  1068. XPhobos
  1069. XPhoebe
  1070. XPhoenix
  1071. XPhorcys
  1072. XPhrixus
  1073. XPhyrro
  1074. XPiithar
  1075. XPindar
  1076. XPinel
  1077. XPifall
  1078. XPlanck
  1079. XPlato
  1080. XPluto
  1081. XPolybus
  1082. XPolydectes
  1083. XPolyneices
  1084. XPoseiden
  1085. XPriam
  1086. XPrimax
  1087. XPrithivi
  1088. XPrometheus
  1089. XProetus
  1090. XPthura
  1091. XPtolemy
  1092. XPuck
  1093. XPymeria
  1094. XPyrgos-Dirou
  1095. XPyrrha
  1096. XPythia
  1097. XQaQwaai
  1098. XQuagKeep
  1099. XQuetzalcoatl
  1100. XQuimbaya
  1101. XQuirnok
  1102. XR'lyeh
  1103. XRadha
  1104. XRagnarok
  1105. XRashnu
  1106. XRata
  1107. XReggae
  1108. XRegia
  1109. XRegulus
  1110. XResida
  1111. XRhadamanthys
  1112. XRhea
  1113. XRhpisort
  1114. XRimahad
  1115. XRol
  1116. XRosalind
  1117. XRousseau
  1118. XRudra
  1119. XRuhe
  1120. XRukmini
  1121. XRunes
  1122. XRustam
  1123. XRyobu
  1124. XSagurak
  1125. XSakra
  1126. XSalacia
  1127. XSappedon
  1128. XSardonis
  1129. XSarnak
  1130. XSatan
  1131. XSati
  1132. XSaturn
  1133. XSauron
  1134. XScearce
  1135. XSchopenhaur
  1136. XScylla
  1137. XSecundus
  1138. XSedaria
  1139. XSedna
  1140. XSega
  1141. XSekasis
  1142. XSemele
  1143. XSeneca
  1144. XSeriphos
  1145. XSha-Lana
  1146. XShaman
  1147. XShantak
  1148. XShapash
  1149. XShax
  1150. XShen
  1151. XSiddhartha
  1152. XSif
  1153. XSig
  1154. XSigyn
  1155. XSinope
  1156. XSirens
  1157. XSkidbladnir
  1158. XSkirnir
  1159. XSkrymir
  1160. XSkuld
  1161. XSleipner
  1162. XSocrates
  1163. XSolaria
  1164. XSphinx
  1165. XSpinner
  1166. XSpinoza
  1167. XSrishok
  1168. XStyx
  1169. XSuboceana
  1170. XSuga
  1171. XSugriva
  1172. XSurt
  1173. XSurya
  1174. XSwarga
  1175. XSymplegades
  1176. XSyrinx
  1177. XT'aishan
  1178. XTacitus
  1179. XTadanobu
  1180. XTantrus
  1181. XTare
  1182. XTarnesus
  1183. XTartarus
  1184. XTaweskare
  1185. XTekeli-li
  1186. XTelesto
  1187. XTerminus
  1188. XTerra
  1189. XTethys
  1190. XThalassa
  1191. XThebes
  1192. XThemis
  1193. XThera
  1194. XTheseus
  1195. XThinis
  1196. XThjalfi
  1197. XThjazi
  1198. XThor
  1199. XThought
  1200. XThrace
  1201. XThrasymachus
  1202. XTi'i
  1203. XTigra-nog'th
  1204. XTiki
  1205. XTillich
  1206. XTimaeus
  1207. XTime
  1208. XTirawa-Atius
  1209. XTitan
  1210. XTiu
  1211. XTjinimin
  1212. XTou-Mu
  1213. XTrantor
  1214. XTrashtri
  1215. XTrisala
  1216. XTriton
  1217. XTroll
  1218. XTroy
  1219. XTsathoggua
  1220. XTsentsa
  1221. XTyphon
  1222. XTyr
  1223. XTyrns
  1224. XTyrrea
  1225. XUhura
  1226. XUkaipu
  1227. XUlka
  1228. XUnicorn
  1229. XUnok
  1230. XUpuaut
  1231. XUranus
  1232. XUrd
  1233. XUrdanis
  1234. XUrech
  1235. XUrsa
  1236. XUrsharabi
  1237. XUrth
  1238. XUtgard
  1239. XUther
  1240. XUtnapishtim
  1241. XUxmal
  1242. XVal
  1243. XValhalla
  1244. XValkyrie
  1245. XVanCleef
  1246. XVanaheim
  1247. XVanir
  1248. XVarnak
  1249. XVasuki
  1250. XVe
  1251. XVedies
  1252. XVenus
  1253. XVerdandi
  1254. XVesta
  1255. XVigari
  1256. XVili
  1257. XVirag
  1258. XVivian
  1259. XVishtaspa
  1260. XVohuManuh
  1261. XVoltaire
  1262. XVolva
  1263. XVucu-Caquix
  1264. XVulcan
  1265. XVurat
  1266. XWalla
  1267. XWampum
  1268. XWaterloo
  1269. XWaura
  1270. XWawalag
  1271. XWoden
  1272. XWu
  1273. XXantor
  1274. XXerxes
  1275. XXrka
  1276. XYaddith
  1277. XYami
  1278. XYamotodake
  1279. XYang
  1280. XYangtse
  1281. XYarnek
  1282. XYgerne
  1283. XYggdrasil
  1284. XYin
  1285. XYmir
  1286. XYog-sothoth
  1287. XYu-Nu
  1288. XYu-ti
  1289. XYucatan
  1290. XYumCaax
  1291. XZaaxon
  1292. XZahak
  1293. XZapana
  1294. XZarathrusta
  1295. XZetes
  1296. XZethus
  1297. XZocho
  1298. XZoroaster
  1299. XZrd
  1300. XZurvan
  1301. END_OF_FILE
  1302. if test 5494 -ne `wc -c <'misc/planet.list'`; then
  1303.     echo shar: \"'misc/planet.list'\" unpacked with wrong size!
  1304. fi
  1305. # end of 'misc/planet.list'
  1306. fi
  1307. if test -f 'server/Makefile.SH' -a "${1}" != "-c" ; then 
  1308.   echo shar: Will not clobber existing file \"'server/Makefile.SH'\"
  1309. else
  1310. echo shar: Extracting \"'server/Makefile.SH'\" \(5777 characters\)
  1311. sed "s/^X//" >'server/Makefile.SH' <<'END_OF_FILE'
  1312. Xcase $CONFIG in
  1313. X'')
  1314. X    if test ! -f config.sh; then
  1315. X    ln ../config.sh . || \
  1316. X    ln ../../config.sh . || \
  1317. X    ln ../../../config.sh . || \
  1318. X    (echo "Can't find config.sh."; exit 1)
  1319. X    fi
  1320. X    . ./config.sh
  1321. X    ;;
  1322. Xesac
  1323. Xcase "$0" in
  1324. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1325. Xesac
  1326. X
  1327. Xecho "Extracting server/Makefile (with variable substitutions)"
  1328. Xcat >Makefile <<!GROK!THIS!
  1329. X#
  1330. X#  user level Makefile for the GB+ program
  1331. X#  This makefile will make the commands library routines
  1332. X#
  1333. X# Bug reports, patches, comments, suggestions should be sent to:
  1334. X#
  1335. X#    John Deragon deragon@jethro.cs.nyu.edu
  1336. X#
  1337. X# Revision 1.7 23:34:38 jpd
  1338. X# 
  1339. X#
  1340. X# Variables
  1341. X#    Variables established by Configure
  1342. XCC        =    $cc
  1343. XCCFLAGS        =    $ccflags $xencf
  1344. XCHGRP        =    $chgrp
  1345. XCHMOD        =    $chmod
  1346. XCP        =    $cp
  1347. XDEST        =    $bin
  1348. XECHO        =    $echo
  1349. XLFLAGS        =    $ldflags 
  1350. XLIB        =    -L../user
  1351. XLIBS2        =     -luser
  1352. XLIBS        =    -ltermcap -lcurses -lm
  1353. XLINT        =    $lint
  1354. XMV        =    $mv
  1355. XOPTIMIZE    =    $optimize
  1356. XRM        =     $rm -f
  1357. XAR        =     $ar
  1358. XRANLIB  =   $ranlib
  1359. XTOUCH        =    $touch
  1360. XPORT        =   $port
  1361. XHOST        =   $host
  1362. X
  1363. X!GROK!THIS!
  1364. X
  1365. Xcat >>Makefile <<'!NO!SUBS!'
  1366. X
  1367. X#    Variables you may want to manually edit
  1368. X#        If you want debug logging then you'll
  1369. X#        want to uncomment the following.
  1370. X#DEBUG        =    -DDEBUG
  1371. X
  1372. X#        If you're on an ACSnet system (Australia) then
  1373. X#        you'll want to uncomment the following.
  1374. X# DACSNET    =    -DACSNET
  1375. X
  1376. X#    Other general variables
  1377. XBIN        =    ../bin
  1378. XCFLAGS        =    $(CCFLAGS) $(OPTIMIZE) -I$(INCLDIR) $(DEBUG) $(DACSNET) 
  1379. XINCLDIR        =    ../hdrs
  1380. XLINTFLAGS    =    -I$(INCLDIR)
  1381. XSHELL        =    /bin/sh
  1382. X
  1383. X#     Lists
  1384. XSERVER_SRC        =    GB_server.c \
  1385. X                    doplanet.c \
  1386. X                    dosector.c \
  1387. X                    doship.c \
  1388. X                    doturn.c \
  1389. X                    files.c \
  1390. X                    files_rw.c \
  1391. X                    max.c \
  1392. X                    files_shl.c \
  1393. X                    get4args.c \
  1394. X                    getplace.c \
  1395. X                    misc.c \
  1396. X                    moveplanet.c \
  1397. X                    moveship.c \
  1398. X                    perm.c \
  1399. X                    rand.c \
  1400. X                    log.c \
  1401. X                    lists.c \
  1402. X                    access.c \
  1403. X                    client.c \
  1404. X                    shlmisc.c 
  1405. X
  1406. XSERVER_OBJ        =    GB_server.o \
  1407. X                    doplanet.o \
  1408. X                    dosector.o \
  1409. X                    doship.o \
  1410. X                    doturn.o \
  1411. X                    files.o \
  1412. X                    files_rw.o \
  1413. X                    max.o \
  1414. X                    files_shl.o \
  1415. X                    get4args.o \
  1416. X                    getplace.o \
  1417. X                    misc.o \
  1418. X                    moveplanet.o \
  1419. X                    moveship.o \
  1420. X                    perm.o \
  1421. X                    rand.o \
  1422. X                    log.o \
  1423. X                    lists.o \
  1424. X                    access.o \
  1425. X                    client.o \
  1426. X                    shlmisc.o 
  1427. X
  1428. X
  1429. X
  1430. X# Standard targets
  1431. Xall:        GB
  1432. X
  1433. X#    Dependencies and rules for compiling C programs
  1434. XGB:    $& $(SERVER_OBJ)
  1435. X        $(CC) $(LFLAGS) -o $@ $(SERVER_OBJ) $(LIB) $(LIBS2) $(LIBS)
  1436. X
  1437. Xinstall:
  1438. X        install GB $(BIN)
  1439. X
  1440. Xinstallgbx:
  1441. X        install GBX $(BIN)
  1442. X
  1443. X#   Use this for making a version to debug with
  1444. Xinclude  ../user/OBJECTS
  1445. Xinclude  ../user/SOURCES
  1446. XGBX: $& $(SERVER_OBJ)
  1447. X        $(CC) $(LFLAGS) -g -o $@ $(USER_OBJ) $(SERVER_OBJ) $(LIBS)
  1448. X
  1449. Xsaber:
  1450. X    #load $(CFLAGS) $(SERVER_SRC) $(USER_SRC)
  1451. X
  1452. Xclean: 
  1453. X    $(RM) $(SERVER_OBJ)
  1454. X
  1455. X# DO NOT DELETE THIS LINE -- make depend depends on it.
  1456. XGB_server.o: ../hdrs/TinyMUD_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1457. XGB_server.o: ../hdrs/tweakables.h ../hdrs/config.h ../hdrs/ships.h
  1458. XGB_server.o: ../hdrs/races.h ../hdrs/power.h ../hdrs/doturn.h
  1459. XGB_server.o: ../hdrs/interface.h ../hdrs/buffers.h 
  1460. Xaccess.o:  ../hdrs/interface.h ../hdrs/TinyMUD_copyright.h ../hdrs/files.h
  1461. Xdoplanet.o: ../hdrs/GB_copyright.h ../hdrs/vars.h 
  1462. Xdoplanet.o: ../hdrs/files.h ../hdrs/tweakables.h ../hdrs/config.h
  1463. Xdoplanet.o: ../hdrs/doturn.h ../hdrs/power.h ../hdrs/buffers.h
  1464. Xdosector.o: ../hdrs/GB_copyright.h ../hdrs/vars.h
  1465. Xdosector.o: ../hdrs/files.h ../hdrs/tweakables.h ../hdrs/config.h
  1466. Xdosector.o: ../hdrs/power.h ../hdrs/races.h
  1467. Xdosector.o: ../hdrs/ships.h ../hdrs/doturn.h 
  1468. Xdoship.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1469. Xdoship.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1470. Xdoship.o: ../hdrs/ships.h 
  1471. Xdoship.o: ../hdrs/races.h ../hdrs/doturn.h ../hdrs/power.h ../hdrs/buffers.h
  1472. Xdoturn.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1473. Xdoturn.o: ../hdrs/tweakables.h ../hdrs/config.h ../hdrs/ships.h
  1474. Xdoturn.o: ../hdrs/races.h ../hdrs/doturn.h ../hdrs/power.h ../hdrs/buffers.h
  1475. Xfiles.o: ../hdrs/GB_copyright.h ../hdrs/files.h
  1476. Xfiles_rw.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/buffers.h
  1477. Xfiles_rw.o: ../hdrs/files.h ../hdrs/tweakables.h ../hdrs/config.h
  1478. Xfiles_shl.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1479. Xfiles_shl.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1480. Xfiles_shl.o: ../hdrs/ships.h 
  1481. Xfiles_shl.o: ../hdrs/races.h ../hdrs/power.h ../hdrs/buffers.h
  1482. Xget4args.o: ../hdrs/GB_copyright.h
  1483. Xgetplace.o: ../hdrs/GB_copyright.h ../hdrs/vars.h
  1484. Xgetplace.o: ../hdrs/files.h ../hdrs/tweakables.h ../hdrs/config.h
  1485. Xgetplace.o: ../hdrs/races.h ../hdrs/ships.h
  1486. Xgetplace.o: ../hdrs/power.h ../hdrs/buffers.h 
  1487. Xlists.o: ../hdrs/vars.h ../hdrs/files.h
  1488. Xlists.o: ../hdrs/tweakables.h ../hdrs/config.h ../hdrs/ships.h
  1489. Xlog.o: ../hdrs/vars.h ../hdrs/files.h
  1490. Xlog.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1491. Xmax.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1492. Xmax.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1493. Xmax.o: ../hdrs/power.h ../hdrs/races.h ../hdrs/ships.h 
  1494. Xmisc.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1495. Xmisc.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1496. Xmisc.o: ../hdrs/races.h ../hdrs/buffers.h
  1497. Xmoveplanet.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1498. Xmoveplanet.o: ../hdrs/tweakables.h ../hdrs/config.h
  1499. Xmoveplanet.o: ../hdrs/ships.h
  1500. Xmoveplanet.o: ../hdrs/races.h ../hdrs/doturn.h 
  1501. Xmoveship.o: ../hdrs/GB_copyright.h ../hdrs/vars.h
  1502. Xmoveship.o: ../hdrs/files.h ../hdrs/tweakables.h ../hdrs/config.h
  1503. Xmoveship.o: ../hdrs/power.h ../hdrs/ships.h
  1504. Xmoveship.o: ../hdrs/races.h ../hdrs/doturn.h ../hdrs/buffers.h
  1505. Xperm.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1506. Xperm.o: ../hdrs/tweakables.h ../hdrs/config.h 
  1507. Xrand.o: ../hdrs/GB_copyright.h
  1508. Xshlmisc.o: ../hdrs/GB_copyright.h ../hdrs/vars.h ../hdrs/files.h
  1509. Xshlmisc.o: ../hdrs/tweakables.h ../hdrs/config.h ../hdrs/races.h
  1510. Xshlmisc.o: ../hdrs/power.h ../hdrs/ships.h ../hdrs/buffers.h
  1511. XGBX: $(USER_OBJ)
  1512. X!NO!SUBS!
  1513. END_OF_FILE
  1514. if test 5777 -ne `wc -c <'server/Makefile.SH'`; then
  1515.     echo shar: \"'server/Makefile.SH'\" unpacked with wrong size!
  1516. fi
  1517. # end of 'server/Makefile.SH'
  1518. fi
  1519. if test -f 'server/dosector.c' -a "${1}" != "-c" ; then 
  1520.   echo shar: Will not clobber existing file \"'server/dosector.c'\"
  1521. else
  1522. echo shar: Extracting \"'server/dosector.c'\" \(5569 characters\)
  1523. sed "s/^X//" >'server/dosector.c' <<'END_OF_FILE'
  1524. X/*
  1525. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
  1526. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h, enroll.dat.
  1527. X * Restrictions in GB_copyright.h. dosector.c produce() -- produce, stuff
  1528. X * like that, on a sector. spread()  -- spread population around. explore()
  1529. X * -- mark sector and surrounding sectors as having been explored.
  1530. X */
  1531. X#include <math.h>
  1532. X
  1533. X#include "GB_copyright.h"
  1534. X#define EXTERN extern
  1535. X#include "vars.h"
  1536. X#include "power.h"
  1537. X#include "races.h"
  1538. X#include "ships.h"
  1539. X#include "doturn.h"
  1540. X
  1541. Xextern int      Defensedata[];
  1542. X/* produce stuff in sector */
  1543. X
  1544. Xvoid            produce(startype *, planettype *, sectortype *);
  1545. Xvoid            spread(planettype *, sectortype *, int, int);
  1546. Xvoid            Migrate2(planettype *, int, int, sectortype *, int *);
  1547. Xvoid            explore(planettype *, sectortype *, int, int, int);
  1548. Xvoid            plate(sectortype *);
  1549. X#include "proto.h"
  1550. X
  1551. Xvoid 
  1552. Xproduce(startype * star, planettype * planet, sectortype * s)
  1553. X{
  1554. X    reg int         ss;
  1555. X    reg int         maxsup;
  1556. X    reg int         pfuel = 0, pdes = 0, pres = 0;
  1557. X    reg struct plinfo *pinf;
  1558. X    reg int         prod, diff;
  1559. X    racetype       *Race;
  1560. X
  1561. X    if (!s->owner)
  1562. X        return;
  1563. X    Race = races[s->owner - 1];
  1564. X
  1565. X    if (s->resource && success(s->eff)) {
  1566. X        prod = round_rand(Race->metabolism) * int_rand(1, s->eff);
  1567. X        prod = MIN(prod, s->resource);
  1568. X        s->resource -= prod;
  1569. X        pfuel = prod * (1 + (s->condition == GAS));
  1570. X        if (success(s->mobilization))
  1571. X            pdes = prod;
  1572. X        else
  1573. X            pres = prod;
  1574. X        prod_fuel[s->owner - 1] += pfuel;
  1575. X        prod_res[s->owner - 1] += pres;
  1576. X        prod_destruct[s->owner - 1] += pdes;
  1577. X    }
  1578. X    /* try to find crystals */
  1579. X    /* chance of digging out a crystal depends on efficiency */
  1580. X    if (s->crystals && Crystal(Race) && success(s->eff)) {
  1581. X        prod_crystals[s->owner - 1]++;
  1582. X        s->crystals--;
  1583. X    }
  1584. X    pinf = &planet->info[s->owner - 1];
  1585. X
  1586. X    /* increase mobilization to planetary quota */
  1587. X    if (s->mobilization < pinf->mob_set) {
  1588. X        if (pinf->resource + prod_res[s->owner - 1] > 0) {
  1589. X            s->mobilization++;
  1590. X            prod_res[s->owner - 1] -= round_rand(MOB_COST);
  1591. X            prod_mob++;
  1592. X        }
  1593. X    } else if (s->mobilization > pinf->mob_set) {
  1594. X        s->mobilization--;
  1595. X        prod_mob--;
  1596. X    }
  1597. X    avg_mob[s->owner - 1] += s->mobilization;
  1598. X
  1599. X    /* do efficiency */
  1600. X    if (s->eff < 100) {
  1601. X        reg int         chance;
  1602. X        chance = round_rand((100.0 - (double) planet->info[s->owner - 1].tax) *
  1603. X                    Race->likes[s->condition]);
  1604. X        if (success(chance)) {
  1605. X            s->eff += round_rand(Race->metabolism);
  1606. X            if (s->eff >= 100)
  1607. X                plate(s);
  1608. X        }
  1609. X    } else
  1610. X        plate(s);
  1611. X
  1612. X
  1613. X    if ((s->condition != WASTED) && Race->fertilize && (s->fert < 100))
  1614. X        s->fert += (int_rand(0, 100) < Race->fertilize);
  1615. X    if (s->fert > 100)
  1616. X        s->fert = 100;
  1617. X
  1618. X    if (s->condition == WASTED && success(NATURAL_REPAIR))
  1619. X        s->condition = s->type;
  1620. X
  1621. X    maxsup = maxsupport(Race, s, Compat[s->owner - 1], planet->conditions[TOXIC]);
  1622. X    if ((diff = s->popn - maxsup) < 0) {
  1623. X        if (s->popn >= Race->number_sexes)
  1624. X            ss = round_rand(-(double) diff * Race->birthrate);
  1625. X        else
  1626. X            ss = 0;
  1627. X    } else
  1628. X        ss = -int_rand(0, MIN(2 * diff, s->popn));
  1629. X    s->popn += ss;
  1630. X
  1631. X    if (s->troops)
  1632. X        Race->governor[star->governor[s->owner - 1]].maintain
  1633. X            += UPDATE_TROOP_COST * s->troops;
  1634. X    else if (!s->popn)
  1635. X        s->owner = 0;
  1636. X}
  1637. X
  1638. Xint             x_adj[] = {-1, 0, 1, -1, 1, -1, 0, 1};
  1639. Xint             y_adj[] = {1, 1, 1, 0, 0, -1, -1, -1};
  1640. X
  1641. Xvoid 
  1642. Xspread(reg planettype * pl, reg sectortype * s, reg int x, reg int y)
  1643. X{
  1644. X    int             people;
  1645. X    reg int         x2, y2, j;
  1646. X    reg int         check;
  1647. X    racetype       *Race;
  1648. X
  1649. X    if (!s->owner)
  1650. X        return;
  1651. X    if (pl->slaved_to && pl->slaved_to != s->owner)
  1652. X        return;        /* no one wants to go anywhere */
  1653. X
  1654. X    Race = races[s->owner - 1];
  1655. X
  1656. X    /* the higher the fertility, the less people like to leave */
  1657. X    people = round_rand((double) Race->adventurism * (double) s->popn
  1658. X                * (100. - (double) s->fert) / 100.)
  1659. X        - Race->number_sexes;    /* how many people want to move - one
  1660. X                     * family stays behind */
  1661. X
  1662. X    check = round_rand(6.0 * Race->adventurism);    /* more rounds for high
  1663. X                             * advent */
  1664. X    while (people > 0 && check) {
  1665. X        j = int_rand(0, 7);
  1666. X        x2 = x_adj[j];
  1667. X        y2 = y_adj[j];
  1668. X        Migrate2(pl, x + x2, y + y2, s, &people);
  1669. X        check--;
  1670. X    }
  1671. X
  1672. X}
  1673. X
  1674. Xvoid 
  1675. XMigrate2(planettype * planet, reg int xd, reg int yd, sectortype * ps, int *people)
  1676. X{
  1677. X    reg sectortype *pd;
  1678. X    reg int         move;
  1679. X
  1680. X    /* attempt to migrate beyond screen, or too many people */
  1681. X    if (yd > planet->Maxy - 1 || yd < 0)
  1682. X        return;
  1683. X
  1684. X    if (xd < 0)
  1685. X        xd = planet->Maxx - 1;
  1686. X    else if (xd > planet->Maxx - 1)
  1687. X        xd = 0;
  1688. X
  1689. X    pd = &Sector(*planet, xd, yd);
  1690. X
  1691. X    if (!pd->owner) {
  1692. X        move = (int) ((double) (*people) * Compat[ps->owner - 1] *
  1693. X            races[ps->owner - 1]->likes[pd->condition] / 100.0);
  1694. X        if (!move)
  1695. X            return;
  1696. X        *people -= move;
  1697. X        pd->popn += move;
  1698. X        ps->popn -= move;
  1699. X        pd->owner = ps->owner;
  1700. X        tot_captured++;
  1701. X        Claims = 1;
  1702. X    }
  1703. X}
  1704. X
  1705. X/*
  1706. X * mark sectors on the planet as having been "explored." for sea exploration
  1707. X * on earthtype planets.
  1708. X */
  1709. X
  1710. Xvoid 
  1711. Xexplore(reg planettype * planet, reg sectortype * s, reg int x, reg int y, reg int p)
  1712. X{
  1713. X    reg int         d;
  1714. X
  1715. X    /* explore sectors surrounding sectors currently explored. */
  1716. X    if (Sectinfo[x][y].explored) {
  1717. X        Sectinfo[mod(x - 1, planet->Maxx, d)][y].explored = p;
  1718. X        Sectinfo[mod(x + 1, planet->Maxx, d)][y].explored = p;
  1719. X        if (y == 0) {
  1720. X            Sectinfo[x][1].explored = p;
  1721. X        } else if (y == planet->Maxy - 1) {
  1722. X            Sectinfo[x][y - 1].explored = p;
  1723. X        } else {
  1724. X            Sectinfo[x][y - 1].explored = Sectinfo[x][y + 1].explored = p;
  1725. X        }
  1726. X
  1727. X    } else if (s->owner == p)
  1728. X        Sectinfo[x][y].explored = p;
  1729. X
  1730. X}
  1731. X
  1732. Xvoid 
  1733. Xplate(sectortype * s)
  1734. X{
  1735. X    s->eff = 100;
  1736. X    if (s->condition != GAS)
  1737. X        s->condition = PLATED;
  1738. X}
  1739. END_OF_FILE
  1740. if test 5569 -ne `wc -c <'server/dosector.c'`; then
  1741.     echo shar: \"'server/dosector.c'\" unpacked with wrong size!
  1742. fi
  1743. # end of 'server/dosector.c'
  1744. fi
  1745. if test -f 'user/dissolve.c' -a "${1}" != "-c" ; then 
  1746.   echo shar: Will not clobber existing file \"'user/dissolve.c'\"
  1747. else
  1748. echo shar: Extracting \"'user/dissolve.c'\" \(5186 characters\)
  1749. sed "s/^X//" >'user/dissolve.c' <<'END_OF_FILE'
  1750. X/*
  1751. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky,
  1752. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. Restrictions in
  1753. X * GB_copyright.h. dissolve.c -- commit suicide, nuke all ships and sectors;
  1754. X * July 24th, 1989, John Deragon, cruz@cadman.nyu.edu
  1755. X */
  1756. X
  1757. X#include "GB_copyright.h"
  1758. X#define EXTERN extern
  1759. X#include "vars.h"
  1760. X#include "ships.h"
  1761. X#include "races.h"
  1762. X#include "doturn.h"
  1763. X#include "power.h"
  1764. X#include "buffers.h"
  1765. X#include <math.h>
  1766. X
  1767. Xvoid            dissolve(int, int);
  1768. Xint             revolt(planettype *, int, int);
  1769. X#include "proto.h"
  1770. X
  1771. Xvoid 
  1772. Xdissolve(int Playernum, int Governor)
  1773. X{
  1774. X    int             n_ships;
  1775. X    int             i, j, z, x2, y2, hix, hiy, lowx, lowy;
  1776. X    unsigned char   waste;
  1777. X    shiptype       *sp;
  1778. X    racetype       *Race;
  1779. X    planettype     *pl;
  1780. X    sectortype     *s;
  1781. X    char            nuke;
  1782. X    char            racepass[100], govpass[100];
  1783. X
  1784. X#ifndef DISSOLVE
  1785. X    notify(Playernum, Governor, "Dissolve has been disabled. Please notify diety.\n");
  1786. X    return;
  1787. X#endif
  1788. X
  1789. X    if (Governor) {
  1790. X        notify(Playernum, Governor, "Only the leader may dissolve the race. The leader has been notified of your attempt!!!\n");
  1791. X        sprintf(buf, "Governor #%d has attempted to dissolve this race.\n",
  1792. X            Governor);
  1793. X        notify(Playernum, 0, buf);
  1794. X        return;
  1795. X    }
  1796. X    n_ships = Numships();
  1797. X
  1798. X    if (argn < 3) {
  1799. X        sprintf(buf, "Self-Destruct sequence requires passwords.\n");
  1800. X        notify(Playernum, Governor, buf);
  1801. X        sprintf(buf, "Please use 'dissolve <race password> <leader password>'<option> to initiate\n");
  1802. X        notify(Playernum, Governor, buf);
  1803. X        sprintf(buf, "self-destruct sequence.\n");
  1804. X        notify(Playernum, Governor, buf);
  1805. X        return;
  1806. X    } else {
  1807. X        sprintf(buf, "WARNING!! WARNING!! WARNING!!\n");
  1808. X        notify(Playernum, Governor, buf);
  1809. X        sprintf(buf, "-------------------------------\n");
  1810. X        notify(Playernum, Governor, buf);
  1811. X        sprintf(buf, "Entering self destruct sequence!\n");
  1812. X        notify(Playernum, Governor, buf);
  1813. X
  1814. X        sscanf(args[1], "%s", racepass);
  1815. X        sscanf(args[2], "%s", govpass);
  1816. X
  1817. X        waste = 0;
  1818. X        if (argn > 3) {
  1819. X            sscanf(args[3], "%c", &nuke);
  1820. X            if (nuke == 'w')
  1821. X                waste = 1;
  1822. X        }
  1823. X        Getracenum(racepass, govpass, &i, &j);
  1824. X
  1825. X        if (!i || !j) {
  1826. X            sprintf(buf, "Password mismatch, self-destruct not initiated!\n");
  1827. X            notify(Playernum, Governor, buf);
  1828. X            return;
  1829. X        }
  1830. X        for (i = 1; i <= n_ships; i++) {
  1831. X            (void) getship(&sp, i);
  1832. X            if (sp->owner == Playernum) {
  1833. X                kill_ship(Playernum, sp);
  1834. X                sprintf(buf, "Ship #%d, self-destruct enabled\n", i);
  1835. X                notify(Playernum, Governor, buf);
  1836. X                putship(sp);
  1837. X            }
  1838. X            free(sp);
  1839. X        }
  1840. X
  1841. X        getsdata(&Sdata);
  1842. X        for (z = 0; z < Sdata.numstars; z++) {
  1843. X            getstar(&(Stars[z]), z);
  1844. X            if (isset(Stars[z]->explored, Playernum)) {
  1845. X                for (i = 0; i < Stars[z]->numplanets; i++) {
  1846. X                    getplanet(&pl, z, i);
  1847. X
  1848. X                    if (pl->info[Playernum - 1].explored
  1849. X                        && pl->info[Playernum - 1].numsectsowned) {
  1850. X                        pl->info[Playernum - 1].fuel = 0;
  1851. X                        pl->info[Playernum - 1].destruct = 0;
  1852. X                        pl->info[Playernum - 1].resource = 0;
  1853. X                        pl->info[Playernum - 1].popn = 0;
  1854. X                        pl->info[Playernum - 1].troops = 0;
  1855. X                        pl->info[Playernum - 1].tax = 0;
  1856. X                        pl->info[Playernum - 1].newtax = 0;
  1857. X                        pl->info[Playernum - 1].crystals = 0;
  1858. X                        pl->info[Playernum - 1].numsectsowned = 0;
  1859. X                        pl->info[Playernum - 1].explored = 0;
  1860. X                        pl->info[Playernum - 1].autorep = 0;
  1861. X                    }
  1862. X                    getsmap(Smap, pl);
  1863. X
  1864. X                    lowx = 0;
  1865. X                    lowy = 0;
  1866. X                    hix = pl->Maxx - 1;
  1867. X                    hiy = pl->Maxy - 1;
  1868. X                    for (y2 = lowy; y2 <= hiy; y2++) {
  1869. X                        for (x2 = lowx; x2 <= hix; x2++) {
  1870. X                            s = &Sector(*pl, x2, y2);
  1871. X                            if (s->owner == Playernum) {
  1872. X                                s->owner = 0;
  1873. X                                s->troops = 0;
  1874. X                                s->popn = 0;
  1875. X                                if (waste)
  1876. X                                    /*
  1877. X                                     * cod
  1878. X                                     * e
  1879. X                                     * fol
  1880. X                                     * ded
  1881. X                                     * 
  1882. X                                     * fro
  1883. X                                     * m
  1884. X                                     * her
  1885. X                                     * e
  1886. X                                     */
  1887. X                                    s->condition = WASTED;
  1888. X                                /* unfolding */
  1889. X                            }
  1890. X                        }
  1891. X                    }
  1892. X                    putsmap(Smap, pl);
  1893. X                    putstar(Stars[z], z);
  1894. X                    putplanet(pl, z, i);
  1895. X                    free(pl);
  1896. X                }
  1897. X            }
  1898. X        }
  1899. X
  1900. X        Race = races[Playernum - 1];
  1901. X        Race->dissolved = 1;
  1902. X        putrace(Race);
  1903. X
  1904. X        sprintf(buf, "%s [%d] has dissolved.\n", Race->name, Playernum);
  1905. X        post(buf, DECLARATION);
  1906. X
  1907. X    }
  1908. X}
  1909. X
  1910. X
  1911. Xint 
  1912. Xrevolt(planettype * pl, int victim, int agent)
  1913. X{
  1914. X    int             x, y, hix, hiy, lowx, lowy;
  1915. X    racetype       *Race;
  1916. X    sectortype     *s;
  1917. X    int             changed_hands = 0;
  1918. X
  1919. X    Race = races[victim - 1];
  1920. X
  1921. X    getsmap(Smap, pl);
  1922. X    /* do the revolt */
  1923. X    lowx = 0;
  1924. X    lowy = 0;
  1925. X    hix = pl->Maxx - 1;
  1926. X    hiy = pl->Maxy - 1;
  1927. X    for (y = lowy; y <= hiy; y++) {
  1928. X        for (x = lowx; x <= hix; x++) {
  1929. X            s = &Sector(*pl, x, y);
  1930. X            if (s->owner == victim && s->popn) {
  1931. X                if (success(pl->info[victim - 1].tax)) {
  1932. X                    if (int_rand(1, (int) s->popn) > 10 * Race->fighters * s->troops) {
  1933. X                        s->owner = agent;    /* enemy gets it */
  1934. X                        s->popn = int_rand(1, (int) s->popn);    /* some people killed */
  1935. X                        s->troops = 0;    /* all troops destroyed */
  1936. X                        pl->info[victim - 1].numsectsowned -= 1;
  1937. X                        pl->info[agent - 1].numsectsowned += 1;
  1938. X                        pl->info[victim - 1].mob_points -= s->mobilization;
  1939. X                        pl->info[agent - 1].mob_points += s->mobilization;
  1940. X                        changed_hands++;
  1941. X                    }
  1942. X                }
  1943. X            }
  1944. X        }
  1945. X    }
  1946. X    putsmap(Smap, pl);
  1947. X
  1948. X    return changed_hands;
  1949. X}
  1950. END_OF_FILE
  1951. if test 5186 -ne `wc -c <'user/dissolve.c'`; then
  1952.     echo shar: \"'user/dissolve.c'\" unpacked with wrong size!
  1953. fi
  1954. # end of 'user/dissolve.c'
  1955. fi
  1956. if test -f 'user/enslave.c' -a "${1}" != "-c" ; then 
  1957.   echo shar: Will not clobber existing file \"'user/enslave.c'\"
  1958. else
  1959. echo shar: Extracting \"'user/enslave.c'\" \(4368 characters\)
  1960. sed "s/^X//" >'user/enslave.c' <<'END_OF_FILE'
  1961. X/*
  1962. X * * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, *
  1963. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. * Restrictions in
  1964. X * GB_copyright.h. *  enslave.c -- ENSLAVE the planet below.
  1965. X */
  1966. X
  1967. X#include "GB_copyright.h"
  1968. X#define EXTERN extern
  1969. X#include "vars.h"
  1970. X#include "ships.h"
  1971. X#include "races.h"
  1972. X#include "power.h"
  1973. X#include "buffers.h"
  1974. X#include <signal.h>
  1975. X
  1976. Xvoid            enslave(int, int, int);
  1977. X#include "proto.h"
  1978. X
  1979. Xvoid 
  1980. Xenslave(int Playernum, int Governor, int APcount)
  1981. X{
  1982. X    shiptype       *s, *s2;
  1983. X    planettype     *p;
  1984. X    int             sh, shipno, i, aliens = 0, def = 0, attack = 0;
  1985. X    racetype       *Race;
  1986. X
  1987. X    sscanf(args[1] + (args[1][0] == '#'), "%d", &shipno);
  1988. X
  1989. X    if (!getship(&s, shipno)) {
  1990. X        return;
  1991. X    }
  1992. X    if (testship(Playernum, Governor, s)) {
  1993. X        free(s);
  1994. X        return;
  1995. X    }
  1996. X    if (s->type != STYPE_OAP) {
  1997. X        sprintf(buf, "This ship is not an %s.\n", Shipnames[STYPE_OAP]);
  1998. X        notify(Playernum, Governor, buf);
  1999. X        free(s);
  2000. X        return;
  2001. X    }
  2002. X    if (s->whatorbits != LEVEL_PLAN) {
  2003. X        sprintf(buf, "%s doesn't orbit a planet.\n", Ship(s));
  2004. X        notify(Playernum, Governor, buf);
  2005. X        free(s);
  2006. X        return;
  2007. X    }
  2008. X    if (!enufAP(Playernum, Governor, Stars[s->storbits]->AP[Playernum - 1], APcount)) {
  2009. X        free(s);
  2010. X        return;
  2011. X    }
  2012. X    getplanet(&p, (int) s->storbits, (int) s->pnumorbits);
  2013. X    if (p->info[Playernum - 1].numsectsowned == 0) {
  2014. X        sprintf(buf, "You don't have a garrison on the planet.\n");
  2015. X        notify(Playernum, Governor, buf);
  2016. X        free(s);
  2017. X        free(p);
  2018. X        return;
  2019. X    }
  2020. X    /* add up forces attacking, defending */
  2021. X    for (attack = aliens = def = 0, i = 1; i < MAXPLAYERS; i++) {
  2022. X        if (p->info[i - 1].numsectsowned && i != Playernum) {
  2023. X            aliens = 1;
  2024. X            def += p->info[i - 1].destruct;
  2025. X        }
  2026. X    }
  2027. X
  2028. X    if (!aliens) {
  2029. X        sprintf(buf, "There is no one else on this planet to enslave!\n");
  2030. X        notify(Playernum, Governor, buf);
  2031. X        free(s);
  2032. X        free(p);
  2033. X        return;
  2034. X    }
  2035. X    Race = races[Playernum - 1];
  2036. X
  2037. X    sh = p->ships;
  2038. X    while (sh) {
  2039. X        (void) getship(&s2, sh);
  2040. X        if (s2->alive && s2->active) {
  2041. X            if (p->info[s2->owner].numsectsowned && s2->owner != Playernum)
  2042. X                def += s2->destruct;
  2043. X            else if (s2->owner == Playernum)
  2044. X                attack += s2->destruct;
  2045. X        }
  2046. X        sh = s2->nextship;
  2047. X        free(s2);
  2048. X    }
  2049. X
  2050. X    deductAPs(Playernum, Governor, APcount, (int) s->storbits, 0);
  2051. X
  2052. X    sprintf(buf, "\nFor successful enslavement this ship and the other ships here\n");
  2053. X    notify(Playernum, Governor, buf);
  2054. X    sprintf(buf, "that are yours must have a weapons\n");
  2055. X    notify(Playernum, Governor, buf);
  2056. X    sprintf(buf, "capacity greater than twice that the enemy can muster, including\n");
  2057. X    notify(Playernum, Governor, buf);
  2058. X    sprintf(buf, "the planet and all ships orbiting it.\n");
  2059. X    notify(Playernum, Governor, buf);
  2060. X    sprintf(buf, "\nTotal forces bearing on %s:   %d\n", prin_ship_orbits(s), attack);
  2061. X    notify(Playernum, Governor, buf);
  2062. X
  2063. X    sprintf(telegram_buf, "ALERT!!!\n\nPlanet /%s/%s ",
  2064. X        Stars[s->storbits]->name,
  2065. X        Stars[s->storbits]->pnames[s->pnumorbits]);
  2066. X
  2067. X    if (def <= 2 * attack) {
  2068. X        p->slaved_to = Playernum;
  2069. X        putplanet(p, (int) s->storbits, (int) s->pnumorbits);
  2070. X
  2071. X        /* send telegs to anyone there */
  2072. X        sprintf(buf, "ENSLAVED by %s!!\n", Ship(s));
  2073. X        strcat(telegram_buf, buf);
  2074. X        sprintf(buf, "All material produced here will be\ndiverted to %s coffers.",
  2075. X            Race->name);
  2076. X        strcat(telegram_buf, buf);
  2077. X
  2078. X        sprintf(buf, "\nEnslavement successful.  All material produced here will\n");
  2079. X        notify(Playernum, Governor, buf);
  2080. X        sprintf(buf, "be diverted to %s.\n", Race->name);
  2081. X        notify(Playernum, Governor, buf);
  2082. X        sprintf(buf, "You must maintain a garrison of 0.1%% the population of the\n");
  2083. X        notify(Playernum, Governor, buf);
  2084. X        sprintf(buf, "planet (at least %.0f); otherwise there is a 50%% chance that\n", p->popn * 0.001);
  2085. X        notify(Playernum, Governor, buf);
  2086. X        sprintf(buf, "enslaved population will revolt.\n");
  2087. X        notify(Playernum, Governor, buf);
  2088. X    } else {
  2089. X        sprintf(buf, "repulsed attempt at enslavement by %s!!\n", Ship(s));
  2090. X        strcat(telegram_buf, buf);
  2091. X        sprintf(buf, "Enslavement repulsed, defense/attack Ratio : %d to %d.\n", def, attack);
  2092. X        strcat(telegram_buf, buf);
  2093. X
  2094. X        sprintf(buf, "Enslavement repulsed.\n");
  2095. X        notify(Playernum, Governor, buf);
  2096. X        sprintf(buf, "You needed more weapons bearing on the planet...\n");
  2097. X        notify(Playernum, Governor, buf);
  2098. X    }
  2099. X
  2100. X    for (i = 1; i < MAXPLAYERS; i++)
  2101. X        if (p->info[i - 1].numsectsowned && i != Playernum)
  2102. X            warn(i, (int) Stars[s->storbits]->governor[i - 1], telegram_buf);
  2103. X
  2104. X    free(p);
  2105. X    free(s);
  2106. X}
  2107. END_OF_FILE
  2108. if test 4368 -ne `wc -c <'user/enslave.c'`; then
  2109.     echo shar: \"'user/enslave.c'\" unpacked with wrong size!
  2110. fi
  2111. # end of 'user/enslave.c'
  2112. fi
  2113. if test -f 'user/togg.c' -a "${1}" != "-c" ; then 
  2114.   echo shar: Will not clobber existing file \"'user/togg.c'\"
  2115. else
  2116. echo shar: Extracting \"'user/togg.c'\" \(4634 characters\)
  2117. sed "s/^X//" >'user/togg.c' <<'END_OF_FILE'
  2118. X#ident  "@(#)togg.c    1.5 2/1/93 "
  2119. X/***********************************************
  2120. X * togg.c
  2121. X *
  2122. X * Created: ???
  2123. X * Author:  Robert Chansky
  2124. X *
  2125. X * Version: 1.5 00:14:42
  2126. X *
  2127. X * Contains: toggle()
  2128. X *           highlight()
  2129. X *           tog()
  2130. X *
  2131. X ***********************************************/
  2132. X
  2133. X#include "GB_copyright.h"
  2134. X#define EXTERN extern
  2135. X#include "vars.h"
  2136. X#include "ships.h"
  2137. X#include "races.h"
  2138. X#include "power.h"
  2139. X#include "buffers.h"
  2140. X#include <strings.h>
  2141. X
  2142. X/*
  2143. X * Prototypes
  2144. X */
  2145. Xvoid            toggle(int, int, int);
  2146. Xvoid            highlight(int, int);
  2147. Xvoid            tog(int, int, char *, char *);
  2148. X#include "proto.h"
  2149. X
  2150. X/*
  2151. X * toggle:
  2152. X * 
  2153. X * arguments: Playernum Governor
  2154. X * 
  2155. X * called by: process_commands
  2156. X * 
  2157. X * description:  Called from process_commands, allows you to toggle some
  2158. X * options. Currently inverse, double_digits, gag, autoload, color, and
  2159. X * monitor
  2160. X * 
  2161. X */
  2162. Xvoid
  2163. Xtoggle(int Playernum, int Governor, int APcount)
  2164. X{
  2165. X    racetype       *Race;
  2166. X
  2167. X    Race = races[Playernum - 1];
  2168. X
  2169. X    if (argn > 1) {
  2170. X        if (match(args[1], "inverse"))
  2171. X            tog(Playernum, Governor,
  2172. X            &Race->governor[Governor].toggle.inverse, "inverse");
  2173. X        else if (match(args[1], "double_digits"))
  2174. X            tog(Playernum, Governor,
  2175. X                &Race->governor[Governor].toggle.double_digits, "double_digits");
  2176. X        else if (match(args[1], "geography"))
  2177. X            tog(Playernum, Governor,
  2178. X                &Race->governor[Governor].toggle.geography, "geography");
  2179. X        else if (match(args[1], "gag"))
  2180. X            tog(Playernum, Governor,
  2181. X                &Race->governor[Governor].toggle.gag, "gag");
  2182. X        else if (match(args[1], "autoload"))
  2183. X            tog(Playernum, Governor,
  2184. X                &Race->governor[Governor].toggle.autoload, "autoload");
  2185. X        else if (match(args[1], "color"))
  2186. X            tog(Playernum, Governor,
  2187. X                &Race->governor[Governor].toggle.color, "color");
  2188. X        else if (match(args[1], "visible"))
  2189. X            tog(Playernum, Governor,
  2190. X                &Race->governor[Governor].toggle.invisible, "invisible");
  2191. X        else if (Race->God && match(args[1], "monitor"))
  2192. X            tog(Playernum, Governor, &Race->monitor, "monitor");
  2193. X        else if (match(args[1], "compatibility"))
  2194. X            tog(Playernum, Governor,
  2195. X                &Race->governor[Governor].toggle.compat, "compatibility");
  2196. X        else if (match(args[1], "client")) {
  2197. X            CSP_client_toggle(Playernum, Governor, 0);    
  2198. X        } else {
  2199. X            sprintf(buf, "No such option '%s'\n", args[1]);
  2200. X            notify(Playernum, Governor, buf);
  2201. X            return;
  2202. X        }
  2203. X        putrace(Race);
  2204. X    } else {
  2205. X        sprintf(buf, "gag is %s\n",
  2206. X            Race->governor[Governor].toggle.gag ? "ON" : "OFF");
  2207. X        notify(Playernum, Governor, buf);
  2208. X
  2209. X        sprintf(buf, "inverse is %s\n",
  2210. X            Race->governor[Governor].toggle.inverse ? "ON" : "OFF");
  2211. X        notify(Playernum, Governor, buf);
  2212. X
  2213. X        sprintf(buf, "double_digits is %s\n",
  2214. X            Race->governor[Governor].toggle.double_digits ? "ON" : "OFF");
  2215. X        notify(Playernum, Governor, buf);
  2216. X
  2217. X        sprintf(buf, "geography is %s\n",
  2218. X          Race->governor[Governor].toggle.geography ? "ON" : "OFF");
  2219. X        notify(Playernum, Governor, buf);
  2220. X
  2221. X        sprintf(buf, "autoload is %s\n",
  2222. X           Race->governor[Governor].toggle.autoload ? "ON" : "OFF");
  2223. X        notify(Playernum, Governor, buf);
  2224. X
  2225. X        sprintf(buf, "color is %s\n",
  2226. X              Race->governor[Governor].toggle.color ? "ON" : "OFF");
  2227. X        notify(Playernum, Governor, buf);
  2228. X
  2229. X        sprintf(buf, "compatibility is %s\n",
  2230. X             Race->governor[Governor].toggle.compat ? "ON" : "OFF");
  2231. X        notify(Playernum, Governor, buf);
  2232. X
  2233. X        sprintf(buf, "%s\n",
  2234. X            Race->governor[Governor].toggle.invisible ? "INVISIBLE" : "VISIBLE");
  2235. X        notify(Playernum, Governor, buf);
  2236. X
  2237. X        sprintf(buf, "highlight player %d\n",
  2238. X            Race->governor[Governor].toggle.highlight);
  2239. X        notify(Playernum, Governor, buf);
  2240. X
  2241. X        sprintf(buf, "client mode is %s\n",
  2242. X            Race->governor[Governor].CSP_client_info.csp_user ? "ON" : "OFF");
  2243. X        notify(Playernum, Governor, buf);
  2244. X
  2245. X        if (Race->God) {
  2246. X            sprintf(buf, "monitor is %s\n", Race->monitor ? "ON" : "OFF");
  2247. X            notify(Playernum, Governor, buf);
  2248. X        }
  2249. X    }
  2250. X}
  2251. X/*
  2252. X * hightlight:
  2253. X * 
  2254. X * arguments: Playernum Governor
  2255. X * 
  2256. X * description:  Called process commands.
  2257. X * 
  2258. X */
  2259. Xvoid
  2260. Xhighlight(int Playernum, int Governor)
  2261. X{
  2262. X    int             n;
  2263. X    racetype       *Race;
  2264. X
  2265. X    if (!(n = GetPlayer(args[1]))) {
  2266. X        sprintf(buf, "No such player.\n");
  2267. X        notify(Playernum, Governor, buf);
  2268. X        return;
  2269. X    }
  2270. X    Race = races[Playernum - 1];
  2271. X    Race->governor[Governor].toggle.highlight = n;
  2272. X    putrace(Race);
  2273. X}
  2274. X
  2275. X/*
  2276. X * tog:
  2277. X * 
  2278. X * arguments: Playernum Governor op  - what we are toggling name
  2279. X * 
  2280. X * called by: toggle (local to this file)
  2281. X * 
  2282. X * description: This function does the acutal toggle of the bits
  2283. X * 
  2284. X */
  2285. Xvoid
  2286. Xtog(int Playernum, int Governor, char *op, char *name)
  2287. X{
  2288. X    *op = !(*op);
  2289. X    sprintf(buf, "%s is now %s\n", name, *op ? "on" : "off");
  2290. X    notify(Playernum, Governor, buf);
  2291. X}
  2292. END_OF_FILE
  2293. if test 4634 -ne `wc -c <'user/togg.c'`; then
  2294.     echo shar: \"'user/togg.c'\" unpacked with wrong size!
  2295. fi
  2296. # end of 'user/togg.c'
  2297. fi
  2298. echo shar: End of archive 19 \(of 21\).
  2299. cp /dev/null ark19isdone
  2300. MISSING=""
  2301. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
  2302.     if test ! -f ark${I}isdone ; then
  2303.     MISSING="${MISSING} ${I}"
  2304.     fi
  2305. done
  2306. if test "${MISSING}" = "" ; then
  2307.     echo You have unpacked all 21 archives.
  2308.     echo "Now type './buildfiles.sh'"
  2309.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2310. else
  2311.     echo You still need to unpack the following archives:
  2312.     echo "        " ${MISSING}
  2313. fi
  2314. ##  End of shell archive.
  2315. exit 0
  2316.