This shows you the differences between two versions of the page.

Link to this comparison view

dcss:brainstorm:internal:source_cleanup [2011-12-22 17:55]
dcss:brainstorm:internal:source_cleanup [2012-01-26 09:40] (current)
Flaming Corpse too many hardcoded resistances & flags
Line 33: Line 33:
    galehar: Unify ENCH and DUR. We can still have player-specific and monster-specific.''    galehar: Unify ENCH and DUR. We can still have player-specific and monster-specific.''
  --- //[[user:galehar]] 2011-01-08 01:21//  --- //[[user:galehar]] 2011-01-08 01:21//
 +  * Move as many checks for resistances, flags, etc. as possible out of hardcoded areas and into mon-data.h and related files.  For instance, undead poison resistance is implemented in mon-util.cc get_mons_resists().  Wind resistance is in mon-util.cc mons_class_res_wind(), which singles out MONS_AIR_ELEMENTAL, MONS_BALL_LIGHTNING, and MONS_TWISTER.  Most other resistances are in monster.cc, such as monster::res_negative_energy() (where MONS_SHADOW_DRAGON is singled out as the single natural monster with it).  mon_util.cc mons_class_flattens_trees() returns true for MONS_LERNAEAN_HYDRA; this could be a flag in the datafile.  MONS_GHOST_DEMON serves as an example of a base class for determining common flags & resistances for several monsters (though the specified monsters are again hardcoded in mon_util.cc mons_is_ghost_demon(), and its implementation is pretty convoluted).
 ----{{tag>dcss:implement}} ----{{tag>dcss:implement}}
Logged in as: Anonymous (VIEWER)
dcss/brainstorm/internal/source_cleanup.txt · Last modified: 2012-01-26 09:40 by Flaming Corpse
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki