Remove option FUEL

The abstract idea of tying ships and land units to a logistical tether
is sound, the concrete implementation as option FUEL is flawed.  It
adds too much busy-work to the game to be enjoyable.  It hasn't been
enabled in a public game for years.  The code implementing it is ugly,
repetitive, and a burden to maintain.

Remove selector fuel from ship_ca[] and land_ca[], and selectors
fuelc, fuelu from mchr_ca[] and lchr_ca[].  Remove fields fuelc, fuelu
from ship.config and land.config.

Remove command fuel from player_coms[].

Deprecate edit key 'B' in doship(), dounit(), and don't show it in
pr_ship(), pr_land().

Drop opt_FUEL code from build_ship(), shi(), sdump(), ship_damage(),
show_ship_stats(), do_mob_ship(), nav_ship(), build_land(), land(),
ldump(), land_damage(), show_land_stats(), do_mob_land(),
resupply_all(), resupply_commod(), get_minimum(), has_supply(),
unit_list(), vers().

Remove opt_FUEL, fuel_mult, struct shpstr member shp_fuel, struct
mchrstr members m_fuelc and m_fuelu, M_OILER, struct lndstr member
lnd_fuel, struct lchrstr members l_fuelc and l_fuelu, fuel(), and
auto_fuel_ship().
This commit is contained in:
Markus Armbruster 2008-05-12 09:25:20 +02:00
parent 3cc80e83c3
commit 3b4de2feb1
42 changed files with 124 additions and 984 deletions

View file

@ -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);
}