config: Make work to build units independently configurable

The work required for build and repairs is traditionally a function of
build materials: 20 + lcm + 2*hcm for ships, planes and land units,
and (lcm + 2*hcm + oil + rad)/5 for nukes.  Make it independently
configurable instead, via new ship-chr, plane-chr, land-chr, nuke-chr
selector bwork, backed by new struct mchrstr member m_bwork, struct
plchrstr member pl_bwork, struct lchrstr member l_bwork, struct
nchrstr member n_bwork.  Keep the required work exactly the same for
now.

Clients that compute work from materials need to be updated.  Easy,
since build work is now exposed in xdump.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-05-27 13:39:11 +02:00
parent 14af586b57
commit 68c7c08a58
19 changed files with 319 additions and 351 deletions

View file

@ -30,7 +30,7 @@
* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998
* Markus Armbruster, 2004-2013
* Markus Armbruster, 2004-2016
*/
#ifndef PLANE_H
@ -81,8 +81,9 @@ struct plchrstr {
char *pl_name; /* full name of type of plane */
int pl_lcm; /* costs to build */
int pl_hcm;
int pl_cost;
int pl_bwork; /* work to build 100% */
int pl_tech; /* tech needed to build */
int pl_cost; /* how much it costs to build */
int pl_acc; /* bombing accuracy (higher the better) */
int pl_load; /* bomb load, also for carrying cargo */
int pl_att; /* air-air attack/defense strengths */
@ -141,9 +142,6 @@ struct shiplist {
struct shiplist *next;
};
/* Work required for building 100% */
#define PLN_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
extern int pl_att(struct plchrstr *, int);
extern int pl_def(struct plchrstr *, int);
extern int pl_acc(struct plchrstr *, int);