fairland: Tweak sea oil & mountain gold for simplicity

The functions mapping elevation to resources are piecewise linear,
except for set_oil(), which randomly adds 1 to sea oil, and
set_gold(), which is isn't linear for mountains, but very close.

Drop the random oil bit, and replace the non-liner gold function by a
linear one.  Both resources decrease at most by one point.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2020-08-21 08:18:49 +02:00
parent 6880908937
commit b6b32f02be
5 changed files with 1084 additions and 1084 deletions

View file

@ -1379,7 +1379,7 @@ set_oil(int e)
{
int oil = 0;
if (e < LANDMIN)
oil = (LANDMIN - e) * 2 + roll0(2);
oil = (LANDMIN - e) * 2;
else if (e <= OIL_MAX)
oil = (120 * (OIL_MAX - e + 1)) / (OIL_MAX - LANDMIN + 1);
if (oil > 100)
@ -1406,7 +1406,7 @@ set_gold(int e)
if (e < HIGHMIN)
gold = (80 * (e - GOLD_MIN + 1)) / (HIGHMIN - GOLD_MIN);
else
gold = 100 - 20 * HIGHMIN / e;
gold = 80 + 5 * (e - HIGHMIN) / (127 - HIGHMIN);
}
if (gold > 100)
gold = 100;