diff --git a/include/econfig-spec.h b/include/econfig-spec.h index bc4ccc6a..9a1305c6 100644 --- a/include/econfig-spec.h +++ b/include/econfig-spec.h @@ -147,8 +147,6 @@ EMPCF_OPT("EASY_BRIDGES", opt_EASY_BRIDGES, "Allow bridge building without bridge heads") EMPCF_OPT("FALLOUT", opt_FALLOUT, "Enable secondary effects caused by radiation") -EMPCF_OPT("FUEL", opt_FUEL, - "Make ships use fuel to move") EMPCF_OPT("GODNEWS", opt_GODNEWS, "Inform the world when deities give/take away") EMPCF_OPT("GO_RENEW", opt_GO_RENEW, @@ -391,8 +389,6 @@ EMPCFBOTH("anno_keep_days", anno_keep_days, int, NSC_INT, KM_INTERNAL, "How long until announcements expire (<0 means never)") EMPCFBOTH("news_keep_days", news_keep_days, int, NSC_INT, KM_INTERNAL, "How long until news expire") -EMPCFBOTH("fuel_mult", fuel_mult, int, NSC_INT, 0, - "Multiplier for fuel to mobility calculation") EMPCFBOTH("lost_items_timeout", lost_items_timeout, int, NSC_INT, KM_INTERNAL, "Seconds before a lost item is timed out of the database") diff --git a/include/land.h b/include/land.h index f3923066..ae7792ca 100644 --- a/include/land.h +++ b/include/land.h @@ -69,7 +69,6 @@ struct lndstr { short lnd_ship; /* pointer to transporting ship */ signed char lnd_harden; /* fortification */ short lnd_retreat; /* retreat percentage */ - unsigned char lnd_fuel; /* How much fuel do we have */ unsigned char lnd_nxlight; /* How many xlight planes on board? */ int lnd_rflags; /* When do I retreat? */ char lnd_rpath[RET_LEN]; /* retreat path */ @@ -105,8 +104,6 @@ struct lchrstr { int l_dam; /* # of guns firing */ int l_ammo; /* firing ammu used per shot */ int l_aaf; /* aa fire */ - unsigned char l_fuelc; /* fuel capacity */ - unsigned char l_fuelu; /* fuel used per 10 mob */ unsigned char l_nxlight; /* maximum number of xlight planes */ unsigned char l_nland; /* maximum number of units */ signed char l_type; /* index in lchr[] */ diff --git a/include/prototypes.h b/include/prototypes.h index 67aed982..73d01ef1 100644 --- a/include/prototypes.h +++ b/include/prototypes.h @@ -130,7 +130,6 @@ int fly(void); int foll(void); int force(void); int fort(void); -int fuel(void); int give(void); int grin(void); int hard(void); @@ -751,7 +750,6 @@ extern int nav_ship(struct shpstr *); extern int load_it(struct shpstr *, struct sctstr *, int); extern void unload_it(struct shpstr *); -extern void auto_fuel_ship(struct shpstr *); /* nxtitemp.c */ extern void *nxtitemp(struct nstr_item *); /* plague.c */ diff --git a/include/ship.h b/include/ship.h index 1f7fbf8a..335f506a 100644 --- a/include/ship.h +++ b/include/ship.h @@ -96,7 +96,6 @@ struct shpstr { char shp_path[MAXSHPPATH]; short shp_follow; char shp_name[MAXSHPNAMLEN]; /* name set with the "name" command */ - unsigned char shp_fuel; /* How much fuel do we have */ unsigned char shp_nchoppers; /* How many choppers on board? */ unsigned char shp_nxlight; /* How many xlight planes on board? */ coord shp_orig_x; @@ -118,8 +117,6 @@ struct mchrstr { int m_glim; /* how many guns it can fire */ unsigned char m_nxlight; /* maximum number of xlight planes */ unsigned char m_nchoppers; /* maximum number of choppers */ - unsigned char m_fuelc; /* fuel capacity */ - unsigned char m_fuelu; /* fuel used per 10 mob */ char *m_name; /* full name of type of ship */ int m_tech; /* tech required to build */ int m_cost; /* how much it costs to build */ @@ -148,7 +145,7 @@ struct mchrstr { #define M_SEMILAND bit(14) /* can land 1/4 */ /* unused bit(15) */ /* unused bit(16) */ -#define M_OILER bit(17) /* can re-fuel ships */ +/* unused bit(17) */ #define M_SUPPLY bit(18) /* Can supply units/sects/ships */ #define M_CANAL bit(19) /* Can navigate a canal (BIG CITY) */ #define M_ANTIMISSILE bit(20) /* Shoot down missile */ diff --git a/info/Autofish.t b/info/Autofish.t index 96217377..d9960c0c 100644 --- a/info/Autofish.t +++ b/info/Autofish.t @@ -66,9 +66,6 @@ repeat 2a,2b for other ships in the area. .s1 During the update your fishing boats will now move to the harbor at 15,1 unload food until it reaches 30, then move back to 15,1 and STOP. -If you're using fishing boats that require fuel, i.e. fb2 -when the ship enters the harbor, and the fuel level is at 0, the -autonav code will automatically refuel the ship for you. So unless the ship gets sunk, or something happens to it, like the civs starve on board if you don't leave enough food on it, the ships will continue to feed your country and you won't even need diff --git a/info/Land-units.t b/info/Land-units.t index 094fac66..a7abe25b 100644 --- a/info/Land-units.t +++ b/info/Land-units.t @@ -17,7 +17,7 @@ will usually start with 'l'. .s1 Land units have some characteristics of both ships and planes, plus some unique ones. Like both ships & planes, they have efficiency & mobility. -Like ships, they can carry cargo, may have/use fuel, and may be able to fire +Like ships, they can carry cargo, and may be able to fire guns at distant targets. Like planes, they have attack and defense values, and may be able to act automatically to defend your country. Let's look at a typical land unit: @@ -31,7 +31,7 @@ Let's look at a typical land unit: .s1 This land unit is an infantry unit, located at 8,0. In many games, you will start with 1-2 basic land units of this type. Some of the things about it are -familiar. It is 96% efficient, has 93 mobility units, carries 1 food, no fuel, +familiar. It is 96% efficient, has 93 mobility units, carries 1 food, and is tech 0 and currently contains 100 mi. It carries 0 extra-light planes, and is not on a ship. The 'a' stands for army, and is just like fleets or wings, i.e. a way of grouping your @@ -132,16 +132,16 @@ operate. These are obtainable from the show command: .EX show land statistics .s1 .NF - s v s r f a d a a x - p i p a r c a m a f f p - att def vul d s y d g c m m f c u l -infantry 1.0 1.5 60 23 15 2 1 0 0 0 0 0 0 0 0 + s v s r f a d a a x + p i p a r c a m a p + att def vul d s y d g c m m f l +infantry 1.0 1.5 60 23 15 2 1 0 0 0 0 0 0 .FI .s1 The infantry unit has an attack multiplier of 1.0, and defensive multiplier of 1.5. It has a vulnerability rating of 60, a speed of 23, a visibility of 15, spy value of 2, reaction radius maximum of 1, no firing range, no accuracy, -no firing damage, uses no ammo, has no aa fire, doesn't carry of use fuel, +no firing damage, uses no ammo, has no aa fire, and can't carry extra-light planes. .s1 When attacking, a unit's value is expressed in 'mil-equivalents', i.e. 1 @@ -207,11 +207,6 @@ information on supply and how it affects combat) Aaf is the unit's anti-aircraft fire value. The higher the value, the more damage the unit will do to planes flying overhead. .s1 -Fc/fu are the unit's fuel capacity and use. If the fc/fu are 0, the unit -does not need fuel to gain mobility. If the fc/fu are non-zero, the unit -will need fuel to gain mobility, and will use fu fuel whenever it fights. -(See info \*Qfuel\*U for information on fuel) -.s1 Xpl is the number of extra-light planes the unit can carry. Planes can operate from a land unit in the same fashion as if it were a carrier. Normally, extra-light planes are SAMs, so units can carry SAMs for diff --git a/info/Options.t b/info/Options.t index 07f165c5..777a3a6e 100644 --- a/info/Options.t +++ b/info/Options.t @@ -17,7 +17,6 @@ ALL_BLEED: you get tech bleed from all countries, not just allies SLOW_WAR: War declaring takes time. No land attacks unless at war. NOMOBCOST: ships pay 0 mob to fire. Subs pay 1/2 a sect's movement cost TRADESHIPS: you can build/nav/scuttle trade ships to make money -FUEL: ships need fuel to gain mobility RES_POP: Research affects max sector population. NOFOOD: No food is required. BLITZ: Players get infinite BTU's. diff --git a/info/Selector.t b/info/Selector.t index 892e56a2..2e54c108 100644 --- a/info/Selector.t +++ b/info/Selector.t @@ -120,7 +120,6 @@ Ship: .L fleet .L nplane number of planes the ship is carrying -.L fuel .L nxlight number of xlight planes the ship is carrying .L nchoppers @@ -154,7 +153,6 @@ ship the land unit is on (-1 = no land unit) .L harden fortification .L retreat -.L fuel .L land number of land units on the unit .L nxlight @@ -169,8 +167,6 @@ number of xlight planes on the unit .L dam .L ammo .L aaf -.L fuelc -.L fuelu .L maxlight .in .s1 diff --git a/info/Ship-types.t b/info/Ship-types.t index 0604f507..53bd43c7 100644 --- a/info/Ship-types.t +++ b/info/Ship-types.t @@ -162,8 +162,6 @@ submarine The submarine was originally intended, in the 1900-1910 period, minesweeper Usually converted fishing vessels, small, and expendable. They found and destroyed mines with a variety of tricks, including cables & magnetism. - -oiler These ships represent the whole range of refueling ships. .fi .s1 These units types differ in their fundamental @@ -191,7 +189,7 @@ The headings for the stats listing are .s1 .EX show ship stats .s1 -.in \w'fuel c/u\0\0'u +.in \w'spy\0\0'u .L def defensive armament of the ship .L spd @@ -219,9 +217,6 @@ enabled) .L xpl The number of extra-light planes the ship can carry. (If the XLIGHT option is enabled) -.L "fuel c/u" -The ship's fuel capacity & usage. (see info fuel) (If the FUEL option is -enabled) .in .s1 Each ship can carry a certain amount of products and has certain @@ -244,8 +239,6 @@ The vessel can carry planes with the light attribute set. The vessel can carry missiles. .L oil The vessel can drill for oil -.L oiler -The vessel can fuel other ships at sea .L sonar The vessel has sonar capabilities to detect submarines .L mine @@ -290,15 +283,15 @@ battleship 1 50 50 31 0 $800 .s1 .EX show ship stats .NF - s v s r f h x p l fuel - p i p n i e p l n c/u + s v s r f h x p l + p i p n i e p l n def d s y g r l l n d -fishing boat 1 10 10 15 2 0 0 0 0 0 0 0/0 -cargo ship 1 20 10 35 3 0 0 0 1 0 0 0/0 -ore ship 1 20 10 35 3 0 0 0 1 0 0 0/0 -slave ship 20 10 35 3 0 0 0 1 0 0 0/0 -trade ship 1 20 10 35 3 0 0 0 1 0 0 0/0 -frigate 50 25 25 3 1 1 0 1 0 2 0/0 +fishing boat 1 10 10 15 2 0 0 0 0 0 0 +cargo ship 1 20 10 35 3 0 0 0 1 0 0 +ore ship 1 20 10 35 3 0 0 0 1 0 0 +slave ship 20 10 35 3 0 0 0 1 0 0 +trade ship 1 20 10 35 3 0 0 0 1 0 0 +frigate 50 25 25 3 1 1 0 1 0 2 .FI .s1 .EX show ship cap diff --git a/info/Unit-types.t b/info/Unit-types.t index 1a0cca53..a2761dce 100644 --- a/info/Unit-types.t +++ b/info/Unit-types.t @@ -126,7 +126,7 @@ The headings for the stats listing are .s1 .EX show land stats .s1 -.in \w'fc/fu\0\0'u +.in \w'spy\0\0'u .L att the attack multiplier of the land unit .L def @@ -153,9 +153,6 @@ the number of guns that fire when the unit fires ammo: the number of shells the unit uses when fighting or firing .L aaf the aa fire rating of the unit -.L fc/fu -The land unit's fuel capacity & usage. -(see info fuel) (If the FUEL option is enabled) .L xpl The number of extra-light planes the land unit can carry. (If the XLIGHT option is enabled) @@ -215,15 +212,15 @@ marines 1 20 10 100 2 4 5 200 $2000 .s1 .EX show land stats .NF - s v s r f a d a a x - p i p a r c a m a f f p - att def vul d s y d g c m m f c u l -War band 1.3 1.0 99 23 5 1 1 0 0 0 0 0 0 0 0 -Supply Wagon 0.1 0.2 100 15 6 1 0 0 0 0 0 0 0 0 0 -GPG Commandos 1.0 1.0 70 30 1 2 1 0 0 0 5 1 10 1 0 -artillery 1 0.0 0.5 50 15 6 1 0 6 40 4 5 15 0 0 0 -Jump infantry 5.0 6.0 20 55 1 4 4 0 0 0 5 35 10 1 5 -marines 1 1.0 2.0 70 23 3 3 2 0 0 0 5 5 0 0 2 + s v s r f a d a a x + p i p a r c a m a p + att def vul d s y d g c m m f l +War band 1.3 1.0 99 23 5 1 1 0 0 0 0 0 0 +Supply Wagon 0.1 0.2 100 15 6 1 0 0 0 0 0 0 0 +GPG Commandos 1.0 1.0 70 30 1 2 1 0 0 0 5 1 0 +artillery 1 0.0 0.5 50 15 6 1 0 6 40 4 5 15 0 +Jump infantry 5.0 6.0 20 55 1 4 4 0 0 0 5 35 5 +marines 1 1.0 2.0 70 23 3 3 2 0 0 0 5 5 2 .FI .s1 .EX show land cap diff --git a/info/fortify.t b/info/fortify.t index 539f66bc..8829cabb 100644 --- a/info/fortify.t +++ b/info/fortify.t @@ -35,7 +35,4 @@ to fortify. For example, when a unit with 120 of 127 mobility gains 60 mobility, its mobility increases to the maximum 127, and it uses 53 mobility to fortify. .s1 -Units requiring fuel (if option FUEL is enabled), do not fortify -automatically, as this would burn fuel. -.s1 .SA "bomb, Unit-types, LandUnits" diff --git a/info/fuel.t b/info/fuel.t deleted file mode 100644 index c0e09c5a..00000000 --- a/info/fuel.t +++ /dev/null @@ -1,41 +0,0 @@ -.TH Command FUEL -.NA fuel "Give fuel to a ship/unit" -.LV Basic -.SY "fuel []" -The fuel command carries out the fueling of ships and units. -The ship(s) must be in a harbor and -the harbor must be at least 2% efficient. -Land units may be in any sector. -Alternatively, you can fuel at sea using an oiler, which is -any ship with the oiler ability. (Note: if you are in a harbor, -you can't fuel from an oiler, you must use the harbor) -.s1 -Ships and units can be fueled by either petrol or oil, with petrol being -used first. 1 unit of petrol = 5 fuel units. 1 unit of oil = 50 -fuel units. Each ship or unit, in turn, will attempt to take on the -specified amount of fuel. Petrol/oil will be used for each ship or unit, -the amount being rounded up individually. For example, if you have -a harbor with 50 fuel in it, and you tell a ship with a 50 fuel -capacity to load 50 fuel, it'll use 1 oil. If you tell it to load -*1* fuel 50 times, it'll use *50* oil, with the round-up making -it use 1 oil each time. The solution, of course, is to not load -fuel in tiny, wasteful amounts. -.s1 -Each update, ships and units use fuel to make mobility points. To produce -10 mobility points requires the number of units of fuel listed -for the ship or unit in the capability list. (see info show) -(This number is usually 1, but may be more). If the number is a 0, -the unit does not use fuel. -.s1 -If the ship or unit has no fuel, -it will attempt to get fuel using the supply procedure (see -info supply). It will try to use first petrol, then oil, until it has enough -fuel to get full mobility. -If it can't get fuel by using the supply system, it won't get mobility. -.s1 -See \*Qshow\*U for a table of the maximum amounts of -fuel that can be carried on each type of unit or ship. -.s1 -You can fuel friendly ships, but must fuel them one at a time, by number. -.s1 -.SA "Ship-types, Unit-types, Ships, LandUnits" diff --git a/info/land.t b/info/land.t index 5cd9c681..d8b369bb 100644 --- a/info/land.t +++ b/info/land.t @@ -34,8 +34,6 @@ the land unit's fortification level, the mobility of the land unit, .L fd the amount of food on board, -.L fl -the amount of fuel on board (only if the FUEL option is enabled), .L tch the tech level of the land unit, .L retr diff --git a/info/ldump.t b/info/ldump.t index 1f71ce83..3ab5215a 100644 --- a/info/ldump.t +++ b/info/ldump.t @@ -42,7 +42,7 @@ shown here (no partial pattern matching is done.) fort fortification level mob mobility food # of food loaded - fuel # of fuel loaded + fuel obsolete, retained for backwards compatibility, always zero tech technology of unit retr retreat %age of unit react current reaction radius diff --git a/info/order.t b/info/order.t index 8963fed7..be39bec5 100644 --- a/info/order.t +++ b/info/order.t @@ -118,14 +118,6 @@ In either case when you arrive at the other harbor all but 1 civ will be dumped into the harbor. Be careful if you set civilians as one of your cargo levels. .s1 -If the FUEL option is enabled ships will try and fuel when they load -cargo in the starting or ending point and they currently have a fuel -level less then half of their max fuel level. -Auto fueling is not foolproof. If you declare a -long path and the ship does not pass through any harbors it might -run out of fuel and mobility. Remember ships can only autofuel -in harbors. -.s1 You can set any commodity in the game to be loaded on the ship. However if you tell a ship to load a commodity it can not hold it will be ignored. Example: If you tell a battleship to load diff --git a/info/relations.t b/info/relations.t index 9936fabd..9b9a03b9 100644 --- a/info/relations.t +++ b/info/relations.t @@ -47,7 +47,7 @@ allies, but not by others . Allied nations are assumed to have .L Friendly When you accept a country as a trustworthy trading partner, then you establish friendly relations towards them. This allows them to sail -ships into your harbours, load and unload goods, fuel, and have their +ships into your harbours, load and unload goods, and have their ships repaired there. You are allowed to "tend" and "follow" friendly ships. You are allowed to cede sectors to a friendly nation, and may send them "flash" messages (see info flash). You will diff --git a/info/sdump.t b/info/sdump.t index 5709c57b..bcd942f8 100644 --- a/info/sdump.t +++ b/info/sdump.t @@ -47,7 +47,7 @@ shown here (no partial pattern matching is done.) xl # of x-light planes on board land # of land units on board mob mobility - fuel fuel on board + fuel obsolete, retained for backwards compatibility, always zero tech technology of ship shell # of shells on board gun # of guns on board diff --git a/info/ship.t b/info/ship.t index 980ba0fd..66ccd236 100644 --- a/info/ship.t +++ b/info/ship.t @@ -40,8 +40,6 @@ the number of helicopters on board, the number of extra-light planes on board, .L ln the number of land units on board, -.L fuel -the amount of fuel on board (only if the FUEL option is enabled) .L mob the mobility of the ship, .L tech diff --git a/info/supply.t b/info/supply.t index db6065cf..fd184724 100644 --- a/info/supply.t +++ b/info/supply.t @@ -14,9 +14,6 @@ A basic load of supplies for a unit consists of: A unit uses shells equal to its ammo stat to fire once. Use the \*Qshow\*U command to find out how much ammo the unit uses per shot. - - 3) petrol equal to its fuel use number, if the unit uses fuel - (show land stats will show the fuel use number) .fi .s1 diff --git a/info/version.t b/info/version.t index dd8f2da0..0ff3e173 100644 --- a/info/version.t +++ b/info/version.t @@ -83,7 +83,7 @@ Options enabled in this game: PINPOINTMISSILE, SAIL, SHOWPLANE, TREATIES Options disabled in this game: - AUTO_POWER, FUEL, GO_RENEW, GUINEA_PIGS, HIDDEN, LOSE_CONTACT, MARKET, + AUTO_POWER, GO_RENEW, GUINEA_PIGS, HIDDEN, LOSE_CONTACT, MARKET, MOB_ACCESS, NO_FORT_FIRE, RES_POP, SLOW_WAR, SUPER_BARS, TECH_POP, TRADESHIPS diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index c9ea788a..2c325141 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -374,7 +374,6 @@ build_ship(struct sctstr *sp, struct mchrstr *mp, short *vec, int tlev) ship.shp_orig_own = player->cnum; ship.shp_orig_x = sp->sct_x; ship.shp_orig_y = sp->sct_y; - ship.shp_fuel = mchr[(int)ship.shp_type].m_fuelc; ship.shp_rflags = 0; memset(ship.shp_rpath, 0, sizeof(ship.shp_rpath)); shp_set_tech(&ship, tlev); @@ -490,7 +489,6 @@ build_land(struct sctstr *sp, struct lchrstr *lp, short *vec, int tlev) land.lnd_nland = 0; land.lnd_harden = 0; land.lnd_retreat = morale_base; - land.lnd_fuel = lp->l_fuelc; land.lnd_nxlight = 0; land.lnd_rflags = 0; memset(land.lnd_rpath, 0, sizeof(land.lnd_rpath)); diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index e90ff72f..98bb6d9b 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -346,7 +346,6 @@ pr_land(struct lndstr *land) pr("Tech : %d\t\t", land->lnd_tech); pr("Army : %.1s\n", &land->lnd_army); pr("Fortification : %d\t", land->lnd_harden); - pr("Fuel : %d\n", land->lnd_fuel); pr("Land unit : %d\n", land->lnd_land); pr("Ship : %d\t\t", land->lnd_ship); pr("Radius

: %d\n", land->lnd_rad_max); @@ -386,9 +385,6 @@ pr_ship(struct shpstr *ship) pr("Efficiency : %d\n", ship->shp_effic); pr("Mobility : %d\t\t", ship->shp_mobil); pr("Fleet : %.1s\n", &ship->shp_fleet); - /* could depend on opt_FUEL - but a deity might want to set this - up before enabling the option */ - pr("Fuel : %d\n", ship->shp_fuel); pr("Retreat path : '%s'\t\tRetreat Flags : %d\n", ship->shp_rpath, ship->shp_rflags); pr("Plague Stage : %d\t\t",ship->shp_pstage); @@ -810,7 +806,7 @@ doship(char op, int arg, char *p, struct shpstr *ship) ship->shp_mobil = arg; break; case 'B': - ship->shp_fuel = errcheck(arg, 0, 255); + warn_deprecated(op); break; case 'F': if (p[0] == '~') @@ -928,7 +924,7 @@ dounit(char op, int arg, char *p, struct lndstr *land) land->lnd_harden = errcheck(arg, 0, 255); break; case 'B': - land->lnd_fuel = errcheck(arg, 0, 255); + warn_deprecated(op); break; case 'S': land->lnd_ship = arg; diff --git a/src/lib/commands/fuel.c b/src/lib/commands/fuel.c deleted file mode 100644 index 33b6d251..00000000 --- a/src/lib/commands/fuel.c +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak, - * Ken Stevens, Steve McClure - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * --- - * - * See files README, COPYING and CREDITS in the root of the source - * tree for related information and legal notices. It is expected - * that future projects/authors will amend these files as needed. - * - * --- - * - * fuel.c: fuel ships/land units - * - * Known contributors to this file: - * - */ - -#include - -#include -#include "commands.h" -#include "empobj.h" -#include "optlist.h" -#include "plague.h" - -int -fuel(void) -{ - static int shp_or_lnd[] = { EF_SHIP, EF_LAND, EF_BAD }; - struct nstr_item ni; - union empobj_storage item, item2; - int type; - struct mchrstr *mp; - struct lchrstr *lcp; - char *p; - int fueled; - int land_fuel, ship_fuel; - int oil_amt, pet_amt, fuel_amt, tot_fuel, max_amt; - int move_amt; - double extra; - struct sctstr sect; - struct natstr *natp; - int harbor, sector; - int fuelled_ship = -1; - struct nstr_item tender, ltender; - char prompt[128]; - char buf[1024]; - - if (opt_FUEL == 0) { - pr("Option 'FUEL' not enabled\n"); - return RET_SYN; - } - if ((p = - getstarg(player->argp[1], "Ship or land unit (s,l)? ", buf)) == 0) - return RET_SYN; - type = ef_byname_from(p, shp_or_lnd); - if (type < 0) { - pr("Ships or land units only! (s, l)\n"); - return RET_SYN; - } - sprintf(prompt, "%s(s)? ", ef_nameof(type)); - p = getstarg(player->argp[2], prompt, buf); - if (!snxtitem(&ni, type, p)) - return RET_SYN; - if (isdigit(*p)) - fuelled_ship = atoi(p); - p = getstarg(player->argp[3], "Amount: ", buf); - if (p == 0 || *p == 0) - return RET_SYN; - fuel_amt = atoi(p); - if (fuel_amt <= 0) { - pr("Fuel amount must be positive!\n"); - return RET_FAIL; - } - - while (nxtitem(&ni, &item)) { - fueled = 0; - if (type == EF_SHIP) { - if (item.ship.shp_own != player->cnum) { - int rel; - - if (item.ship.shp_uid != fuelled_ship) - continue; - natp = getnatp(player->cnum); - rel = getrel(natp, item.ship.shp_own); - if (rel < FRIENDLY) - continue; - } - if (!getsect(item.ship.shp_x, item.ship.shp_y, §)) - continue; - if (!item.ship.shp_own) - continue; - - if (shp_check_nav(§, &item.ship) == CN_LANDLOCKED) { - pr("%s is landlocked and cannot be fueled.\n", - prship(&item.ship)); - continue; - } - - mp = &mchr[(int)item.ship.shp_type]; - - harbor = 0; - if (sect_has_dock(§)) { - harbor = 1; - oil_amt = sect.sct_item[I_OIL]; - pet_amt = sect.sct_item[I_PETROL]; - if ((oil_amt + pet_amt) == 0) - harbor = 0; - - if (sect.sct_effic < 2) { - pr("The harbor at %s is not 2%% efficient yet.\n", - xyas(item.ship.shp_x, item.ship.shp_y, - player->cnum)); - harbor = 0; - } - if ((sect.sct_own != player->cnum) && sect.sct_own) - harbor = 0; - } - - if ((mp->m_fuelu == 0) && (item.ship.shp_own == player->cnum)) { - pr("%s does not use fuel!\n", prship(&item.ship)); - continue; - } - - if (harbor) { - ship_fuel = item.ship.shp_fuel; - oil_amt = sect.sct_item[I_OIL]; - pet_amt = sect.sct_item[I_PETROL]; - max_amt = mp->m_fuelc - ship_fuel; - - if (max_amt == 0) { - pr("%s already has a full fuel load.\n", - prship(&item.ship)); - continue; - } - tot_fuel = (oil_amt * 50 + pet_amt * 5); - if (tot_fuel == 0) { - pr("No fuel in the harbor at %s!\n", - xyas(sect.sct_x, sect.sct_y, player->cnum)); - continue; - } - move_amt = MIN(tot_fuel, fuel_amt); - move_amt = MIN(move_amt, max_amt); - - if (move_amt == 0) - continue; - - item.ship.shp_fuel += move_amt; - - fueled = 1; - if ((pet_amt * 5) >= move_amt) { - extra = move_amt / 5.0 - move_amt / 5; - if (extra > 0.0) - sect.sct_item[I_PETROL] - = MAX((pet_amt - move_amt / 5) - 1, 0); - else - sect.sct_item[I_PETROL] - = MAX((pet_amt - move_amt / 5), 0); - } else { - sect.sct_item[I_PETROL] = 0; - move_amt -= pet_amt * 5; - extra = move_amt / 50.0 - move_amt / 50; - sect.sct_item[I_OIL] = MAX(oil_amt - move_amt / 50, 0); - if (extra > 0.0) - sect.sct_item[I_OIL] - = MAX((oil_amt - move_amt / 50) - 1, 0); - else - sect.sct_item[I_OIL] - = MAX((oil_amt - move_amt / 50), 0); - } - - /* load plague */ - if (sect.sct_pstage == PLG_INFECT - && item.ship.shp_pstage == PLG_HEALTHY) - item.ship.shp_pstage = PLG_EXPOSED; - - putsect(§); - putship(item.ship.shp_uid, &item.ship); - } else { /* not in a harbor */ - if (!player->argp[4]) - pr("%s is not in a supplied, efficient harbor\n", - prship(&item.ship)); - if (!snxtitem(&tender, EF_SHIP, - getstarg(player->argp[4], "Oiler? ", buf))) - continue; - - if (!check_ship_ok(&item.ship)) - continue; - - if (!nxtitem(&tender, &item2)) - continue; - - if (!(mchr[(int)item2.ship.shp_type].m_flags & M_OILER)) { - pr("%s is not an oiler!\n", prship(&item2.ship)); - continue; - } - if (item2.ship.shp_own != player->cnum) { - pr("You don't own that oiler!\n"); - continue; - } - - if ((item2.ship.shp_x != item.ship.shp_x) || - (item2.ship.shp_y != item.ship.shp_y)) { - pr("Not in the same sector!\n"); - continue; - } - ship_fuel = item.ship.shp_fuel; - oil_amt = item2.ship.shp_item[I_OIL]; - pet_amt = item2.ship.shp_item[I_PETROL]; - max_amt = mp->m_fuelc - ship_fuel; - - if (max_amt == 0) { - pr("%s already has a full fuel load.\n", - prship(&item.ship)); - continue; - } - tot_fuel = oil_amt * 50 + pet_amt * 5; - move_amt = MIN(tot_fuel, fuel_amt); - move_amt = MIN(move_amt, max_amt); - - if (move_amt == 0) - continue; - - item.ship.shp_fuel += move_amt; - - fueled = 1; - if ((pet_amt * 5) >= move_amt) { - extra = move_amt / 5.0 - move_amt / 5; - if (extra > 0.0) - item2.ship.shp_item[I_PETROL] - = MAX((pet_amt - move_amt / 5) - 1, 0); - else - item2.ship.shp_item[I_PETROL] - = MAX((pet_amt - move_amt / 5), 0); - } else { - item2.ship.shp_item[I_PETROL] = 0; - move_amt -= pet_amt * 5; - extra = move_amt / 50.0 - move_amt / 50; - item2.ship.shp_item[I_OIL] - = MAX(oil_amt - (move_amt / 50), 0); - if (extra > 0.0) - item2.ship.shp_item[I_OIL] - = MAX((oil_amt - move_amt / 50) - 1, 0); - else - item2.ship.shp_item[I_OIL] - = MAX((oil_amt - move_amt / 50), 0); - } - - /* load plague */ - if (item2.ship.shp_pstage == PLG_INFECT - && item.ship.shp_pstage == PLG_HEALTHY) - item.ship.shp_pstage = PLG_EXPOSED; - - putship(item.ship.shp_uid, &item.ship); - /* quick hack -KHS */ - if (item.ship.shp_uid == item2.ship.shp_uid) - item2.ship.shp_fuel = item.ship.shp_fuel; - putship(item2.ship.shp_uid, &item2.ship); - } - pr("%s", prship(&item.ship)); - } else { - if (item.land.lnd_own != player->cnum) - continue; - - if (!getsect(item.land.lnd_x, item.land.lnd_y, §)) - continue; - - if (!player->owner) - continue; - - lcp = &lchr[(int)item.land.lnd_type]; - - sector = 1; - oil_amt = sect.sct_item[I_OIL]; - pet_amt = sect.sct_item[I_PETROL]; - - if ((oil_amt + pet_amt) == 0) - sector = 0; - - if (lcp->l_fuelu == 0 - && (item.land.lnd_own == player->cnum)) { - pr("%s does not use fuel!\n", prland(&item.land)); - continue; - } - - if (sector) { - land_fuel = item.land.lnd_fuel; - oil_amt = sect.sct_item[I_OIL]; - pet_amt = sect.sct_item[I_PETROL]; - max_amt = lcp->l_fuelc - land_fuel; - - if (max_amt == 0) { - pr("%s already has a full fuel load.\n", - prland(&item.land)); - continue; - } - tot_fuel = (oil_amt * 50 + pet_amt * 5); - if (tot_fuel == 0) { - pr("No fuel in the sector at %s!\n", - xyas(sect.sct_x, sect.sct_y, player->cnum)); - continue; - } - move_amt = MIN(tot_fuel, fuel_amt); - move_amt = MIN(move_amt, max_amt); - - if (move_amt == 0) - continue; - - item.land.lnd_fuel += move_amt; - - fueled = 1; - if ((pet_amt * 5) >= move_amt) { - extra = move_amt / 5.0 - move_amt / 5; - if (extra > 0.0) - sect.sct_item[I_PETROL] - = MAX((pet_amt - move_amt / 5) - 1, 0); - else - sect.sct_item[I_PETROL] - = MAX((pet_amt - move_amt / 5), 0); - } else { - sect.sct_item[I_PETROL] = 0; - move_amt -= pet_amt * 5; - extra = move_amt / 50.0 - move_amt / 50; - sect.sct_item[I_OIL] = MAX(oil_amt - move_amt / 50, 0); - if (extra > 0.0) - sect.sct_item[I_OIL] - = MAX((oil_amt - move_amt / 50) - 1, 0); - else - sect.sct_item[I_OIL] - = MAX((oil_amt - move_amt / 50), 0); - } - - /* load plague */ - if (sect.sct_pstage == PLG_INFECT - && item.land.lnd_pstage == PLG_HEALTHY) - item.land.lnd_pstage = PLG_EXPOSED; - - putsect(§); - putland(item.land.lnd_uid, &item.land); - } else { /* not in a sector */ - if (!player->argp[4]) - pr("%s is not in a supplied sector\n", - prland(&item.land)); - if (!snxtitem(<ender, EF_LAND, - getstarg(player->argp[4], "Supply unit? ", - buf))) - continue; - - if (!check_land_ok(&item.land)) - continue; - - if (!nxtitem(<ender, &item2)) - continue; - - if (!(lchr[(int)item2.land.lnd_type].l_flags & L_SUPPLY)) { - pr("%s is not a supply unit!\n", prland(&item2.land)); - continue; - } - if (item2.land.lnd_own != player->cnum) { - pr("You don't own that unit!\n"); - continue; - } - - if ((item2.land.lnd_x != item.land.lnd_x) || - (item2.land.lnd_y != item.land.lnd_y)) { - pr("Not in the same sector!\n"); - continue; - } - land_fuel = item.land.lnd_fuel; - oil_amt = item2.land.lnd_item[I_OIL]; - pet_amt = item2.land.lnd_item[I_PETROL]; - max_amt = lcp->l_fuelc - land_fuel; - - if (max_amt == 0) { - pr("%s already has a full fuel load.\n", - prland(&item.land)); - continue; - } - tot_fuel = oil_amt * 50 + pet_amt * 5; - move_amt = MIN(tot_fuel, fuel_amt); - move_amt = MIN(move_amt, max_amt); - - if (move_amt == 0) - continue; - - item.land.lnd_fuel += move_amt; - - fueled = 1; - if ((pet_amt * 5) >= move_amt) { - extra = move_amt / 5.0 - move_amt / 5; - if (extra > 0.0) - item2.land.lnd_item[I_PETROL] - = MAX((pet_amt - move_amt / 5) - 1, 0); - else - item2.land.lnd_item[I_PETROL] - = MAX((pet_amt - move_amt / 5), 0); - } else { - item2.land.lnd_item[I_PETROL] = 0; - move_amt -= pet_amt * 5; - extra = move_amt / 50.0 - move_amt / 50; - item2.land.lnd_item[I_OIL] - = MAX(oil_amt - move_amt / 50, 0); - if (extra > 0.0) - item2.land.lnd_item[I_OIL] - = MAX((oil_amt - move_amt / 50) - 1, 0); - else - item2.land.lnd_item[I_OIL] - = MAX((oil_amt - move_amt / 50), 0); - } - - /* load plague */ - if (item2.land.lnd_pstage == PLG_INFECT - && item.land.lnd_pstage == PLG_HEALTHY) - item.land.lnd_pstage = PLG_EXPOSED; - - putland(item.land.lnd_uid, &item.land); - /* quick hack -KHS */ - if (item2.land.lnd_uid == item.land.lnd_uid) - item2.land.lnd_fuel = item.land.lnd_fuel; - putland(item2.land.lnd_uid, &item2.land); - } - pr("%s", prland(&item.land)); - } - if (fueled) { - pr(" takes on %d fuel in %s\n", - move_amt, - xyas(item.ship.shp_x, item.ship.shp_y, player->cnum)); - if (player->cnum != item.ship.shp_own) - wu(0, item.ship.shp_own, - "%s takes on %d fuel in %s courtesy of %s\n", - prship(&item.ship), - move_amt, - xyas(item.ship.shp_x, item.ship.shp_y, - item.ship.shp_own), cname(player->cnum)); - } - } - return RET_OK; -} diff --git a/src/lib/commands/land.c b/src/lib/commands/land.c index 02805835..3985c09b 100644 --- a/src/lib/commands/land.c +++ b/src/lib/commands/land.c @@ -60,8 +60,6 @@ land(void) if (player->god) pr("own "); pr(" # unit type x,y a eff mil frt mu fd"); - if (opt_FUEL) - pr(" fl"); pr(" tch retr rd xl ln carry\n"); } if (land.lnd_off) @@ -77,8 +75,6 @@ land(void) pr("%4d", land.lnd_harden); pr("%4d", land.lnd_mobil); pr("%4d", land.lnd_item[I_FOOD]); - if (opt_FUEL) - pr("%3d", land.lnd_fuel); pr("%4d ", land.lnd_tech); pr("%3d%%", land.lnd_retreat); pr("%3d", land.lnd_rad_max); diff --git a/src/lib/commands/ldump.c b/src/lib/commands/ldump.c index 9d9bdbcb..5b985104 100644 --- a/src/lib/commands/ldump.c +++ b/src/lib/commands/ldump.c @@ -337,10 +337,7 @@ ldump(void) pr(" %d", land.lnd_item[I_FOOD]); break; case 10: - if (opt_FUEL) - pr(" %d", land.lnd_fuel); - else - pr(" 0"); + pr(" 0"); break; case 11: pr(" %d", land.lnd_tech); diff --git a/src/lib/commands/sdump.c b/src/lib/commands/sdump.c index 849ae615..a70ade8d 100644 --- a/src/lib/commands/sdump.c +++ b/src/lib/commands/sdump.c @@ -315,10 +315,7 @@ sdump(void) pr(" %d", ship.shp_mobil); break; case 15: - if (opt_FUEL) - pr(" %d", ship.shp_fuel); - else - pr(" 0"); + pr(" 0"); break; case 16: pr(" %d", ship.shp_tech); diff --git a/src/lib/commands/shi.c b/src/lib/commands/shi.c index 5b6cedfc..05d8c018 100644 --- a/src/lib/commands/shi.c +++ b/src/lib/commands/shi.c @@ -59,8 +59,6 @@ shi(void) pr("own "); pr("shp# ship type x,y fl eff civ mil uw fd pn" " he xl ln mob"); - if (opt_FUEL) - pr(" fuel"); pr(" tech\n"); } if (ship.shp_off) @@ -83,8 +81,6 @@ shi(void) pr("%3d", ship.shp_nxlight); pr("%3d", ship.shp_nland); pr("%4d", ship.shp_mobil); - if (opt_FUEL) - pr("%5d", ship.shp_fuel); pr("%5d\n", ship.shp_tech); if (ship.shp_name[0] != 0) { if (player->god) diff --git a/src/lib/commands/vers.c b/src/lib/commands/vers.c index 773428a6..a0374e8d 100644 --- a/src/lib/commands/vers.c +++ b/src/lib/commands/vers.c @@ -162,9 +162,6 @@ vers(void) pr("The starting mobility when acquiring a sector or unit is %d.\n", -(etu_per_update / sect_mob_neg_factor)); pr("\n"); - if (opt_FUEL) - pr("For ships and land units, fuelu makes %d mobility.\n\n", - fuel_mult); pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX); if (opt_TRADESHIPS) { pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n", diff --git a/src/lib/global/constants.c b/src/lib/global/constants.c index 62ee91ca..b42db330 100644 --- a/src/lib/global/constants.c +++ b/src/lib/global/constants.c @@ -102,9 +102,6 @@ double people_damage = 1.00; /* Civs/mil/uw take this fraction of damage */ double collateral_dam = 0.10; /* Side effect damage to sector */ double assault_penalty = 0.50; /* attack factor for para & assault troops */ -/* opt_FUEL */ -int fuel_mult = 10; /* 1 fuel = 10 mob */ - float land_grow_scale = 2.0; /* how fast eff grows for land units (xETUS) */ float ship_grow_scale = 3.0; /* how fast eff grows for ships (xETUS) */ float plane_grow_scale = 2.0; /* how fast eff grows for planes (xETUS) */ diff --git a/src/lib/global/land.config b/src/lib/global/land.config index 235a9ba0..20a9a7e4 100644 --- a/src/lib/global/land.config +++ b/src/lib/global/land.config @@ -70,29 +70,29 @@ type name l_b h_b tech cost ... /config config land-chr -type name att def vul spd vis spy rma frg acc dam amm aaf fuelc fuelu nxl nla ... - 0 "cav cavalry" 1.2 0.5 80 32 18 4 3 0 0 0 0 0 0 0 0 0 - 1 "linf light infantry" 1.0 1.5 60 28 15 2 1 0 0 0 1 1 0 0 0 0 - 2 "inf infantry" 1.0 1.5 60 25 15 2 1 0 0 0 0 0 0 0 0 0 - 3 "mtif motor inf" 1.2 2.2 60 33 17 1 3 0 0 0 2 3 13 1 0 0 - 4 "mif mech inf" 1.5 2.5 50 33 17 1 3 0 0 0 2 3 13 1 0 0 - 5 "mar marines" 1.4 2.4 60 25 14 2 1 0 0 0 1 2 0 0 0 0 - 6 "sup supply" 0.1 0.2 80 25 20 1 0 0 0 0 0 0 0 0 0 0 - 7 "tra train" 0.0 0.0 120 10 25 3 0 0 0 0 0 0 0 0 5 12 - 8 "spy infiltrator" 0.0 0.0 80 32 18 4 3 0 0 0 0 0 0 0 0 0 - 9 "com commando" 0.0 0.0 80 32 18 4 3 0 0 0 0 0 0 0 0 0 -10 "aau aa unit" 0.5 1.0 60 18 20 1 1 0 0 0 1 2 0 0 0 0 -11 "art artillery" 0.1 0.4 70 18 20 1 0 8 50 5 2 1 0 0 0 0 -12 "lat lt artillery" 0.2 0.6 60 30 18 1 1 5 10 3 1 1 0 0 0 0 -13 "hat hvy artillery" 0.0 0.2 60 12 20 1 0 11 99 8 4 1 0 0 0 0 -14 "mat mech artillery" 0.2 0.6 50 35 17 1 1 8 35 6 3 3 13 1 0 0 -15 "eng engineer" 1.2 2.4 50 25 14 2 1 0 0 0 1 1 0 0 0 0 -16 "meng mech engineer" 1.8 3.5 45 33 15 3 3 0 0 0 1 5 25 2 0 0 -17 "lar lt armor" 2.0 1.0 50 42 15 4 4 0 0 0 1 2 25 1 0 0 -18 "har hvy armor" 2.0 0.8 50 18 17 1 1 0 0 0 2 1 10 2 0 0 -19 "arm armor" 3.0 1.5 40 33 16 2 2 0 0 0 1 2 13 1 0 0 -20 "sec security" 1.0 2.0 60 25 15 2 1 0 0 0 1 1 0 0 0 0 -21 "rad radar unit" 0.0 0.0 50 33 15 3 0 0 0 0 0 2 25 2 1 0 +type name att def vul spd vis spy rma frg acc dam amm aaf nxl nla ... + 0 "cav cavalry" 1.2 0.5 80 32 18 4 3 0 0 0 0 0 0 0 + 1 "linf light infantry" 1.0 1.5 60 28 15 2 1 0 0 0 1 1 0 0 + 2 "inf infantry" 1.0 1.5 60 25 15 2 1 0 0 0 0 0 0 0 + 3 "mtif motor inf" 1.2 2.2 60 33 17 1 3 0 0 0 2 3 0 0 + 4 "mif mech inf" 1.5 2.5 50 33 17 1 3 0 0 0 2 3 0 0 + 5 "mar marines" 1.4 2.4 60 25 14 2 1 0 0 0 1 2 0 0 + 6 "sup supply" 0.1 0.2 80 25 20 1 0 0 0 0 0 0 0 0 + 7 "tra train" 0.0 0.0 120 10 25 3 0 0 0 0 0 0 5 12 + 8 "spy infiltrator" 0.0 0.0 80 32 18 4 3 0 0 0 0 0 0 0 + 9 "com commando" 0.0 0.0 80 32 18 4 3 0 0 0 0 0 0 0 +10 "aau aa unit" 0.5 1.0 60 18 20 1 1 0 0 0 1 2 0 0 +11 "art artillery" 0.1 0.4 70 18 20 1 0 8 50 5 2 1 0 0 +12 "lat lt artillery" 0.2 0.6 60 30 18 1 1 5 10 3 1 1 0 0 +13 "hat hvy artillery" 0.0 0.2 60 12 20 1 0 11 99 8 4 1 0 0 +14 "mat mech artillery" 0.2 0.6 50 35 17 1 1 8 35 6 3 3 0 0 +15 "eng engineer" 1.2 2.4 50 25 14 2 1 0 0 0 1 1 0 0 +16 "meng mech engineer" 1.8 3.5 45 33 15 3 3 0 0 0 1 5 0 0 +17 "lar lt armor" 2.0 1.0 50 42 15 4 4 0 0 0 1 2 0 0 +18 "har hvy armor" 2.0 0.8 50 18 17 1 1 0 0 0 2 1 0 0 +19 "arm armor" 3.0 1.5 40 33 16 2 2 0 0 0 1 2 0 0 +20 "sec security" 1.0 2.0 60 25 15 2 1 0 0 0 1 1 0 0 +21 "rad radar unit" 0.0 0.0 50 33 15 3 0 0 0 0 0 2 1 0 /config config land-chr diff --git a/src/lib/global/nsc.c b/src/lib/global/nsc.c index 205ae005..359c9038 100644 --- a/src/lib/global/nsc.c +++ b/src/lib/global/nsc.c @@ -242,7 +242,6 @@ struct castr ship_ca[] = { {"follow", fldoff(shp_follow), NSC_SHORT, 0, NULL, EF_BAD, 0}, {"name", fldoff(shp_name), NSC_STRINGY, MAXSHPNAMLEN, NULL, EF_BAD, 0}, - {"fuel", fldoff(shp_fuel), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"nchoppers", fldoff(shp_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, NSC_EXTRA}, {"nxlight", fldoff(shp_nxlight), NSC_UCHAR, 0, NULL, @@ -276,8 +275,6 @@ struct castr mchr_ca[] = { {"glim", fldoff(m_glim), NSC_INT, 0, NULL, EF_BAD, 0}, {"nxlight", fldoff(m_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"nchoppers", fldoff(m_nchoppers), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"fuelc", fldoff(m_fuelc), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"fuelu", fldoff(m_fuelu), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"tech", fldoff(m_tech), NSC_INT, 0, NULL, EF_BAD, 0}, {"cost", fldoff(m_cost), NSC_INT, 0, NULL, EF_BAD, 0}, {"flags", fldoff(m_flags), NSC_LONG, 0, NULL, @@ -336,7 +333,6 @@ struct castr land_ca[] = { {"ship", fldoff(lnd_ship), NSC_SHORT, 0, NULL, EF_BAD, 0}, {"harden", fldoff(lnd_harden), NSC_CHAR, 0, NULL, EF_BAD, 0}, {"retreat", fldoff(lnd_retreat), NSC_SHORT, 0, NULL, EF_BAD, 0}, - {"fuel", fldoff(lnd_fuel), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"nxlight", fldoff(lnd_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, NSC_EXTRA}, {"rflags", fldoff(lnd_rflags), NSC_INT, 0, NULL, @@ -364,8 +360,6 @@ struct castr land_ca[] = { {"spy", fldoff(l_spy), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, {"rmax", fldoff(l_rad), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, {"ammo", fldoff(l_ammo), NSC_INT, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, - {"fuelc", fldoff(l_fuelc), NSC_UCHAR, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, - {"fuelu", fldoff(l_fuelu), NSC_UCHAR, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, {"maxlight", fldoff(l_nxlight), NSC_UCHAR, 0, nsc_lchr, EF_BAD, NSC_EXTRA}, {NULL, 0, NSC_NOTYPE, 0, NULL, EF_BAD, 0} @@ -393,8 +387,6 @@ struct castr lchr_ca[] = { {"dam", fldoff(l_dam), NSC_INT, 0, NULL, EF_BAD, 0}, {"ammo", fldoff(l_ammo), NSC_INT, 0, NULL, EF_BAD, 0}, {"aaf", fldoff(l_aaf), NSC_INT, 0, NULL, EF_BAD, 0}, - {"fuelc", fldoff(l_fuelc), NSC_UCHAR, 0, NULL, EF_BAD, 0}, - {"fuelu", fldoff(l_fuelu), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"nxlight", fldoff(l_nxlight), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"nland", fldoff(l_nland), NSC_UCHAR, 0, NULL, EF_BAD, 0}, {"flags", fldoff(l_flags), NSC_LONG, 0, NULL, diff --git a/src/lib/global/options.c b/src/lib/global/options.c index 02753e45..c697f96d 100644 --- a/src/lib/global/options.c +++ b/src/lib/global/options.c @@ -42,7 +42,6 @@ int opt_BLITZ = 1; int opt_BRIDGETOWERS = 1; int opt_EASY_BRIDGES = 1; int opt_FALLOUT = 1; -int opt_FUEL = 0; int opt_GODNEWS = 1; int opt_GO_RENEW = 0; int opt_GUINEA_PIGS = 0; diff --git a/src/lib/global/ship.config b/src/lib/global/ship.config index 11f00955..845d6a46 100644 --- a/src/lib/global/ship.config +++ b/src/lib/global/ship.config @@ -90,44 +90,44 @@ type name l_b h_b tech cost ... /config config ship-chr -type name arm spe vis vrn frn gli nla npl nch nxl fuelc fuelu ... - 0 "fb fishing boat" 10 10 15 2 0 0 0 0 0 0 0 0 - 1 "ft fishing trawler" 10 25 15 2 0 0 0 0 0 0 20 1 - 2 "cs cargo ship" 20 25 35 3 0 0 2 0 0 1 0 0 - 3 "os ore ship" 20 25 35 3 0 0 0 0 0 1 30 1 - 4 "ss slave ship" 20 10 35 3 0 0 0 0 0 1 0 0 - 5 "ts trade ship" 20 25 35 3 0 0 0 0 0 1 30 1 - 6 "frg frigate" 50 25 25 3 1 1 2 0 0 1 0 0 - 7 "oe oil exploration boat" 10 25 15 2 0 0 0 0 0 0 20 1 - 8 "od oil derrick" 30 15 65 3 0 0 0 0 0 2 0 0 - 9 "pt patrol boat" 10 38 10 2 1 1 0 0 0 0 4 1 -10 "lc light cruiser" 50 30 30 5 6 3 2 0 0 1 40 1 -11 "hc heavy cruiser" 70 30 30 5 8 4 4 0 0 1 30 1 -12 "tt troop transport" 60 20 35 3 1 2 2 0 0 1 0 0 -13 "bb battleship" 95 25 35 6 10 7 2 0 0 1 50 2 -14 "bbc battlecruiser" 55 30 35 6 10 6 2 0 0 1 60 2 -15 "tk tanker" 75 25 45 3 0 0 0 0 0 1 30 1 -16 "ms minesweeper" 10 25 15 2 0 0 0 0 0 0 20 1 -17 "dd destroyer" 45 35 20 4 6 3 1 0 0 1 30 1 -18 "sb submarine" 25 20 5 4 3 3 0 0 0 0 30 1 -19 "sbc cargo submarine" 50 30 2 3 0 0 0 0 0 0 50 2 -20 "cal light carrier" 60 30 40 5 2 2 0 20 20 4 50 2 -21 "car aircraft carrier" 80 35 40 7 2 2 0 40 40 10 120 3 -22 "can nuc carrier" 100 45 40 9 2 2 0 60 4 20 0 0 -23 "ls landing ship" 40 30 30 2 0 0 6 0 0 2 30 1 -24 "af asw frigate" 50 35 30 5 2 2 0 0 0 4 40 1 -25 "na nuc attack sub" 45 40 3 6 5 3 0 0 0 0 0 0 -26 "ad asw destroyer" 60 40 35 6 8 3 0 0 2 10 80 2 -27 "nm nuc miss sub" 55 35 2 6 0 0 0 20 0 0 0 0 -28 "msb missile sub" 35 30 3 3 0 0 0 10 0 0 30 1 -29 "mb missile boat" 15 40 15 3 2 2 0 10 0 0 7 1 -30 "mf missile frigate" 50 35 30 5 2 2 0 20 0 2 30 1 -31 "mc missile cruiser" 70 35 35 8 8 6 0 40 8 8 35 1 -32 "aac aa cruiser" 80 35 30 6 1 8 4 0 0 1 60 2 -33 "agc aegis cruiser" 80 35 30 6 1 16 0 32 2 30 0 0 -34 "ncr nuc cruiser" 100 45 35 6 14 7 0 20 2 10 0 0 -35 "nas nuc asw cruiser" 80 45 35 9 10 4 0 0 8 25 0 0 -36 "nsp nuc supply ship" 40 45 35 6 0 0 2 0 2 10 0 0 +type name arm spe vis vrn frn gli nla npl nch nxl ... + 0 "fb fishing boat" 10 10 15 2 0 0 0 0 0 0 + 1 "ft fishing trawler" 10 25 15 2 0 0 0 0 0 0 + 2 "cs cargo ship" 20 25 35 3 0 0 2 0 0 1 + 3 "os ore ship" 20 25 35 3 0 0 0 0 0 1 + 4 "ss slave ship" 20 10 35 3 0 0 0 0 0 1 + 5 "ts trade ship" 20 25 35 3 0 0 0 0 0 1 + 6 "frg frigate" 50 25 25 3 1 1 2 0 0 1 + 7 "oe oil exploration boat" 10 25 15 2 0 0 0 0 0 0 + 8 "od oil derrick" 30 15 65 3 0 0 0 0 0 2 + 9 "pt patrol boat" 10 38 10 2 1 1 0 0 0 0 +10 "lc light cruiser" 50 30 30 5 6 3 2 0 0 1 +11 "hc heavy cruiser" 70 30 30 5 8 4 4 0 0 1 +12 "tt troop transport" 60 20 35 3 1 2 2 0 0 1 +13 "bb battleship" 95 25 35 6 10 7 2 0 0 1 +14 "bbc battlecruiser" 55 30 35 6 10 6 2 0 0 1 +15 "tk tanker" 75 25 45 3 0 0 0 0 0 1 +16 "ms minesweeper" 10 25 15 2 0 0 0 0 0 0 +17 "dd destroyer" 45 35 20 4 6 3 1 0 0 1 +18 "sb submarine" 25 20 5 4 3 3 0 0 0 0 +19 "sbc cargo submarine" 50 30 2 3 0 0 0 0 0 0 +20 "cal light carrier" 60 30 40 5 2 2 0 20 20 4 +21 "car aircraft carrier" 80 35 40 7 2 2 0 40 40 10 +22 "can nuc carrier" 100 45 40 9 2 2 0 60 4 20 +23 "ls landing ship" 40 30 30 2 0 0 6 0 0 2 +24 "af asw frigate" 50 35 30 5 2 2 0 0 0 4 +25 "na nuc attack sub" 45 40 3 6 5 3 0 0 0 0 +26 "ad asw destroyer" 60 40 35 6 8 3 0 0 2 10 +27 "nm nuc miss sub" 55 35 2 6 0 0 0 20 0 0 +28 "msb missile sub" 35 30 3 3 0 0 0 10 0 0 +29 "mb missile boat" 15 40 15 3 2 2 0 10 0 0 +30 "mf missile frigate" 50 35 30 5 2 2 0 20 0 2 +31 "mc missile cruiser" 70 35 35 8 8 6 0 40 8 8 +32 "aac aa cruiser" 80 35 30 6 1 8 4 0 0 1 +33 "agc aegis cruiser" 80 35 30 6 1 16 0 32 2 30 +34 "ncr nuc cruiser" 100 45 35 6 14 7 0 20 2 10 +35 "nas nuc asw cruiser" 80 45 35 9 10 4 0 0 8 25 +36 "nsp nuc supply ship" 40 45 35 6 0 0 2 0 2 10 /config config ship-chr @@ -147,14 +147,14 @@ type name civ mil she gun pet iro dus bar foo oil lcm hcm 12 "tt troop transport" 0 120 20 4 0 0 0 0 120 0 0 0 0 0 (semi-land) 13 "bb battleship" 0 200 200 10 0 0 0 0 900 0 0 0 0 0 () 14 "bbc battlecruiser" 0 180 100 10 0 0 0 0 400 0 0 0 0 0 () -15 "tk tanker" 30 5 0 0 990 0 0 0 200 990 0 0 25 0 (oiler supply) +15 "tk tanker" 30 5 0 0 990 0 0 0 200 990 0 0 25 0 (supply) 16 "ms minesweeper" 0 10 100 1 0 0 0 0 90 0 0 0 0 0 (mine sweep canal) 17 "dd destroyer" 0 60 40 4 0 0 0 0 80 0 0 0 0 0 (dchrg sonar mine) 18 "sb submarine" 0 25 36 5 0 0 0 0 80 0 0 0 0 0 (torp sonar mine sub) -19 "sbc cargo submarine" 5 10 104 20 100 0 0 0 900 0 500 300 0 0 (sonar sub oiler supply) +19 "sbc cargo submarine" 5 10 104 20 100 0 0 0 900 0 500 300 0 0 (sonar sub supply) 20 "cal light carrier" 0 175 250 4 300 0 0 0 180 0 0 0 0 0 (plane) 21 "car aircraft carrier" 0 350 500 4 500 0 0 0 900 0 0 0 0 0 (plane) -22 "can nuc carrier" 0 350 999 4 999 0 0 0 900 0 0 0 0 0 (plane oiler supply) +22 "can nuc carrier" 0 350 999 4 999 0 0 0 900 0 0 0 0 0 (plane supply) 23 "ls landing ship" 0 400 10 1 0 0 0 0 300 0 0 0 0 0 (land) 24 "af asw frigate" 0 60 60 4 0 0 0 0 120 0 0 0 0 0 (torp dchrg sonar sub-torp) 25 "na nuc attack sub" 0 25 60 6 0 0 0 0 500 0 0 0 0 0 (torp sonar min sub sub-torp) diff --git a/src/lib/global/symbol.c b/src/lib/global/symbol.c index 351ef1fb..682ee5e4 100644 --- a/src/lib/global/symbol.c +++ b/src/lib/global/symbol.c @@ -276,7 +276,6 @@ struct symbol ship_chr_flags[] = { {M_SUBT, "sub-torp"}, {M_TRADE, "trade"}, {M_SEMILAND, "semi-land"}, - {M_OILER, "oiler"}, {M_SUPPLY, "supply"}, {M_CANAL, "canal"}, {M_ANTIMISSILE, "anti-missile"}, diff --git a/src/lib/player/empmod.c b/src/lib/player/empmod.c index 9dde8add..8108f570 100644 --- a/src/lib/player/empmod.c +++ b/src/lib/player/empmod.c @@ -114,8 +114,6 @@ struct cmndstr player_coms[] = { {"follow ", 1, foll, C_MOD, NORM + CAP}, {"force", 0, force, C_MOD, GOD}, {"fortify ", 1, fort, C_MOD, NORM}, - {"fuel []", - 1, fuel, C_MOD, NORM}, {"give ", 0, give, C_MOD, GOD}, {"grind ", 1, grin, C_MOD, NORM + MONEY + CAP}, {"harden ", 2, hard, C_MOD, NORM + MONEY + CAP}, diff --git a/src/lib/subs/damage.c b/src/lib/subs/damage.c index bc02275f..b0b763d2 100644 --- a/src/lib/subs/damage.c +++ b/src/lib/subs/damage.c @@ -74,8 +74,6 @@ ship_damage(struct shpstr *sp, int dam) sp->shp_effic = damage((int)sp->shp_effic, dam); if (sp->shp_mobil > 0) sp->shp_mobil = damage((int)sp->shp_mobil, dam); - if (opt_FUEL && sp->shp_fuel) - sp->shp_fuel = damage((int)sp->shp_fuel, dam); item_damage(dam, sp->shp_item); } @@ -101,8 +99,6 @@ land_damage(struct lndstr *lp, int dam) lp->lnd_effic = damage((int)lp->lnd_effic, dam); if (lp->lnd_mobil > 0) lp->lnd_mobil = damage((int)lp->lnd_mobil, dam); - if (opt_FUEL && lp->lnd_fuel) - lp->lnd_fuel = damage((int)lp->lnd_fuel, dam); item_damage(dam, lp->lnd_item); } } diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index 1ec80d11..d168e134 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -244,18 +244,12 @@ show_ship_stats(int tlev) int scount; pr("%25s s v s r f l p h x", ""); - if (opt_FUEL) - pr(" fuel"); pr("\n"); pr("%25s p i p n i n l e p", ""); - if (opt_FUEL) - pr(" c/u"); pr("\n"); pr("%25s def d s y g r d n l l", ""); - if (opt_FUEL) - pr(" "); pr("\n"); @@ -275,8 +269,6 @@ show_ship_stats(int tlev) pr("%2d ", mp->m_nplanes); pr("%2d ", mp->m_nchoppers); pr("%2d ", mp->m_nxlight); - if (opt_FUEL) - pr("%3d/%1d ", mp->m_fuelc, mp->m_fuelu); pr("\n"); } } @@ -445,9 +437,9 @@ show_land_stats(int tlev) struct lchrstr *lcp; int lcount; - pr("%25s s v s r r a f a a x l\n", ""); - pr("%25s p i p a n c i m a f f p n\n", ""); - pr("%25s att def vul d s y d g c r m f c u l d\n", ""); + pr("%25s s v s r r a f a a x l\n", ""); + pr("%25s p i p a n c i m a p n\n", ""); + pr("%25s att def vul d s y d g c r m f l d\n", ""); make_new_list(tlev, EF_LAND); for (lcount = 0; lcount < lookup_list_cnt; lcount++) { @@ -463,9 +455,6 @@ show_land_stats(int tlev) pr("%2d %2d %2d %2d %2d ", l_frg(lcp, tlev), l_acc(lcp, tlev), l_dam(lcp, tlev), lcp->l_ammo, lcp->l_aaf); - pr("%2d %2d %2d %2d ", - lcp->l_fuelc, lcp->l_fuelu, lcp->l_nxlight, lcp->l_nland); - pr("\n"); } } diff --git a/src/lib/subs/supply.c b/src/lib/subs/supply.c index 96b2d2cc..9f998a27 100644 --- a/src/lib/subs/supply.c +++ b/src/lib/subs/supply.c @@ -48,8 +48,7 @@ static int s_commod(int, int, int, i_type, int, int); /* * We want to get enough guns to be maxed out, enough shells to - * fire once, one update's worth of food, enough fuel for - * one update. + * fire once, one update's worth of food. * * Firts, try to forage in the sector * Second look for a warehouse or headquarters to leech @@ -67,8 +66,6 @@ resupply_all(struct lndstr *lp) if (!opt_NOFOOD) resupply_commod(lp, I_FOOD); resupply_commod(lp, I_SHELL); - if (opt_FUEL) - resupply_commod(lp, I_PETROL); } /* @@ -104,18 +101,6 @@ resupply_commod(struct lndstr *lp, i_type type) putship(lp->lnd_ship, &ship); } } - - if (opt_FUEL && type == I_PETROL) { - int fuel_needed = lchr[lp->lnd_type].l_fuelu - * ((float)etu_per_update * land_mob_scale) / 10.0; - - while ((lp->lnd_fuel < fuel_needed) && lp->lnd_item[I_PETROL]) { - lp->lnd_fuel += 10; - if (lp->lnd_fuel > lchr[lp->lnd_type].l_fuelc) - lp->lnd_fuel = lchr[lp->lnd_type].l_fuelc; - lp->lnd_item[I_PETROL]--; - } - } } /* @@ -413,8 +398,7 @@ s_commod(int own, int x, int y, i_type type, int total_wanted, /* * We want to get enough shells to fire once, - * one update's worth of food, enough fuel for - * one update. + * one update's worth of food. */ static int @@ -435,25 +419,6 @@ get_minimum(struct lndstr *lp, i_type type) case I_SHELL: want = lcp->l_ammo; break; - - /* - * return the amount of pet we'd need to get to - * enough fuel for 1 update - */ - case I_PETROL: - if (opt_FUEL == 0) - return 0; - want = lcp->l_fuelu * ((float)etu_per_update * land_mob_scale) - / 10.0; - want -= lp->lnd_fuel; - if (want > 0) { - want = want / 10; - if (want == 0) - want++; - } - - max = want; - break; default: return 0; } @@ -469,7 +434,6 @@ has_supply(struct lndstr *lp) { int shells_needed, shells, keepshells; int food, food_needed, keepfood; - int fuel_needed, fuel, petrol_needed, petrol, keeppetrol; if (!opt_NOFOOD) { food_needed = get_minimum(lp, I_FOOD); @@ -501,29 +465,5 @@ has_supply(struct lndstr *lp) if (shells < shells_needed) return 0; - if (opt_FUEL) { - fuel_needed = lchr[lp->lnd_type].l_fuelu; - fuel = lp->lnd_fuel; - if (fuel < fuel_needed) { - petrol_needed = - ldround((fuel_needed - fuel) / 10.0, 1); - petrol = keeppetrol = lp->lnd_item[I_PETROL]; - if (petrol < petrol_needed) { - lp->lnd_item[I_PETROL] = 0; - putland(lp->lnd_uid, lp); - petrol += try_supply_commod(lp->lnd_own, - lp->lnd_x, lp->lnd_y, - I_PETROL, - (petrol_needed - petrol)); - lp->lnd_item[I_PETROL] = keeppetrol; - putland(lp->lnd_uid, lp); - } - fuel += petrol * 10; - } - - if (fuel < fuel_needed) - return 0; - } - /* end opt_FUEL */ return 1; } diff --git a/src/lib/subs/unitsub.c b/src/lib/subs/unitsub.c index 76159c70..2a3e2411 100644 --- a/src/lib/subs/unitsub.c +++ b/src/lib/subs/unitsub.c @@ -60,7 +60,7 @@ unit_list(struct emp_qelem *unit_list) return; if (type == EF_LAND) - pr("lnd# land type x,y a eff sh gun xl mu tech retr fuel\n"); + pr("lnd# land type x,y a eff sh gun xl mu tech retr\n"); else pr("shp# ship type x,y fl eff mil sh gun pn he xl ln mob tech\n"); @@ -97,7 +97,6 @@ unit_list(struct emp_qelem *unit_list) pr("%4d", unit->tech); if (type == EF_LAND) { pr("%4d%%", lnd->lnd_retreat); - pr("%5d", lnd->lnd_fuel); } pr("\n"); } diff --git a/src/lib/update/mobility.c b/src/lib/update/mobility.c index 211bba20..c37f5dd4 100644 --- a/src/lib/update/mobility.c +++ b/src/lib/update/mobility.c @@ -181,10 +181,7 @@ mob_ship(void) static void do_mob_ship(struct shpstr *sp, int etus) { - int newfuel = 0; int value; - int can_add, have_fuel_for, total_add; - double d; if (CANT_HAPPEN(etus < 0)) etus = 0; @@ -192,72 +189,10 @@ do_mob_ship(struct shpstr *sp, int etus) if (sp->shp_own == 0) return; - if (opt_FUEL == 0 || mchr[(int)sp->shp_type].m_fuelu == 0) { - value = sp->shp_mobil + (float)etus * ship_mob_scale; - if (value > ship_mob_max) - value = ship_mob_max; - sp->shp_mobil = (signed char)value; - } else { - if (sp->shp_mobil >= ship_mob_max) { - sp->shp_mobil = ship_mob_max; - return; - } - can_add = ship_mob_max - sp->shp_mobil; - if (can_add > (float)etus * ship_mob_scale) - can_add = (float)etus * ship_mob_scale; - have_fuel_for = ldround(((double)sp->shp_fuel / - (double)mchr[(int)sp->shp_type].m_fuelu) - * (double)fuel_mult, 1); - - if (can_add > have_fuel_for) { - int need; - need = can_add - have_fuel_for; - d = need; - d *= mchr[(int)sp->shp_type].m_fuelu; - d /= fuel_mult; - d /= 5.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, - I_PETROL, need); - sp->shp_fuel += newfuel * 5; - } - - have_fuel_for = ldround(((double)sp->shp_fuel / - (double)mchr[(int)sp->shp_type].m_fuelu) - * (double)fuel_mult, 1); - - if (can_add > have_fuel_for) { - int need; - need = can_add - have_fuel_for; - d = need; - d *= mchr[(int)sp->shp_type].m_fuelu; - d /= fuel_mult; - d /= 50.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, - I_OIL, need); - sp->shp_fuel += newfuel * 50; - } - - have_fuel_for = ldround(((double)sp->shp_fuel / - (double)mchr[(int)sp->shp_type].m_fuelu) - * (double)fuel_mult, 1); - - if (can_add > have_fuel_for) - total_add = have_fuel_for; - else - total_add = can_add; - d = total_add; - d *= mchr[(int)sp->shp_type].m_fuelu; - d /= fuel_mult; - sp->shp_fuel -= ldround(d, 1); - sp->shp_fuel = MIN(sp->shp_fuel, mchr[(int)sp->shp_type].m_fuelc); - sp->shp_mobil += total_add; - } + value = sp->shp_mobil + (float)etus * ship_mob_scale; + if (value > ship_mob_max) + value = ship_mob_max; + sp->shp_mobil = (signed char)value; } void @@ -281,11 +216,7 @@ mob_land(void) static void do_mob_land(struct lndstr *lp, int etus) { - int newfuel = 0; int value; - int can_add, have_fuel_for, total_add; - double d; - struct lchrstr *lcp = lchr + lp->lnd_type; if (CANT_HAPPEN(etus < 0)) etus = 0; @@ -293,85 +224,24 @@ do_mob_land(struct lndstr *lp, int etus) if (lp->lnd_own == 0) return; - if (opt_FUEL == 0 || lcp->l_fuelu == 0) { - value = lp->lnd_mobil + ((float)etus * land_mob_scale); - if (value > land_mob_max) { - if (lp->lnd_harden < land_mob_max && !opt_MOB_ACCESS) { - /* - * Automatic fortification on excess mobility. - * Disabled for MOB_ACCESS, because it leads to - * excessively deep recursion and thus miserable - * performance as the number of land units grows. - * - * Provide mobility to be used in lnd_fortify() - * without overflowing lnd_mobil. - */ - lp->lnd_mobil = land_mob_max; - lnd_fortify(lp, value - land_mob_max); - } - value = land_mob_max; - } - lp->lnd_mobil = value; - - } else { - if (lp->lnd_mobil >= land_mob_max) { + value = lp->lnd_mobil + ((float)etus * land_mob_scale); + if (value > land_mob_max) { + if (lp->lnd_harden < land_mob_max && !opt_MOB_ACCESS) { + /* + * Automatic fortification on excess mobility. + * Disabled for MOB_ACCESS, because it leads to + * excessively deep recursion and thus miserable + * performance as the number of land units grows. + * + * Provide mobility to be used in lnd_fortify() + * without overflowing lnd_mobil. + */ lp->lnd_mobil = land_mob_max; - return; + lnd_fortify(lp, value - land_mob_max); } - - can_add = land_mob_max - lp->lnd_mobil; - - if (can_add > (float)etus * land_mob_scale) - can_add = (float)etus * land_mob_scale; - - have_fuel_for = (lp->lnd_fuel / lcp->l_fuelu) * fuel_mult; - - if (can_add > have_fuel_for) { - int need; - need = can_add - have_fuel_for; - d = need; - d *= lcp->l_fuelu; - d /= fuel_mult; - d /= 5.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, - I_PETROL, need); - lp->lnd_fuel += newfuel * 5; - } - - have_fuel_for = (lp->lnd_fuel / lcp->l_fuelu) * fuel_mult; - - if (can_add > have_fuel_for) { - int need; - need = can_add - have_fuel_for; - d = need; - d *= lcp->l_fuelu; - d /= fuel_mult; - d /= 50.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, - I_OIL, need); - lp->lnd_fuel += newfuel * 50; - } - - have_fuel_for = (lp->lnd_fuel / lcp->l_fuelu) * fuel_mult; - - if (can_add > have_fuel_for) { - total_add = have_fuel_for; - } else - total_add = can_add; - d = total_add; - d *= lcp->l_fuelu; - d /= fuel_mult; - lp->lnd_fuel -= ldround(d, 1); - lp->lnd_fuel = MIN(lp->lnd_fuel, lcp->l_fuelc); - lp->lnd_mobil += total_add; - /* No excess mobility here, hence no automatic fortification */ + value = land_mob_max; } + lp->lnd_mobil = value; } void diff --git a/src/lib/update/nav_ship.c b/src/lib/update/nav_ship.c index c774383e..3195bde7 100644 --- a/src/lib/update/nav_ship.c +++ b/src/lib/update/nav_ship.c @@ -239,9 +239,6 @@ nav_load_ship_at_sea(struct shpstr *sp) * Continue to loop until the ship runs out of mobility, a load fails, * the ship gets sunk (forts,ect..), the ship hits a mine. * - * A check has been added for fuel so ships don't end up running - * out of mobility in the ocean. - * * Questions, bugs (fixes) , or new ideas should be directed at * Chad Zabel. * 6-1-94 @@ -250,7 +247,6 @@ nav_load_ship_at_sea(struct shpstr *sp) int nav_ship(struct shpstr *sp) { - struct sctstr *sectp; char *cp; int stopping; int quit; @@ -287,14 +283,6 @@ nav_ship(struct shpstr *sp) sp->shp_own); if (QEMPTY(&ship_list)) return RET_OK; - /* before we move check to see if ship needs fuel. */ - sectp = getsectp(sp->shp_x, sp->shp_y); - if (opt_FUEL && - sectp->sct_own != 0 && - sp->shp_fuel <= 0 && - ((struct mchrstr *)mlp->chrp)->m_fuelu != 0) - auto_fuel_ship(sp); - mlp->unit.ship.shp_fuel = sp->shp_fuel; cp = BestShipPath(buf, sp->shp_x, sp->shp_y, sp->shp_destx[0], sp->shp_desty[0], diff --git a/src/lib/update/nav_util.c b/src/lib/update/nav_util.c index 2e32fbda..ab970620 100644 --- a/src/lib/update/nav_util.c +++ b/src/lib/update/nav_util.c @@ -178,59 +178,3 @@ unload_it(struct shpstr *sp) sectp->sct_pstage = PLG_EXPOSED; } } - -/* auto_fuel_ship - * Assume a check for fuel=0 has already been made and passed. - * Try to fill a ship using petro. and then oil. - * new autonav code. - * This should be merged with the fuel command someday. - * Chad Zabel 6/1/94 - */ - -void -auto_fuel_ship(struct shpstr *sp) -{ - double d; - int totalfuel = 0; - int need; - int maxfuel; - int newfuel = 0; - int add_fuel = 0; - - if (opt_FUEL == 0) - return; - getship(sp->shp_uid, sp); /* refresh */ - /* fill with petrol */ - maxfuel = mchr[(int)sp->shp_type].m_fuelc; - d = maxfuel / 5.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - - newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, - I_PETROL, need); - add_fuel += newfuel * 5; - if (add_fuel > maxfuel) - add_fuel = maxfuel; - sp->shp_fuel += add_fuel; - totalfuel += add_fuel; - - if (totalfuel == maxfuel) { - putship(sp->shp_uid, sp); - return; /* the ship is full */ - } - add_fuel = 0; - /* fill with oil */ - d = (maxfuel - totalfuel) / 50.0; - if (d - (int)d > 0.0) - d++; - need = (int)d; - - newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, - I_OIL, need); - add_fuel = newfuel * 50; - if (add_fuel > maxfuel) - add_fuel = maxfuel; - sp->shp_fuel += add_fuel; - putship(sp->shp_uid, sp); -}