All missions now have op areas, simplify mission()
This commit is contained in:
parent
a9b2d9c7f3
commit
c1b76a1a2f
2 changed files with 9 additions and 25 deletions
|
@ -1,7 +1,7 @@
|
|||
.TH Command MISSION
|
||||
.NA mission "Assign a mission to a ship/plane/unit"
|
||||
.LV Basic
|
||||
.SY "mission <TYPE> <UNITS> <s|o|d|i|e|r|a|c|q> [<op sector|.>] [<radius>]"
|
||||
.SY "mission <TYPE> <UNITS> <s|o|d|i|e|r|a|c|q> <op sector|.> [<radius>]"
|
||||
.s1
|
||||
The mission command is used to assign ships, planes, or land units to
|
||||
missions. The available missions are:
|
||||
|
@ -63,7 +63,7 @@ on a sector until 100 damage is done.
|
|||
.s1
|
||||
OPERATIONS SECTORS
|
||||
.s1
|
||||
Some missions require the designation of an 'op sector', short for operations
|
||||
Missions require the designation of an 'op sector', short for operations
|
||||
sector. This is the center of an area that the mission is focused on.
|
||||
The op sector may be any sector that is within the unit's range.
|
||||
(Firing range for ships & land units on interdiction, reaction range
|
||||
|
|
|
@ -205,10 +205,7 @@ mission(void)
|
|||
|
||||
dist = mapdist(gp->x, gp->y, x, y);
|
||||
radius = 999;
|
||||
if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
|
||||
mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
|
||||
mission == MI_RESERVE || mission == MI_ESCORT ||
|
||||
mission == MI_AIR_DEFENSE) {
|
||||
if (mission) {
|
||||
radius = oprange(gp, mission);
|
||||
if (radius < dist) {
|
||||
pr("%s: out of range! (range %d)\n",
|
||||
|
@ -283,28 +280,15 @@ mission(void)
|
|||
|
||||
num++; /* good one.. go with it */
|
||||
|
||||
if (mission == MI_INTERDICT || mission == MI_SUPPORT ||
|
||||
mission == MI_OSUPPORT || mission == MI_DSUPPORT ||
|
||||
mission == MI_RESERVE || mission == MI_ESCORT ||
|
||||
mission == MI_AIR_DEFENSE)
|
||||
gp->radius = radius;
|
||||
else
|
||||
gp->radius = 0;
|
||||
|
||||
if (mission == MI_SUPPORT || mission == MI_OSUPPORT ||
|
||||
mission == MI_DSUPPORT || mission == MI_INTERDICT ||
|
||||
mission == MI_RESERVE || mission == MI_ESCORT ||
|
||||
mission == MI_AIR_DEFENSE) {
|
||||
if (mission) {
|
||||
pr("%s on %s mission, centered on %s, radius %d\n",
|
||||
obj_nameof(gp), mission_name(mission),
|
||||
xyas(x, y, player->cnum), gp->radius);
|
||||
} else if (mission) {
|
||||
pr("%s on %s mission\n", obj_nameof(gp),
|
||||
mission_name(mission));
|
||||
}
|
||||
|
||||
if (mission)
|
||||
xyas(x, y, player->cnum), radius);
|
||||
gp->mobil -= mobused;
|
||||
gp->radius = radius;
|
||||
} else
|
||||
gp->radius = 0;
|
||||
|
||||
gp->mission = mission;
|
||||
gp->opx = x;
|
||||
gp->opy = y;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue