hero-as-gremlin enhancements

When hero is poly'd into a gremlin, using #monster at a fountain
location will clone a gremlin pet.  Do the same at a pool location
(might not match the movie but if not, most likely because the
situation never came up).  Also, do the same for #sit at either
fountain or pool.
This commit is contained in:
PatR
2024-09-25 01:19:07 -07:00
parent 2471306112
commit f5d889852b
2 changed files with 21 additions and 5 deletions

View File

@@ -915,8 +915,13 @@ domonability(void)
if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
if (split_mon(&gy.youmonst, (struct monst *) 0))
dryup(u.ux, u.uy, TRUE);
} else
} else if (is_pool(u.ux, u.uy)) {
/* is_pool: might be wearing water walking boots or amulet of
magical breathing */
(void) split_mon(&gy.youmonst, (struct monst *) 0);
} else {
There("is no fountain here.");
}
} else if (is_unicorn(uptr)) {
use_unicorn_horn((struct obj **) 0);
return ECMD_TIME;

View File

@@ -297,6 +297,9 @@ dosit(void)
return ECMD_OK;
} else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */
goto in_water;
} else if (Upolyd && u.umonnum == PM_GREMLIN
&& (levl[u.ux][u.uy].typ == FOUNTAIN || is_pool(u.ux, u.uy))) {
goto in_water;
}
if (OBJ_AT(u.ux, u.uy)
@@ -373,10 +376,18 @@ dosit(void)
} else if (is_pool(u.ux, u.uy) && !eggs_in_water(gy.youmonst.data)) {
in_water:
You("sit in the %s.", hliquid("water"));
if (!rn2(10) && uarm)
(void) water_damage(uarm, "armor", TRUE);
if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
(void) water_damage(uarm, "armor", TRUE);
if (Upolyd && u.umonnum == PM_GREMLIN) {
if (split_mon(&gy.youmonst, (struct monst *) 0)) {
if (levl[u.ux][u.uy].typ == FOUNTAIN)
dryup(u.ux, u.uy, TRUE);
}
/* splitting--or failing to do so--protects gear from the water */
} else {
if (!rn2(10) && uarm)
(void) water_damage(uarm, "armor", TRUE);
if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS)
(void) water_damage(uarm, "armor", TRUE);
}
} else if (IS_SINK(typ)) {
You(sit_message, defsyms[S_sink].explanation);
Your("%s gets wet.",