Use function for combined str/hp loss from poison
Since losestr and losehp calls go together most of the time, this feels like it probably makes more sense than repeating the killer name/format twice in a row all over the place.
This commit is contained in:
@@ -1815,9 +1815,9 @@ eatcorpse(struct obj *otmp)
|
||||
tp++;
|
||||
pline("Ecch - that must have been poisonous!");
|
||||
if (!Poison_resistance) {
|
||||
const char *knam = !glob ? "poisonous corpse" : "poisonous glob";
|
||||
losestr(rnd(4), knam, KILLED_BY_AN);
|
||||
losehp(rnd(15), knam, KILLED_BY_AN);
|
||||
poison_strdmg(rnd(4), rnd(15),
|
||||
!glob ? "poisonous corpse" : "poisonous glob",
|
||||
KILLED_BY_AN);
|
||||
} else
|
||||
You("seem unaffected by the poison.");
|
||||
|
||||
@@ -2753,9 +2753,7 @@ doeat(void)
|
||||
if (otmp->oclass == WEAPON_CLASS && otmp->opoisoned) {
|
||||
pline("Ecch - that must have been poisonous!");
|
||||
if (!Poison_resistance) {
|
||||
const char *knam = xname(otmp);
|
||||
losestr(rnd(4), knam, KILLED_BY_AN);
|
||||
losehp(rnd(15), knam, KILLED_BY_AN);
|
||||
poison_strdmg(rnd(4), rnd(15), xname(otmp), KILLED_BY_AN);
|
||||
} else
|
||||
You("seem unaffected by the poison.");
|
||||
} else if (!nodelicious) {
|
||||
|
||||
Reference in New Issue
Block a user