forked from github/server
use up old potion effects
This commit is contained in:
parent
afdd20c4dd
commit
e6907f570e
22
src/battle.c
22
src/battle.c
|
@ -1322,15 +1322,19 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Heiltrank schluerfen und hoffen */
|
if (oldpotiontype[P_HEAL] && !fval(&df->person[dt.index], FL_HEALING_USED)) {
|
||||||
if (oldpotiontype[P_HEAL] && i_get(du->items, oldpotiontype[P_HEAL]->itype) > 0 && !fval(&df->person[dt.index], FL_HEALING_USED)) {
|
if ((get_effect(du, oldpotiontype[P_HEAL]) || i_get(du->items, oldpotiontype[P_HEAL]->itype) > 0)) {
|
||||||
i_change(&du->items, oldpotiontype[P_HEAL]->itype, -1);
|
if (get_effect(du, oldpotiontype[P_HEAL]))
|
||||||
message *m = msg_message("battle::potionsave", "unit", du);
|
change_effect(du, oldpotiontype[P_HEAL], -1);
|
||||||
message_faction(b, du->faction, m);
|
else
|
||||||
msg_release(m);
|
i_change(&du->items, oldpotiontype[P_HEAL]->itype, -1);
|
||||||
fset(&df->person[dt.index], FL_HEALING_USED);
|
message *m = msg_message("battle::potionsave", "unit", du);
|
||||||
df->person[dt.index].hp = u_race(du)->hitpoints*5;
|
message_faction(b, du->faction, m);
|
||||||
return false;
|
msg_release(m);
|
||||||
|
fset(&df->person[dt.index], FL_HEALING_USED);
|
||||||
|
df->person[dt.index].hp = u_race(du)->hitpoints * 5; /* give the person a buffer */
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
++at.fighter->kills;
|
++at.fighter->kills;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue