]> git.pond.sub.org Git - empserver/commitdiff
update/revolt: Make security bonus proportional to efficiency
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 19 Sep 2016 18:05:51 +0000 (20:05 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:20 +0000 (20:09 +0200)
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>
src/lib/update/revolt.c
tests/update/final.xdump
tests/update/journal.log

index 963b7166d17afc18d076c14a94ac809741553c4e..93de035b5d34b26c9490e173d788e04988bb6907 100644 (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)
index 73a5cac845652a9057da5bc92d360d69ab55bae1..e2e92ecc632aa70f9991b8152da3370b3735f557 100644 (file)
@@ -157,7 +157,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
 3 14 -8 4 9 120 0 112 0 0 0 0 0 14 -8 9 0 34 1 4 0 0 0 0 0 3 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0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 -8 39 0 100 1 4 0 0 0 0 0 2 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
@@ -172,7 +172,7 @@ owner xloc yloc des effic mobil off loyal terr0 terr1 terr2 terr3 dterr xdist yd
 3 13 -7 4 11 120 0 112 0 0 0 0 0 13 -7 12 0 38 0 4 0 0 0 0 0 3 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 3 15 -7 4 14 120 0 112 0 0 0 0 0 15 -7 14 0 57 1 4 0 0 0 0 0 3 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 4 -15 -7 4 41 120 0 0 0 0 0 0 0 -15 -7 41 0 100 1 4 0 0 0 0 0 4 130 20 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
-4 -13 -7 4 39 120 0 0 0 0 0 0 0 -13 -7 39 0 100 0 4 0 0 0 0 0 4 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 116 4 0 0 0 0 0
+4 -13 -7 4 39 120 0 0 0 0 0 0 0 -13 -7 39 0 100 0 4 0 0 0 0 0 4 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 156 4 0 0 0 0 0
 4 -11 -7 4 41 120 0 0 0 0 0 0 0 -11 -7 42 0 100 0 4 0 0 0 0 0 4 130 20 0 0 0 0 0 0 96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 4 -9 -7 4 39 120 0 0 0 0 0 0 0 -9 -7 39 0 100 0 4 0 0 0 0 0 4 130 0 0 0 0 0 0 0 97 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
 4 -7 -7 4 39 120 0 0 0 0 0 0 0 -7 -7 39 0 100 0 4 0 0 0 0 0 4 130 0 0 0 0 0 0 0 96 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 0 0 0 0 0
index a760dd8438347fd4b37a5797b1b81a36c9ab10c5..c1aba0902d560925480434159fececfaee86833c 100644 (file)
     Play#0 output Play#0 1 own   sect        eff prd mob uf uf old  civ  mil   uw food work avail fall coa
     Play#0 output Play#0 1   5  -16,-8   -    0%     120 .. ..      124    5    0   96 100%    0    0   1
     Play#0 output Play#0 1   5  -14,-8   b  100%     120 .. ..      124    5    0   97 100%    0    0   1
-    Play#0 output Play#0 1   0  -12,-8   -    0%      60 .. ..      124    5    0   97 100%    0    0   1
+    Play#0 output Play#0 1   0  -12,-8   -    0%      60 .. ..      123    5    0   97 100%    0    0   1
     Play#0 output Play#0 1   4  -10,-8   -   39%     120 .. ..      130    0    0   97 100%   39    0   1
     Play#0 output Play#0 1   4   -8,-8   -   39%     120 .. ..   2  130    0    0   97 100%   39    0   1
     Play#0 output Play#0 1   4   -6,-8   -   39%     120 .. ..   2  130    0    0   97 100%   39    0   1
     Play#0 output Play#0 1   4   -4,-8   -   39%     0    0    0      0     0    0
     Play#0 output Play#0 1   4   -2,-8   -   39%     0    0    0      0     0    0
     Play#0 output Play#0 1   4  -15,-7   -   41%     0    0    0      0     0    0
-    Play#0 output Play#0 1   4  -13,-7   -   39%     0    4  116      0     0    0
+    Play#0 output Play#0 1   4  -13,-7   -   39%     0    4  156      0     0    0
     Play#0 output Play#0 1   4  -11,-7   -   41%     0    0    0      0     0    0
     Play#0 output Play#0 1   4   -9,-7   -   39%     0    0    0      0     0    0
     Play#0 output Play#0 1   4   -7,-7   -   39%     0    0    0      0     0    0