forked from github/server
Orc recruiting now for any race that is configured.
This commit is contained in:
parent
8480886f14
commit
e4acd2874a
6 changed files with 26 additions and 25 deletions
|
@ -310,8 +310,7 @@ add_recruits(unit * u, int number, int wanted)
|
|||
static int
|
||||
any_recruiters(const struct race * rc, int qty)
|
||||
{
|
||||
if (rc==new_race[RC_URUK]) return qty;
|
||||
return qty * 2;
|
||||
return (int)(qty * 2 * rc->recruit_multi);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -319,15 +318,14 @@ 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;
|
||||
if (rc==new_race[RC_URUK]) return qty;
|
||||
return qty * 2;
|
||||
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 qty * 2;
|
||||
if (rc->ec_flags & ECF_REC_HORSES) return (int)(qty * 2 * rc->recruit_multi);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1833,9 +1833,13 @@ skilldiff(troop at, troop dt, int dist)
|
|||
}
|
||||
#endif /* KARMA_MODULE */
|
||||
|
||||
if (au->race == new_race[RC_GOBLIN] &&
|
||||
af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * 10)
|
||||
skdiff += 1;
|
||||
if (au->race == new_race[RC_GOBLIN]) {
|
||||
static int goblin_bonus = -1;
|
||||
if (goblin_bonus<0) goblin_bonus = get_param_int(global.parameters, "rules.combat.goblinbonus", 10);
|
||||
if (af->side->size[SUM_ROW] >= df->side->size[SUM_ROW] * goblin_bonus) {
|
||||
skdiff += 1;
|
||||
}
|
||||
}
|
||||
|
||||
#if KARMA_MODULE
|
||||
/* TODO this should be a skillmod */
|
||||
|
|
|
@ -297,10 +297,8 @@ destroyfaction(faction * f)
|
|||
* stammen */
|
||||
if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */
|
||||
h += u->number;
|
||||
} else if (rc == new_race[RC_URUK]){ /* Orks zählen nur zur Hälfte */
|
||||
p += u->number/2;
|
||||
} else {
|
||||
p += u->number;
|
||||
} else { /* Orks zählen nur zur Hälfte */
|
||||
p += (int)(u->number * rc->recruit_multi);
|
||||
}
|
||||
for (itm=u->items;itm;itm=itm->next) {
|
||||
if (itm->type->flags&ITF_ANIMAL) {
|
||||
|
|
|
@ -981,11 +981,7 @@ transfermen(unit * u, unit * u2, int n)
|
|||
rsethorses(r, h);
|
||||
} else {
|
||||
int p = rpeasants(r);
|
||||
if (rc == new_race[RC_URUK]){ /* Orks zählen nur zur Hälfte */
|
||||
p += n/2;
|
||||
} else {
|
||||
p += n;
|
||||
}
|
||||
p += (int)(n * rc->recruit_multi);
|
||||
rsetpeasants(r, p);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4227,11 +4227,13 @@ sp_recruit(castorder *co)
|
|||
{
|
||||
unit *u;
|
||||
region *r = co->rt;
|
||||
int n, maxp = rpeasants(r);
|
||||
int num, maxp = rpeasants(r);
|
||||
double n;
|
||||
unit *mage = co->magician.u;
|
||||
int cast_level = co->level;
|
||||
double force = co->force;
|
||||
faction *f = mage->faction;
|
||||
const struct race * rc = f->race;
|
||||
|
||||
if (maxp == 0) {
|
||||
report_failure(mage, co->order);
|
||||
|
@ -4243,21 +4245,23 @@ sp_recruit(castorder *co)
|
|||
* ist das Verhältniss von ausgegebene Aura pro Bauer bei Stufe 2
|
||||
* ein mehrfaches von Stufe 1, denn in beiden Fällen gibt es nur 1
|
||||
* Bauer, nur die Kosten steigen. */
|
||||
n = (int)((pow(force, 1.6) * 100)/f->race->recruitcost);
|
||||
if (f->race==new_race[RC_URUK]) {
|
||||
n = MIN(2*maxp, n);
|
||||
n = (pow(force, 1.6) * 100)/f->race->recruitcost;
|
||||
if (rc->recruit_multi!=0) {
|
||||
double multp = maxp/rc->recruit_multi;
|
||||
n = MIN(multp, n);
|
||||
n = MAX(n, 1);
|
||||
rsetpeasants(r, maxp - (n+1) / 2);
|
||||
rsetpeasants(r, maxp - (int)(n * rc->recruit_multi));
|
||||
} else {
|
||||
n = MIN(maxp, n);
|
||||
n = MAX(n, 1);
|
||||
rsetpeasants(r, maxp - n);
|
||||
rsetpeasants(r, maxp - (int)n);
|
||||
}
|
||||
|
||||
u = create_unit(r, f, n, f->race, 0, LOC(f->locale,(n == 1 ? "peasant" : "peasant_p")), mage);
|
||||
num = (int)n;
|
||||
u = create_unit(r, f, num, f->race, 0, LOC(f->locale,(num == 1 ? "peasant" : "peasant_p")), mage);
|
||||
set_order(&u->thisorder, default_order(f->locale));
|
||||
|
||||
ADDMSG(&mage->faction->msgs, msg_message("recruit_effect", "mage amount", mage, n));
|
||||
ADDMSG(&mage->faction->msgs, msg_message("recruit_effect", "mage amount", mage, num));
|
||||
|
||||
return cast_level;
|
||||
}
|
||||
|
|
|
@ -128,6 +128,7 @@
|
|||
<param name="study.expensivemigrants" value="1"/>
|
||||
<param name="study.speedup" value="1"/>
|
||||
<param name="rules.check_overload" value="0"/>
|
||||
<param name="rules.combat.goblinbonus" value="3"/>
|
||||
<param name="rules.alliances" value="1"/>
|
||||
<param name="rules.combat.herospeed" value="3"/>
|
||||
<param name="rules.combat.demon_vampire" value="5"/> <!-- regen 1 hp per X points of damage done -->
|
||||
|
|
Loading…
Reference in a new issue