empserver/include/product.h
Markus Armbruster 1d8451e87b config: Make product work independently configurable
The work required for a product is traditionally the amount of raw
materials, plus 1 for resource usage, or 1 if using neither.  Make it
independently configurable instead, via new product selector bwork,
backed by new struct pchrstr member p_bwork.  Keep the required work
exactly the same in the default configuration.

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>
2021-01-23 08:39:14 +01:00

64 lines
2.2 KiB
C

/*
* Empire - A multi-player, client/server Internet based war game.
* Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
* See files README, COPYING and CREDITS in the root of the source
* tree for related information and legal notices. It is expected
* that future projects/authors will amend these files as needed.
*
* ---
*
* product.h: Definitions for things having to do with products
*
* Known contributors to this file:
*
*/
#ifndef PRODUCT_H
#define PRODUCT_H
#include "item.h"
/*
* Maximum number of product constituents.
* Beware, some output formats rely on MAXPRCON <= 3!
*/
enum { MAXPRCON = 3 };
struct pchrstr {
int p_uid;
i_type p_ctype[MAXPRCON]; /* constituent types */
unsigned short p_camt[MAXPRCON]; /* constituent amounts */
int p_bwork; /* work to build one product unit */
i_type p_type; /* product item type, or I_NONE if level */
int p_level; /* level index (NAT_?LEV), or -1 if item */
int p_cost; /* dollars / product unit */
int p_nrndx; /* index into sect of natural resource */
int p_nrdep; /* depletion as a % of resource used */
int p_nlndx; /* index (NAT_?LEV) affecting production */
int p_nlmin; /* minimum lvl required */
int p_nllag; /* lag, mul by (lvl-nlmin)/(lvl-nlmin+nllag) */
char *p_name; /* name of product */
char *p_sname; /* short (7 char or less) name of product */
};
#define PCHR_SZ 32
extern struct pchrstr pchr[PCHR_SZ];
#endif