use up old potion effects

This commit is contained in:
Steffen Mecke 2016-06-13 09:25:08 +02:00
parent afdd20c4dd
commit e6907f570e
1 changed files with 13 additions and 9 deletions

View File

@ -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;