From 1d3f6a727e9bbe4a2a9274b2172bf7a1a1714be8 Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Sun, 3 Nov 2002 12:47:29 +0000 Subject: [PATCH] abbau von hp nur noch am ende der runde in regeneration --- src/common/gamecode/laws.c | 21 +++++++++++---------- src/common/kernel/unit.c | 3 ++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 5402f5080..97a62562a 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -3197,27 +3197,28 @@ monthly_healing(void) for (u = r->units; u; u = u->next) { int umhp; - /* dann wirkt bei Untoten das Elixier der Macht ewig */ + umhp = unit_max_hp(u) * u->number; + + /* hp über Maximum bauen sich ab. Wird zb durch Elixier der Macht + * oder verändertes Ausdauertalent verursacht */ + if (u->hp > umhp) { + u->hp -= (int) ceil((u->hp - umhp) / 2.0); + if (u->hp < umhp) + u->hp = umhp; + } + if((u->race->flags & RCF_NOHEAL) || fval(u, FL_HUNGER) || fspecial(u->faction, FS_UNDEAD)) continue; if(rterrain(r) == T_OCEAN && !u->ship && !(canswim(u))) continue; - umhp = unit_max_hp(u) * u->number; - if(fspecial(u->faction, FS_REGENERATION)) { u->hp = umhp; continue; } - /* Effekt von Elixier der Macht schwindet */ - if (u->hp > umhp) { - u->hp -= (int) ceil((u->hp - umhp) / 2.0); - if (u->hp < umhp) - u->hp = umhp; - } - else if (u->hp < umhp && (p=canheal(u)) > 0) { + if (u->hp < umhp && (p=canheal(u)) > 0) { /* Mind 1 HP wird pro Runde geheilt, weil angenommen wird, das alle Personen mind. 10 HP haben. */ int max_unit = max(umhp, u->number * 10); diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index d7172b020..b44d10569 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -671,7 +671,8 @@ move_unit(unit * u, region * r, unit ** ulist) u->faction->first = 0; u->faction->last = 0; u->region = r; - if (maxhp>0) u->hp = u->hp * unit_max_hp(u) / maxhp; + /* keine automatische hp reduzierung bei bewegung */ + /* if (maxhp>0) u->hp = u->hp * unit_max_hp(u) / maxhp; */ } /* ist mist, aber wegen nicht skalierender attirbute notwendig: */