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:
parent
cf960a573c
commit
528df9acba
4 changed files with 12 additions and 13 deletions
|
@ -548,6 +548,7 @@ extern int carrier_planes(struct shpstr *, int);
|
|||
extern void pln_sel(struct nstr_item *, struct emp_qelem *,
|
||||
struct sctstr *, int, int, int, int);
|
||||
extern void pln_arm(struct emp_qelem *, int, char, struct ichrstr *);
|
||||
extern int pln_equip(struct plist *, struct ichrstr *, char);
|
||||
extern int pln_mobcost(int, struct plnstr *, char);
|
||||
extern void pln_put(struct emp_qelem *);
|
||||
extern void pln_put1(struct plist *);
|
||||
|
|
|
@ -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, §);
|
||||
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')
|
||||
|
|
|
@ -61,7 +61,7 @@ msl_equip(struct plnstr *pp, char mission)
|
|||
memset(&pl, 0, sizeof(struct plist));
|
||||
pl.pcp = plchr + pp->pln_type;
|
||||
pl.plane = *pp;
|
||||
return mission_pln_equip(&pl, NULL, mission);
|
||||
return pln_equip(&pl, NULL, mission);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
#include "ship.h"
|
||||
#include "xy.h"
|
||||
|
||||
static int pln_equip(struct plist *, struct ichrstr *, char);
|
||||
static int fit_plane_on_ship(struct plnstr *, struct shpstr *);
|
||||
|
||||
/*
|
||||
|
@ -613,7 +612,7 @@ pln_arm(struct emp_qelem *list, int dist, char mission, struct ichrstr *ip)
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
|
||||
{
|
||||
struct plchrstr *pcp;
|
||||
|
@ -684,7 +683,12 @@ pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
|
|||
break;
|
||||
case 'r': /* reconnaissance */
|
||||
case 'e': /* escort */
|
||||
load = 0;
|
||||
case 'i': /* missile interception */
|
||||
if (CANT_HAPPEN(!(pcp->pl_flags & P_M)
|
||||
|| !(pcp->pl_flags & (P_N | P_O))))
|
||||
break;
|
||||
if (load)
|
||||
itype = I_SHELL;
|
||||
break;
|
||||
default:
|
||||
CANT_REACH();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue