2010-08-08 10:06:34 +02:00
|
|
|
#ifndef H_GC_ECONOMY
|
|
|
|
#define H_GC_ECONOMY
|
2018-02-24 19:41:36 +01:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Welchen Teil des Silbers die Bauern fuer Unterhaltung ausgeben (1/20), und
|
|
|
|
* wiviel Silber ein Unterhalter pro Talentpunkt bekommt. */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Wieviele Silbermuenzen jeweils auf einmal "getaxed" werden. */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#define TAXFRACTION 10
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Wieviel Silber pro Talentpunkt geklaut wird. */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#define STEALINCOME 50
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Teil der Bauern, welche Luxusgueter kaufen und verkaufen (1/100). */
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#define TRADE_FRACTION 100
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Wieviel Fremde eine Partei pro Woche aufnehmen kann */
|
2010-08-08 10:06:34 +02:00
|
|
|
#define MAXNEWBIES 5
|
|
|
|
|
2014-11-03 09:55:29 +01:00
|
|
|
struct unit;
|
2018-08-02 14:31:00 +02:00
|
|
|
struct race;
|
2014-11-03 09:55:29 +01:00
|
|
|
struct region;
|
|
|
|
struct faction;
|
2014-11-03 17:32:55 +01:00
|
|
|
struct order;
|
|
|
|
struct message;
|
2019-09-08 13:06:24 +02:00
|
|
|
struct terrain_type;
|
2018-02-14 20:02:50 +01:00
|
|
|
struct item_type;
|
2017-12-04 19:20:48 +01:00
|
|
|
|
2017-12-04 20:01:08 +01:00
|
|
|
typedef struct econ_request {
|
|
|
|
struct econ_request *next;
|
2017-12-04 19:20:48 +01:00
|
|
|
struct unit *unit;
|
|
|
|
int qty;
|
2019-07-30 11:13:25 +02:00
|
|
|
enum econ_type {
|
|
|
|
ECON_LIST,
|
|
|
|
ECON_ENTERTAIN,
|
|
|
|
ECON_WORK,
|
|
|
|
ECON_TAX,
|
|
|
|
ECON_LOOT,
|
|
|
|
ECON_BUY,
|
|
|
|
ECON_SELL,
|
|
|
|
ECON_STEAL,
|
|
|
|
} type;
|
2017-12-04 19:20:48 +01:00
|
|
|
union {
|
2018-02-03 20:24:16 +01:00
|
|
|
struct {
|
|
|
|
int no;
|
|
|
|
bool goblin; /* stealing */
|
|
|
|
} steal;
|
|
|
|
struct {
|
|
|
|
const struct luxury_type *ltype; /* trading */
|
|
|
|
} trade;
|
2019-07-30 11:13:25 +02:00
|
|
|
} data;
|
2017-12-04 20:01:08 +01:00
|
|
|
} econ_request;
|
2014-11-03 17:32:55 +01:00
|
|
|
|
2019-07-30 11:13:25 +02:00
|
|
|
int expand_production(struct region * r, struct econ_request * requests, struct econ_request ***results);
|
|
|
|
|
2014-11-03 09:55:29 +01:00
|
|
|
int income(const struct unit *u);
|
2016-11-22 12:22:07 +01:00
|
|
|
int entertainmoney(const struct region *r);
|
2014-11-03 09:55:29 +01:00
|
|
|
|
2014-09-15 15:51:40 +02:00
|
|
|
void economics(struct region *r);
|
2019-07-29 23:53:59 +02:00
|
|
|
void destroy(struct region *r);
|
2014-09-15 15:51:40 +02:00
|
|
|
void produce(struct region *r);
|
|
|
|
void auto_work(struct region *r);
|
2019-09-08 13:06:24 +02:00
|
|
|
|
|
|
|
bool trade_needs_castle(const struct terrain_type *terrain, const struct race *rc);
|
2014-09-15 15:51:40 +02:00
|
|
|
|
2017-12-04 20:01:08 +01:00
|
|
|
typedef enum income_t { IC_WORK, IC_ENTERTAIN, IC_TAX, IC_TRADE, IC_TRADETAX, IC_STEAL, IC_MAGIC, IC_LOOT } income_t;
|
|
|
|
void add_income(struct unit * u, income_t type, int want, int qty);
|
|
|
|
|
2016-08-21 18:06:38 +02:00
|
|
|
void maintain_buildings(struct region *r);
|
2017-02-15 17:09:23 +01:00
|
|
|
void make_item(struct unit * u, const struct item_type * itype, int want);
|
2015-01-30 20:37:14 +01:00
|
|
|
int make_cmd(struct unit *u, struct order *ord);
|
|
|
|
void split_allocations(struct region *r);
|
|
|
|
int give_control_cmd(struct unit *u, struct order *ord);
|
|
|
|
void give_control(struct unit * u, struct unit * u2);
|
2017-12-04 20:01:08 +01:00
|
|
|
|
|
|
|
void tax_cmd(struct unit * u, struct order *ord, struct econ_request ** taxorders);
|
|
|
|
void expandtax(struct region * r, struct econ_request * taxorders);
|
|
|
|
|
|
|
|
struct message * steal_message(const struct unit * u, struct order *ord);
|
|
|
|
void steal_cmd(struct unit * u, struct order *ord, struct econ_request ** stealorders);
|
|
|
|
void expandstealing(struct region * r, struct econ_request * stealorders);
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|