Orkbonus für Rekrutierungszauber
This commit is contained in:
Enno Rehling 2004-08-21 23:11:23 +00:00
parent f1f887d1ae
commit e657058251
1 changed files with 29 additions and 27 deletions

View File

@ -4519,16 +4519,14 @@ static int
sp_recruit(castorder *co)
{
unit *u;
faction *f;
int n;
region *r = co->rt;
int n, maxp = rpeasants(r);
unit *mage = (unit *)co->magician;
int cast_level = co->level;
double force = co->force;
faction *f = mage->faction;
f = mage->faction;
if (rpeasants(r) == 0){
if (maxp == 0) {
report_failure(mage, co->order);
return 0;
}
@ -4539,21 +4537,25 @@ sp_recruit(castorder *co)
* 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);
n = min(rpeasants(r),n);
if (f->race==new_race[RC_URUK]) {
n = min(2*maxp, n);
n = max(n, 1);
if(n <= 0){
report_failure(mage, co->order);
return 0;
rsetpeasants(r, maxp - (n+1) / 2);
} else {
n = min(maxp, n);
n = max(n, 1);
rsetpeasants(r, maxp - n);
}
rsetpeasants(r, rpeasants(r) - n);
u = create_unit(r, f, n, f->race, 0, (n == 1 ? "Bauer" : "Bauern"), mage);
set_order(&u->thisorder, default_order(f->locale));
sprintf(buf, "%s konnte %d %s anwerben", unitname(mage), n,
n == 1 ? "Bauer" : "Bauern");
addmessage(r, mage->faction, buf, MSG_MAGIC, ML_INFO);
if (f->race==new_race[RC_URUK]) n = (n+1) / 2;
return cast_level;
}
@ -4570,31 +4572,31 @@ static int
sp_bigrecruit(castorder *co)
{
unit *u;
faction *f;
int n;
region *r = co->rt;
int n, maxp = rpeasants(r);
unit *mage = (unit *)co->magician;
int cast_level = co->level;
double force = co->force;
faction *f = mage->faction;
f = mage->faction;
if (rpeasants(r) == 0){
if (maxp <= 0) {
report_failure(mage, co->order);
return 0;
}
/* Für vergleichbare Erfolge bei unterschiedlichen Rassen die
* Rekrutierungskosten mit einfliessen lassen. */
n = (int)force + lovar((force * force * 1000)/f->race->recruitcost);
/* natürlich nur maximal soviele Bauern, wie auch in der Region sind */
n = min(rpeasants(r), n);
if (n <= 0) {
report_failure(mage, co->order);
return 0;
n = (int)force + lovar((force * force * 1000)/f->race->recruitcost);
if (f->race==new_race[RC_URUK]) {
n = min(2*maxp, n);
n = max(n, 1);
rsetpeasants(r, maxp - (n+1) / 2);
} else {
n = min(maxp, n);
n = max(n, 1);
rsetpeasants(r, maxp - n);
}
rsetpeasants(r, rpeasants(r) - n);
u = create_unit(r, f, n, f->race, 0, (n == 1 ? "Bauer" : "Bauern"), mage);
set_order(&u->thisorder, default_order(f->locale));