forked from github/server
gemilderte Bauernwandlungsroutine
This commit is contained in:
parent
d2d19ceb55
commit
49317210e0
|
@ -1331,6 +1331,7 @@ sp_kaelteschutz(castorder *co)
|
||||||
unit *mage = (unit *)co->magician;
|
unit *mage = (unit *)co->magician;
|
||||||
int cast_level = co->level;
|
int cast_level = co->level;
|
||||||
int force = co->force;
|
int force = co->force;
|
||||||
|
int duration = max(cast_level, force);
|
||||||
spellparameter *pa = co->par;
|
spellparameter *pa = co->par;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1354,7 +1355,7 @@ sp_kaelteschutz(castorder *co)
|
||||||
}
|
}
|
||||||
|
|
||||||
create_curse(mage, &u->attribs, C_KAELTESCHUTZ, 0, cast_level,
|
create_curse(mage, &u->attribs, C_KAELTESCHUTZ, 0, cast_level,
|
||||||
cast_level, 1, men);
|
duration, 1, men);
|
||||||
|
|
||||||
force -= u->number;
|
force -= u->number;
|
||||||
add_message(&mage->faction->msgs, new_message(mage->faction,
|
add_message(&mage->faction->msgs, new_message(mage->faction,
|
||||||
|
|
|
@ -2818,6 +2818,7 @@ heal_all(void)
|
||||||
#if PEASANT_ADJUSTMENT == 1
|
#if PEASANT_ADJUSTMENT == 1
|
||||||
|
|
||||||
#define WEIGHT ((double)0.5)
|
#define WEIGHT ((double)0.5)
|
||||||
|
#define PLWEIGHT ((double)0.75)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
peasant_adjustment(void)
|
peasant_adjustment(void)
|
||||||
|
@ -2859,9 +2860,15 @@ peasant_adjustment(void)
|
||||||
|
|
||||||
soll = (avg + playerp + rpeasants(r)) * WEIGHT;
|
soll = (avg + playerp + rpeasants(r)) * WEIGHT;
|
||||||
|
|
||||||
if(playerp + rpeasants(r) > soll) {
|
if(playerp * PLWEIGHT + rpeasants(r) > soll) {
|
||||||
p_weg = min((playerp + rpeasants(r)) - soll, rpeasants(r));
|
p_weg = min(((playerp * PLWEIGHT) + rpeasants(r)) - soll, rpeasants(r));
|
||||||
assert(p_weg >= 0);
|
assert(p_weg >= 0);
|
||||||
|
/*
|
||||||
|
if (p_weg > 0){
|
||||||
|
log_printf("BAUERN: war %d, minus %d, playerp %d\n",
|
||||||
|
rpeasants(r), p_weg, playerp);
|
||||||
|
}
|
||||||
|
*/
|
||||||
pool += p_weg;
|
pool += p_weg;
|
||||||
rsetpeasants(r, rpeasants(r) - p_weg);
|
rsetpeasants(r, rpeasants(r) - p_weg);
|
||||||
assert(rpeasants(r) >= 0);
|
assert(rpeasants(r) >= 0);
|
||||||
|
|
Loading…
Reference in New Issue