Source Code Cleanup

Cleanup TODO list – please extend. See also mantis category Source Cleanup.

  • Move all radius_iterator to new and more explicit constructor.
  • newgame.cc: separate character choice from character initialization.
  • Lua:
    • document clua (“client lua”) vs. dlua (“dungeon lua”)
    • make clua and dlua initialization more similar
    • reduce duplication in cluautil.h
  • Check calls to viewwindow for whether they're needed at all, and set second argument explicitly.
  • Clarify field overloading in item_def. A start would be to replace item_def::plus by a union with members short plus, short charge, monster_type corpsemon.
  • The weight / 150 conversion to determine how many chunks a corpse gives is used in 5 or so different places; it seems like this should be consolidated into one single function.
  • Merge all mimic types into a single monster (allowing any kind of item, including gold) to get rid of all the special cases.
  • Rename the you.demon_pow –> you.innate_mutations.
  • The section that has HP/MP bars, stats etc is referred as “hud” in the code; it's not a heads-up display. Suggestion: “stats”
  • RLtiles: Add a parameter to control whether tilesets' variant tile selection should be fixed, random, or ordered, and use that rather than the current hardcoded checks and assumptions.
  • move functions that pass a specific enum as “int” to pass the actual type (done for skill_type).
  • mege duplicate code from up_stairs and down_stairs in a change_level function. Probably also add a portal function.
  • Consolidate the code that assigns abilities to slots, clears abilities from slots, and attempts to reserve certain slots for god abilities, and make it all handle placeholders properly. Currently, the code is partially duplicated across several functions (abl-show.cc's _set_god_ability_helper, set_god_ability_slots, and find_ability_slot).
<galehar> well, there a plenty of stuff in monster enchantment that are not enchantments, but just a temporary status
 maybe we should just rename the thing
<Zannick> haha, i didn't consider that
 that's probably a better idea
<galehar> the underlying mechanism is good
 and less work ;)
<due> Zannick: Actually ,the solution is to just rename ENCH_XXX to "monster_durations".
 There are visibly external durations (such as slow, status effects, etc), and invisible internal durations (timers and so-on).
 Implementing another set of decaying attributes would be costly and duplicative when you already have a perfectly good framework in place.
<galehar> but if something is both in the monster and the player classes, shouldn't we move it to the actor class?
<due> galehar: Yes, that's also a good move.
 galehar: Unify ENCH and DUR. We can still have player-specific and monster-specific.''

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

—-

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