summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ee3b02c)
Repeated for ship, sector and land unit firing. The latter prints
range only when the sanity check succeeds.
Factor out, changing ship and sector to behave like land unit firing.
When the sanity check fails, print "Jammed!" instead of "Klick!",
because "Klick!" suggests no shells. Used to be printed exactly then,
but the condition first became impossible (Chainsaw), then generalized
to "can't fire for whatever reason" (commit
22c6fd8, v4.3.12).
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
}
range = shp_fire_range(&fship);
range2 = roundrange(range);
}
range = shp_fire_range(&fship);
range2 = roundrange(range);
- pr("range is %d.00 (%.2f)\n", range2, range);
/* Use depth charges against subs, but only when in range */
if (target == targ_ship && trange <= range2
&& (mchr[vship.shp_type].m_flags & M_SUB)
/* Use depth charges against subs, but only when in range */
if (target == targ_ship && trange <= range2
&& (mchr[vship.shp_type].m_flags & M_SUB)
dam = shp_fire(&fship);
fship.shp_mission = 0;
putship(fship.shp_uid, &fship);
dam = shp_fire(&fship);
fship.shp_mission = 0;
putship(fship.shp_uid, &fship);
- if (CANT_HAPPEN(dam < 0)) {
- pr("Klick! ...\n");
- continue;
- }
if (opt_NOMOBCOST == 0) {
fship.shp_mobil = MAX(fship.shp_mobil - 15, -100);
putship(fship.shp_uid, &fship);
if (opt_NOMOBCOST == 0) {
fship.shp_mobil = MAX(fship.shp_mobil - 15, -100);
putship(fship.shp_uid, &fship);
}
range = lnd_fire_range(&fland);
range2 = roundrange(range);
}
range = lnd_fire_range(&fland);
range2 = roundrange(range);
- pr("range is %d.00 (%.2f)\n", range2, range);
dam = lnd_fire(&fland);
fland.lnd_mission = 0;
putland(fland.lnd_uid, &fland);
dam = lnd_fire(&fland);
fland.lnd_mission = 0;
putland(fland.lnd_uid, &fland);
- if (CANT_HAPPEN(dam < 0)) {
- pr("Klick! ...\n");
- continue;
- }
if (target == targ_ship) {
if (chance(lnd_acc(&fland) / 100.0))
dam = ldround(dam / 2.0, 1);
if (target == targ_ship) {
if (chance(lnd_acc(&fland) / 100.0))
dam = ldround(dam / 2.0, 1);
}
dam = fort_fire(&fsect);
putsect(&fsect);
}
dam = fort_fire(&fsect);
putsect(&fsect);
- if (CANT_HAPPEN(dam < 0)) {
- pr("Klick! ...\n");
- continue;
- }
range = fortrange(&fsect);
range2 = roundrange(range);
range = fortrange(&fsect);
range2 = roundrange(range);
- pr("range is %d.00 (%.2f)\n", range2, range);
+ if (CANT_HAPPEN(dam < 0)) {
+ pr("Jammed!\n");
+ continue;
+ }
+ pr("range is %d.00 (%.2f)\n", range2, range);
nfiring++;
switch (target) {
case targ_sub:
nfiring++;
switch (target) {
case targ_sub: