Difference between revisions of "User:Killian/Pet food"

From NetHackWiki
Jump to navigation Jump to search
(Food: ghoul age check doesn't appear to check whether corpse is lizard, lichen etc.)
(dog_invent: restrictions to monsters picking up items)
Line 63: Line 63:
 
* Cursed objects, [[heavy iron ball]]s, [[iron chain]]s, [[boulder]]s and [[statue]]s are considered uninteresting. All other objects are considered apportable.
 
* Cursed objects, [[heavy iron ball]]s, [[iron chain]]s, [[boulder]]s and [[statue]]s are considered uninteresting. All other objects are considered apportable.
  
== <tt>dog_invent</tt> ==
+
== dog_invent ==
  
([[source:monmove.c#dog_invent]])
+
(from {{function|monmove.c|dog_invent}})
  
 
Pets will only interact with the topmost item.
 
Pets will only interact with the topmost item.
Line 75: Line 75:
 
If the pet is able to carry the item, and it is not cursed, there is a chance that it will pick up the item. The pet will immediately wield its best melee weapon and wear its best armor, if able, in case the new item is better.
 
If the pet is able to carry the item, and it is not cursed, there is a chance that it will pick up the item. The pet will immediately wield its best melee weapon and wear its best armor, if able, in case the new item is better.
 
:There are two probability checks that must both succeed: <code>(rn2(20) < edog->apport+3)</code> and <code>(rn2(udist) || !rn2(edog->apport))</code>. This means the pet must first pass a ''d20'' apport check (with a +3 bonus), and then must be relatively far from the player, have relatively low apport, or else simply be lucky.
 
:There are two probability checks that must both succeed: <code>(rn2(20) < edog->apport+3)</code> and <code>(rn2(udist) || !rn2(edog->apport))</code>. This means the pet must first pass a ''d20'' apport check (with a +3 bonus), and then must be relatively far from the player, have relatively low apport, or else simply be lucky.
 +
 +
The following restrictions apply to monsters picking up items: (from {{function|mon.c|can_carry}})
 +
* Monsters marked <tt>M1_NOTAKE</tt> cannot pick up anything.
 +
* Monsters cannot take petrifying corpses, unless they are stoning-resistant or are wearing gloves.
 +
* Rider corpses cannot be taken.
 +
* Silver-hating monsters cannot take silver items. As an exception, [[covetous]] monsters may pick up the [[Bell of Opening]].
 +
* Monsters being ridden cannot pick up anything.
 +
* [[Shopkeeper]]s ''can'' always pick up anything, ignoring weight limits.
 +
* Peaceful monsters cannot pick up anything.
 +
* Rock-throwing monsters (<tt>M2_ROCKTHROW</tt>) can always pick up boulders, ignoring weight limits.
 +
* [[Nymph]]s can always pick up anything, except for statues and boulders, ignoring weight limits.
 +
* Otherwise, the monster must have enough weight capacity to pick up the item in question.

Revision as of 12:02, 23 May 2008

Item types

  • Treat (DOGFOOD)
  • Suitable corpse (CADAVER)
  • Acceptable (ACCFOOD)
  • Human food (MANFOOD)
  • Apportable (APPORT)
  • Poison (POISON)
  • Uninteresting (UNDEF)
  • Taboo (TABU)

These classifications appear to affect the following:

  • Whether thrown food will tame or pacify a domestic animal
  • The effect of thrown food on a pet
  • Whether a pet will eat an item on the ground
  • Whether or not a pet will try to move to a particular square

They do not seem to affect whether a pet will pick up non-food items.

Classification

  • Quest artifacts (and other artifacts, 5% of the time) are considered taboo if cursed, or apportable otherwise.

Food

  • Rider corpses are taboo.
  • Petrifying corpses are taboo for monsters that are not stoning-resistant.
  • For ghouls, old corpses (more than 50 turns) are treats, and other corpses are taboo. This seems to apply even to corpses that don't degrade, such as lizard or lichen corpses.
  • For monsters (other than ghouls) that are neither carnivores nor herbivores, cursed food is uninteresting and non-cursed food is apportable.
  • Petrifying eggs are considered poison by monsters not stoning-resistant. Other eggs are considered suitable corpses by carnivores, and human food by herbivores.
  • Corpses that are more than 50 turns old and are not lizards or F are considered poison. Acidic corpses are poison for monsters not acid-resistant. Poisonous corpses are poison for monsters not poison-resistant. Vegan corpses are considered suitable corpses by herbivores, and non-vegan corpses are considered suitable by carnivores. All other corpses are considered human food.
  • A clove of garlic is taboo for undead monsters. It is acceptable to herbivores and to starving carnivores; otherwise it is considered human food.
  • Tins are considered acceptable to metallivores, and are considered human food otherwise.
  • Apples and carrots are treats for herbivores. Carnivores will consider them acceptable if starving, and human food otherwise.
  • Bananas are considered treats for Y. They are acceptable to herbivores and starving carnivores, and are otherwise considered human food.
  • All other comestibles are considered acceptable by starving pets. Other fruits and vegetables are acceptable to herbivores, and other processed foods (including royal jelly) are acceptable to carnivores; they are otherwise considered human food.

Non-food

  • Any object made of silver is taboo for silver-hating monsters.

dog_invent

(from dog_invent in monmove.c)

Pets will only interact with the topmost item.

Pets will not pick up heavy iron balls, iron chains, boulders, statues, or scrolls of mail.

If the item is a treat or a suitable corpse (or acceptable to a starving pet), the pet will eat it. Pets do not seem to care if the food is cursed, though they will still try to avoid the square containing the cursed food.

If the pet is able to carry the item, and it is not cursed, there is a chance that it will pick up the item. The pet will immediately wield its best melee weapon and wear its best armor, if able, in case the new item is better.

There are two probability checks that must both succeed: (rn2(20) < edog->apport+3) and (rn2(udist) || !rn2(edog->apport)). This means the pet must first pass a d20 apport check (with a +3 bonus), and then must be relatively far from the player, have relatively low apport, or else simply be lucky.

The following restrictions apply to monsters picking up items: (from can_carry in mon.c)

  • Monsters marked M1_NOTAKE cannot pick up anything.
  • Monsters cannot take petrifying corpses, unless they are stoning-resistant or are wearing gloves.
  • Rider corpses cannot be taken.
  • Silver-hating monsters cannot take silver items. As an exception, covetous monsters may pick up the Bell of Opening.
  • Monsters being ridden cannot pick up anything.
  • Shopkeepers can always pick up anything, ignoring weight limits.
  • Peaceful monsters cannot pick up anything.
  • Rock-throwing monsters (M2_ROCKTHROW) can always pick up boulders, ignoring weight limits.
  • Nymphs can always pick up anything, except for statues and boulders, ignoring weight limits.
  • Otherwise, the monster must have enough weight capacity to pick up the item in question.