nethack spoiler site http://www.nethack.de/ Maintainer: Sascha Wostmann (sascha@nethack.de) ----------------------------------------------------------------- Newsgroups: rec.games.roguelike.nethack Subject: Re: prayer From: Bruce Cox Date: 14 Aug 1997 12:58:09 +1000 ======== When a monster moves, a bunch of things happen ("polymorphs" for chameleons, were-things, stop sleeping, being confused or stunned, fleeing, teleport away, shriek, etc). After these things (if we are still looking), a defensive action is looked for: 1. Animals and Mindless creatures do not defend. 2. Creatures more than 5 squares away do not defend. 3. If the monster has swallowed you, it will not defend. 4. If the monster is confused, stunned or blind; is a unicorn or has hands and is carrying a noncursed unicorn horn then it will apply it. 5. If it is blind and has hands and is carrying a potion of extra healing or healing, then it will quaff it. 6. If it is above a certain fraction of its hit points, then it won't defend; otherwise... 7. If it is peaceful, has hands and is carrying a potion of (extra) healing, it will quaff it. 8. If it is a mercenary (soldier or guard) and is carrying a bugle and it knows of other mercenary nearby, it will blow it. 9. If it is on (usable) stairs, ladders, trapdoor or teleport trap, it will use them. 10. If it doesn't have hands, it can't defend. 11. If it has a (usable) wand of digging, wand or scroll of teleportation, potion of (extra) healing, wand or scroll of create monster, it will choose one of them to use. Otherwise, it will look for some miscellaneous items to use: 1. Animals and Mindless creatures don't use any. 2. Nor do monsters which have swallowed you. 3. Creatures more than 6 squares away don't either. 4. If there is a (usable) polymorph trap within one move, it will jump on it. 5. If it doesn't have hands, then it can't use any; otherwise... 6. If it has a (usable) potion of gain level, bullwhip, wand of make invisible, potion of invisibility, wand of speed monster, potion of speed or wand of polymorph, it will use it. Then various other things are checked for (demon bribes, the watch catching you in the act, mind flayers psychic attack, need to wield a weapon). Then the possible sorts of actions are determined. If it is a certain type of action, then the monster will see if it has an offensive item: 1. Peaceful, Handless or Mindless monsters and Animals don't use offensive items. 2. If you have been swallowed, no monster will use an offensive item. 3. If you are in a room with a coaligned altar, they won't either. 4. Nor will nurses if you are not wielding a weapon nor wearing armour. 5. If you are not in a direct line of fire, then there's nothing to use. 6. If it has a (usable) wand of death, sleep, fire, cold, lightning, magic missile or striking, a fire or frost horn, a potion of paralysis, blindness or confusion or a scroll of fire, it will use one of them. (Half the time they notice if you have reflection, making most of the wands and horns unusable). Lots of other things happen after this in a monsters move. At some point, we get to a piece of code where monsters try to pick something up. Monsters may have any/all of the characteristics: likeobjs, likemagic, likerock, likegems, uses_items, likegold. They will be interested in picking up (weapons, armor, gems, food); (amulets, potions, scrolls, wands, rings, spellbooks); (rocks); (gems); (see below) and (gold), respectively. Monsters which use_items are interested in picking up the items mentioned in the lists of defensive/offensive/miscellaneous items and also pick-axe, amulets of life saving and reflection, cockatrice corpses (only if wearing gloves), lizard and acidic corpses (only if not resistant to stoning). The issue of what weapon a monster will use is a whole new issue.