From bacchus.pa.dec.com!decwrl!uunet!zephyr.ens.tek.com!tekred!saab!billr Thu Aug 30 19:45:56 PDT 1990 Article 1079 of comp.sources.games: Path: bacchus.pa.dec.com!decwrl!uunet!zephyr.ens.tek.com!tekred!saab!billr From: billr@saab.CNA.TEK.COM (Bill Randle) Newsgroups: comp.sources.games Subject: v11i039: gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2a Message-ID: <6226@tekred.CNA.TEK.COM> Date: 28 Aug 90 19:34:03 GMT Sender: news@tekred.CNA.TEK.COM Lines: 1828 Approved: billr@saab.CNA.TEK.COM Submitted-by: VANCLEEF@mps.ohio-state.edu Posting-number: Volume 11, Issue 39 Archive-name: gb3/Patch2a Patch-To: gb3: Volume 10, Issue 1-14 [Patch #2 reflects the changes necessary to bring this version up to level 1.3.1 client and level 2.2.2 server. (Patch #1 was incorporated as part of the original source posting.) This set of patches contains diffs for files whose diffs were shorter than the source and replacement files for those whose diffs were larger than the source. Use "patch -p" to apply the diffs in the patches02[a-d] files. -br] [I also added a NO_LOG1P flag to the server/Makefile that can be defined to get the server to compile on hosts that don't have the log1p() function. -br] #! /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 'Docs/crystal.doc' <<'END_OF_FILE' XCRYSTAL Galactic Bloodshed CRYSTAL X XCONCEPT X X When the universe is created, some sectors on planets may contain Xcrystal deposits denoted by a '&'. As long as there are crystals in Xa sector the symbol remains on the sector. Through their explorations Xplayers will find sectors that have these deposits although they Xcan never know exactly how many crystals are hidden in the sector. X X When a player occupies a sector with crystal deposits in them, during Xthe update, his race will attempt to find crystals. The probability of Xsuccess per update is equal to the sector efficiency. During an update, Xthe planet's total crystal production can be determined by setting Xautoreport. A line telling how many crystals are in the players stockpiles Xalso will appear on map. X X Crystals are like the other commodities, population, resources, fuel, Xand destruct. They may be loaded and unloaded from ships as for other Xcommodities. They may also be captured just like other commodities. X X If a ship with hyper-drive has at least one crystal on board, the player Xmay mount the crystal into the hyper-drive (see help on the 'mount' Xcommand). Only one crystal needs to be mounted. However a player may Xcarry more if he/she chooses. If a player has a crystal mounted in the Xhyper-drive, the ship does not need to recharge, it is always considered Xto be charged for hyper-space jump during the update. The crystal also Xallows the ship to travel longer distances due to fuel efficiency. X X Crystals in the hyper-drive also allows a player to use laser-beam- Xlike weapons. These weapons, however, will consume fuel, not destruct Xto operate. These weapons have the same effect as normal fire, except Xthere is no limit to how much fuel you may expend in an attack. X X Players should be careful of the amount of fuel they wish to put Xthrough a crystal at anytime. Crystals may break, rendering them useless, Xor, in extreme cases, cause the detonation of the ship they are in, Xalong with everything else nearby. X X The maximum safe limit of fuel passing through a crystal is 100 fuel Xpoints. For every point of fuel passed through above that the crystal Xstands a 1% chance of breaking and a 1/2% change of blowing up the Xship! X XSEE ALSO X mount, fire, order END_OF_FILE if test 2246 -ne `wc -c <'Docs/crystal.doc'`; then echo shar: \"'Docs/crystal.doc'\" unpacked with wrong size! fi # end of 'Docs/crystal.doc' if test -f 'MANIFEST.P2' -a "${1}" != "-c" ; then echo shar: Renaming existing file \"'MANIFEST.P2'\" to \"'MANIFEST.P2.orig'\" mv -f 'MANIFEST.P2' 'MANIFEST.P2.orig' fi echo shar: Extracting \"'MANIFEST.P2'\" \(1850 characters\) sed "s/^X//" >'MANIFEST.P2' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X Docs/beginner.doc 9 X Docs/crystal.doc 1 X Docs/detonate.doc 9 X Docs/dissolve.doc 9 X Docs/dump.doc 9 X Docs/lasers.doc 9 X Docs/motto.doc 9 X Docs/mount.doc 6 X Docs/production.doc 9 X Docs/read.doc 9 X Docs/repair.doc 9 X Docs/standby.doc 9 X Docs/stats.doc 9 X Docs/victory.doc 4 X MANIFEST.P2 1 This shipping list X SETUP 9 X client/GB_client.c 7 X client/client.h 9 X client/cmd.c 8 X client/map.c 6 X patches02a 4 X patches02b 2 X patches02c 3 X patches02d 1 X server/build.c 5 X server/capitol.c 9 X server/capture.c 8 X server/config.h 9 X server/cs.c 8 X server/declare.c 8 X server/dissolve.c 9 X server/dock.c 6 X server/doship.c 6 X server/doturn.c 7 X server/files.h 9 X server/fire.c 5 X server/interface.h 9 X server/land.c 8 X server/launch.c 8 X server/load.c 1 X server/map.c 5 X server/move.c 7 X server/moveship.c 7 X server/name.c 6 X server/patchlevel.h 2 X server/power.c 9 X server/races.h 9 X server/relation.c 9 X server/rst.c 7 X server/scrap.c 8 X server/shipdata.h 9 X server/ships.h 8 X server/tech.c 9 X server/teleg_send.c 7 X server/toggle.c 9 X server/welcome.txt 3 END_OF_FILE if test 1850 -ne `wc -c <'MANIFEST.P2'`; then echo shar: \"'MANIFEST.P2'\" unpacked with wrong size! fi # end of 'MANIFEST.P2' if test -f 'patches02d' -a "${1}" != "-c" ; then echo shar: Renaming existing file \"'patches02d'\" to \"'patches02d.orig'\" mv -f 'patches02d' 'patches02d.orig' fi echo shar: Extracting \"'patches02d'\" \(29478 characters\) sed "s/^X//" >'patches02d' <<'END_OF_FILE' X*** /usr/cna/billr/games/gb3/Docs/build.doc Wed May 30 15:11:25 1990 X--- Docs/build.doc Thu Aug 23 13:28:56 1990 X*************** X*** 38,45 **** X If your ship is a factory 'F', you must 'cs' to the factory, and type 'build'. If the X factory is online (turned on via the 'order' command) and has been programmed X to build a specific ship design, it will construct the ship in the same sector X! as the factory. Resources must be available to construct the ship at the X! planet where the factory is located. See help on the 'make' command and X 'modify' command for details on ship design. When a factory is turned online X via the 'order' command, twice the resource cost of the ship being produced at X the factory will be deducted form the planetary stockpile. Once online, a factory X--- 38,46 ---- X If your ship is a factory 'F', you must 'cs' to the factory, and type 'build'. If the X factory is online (turned on via the 'order' command) and has been programmed X to build a specific ship design, it will construct the ship in the same sector X! as the factory. Note that a factory will only attempt to produce a ship if you type X! 'build'. It will not produce ships on its own. Resources must be available to construct X! the ship at the planet where the factory is located. See help on the 'make' command and X 'modify' command for details on ship design. When a factory is turned online X via the 'order' command, twice the resource cost of the ship being produced at X the factory will be deducted form the planetary stockpile. Once online, a factory X*************** X*** 46,52 **** X cannot be turned 'off' (via order). The factory is then committed to producing X the class of ships it has been programmed. Players should therefore be warned X to make absolutely sure that the ship type and parameters are acceptable before X! turning the factory online. X X X A player may do 'build ?' for details on the types of ships available at his X--- 47,55 ---- X cannot be turned 'off' (via order). The factory is then committed to producing X the class of ships it has been programmed. Players should therefore be warned X to make absolutely sure that the ship type and parameters are acceptable before X! turning the factory online. You can give a name to the ship design made by X! the factory by using 'name class '. This is useful for keeping track X! of your factories (class names show up with 'stock' reports). X X X A player may do 'build ?' for details on the types of ships available at his X*** /usr/cna/billr/games/gb3/Docs/capture.doc Wed May 30 15:11:27 1990 X--- Docs/capture.doc Thu Aug 23 13:28:58 1990 X*************** X*** 15,23 **** X assault. If the sector where the ship is located is occupied by the player, X the combat strengths of the player (attacker) and alien (defender) are X computed. The combat strengths depend on number of beings, fighting X! ability, sector mobilizations, sector terrain and technology of the X! races as well as ship sizes and armor. The assault is evaluated and casualties X! are removed from each defender and attacker. X X Defense strengths of terrain: X land = 1 X--- 15,28 ---- X assault. If the sector where the ship is located is occupied by the player, X the combat strengths of the player (attacker) and alien (defender) are X computed. The combat strengths depend on number of beings, fighting X! ability, sector terrain and technology of the races as well as ship sizes X! and armor. The assault is evaluated and casualties are removed from each X! defender and attacker. X! X! A player may attack with as many population as the sector contains. X! If the number of boarders isn't specified, all occupants of the sector X! will assault the ship. X! X X Defense strengths of terrain: X land = 1 X*** /usr/cna/billr/games/gb3/Docs/fire.doc Wed May 30 15:11:34 1990 X--- Docs/fire.doc Thu Aug 23 13:29:08 1990 X*************** X*** 58,63 **** X--- 58,66 ---- X evaluated for hit/miss, the sum of all hits is then used to X determine the results of the salvo. X X+ If a ship is firing on another ship, and no strength is given, the salvo X+ strength specified by the player (see 'order salvo ') is used. X+ X The hit probability depends on several factors X X 1) The technology of firing ship. The higher the technology, X*************** X*** 107,127 **** X X X After the hit probability is determined each firing gun is X! evaluated for hit/miss. The total number of hits is then compared X! to the armor of the defending ship. The armor value of the ship X! represents the amount of hits per salvo it can absorb without taking X! any structural damage at all (exception - see 'critical hits' below). X! The structural damage to the ship is evaluated by the formula X X! % damage = 30 * ( hits - armor) / body. X X! If hits <= armor no structural damage is evaluated. Bigger ships X! (represented by body) can absorb more hits less ensuing damage X! than little ships. Also notice that smaller ships, although X! harder to hit, are easier to damage *when* hit. X X X X After evaluating for structural damage, the program then checks for X 'critical hits'. EACH hit is evaluated, whether or not any real X structural damage has occured on the target vessel. The chances X--- 110,140 ---- X X X After the hit probability is determined each firing gun is X! evaluated for hit/miss. Each hit is then checked to for penetration. X! The probability of a hit penetrating depends on the ships armor: X X! armor X! penetration probability = factor X X! The armor effectiveness factor is depends on the technology of both X! the firing and target ship: X X+ firing ship technology + 1 X+ factor = tanh( ---------------------------- ) X+ target ship technology + 1 X X+ The structural damage to the ship is then evaluated by the formula X X+ % damage = ( 1 + damage_factor) * 40 * penetrated hits / body. X+ X+ Bigger ships (represented by body) can absorb more hits less ensuing X+ damage than little ships. Also notice that smaller ships, although X+ harder to hit, are easier to damage *when* hit. X+ X+ Civilian class ships are easier to damage than military ships. The X+ 'damage_factor' is 2 for stations, habitats, mirrors and 1 for cargo ships, X+ tankers, and orbital assault platforms. X+ X After evaluating for structural damage, the program then checks for X 'critical hits'. EACH hit is evaluated, whether or not any real X structural damage has occured on the target vessel. The chances X*************** X*** 128,142 **** X of a critical hit depends on the size of the target ship. X Specifically X X! critical hit probability = 10 * body : 1. X X Smaller ships are more likely to suffer damage from critical hits X! than big ships. As an example, a Battleship with a size of X! 45 has a 450:1 odds of taking a critical hit from each hit. X! A fighter group with a size of 10 has a 100:1 odds against such X! a hit. Note, if you throw LOTS of fire power at an object you X! may get one. (You can also recall the story of David and Goliath!) X! Each critical hit is then evaluated. A random amount of damage X between 1 and 100% is assessed for each hit, in addition to the X normal structural damage. X X--- 141,153 ---- X of a critical hit depends on the size of the target ship. X Specifically X X! critical hit probability = size : 1. X X Smaller ships are more likely to suffer damage from critical hits X! than big ships. As an example, a Battleship with a size of 30 X! and has a 30:1 odds of taking a critical hit from each pentration. X! A fighter group with a size of 10 and no armor has a 10:1 odds against X! such a hit. Each critical hit is then evaluated. A random amount of damage X between 1 and 100% is assessed for each hit, in addition to the X normal structural damage. X X*** /usr/cna/billr/games/gb3/Docs/load.doc Wed May 30 15:11:39 1990 X--- Docs/load.doc Thu Aug 23 13:29:15 1990 X*************** X*** 15,22 **** X X #shipnum -- What ship to load from/to X X! d|c|r|f -- specify destructive potential, crew, resources, or fuel to load/ X! unload. destructive potential, resources and fuel are taken from that user's X stockpiles, while people are taken from the sector the ship is landed on. If X the ship is docked with another ship and not a planet, the tranfers will be X direct. X--- 15,22 ---- X X #shipnum -- What ship to load from/to X X! d|c|r|f|x -- specify destructive potential, crew, resources, fuel or crystals to X! load/ unload. destructive potential, resources and fuel are taken from that user's X stockpiles, while people are taken from the sector the ship is landed on. If X the ship is docked with another ship and not a planet, the tranfers will be X direct. X*** /usr/cna/billr/games/gb3/Docs/make.doc Wed May 30 15:11:39 1990 X--- Docs/make.doc Thu Aug 23 13:29:16 1990 X*************** X*** 16,22 **** X The make with a ship argument can only be issued to offline factories. X Once online, the ship design is set. X X! if no argument is specified, the command will list the characteristics X of the ship type being produced. These characteristics can be altered X via the 'modify' command. X X--- 16,22 ---- X The make with a ship argument can only be issued to offline factories. X Once online, the ship design is set. X X! If no argument is specified, the command will list the characteristics X of the ship type being produced. These characteristics can be altered X via the 'modify' command. X X*** /usr/cna/billr/games/gb3/Docs/modify.doc Wed May 30 15:11:42 1990 X--- Docs/modify.doc Thu Aug 23 13:29:20 1990 X*************** X*** 14,20 **** X the 'standard' design and a cost for producing the ship is evaluated X based on these attributes. Specifically, the following attributes may X be altered: X! armor, guns, size, crew, fuel, cargo, destruct, speed. X X The modify command reports the current cost of producing the ship X type at the factory. Basically, the cost of producing the ship is X--- 14,20 ---- X the 'standard' design and a cost for producing the ship is evaluated X based on these attributes. Specifically, the following attributes may X be altered: X! armor, guns, size, crew, fuel, cargo, destruct, speed, hyperdrive. X X The modify command reports the current cost of producing the ship X type at the factory. Basically, the cost of producing the ship is X*************** X*** 26,31 **** X--- 26,39 ---- X For each attribute, if this number is positive it is considered to be an X 'advantage' and if it is negative, the absolute value of it is considered X to be a 'disadvantage'. X+ X+ All ships built at a factory may have hyper-space jump capabilities X+ by installing 'hyperdrive'. Having this is assumed to be an advantage X+ of 1. X+ X+ The maximum value by which an attribute may be modified to is dependent X+ on the technology the factory used to construct the ship by X+ (max value) = (1 + tech/100) * (standard value) X X A base mass is also computed, the mass of the ship with nothing loaded X on board. Each point of armor has a mass of 1 while each gun and point X*** /usr/cna/billr/games/gb3/Docs/move.doc Wed May 30 15:11:43 1990 X--- Docs/move.doc Thu Aug 23 13:29:23 1990 X*************** X*** 11,23 **** X X This command is used to move population from one sector to an adjacent X sector. The player enters the origination sector, target sector, and the X! amount of population to move. If no population argument is given, all X! population in the original sector will be moved. If the destination X! sector is occupied by aliens, the combat strengths of the player (attacker) X! and alien (defender) are computed. The combat strengths depend on number of X! beings, fighting ability, sector mobilizations, sector terrain and technology X! of the races. The assault is evaluated and casualties are removed from X! each sector. X X If mesomorphic races are involved in the combat, and are victorious, X by either taking the assaulted sector or repulsing an attack, they may X--- 11,27 ---- X X This command is used to move population from one sector to an adjacent X sector. The player enters the origination sector, target sector, and the X! amount of population to move. If the destination sector is occupied by X! aliens, the combat strengths of the player (attacker) and alien (defender) X! are computed. The combat strengths depend on number of beings, fighting X! ability, sector terrain and technology of the races. The assault is evaluated X! and casualties are removed from each sector. X! X! If no population argument is given, all population in the original sector X! will be moved. If a negative population is specified, the all population, X! except for the amount specified, will move. For example, 'move 2,3 3,3 -5' X! will move all population from sector 2,3 to sector 3,3, except for 5 which X! remain behind. X X If mesomorphic races are involved in the combat, and are victorious, X by either taking the assaulted sector or repulsing an attack, they may X*** /usr/cna/billr/games/gb3/Docs/name.doc Wed May 30 15:11:43 1990 X--- Docs/name.doc Thu Aug 23 13:29:24 1990 X*************** X*** 14,19 **** X--- 14,23 ---- X You can also rename your race with 'name race '. You must own the X ship or have explored the star or planet to rename them. X X+ To name the clkass of ships being produced by a factory, you use 'name class X+ '. The factory must be off-line for this to work. X+ X+ X An additional constraint against the player is that he have more AP's X than any other player in the system in which he is naming (only if the X object is a star). The AP cost will be deducted from that system, X*** /usr/cna/billr/games/gb3/Docs/order.doc Wed May 30 15:11:49 1990 X--- Docs/order.doc Thu Aug 23 13:29:34 1990 X*************** X*** 31,37 **** X Syntax: order destination X X X! speed -- Change the speed of a ship. All speed factors are between 0 and 4. X Higher speeds used fuel less efficiently than lower speeds. X Syntax: order speed X X--- 31,37 ---- X Syntax: order destination X X X! speed -- Change the speed of a ship. All speed factors are between 0 and 9. X Higher speeds used fuel less efficiently than lower speeds. X Syntax: order speed X X*************** X*** 81,89 **** X retaliate -- normally, if a ship is attacked and suffers damage, it X and all ships assigned to protect will immediately retaliate X with one salvo against the violating ships. A ship can also X! be order *not* to retaliate X Syntax: order retaliate X X navigate -- while this is on the destination described above is X ignored and instead, the ship will travel in the direction X specified by the course. The directions are specified with X--- 81,97 ---- X retaliate -- normally, if a ship is attacked and suffers damage, it X and all ships assigned to protect will immediately retaliate X with one salvo against the violating ships. A ship can also X! be order *not* to retaliate. X Syntax: order retaliate X X+ laser -- If this is set, the ship will use it's combat lasers to attack X+ with instead of normal fire. The player must specify how many X+ strength points will fire upon retaliation (or default fire power). X+ For ever point of strength, a laser used 2 fuel points instead X+ destruct for the attack. The ship must have lasers mounted as X+ well as a crystal in the hyperdrive. X+ Syntax: order laser X+ X navigate -- while this is on the destination described above is X ignored and instead, the ship will travel in the direction X specified by the course. The directions are specified with X*************** X*** 102,107 **** X--- 110,119 ---- X specified protect will be turned off. X Syntax: order protect X X+ salvo -- This allows players to control the strength of their X+ retaliate/defense/protect response. By default it is set X+ to the number of guns of the ship. X+ Syntax: order salvo X X defense -- If this is set 'on' it will retaliate X if the planet that it is in orbit around or landed on is X*************** X*** 112,123 **** X switch -- Turn mines and transporters on or off. X Syntax: order switch X X! explosive -- If the ship is a mine, this command sets it to be in explosive X! mode which can damage ships. X Syntax: order explosive X X! radiative -- Similar to the previous command. Radiation mines incapacitate X! ships caught in the trigger radius. X Syntax: order radiative X X move -- If the ship is a terraforming device, the direction it X--- 124,135 ---- X switch -- Turn mines and transporters on or off. X Syntax: order switch X X! explosive -- If the ship is a mine or a gamma ray laser, this command sets X! it to be in explosive mode which can damage ships. X Syntax: order explosive X X! radiative -- Similar to the previous command. Radiation mines and X! gamma ray lasers incapacitate ships. X Syntax: order radiative X X move -- If the ship is a terraforming device, the direction it X*** /usr/cna/billr/games/gb3/Docs/report.doc Wed May 30 15:11:54 1990 X--- Docs/report.doc Thu Aug 23 13:29:43 1990 X*************** X*** 20,24 **** X X X SEE ALSO X! examine, ship, stock, tactical, scope X X--- 20,24 ---- X X X SEE ALSO X! examine, ship, stock, tactical, scope, stats X X*** /usr/cna/billr/games/gb3/Docs/ship.doc Wed May 30 15:11:55 1990 X--- Docs/ship.doc Thu Aug 23 13:29:45 1990 X*************** X*** 20,24 **** X X X SEE ALSO X! examine, report, tactical, scope X X--- 20,24 ---- X X X SEE ALSO X! examine, report, tactical, scope, stats X X*** /usr/cna/billr/games/gb3/Docs/survey.doc Wed May 30 15:11:58 1990 X--- Docs/survey.doc Thu Aug 23 13:29:50 1990 X*************** X*** 68,71 **** X Same as the command 'ship #n' X X SEE ALSO X! ship, report, map, weapons, mobilize X--- 68,71 ---- X Same as the command 'ship #n' X X SEE ALSO X! ship, report, map, weapons, mobilize, production X*** /usr/cna/billr/games/gb3/Docs/tactical.doc Wed May 30 15:11:59 1990 X--- Docs/tactical.doc Thu Aug 23 13:29:51 1990 X*************** X*** 24,28 **** X X X SEE ALSO X! report, stock, scope X X--- 24,28 ---- X X X SEE ALSO X! report, stock, scope, stats X X*** /usr/cna/billr/games/gb3/Docs/technology.doc Wed May 30 15:11:59 1990 X--- Docs/technology.doc Thu Aug 23 13:29:52 1990 X*************** X*** 17,23 **** X production. As you increase the quota on one planet, you will notice, the X actual tech production increases less and less; thus, it is important to have X a wider cultural base (lots of planets) for better tech development. X! The tech growth per planet is 0.10*log10(1+investment)/turn. X X SEE ALSO X profile X--- 17,29 ---- X production. As you increase the quota on one planet, you will notice, the X actual tech production increases less and less; thus, it is important to have X a wider cultural base (lots of planets) for better tech development. X! X! The additional technology increase per update for a planet is given by X! a rather complex formula : X! X! tech = 0.005 * sqrt(investment * SCALE) X! X! where SCALE = population/1000. X X SEE ALSO X profile X*** /usr/cna/billr/games/gb3/Docs/telegram.doc Wed May 30 15:12:00 1990 X--- Docs/telegram.doc Thu Aug 23 13:29:53 1990 X*************** X*** 1,4 **** X! TELGRAM Galactic Bloodshed TELGRAM X X X CONCEPT X--- 1,4 ---- X! TELEGRAM Galactic Bloodshed TELEGRAM X X X CONCEPT X*************** X*** 11,22 **** X DESCRIPTION X X This command allows users to communicate with each other. The player X! must specify who/what they wish to contact, and a message to send to X! that player. To specify a place instead of a single player, the string X! must begin with one of the following characters: / : . # If the string X! is specified in this way, all players that currently occupy the area X! specified will be sent the telegram. If the area is a ship, only the owner X! of that ship will be the recipient. X X You can send a message to all members of your alliance block if you X use the string 'block' for . X--- 11,18 ---- X DESCRIPTION X X This command allows users to communicate with each other. The player X! must specify who they wish to contact, and a message to send to X! that player. X X You can send a message to all members of your alliance block if you X use the string 'block' for . X*** /usr/cna/billr/games/gb3/Docs/time.doc Wed May 30 15:12:00 1990 X--- Docs/time.doc Thu Aug 23 13:29:54 1990 X*************** X*** 1,16 **** X! TIME Galactic Bloodshed TIME X X X NAME X! [0] time -- give player information of the time for game functions. X X SYNTAX X! time X X DESCRIPTION X X! This command tells the player the current local time, the time of the X! last update and when the server was last started. X X X X--- 1,33 ---- X! TIME Galactic Bloodshed TIME X X X NAME X! [0] time -- give player information of the time for game functions/allocate X! more time for daily allotments. X X SYNTAX X! time X X DESCRIPTION X X! If no argument is given, this command tells the player the current local time, X! the time of the last update, when the server was last started, as well as current X! time allotments. X X+ If an argument is given, the designated number of minutes will be subtracted X+ from weekly time allotments and added to the daily time allotment. X X+ Each player is entitled to 3 hours (180 minutes) login time per day, X+ as well as having a pool of 5 hours (300 minutes) of time which can be X+ allocated per week. Daily time allotments are reset at the midnight update, X+ and weekly time allotments are reset on the midnight update on the 7th, 14th, X+ 21st and 28th of each month. Time is not counted when in standby mode. In X+ standby mode, however, players may not issue active commands. X X+ If a player's daily time allotment goes to zero, or is in standby mode, the X+ player may no longer issue and active commands (commands which alter the X+ game data base or do intelligence gathering), but may still use communications X+ commands. X+ X+ SEE ALSO X+ standby X*** /usr/cna/billr/games/gb3/Docs/toggle.doc Wed May 30 15:12:02 1990 X--- Docs/toggle.doc Thu Aug 23 13:29:54 1990 X*************** X*** 6,11 **** X--- 6,12 ---- X X SYNOPSIS X toggle X+ highlight X X DESCRIPTION X X*************** X*** 12,19 **** X Toggle turns on or off the named option. If no option is given, X toggle will list all available options and their values. X X! Currently the only options available deal with the "map" command. X X SEE ALSO X! map X X--- 13,29 ---- X Toggle turns on or off the named option. If no option is given, X toggle will list all available options and their values. X X! Options : X! gag will turn off global broadcasts and login/logout X! inverse whether or not to use reverse video X! double_digits display aliens numbers with double digits X! geography if set, playernumbers will not be displayed X! autoload if set, full crew and fuel will be loaded after X! building a new ship X X+ A player can specify which players he/she wishes to highlight. X+ It is initially set to the player. X+ X SEE ALSO X! map, load, broadcast X X*** /usr/cna/billr/games/gb3/Docs/toxicity.doc Wed May 30 15:12:02 1990 X--- Docs/toxicity.doc Thu Aug 23 13:29:55 1990 X*************** X*** 1,11 **** X! TOXICTY Galactic Bloodshed TOXICTY X X X NAME X [1] toxicity -- set threshold for building toxic waste canisters X X! SYNOPSIS X! toxicity X X DESCRIPTION X X--- 1,11 ---- X! TOXICITY Galactic Bloodshed TOXICITY X X X NAME X [1] toxicity -- set threshold for building toxic waste canisters X X! SYNTAX X! toxicity X X DESCRIPTION X X*** /usr/cna/billr/games/gb3/client/keyboard.c Tue May 15 11:31:16 1990 X--- client/keyboard.c Thu Aug 23 13:37:31 1990 X*************** X*** 116,123 **** X int count; X X count = read(0, &ch, 1);/* Read from stdin. */ X! if (count == 0) /* Huh? Ignore this. */ X! return; X X if (count == -1) { X if (errno == EWOULDBLOCK) X--- 116,123 ---- X int count; X X count = read(0, &ch, 1);/* Read from stdin. */ X! /*if (count == 0) /* Huh? Ignore this. */ X! /*return;*/ X X if (count == -1) { X if (errno == EWOULDBLOCK) X*************** X*** 163,173 **** X X process_buffer() X { X! if (keyboard_pos == 0) /* Nothing typed. */ X! return; X X keyboard_buffer[keyboard_pos] = '\n'; X! transmit(keyboard_buffer, keyboard_pos + 1); X /* log_input(keyboard_buffer);*/ X } X X--- 163,177 ---- X X process_buffer() X { X! /*if (keyboard_pos == 0) /* Nothing typed. */ X! /* return;*/ X X keyboard_buffer[keyboard_pos] = '\n'; X! X! /* check for client command ('source') */ X! if (!client_cmd(keyboard_buffer)) X! transmit(keyboard_buffer, keyboard_pos + 1); X! X /* log_input(keyboard_buffer);*/ X } X X*** /usr/cna/billr/games/gb3/client/orbit.c Tue May 15 11:31:18 1990 X--- client/orbit.c Thu Aug 23 13:37:33 1990 X*************** X*** 33,38 **** X--- 33,40 ---- X extern int have_inv; X X float Lastx, Lasty, Zoom; X+ char temp[2048]; X+ string blob; X X plot_orbit(t) X char *t; X*************** X*** 40,48 **** 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--- 42,49 ---- X int x, y, array; X int stand1, stand2; X char *u, *v; X! char /*temp[1024],*/ symbol; X int more_data = 1; X X X clear(); X*************** X*** 51,57 **** 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--- 52,58 ---- X while (more_data) { X while ((v = index(u, ';')) != NULL) { X *v = 0; X! sscanf(u, "%d %d %d %d %c %d %s", &stand1, &x, &y, &array, X &symbol, &stand2, temp); X x = (int) x * Midx; X y = (int) y * Midy; X*************** X*** 62,79 **** 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--- 63,80 ---- 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*** 95,100 **** X--- 96,102 ---- X } X } X X+ move(S_Y-1,0); X refresh(); X return; X } X*** /usr/cna/billr/games/gb3/client/patchlevel.h Thu May 31 08:49:50 1990 X--- client/patchlevel.h Thu Aug 23 13:45:08 1990 X*************** X*** 1 **** X! #define PATCHLEVEL 1 X--- 1 ---- X! #define PATCHLEVEL 2 X*** /usr/cna/billr/games/gb3/README_ORIG Wed May 30 15:10:28 1990 X--- README_ORIG Wed Aug 22 11:42:01 1990 X*************** X*** 1,3 **** X--- 1,6 ---- X+ (Note: This is the README which came along with GB .975 in April 1989 - X+ It is currently outdated and is included for historical interest only - G.vC) X+ X X This is a game of interstellar exploration/conquest. By the time I X realized there really wasn't going to be much fighting going on in the game, I X*** /usr/cna/billr/games/gb3/README Fri Jun 1 11:52:49 1990 X--- README Thu Aug 23 14:00:15 1990 X*************** X*** 32,38 **** X then tells the server to do an update. The default update time is 4 hours, X but you can change that with 'GB_daemon '. It is a X good idea to make your update times a factor of 24 hours. If you want to X! force an update just do 'GB_doturn' by itself. X X Players cannot enroll by themselves in this version. The game's host X must do that by running 'GB_enroll' and following the instructions. It X--- 32,38 ---- X then tells the server to do an update. The default update time is 4 hours, X but you can change that with 'GB_daemon '. It is a X good idea to make your update times a factor of 24 hours. If you want to X! force an update just telnet to the server and enter the update password. X X Players cannot enroll by themselves in this version. The game's host X must do that by running 'GB_enroll' and following the instructions. It X*************** X*** 71,73 **** X--- 71,81 ---- X Bill Randle X billr@saab.CNA.TEK.COM X 6/1/90 X+ X+ X+ Patchlevel 2 reflects the changes necessary to bring this version up X+ to level 1.3.1 client and level 2.2.2 server. X+ X+ Bill Randle X+ billr@saab.CNA.TEK.COM X+ 8/24/90 END_OF_FILE if test 29478 -ne `wc -c <'patches02d'`; then echo shar: \"'patches02d'\" unpacked with wrong size! fi # end of 'patches02d' if test -f 'server/load.c' -a "${1}" != "-c" ; then echo shar: Renaming existing file \"'server/load.c'\" to \"'server/load.c.orig'\" mv -f 'server/load.c' 'server/load.c.orig' fi echo shar: Extracting \"'server/load.c'\" \(20187 characters\) sed "s/^X//" >'server/load.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 * load.c -- load/unload stuff 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 X Xint load_shdata,load_pdata,load_sectdata, load_racedata, load_stardata; X X Xload(Playernum,APcount, argn,args, mode) Xint Playernum; Xint APcount; Xint argn; Xint mode; /* mode = 0 load, mode =1 unload */ Xchar args[MAXARGS][COMMANDSIZE]; X{ Xboolean sh=0,diff=0; Xint first=1,proc,Mod=0,lolim,uplim, shipno,amt; Xint test; Xint transfercrew; Xchar commod, buff[128], bufr[128], bufd[128], bufc[128], bufx[128]; Xshiptype *s,*s2; Xplanettype *p; Xsectortype *sect; Xracetype *Race; X X load_shdata = load_pdata = load_sectdata = NEUTRAL_FD; X X sscanf(args[1]+(args[1][0]=='#'),"%d",&shipno); X X openshdata(&load_shdata); Xif (!getship(load_shdata,&s,shipno)) { X close_file(load_shdata); X return; X } Xclose_file(load_shdata); Xif (s->owner!=Playernum || !s->is_alive) { X DontOwnErr(Playernum,shipno); X free(s); X return; X } X if (!s->active) { X sprintf(buf,"%s #%d is irradiated and inactive.\n", Shipnames[s->type],shipno); X notify(Playernum, buf); X free(s); X return; X } X X X if (s->whatorbits==LEVEL_UNIV) { X if (!enufAP(Playernum,Sdata.AP[Playernum-1], APcount)) { X free(s); X return; X } X } else if (!enufAP(Playernum,Stars[s->storbits]->AP[Playernum-1], APcount)) { X free(s); X return; X } X X X proc = 0; X X if (s->type == OTYPE_TRANSDEV && s->object.number > 0) { X openshdata(&load_shdata); X if (!getship(load_shdata,&s2, s->object.number)) { X sprintf(buf,"The hopper seems to be blocked.\n"); X notify(Playernum, buf); X close_file(load_shdata); X free(s); X return; X } X close_file(load_shdata); X if (!s2->is_alive) { X sprintf(buf,"The target device does not exist.\n"); X notify(Playernum, buf); X free(s); X free(s2); X return; X } X if (s2->type!=OTYPE_TRANSDEV || !s2->on) { X sprintf(buf,"s2->type = %d\n",s2->type); X notify(Playernum, buf); X sprintf(buf,"OTYPE_TRANSDEV = %d\n",OTYPE_TRANSDEV); X notify(Playernum, buf); X X sprintf(buf,"s2->on = %d\n",s2->on); X notify(Playernum, buf); X sprintf(buf,"The target device is not receiving.\n"); X notify(Playernum, buf); X free(s); X free(s2); X return; X } X } else if (!s->is_docked) { X if (s->type==OTYPE_TRANSDEV) { X sprintf(buf,"It does not seem to work in zero-g environments.\n"); X notify(Playernum, buf); X free(s); X return; X } X sprintf(buf,"%s #%d is not landed.\n",is_object(s)?"object":"ship",shipno); X notify(Playernum, buf); X free(s); X return; X } else { X if (s->whatdest==LEVEL_PLAN) X { X sprintf(buf,"Ship #%d at %.0f,%.0f\n", shipno, s->xpos, s->ypos); X notify(Playernum, buf); X if(s->storbits != Dir[Playernum-1].snum || s->pnumorbits != Dir[Playernum-1].pnum) X { X sprintf(buf,"Wrong scope!\n"); X notify(Playernum, buf); X free(s); X return; X } X } else { X openshdata(&load_shdata); X if (!getship(load_shdata, &s2, s->destshipno) X || !s2->is_alive X || !s->object.number4 && X !(s2->is_docked && s2->whatdest==LEVEL_SHIP X && s2->destshipno==shipno) ) { X /* the ship it was docked with died or X undocked with it or something. */ X s->is_docked = 0; X s->whatdest = LEVEL_UNIV; X putship(load_shdata, s, shipno); X close_file(load_shdata); X sprintf(buf,"ship #%u is not docked.\n", s->destshipno); X notify(Playernum, buf); X free(s); X free(s2); X return; X } X close(load_shdata); X sprintf(buf,"Ship #%d docked with %s #%d\n", shipno, X Shipnames[s2->type], s->destshipno); X notify(Playernum, buf); X sh = 1; X if (s2->owner!=Playernum) { X sprintf(buf,"Player %d owns that ship.\n", s2->owner); X notify(Playernum, buf); X diff = 1; X } X } X } X Xcommod = args[2][0]; X if(argn>3) X amt = atoi(args[3]); X else X amt = 0; X X if(mode) amt = -amt; /* unload */ X X if (!sh) { X openpdata(&load_pdata); X getplanet(load_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(load_pdata); X } X X if (!sh && commod=='c') { X opensectdata(&load_sectdata); X getsector(load_sectdata, §, p->sectormappos X + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) ); X close_file(load_sectdata); X } X X switch (commod) { X X case 'x' : X case '&' : X if (sh) { X uplim = diff ? 0 : MIN(s2->crystals, Max_crystals(s) - s->crystals); X lolim = diff ? 0 : - MIN(s->crystals, Max_crystals(s2) - s2->crystals); X } else { X uplim = MIN(p->info[Playernum-1].crystals, Max_crystals(s) - s->crystals); X lolim = -s->crystals; X } X proc = 1; X break; X X case 'c': X if (sh) { X uplim = diff ? 0 : MIN(s2->popn, Max_crew(s) - s->popn); X lolim = diff ? 0 : - MIN(s->popn, Max_crew(s2) - s2->popn); X } else { X uplim = MIN(sect->popn, Max_crew(s) - s->popn); X lolim = -s->popn; X } X proc = 1; X break; X X case 'd': X if (sh) { X uplim = diff ? 0 : MIN(s2->destruct, Max_destruct(s) - s->destruct); X lolim = -MIN(s->destruct, Max_destruct(s2) - s2->destruct); X } else { X uplim = MIN(p->info[Playernum-1].destruct, Max_destruct(s) - s->destruct); X lolim = -s->destruct; X } X proc = 1; X break; X X case 'f': X if (sh) { X uplim = diff ? 0.0 : MIN((int)s2->fuel, Max_fuel(s) - (int)s->fuel); X lolim = - MIN((int)s->fuel, Max_fuel(s2) - (int)s2->fuel); X } else { X uplim = MIN((int)p->info[Playernum-1].fuel, Max_fuel(s) - (int)s->fuel); X lolim = -(int)s->fuel; X } X proc = 1; X break; X X case 'r': X if (sh) { X if (s->type==STYPE_SHUTTLE) X uplim = diff ? 0 : s2->resource; X else X uplim = diff ? 0 : MIN(s2->resource, Max_resource(s) - s->resource); X if (s2->type==STYPE_SHUTTLE) X lolim = -s->resource; X else X lolim = - MIN(s->resource, Max_resource(s2) - s2->resource); X } else { X uplim = MIN(p->info[Playernum-1].resource, Max_resource(s) - s->resource); X lolim = -s->resource; X } X proc = 1; X break; X X default: X notify(Playernum, "No such commodity valid.\n"); X if(sh) X free(s2); X else X free(p); X X free(s); X return; X } X Xif(amtuplim) { X sprintf(buf, "you can only transfer between %d and %d.\n", lolim, uplim); X notify(Playernum, buf); X free(s); X X if(sh) X free(s2); X else X free(p); X X return; X } X Xopenracedata(&load_racedata); Xgetrace(load_racedata, &Race, Playernum); Xclose_file(load_racedata); X Xif(amt==0) X amt = uplim; X X switch (commod) { X X case 'c': X if (sh) { X s2->popn -= amt; X s2->mass -= amt*Race->mass; X transfercrew = 1; X } else if(sect->owner && sect->owner != Playernum) { X sprintf(buf,"That sector is already occupied by another player!\n"); X notify(Playernum, buf); X transfercrew = 0; X } else { X transfercrew = 1; X if (!sect->popn && amt<0) { X p->info[Playernum-1].numsectsowned++; X sect->owner = Playernum; X sprintf(buf,"sector %.0f,%.0f COLONIZED.\n",s->xpos,s->ypos); X notify(Playernum, buf); X } X sect->popn -= amt; X p->popn -= amt; X if (sect->popn==0) { X p->info[Playernum-1].numsectsowned--; X sect->owner = 0; X sprintf(buf,"sector %.0f,%.0f evacuated.\n",s->xpos,s->ypos); X notify(Playernum, buf); X } X } X if(transfercrew) { X sprintf(buf,"crew complement of ship #%d is now %u.\n", X shipno, s->popn+amt); X notify(Playernum, buf); X s->popn += amt; X s->mass += amt*Race->mass; X Mod = 1; X } X break; X X case 'd': s->destruct += amt; X s->mass += amt*MASS_DESTRUCT; X sprintf(buf, "%d destruct transferred.\n", amt); X notify(Playernum, buf); X if (!Max_crew(s)) { X sprintf(buf,"\n%s #%d ",Shipnames[s->type], shipno); X notify(Playernum, buf); X if (s->destruct) { X sprintf(buf,"now boobytrapped.\n"); X } else { X sprintf(buf,"no longer boobytrapped.\n"); X } X notify(Playernum, buf); X } X X if (sh) { X s2->destruct -= amt; X s2->mass -= amt*MASS_DESTRUCT; X } else X p->info[Playernum-1].destruct -= amt; X X Mod = 1; X break; X X case 'x' : X case '&': X s->crystals+= amt; X sprintf(buf, "%d crystal(s) transferred.\n", amt); X notify(Playernum, buf); X X if (sh) { X s2->crystals -= amt; X } else p->info[Playernum-1].crystals -= amt; X X Mod = 1; X break; X X case 'f': s->fuel += amt*1.0; X s->mass += amt*MASS_FUEL; X sprintf(buf, "%d fuel transferred.\n", amt); X notify(Playernum, buf); X X if (sh) { X s2->fuel -= amt*1.0; X s2->mass -= amt*MASS_FUEL; X } else p->info[Playernum-1].fuel -= amt*1.0; X X Mod = 1; X break; X X case 'r': s->resource += amt; X s->mass += amt*MASS_RESOURCE; X sprintf(buf, "%d resources transferred.\n", amt); X notify(Playernum, buf); X X if (sh) { X s2->resource -= amt; X s2->mass -= amt*MASS_RESOURCE; X } else p->info[Playernum-1].resource -= amt; X X Mod = 1; X break; X X default: X notify(Playernum, "No such commodity.\n"); X free(Race); X free(s); X X if(sh) X free(s2); X else X free(p); X X return; X break; X } X X openshdata(&load_shdata); X putship(load_shdata,s,shipno); X close_file(load_shdata); X X if (s->type==OTYPE_TRANSDEV && s->object.number > 0) { X X sprintf(buf,"Zap\07!\n"); /* ^G */ X notify(Playernum, buf); X X /* send stuff to other ship (could be transport device) */ X if (s->resource ) { X s2->mass += s->resource * MASS_RESOURCE; X s2->resource += s->resource; X X sprintf(buf,"%d resources transferred.\n", s->resource); X notify(Playernum, buf); X sprintf(bufr, "%d Resources\n",s->resource); X X s->mass -= s->resource * MASS_RESOURCE; X s->resource -= s->resource; X } else X bufr[0] = '\0'; X X if (s->fuel) { X s2->fuel += s->fuel; X s2->mass += s->fuel * MASS_FUEL; X X sprintf(buf,"%g fuel transferred.\n", s->fuel); X notify(Playernum, buf); X sprintf(buff, "%g Fuel\n",s->fuel); X X s->mass -= s->fuel * MASS_FUEL; X s->fuel -= s->fuel; X } else X buff[0] = '\0'; X X if (s->destruct) { X s2->mass += s->destruct * MASS_DESTRUCT; X s2->destruct += s->destruct; X X sprintf(buf,"%d destruct transferred.\n", s->destruct); X notify(Playernum, buf); X sprintf(bufd, "%d Destruct\n",s->destruct); X X s->mass -= s->destruct * MASS_DESTRUCT; X s->destruct -= s->destruct; X } else X bufd[0] = '\0'; X X if (s->popn) { X s2->mass += s->popn * Race->mass; X s2->popn += s->popn; X X sprintf(buf,"%d population transferred.\n", s->popn); X notify(Playernum, buf); X sprintf(bufc, "%d %s\n",s->popn,Race->Thing?"tons of biomass" : "population"); X X s->mass -= s->popn * Race->mass; X s->popn -= s->popn; X } else X bufc[0] = '\0'; X X if (s->crystals) { X s2->crystals += s->crystals; X X sprintf(buf,"%d crystal(s) transferred.\n", s->crystals); X notify(Playernum, buf); X sprintf(bufx, "%d crystal(s)\n",s->crystals); X X s->crystals = 0; X } else X bufx[0] = '\0'; X X if (s2->owner!=s->owner) { X sprintf(telegram_buf,"BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #"); X sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number); X str_cat(telegram_buf, buf); X str_cat(telegram_buf, bufr); X str_cat(telegram_buf, bufd); X str_cat(telegram_buf, buff); X str_cat(telegram_buf, bufc); X str_cat(telegram_buf, bufx); X notify(s2->owner, telegram_buf); X } X X openshdata(&load_shdata); X putship(load_shdata,s,shipno); X putship(load_shdata, s2, s->object.number); X close_file(load_shdata); X free(s2); X X } else if (sh) { X /* ship to ship transfer, non-transport device */ X X buff[0] = bufr[0] = bufd[0] = bufc[0] = '\0'; X switch (commod) { X case 'r': X sprintf(buf,"%d resources transferred.\n", amt); X notify(Playernum, buf); X sprintf(bufr, "%d Resources\n",amt); X break; X case 'f': X sprintf(buf,"%d fuel transferred.\n", amt); X notify(Playernum, buf); X sprintf(buff, "%d Fuel\n",amt); X break; X case 'd': X sprintf(buf,"%d destruct transferred.\n", amt); X notify(Playernum, buf); X sprintf(bufd, "%d Destruct\n",amt); X break; X case 'x' : X case '&': X sprintf(buf,"%d crystals transferred.\n", amt); X notify(Playernum, buf); X sprintf(bufd, "%d Crystal(s)\n",amt); X break; X case 'c': X sprintf(buf,"%d popn transferred.\n", amt); X notify(Playernum, buf); X sprintf(bufc, "%d %s\n",amt,Race->Thing?"tons of biomass" : "population"); X break; X default: X break; X } X X X if (s2->owner!=s->owner) { X sprintf(telegram_buf, "BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #"); X sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number); X str_cat(telegram_buf, buf); X str_cat(telegram_buf, bufr); X str_cat(telegram_buf, bufd); X str_cat(telegram_buf, buff); X str_cat(telegram_buf, bufc); X notify(s2->owner, telegram_buf); X } X openshdata(&load_shdata); X putship(load_shdata,s2,s->destshipno); X close_file(load_shdata); X free(s2); X } X X if (!sh) { X if (commod=='c') { X opensectdata(&load_sectdata); X putsector(load_sectdata,sect,p->sectormappos + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) ); X close_file(load_sectdata); X free(sect); X } X X openpdata(&load_pdata); X putplanet(load_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(load_pdata); X free(p); X } X X if (Mod && first) { X first = 0; X if (s->whatorbits==LEVEL_UNIV) X deductAPs(Playernum,APcount, 0, 1); /* ded from sdata */ X else X deductAPs(Playernum,APcount, s->storbits, 0); X X } X Xfree(s); Xfree(Race); X} X Xdump(Playernum,APcount, argn,args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint player, star, i; Xracetype *Race, *r; X X if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) X return; X X GetPlayer(args[1], &player, &r); Xif(player < 0 || player > Numraces() ) { X sprintf(buf,"No such player.\n"); X notify(Playernum, buf); X return; X } X X/* transfer all planet and star knowledge to the player */ X/* get all stars and planets */ Xopenracedata(&load_racedata); Xgetrace(load_racedata, &Race, Playernum); Xclose_file(load_racedata); X X openstardata(&load_stardata); X getsdata(load_stardata,&Sdata); X openpdata(&load_pdata); X for (star=0; starexplored, Playernum)) { X setbit(Stars[star]->explored, player); X X for (i=0; inumplanets; i++) { X free(planets[star][i]); X getplanet(load_pdata,&planets[star][i],Stars[star]->planetpos[i]); X if(planets[star][i]->info[Playernum-1].explored) { X planets[star][i]->info[player-1].explored = 1; X putplanet(load_pdata,planets[star][i],Stars[star]->planetpos[i]); X } X } X putstar(load_stardata, Stars[star], star); X} X X} Xclose_file(load_stardata); Xclose_file(load_pdata); X X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0); X Xsprintf(buf, "%s [%d] has given you exploration data.\n", Race->name, Playernum); Xif(!notify(player, buf)) X push_message(TELEG_PLAYER_AUTO, player, buf, TELEGRAM); Xnotify(Playernum, "Exploration Data transferred.\n"); X Xfree(r); Xfree(Race); X} X Xtransfer(Playernum,APcount, argn,args) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; X{ Xint Mod = 0, transfer_fd, player, give; Xplanettype *planet; Xchar commod=0; Xracetype *r; X X if (Dir[Playernum-1].level != LEVEL_PLAN) { X sprintf(buf,"You need to be in planet scope to do this.\n"); X notify(Playernum, buf); X return; X } X X X if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount)) X return; X X GetPlayer(args[1], &player, &r); X Xif(player < 0 || player > Numraces() ) { X sprintf(buf,"No such player.\n"); X notify(Playernum, buf); X return; X } X X openpdata(&transfer_fd); X getplanet(transfer_fd, &planet, Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(transfer_fd); X X sscanf(args[2],"%c",&commod); X give = atoi(args[3]); X Xif(give < 0) { X notify(Playernum, "You must specify a positive amount.\n"); X free(r); X free(planet); X return; X } X Xswitch(commod) { X case 'r' : X if(give > planet->info[Playernum-1].resource) X { X sprintf(buf,"You don't have %d on this planet.\n",give); X notify(Playernum, buf); X } else { X planet->info[Playernum-1].resource -= give; X planet->info[player-1].resource += give; X sprintf(buf,"%d resources transferred to player #%d\n",give,player); X notify(Playernum, buf); X } X break; X case 'x' : X case '&' : X if(give > planet->info[Playernum-1].crystals) X { X sprintf(buf,"You don't have %d on this planet.\n",give); X notify(Playernum, buf); X } else { X planet->info[Playernum-1].crystals -= give; X planet->info[player-1].crystals += give; X sprintf(buf,"%d crystal(s) transferred to player #%d\n",give,player); X notify(Playernum, buf); X } X break; X case 'f' : X if(give > planet->info[Playernum-1].fuel) X { X sprintf(buf,"You don't have %d fuel on this planet.\n",give); X notify(Playernum, buf); X } else { X planet->info[Playernum-1].fuel -= give; X planet->info[player-1].fuel += give; X sprintf(buf,"%d fuel transferred to player #%d\n",give,player); X notify(Playernum, buf); X } X break; X case 'd' : X if(give > planet->info[Playernum-1].destruct) X { X sprintf(buf,"You don't have %d destruct on this planet.\n",give); X notify(Playernum, buf); X } else { X planet->info[Playernum-1].destruct -= give; X planet->info[player-1].destruct += give; X sprintf(buf,"%d destruct transferred to player #%d\n",give,player); X notify(Playernum, buf); X } X break; X default : X sprintf(buf,"What?\n"); X notify(Playernum, buf); X } X X openpdata(&transfer_fd); X putplanet(transfer_fd, planet, Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]); X close_file(transfer_fd); X X Xfree(r); Xfree(planet); XMod = 1; X X deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0); X X} X Xmount(Playernum,APcount, argn,args, mnt) Xint Playernum; Xint APcount; Xint argn; Xchar args[MAXARGS][COMMANDSIZE]; Xint mnt; X{ Xshiptype *ship; X Xif(Dir[Playernum-1].level != LEVEL_SHIP) { X notify(Playernum, "You have to change scope to the ship first.\n"); X return; X} X X openshdata(&load_shdata); X if (!getship(load_shdata, &ship, Dir[Playernum-1].shipno)) { X sprintf(buf,"Illegal dir value.\n"); X notify(Playernum, buf); X close_file(load_shdata); X return; X } X close_file(load_shdata); X if (testship(Playernum,ship, Dir[Playernum-1].shipno)) X { X free(ship); X return; X } X Xif(!ship->hyper_drive.has) { X notify(Playernum, "This ship is not equipped with hyper-drive.\n"); X free(ship); X return; X } X Xif(ship->hyper_drive.mounted && mnt) { X notify(Playernum, "You already have a crystal mounted.\n"); X free(ship); X return; X } else if(!ship->hyper_drive.mounted && !mnt) { X notify(Playernum, "You don't have a crystal mounted.\n"); X free(ship); X return; X } else if(!ship->hyper_drive.mounted && mnt) { X if(!ship->crystals) { X notify(Playernum, "You have no crystals on board.\n"); X free(ship); X return; X } X ship->hyper_drive.mounted=1; X ship->crystals--; X notify(Playernum, "Mounted.\n"); X } else if(ship->hyper_drive.mounted && !mnt) { X if(ship->crystals==Max_crystals(ship)) { X notify(Playernum, "You can't dismount the crystal. Max allowed already on board.\n"); X free(ship); X return; X } X ship->hyper_drive.mounted=0; X ship->crystals++; X notify(Playernum, "Dismounted.\n"); X if(ship->hyper_drive.charge | ship->hyper_drive.ready) { X ship->hyper_drive.charge=0; X ship->hyper_drive.ready=0; X notify(Playernum, "Discharged.\n"); X } X if(ship->laser && ship->fire_laser) { X ship->fire_laser = 0; X notify(Playernum, "Laser deactivated.\n"); X } X X } else { X notify(Playernum, "Weird error in 'mount'.\n"); X free(ship); X return; X } X X openshdata(&load_shdata); X putship(load_shdata, ship, Dir[Playernum-1].shipno); X close_file(load_shdata); X Xfree(ship); X} END_OF_FILE if test 20187 -ne `wc -c <'server/load.c'`; then echo shar: \"'server/load.c'\" unpacked with wrong size! fi # end of 'server/load.c' echo shar: End of archive 1 \(of 9\). cp /dev/null ark1isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 9 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