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:
parent
14af586b57
commit
68c7c08a58
19 changed files with 319 additions and 351 deletions
|
@ -31,7 +31,7 @@
|
|||
* Thomas Ruschak, 1992
|
||||
* Ken Stevens, 1995
|
||||
* Steve McClure, 1998
|
||||
* Markus Armbruster, 2004-2015
|
||||
* Markus Armbruster, 2004-2016
|
||||
*/
|
||||
|
||||
#ifndef SHIP_H
|
||||
|
@ -93,6 +93,7 @@ struct mchrstr {
|
|||
unsigned char m_nxlight; /* maximum number of xlight planes */
|
||||
unsigned char m_nchoppers; /* maximum number of choppers */
|
||||
char *m_name; /* full name of type of ship */
|
||||
int m_bwork; /* work to build 100% */
|
||||
int m_tech; /* tech required to build */
|
||||
int m_cost; /* how much it costs to build */
|
||||
int m_flags; /* what special things can this ship do */
|
||||
|
@ -131,9 +132,6 @@ struct mchrstr {
|
|||
|
||||
extern struct mchrstr mchr[SHP_TYPE_MAX + 2];
|
||||
|
||||
/* Work required for building 100% */
|
||||
#define SHP_BLD_WORK(lcm, hcm) (20 + (lcm) + 2 * (hcm))
|
||||
|
||||
enum {
|
||||
SHP_AIROPS_EFF = 50, /* min. efficiency for air ops */
|
||||
SHP_TORP_SHELLS = 3 /* number of shells used by a torpedo */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue