subs/control: Grant bonus for capability security
Grant land units with security capability the same bonus as in convert and shoot: multiply by (1 + eff/100). military_control()'s code to count military is now functionally equivalent to security_strength(), except it has no use for its second parameter. Change security_strength() to permit a null argument, and reuse it in military_control(). Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
19656b892b
commit
c89161d496
3 changed files with 20 additions and 22 deletions
|
@ -64,10 +64,12 @@ you must own the distribution sector, and there must be a path of owned
|
|||
sectors to it. In order to export something from a sector, you must have
|
||||
military control of the sector. In order to import something from a
|
||||
distribution sector, you must have military control of the distribution
|
||||
sector. (Military control is defined as having mil in the sector equal
|
||||
to at least 1/10th the number of unconverted civilians there. Units count
|
||||
as if they were straight mil, i.e. a 100% unit that contained 50 mil would
|
||||
count as 50 mil for the purposes of control)
|
||||
sector.
|
||||
.s1
|
||||
Military control is defined as having military in the sector equal to
|
||||
at least 1/10th the number of unconverted civilians there. Military
|
||||
in land units count towards military control. Military in efficient
|
||||
security units count double.
|
||||
.s1
|
||||
Mobility is used from the sector when sending \*Qto\*U the distribution sector.
|
||||
When getting something \*Qfrom\*U the distribution sector, mobility is paid
|
||||
|
|
13
info/move.t
13
info/move.t
|
@ -81,13 +81,16 @@ You can also supply additional parameters:
|
|||
is equivalent to a \*Qmap\*U command, like
|
||||
this:
|
||||
.EX map # ls
|
||||
.s1
|
||||
.L "Military control"
|
||||
.s1
|
||||
In order to move something (other than mil) out of a sector, you must have
|
||||
military control of the sector. Military control is defined as having mil in
|
||||
the sector equal to at least 1/10th the number of unconverted civilians there.
|
||||
Units count as if they were straight mil, i.e. a 100% unit that contained 50
|
||||
mil would count as 50 mil for the purposes of control)
|
||||
In order to move something (other than military) out of a sector, you
|
||||
must have military control of the sector. Military control is defined
|
||||
as having military in the sector equal to at least 1/10th the number
|
||||
of unconverted civilians there.
|
||||
.s1
|
||||
Military in land units count towards military control. Military in
|
||||
efficient security units count double.
|
||||
.s1
|
||||
.L Mobility
|
||||
See \*Qinfo Mobility\*U for a description of how much mobility it costs to
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
/*
|
||||
* Return strength of security detail in @sp.
|
||||
* Store sum of efficiency of land units with security capability in
|
||||
* @seceffp.
|
||||
* @seceffp unless it is null.
|
||||
*/
|
||||
double
|
||||
security_strength(struct sctstr *sp, int *seceffp)
|
||||
|
@ -68,7 +68,8 @@ security_strength(struct sctstr *sp, int *seceffp)
|
|||
}
|
||||
}
|
||||
|
||||
*seceffp = seceff;
|
||||
if (seceffp)
|
||||
*seceffp = seceff;
|
||||
return strength;
|
||||
}
|
||||
|
||||
|
@ -78,19 +79,11 @@ security_strength(struct sctstr *sp, int *seceffp)
|
|||
int
|
||||
military_control(struct sctstr *sp)
|
||||
{
|
||||
int tot_mil = 0;
|
||||
struct nstr_item ni;
|
||||
struct lndstr land;
|
||||
int tot_mil;
|
||||
|
||||
if (sp->sct_oldown != sp->sct_own) {
|
||||
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
|
||||
while (nxtitem(&ni, &land)) {
|
||||
if (land.lnd_ship >= 0 || land.lnd_land >= 0)
|
||||
continue;
|
||||
if (land.lnd_own == sp->sct_own)
|
||||
tot_mil += land.lnd_item[I_MILIT];
|
||||
}
|
||||
if ((sp->sct_item[I_MILIT] + tot_mil) * 10 < sp->sct_item[I_CIVIL])
|
||||
tot_mil = sp->sct_item[I_MILIT] + security_strength(sp, NULL);
|
||||
if (tot_mil * 10 < sp->sct_item[I_CIVIL])
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue