config: Generalize unit build materials storage

Use a single array member instead of multiple scalar members.  Only
the array elements that replace scalar members are can be non-zero for
now.

This is a first step to permitting more build materials.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-05-27 14:17:08 +02:00
parent 68c7c08a58
commit da05484d8b
17 changed files with 79 additions and 100 deletions

View file

@ -35,6 +35,7 @@
#define NUKE_H
#include <time.h>
#include "item.h"
#include "types.h"
#define N_MAXNUKE 20
@ -64,12 +65,10 @@ struct nukstr {
struct nchrstr {
char *n_name; /* warhead unit name */
int n_lcm; /* costs to build */
int n_hcm;
int n_oil;
int n_rad;
int n_blast; /* blast radius */
int n_dam; /* damage at center */
short n_mat[I_MAX+1]; /* materials to build 100% */
/* only I_LCM, I_HCM, I_OIL, I_RAD non-zero */
int n_bwork; /* work to build 100% */
int n_tech; /* tech needed to build */
int n_cost; /* how much it costs to build */