Module monster

Monster information.

Functions

get_monster_at (x, y) Get information about a monster at a cell.

Class monster.info

monster.info:attitude () The monster's current attitude.
monster.info:base_type () Monster base type as in monster_type.h.
monster.info:can_be_constricted () Can this monster be constricted?
monster.info:colour () Monster glyph colour.
monster.info:damage_desc () Get a string describing how injured this monster is.
monster.info:damage_level () How hurt is this monster?
monster.info:desc () A description of this monster.
monster.info:has_ranged_attack () Does this monster have a ranged attack we know about?
monster.info:holiness ([holiness]) Get the monster's holiness.
monster.info:is (flagname) Test a monster flag.
monster.info:is_caught () Is the monster caught in something?
monster.info:is_constricted () Is the monster constricted?
monster.info:is_constricting () Is the monster constricting something?
monster.info:is_constricting_you () Is the monster constricting you in particular?
monster.info:is_firewood () Is this monster firewood.
monster.info:is_safe () Is this monster safe by default?
monster.info:is_stationary () Can this monster move?
monster.info:is_unique () Is this monster a unique?
monster.info:mname () Simple monster name.
monster.info:name () The monster's full name.
monster.info:number () Monster number field.
monster.info:pos () The x,y coordinates of the monster in player centered coordinates.
monster.info:reach_range () How far can the monster reach with their melee weapon?
monster.info:res_cold () Does the monster resist cold?
monster.info:res_corr () Does the monster resist corrosion?
monster.info:res_draining () Does the monster resist negative energy?
monster.info:res_fire () Does the monster resist fire?
monster.info:res_shock () Does the monster resist electricity?
monster.info:speed_description () A string describing monster speed.
monster.info:spells () Get the monster's possible spells.
monster.info:stabbability () What quality of stab can you get on this monster?
monster.info:status ([statusname]) What statuses is this monster under?
monster.info:threat () The monster's threat level.
monster.info:type () Monster type enum value as in monster_type.h.
monster.info:x_pos () The monster's x coordinate in player centered coordinates.
monster.info:y_pos () The monster's y coordinate in player centered coordinates.


Functions

get_monster_at (x, y)
Get information about a monster at a cell. Returns a monster.info object of a monster at the specified coordinates. Uses player coordinates

Parameters:

  • x int
  • y int

Returns:

    monster.info or nil

Class monster.info

Monster information class.
monster.info:attitude ()

