forked from github/server
abbau von hp nur noch am ende der runde in regeneration
This commit is contained in:
parent
84c9609e25
commit
1d3f6a727e
|
@ -3197,27 +3197,28 @@ monthly_healing(void)
|
||||||
for (u = r->units; u; u = u->next) {
|
for (u = r->units; u; u = u->next) {
|
||||||
int umhp;
|
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))
|
if((u->race->flags & RCF_NOHEAL) || fval(u, FL_HUNGER) || fspecial(u->faction, FS_UNDEAD))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(rterrain(r) == T_OCEAN && !u->ship && !(canswim(u)))
|
if(rterrain(r) == T_OCEAN && !u->ship && !(canswim(u)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
umhp = unit_max_hp(u) * u->number;
|
|
||||||
|
|
||||||
if(fspecial(u->faction, FS_REGENERATION)) {
|
if(fspecial(u->faction, FS_REGENERATION)) {
|
||||||
u->hp = umhp;
|
u->hp = umhp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Effekt von Elixier der Macht schwindet */
|
if (u->hp < umhp && (p=canheal(u)) > 0) {
|
||||||
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) {
|
|
||||||
/* Mind 1 HP wird pro Runde geheilt, weil angenommen wird,
|
/* Mind 1 HP wird pro Runde geheilt, weil angenommen wird,
|
||||||
das alle Personen mind. 10 HP haben. */
|
das alle Personen mind. 10 HP haben. */
|
||||||
int max_unit = max(umhp, u->number * 10);
|
int max_unit = max(umhp, u->number * 10);
|
||||||
|
|
|
@ -671,7 +671,8 @@ move_unit(unit * u, region * r, unit ** ulist)
|
||||||
u->faction->first = 0;
|
u->faction->first = 0;
|
||||||
u->faction->last = 0;
|
u->faction->last = 0;
|
||||||
u->region = r;
|
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: */
|
/* ist mist, aber wegen nicht skalierender attirbute notwendig: */
|
||||||
|
|
Loading…
Reference in New Issue