Pyrolisk eggs explode when broken

This commit is contained in:
Pasi Kallinen
2024-06-02 10:50:58 +03:00
parent d8aa4c0b1f
commit 2bec685bae
6 changed files with 34 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ staticfn void start_tin(struct obj *);
staticfn int eatcorpse(struct obj *);
staticfn void start_eating(struct obj *, boolean);
staticfn void garlic_breath(struct monst *);
staticfn void fprefx(struct obj *);
staticfn boolean fprefx(struct obj *);
staticfn void fpostfx(struct obj *);
staticfn int bite(void);
staticfn int edibility_prompts(struct obj *);
@@ -2020,11 +2020,19 @@ garlic_breath(struct monst *mtmp)
* marked it 'partly eaten'. Used for non-rotten non-tin non-corpse food.
* Messages should use present tense since multi-turn food won't be
* finishing at the time they're issued.
* Returns FALSE if eating should not succeed for whatever reason.
*/
staticfn void
staticfn boolean
fprefx(struct obj *otmp)
{
switch (otmp->otyp) {
case EGG:
if (otmp->corpsenm == PM_PYROLISK) {
useup(otmp);
explode(u.ux, u.uy, -11, d(3, 6), 0, EXPL_FIERY);
return FALSE;
}
break;
case FOOD_RATION: /* nutrition 800 */
/* 200+800 remains below 1000+1, the satiation threshold */
if (u.uhunger <= 200)
@@ -2127,6 +2135,7 @@ fprefx(struct obj *otmp)
}
break; /* default */
} /* switch */
return TRUE;
}
/* increment a combat intrinsic with limits on its growth */
@@ -2946,7 +2955,10 @@ doeat(void)
}
consume_oeaten(otmp, 1); /* oeaten >>= 1 */
} else if (!already_partly_eaten) {
fprefx(otmp);
if (!fprefx(otmp)) {
do_reset_eat();
return ECMD_TIME;
}
} else {
You("%s %s.",
(gc.context.victual.reqtime == 1) ? "eat" : "begin eating",