The monster's current attitude. A numerical value representing the monster's attitude. Possible values:

  • 0 hostile
  • 1 neutral
  • 2 strict neutral (neutral but won't attack the player)
  • 3 good neutral (neutral but won't attack friendlies)
  • 4 friendly (created friendly, not enslavement)

Returns:

    int
monster.info:base_type ()
Monster base type as in monster_type.h.

Returns:

    int
monster.info:can_be_constricted ()
Can this monster be constricted?

Returns:

    boolean
monster.info:colour ()
Monster glyph colour. Return is a crawl colour number.

Returns:

    int
monster.info:damage_desc ()
Get a string describing how injured this monster is.

Returns:

    string
monster.info:damage_level ()
How hurt is this monster? Numeric representation of the level of damage sustained by the monster. Return value ranges from 0 (full HP) to 6 (dead).

Returns:

    boolean
monster.info:desc ()
A description of this monster.

Returns:

    string
monster.info:has_ranged_attack ()
Does this monster have a ranged attack we know about? This refers to ranged weapons. Ranged spells and abilities are not included in this check.

Returns:

    boolean
monster.info:holiness ([holiness])
Get the monster's holiness. If passed a holiness, returns a boolean test of whether the monster has the given holiness. Otherwise returns a string describing the monster's holiness.

Possible holinesses: "holy", "natural", "undead", "demonic", "nonliving", "plant", "evil". Evil is a pseudo-holiness given to natural, nonliving, or plant monsters that are hated by the good gods for the spells they cast or gods they worship.

Parameters:

  • holiness string (optional)

Returns:

    string or boolean
monster.info:is (flagname)
Test a monster flag. Check if a monster has a flag set. See mi-flag.h for a list of flags.

Parameters:

  • flagname string

Returns:

    boolean
monster.info:is_caught ()
Is the monster caught in something? Tests for nets or webs.

Returns:

    boolean
monster.info:is_constricted ()
Is the monster constricted?

Returns:

    boolean
monster.info:is_constricting ()
Is the monster constricting something?

Returns:

    boolean
monster.info:is_constricting_you ()
Is the monster constricting you in particular?

Returns:

    boolean
monster.info:is_firewood ()
Is this monster firewood. Plants and fungi. Immobile things that give no exp.

Returns:

    boolean
monster.info:is_safe ()
Is this monster safe by default? Check if this monster is thought of as safe by crawl internally. Does not check Hooks.ch_mon_is_safe, so this can be used there without causing an infinite loop.

Returns:

    boolean
monster.info:is_stationary ()
Can this monster move?

Returns:

    boolean
monster.info:is_unique ()
Is this monster a unique?

Returns:

    boolean
monster.info:mname ()
Simple monster name. Returns the name of the monster.

Returns:

    string

See also:

monster.info:name ()
The monster's full name. Includes any vault defined names, the uniques name, name changes induced by polymorph, &c.

Returns:

    string

See also:

monster.info:number ()
Monster number field. Contains hydra heads or slime size. Meaningless for all others.

Returns:

    int
monster.info:pos ()
The x,y coordinates of the monster in player centered coordinates.

Returns:

  1. int
  2. int
monster.info:reach_range ()
How far can the monster reach with their melee weapon?

Returns:

    int
monster.info:res_cold ()
Does the monster resist cold? Returns a value ranging from -1 (vulnerable) to 3 (immune).

Returns:

    int resistance level
monster.info:res_corr ()
Does the monster resist corrosion? Returns a value ranging from -1 (vulnerable) to 3 (immune).

Returns:

    int resistance level
monster.info:res_draining ()
Does the monster resist negative energy? Returns a value ranging from -1 (vulnerable) to 3 (immune).

Returns:

    int resistance level
monster.info:res_fire ()
Does the monster resist fire? Returns a value ranging from -1 (vulnerable) to 3 (immune).

Returns:

    int resistance level
monster.info:res_shock ()
Does the monster resist electricity? Returns a value ranging from -1 (vulnerable) to 3 (immune).

Returns:

    int resistance level
monster.info:speed_description ()
A string describing monster speed. Possible values are: "very slow", "slow", "normal", "fast", "very fast", and "extremely fast".

Returns:

    string
monster.info:spells ()
Get the monster's possible spells. Returns a list of the monster's possible spellbooks. Each spellbook is given as a list of spell names.

Returns:

    array
monster.info:stabbability ()

What quality of stab can you get on this monster? The return value is a number representing the percentage of a top-tier stab you can currently get by attacking the monster. Possible values are:

  • 1.0 Sleep and paralysis stabs.
  • 0.5 Net, web, and petrification stabs.
  • 0.25 Confusion, fear, and invisibility stabs.
  • 0.166666666 Distraction stabs.
  • 0.0 No stab bonus.

Returns:

    number
monster.info:status ([statusname])
What statuses is this monster under? If passed a string parameter, returns a boolean indicating if the monster has that status. Otherwise returns a comma separated string with all the statuses the monster has.

Parameters:

  • statusname string (optional)

Returns:

    string or boolean
monster.info:threat ()

The monster's threat level. A numeric representation of the the threat level in the monster list.

  • 0 dark grey threat (trivial)
  • 1 light grey threat (easy)
  • 2 yellow threat (dangerous)
  • 3 red threat (extremely dangerous)

Returns:

    int
monster.info:type ()
Monster type enum value as in monster_type.h.

Returns:

    int
monster.info:x_pos ()
The monster's x coordinate in player centered coordinates.

Returns:

    int
monster.info:y_pos ()
The monster's y coordinate in player centered coordinates.

Returns:

    int
generated by LDoc 1.4.6 Last updated 2018-08-21 11:24:55