forked from github/server
Merge branch 'develop' of github.com:ennorehling/eressea into develop
This commit is contained in:
commit
edbfe686e7
|
@ -269,11 +269,6 @@
|
||||||
<skill name="melee" level="1"/>
|
<skill name="melee" level="1"/>
|
||||||
</set>
|
</set>
|
||||||
|
|
||||||
<set name="new_centaur_unit">
|
|
||||||
<skill name="polearm" level="1"/>
|
|
||||||
<skill name="melee" level="1"/>
|
|
||||||
</set>
|
|
||||||
|
|
||||||
<set name="seaserpent_spoils">
|
<set name="seaserpent_spoils">
|
||||||
<item name="dragonblood" amount="6"/>
|
<item name="dragonblood" amount="6"/>
|
||||||
<item name="seaserpenthead" amount="1"/>
|
<item name="seaserpenthead" amount="1"/>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
recruitcost="-1" maintenance="0" weight="1000" capacity="440" speed="1.000000"
|
recruitcost="-1" maintenance="0" weight="1000" capacity="440" speed="1.000000"
|
||||||
hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="no"
|
hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="no"
|
||||||
walk="yes" shapeshift="no" giveperson="no" giveunit="no"
|
walk="yes" shapeshift="no" giveperson="no" giveunit="no"
|
||||||
getitem="no" recruitethereal="no" equipment="yes" scarepeasants="yes"
|
getitem="no" equipment="yes" scarepeasants="yes"
|
||||||
cansteal="no" unarmedguard="yes" absorbpeasants="yes" noheal="yes"
|
cansteal="no" unarmedguard="yes" absorbpeasants="yes" noheal="yes"
|
||||||
undead="yes" resistpierce="yes">
|
undead="yes" resistpierce="yes">
|
||||||
<ai splitsize="1000" moverandom="yes" learn="yes" />
|
<ai splitsize="1000" moverandom="yes" learn="yes" />
|
||||||
|
|
|
@ -180,15 +180,6 @@ static void expandorders(region * r, request * requests)
|
||||||
|
|
||||||
/* ------------------------------------------------------------- */
|
/* ------------------------------------------------------------- */
|
||||||
|
|
||||||
static void change_level(unit * u, skill_t sk, int bylevel)
|
|
||||||
{
|
|
||||||
skill *sv = unit_skill(u, sk);
|
|
||||||
assert(bylevel > 0);
|
|
||||||
if (sv == 0)
|
|
||||||
sv = add_skill(u, sk);
|
|
||||||
sk_set(sv, sv->level + bylevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef struct recruitment {
|
typedef struct recruitment {
|
||||||
struct recruitment *next;
|
struct recruitment *next;
|
||||||
faction *f;
|
faction *f;
|
||||||
|
@ -258,10 +249,6 @@ void add_recruits(unit * u, int number, int wanted)
|
||||||
strlcat(equipment, "_unit", sizeof(equipment));
|
strlcat(equipment, "_unit", sizeof(equipment));
|
||||||
equip_unit(unew, get_equipment(equipment));
|
equip_unit(unew, get_equipment(equipment));
|
||||||
|
|
||||||
if (u_race(unew)->ec_flags & ECF_REC_HORSES) {
|
|
||||||
change_level(unew, SK_RIDING, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unew != u) {
|
if (unew != u) {
|
||||||
transfermen(unew, u, unew->number);
|
transfermen(unew, u, unew->number);
|
||||||
remove_unit(&r->units, unew);
|
remove_unit(&r->units, unew);
|
||||||
|
@ -278,24 +265,6 @@ static int any_recruiters(const struct race *rc, int qty)
|
||||||
return (int)(qty * 2 * rc->recruit_multi);
|
return (int)(qty * 2 * rc->recruit_multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static int peasant_recruiters(const struct race *rc, int qty)
|
|
||||||
{
|
|
||||||
if (rc->ec_flags & ECF_REC_ETHEREAL)
|
|
||||||
return -1;
|
|
||||||
if (rc->ec_flags & ECF_REC_HORSES)
|
|
||||||
return -1;
|
|
||||||
return (int)(qty * 2 * rc->recruit_multi);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
static int horse_recruiters(const struct race *rc, int qty)
|
|
||||||
{
|
|
||||||
if (rc->ec_flags & ECF_REC_ETHEREAL)
|
|
||||||
return -1;
|
|
||||||
if (rc->ec_flags & ECF_REC_HORSES)
|
|
||||||
return (int)(qty * 2.0 * rc->recruit_multi);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int do_recruiting(recruitment * recruits, int available)
|
static int do_recruiting(recruitment * recruits, int available)
|
||||||
{
|
{
|
||||||
recruitment *rec;
|
recruitment *rec;
|
||||||
|
@ -407,17 +376,6 @@ static void expandrecruit(region * r, request * recruitorders)
|
||||||
|
|
||||||
int orc_total = 0;
|
int orc_total = 0;
|
||||||
|
|
||||||
/* centaurs: */
|
|
||||||
recruits = select_recruitment(&recruitorders, horse_recruiters, &orc_total);
|
|
||||||
if (recruits) {
|
|
||||||
int recruited, horses = rhorses(r) * 2;
|
|
||||||
if (orc_total < horses)
|
|
||||||
horses = orc_total;
|
|
||||||
recruited = do_recruiting(recruits, horses);
|
|
||||||
rsethorses(r, (horses - recruited) / 2);
|
|
||||||
free_recruitments(recruits);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* peasant limited: */
|
/* peasant limited: */
|
||||||
recruits = select_recruitment(&recruitorders, any_recruiters, &orc_total);
|
recruits = select_recruitment(&recruitorders, any_recruiters, &orc_total);
|
||||||
if (recruits) {
|
if (recruits) {
|
||||||
|
@ -539,7 +497,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(rc->ec_flags & ECF_REC_HORSES) && fval(r, RF_ORCIFIED)) {
|
if (fval(r, RF_ORCIFIED)) {
|
||||||
if (rc != get_race(RC_ORC)) {
|
if (rc != get_race(RC_ORC)) {
|
||||||
cmistake(u, ord, 238, MSG_EVENT);
|
cmistake(u, ord, 238, MSG_EVENT);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -386,19 +386,14 @@ void destroyfaction(faction ** fp)
|
||||||
const race *rc = u_race(u);
|
const race *rc = u_race(u);
|
||||||
int m = rmoney(r);
|
int m = rmoney(r);
|
||||||
|
|
||||||
|
/* Personen gehen nur an die Bauern, wenn sie auch von dort
|
||||||
|
* stammen */
|
||||||
if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
||||||
int p = rpeasants(u->region);
|
int p = rpeasants(u->region);
|
||||||
int h = rhorses(u->region);
|
int h = rhorses(u->region);
|
||||||
item *itm;
|
item *itm;
|
||||||
|
|
||||||
/* Personen gehen nur an die Bauern, wenn sie auch von dort
|
|
||||||
* stammen */
|
|
||||||
if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */
|
|
||||||
h += u->number;
|
|
||||||
}
|
|
||||||
else { /* Orks zählen nur zur Hälfte */
|
|
||||||
p += (int)(u->number * rc->recruit_multi);
|
p += (int)(u->number * rc->recruit_multi);
|
||||||
}
|
|
||||||
for (itm = u->items; itm; itm = itm->next) {
|
for (itm = u->items; itm; itm = itm->next) {
|
||||||
if (itm->type->flags & ITF_ANIMAL) {
|
if (itm->type->flags & ITF_ANIMAL) {
|
||||||
h += itm->number;
|
h += itm->number;
|
||||||
|
|
|
@ -217,7 +217,6 @@ extern "C" {
|
||||||
#define GIVEPERSON (1<<2) /* übergibt Personen */
|
#define GIVEPERSON (1<<2) /* übergibt Personen */
|
||||||
#define GIVEUNIT (1<<3) /* Einheiten an andere Partei übergeben */
|
#define GIVEUNIT (1<<3) /* Einheiten an andere Partei übergeben */
|
||||||
#define GETITEM (1<<4) /* nimmt Gegenstände an */
|
#define GETITEM (1<<4) /* nimmt Gegenstände an */
|
||||||
#define ECF_REC_HORSES (1<<6) /* Rekrutiert aus Pferden */
|
|
||||||
#define ECF_REC_ETHEREAL (1<<7) /* Rekrutiert aus dem Nichts */
|
#define ECF_REC_ETHEREAL (1<<7) /* Rekrutiert aus dem Nichts */
|
||||||
#define ECF_REC_UNLIMITED (1<<8) /* Rekrutiert ohne Limit */
|
#define ECF_REC_UNLIMITED (1<<8) /* Rekrutiert ohne Limit */
|
||||||
|
|
||||||
|
|
|
@ -1084,17 +1084,11 @@ void transfermen(unit * u, unit * dst, int n)
|
||||||
else if (r->land) {
|
else if (r->land) {
|
||||||
if ((u_race(u)->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
if ((u_race(u)->ec_flags & ECF_REC_ETHEREAL) == 0) {
|
||||||
const race *rc = u_race(u);
|
const race *rc = u_race(u);
|
||||||
if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */
|
|
||||||
int h = rhorses(r) + n;
|
|
||||||
rsethorses(r, h);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
int p = rpeasants(r);
|
int p = rpeasants(r);
|
||||||
p += (int)(n * rc->recruit_multi);
|
p += (int)(n * rc->recruit_multi);
|
||||||
rsetpeasants(r, p);
|
rsetpeasants(r, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct building *inside_building(const struct unit *u)
|
struct building *inside_building(const struct unit *u)
|
||||||
|
|
|
@ -1730,8 +1730,6 @@ static int parse_races(xmlDocPtr doc)
|
||||||
rc->ec_flags |= GIVEUNIT;
|
rc->ec_flags |= GIVEUNIT;
|
||||||
if (xml_bvalue(node, "getitem", false))
|
if (xml_bvalue(node, "getitem", false))
|
||||||
rc->ec_flags |= GETITEM;
|
rc->ec_flags |= GETITEM;
|
||||||
if (xml_bvalue(node, "recruithorses", false))
|
|
||||||
rc->ec_flags |= ECF_REC_HORSES;
|
|
||||||
if (xml_bvalue(node, "recruitethereal", false))
|
if (xml_bvalue(node, "recruitethereal", false))
|
||||||
rc->ec_flags |= ECF_REC_ETHEREAL;
|
rc->ec_flags |= ECF_REC_ETHEREAL;
|
||||||
if (xml_bvalue(node, "recruitunlimited", false))
|
if (xml_bvalue(node, "recruitunlimited", false))
|
||||||
|
|
Loading…
Reference in New Issue