From 234797c24bc70788703816167e54101d59e1cfd2 Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Sun, 7 Apr 2002 08:31:20 +0000 Subject: [PATCH] fix illaunzauber vermehrung --- src/common/gamecode/randenc.c | 40 ++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/src/common/gamecode/randenc.c b/src/common/gamecode/randenc.c index 680be4e9c..d8d73b3e2 100644 --- a/src/common/gamecode/randenc.c +++ b/src/common/gamecode/randenc.c @@ -1060,6 +1060,33 @@ randomevents(void) drown(r); } + /* Orkische vermehren sich */ + + for (r = regions; r; r = r->next) { + + plane * p = rplane(r); + for (u = r->units; u; u = u->next) { + if (is_cursed(u->attribs, C_ORC, 0)) + && !has_skill(u, SK_MAGIC) && !has_skill(u, SK_ALCHEMY)) { + int increase = 0; + int num = min(get_cursedmen(u->attribs, C_ORC, 0), u->number); + int prob = get_curseeffect(u->attribs, C_ORC, 0); + + for (n = (num - get_item(u, I_CHASTITY_BELT)); n > 0; n--) { + if (rand() % 100 < prob) { + ++increase; + } + } + if (increase) { + set_number(u, u->number + increase); + + u->hp += unit_max_hp(u) * increase; + ADDMSG(&u->faction->msgs, msg_message("orcgrowth", + "unit amount race", u, increase, u->race)); + } + } + } + } #if RACE_ADJUSTMENTS == 0 /* Orks vermehren sich */ @@ -1070,18 +1097,11 @@ randomevents(void) /* there is a flag for planes without orc growth: */ if (p && (p->flags & PFL_NOORCGROWTH)) continue; for (u = r->units; u; u = u->next) { - if ( (u->race == new_race[RC_ORC] || is_cursed(u->attribs, C_ORC, 0)) + if ( (u->race == new_race[RC_ORC]) && !has_skill(u, SK_MAGIC) && !has_skill(u, SK_ALCHEMY)) { int increase = 0; - int num, prob; - - if (u->race == new_race[RC_ORC]) { - num = u->number; - prob = 5; - } else { - num = min(get_cursedmen(u->attribs, C_ORC, 0), u->number); - prob = get_curseeffect(u->attribs, C_ORC, 0); - } + int num = u->number; + int prob = 5; for (n = (num - get_item(u, I_CHASTITY_BELT)); n > 0; n--) { if (rand() % 100 < prob) {