]> git.pond.sub.org Git - empserver/commit
config: Define infra build cost and mobility use per 100%
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 17 Aug 2016 18:00:02 +0000 (20:00 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:19 +0000 (20:09 +0200)
commitc8b51ec1a81833df35d1776ad1ae30695faca297
tree3f36a9ca9ab6825799cb29bb2d3d9533a69523ad
parentf9114aecd884e695d48e1191f62c6c6cb3fa6987
config: Define infra build cost and mobility use per 100%

Infrastructure build cost is defined by infra column dcost (struct
sctintrins member in_dcost).  It's the cost per point of efficiency.
In contrast, sector and unit build cost is defined for 100%, by
sect-chr, ship-chr, plane-chr, land-chr, nuke-chr column cost.

Switch to build cost per 100%, for flexibility and consistency:
replace struct sctintrins member in_dcost by in_cost, and selector
dcost by cost.

With cost values that aren't multiple of 100, the build cost may have
to be rounded.  Do this exactly like we round sector build cost: the
amount is limited to money * 100 / cost rounded down, but the money
charged is actual amount * money / 100 rounded randomly.

Do the same for mobility use: replace struct sctintrins member
in_mcost by in_bmobil, and selector mcost by bmobil, with similar
rounding.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/sect.h
src/lib/commands/improve.c
src/lib/common/nsc.c
src/lib/global/infra.config
src/lib/subs/show.c
tests/empdump/xundump-errors/fld-conststr
tests/empdump/xundump-errors/ftr-mal2
tests/version/journal.log