- lookup %ARGS
- PRIMITIVE ACCESSORS
- numeric_size :: Int
- has_attack MODE
- resists ELEMENT
- parse_description $name
- COPYRIGHT AND LICENSE
- SEE ALSO
NetHack::Monster::Spoiler - information on a type of monster
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
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 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.
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.
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.
Returns true if the monster is one of the three Riders of the Astral Plane^W^WApocalypse.
Returns true if the monster will always ignore Elbereth. Peacefuls, blind monsters, and monsters with special AIs will ignore regardless.
Return true if the monster has an attack of the specified mode or type.
Return undef if the monster is not a spellcaster. Otherwise return the type of magic used.
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.
Return true if the monster is capable of levitation, if not flight.
Return true if the monster is non-corporeal (a ghost or shade).
Return true if the monster is made of whirls of gas, and for instance can be disrupted with slowing.
Return true if the monster is already on fire and cannot be ignited further.
Return true if the monster is intrinsically telepathic.
Return true if the monster uses weapons in the wild. If you are polymorphed, you want could_wield, not this.
Return true (specifically, the 3-letter code for the unicorn's alignment) if this monster is a unicorn.
Return true if the current monster is a true bat, not a bird.
Return true for golems.
Return true if this monster is very small (can pass between bars, etc).
Return true if this monster is quite large (cannot fit through crevice, etc).
Return true if this monster is capable of using weapons. For whether it will use weapons in the wild, see uses_weapons.
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.
Return true if the player can dualwield while polymorphed into this.
Return true if this is a non-unique true demon.
Return true if this is a demon prince.
Return true if this is a demon lord.
Returns true if this monster is capable of spinning webs.
Returns true if this monster has a breath weapon.
Return true if this is a role monster (valkyrie, etc).
Returns true if this uses the covetous AI extension (teleporting to stairs, you, picking up invocation items; does not imply a theft attack).
Return true if this monster is always surrounded by a 1-square lit region.
Return true if this monster suffers no penalties in lava.
Return true if this monster is automatically invisible.
Return true if this monster is not penalized by fire.
Return true for monsters whose flesh is fatal on contact petrification.
Can this monster use mental blasts?
Return true if this monster is not considered alive.
Return true if this monster intrinsically cannot be life drained.
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.
Return true if this monster intrinsically cannot be blinded.
Return true if this monster takes d20 bonus damage from silver attacks.
Return true if this monster can walk through, between, or around iron bars.
Return true if body armor would always fall off this monster.
Return true if any armor worn by this monster would break.
Return true if this monster has an adhesion/grabbing attack, and is immune to such attacks.
Return true if this monster has one or more horns preventing the use of helmets.
Return true if eating this monster or its corpse won't break vegan conduct.
Return true if eating this monster or its corpse won't break vegetarian conduct.
Returns a hashref with all effects that eating a corpse will provide.
Returns the monster corresponding to the type of corpse that a monster will leave (i.e. vampires leave human corpses).
Return true if the corpse will reanimate after sitting on the floor for a while.
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.
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 2008 Stefan O'Rear.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.