Custom games may want to tweak how items contribute to the power factor, in particular when products are also customized. Add ichrstr member i_power and item selector power for that. "info power" doesn't reflect this change, yet. It'll be updated in the next commit. The current item power values are problematic. This will be addressed later. For straightforward configurations, reasonable item power values could perhaps be derived from the configuration automatically. However, this is surprisingly hard in the general case: since producing things should not decrease power, the efficiency of processing products into other products needs to be considered, and estimating these efficiencies can be difficult. Deities can create multiple products making the same item, or multiple sector types with the same product, but different process efficiency (sect-chr selector peffic). Providing differently efficient ways to make the same item can be reasonable when the sector types involved have different terrain. To average them, you'd need to know the map. The stock game has one example: gold mines produce dust with 100% process efficiency, mountains produce it with 75%. Mountains are normally rare enough not to matter. Level p.e. (product selectors nlmin, nllag) may have to be considered. In the stock game, level p.e. variations are minor, because it reaches 0.9 pretty quickly. In games where it doesn't, you might have to increase the power value of the product. Resources (sect selectors min, gold, fert, ocontent, uran) and resource depletion (product selectors nrndx and nrdep) further complicate things: you might want to increase the power value of products depending on unusually scarce resources, but you can't know what's scarce without understanding the map. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
91 lines
2.4 KiB
C
91 lines
2.4 KiB
C
/*
|
|
* Empire - A multi-player, client/server Internet based war game.
|
|
* Copyright (C) 1986-2016, 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.
|
|
*
|
|
* ---
|
|
*
|
|
* item.h: Definitions for item characteristics stuff
|
|
*
|
|
* Known contributors to this file:
|
|
* Markus Armbruster, 2004-2016
|
|
*/
|
|
|
|
#ifndef ITEM_H
|
|
#define ITEM_H
|
|
|
|
#include "misc.h"
|
|
|
|
enum i_packing {
|
|
IPKG, /* "inefficient" packaging (eff<60) */
|
|
NPKG, /* no special packaging */
|
|
WPKG, /* "warehouse" packaging */
|
|
UPKG, /* "urban" packaging */
|
|
BPKG /* "bank" packaging */
|
|
};
|
|
|
|
enum {
|
|
NUMPKG = BPKG + 1
|
|
};
|
|
|
|
/* Item types, must match item.config */
|
|
typedef enum {
|
|
I_NONE = -1,
|
|
I_CIVIL,
|
|
I_MILIT,
|
|
I_SHELL,
|
|
I_GUN,
|
|
I_PETROL,
|
|
I_IRON,
|
|
I_DUST,
|
|
I_BAR,
|
|
I_FOOD,
|
|
I_OIL,
|
|
I_LCM,
|
|
I_HCM,
|
|
I_UW,
|
|
I_RAD,
|
|
I_MAX = I_RAD
|
|
} ATTRIBUTE((packed)) i_type;
|
|
|
|
struct ichrstr {
|
|
char i_mnem; /* usually the initial letter */
|
|
i_type i_uid; /* index in ichr[] */
|
|
int i_power; /* power value of 1000 items */
|
|
int i_value; /* mortgage value */
|
|
int i_sell; /* can this be sold? */
|
|
int i_lbs; /* how hard to move */
|
|
int i_pkg[NUMPKG]; /* units for reg, ware, urb, bank */
|
|
int i_melt_denom; /* fallout meltdown denominator */
|
|
char *i_name; /* full name of item */
|
|
};
|
|
|
|
/* variables using this structure */
|
|
|
|
extern struct ichrstr ichr[I_MAX + 2];
|
|
|
|
/* procedures using/returning this struct */
|
|
|
|
extern struct ichrstr *whatitem(char *, char *);
|
|
extern struct ichrstr *item_by_name(char *);
|
|
|
|
#endif
|