Files
nethack/doc
copperwater 2d4f9893ad Enable more ways to specify monster inventory in special levels
This originated with a bug in NerfHack in which the developer specified
an inventory for a quest nemesis, but neglected to include the Bell of
Opening in it. Since monsters' inventory contents from makemon() were
tossed out completely, this caused a situation where the Bell was
deleted and the game was unwinnable. The first part of this change is
guarding against that by adding mdrop_special_objs before discarding the
inventory. This does create a possibility where if the programmer *does*
specify a nemesis get the Bell item in their inventory, while neglecting
to remove its special case generation in makemon.c, it would generate
twice - but two Bells is better than none.

Working on that fix led me to think about a limitation of the current
sp_lev.c behavior. You could either have a monster generate with its
species-typical inventory by not specifying an inventory for it, or you
could have it generate with custom inventory but then have to use that
to clumsily reproduce the normal inventory's complex chances and
conditionals in mongets(). So the remainder of this commit implements
another flag for des.monster(), keep_default_invent, that allows for
more flexibility in two ways:

1. When des.monster() contains an inventory function and
   keep_default_invent is true, the monster will retain everything it
   gets from makemon() and the objects in the inventory function are in
   ADDITION to those. This is useful for augmenting a monster's default
   kit with something to make them more threatening, or just more loot.
2. When des.monster contains no inventory function and
   keep_default_invent is false, the monster will get NO inventory even
   if its species is normally supposed to. I'm not sure where exactly
   this would be used, but it doesn't hurt to have it available.

When keep_default_invent is not specified at all, the behavior remains
the same as it is now - if inventory is provided, default items are
discarded, and if not, they are kept.
2025-01-02 08:07:50 +02:00
..
2024-12-25 20:23:00 -05:00
2022-06-18 10:29:15 -04:00
2024-02-28 20:15:56 -08:00
2024-12-27 18:17:49 -05:00
2024-12-26 17:34:18 -05:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2022-01-29 22:57:22 -05:00
2024-02-28 20:15:56 -08:00
2024-12-26 17:34:18 -05:00
2024-12-26 17:34:18 -05:00
2018-11-11 10:29:52 -05:00
2024-12-24 13:41:17 -05:00
2024-12-31 17:15:11 -05:00
2024-12-26 17:34:18 -05:00
2024-02-28 20:15:56 -08:00
2024-12-26 17:34:18 -05:00
2024-03-19 18:59:23 +02:00