From be3092bed480c600ee5c003914007359221fa0cb Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 26 Feb 2019 19:49:24 -0500 Subject: [PATCH] some fish should lay their eggs in the water rather than on land Generally, fish should lay their eggs in the water and not on land, but the game was only allowing the opposite. Eels are catadromous and lay their eggs in the Sargasso Sea, not in the dungeon. --- doc/fixes36.2 | 1 + include/mondata.h | 2 ++ src/polyself.c | 8 ++++++-- src/sit.c | 19 +++++++++++++++---- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/doc/fixes36.2 b/doc/fixes36.2 index e7524f32a..846fc9c51 100644 --- a/doc/fixes36.2 +++ b/doc/fixes36.2 @@ -384,6 +384,7 @@ persistent inventory window would show "(being worn)" for armor that was in the midst of being put on or taken off; it is 'partly worn' in such circumstances so "being worn" could be misleading toggling perm_invent on didn't immediately show persistent inventory window +some fish should lay their eggs in the water rather than on land Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository diff --git a/include/mondata.h b/include/mondata.h index d8c3511b2..41b5f70f4 100644 --- a/include/mondata.h +++ b/include/mondata.h @@ -71,6 +71,8 @@ #define slimeproof(ptr) \ ((ptr) == &mons[PM_GREEN_SLIME] || flaming(ptr) || noncorporeal(ptr)) #define lays_eggs(ptr) (((ptr)->mflags1 & M1_OVIPAROUS) != 0L) +#define eggs_in_water(ptr) \ + (lays_eggs(ptr) && (ptr)->mlet == S_EEL && is_swimmer(ptr)) #define regenerates(ptr) (((ptr)->mflags1 & M1_REGEN) != 0L) #define perceives(ptr) (((ptr)->mflags1 & M1_SEE_INVIS) != 0L) #define can_teleport(ptr) (((ptr)->mflags1 & M1_TPORT) != 0L) diff --git a/src/polyself.c b/src/polyself.c index b9e6fa81b..c30ac6583 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -784,8 +784,12 @@ int mntmp; if (is_vampire(youmonst.data)) pline(use_thec, monsterc, "change shape"); - if (lays_eggs(youmonst.data) && flags.female) - pline(use_thec, "sit", "lay an egg"); + if (lays_eggs(youmonst.data) && flags.female && + !(youmonst.data == &mons[PM_GIANT_EEL] + || youmonst.data == &mons[PM_ELECTRIC_EEL])) + pline(use_thec, "sit", + eggs_in_water(youmonst.data) ? + "spawn in the water" : "lay an egg"); } /* you now know what an egg of your type looks like */ diff --git a/src/sit.c b/src/sit.c index 5f85bb13e..09cbc9bf2 100644 --- a/src/sit.c +++ b/src/sit.c @@ -116,12 +116,13 @@ dosit() You("sit down."); dotrap(trap, VIASITTING); } - } else if (Underwater || Is_waterlevel(&u.uz)) { + } else if ((Underwater || Is_waterlevel(&u.uz)) + && !eggs_in_water(youmonst.data)) { if (Is_waterlevel(&u.uz)) There("are no cushions floating nearby."); else You("sit down on the muddy bottom."); - } else if (is_pool(u.ux, u.uy)) { + } else if (is_pool(u.ux, u.uy) && !eggs_in_water(youmonst.data)) { in_water: You("sit in the %s.", hliquid("water")); if (!rn2(10) && uarm) @@ -297,8 +298,18 @@ dosit() } else if (u.uhunger < (int) objects[EGG].oc_nutrition) { You("don't have enough energy to lay an egg."); return 0; + } else if (eggs_in_water(youmonst.data)) { + if (!(Underwater || Is_waterlevel(&u.uz))) { + pline("A splash tetra you are not."); + return 0; + } + if (Upolyd && + (youmonst.data == &mons[PM_GIANT_EEL] + || youmonst.data == &mons[PM_ELECTRIC_EEL])) { + You("yearn for the Sargasso Sea."); + return 0; + } } - uegg = mksobj(EGG, FALSE, FALSE); uegg->spe = 1; uegg->quan = 1L; @@ -306,7 +317,7 @@ dosit() /* this sets hatch timers if appropriate */ set_corpsenm(uegg, egg_type_from_parent(u.umonnum, FALSE)); uegg->known = uegg->dknown = 1; - You("lay an egg."); + You("%s an egg.", eggs_in_water(youmonst.data) ? "spawn" : "lay"); dropy(uegg); stackobj(uegg); morehungry((int) objects[EGG].oc_nutrition);