Difference between revisions of "Monster attributes"

From CrawlWiki
Jump to: navigation, search
(Update to 0.23; replace develz.org links that no longer work with GitHub links)
(Update to 0.26)
 
Line 1: Line 1:
{{version023}}
+
{{version026}}
 
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.
 
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 [https://github.com/crawl/crawl/blob/stone_soup-0.23/crawl-ref/source/mon-data.h mon-data.h] file in the ''Crawl'' [[source code]], in the following format:
+
Most of the attributes for each individual monster are stored in the [https://github.com/crawl/crawl/blob/stone_soup-0.26/crawl-ref/source/mon-data.h mon-data.h] file in the ''Crawl'' [[source code]], in the following format:
  
 
  row 1: monster id, display character, display colour, name
 
  row 1: monster id, display character, display colour, name
 
  row 2: monster flags
 
  row 2: monster flags
 
  row 3: monster resistance flags
 
  row 3: monster resistance flags
  row 4: experience modifier, genus, species, holiness, resist magic
+
  row 4: experience modifier, genus, species, holiness, willpower
 
  row 5: damage for each of four attacks
 
  row 5: damage for each of four attacks
 
  row 6: hit dice, hit points
 
  row 6: hit dice, hit points
  row 7: AC, evasion, spells, corpse effect, shouts
+
  row 7: AC, evasion, spells, corpse, shouts
 
  row 8: intel, habitat, speed, energy_usage
 
  row 8: intel, habitat, speed, energy_usage
 
  row 9: gmon_use class, body size, body shape
 
  row 9: gmon_use class, body size, body shape
 
  row 10: tile, corpse
 
  row 10: tile, corpse
  
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 [https://github.com/crawl/crawl/blob/stone_soup-0.23/crawl-ref/source/monster.cc monster.cc]:
+
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 [https://github.com/crawl/crawl/blob/stone_soup-0.26/crawl-ref/source/monster.cc monster.cc]:
  
 
  int monster::res_negative_energy(bool intrinsic_only) const
 
  int monster::res_negative_energy(bool intrinsic_only) const
Line 26: Line 26:
  
 
The above means "if the monster is not [[natural]], it has 3 levels of negative energy resistance".
 
The above means "if the monster is not [[natural]], 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 butcher.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|*]]

Latest revision as of 14:48, 12 May 2021

Version 0.26: This article may not be up to date for the latest stable release of Crawl.

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: experience modifier, genus, species, holiness, willpower
row 5: damage for each of four attacks
row 6: hit dice, hit points
row 7: AC, evasion, spells, corpse, shouts
row 8: intel, habitat, speed, energy_usage
row 9: gmon_use class, body size, body shape
row 10: tile, corpse

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(bool intrinsic_only) const
{
    // If you change this, also change get_mons_resists.
    if (!(holiness() & MH_NATURAL))
        return 3;
    [additional checks for items w/ resistance]
}

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

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