Replace "roll0(N) + M" by "roll(N) + M-1"

This commit is contained in:
Markus Armbruster 2012-08-14 20:33:51 +02:00
parent fce1393017
commit c3be487479
8 changed files with 22 additions and 22 deletions

View file

@ -95,12 +95,12 @@ do_feed(struct sctstr *sp, struct natstr *np, short *vec,
nreport(sp->sct_own, N_DIE_FAMINE, 0, 1);
}
sp->sct_work = 0;
sp->sct_loyal += roll0(8) + 2;
sp->sct_loyal += roll(8) + 1;
}
sctwork = 0;
} else {
if (sp->sct_work < 100)
sctwork = sp->sct_work + 8 + roll0(15);
sctwork = sp->sct_work + 7 + roll(15);
if (sctwork > 100)
sctwork = 100;
if (!player->simulation)

View file

@ -73,7 +73,7 @@ populace(struct natstr *np, struct sctstr *sp, int etu)
n = roundavg(etu * 0.125);
if (n == 0)
n = 1;
n = sp->sct_loyal + roll0(n) + 1;
n = sp->sct_loyal + roll(n);
if (n > 127)
n = 127;
sp->sct_loyal = n;
@ -81,7 +81,7 @@ populace(struct natstr *np, struct sctstr *sp, int etu)
if (sp->sct_loyal > 65 && mil < civ / 20) {
int work_red;
work_red = sp->sct_loyal - (50 + roll0(15));
work_red = sp->sct_loyal - (49 + roll(15));
n = sp->sct_work - work_red;
if (n < 0)
n = 0;

View file

@ -77,7 +77,7 @@ revolt(struct sctstr *sp)
che += che_civ;
if (che < CHE_MAX) {
/* che due to uw unrest */
n = 10 + roll0(30);
n = 9 + roll(30);
che_uw = 5 + (uw * n / 500);
if (che_uw > uw)
che_uw = uw;
@ -327,9 +327,9 @@ guerrilla(struct sctstr *sp)
/* loyalty drops during recruitment efforts */
n = sp->sct_loyal;
if (n < 30)
n += roll0(5) + 1;
n += roll(5);
else if (n < 70)
n += roll0(10) + 4;
n += roll(10) + 3;
if (n > 127)
n = 127;
sp->sct_loyal = n;
@ -375,7 +375,7 @@ domove:
val = roundintby(val, 10);
/* inject a modicum of indeterminism; also
* avoids che preferring certain directions */
val += roll0(10) - 5;
val += roll(10) - 6;
if (val >= min_mil)
continue;
nicest_sp = nsp;