NAME

NetHack::Monster::Spoiler - information on a type of monster

SYNOPSIS

use NetHack::Monster::Spoiler;

my $s = NetHack::Monster::Spoiler->lookup(glyph => 'A', color => 'magenta');

$s->is_spellcaster;          # returns 'wizard'
$s->name                     # 'Archon'
$s->never_leaves_corpse      # 1
$s->ignores_elbereth         # 1
$s->resists('petrification') # 0

DESCRIPTION

NetHack::Monster::Spoiler is a machine-readable database of information on the various monsters that inhabit the NetHack universe. It is a sort of metaclass of monsters; an instance of NetHack::Monster::Spoiler is associated with each type of monster, so there is one for Archons, one for black puddings, et cetera. The lookup class method allows one to find the correct instance for an observed monster, from which general information can be obtained using accessors.

lookup %ARGS

lookup is used to find instances of NetHack::Monster::Spoiler. It takes an optional named argument for each accessor, and returns only those monsters that match the fields. As a special exception, ANSI color numbers are automatically translated into the correct NetHack colors. Note that there is no munging for name, so in general directly using the return from farlook will do the wrong thing.

Returns all matches in list context; in scalar context it returns an unambiguous result, or undef on failure or ambiguity.

PRIMITIVE ACCESSORS

The following primitive accessors are availiable. Each of them corresponds to one field in the NetHack monster structure, with three exceptions: all breathless monsters get amphibious for free, mimics do not cling to the ceiling, and dwarves do not eat rock.

The return values of resist is a hashref which maps a truth value to each resistance the monster possesses The return value of attacks is an arrayref of hashrefs which describe each of the monster's attack(s) in terms of mode, type, and damage.

absent_from_gehennom
ac
acidic_corpse
alignment
always_hostile
always_peaceful
attacks
can_eat_metal
can_eat_rock
can_fly
can_swim
cannot_pickup_items
clings_to_ceiling
color
corpse_nutrition
extra_nasty
follows_stair_users
food_makes_peaceful
gehennom_exclusive
glyph
has_infravision
has_proper_name
has_teleport_control
has_teleportitis
has_thick_hide
hides_on_ceiling
hides_under_item
hitdice
humanoid_body
ignores_walls
immobile_until_disturbed
immobile_until_seen
infravision_detectable
invalid_polymorph_target
is_always_female
is_always_male
is_amorphous
is_amphibious
is_animal
is_breathless
is_carnivorous
is_demon
is_dwarf
is_elf
is_genderless
is_genocidable
is_giant
is_gnome
is_herbivorous
is_human
is_lycanthrope
is_mercenary
is_mindless
is_minion
is_orc
is_rank_lord
is_rank_prince
is_undead
is_unique
is_very_strong
is_wanderer
lacks_eyes
lacks_hands
lacks_head
lacks_limbs
large_group
lays_eggs
made_of_gas
mr
name
never_drops_corpse
not_randomly_generated
poisonous_corpse
rarity
regenerates_quickly
resist
sees_invisible
serpentine_body
size
small_group
sound
speed
throws_boulders
tunnels_with_pick
wants_amulet
wants_bell
wants_book
wants_candelabrum
wants_gems
wants_gold
wants_magic_items
wants_quest_artifact
wants_wargear
weight

numeric_size :: Int

numeric_size returns a number with the correct ordering properties for the monster's size if called as a method, or translates strings into the same set of numbers if called as a function. The numbers used are the same as NetHack's MZ_XXX defines.

is_rider

Returns true if the monster is one of the three Riders of the Astral Plane^W^WApocalypse.

ignores_elbereth

Returns true if the monster will always ignore Elbereth. Peacefuls, blind monsters, and monsters with special AIs will ignore regardless.

has_attack MODE

Return true if the monster has an attack of the specified mode or type.

is_spellcaster

Return undef if the monster is not a spellcaster. Otherwise return the type of magic used.

resists ELEMENT

Return true if the monster resists the provided element. Supported elements are fire, cold, elec, electricity, acid, petrification, stoning, stone, shock, disintegration, disint, sleep, and poison.

can_float

Return true if the monster is capable of levitation, if not flight.

