Difference between revisions of "Monster attributes"

From CrawlWiki
Jump to: navigation, search
m (1 revision: monster attributes)
Line 27: Line 27:
 
The above means "if the monster is not [[natural]] or a [[shadow dragon]], it has 3 levels of negative energy resistance".
 
The above means "if the monster is not [[natural]] or a [[shadow dragon]], it has 3 levels of negative energy resistance".
  
The maximum number of chunks a monster can leave is mass/150 (rounded down).
+
If you want to know the maximum number of chunks a monster can leave, take a look at the function turn_corpse_into_chunks which can be found in misc.cc
  
 
See [[:Category:Monster attributes]] for documentation of various attributes and lists of monsters with specific attributes.
 
See [[:Category:Monster attributes]] for documentation of various attributes and lists of monsters with specific attributes.
  
 
[[Category:Monster attributes|*]]
 
[[Category:Monster attributes|*]]

Revision as of 20:22, 10 May 2013

All monsters have different attributes. These attributes govern every aspect of how the monster functions in-game – the monster's behavior, its toughness in combat, its special abilities, its resistances and vulnerabilities, and its general stats.

Most of the attributes for each individual monster are stored in the mon-data.h file in the Crawl source code, in the following format:

row 1: monster id, display character, display colour, name
row 2: monster flags
row 3: monster resistance flags
row 4: mass, experience modifier, genus, species, holiness, resist magic
row 5: damage for each of four attacks
row 6: hit dice, described by four parameters
row 7: AC, evasion, sec(spell), corpse_thingy, zombie size, shouts
row 8: intel, habitat, flight class, speed, energy_usage
row 9: gmon_use class, gmon_eat class, body size

Many other monster properties are hardcoded into other parts of the source. For instance, negative energy resistance is not one of the "resistance flags" in mon-data; it is in monster.cc:

int monster::res_negative_energy() const
{
    if (holiness() != MH_NATURAL
        || type == MONS_SHADOW_DRAGON)
    {
        return (3);
    }
    [additional checks for items w/ resistance]
}

The above means "if the monster is not natural or a shadow dragon, it has 3 levels of negative energy resistance".

If you want to know the maximum number of chunks a monster can leave, take a look at the function turn_corpse_into_chunks which can be found in misc.cc

See Category:Monster attributes for documentation of various attributes and lists of monsters with specific attributes.