(shp_mobcost): New.

(use_ammo, eta_calc, torp, fire_torp, perform_mission, retreat_ship1)
(shp_sweep, shp_nav_one_sector, cost_ship): Use it.

(perform_mission): Fix mobility cost of torpedo: charged full sector
cost instead of half.
This commit is contained in:
Markus Armbruster 2006-05-20 19:28:29 +00:00
parent 2cd8e99f49
commit 16b9c41b39
8 changed files with 18 additions and 54 deletions

View file

@ -958,8 +958,6 @@ use_ammo(struct emp_qelem *list)
struct sctstr sect;
int shell;
short *item;
double mobcost;
struct mchrstr *mcp;
/* use 1 shell from everyone */
for (qp = list->q_forw; qp != list; qp = next) {
@ -975,13 +973,8 @@ use_ammo(struct emp_qelem *list)
shell = 0;
item[I_SHELL] = shell;
putship(ship.shp_uid, &ship);
mcp = &mchr[(int)ship.shp_type];
mobcost = ship.shp_effic * 0.01 * ship.shp_speed;
mobcost = (480.0 / (mobcost +
techfact(ship.shp_tech, mobcost)));
/* mob cost = 1/2 a sect's mob */
mobcost /= 2.0;
ship.shp_mobil -= mobcost;
ship.shp_mobil -= shp_mobcost(&ship) / 2.0;
}
} else if (fp->type == targ_land) {
getsect(fp->x, fp->y, &sect);