Make sweep require capability sweep

Before, sweep accepted any plane.  Planes without capability sweep
flew an ordinary recon mission.

Partial fix for #1388263.
This commit is contained in:
Markus Armbruster 2009-09-27 13:53:40 -04:00
parent 3cea4ac5be
commit 5f5362cece
2 changed files with 13 additions and 19 deletions

View file

@ -2,14 +2,14 @@
.NA sweep "Use planes to remove mines from sea sectors" .NA sweep "Use planes to remove mines from sea sectors"
.LV Expert .LV Expert
.SY "sweep <PLANES> <ESCORTS> <SECT> route|destination" .SY "sweep <PLANES> <ESCORTS> <SECT> route|destination"
The \*Qsweep\*U command is identical to the recon command, except The \*Qsweep\*U command is used to sweep sea mines from the sectors
that if you use planes capable of minesweeping, they will sweep along the route.
sea mines from sectors along their route.
.s1 .s1
<PLANES> represents a list of planes which are to perform the <PLANES> represents a list of planes which are to perform the
intelligence gathering operation. mine-sweeping mission.
Only planes with sufficient mobility, based in a sector stocked with Only planes with capability sweep and sufficient mobility, based in a
petrol, will be successfully selected for the mission. sector stocked with petrol, will be successfully selected for the
mission.
.s1 .s1
<ESCORTS> represent a list of fighter planes which are capable of escorting <ESCORTS> represent a list of fighter planes which are capable of escorting
the transports all the way to the target. the transports all the way to the target.
@ -38,20 +38,14 @@ info \*QIntercept\*U.
If the destination sector is not an airport, then all planes in If the destination sector is not an airport, then all planes in
the mission must have V/STOL capability. the mission must have V/STOL capability.
.s1 .s1
Planes with the ASW ability will Planes will
perform a sonar search on each sector as they fly through it.
Each sub contact will be reported only once, giving the sector and number
of the sub, from the sector in which it
is first detected (which may not be the sector the sub is in, as plane
sonar has a range dependent on acc, and a chance of finding a sub of
((100-acc)-(4-sub visib)*10))+((100-effic)/5) percent.
The sub being sonared may detect the sonar ping.
.s1
Planes with the sweep ability will
automatically attempt to sweep sea mines in sea sectors they overfly. automatically attempt to sweep sea mines in sea sectors they overfly.
Their chance of sweeping is (100-acc), and they can only sweep 1 mine per Their chance of sweeping is (100-acc), and they can only sweep 1 mine per
overflight of the sector. overflight of the sector.
.s1 .s1
The planes will additionally gather intelligence, just like they do on
a recon mission. See info \*Qrecon\*U.
.s1
Note that a plane must be at least 40% efficient before it can leave Note that a plane must be at least 40% efficient before it can leave
the ground. the ground.
.s1 .s1

View file

@ -41,6 +41,7 @@
int int
reco(void) reco(void)
{ {
int mission_flags = player->argp[0][0] == 's' ? PM_R | PM_S : PM_R;
coord tx, ty; coord tx, ty;
coord ax, ay; coord ax, ay;
int ap_to_target; int ap_to_target;
@ -81,7 +82,7 @@ reco(void)
* select planes within range * select planes within range
*/ */
pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target, pln_sel(&ni_bomb, &bomb_list, &ap_sect, ap_to_target,
1, wantflags, P_M | P_O); 1, wantflags | (mission_flags & PM_S ? P_SWEEP : 0), P_M | P_O);
if (QEMPTY(&bomb_list)) { if (QEMPTY(&bomb_list)) {
pr("No planes could be equipped for the mission.\n"); pr("No planes could be equipped for the mission.\n");
return RET_FAIL; return RET_FAIL;
@ -101,8 +102,7 @@ reco(void)
return RET_FAIL; return RET_FAIL;
} }
pln_arm(&esc_list, ap_to_target, 'e', NULL); pln_arm(&esc_list, ap_to_target, 'e', NULL);
ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, mission_flags);
*player->argp[0] == 's' ? PM_R | PM_S : PM_R);
if (QEMPTY(&bomb_list)) { if (QEMPTY(&bomb_list)) {
pr("No planes got through fighter defenses\n"); pr("No planes got through fighter defenses\n");
} else { } else {