update/revolt: Make security bonus proportional to efficiency

Land units with capability security get a combat bonus regardless of
efficiency.  This lets players get the benefits of a security unit at
a discount: just don't build it beyond 10%.

Multiply the combat bonus by eff/100.  Together with the previous
commit, this closes bug#64.

Note that the the strength of a security unit's commando raid is
already proportional to its efficiency.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-09-19 20:05:51 +02:00
parent 3c1c68f16d
commit 04dddb6bd1
3 changed files with 7 additions and 7 deletions

View file

@ -129,10 +129,10 @@ guerrilla(struct sctstr *sp)
struct sctstr *nsp;
int recruit;
int move;
int ratio;
double ratio;
int che;
int mil;
int security_bonus;
double security_bonus;
int cc, mc;
double odds;
int civ;
@ -182,7 +182,7 @@ guerrilla(struct sctstr *sp)
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY) {
int che_kill, r;
security_bonus += lp->lnd_item[I_MILIT] * 3;
security_bonus += 3 * lp->lnd_item[I_MILIT] * lp->lnd_effic / 100.0;
r = (lp->lnd_item[I_MILIT] * lp->lnd_effic) / 500;
che_kill = r < 1 ? 0 : roll(r);
if (che_kill > che)