forked from github/server
- market bonus for halflings
This commit is contained in:
parent
b66dc40a85
commit
f28b252f6f
2 changed files with 23 additions and 2 deletions
|
@ -23,6 +23,7 @@ without prior permission by the authors of Eressea.
|
||||||
#include <kernel/faction.h>
|
#include <kernel/faction.h>
|
||||||
#include <kernel/item.h>
|
#include <kernel/item.h>
|
||||||
#include <kernel/message.h>
|
#include <kernel/message.h>
|
||||||
|
#include <kernel/race.h>
|
||||||
#include <kernel/region.h>
|
#include <kernel/region.h>
|
||||||
#include <kernel/unit.h>
|
#include <kernel/unit.h>
|
||||||
|
|
||||||
|
@ -65,6 +66,22 @@ attrib_type at_market = {
|
||||||
NULL, NULL, ATF_UNIQUE
|
NULL, NULL, ATF_UNIQUE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static int rc_luxury_trade(const struct race * rc)
|
||||||
|
{
|
||||||
|
if (rc) {
|
||||||
|
return get_param_int(rc->parameters, "luxury_trade", 1000);
|
||||||
|
}
|
||||||
|
return 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int rc_herb_trade(const struct race * rc)
|
||||||
|
{
|
||||||
|
if (rc) {
|
||||||
|
return get_param_int(rc->parameters, "herb_trade", 500);
|
||||||
|
}
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
|
||||||
#define MAX_MARKETS 128
|
#define MAX_MARKETS 128
|
||||||
void do_markets(void)
|
void do_markets(void)
|
||||||
{
|
{
|
||||||
|
@ -73,9 +90,12 @@ void do_markets(void)
|
||||||
region * r;
|
region * r;
|
||||||
for (r=regions;r;r=r->next) {
|
for (r=regions;r;r=r->next) {
|
||||||
if (r->land) {
|
if (r->land) {
|
||||||
|
faction * f = region_get_owner(r);
|
||||||
|
const struct race * rc = f?f->race:NULL;
|
||||||
int p = rpeasants(r);
|
int p = rpeasants(r);
|
||||||
int numlux = p/1000;
|
int numlux, numherbs;
|
||||||
int numherbs = p/500;
|
numlux = p/rc_luxury_trade(rc);
|
||||||
|
numherbs = p/rc_herb_trade(rc);
|
||||||
if (numlux>0 || numherbs>0) {
|
if (numlux>0 || numherbs>0) {
|
||||||
int d, nmarkets = 0;
|
int d, nmarkets = 0;
|
||||||
const item_type * lux = r_luxury(r);
|
const item_type * lux = r_luxury(r);
|
||||||
|
|
|
@ -79,6 +79,7 @@
|
||||||
<param name="other_race" value="dwarf"/>
|
<param name="other_race" value="dwarf"/>
|
||||||
<param name="other_cost" value="500"/>
|
<param name="other_cost" value="500"/>
|
||||||
<param name="morale" value="5"/>
|
<param name="morale" value="5"/>
|
||||||
|
<param name="luxury_trade" value="600"/>
|
||||||
<skill name="bow" modifier="-1"/>
|
<skill name="bow" modifier="-1"/>
|
||||||
<skill name="building" modifier="1"/>
|
<skill name="building" modifier="1"/>
|
||||||
<skill name="cartmaking" modifier="2"/>
|
<skill name="cartmaking" modifier="2"/>
|
||||||
|
|
Loading…
Reference in a new issue