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

@@ -2587,6 +2587,7 @@ if hero is punished or tethered to a buried iron ball and has no inventory (or
in the status display so that it will be visible for screenshots or in the status display so that it will be visible for screenshots or
during streaming video during streaming video
'query_menu' option to use a menu when asked certain yes/no questions 'query_menu' option to use a menu when asked certain yes/no questions
pyrolisk eggs explode when broken
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features

View File

@@ -991,6 +991,8 @@ dogfood(struct monst *mon, struct obj *obj)
case ENORMOUS_MEATBALL: case ENORMOUS_MEATBALL:
return carni ? DOGFOOD : MANFOOD; return carni ? DOGFOOD : MANFOOD;
case EGG: case EGG:
if (obj->corpsenm == PM_PYROLISK && !likes_fire(mptr))
return POISON;
return carni ? CADAVER : MANFOOD; return carni ? CADAVER : MANFOOD;
case CORPSE: case CORPSE:
if ((peek_at_iced_corpse_age(obj) + 50L <= gm.moves if ((peek_at_iced_corpse_age(obj) + 50L <= gm.moves

View File

@@ -2438,6 +2438,7 @@ breakobj(
boolean from_invent) boolean from_invent)
{ {
boolean fracture = FALSE; boolean fracture = FALSE;
boolean explosion = FALSE;
if (is_crackable(obj)) /* if erodeproof, erode_obj() will say so */ if (is_crackable(obj)) /* if erodeproof, erode_obj() will say so */
return (erode_obj(obj, armor_simple_name(obj), ERODE_CRACK, return (erode_obj(obj, armor_simple_name(obj), ERODE_CRACK,
@@ -2479,6 +2480,8 @@ breakobj(
/* breaking your own eggs is bad luck */ /* breaking your own eggs is bad luck */
if (hero_caused && obj->spe && ismnum(obj->corpsenm)) if (hero_caused && obj->spe && ismnum(obj->corpsenm))
change_luck((schar) -min(obj->quan, 5L)); change_luck((schar) -min(obj->quan, 5L));
if (obj->corpsenm == PM_PYROLISK)
explosion = TRUE;
break; break;
case BOULDER: case BOULDER:
case STATUE: case STATUE:
@@ -2519,6 +2522,8 @@ breakobj(
} }
if (!fracture) if (!fracture)
delobj(obj); delobj(obj);
if (explosion)
explode(x, y, -11, d(3, 6), 0, EXPL_FIERY);
return 1; return 1;
} }

View File

@@ -28,7 +28,7 @@ staticfn void start_tin(struct obj *);
staticfn int eatcorpse(struct obj *); staticfn int eatcorpse(struct obj *);
staticfn void start_eating(struct obj *, boolean); staticfn void start_eating(struct obj *, boolean);
staticfn void garlic_breath(struct monst *); staticfn void garlic_breath(struct monst *);
staticfn void fprefx(struct obj *); staticfn boolean fprefx(struct obj *);
staticfn void fpostfx(struct obj *); staticfn void fpostfx(struct obj *);
staticfn int bite(void); staticfn int bite(void);
staticfn int edibility_prompts(struct obj *); 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. * 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 * Messages should use present tense since multi-turn food won't be
* finishing at the time they're issued. * 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) fprefx(struct obj *otmp)
{ {
switch (otmp->otyp) { 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 */ case FOOD_RATION: /* nutrition 800 */
/* 200+800 remains below 1000+1, the satiation threshold */ /* 200+800 remains below 1000+1, the satiation threshold */
if (u.uhunger <= 200) if (u.uhunger <= 200)
@@ -2127,6 +2135,7 @@ fprefx(struct obj *otmp)
} }
break; /* default */ break; /* default */
} /* switch */ } /* switch */
return TRUE;
} }
/* increment a combat intrinsic with limits on its growth */ /* increment a combat intrinsic with limits on its growth */
@@ -2946,7 +2955,10 @@ doeat(void)
} }
consume_oeaten(otmp, 1); /* oeaten >>= 1 */ consume_oeaten(otmp, 1); /* oeaten >>= 1 */
} else if (!already_partly_eaten) { } else if (!already_partly_eaten) {
fprefx(otmp); if (!fprefx(otmp)) {
do_reset_eat();
return ECMD_TIME;
}
} else { } else {
You("%s %s.", You("%s %s.",
(gc.context.victual.reqtime == 1) ? "eat" : "begin eating", (gc.context.victual.reqtime == 1) ? "eat" : "begin eating",

View File

@@ -1402,6 +1402,8 @@ m_consume_obj(struct monst *mtmp, struct obj *otmp)
mcureblindness(mtmp, canseemon(mtmp)); mcureblindness(mtmp, canseemon(mtmp));
if (ispet && deadmimic) if (ispet && deadmimic)
quickmimic(mtmp); quickmimic(mtmp);
if (otmp->otyp == EGG && corpsenm == PM_PYROLISK)
explode(mtmp->mx, mtmp->my, -11, d(3, 6), 0, EXPL_FIERY);
if (corpsenm != NON_PM) if (corpsenm != NON_PM)
mon_givit(mtmp, &mons[corpsenm]); mon_givit(mtmp, &mons[corpsenm]);
} }
@@ -1729,6 +1731,9 @@ mon_givit(struct monst *mtmp, struct permonst *ptr)
int prop = corpse_intrinsic(ptr); int prop = corpse_intrinsic(ptr);
boolean vis = canseemon(mtmp); boolean vis = canseemon(mtmp);
if (DEADMONSTER(mtmp))
return;
if (ptr == &mons[PM_STALKER]) { if (ptr == &mons[PM_STALKER]) {
/* /*
* Invisible stalker isn't flagged as conferring invisibility * Invisible stalker isn't flagged as conferring invisibility

View File

@@ -1212,6 +1212,12 @@ hmon_hitmon_misc_obj(
obj->owt = weight(obj); obj->owt = weight(obj);
if (hmd->thrown) if (hmd->thrown)
place_object(obj, mon->mx, mon->my); place_object(obj, mon->mx, mon->my);
} else if (obj->corpsenm == PM_PYROLISK) {
useup_eggs(obj);
explode(mon->mx, mon->my, -11, d(3, 6), 0, EXPL_FIERY);
hmd->doreturn = TRUE;
hmd->retval = !DEADMONSTER(mon);
return;
} else { } else {
pline("Splat!"); pline("Splat!");
useup_eggs(obj); useup_eggs(obj);