Opened 10 years ago

Last modified 6 years ago

#1317 new change

Remove hard-coded dependence on monster display characters

Reported by: GabeCunningham Owned by:
Milestone: Future Keywords: dungeon monster

Description (last modified by nckmccnnll)

In generate.c, some of the monster pits / nests use flags to restrict the type of creatures (such as undead pits and pits of animals), whereas others check the display character (such as jelly pits and orc pits). For jelly pits, there's currently no better way, but orcs, trolls, etc all have a race flag anyway. Is there a reason why we don't just use that?

In fact, it might be nice for (almost) every monster to have a race or multiple races. Instead of handling it with flags, we could have each monster kind also store its race(s), which would then be used for slays, building pits, etc.

Change History (3)

comment:1 Changed 10 years ago by GabeCunningham

  • Summary changed from Make monster pits / nests depend on flags, not display characters to Remove hard-coded dependence on monster display characters

Here are the places where we have a hardcoded dependence on monster display characters:

  1. Monster nest/pit generation
  2. monster_is_unusual (used for determining whether a monster is "killed" or "destroyed")
  3. message_pain (does a monster shriek, scream, squelch when hit?)
  4. ident_info (used for the knowledge screen)
  5. Summons

comment:2 Changed 9 years ago by GabeCunningham

1-3 above are now independent of display symbol. 4 is independent of display symbol, but still needs some work (see lookup_symbol in cmd3). 5 is independent of display symbol, but uses hardcoded references to monster templates. Ideally, monster summons should be in a user-editable file.

comment:3 Changed 6 years ago by nckmccnnll

  • Description modified (diff)

Summons are all in list-summon-types.h now, I'm not sure about the knowledge screens

Note: See TracTickets for help on using tickets.