is_noncorporeal

Return true if the monster is non-corporeal (a ghost or shade).

is_whirly

Return true if the monster is made of whirls of gas, and for instance can be disrupted with slowing.

is_flaming

Return true if the monster is already on fire and cannot be ignited further.

is_telepathic

Return true if the monster is intrinsically telepathic.

uses_weapons

Return true if the monster uses weapons in the wild. If you are polymorphed, you want could_wield, not this.

is_unicorn

Return true (specifically, the 3-letter code for the unicorn's alignment) if this monster is a unicorn.

is_bat

Return true if the current monster is a true bat, not a bird.

is_golem

Return true for golems.

is_verysmall

Return true if this monster is very small (can pass between bars, etc).

is_bigmonst

Return true if this monster is quite large (cannot fit through crevice, etc).

could_wield

Return true if this monster is capable of using weapons. For whether it will use weapons in the wild, see uses_weapons.

could_wear_armor

Return true if the current monster is capable of wearing armor. Note that animals, mindless monsters, and monsters which do not wants_wargear will not actually ever wear anything.

can_dualwield

Return true if the player can dualwield while polymorphed into this.

is_normal_demon

Return true if this is a non-unique true demon.

is_demon_prince

Return true if this is a demon prince.

is_demon_lord

Return true if this is a demon lord.

makes_webs

Returns true if this monster is capable of spinning webs.

can_breathe

Returns true if this monster has a breath weapon.

is_player_monster

Return true if this is a role monster (valkyrie, etc).

is_covetous

Returns true if this uses the covetous AI extension (teleporting to stairs, you, picking up invocation items; does not imply a theft attack).

emits_light

Return true if this monster is always surrounded by a 1-square lit region.

likes_lava

Return true if this monster suffers no penalties in lava.

naturally_invisible

Return true if this monster is automatically invisible.

likes_fire

Return true if this monster is not penalized by fire.

touch_petrifies

Return true for monsters whose flesh is fatal on contact petrification.

is_mind_flayer

Can this monster use mental blasts?

is_nonliving

Return true if this monster is not considered alive.

resists_drain_life

Return true if this monster intrinsically cannot be life drained.

resists_magic

Return true if this monster has the magic resistance special property, giving it immunity to several special attacks. This is distinct from the mr accessor, which is a percentage save against a much wider range of attacks.

resists_blinding

Return true if this monster intrinsically cannot be blinded.

is_vulnerable_to_silver

Return true if this monster takes d20 bonus damage from silver attacks.

ignores_bars

Return true if this monster can walk through, between, or around iron bars.

would_slip_armor

Return true if body armor would always fall off this monster.

would_break_armor

Return true if any armor worn by this monster would break.

can_stick

Return true if this monster has an adhesion/grabbing attack, and is immune to such attacks.

has_horns

Return true if this monster has one or more horns preventing the use of helmets.

vegan

Return true if eating this monster or its corpse won't break vegan conduct.

vegetarian

Return true if eating this monster or its corpse won't break vegetarian conduct.

corpse

Returns a hashref with all effects that eating a corpse will provide.

corpse_type

Returns the monster corresponding to the type of corpse that a monster will leave (i.e. vampires leave human corpses).

corpse_reanimates

Return true if the corpse will reanimate after sitting on the floor for a while.

parse_description $name

Attempt to decypher a monster description returned by NetHack. The return value is a hashref of information about the monster which could be obtained from the string:

name Monster's (C)alled name, or shopkeeper name.
god Monster's god of minionhood.
priest Monster is a priest.
renegade Monster is a renegade priest.
high_priest Monster is a high priest.
tame Monster is tame.
invisible Monster is invisible.
saddled Monster is saddled.

If an item is undef, the field cannot be determined from the information given.

AUTHOR

Stefan O'Rear, <stefanor@cox.net>

BUGS

No known bugs.

Please report any bugs through RT: email bug-nethack-monster at rt.cpan.org, or browse http://rt.cpan.org/NoAuth/ReportBug.html?Queue=NetHack-Monster.

COPYRIGHT AND LICENSE

Copyright 2008 Stefan O'Rear.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

NetHack::Item, MooseX::Role::Matcher