Files
nethack/include
copperwater dad1c3f8b7 Fix: breathless monsters always generate in water in special levels
... unless explicitly specified to generate at a specific point or
within a specific area. But if they are permitted to generate anywhere
on the level, and it contains water, they always end up in the water. I
noticed this when trying to explicitly specify ghouls to generate
anywhere on a level with a minimal amount of water.

This was due to the definition of "amphibious" being conflated with
"breathless", such that all breathless monsters counted as amphibious.
There are plenty of breathless monsters in the game that decidedly don't
normally inhabit water, such as undead, but they would pass the
amphibious() check in pm_to_humidity and thus the game decides that they
must generate in wet terrain if there is any available.

This fix takes the approach of changing amphibious() so that it no
longer checks the M1_BREATHLESS flag and only considers M1_AMPHIBIOUS,
then updating the places where amphibious() and Amphibious are used
accordingly. I also added a new macro cant_drown() which wraps up
swimming, amphibiousness, and breathlessness because these three things
are frequently checked together in the context of whether something
should drown.

Places where amphibious() or Amphibious did NOT have an extra
breathless() or Breathless check added on, and thus where behavior has
been changed:
- The pm_to_humidity function (to fix the bug).
- Player vs water in goodpos; it didn't seem like being polymorphed into
  a breathless non-amphibious monster should make it fair game to
  randomly teleport into water even though it's technically safe.
- Awarding extra experience when killing an eel. (So the hero will get
  the extra experience if they are polymorphed into a breathless
  non-amphibious monster and don't have magical breathing. Very much an
  edge case.)
2023-04-16 09:57:41 +03:00
..
2022-02-04 11:01:20 -05:00
2022-03-13 13:58:56 -07:00
2022-11-29 21:53:21 -05:00
2022-07-19 21:23:26 +03:00
2022-07-19 21:23:26 +03:00
2022-11-29 21:53:21 -05:00
2022-10-30 16:08:14 -04:00
2023-03-04 11:02:06 +02:00
2022-06-30 23:48:18 -04:00
2023-03-01 14:00:29 +02:00
2023-03-16 22:27:01 -04:00
2021-01-26 21:06:16 -05:00
2023-03-01 14:00:29 +02:00
2022-08-23 23:27:21 +03:00
2023-04-06 01:56:08 -07:00
2022-07-01 08:36:03 -04:00
2022-03-11 07:33:28 -05:00
2022-06-19 02:30:45 -07:00
2022-11-29 21:53:21 -05:00
2022-11-29 21:53:21 -05:00
2023-02-25 07:02:19 -08:00
2023-02-25 07:02:19 -08:00
2023-03-16 22:27:01 -04:00
2023-01-12 14:54:05 -08:00
2023-02-07 16:47:42 -08:00
2023-04-11 13:23:30 +03:00
2023-04-11 14:21:06 +03:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2023-03-17 20:13:32 +02:00
2023-02-28 16:15:56 -05:00
2022-07-23 23:11:13 -07:00
2023-02-25 18:05:09 +02:00
2022-11-29 21:53:21 -05:00
2022-12-10 12:27:18 -05:00
2022-12-10 12:27:18 -05:00
2020-08-12 16:15:28 -07:00
2022-10-26 14:21:23 -04:00
2022-12-06 00:49:52 -08:00
2022-11-29 21:53:21 -05:00
2022-06-30 23:48:18 -04:00
2022-10-26 14:21:23 -04:00
2022-10-26 14:21:23 -04:00
2023-04-11 14:21:06 +03:00
2023-04-11 13:23:30 +03:00