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.
This commit is contained in:
nhmall
2019-02-26 19:49:24 -05:00
parent 5a432d0c97
commit be3092bed4
4 changed files with 24 additions and 6 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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 */

View File

@@ -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);