bug 2660 delayed canibalism

monsters now eat each other in randenc.
This commit is contained in:
Enno Rehling 2020-07-26 21:24:58 +02:00
parent d0149f334f
commit 6d542327f9
2 changed files with 11 additions and 9 deletions

View File

@ -205,8 +205,13 @@ void monsters_desert(struct faction *monsters)
unit *u; unit *u;
for (u = r->units; u; u = u->next) { for (u = r->units; u; u = u->next) {
if (u->faction != monsters if (u->faction == monsters) {
&& (u_race(u)->flags & RCF_DESERT)) { const struct race * rc = u_race(u);
if (rc->splitsize < 10) {
/* hermit-type monsters eat each other */
monster_cannibalism(u);
}
} else if (u_race(u)->flags & RCF_DESERT) {
if (fval(u, UFL_ISNEW)) if (fval(u, UFL_ISNEW))
continue; continue;
if (rng_int() % 100 < 5) { if (rng_int() % 100 < 5) {
@ -752,7 +757,8 @@ static order *plan_dragon(unit * u)
return long_order; return long_order;
} }
static void monster_cannibalism(unit *u) { void monster_cannibalism(unit *u)
{
unit *u2; unit *u2;
for (u2 = u->next; u2; u2 = u2->next) { for (u2 = u->next; u2; u2 = u2->next) {
@ -792,11 +798,6 @@ void plan_monsters(faction * f)
} }
a_removeall(&u->attribs, &at_otherfaction); a_removeall(&u->attribs, &at_otherfaction);
if (rc->splitsize < 10) {
/* hermit-type monsters eat each other */
monster_cannibalism(u);
}
if (skill_enabled(SK_PERCEPTION)) { if (skill_enabled(SK_PERCEPTION)) {
/* Monster bekommen jede Runde ein paar Tage Wahrnehmung dazu */ /* Monster bekommen jede Runde ein paar Tage Wahrnehmung dazu */
produceexp(u, SK_PERCEPTION, u->number); produceexp(u, SK_PERCEPTION, u->number);

View File

@ -15,7 +15,8 @@ extern "C" {
struct unit *spawn_seaserpent(struct region *r, struct faction *f); struct unit *spawn_seaserpent(struct region *r, struct faction *f);
void spawn_dragons(void); void spawn_dragons(void);
void monsters_desert(struct faction *monsters); void monsters_desert(const struct faction *monsters);
void monster_cannibalism(struct unit *u);
void monster_kills_peasants(struct unit *u); void monster_kills_peasants(struct unit *u);
void make_zombie(struct unit * u); void make_zombie(struct unit * u);