Improve launch diagnostic messages, switch off supply

msl_equip() used mission_pln_equip(), which is for automatic defenses,
and therefore silent.  Its users launch_as(), launch_missile() and
launch_sat() printed failure diagnostics based on assumptions on what
could go wrong.

Switch to the appropriate function for commands, pln_equip(), and
remove the guesswork.  Implement mission 'i' there.  When launching
from a foreign base, its owner now gets informed.  Unimportant at this
time, as players can't easily deploy missiles in foreign bases.

This change also switches off automatic supply for launch.  Consistent
with bomb.
This commit is contained in:
Markus Armbruster 2009-10-05 05:40:39 -04:00
parent cf960a573c
commit 528df9acba
4 changed files with 12 additions and 13 deletions

View file

@ -156,10 +156,8 @@ launch_as(struct plnstr *pp)
pr("Range too great!\n");
return RET_FAIL;
}
if (msl_equip(pp, 'i') < 0) {
pr("%s not enough petrol or shells!\n", prplane(pp));
if (msl_equip(pp, 'i') < 0)
return RET_FAIL;
}
if (msl_hit(pp, pln_def(&plane), EF_PLANE, N_SAT_KILL, N_SAT_KILL,
prplane(&plane), plane.pln_x, plane.pln_y, plane.pln_own)) {
pr("Satellite shot down\n");
@ -233,10 +231,8 @@ launch_missile(struct plnstr *pp, int sublaunch)
pr("Range too great; try again!\n");
return RET_FAIL;
}
if (msl_equip(pp, 'p') < 0) {
pr("%s not enough shells!\n", prplane(pp));
if (msl_equip(pp, 'p') < 0)
return RET_FAIL;
}
if (!(pcp->pl_flags & P_MAR)) {
getsect(sx, sy, &sect);
if (opt_SLOW_WAR) {
@ -343,10 +339,8 @@ launch_sat(struct plnstr *pp, int sublaunch)
return RET_SYN;
if (!check_plane_ok(pp))
return RET_FAIL;
if (msl_equip(pp, 'r') < 0) {
pr("%s not enough petrol!\n", prplane(pp));
if (msl_equip(pp, 'r') < 0)
return RET_FAIL;
}
pp->pln_theta = 0;
pp->pln_flags |= PLN_SYNCHRONOUS;
if (*p == 0 || *p == 'n')