billr@saab.CNA.TEK.COM (Bill Randle) (06/02/90)
Submitted-by: VANCLEEF@mps.ohio-state.edu Posting-number: Volume 10, Issue 12 Archive-name: gb3/Part12 Supersedes: GB2: Volume 7, Issue 44-51 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of archive 12 (of 14)." # Contents: Docs/assault.doc Docs/blocks.doc Docs/enslave.doc # Docs/help.doc Docs/message.doc Docs/news.doc Docs/oldnews.doc # Docs/orbit.doc Docs/survey.doc client/orbit.c server/autoreport.c # server/capitol.c server/daemon.c server/examine.c server/max.c # server/mobiliz.c server/more.c server/moveplanet.c server/races.h # server/relation.c server/tech.c server/toggle.c # Wrapped by billr@saab on Fri Jun 1 11:53:45 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'Docs/assault.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/assault.doc'\" else echo shar: Extracting \"'Docs/assault.doc'\" \(2606 characters\) sed "s/^X//" >'Docs/assault.doc' <<'END_OF_FILE' XASSAULT Galactic Bloodshed ASSAULT X X XNAME X [1] assault -- attempt capture of ship/planet X XSYNTAX X assault #<shipnumber> <where> <number of boarders> X XDESCRIPTION X This command may be used when a player wishes to capture a ship or planet Xintact instead of laying waste to it. To perform an assault, the ship involved Xmust be 10 units of distance to the enemy or closer (much like ``land''.) X X XCAPTURING A PLANET X X The player will receive a combat readiness bonus of 100 on the disputed Xplanet only if he does not already have extensive colonies there. Combat Xreadiness represents how ready and willing the inhabitants are to fight. XOver time, this combat readiness will tend towards the average mobilization Xof the sectors each player owns. The mobilization of the assaulted sector Xwill be set to 100, as will the mobilization quota (see ``mobilize''). X X Each turn sectors bordered by two opposing players will be contested, both Xraces will receive casualties in disputed sectors and the winner, if there is Xone, will move in. Being possibly outnumbered by the planet's original Xinhabitants, the assaulting player may have to resort to orbital bombardment Xbefore the natives wise up and surrender. (see the section on ``slavery''). XThis, however, carries it's own price -- sectors may be rendered uninhabitable Xfor some time and of no use to anyone. X X XCAPTURING A SHIP X X You will be prompted for how many boarders you wish to risk in this Xendeavor. This must be at least one and at most the entire ship's crew. XYou cannot assault with more crew than the maximum crew capacity of the Xother ship. Your total boarding strength is calculated, and compared with Xthe other ship's, and casualties are taken. If you win, you capture the ship; Xif you lose, the ships are not docked and you will have to try again. It Xmay take several tries to capture a ship, especially if there are a lot of Xenemy crew. Some structural damage to both ships is unavoidable, and may Xresult in the destruction of one or the other (or both). X X The boarding strength of the attacking ship is proportional to the Xlogarithms of the following: the number of boarders, the tech of their race, Xand their fighting ability. The defending strength of the other ship depends Xon these same factors and the armor class of the defending ship. Note that Xin attacking, any ship is as good as any other; it only depends on the Xsoldiers. Smaller groups of boarders can actually be more effective than Xlarger groups, but the attacker will need AP's and patience for several Xassaults. X XSEE ALSO X enslave, land, fire X END_OF_FILE if test 2606 -ne `wc -c <'Docs/assault.doc'`; then echo shar: \"'Docs/assault.doc'\" unpacked with wrong size! fi # end of 'Docs/assault.doc' fi if test -f 'Docs/blocks.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/blocks.doc'\" else echo shar: Extracting \"'Docs/blocks.doc'\" \(1023 characters\) sed "s/^X//" >'Docs/blocks.doc' <<'END_OF_FILE' XBLOCKS Galactic Bloodshed BLOCKS X X XNAME X [0] block -- list empires and their approximate influence X XSYNTAX X block <leader or block number> X XDESCRIPTION X X This command will list the relative power of each alliance Xblock, or a specific alliance block if specified. Each player Xmay lead one alliance block only. In order to get people to Xinto the group you must use the 'invite <player>' to request Xmembership. The other player may join the alliance block by Xusing 'pledge <leader or block number>'. A player may quit Xor blackball another for his group by doing 'uninvite <player>' Xor 'unpledge <leader or block number>'. Alliance blocks Xdo not force alliances among its members. In fact, it solely Xis used for political purposes. However, an alliance block Xcan win the game by accumulating the required number of Xvictory points. This is the sum of all VPs accumulated Xby its current members (not programmed in yet). X X You can name your alliance block with 'name block <your block's Xname>'. X X SEE ALSO X power END_OF_FILE if test 1023 -ne `wc -c <'Docs/blocks.doc'`; then echo shar: \"'Docs/blocks.doc'\" unpacked with wrong size! fi # end of 'Docs/blocks.doc' fi if test -f 'Docs/enslave.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/enslave.doc'\" else echo shar: Extracting \"'Docs/enslave.doc'\" \(2049 characters\) sed "s/^X//" >'Docs/enslave.doc' <<'END_OF_FILE' XENSLAVE Galactic Bloodshed ENSLAVE X X XNAME X [1] enslave -- enslave a world X XSYNTAX X enslave <shipnumber> X XDESCRIPTION X This command is used to convert entire planets to a condition of slavery. XWhen invoked the ship specified must be an Orbital Assault Platform, which Xis the only ship type sufficiently impressive to convince the planetary Xpopulation of the futility of resistance. The platform must be orbiting Xthe planet to be enslaved. X X To commence a proper enslavement, the forces bearing (the platform itself Xplus the other ships which might be orbiting the planet) against the Xplanet must be more than twice the defending strength (weapons under the Xcontrol of the inhabitants plus the weapons on board any ships they own in Xorbit around the planet). The enslaving player must have a garrison (at Xleast one population) on the planet. X X The enslaving player is not told how much strength the other players might Xhave, but he is told whether the planet was enslaved or not. Telegram Xmessages are sent to any players affected by the command. X X To keep the planet the enslaving player must maintain a garrison of at Xleast 0.1% of the total population on the planet. (The garrison need not be Xthat large to initiate slavery, but must be that large to maintain it.) XIf the garrison falls below this threshold, and the OASP is no longer in Xorbit around the planet, a revolution is immediate and devastating: Xall sectors belonging to the former slave holder are destroyed in the Xinhabitants' fury of revolution. If the OASP is still there, there is a Xchance (50%) that a revolution will not occur, and some occupying sectors Xmay not be destroyed (without it overhead, they will be). Other random Xsectors will be damaged as well in the fight. X X When a planet is under enslavement, everything produced there will be Xcredited to the slave-holding player's stockpiles. Races enslaved on a Xplanet can still survey, map, build, and otherwise observe things happening Xthere (there is an active resistance). X X X SEE ALSO X survey, map END_OF_FILE if test 2049 -ne `wc -c <'Docs/enslave.doc'`; then echo shar: \"'Docs/enslave.doc'\" unpacked with wrong size! fi # end of 'Docs/enslave.doc' fi if test -f 'Docs/help.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/help.doc'\" else echo shar: Extracting \"'Docs/help.doc'\" \(2598 characters\) sed "s/^X//" >'Docs/help.doc' <<'END_OF_FILE' XGalactic.Bloodshed commands: X X X () or none -required arguments. []-optional arguments. X xlow:xhi,ylow:yhi-means a range of sectors from xlow to xhi, and ylow to X yhi. also legal: x,y xlow:xhi,y x,ylow:yhi X path : a scope path; separated by '/'. ex: /sol/Earth means system sol, planet X Earth; ../Mars means the scope above you, planet (or star for that X matter) Mars. these may be abbreviated. Substitute ':' for the X current scope you are in for any command. 'path' can be substituted X with '#(shipno)' for many commands. X X Xsurvey [xlow:xhi,ylow:yhi] -- look at survey on range of sectors or planet X or star. X Xbuild [shiptypeletter] [x,y] -- build a ship/object. X Xcs ([#(shipnumber)|[:]|[/]|[..]|[planetname]|[starname]|[/] etc.) -- X change scope. ( ".." = up one; X ':' = current scope; X <name> = down to planet or star, X #(shipnumber) = that ship number.) X Xdeclare -- state relations (alliance, neutrality, war) to other players. X Xfire -- fire from ship or planet, to ship or planet X Xload [#shipnum] -- load/unload commodities from ship. X Xlaunch [#shipnum] -- launch a ship from a planet or the ship it is docked with. X Xland [#shipnum] [x,y] -- land a ship on a planet, sector x,y. X Xmobilize -- build up military readiness in sectors. X Xmap [path] -- look at sector map if [path] is a planet; use orbit otherwise. X Xname -- rename an object (star or planet). X Xorbit [options] [path] -- graphic representation of ship and planet positions. X Xorder [ #shipnum ] -- send orders to ships: turn them on/off, X navigation, speed setting, various other things dependent X on the type of ship. X Xprofile -- racial profile. X Xpower -- report of all races and their approximate influence in the game. X Xscrap [#shipnum] -- turn a ship/object into scrap. X Xstock [#shipnumber] -- ship report. X Xread -- read telegram messages. X Xrelation -- report on the relations between your player and the other players X in the game; also translation modifiers. X Xreport [#shipnumber] -- navigational ship report. X Xtactical [#shipnumber] -- tactical report of enemy ships within range of yours. X Xtechnology -- invest production into technological development. X Xtelegram [ path | playername | player# ] -- send a message to another player, X or to whomever resides in (path): if ship, the owner of the ship, X if planet, anyone inhabiting it, X if star, anyone with colonies/ships X there. X Xtoxicity -- Set a threshold to build toxic waste canisters when toxicity gets X too high. X Xzoom (amount) | (numerator/denominator) [x,y] -- zoom in/out for orbit display. X Xquit -- quit. X Xhelp -- this file. X END_OF_FILE if test 2598 -ne `wc -c <'Docs/help.doc'`; then echo shar: \"'Docs/help.doc'\" unpacked with wrong size! fi # end of 'Docs/help.doc' fi if test -f 'Docs/message.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/message.doc'\" else echo shar: Extracting \"'Docs/message.doc'\" \(1921 characters\) sed "s/^X//" >'Docs/message.doc' <<'END_OF_FILE' X******************************************************************** X X12/14/89 - 4 hour updates have started (we changed our minds). X 12, 4, 8 am/pm PST. There may also be unscheduled X updates in case of anything unusual that may crop up X (hopefully nothing). X X12/13/89 - Looks like we got major problems ironed out now. X Production is fixed, planets now orbit stars by Keppler's X Law, and a few other technical stuff to improve reliability. X You can go ahead and enroll again. X X Also, if you have never played before, when the program X asks you for your password, type the password by which X you expect to be referred to of by GB. This *is* your X password. Please do not enroll more than once, we have a X limited number of openings. X X12/12/89 - WELL I LOST THE DATA BASE!! (accidentally used 'rm' X instead of 'cp' when I was trying to back it up. GRR!!!) X Production was messed up anyway (unknown, some pointer is X mislabeled). I want to make sure this is working tonight X before we start again. Sorry folks! X -Garrett X X12/8/89 - Make sure that your combat ships ('d', 'C', 'B', 'D', '$') X have resources on board to repair damage! (When these X ships are built they begin with a 50% damage level). X During battle, resources are required to be on board to repair X ships. Also, make sure you load destruct on ships so your guns X have ammo to fire. The game automatically loads fuel and crew to X the max available in a sector. If you don't want that X unload the crew with 'load' or 'unload' (same thing). Keep X in mind that the efficiency of the ship depends on the X amount of crew available (max crew is best!) X X12/5/89 - Check out the new options 'aliens', 'geography' and X 'inverse'. Do 'help map' to find out about what they X do. X --> I compiled these options into one command 'toggle', X in anticipation of adding tons more later on. -Rob X X******************************************************************** END_OF_FILE if test 1921 -ne `wc -c <'Docs/message.doc'`; then echo shar: \"'Docs/message.doc'\" unpacked with wrong size! fi # end of 'Docs/message.doc' fi if test -f 'Docs/news.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/news.doc'\" else echo shar: Extracting \"'Docs/news.doc'\" \(2767 characters\) sed "s/^X//" >'Docs/news.doc' <<'END_OF_FILE' X************************************************************* X X10/24/89 ********** FIRE --- IMPORTANT ********************* X X In case you have been upset with the randomness in X the fire routine, I tried to implement as change. X I will do this in several stages. For the moment X everything is completely deterministic, so look at X the damages you do (and get) and see if you like them. X Comments are appreciated. I will ad dthe random factors X later, I think they are neccessary but hard for X debugging. To save you a lot of experimenting, here is how X it works: X X SHIPS to SHIPS: X effstr = (your strenght) * FAC / (1+dist/DIST) X currently FAC = 2, DIST = 300 X X damage = (effstr-3*armor)/2 X X Thats it !! Simple enough ?? X X PLANETS on PLANETS: (proposed!). There will be no X more firing from planets on planets, if you want X to attack a planet you should build ships. X This will eliminate the common trick of X wasing one sector, landing and letting the X planet destroy itsself. X X PLANETS on SHIPS: I think I will inclease the planet guns X back to 40 (or 60 ???), a planet should be able to X vaporize anything that attacks it. Note that X The damage on the ship will be calculated as above. X These two changes, for the first time, might make X planetary defense logical. X X SHIPS on PLANETS: Same as before, except, you have to be X there to attack. Only ORBITING ships will be X able to attack planets. This should disallow X somebody entering your system to wipe out your X planets instantaneously. X X X X X6/29/89 - For those of you who haven't noticed, you can tell 'map' X or 'orbit' to omit the names of ships, stars, or planets X to get a look at objects that may be overprinting others X so you can see them. do `help map' or `help orbit' to X see how to do this. X X6/26/89 - When you order ships to go to other systems, do not X specify planet designations until your ships arrive at X the star. X X6/23/89 - Just a reminder, don't build ships/objects with a `*' X designation in front of them. They haven't been programmed X and will just be a waste of resources. X X6/22/89 - You must load fuel and crew onto an atmospheric processor `A' X to get them to work. See help in `build' for details. X X6/22/89 - Cargo ships, shuttle, stations, orbital assualt platforms, X and habitats can be used to construct other ships. X X6/21/89 - Teletransporter devices '[' are now working. X X6/9/89 - We have installed the new version of Galactic Bloodshed 1.0(osu). X This has superior addressing and whatnot from the previous bug-ridden X version. It has several new features. Good luck with this one. END_OF_FILE if test 2767 -ne `wc -c <'Docs/news.doc'`; then echo shar: \"'Docs/news.doc'\" unpacked with wrong size! fi # end of 'Docs/news.doc' fi if test -f 'Docs/oldnews.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/oldnews.doc'\" else echo shar: Extracting \"'Docs/oldnews.doc'\" \(2767 characters\) sed "s/^X//" >'Docs/oldnews.doc' <<'END_OF_FILE' X************************************************************* X X10/24/89 ********** FIRE --- IMPORTANT ********************* X X In case you have been upset with the randomness in X the fire routine, I tried to implement as change. X I will do this in several stages. For the moment X everything is completely deterministic, so look at X the damages you do (and get) and see if you like them. X Comments are appreciated. I will ad dthe random factors X later, I think they are neccessary but hard for X debugging. To save you a lot of experimenting, here is how X it works: X X SHIPS to SHIPS: X effstr = (your strenght) * FAC / (1+dist/DIST) X currently FAC = 2, DIST = 300 X X damage = (effstr-3*armor)/2 X X Thats it !! Simple enough ?? X X PLANETS on PLANETS: (proposed!). There will be no X more firing from planets on planets, if you want X to attack a planet you should build ships. X This will eliminate the common trick of X wasing one sector, landing and letting the X planet destroy itsself. X X PLANETS on SHIPS: I think I will inclease the planet guns X back to 40 (or 60 ???), a planet should be able to X vaporize anything that attacks it. Note that X The damage on the ship will be calculated as above. X These two changes, for the first time, might make X planetary defense logical. X X SHIPS on PLANETS: Same as before, except, you have to be X there to attack. Only ORBITING ships will be X able to attack planets. This should disallow X somebody entering your system to wipe out your X planets instantaneously. X X X X X6/29/89 - For those of you who haven't noticed, you can tell 'map' X or 'orbit' to omit the names of ships, stars, or planets X to get a look at objects that may be overprinting others X so you can see them. do `help map' or `help orbit' to X see how to do this. X X6/26/89 - When you order ships to go to other systems, do not X specify planet designations until your ships arrive at X the star. X X6/23/89 - Just a reminder, don't build ships/objects with a `*' X designation in front of them. They haven't been programmed X and will just be a waste of resources. X X6/22/89 - You must load fuel and crew onto an atmospheric processor `A' X to get them to work. See help in `build' for details. X X6/22/89 - Cargo ships, shuttle, stations, orbital assualt platforms, X and habitats can be used to construct other ships. X X6/21/89 - Teletransporter devices '[' are now working. X X6/9/89 - We have installed the new version of Galactic Bloodshed 1.0(osu). X This has superior addressing and whatnot from the previous bug-ridden X version. It has several new features. Good luck with this one. END_OF_FILE if test 2767 -ne `wc -c <'Docs/oldnews.doc'`; then echo shar: \"'Docs/oldnews.doc'\" unpacked with wrong size! fi # end of 'Docs/oldnews.doc' fi if test -f 'Docs/orbit.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/orbit.doc'\" else echo shar: Extracting \"'Docs/orbit.doc'\" \(2156 characters\) sed "s/^X//" >'Docs/orbit.doc' <<'END_OF_FILE' X XORBIT Galactic Bloodshed ORBIT X X XNAME X [0] orbit -- Graphic representation of objects in current scope X XSYNOPSIS X orbit <[-n] [-S] [-p] [-s] [-ship/planet number]> <path> X XDESCRIPTION X X Orbit gives a visual map of all stars, planets, and ships in the scope Xof ``path'' or the current scope if none is specified. You cannot map an Xarea that has not been visited by one of your ships. X X If ``path'' is the root, ``orbit'' will show all the stars in the game, Xand all ships travelling in interstellar space that belong to the player. X X If ``path'' is a star, orbit will display the solar system there Xwith its star in the center and orbiting planets around it, plus all ships Xthat are the player's (or can be detected). X X If ``path'' is a planet orbit will display that planet and orbiting Xships. X X If ``path'' is in the form ``#shipnum'' orbit will display a map of Xwhichever system or planet the ship is at. X X If no path has been specified, the current scope is used, and display will Xbe centered around the current ``lastx,lasty'' coordinates. These coordinates Xrepresent the x,y location of the last scope the player was in. For instance, Xif a player types the following: X X [xx] / >cs #5/.. X [yy] / Sol / Sol-III >orbit X X The orbit display will be centered around the location of ship #5. X X When no path is specified, the zoom factor comes into play as well. Display Xwill appear larger or smaller according to the zoom factor (1.0 being normal). XIf there is a specified path argument to orbit, zoom and last coordinates are Xnot dealt with. (It is as if they are 0,0 and 1.0, respectively.) X X X OPTIONS X X when invoking ``orbit'' the options given (except for ``-(number)'') can be Xeither in the form "-pSs" or spread out as in "-p -S -s -3". X X X -p : If this option is set, ``orbit'' will not display planet names. X X -S : Do not display star names. X X -s : Do not display ships. X X -(number) : Do not display that #'d ship or planet (should it obstruct X the view of another object). Stars or planets are numbered X sequentially from 1, while ships can be referenced by their X ship number. X X XSEE ALSO X map, cs, scope, zoom X END_OF_FILE if test 2156 -ne `wc -c <'Docs/orbit.doc'`; then echo shar: \"'Docs/orbit.doc'\" unpacked with wrong size! fi # end of 'Docs/orbit.doc' fi if test -f 'Docs/survey.doc' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'Docs/survey.doc'\" else echo shar: Extracting \"'Docs/survey.doc'\" \(2504 characters\) sed "s/^X//" >'Docs/survey.doc' <<'END_OF_FILE' XSURVEY Galactic Bloodshed SURVEY X X XNAME X [0] survey -- more detailed survey of planet, sector, ship, star X XSYNOPSIS X survey <xlow:xhi,ylow:yhi or x,y> X XDESCRIPTION X survey gives a different report depending on what scope it is used on. XThe possible scopes are ship, planet, and star. X XCensus on sector X X x,y des eff mob frt res popn ^popn X 5,7 x 20 50 45 25 80 196 X X x,y: map coordinates on sector X des: designation of sector (land, water, etc) X eff: efficiency (%age it is built up) of the sector X mob: % mobilization of the citizens in that sector X frt: fertility of the sector (supports people) X res: resource deposits in the sector X popn: population of the sector X ^popn: maximum population the sector can support X XCensus on planet X X gravity x,y absolute x,y relative to Sol X 1.00 -24222,5424 -324,755 X X gravity: gravity of the planet (relative to Earth normal) X x,y absolute: coordinates relative to the Center of the Universe X x,y relative..: coordinates relative to the planet's primary X X ======== planetary conditions: ======== X Gives the atmospheric concentrations of certain key elements in the X planet's atmosphere: Oxygen, CO2, Methane, Hydrogen, Nitrogen, Helium, X Sulfur, surface temperature, normal temperature (without artificial X influencing factors like space mirrors), and 'Other'. The 'Total X planetary compatibility' is the difference between the weighted sum X of each of these characteristics and the preferences of the player X (expressed in parentheses after each characteristic). X X fuel_stock resource_stock dest_pot. popltn ^popltn X 173 92 101 1158 2901 X X x,y: the x,y coordinates of the planet relative to its star X fuel_stock: fuel the player has managed to stockpile on the planet X resource_stock: stockpiled resources on the planet X dest_pot: stockpiled destructive potential on the planet (weapons) X popltn: total population of living beings X ^popltn: maximum number of living beings the planet can support X (inhabited sectors only) X XCensus on star X X Locn: x,y coordinates of the star from the Center of the Universe X gravity: gravitational influence X stability: Stability of the star. As stability approaches 100, the star X will become more and more unstable. The player must have a technology X of 3 or more to determine the stability. X X XCensus on ship #n X X Same as the command 'ship #n' X XSEE ALSO X ship, report, map, weapons, mobilize END_OF_FILE if test 2504 -ne `wc -c <'Docs/survey.doc'`; then echo shar: \"'Docs/survey.doc'\" unpacked with wrong size! fi # end of 'Docs/survey.doc' fi if test -f 'client/orbit.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'client/orbit.c'\" else echo shar: Extracting \"'client/orbit.c'\" \(2728 characters\) sed "s/^X//" >'client/orbit.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu X * X * orbit.c -- display orbits of planets (graphic representation) X * X * OPTIONS X * -p : If this option is set, ``orbit'' will not display planet names. X * X * -S : Do not display star names. X * X * -s : Do not display ships. X * X * -(number) : Do not display that #'d ship or planet (in case it obstructs X * the view of another object) X */ X X#include "GB_copyright.h" X#define NAMESIZE 18 X X#define SCALE 100.0 X#define S_X (stdscr->_maxx - NAMESIZE) X#define S_Y (stdscr->_maxy - 1) X#define Midx (0.5*(S_X - NAMESIZE)/SCALE) X#define Midy (0.5*S_Y /SCALE) X X#include <curses.h> X#include <stdio.h> X#include "arrays.h" X#include "client.h" Xextern char *index(), *malloc(); Xextern hugestr current_output; Xextern int have_inv; X Xfloat Lastx, Lasty, Zoom; X Xplot_orbit(t) X char *t; X{ X int x, y, array; X int stand1, stand2; X char *u, *v; X char temp[1024], symbol; X int more_data = 1; X string blob; X X X clear(); X X u = t + 1; X while (more_data) { X while ((v = index(u, ';')) != NULL) { X *v = 0; X sscanf(u, "%d %d %d %d %1s %d %s", &stand1, &x, &y, &array, X &symbol, &stand2, temp); X x = (int) x * Midx; X y = (int) y * Midy; X if (x <= S_X && y <= S_Y) { X X if (symbol == 'm') { /* space mirror */ X DispArray(x, y, 9, 5, Mirror[array], 1.0); X } else if (symbol == '*' && array > 0) { /* nova */ X DispArray(x, y, 11, 7, Novae[array - 1], 1.0); X } X if (stand1 * have_inv) X standout(); X mvaddch(y, x, symbol); X if (stand1 * have_inv) X standend(); X if (symbol == '@' || symbol == '*') { X addstr(" "); X } X if (stand2 * have_inv) X standout(); X addstr(temp); X if (stand2 * have_inv) X standend(); X } X u = v + 1; X } X X move(S_Y - 1, 0); X if (strlen(u) == 0) { X refresh(); X return; X } X if (index(u, '\n') != NULL) { X print_with_wrap(u); X more_data = 0; X } else { X receive(blob); X strcpy(current_output, u); X strcat(current_output, blob); X u = current_output; X } X } X X refresh(); X return; X} X X/* X * display array on screen. at the moment magnification is not implemented. X */ XDispArray(x, y, maxx, maxy, array, mag) X int x, y; X int maxx, maxy; X char *array[]; X float mag; X{ X register int x2, y2, curx, cury; X X for (cury = y - maxy / 2, y2 = 0; y2 < maxy; cury++) { X if (cury >= 0 && cury <= S_Y) { X move(cury, curx = x - maxx / 2); X for (x2 = 0; x2 < maxx; curx++) { X if (curx >= 0 && curx <= S_X) X if (inch() == ' ') X addch(array[y2][x2]); X else X move(cury, curx); X /* one to right */ X x2++; X } X } X y2++; X } X X} END_OF_FILE if test 2728 -ne `wc -c <'client/orbit.c'`; then echo shar: \"'client/orbit.c'\" unpacked with wrong size! fi # end of 'client/orbit.c' fi if test -f 'server/autoreport.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/autoreport.c'\" else echo shar: Extracting \"'server/autoreport.c'\" \(2211 characters\) sed "s/^X//" >'server/autoreport.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.c. X * Restrictions in GB_copyright.h.c. X * autoreport.c -- tell server to generate a report for each planet X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "ships.h" X#include "buffers.h" X Xautoreport(Playernum,APcount, argn,args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xplanettype *p; Xplacetype place; Xint autoreport_pdata,autoreport_sectdata; X Xif (argn==1) { /* no args */ X if (Dir[Playernum-1].level==LEVEL_PLAN) { X openpdata(&autoreport_pdata); X getplanet(autoreport_pdata,&p, X Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X if (p->info[Playernum-1].autorep) X p->info[Playernum-1].autorep = 0; X else X p->info[Playernum-1].autorep = TELEG_MAX_AUTO; X X putplanet(autoreport_pdata, p, X Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(autoreport_pdata); X X sprintf(buf,"Autoreport on %s has been %s.\n", X Stars[Dir[Playernum-1].snum]->pnames[Dir[Playernum-1].pnum], X p->info[Playernum-1].autorep ? "set" : "unset"); X notify(Playernum, buf); X Xfree(p); X } else { X sprintf(buf,"Scope must be a planet or ship.\n"); X notify(Playernum, buf); X return(1); X } X} else if (argn==2) { /* argn==2, place specified */ X place = Getplace(Playernum,args[1], 0); X if (place.level==LEVEL_PLAN) { X openpdata(&autoreport_pdata); X getplanet(autoreport_pdata,&p, X Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X X sprintf(buf,"Autoreport on %s has been %s.\n", X Stars[Dir[Playernum-1].snum]->pnames[Dir[Playernum-1].pnum], X p->info[Playernum-1].autorep ? "set" : "unset"); X notify(Playernum, buf); X X p->info[Playernum-1].autorep = !p->info[Playernum-1].autorep; X putplanet(autoreport_pdata, p, X Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(autoreport_pdata); X X free(p); X } else { X sprintf(buf,"Scope must be a planet or ship.\n"); X notify(Playernum, buf); X return(1); X } X } else if (argn>2) { X sprintf(buf,"Autoreport: error in args.\n"); X notify(Playernum, buf); X return(1); X } X X} END_OF_FILE if test 2211 -ne `wc -c <'server/autoreport.c'`; then echo shar: \"'server/autoreport.c'\" unpacked with wrong size! fi # end of 'server/autoreport.c' fi if test -f 'server/capitol.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/capitol.c'\" else echo shar: Extracting \"'server/capitol.c'\" \(1824 characters\) sed "s/^X//" >'server/capitol.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * capitol.c -- designate a capitol X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "ships.h" X#include "races.h" X#include "buffers.h" X#include <signal.h> X Xint capitol_racedata; X Xcapitol(Playernum,APcount, argn,args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint shipno,stat; Xint shdata; Xshiptype *s; X Xfree(Race); Xopenracedata(&capitol_racedata); Xgetrace(capitol_racedata, &Race, Playernum); Xclose_file(capitol_racedata); X X if (argn!=2) { X X shipno = Race->Gov_ship; X X } else { X X shipno = atoi(args[1]+(args[1][0]=='#')); X X if (Dir[Playernum-1].level==LEVEL_UNIV) { X if (!enufAP(Playernum,Sdata.AP[Playernum-1],APcount)) X return; X } else { X if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1],APcount)) X return; X } X } X Xif(shipno <= 0) { X notify(Playernum, "Change the capitol to be what ship?\n"); X return; X } X X openshdata(&shdata); X stat = getship(shdata, &s, shipno); X close_file(shdata); X X if (argn==2) { X if (!stat || testship(Playernum,s, shipno)) X return; X X if (s->type!=OTYPE_GOV) { X sprintf(buf,"That ship is not a %s.\n",Shipnames[OTYPE_GOV]); X notify(Playernum, buf); X return; X } X X if (Dir[Playernum-1].level==LEVEL_UNIV) X deductAPs(Playernum, APcount, 0, 1); X else X deductAPs(Playernum, APcount, Dir[Playernum-1].snum, 0); X X Race->Gov_ship = shipno; Xopenracedata(&capitol_racedata); X putrace(capitol_racedata, Race); Xclose_file(capitol_racedata); X X } X sprintf(buf,"Efficiency of governmental center: %.0f%%.\n", X ((float)s->popn/Max_crew(s)) * X (100 - (float)s->damage) ); X notify(Playernum, buf); X X free(s); X X} END_OF_FILE if test 1824 -ne `wc -c <'server/capitol.c'`; then echo shar: \"'server/capitol.c'\" unpacked with wrong size! fi # end of 'server/capitol.c' fi if test -f 'server/daemon.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/daemon.c'\" else echo shar: Extracting \"'server/daemon.c'\" \(1853 characters\) sed "s/^X//" >'server/daemon.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * daemon.c -- sleep for awhile, then do a turn X */ X X#include "GB_copyright.h" X#include "config.h" X#include "tweakables.h" X#include "files.h" X#include <stdio.h> X#include <signal.h> X#include <time.h> X#include <sys/types.h> X#include <sys/timeb.h> X#include <sys/file.h> X#include <sys/ioctl.h> X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X struct tm *t; X long clk; X int updtime,exstat,turn=0,update=0,fd2; X FILE *fd; Xchar buf[128]; X X if (fork()) exit(); /* detach from shell */ X X sigblock(SIGHUP|SIGQUIT); /* ignore signal from owner logging out */ X X X fd2 = open("/dev/tty", O_RDWR); /* disassociate from tty */ X ioctl(fd2, TIOCNOTTY, 0); X close(fd2); X X if (argc>1) X updtime = atoi(argv[1]); X else X updtime = DEFAULT_UPDATE_TIME; X X /* initialize the data file to feed telnet */ X if ((fd = fopen(DAEMONFL, "w")) == NULL) X perror("GB_daemon open of daemon.dat failed"); X else X fprintf(fd, "%s\n%s\n", DAEMON_PASSWORD, QUIT_COMMAND); X fclose(fd); X X while (1) { X X clk = time(0); X t = localtime(&clk); X X printf("day %d,hour %d,min %d,sec %d\n", X t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); X X if ( (t->tm_hour % updtime)==0 && update!=t->tm_hour ) { X update = t->tm_hour; X printf("Requesting update\n"); X /* this will trigger the update */ X /* X exstat = system("telnet pooh 2010 < daemon.dat"); X */ X sprintf(buf,"telnet %s %d < %s", GB_HOST, GB_PORT, DAEMONFL); X exstat = system(buf); X X fd = fopen(PROFDATAFL, "a"); X clk = time(0); X t = localtime(&clk); X fprintf(fd,"turn %d @ day %d,hour %d,min %d,sec %d, time=%d secs, exit %d\n", X turn++, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, X t->tm_min * 60 + t->tm_sec, exstat); X fclose(fd); X } else X sleep(600); X } X X} END_OF_FILE if test 1853 -ne `wc -c <'server/daemon.c'`; then echo shar: \"'server/daemon.c'\" unpacked with wrong size! fi # end of 'server/daemon.c' fi if test -f 'server/examine.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/examine.c'\" else echo shar: Extracting \"'server/examine.c'\" \(2114 characters\) sed "s/^X//" >'server/examine.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * examine -- check out an object X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "ships.h" X#include "buffers.h" Xextern int Shipdata[NUMSTYPES][NUMABILS]; Xextern char *Shipnames[]; X Xexamine(Playernum,APcount, argn,args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ X shiptype *ship; X int c,t,shdata,shipno; X FILE *fd; Xchar ch, temp[128]; X X sscanf(args[1] + ((*args[1]=='#') ? 1 : 0),"%d",&shipno); X X openshdata(&shdata); X if (!getship(shdata,&ship,shipno)) { X close_file(shdata); X return; X } X close_file(shdata); X if (!ship->is_alive) { X sprintf(buf,"that ship is dead.\n"); X notify(Playernum, buf); X free(ship); X return; X } X if (ship->whatorbits==LEVEL_UNIV || isclr(Stars[ship->storbits]->inhabited, Playernum)) { X sprintf(buf,"That ship it not visible to you.\n"); X notify(Playernum, buf); X return; X } X X if ((fd=fopen(EXAM_FL, "r"))==NULL) { X perror(EXAM_FL); X return; X } X X /* look through ship data file */ X for (t=0; t<=ship->type; t++) X while (fgetc(fd) != '~') ; X X /* look through ship data file */ X sprintf(buf, "\n"); X /* give report */ X while ((ch=fgetc(fd)) != '~') { X sprintf(temp, "%c", ch); X strcat(buf, temp); X } X notify(Playernum, buf); X fclose(fd) ; X X if (!ship->is_examined) { X if (ship->whatorbits==LEVEL_UNIV) X deductAPs(Playernum,APcount, 0, 1); /* ded from sdata */ X else X deductAPs(Playernum,APcount, ship->storbits, 0); X X ship->is_examined = 1; X openshdata(&shdata); X putship(shdata,ship,shipno); X close_file(shdata); X X } X X if (has_switch(ship)) { X sprintf(buf,"This device has an on/off switch that can be set with order.\n"); X notify(Playernum, buf); X } X if (!ship->active) { X sprintf(buf,"This device has been irradiated;\nit's crew is dying and it cannot move for the time being.\n"); X notify(Playernum, buf); X } X X free(ship); X X} END_OF_FILE if test 2114 -ne `wc -c <'server/examine.c'`; then echo shar: \"'server/examine.c'\" unpacked with wrong size! fi # end of 'server/examine.c' fi if test -f 'server/max.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/max.c'\" else echo shar: Extracting \"'server/max.c'\" \(2305 characters\) sed "s/^X//" >'server/max.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * maxsupport() -- return how many people one sector can support X * Distmap() -- map-oriented distance that does not look square X * compatibility() -- return how much race is compatible with planet X * gravity() -- return gravity for planet X * prin_ship_orbits() -- prints place ship orbits X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "races.h" X#include "ships.h" X#include <math.h> X X/* max this sector can support of specified race. X */ Xint maxsupport(r,p,c,toxic) Xreg racetype *r; Xreg sectortype *p; Xfloat c; /* (compatibility of race sector) */ Xint toxic; X{ Xint val; Xfloat a,b; Xa=FACTOR_FERT_SUPPORT * (log1p((double)1.*p->eff) * log1p((double)p->fert)+1.0); Xb=.01 * ((r==NULL) ? 0.0 : r->likes[p->des]) X * (MAX(0.0, MIN(100.0, c+20.0*(r->number_sexes-2)))); X X Xval = (int)( a * b * .01 * (100.0 - (float)toxic) ); X Xreturn val; X} X X X Xint Distmap(x,y,x2,y2) Xreg int x,y,x2,y2; X{ X return( round_rand(fabs((double)x-x2) + fabs( (double)y-y2)*(RATIOXY*0.5) ) ); X} X X Xfloat compatibility(planet, race) Xreg planettype *planet; Xreg racetype *race; X{ X reg int i,add; X float sum=1.0; X X /* make an adjustment for planetary temperature */ X add = 0.1*((float)planet->conditions[TEMP]-race->conditions[TEMP]); X sum *= 1.0 -(abs(add)/100.0); X X /* step through and report compatibility of each planetary gas */ X for (i=TEMP+1; i<=OTHER; i++) { X add = ((float)planet->conditions[i] - race->conditions[i]); X sum *= 1.0 - (abs((float)add)/100.0); X } X if(sum < 0.0) sum = 0.0; X sum *= 100.0 - planet->conditions[TOXIC]; X X return (sum); X X} X X X Xfloat gravity(p) Xplanettype *p; X{ X return (float)p->Maxx * p->Maxy * GRAV_FACTOR; X} X X X Xchar Dispshiporbits_buf[PLACENAMESIZE+13]; X Xchar *prin_ship_orbits(s) Xshiptype *s; X{ X X switch (s->whatorbits) { X case LEVEL_UNIV: X sprintf(Dispshiporbits_buf,"/(%.0f,%.0f)",s->xpos,s->ypos); X break; X case LEVEL_STAR: X sprintf(Dispshiporbits_buf,"/%s", Stars[s->storbits]->name); X break; X case LEVEL_PLAN: X sprintf(Dispshiporbits_buf,"/%s/%s", X Stars[s->storbits]->name, X Stars[s->storbits]->pnames[s->pnumorbits]); X break; X default: X break; X } X return Dispshiporbits_buf; X} END_OF_FILE if test 2305 -ne `wc -c <'server/max.c'`; then echo shar: \"'server/max.c'\" unpacked with wrong size! fi # end of 'server/max.c' fi if test -f 'server/mobiliz.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/mobiliz.c'\" else echo shar: Extracting \"'server/mobiliz.c'\" \(1820 characters\) sed "s/^X//" >'server/mobiliz.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * mobilize.c -- persuade people to build military stuff. X * Sectors that are mobilized produce Destructive Potential in X * proportion to the % they are mobilized. they are also more X * damage-resistant. X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "buffers.h" X#include <signal.h> X#include <ctype.h> Xint mobilize_sectdata,mobilize_pdata; X Xmobilize(Playernum,APcount, argn, args) Xint Playernum; Xint APcount, argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint owned=0,x,y,sum_mob=0; Xsectortype *s; Xplanettype *p; X Xmobilize_pdata = mobilize_sectdata = NEUTRAL_FD; X Xif (Dir[Playernum-1].level!=LEVEL_PLAN) { X sprintf(buf,"scope must be a planet.\n"); X notify(Playernum, buf); X return; X} Xif (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) { X return; X } X X openpdata(&mobilize_pdata); X getplanet(mobilize_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); Xclose_file(mobilize_pdata); X X opensectdata(&mobilize_sectdata); X getsmap(mobilize_sectdata,Smap,p); X close_file(mobilize_sectdata); X Xif(argn < 2) { X sprintf(buf, "Current mobilization: %d Quota: %d\n", X p->info[Playernum-1].comread, p->info[Playernum-1].mob_set); X notify(Playernum, buf); X return; X } X X X X sum_mob = atoi(args[1]); X X if (sum_mob > 100 || sum_mob < 0) { X sprintf(buf,"Illegal value.\n"); X notify(Playernum, buf); X return; X } X X X p->info[Playernum-1].mob_set = sum_mob; Xopenpdata(&mobilize_pdata); Xputplanet(mobilize_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(mobilize_pdata); X X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0); X X free(p); X X} X END_OF_FILE if test 1820 -ne `wc -c <'server/mobiliz.c'`; then echo shar: \"'server/mobiliz.c'\" unpacked with wrong size! fi # end of 'server/mobiliz.c' fi if test -f 'server/more.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/more.c'\" else echo shar: Extracting \"'server/more.c'\" \(1833 characters\) sed "s/^X//" >'server/more.c' <<'END_OF_FILE' X/* more program by therat@ucscb.ucsc.edu */ X X#include <stdio.h> X#include <sys/file.h> X#include <sgtty.h> X X#define ZMORE 0 X X Xmain(argc, argv) Xint argc; Xchar **argv; X{ X int c=1; X X while (c < argc) X doc(argv[c++]); X} X Xdoc(s) Xchar *s; X{ X char filename[128], tmpfile[128]; X int fd, pid; X long t; X X sprintf(filename, "%s", s); X /* could stat the file here to make sure it's there */ X X time(&t); X sprintf(tmpfile, "/usr/tmp/#GBtrash%05d", (t >> 4) & 0x7fff); X fd = open(tmpfile, O_CREAT | O_WRONLY | O_TRUNC, 0600); X if (fd < 0) { X fprintf(stderr, "doc(): %s: ", filename); X perror("open failed"); X return; X } X X switch (pid = fork()) { X case -1 : X perror("doc(): fork for zcat failed"); X break; X X case 0 : X dup2(fd, 1); X# if (ZMORE) X execl("/usr/ucb/zcat", "zcat", filename, 0); X perror("doc(): execl for zcat failed"); X# else X execl("/bin/cat", "cat", filename, 0); X# endif X X default : X while (wait(0) != pid) X ; X } X X close(fd); X page(tmpfile); X unlink(tmpfile); X} X Xpage(file) Xchar *file; X{ X char buf[4096]; X FILE *fp; X int line; X X fp = fopen(file, "r"); X if (!fp) { X fprintf(stderr, "page(): %s: ", file); X perror("open failed"); X return; X } X X while (fgets(buf, sizeof(buf), fp)) { X ++line; X fputs(buf, stdout); X if (line == 23) { X char ch; X X fputs(" -- more -- ", stdout); X fflush(stdout); X do X ch = get_a_char(); X while (ch != ' ' && ch!='q'); X fputs("\b\b\b\b\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b\b\b\b\b", stdout); X if (ch=='q') { X fclose (fp); X return; X } X line = 0; X } X } X fclose(fp); X} X Xget_a_char() X{ X struct sgttyb foo, bar; X char c; X X ioctl(0, TIOCGETP, &foo); X bar = foo; X foo.sg_flags |= CBREAK; X foo.sg_flags &= ~ECHO; X ioctl(0, TIOCSETN, &foo); X X c = getchar(); X/* while (!read(0, &c, 1)) */ X/* ; */ X X X ioctl(0, TIOCSETN, &bar); X X return c; X} END_OF_FILE if test 1833 -ne `wc -c <'server/more.c'`; then echo shar: \"'server/more.c'\" unpacked with wrong size! fi # end of 'server/more.c' fi if test -f 'server/moveplanet.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/moveplanet.c'\" else echo shar: Extracting \"'server/moveplanet.c'\" \(2104 characters\) sed "s/^X//" >'server/moveplanet.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * moveplanet.c -- move the planet in orbit around its star. X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "ships.h" X#include "races.h" /* (needed only for races in doturn.h */ X#include "doturn.h" X#include <math.h> X X Xmoveplanet(starnum, planet, planetnum) Xint starnum; Xplanettype *planet; Xint planetnum; X{ Xfloat dist; Xfloat t,xadd,yadd,phase,period; Xint sh; Xreg int i; Xshiptype *ship; X X/* return; */ X X StarsInhab[starnum] |= Stars[starnum]->inhabited; X Stars[starnum]->inhabited = 0; X X if (planet->popn) X Stinfo[starnum][planetnum].inhab = 1; X X if (!StarsInhab[starnum]) X return; /* no one's explored the star yet */ X X dist = hypot((double)planet->ypos, (double)planet->xpos); X Xphase = atan2((double)planet->ypos, (double)planet->xpos); Xperiod = dist * sqrt((double)dist / X (SYSTEMGRAVCONST * Stars[starnum]->gravity)); X /* keppler's law */ X X xadd = dist * cos((double)(-1./period+phase)) - planet->xpos; X yadd = dist * sin((double)(-1./period+phase)) - planet->ypos; X /* one update time unit - planets orbit counter-clockwise */ X X/* printf("st %d pl %d xadd %g yadd %g \n", starnum, planetnum, xadd, yadd); Xprintf("(%s) \n",Stars[starnum]->name); */ X X /* adjust ships in orbit around the planet */ X X sh = planet->ships; X X while (sh && sh<=Num_ships) { /* just in case... */ X ship=ships[sh]; X /* don't do landed ships */ X if (ship->is_alive && !(ship->is_docked && ship->whatdest==LEVEL_PLAN)) { X ship->xpos += xadd; X ship->ypos += yadd; X } Xif(sh == ship->nextship) /* shouldn't happen, but it did */ X sh = 0; Xelse X sh = ship->nextship; X X } X/* printf("**** \n"); */ X X planet->xpos += xadd; X planet->ypos += yadd; X X/* well, maybe : */ X if (planet->xpos>SYSTEMSIZE) planet->xpos *= .5; X else if (planet->xpos< -SYSTEMSIZE) planet->xpos *= .5; X if (planet->ypos>SYSTEMSIZE) planet->ypos *= .5; X else if (planet->ypos< -SYSTEMSIZE) planet->ypos *= .5; X X} END_OF_FILE if test 2104 -ne `wc -c <'server/moveplanet.c'`; then echo shar: \"'server/moveplanet.c'\" unpacked with wrong size! fi # end of 'server/moveplanet.c' fi if test -f 'server/races.h' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/races.h'\" else echo shar: Extracting \"'server/races.h'\" \(2054 characters\) sed "s/^X//" >'server/races.h' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB.c, enroll.dat. X * Restrictions in GB.c. X */ X X Xstruct race { X int Playernum; X char name[RNAMESIZE]; X float tech; /* technology */ X float birthrate; X float overbirthrate; X percent fighters; X percent IQ; X percent number_sexes; X float mass; X float metabolism; X float adventurism; X short conditions[OTHER+1]; /* planetary conditions you like */ X char deflevel; X char defsystem; X char defplanetnum; /* current default */ X char homelevel; X char homesystem; X char homeplanetnum; /* home place */ X float likes[DES_PLATED+1]; /* what territories they like */ X char likesbest; X percent translate[MAXPLAYERS]; /* translation mod for each player */ X percent captured_prisoners[MAXPLAYERS]; /* goes up with planetary contact */ X unsigned int atwar; /* war 32 bits*/ X unsigned int allied; /* allies 32 bits*/ X unsigned short Gov_ship; X int double_digits; /* options for 'toggle' */ X int inverse; X int geography; X int autoload; X int C_C; /* berserker control code */ X short God; /* whether or not the race has God status */ X unsigned Thing : 1; /* your race is like "The Thing" */ X}; X Xstruct block { X int Playernum; X char name[RNAMESIZE]; X unsigned int invite; X unsigned int pledge; X unsigned int atwar; X unsigned int allied; X unsigned VPs; X}; X Xstruct power_blocks { X char time[128]; X unsigned members[MAXPLAYERS]; X ul popn[MAXPLAYERS]; /* total population */ X ul resource[MAXPLAYERS]; /* total resource in stock */ X ul fuel[MAXPLAYERS]; X ul destruct[MAXPLAYERS]; /* total dest in stock */ X us ships_owned[MAXPLAYERS]; /* # of ships owned */ X us planets_owned[MAXPLAYERS]; X ul sectors_owned[MAXPLAYERS]; X us VPs[MAXPLAYERS]; X}; X Xtypedef struct race racetype; Xtypedef struct block blocktype; XEXTERN struct block Blocks[MAXPLAYERS]; XEXTERN struct power_blocks Power_blocks; X XEXTERN racetype *Race; XEXTERN racetype *races[MAXPLAYERS]; END_OF_FILE if test 2054 -ne `wc -c <'server/races.h'`; then echo shar: \"'server/races.h'\" unpacked with wrong size! fi # end of 'server/races.h' fi if test -f 'server/relation.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/relation.c'\" else echo shar: Extracting \"'server/relation.c'\" \(2071 characters\) sed "s/^X//" >'server/relation.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * relation.c -- state relations among players X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "races.h" X#include "ships.h" X#include "buffers.h" X Xextern char *Desnames[]; Xchar *allied(); Xint relation_racedata; X Xrelation(Playernum,APcount, argn, args) Xint Playernum; Xint APcount, argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint numraces; Xint p; Xracetype *r; X Xfree(Race); Xopenracedata(&relation_racedata); Xgetrace(relation_racedata, &Race, Playernum); X numraces = Numraces(); X X sprintf(buf,"\n Racial Relations Report for %s\n\n",Race->name); X notify(Playernum, buf); X sprintf(buf," # know Race name Yours Theirs \n"); X notify(Playernum, buf); X sprintf(buf," - ---- --------- ----- ------ \n"); X notify(Playernum, buf); Xif(argn==1) { Xfor (p=1; p<=numraces; p++) X if (p != Race->Playernum) { X getrace(relation_racedata, &r, p); X sprintf(buf,"%2d %s (%3d%%) %20.20s : %10s %10s\n", p, X ((Race->God || Race->translate[p-1] > 30) && r->Thing) ? X "Meso" : " ", Race->translate[p-1], r->name, X allied(Race, p, 100, Race->God), X allied(r, Playernum,Race->translate[p-1], Race->God) ); X notify(Playernum, buf); X free(r); X } X } else { XGetPlayer(args[1], &p, &r); Xif(p==-1) { Xnotify(Playernum, "No such player.\n"); Xreturn; X} X sprintf(buf,"%2d %s (%3d%%) %20.20s : %10s %10s\n", p, X ((Race->God || Race->translate[p-1] > 30) && r->Thing) ? X "Meso" : " ", Race->translate[p-1], r->name, X allied(Race, p, 100, Race->God), X allied(r, Playernum,Race->translate[p-1], Race->God) ); X notify(Playernum, buf); X free(r); X} Xclose_file(relation_racedata); X X X} X X X Xchar *allied(r, p, q, God) Xracetype *r; Xint p,q,God; X{ X if (isset( r->atwar, p)) return "WAR"; X else if (isset( r->allied, p)) return "ALLIED"; X else return "neutral"; X} X X X X END_OF_FILE if test 2071 -ne `wc -c <'server/relation.c'`; then echo shar: \"'server/relation.c'\" unpacked with wrong size! fi # end of 'server/relation.c' fi if test -f 'server/tech.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/tech.c'\" else echo shar: Extracting \"'server/tech.c'\" \(1761 characters\) sed "s/^X//" >'server/tech.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * tech.c -- increase investment in technological development. X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "races.h" X#include "buffers.h" X#include <math.h> X#include <signal.h> X#include <ctype.h> Xint tech_pdata; X Xtechnology(Playernum,APcount, argn, args) Xint Playernum; Xint APcount, argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint c,invest; Xplanettype *p; X Xtech_pdata = NEUTRAL_FD; X Xif (Dir[Playernum-1].level != LEVEL_PLAN) { X sprintf(buf,"scope must be a planet (%d).\n", Dir[Playernum-1].level); X notify(Playernum, buf); X return; X} Xif (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) { X return; X } X X openpdata(&tech_pdata); X getplanet(tech_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); Xclose_file(tech_pdata); X Xif(argn < 2) { X sprintf(buf, "Current investment : %d Technology production/update: %.2f\n", X p->info[Playernum-1].tech_invest, X log10(1.0+(double)p->info[Playernum-1].tech_invest)*TECH_INVEST); X notify(Playernum, buf); X return; X } X X invest=atoi(args[1]); X X if (invest > 100 || invest < 0) { X sprintf(buf,"Illegal value.\n"); X notify(Playernum, buf); X return; X } X p->info[Playernum-1].tech_invest = invest; Xopenpdata(&tech_pdata); Xputplanet(tech_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(tech_pdata); X X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0); X X sprintf(buf," New (ideal) tech production: %.2f (this planet)\n", X log10(1.0+(double)p->info[Playernum-1].tech_invest) * TECH_INVEST ); X notify(Playernum, buf); X X X free(p); X X} X END_OF_FILE if test 1761 -ne `wc -c <'server/tech.c'`; then echo shar: \"'server/tech.c'\" unpacked with wrong size! fi # end of 'server/tech.c' fi if test -f 'server/toggle.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'server/toggle.c'\" else echo shar: Extracting \"'server/toggle.c'\" \(1738 characters\) sed "s/^X//" >'server/toggle.c' <<'END_OF_FILE' X/* X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h. X * Restrictions in GB_copyright.h. X * X * toggle.c -- toggles some options X */ X X#include "GB_copyright.h" X#define EXTERN extern X#include "vars.h" X#include "races.h" X#include "buffers.h" X#include <strings.h> Xint toggle_racedata; X Xtoggle(Playernum,APcount, argn, args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint i; X X X if (argn>1) { X i = strlen(args[1]); X free(Race); X openracedata(&toggle_racedata); X getrace(toggle_racedata, &Race, Playernum); X close_file(toggle_racedata); X X if (!strncmp(args[1],"inverse",i)) tog(Playernum,&Race->inverse,"inverse"); X else if (!strncmp(args[1],"double_digits",i)) tog(Playernum,&Race->double_digits, X "double_digits"); X else if (!strncmp(args[1],"geography",i)) tog(Playernum,&Race->geography,"geography"); X else if (!strncmp(args[1],"autoload",i)) tog(Playernum,&Race->autoload,"autoload"); X else { X sprintf(buf,"No such option '%s'\n", args[1]); X notify(Playernum, buf); X } Xopenracedata(&toggle_racedata); Xputrace(toggle_racedata, Race); Xclose_file(toggle_racedata); X X } else { X sprintf(buf,"inverse is %s\n", Race->inverse ? "ON" : "OFF"); X notify(Playernum, buf); X sprintf(buf,"double_digits is %s\n", Race->double_digits ? "ON" : "OFF"); X notify(Playernum, buf); X sprintf(buf,"geography is %s\n", Race->geography ? "ON" : "OFF"); X notify(Playernum, buf); X sprintf(buf,"autoload is %s\n", Race->autoload ? "ON": "OFF"); X notify(Playernum, buf); X } X X} X X Xtog(Playernum,op, name) Xint Playernum; Xint *op; Xchar *name; X{ X *op = !(*op); X sprintf(buf, "%s is now %s\n", name, *op ? "on" : "off" ); X notify(Playernum, buf); X} X END_OF_FILE if test 1738 -ne `wc -c <'server/toggle.c'`; then echo shar: \"'server/toggle.c'\" unpacked with wrong size! fi # end of 'server/toggle.c' fi echo shar: End of archive 12 \(of 14\). cp /dev/null ark12isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 14 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0