]> granicus.if.org Git - nethack/commitdiff
more monkeys
authorPatR <rankin@nethack.org>
Wed, 22 Jun 2016 00:32:02 +0000 (17:32 -0700)
committerPatR <rankin@nethack.org>
Wed, 22 Jun 2016 00:32:02 +0000 (17:32 -0700)
My old monkey patch was a bit more extensive than Pasi's, although
it didn't originally include letting apes be tameable with bananas.
No sense in throwing it away:
1) Make monkeys and apes be omnivores instead of carnivores.
2) Make bananas be preferred food for herbivore/omnivore subset
   of Y-class, so excludes carniverous ape, owlbear, and yeti.
   [Sasquatch remain omnivorous but aren't tameable with bananas.]
3) While updating befriend_with_food(), make horses be affected
   only by food they might eat, not by meat and corpses and tins.
   So they'll be somewhat harder to cope with for characters not
   strong enough to kill them.  [Dogs and cats are unchanged.]

Not included (not even implemented...):
0) Allow archeologists to choose monkey for starting pet.
   [The one in "Raiders of the Lost Ark" didn't actually belong
   to Indiana Jones but spent a lot of time accompanying him.]

include/mondata.h
src/dog.c
src/monst.c

index 2296177821707bfd478ee278738d5bb2e7287d1a..cdb2990073be495552620095c135afdeccd9a36f 100644 (file)
     (vegan(ptr)         \
      || ((ptr)->mlet == S_PUDDING && (ptr) != &mons[PM_BLACK_PUDDING]))
 
+/* monkeys are tameable via bananas but not pacifiable via food,
+   otherwise their theft attack could be nullified too easily;
+   dogs and cats can be tamed by anything they like to eat and are
+   pacified by any other food;
+   horses can be tamed by always-veggy food or lichen corpses but
+   not tamed or pacified by other corpses or tins of veggy critters */
 #define befriend_with_obj(ptr, obj) \
-    (((obj)->oclass == FOOD_CLASS && is_domestic(ptr))                  \
-     || ((obj)->otyp == BANANA &&                                       \
-         ((ptr) == &mons[PM_MONKEY]                                     \
-          || (ptr) == &mons[PM_APE])))
+    (((ptr) == &mons[PM_MONKEY] || (ptr) == &mons[PM_APE])               \
+     ? (obj)->otyp == BANANA                                             \
+     : (is_domestic(ptr) && (obj)->oclass == FOOD_CLASS                  \
+        && ((ptr)->mlet != S_UNICORN                                     \
+            || objects[(obj)->otyp].oc_material == VEGGY                 \
+            || ((obj)->otyp == CORPSE && (obj)->corpsenm == PM_LICHEN))))
 
 #endif /* MONDATA_H */
index f2993751dff98e764fdbd9467e44637e88686052..0d55baad86971d5486999fff07d52b2a3f0f4b84 100644 (file)
--- a/src/dog.c
+++ b/src/dog.c
@@ -814,8 +814,8 @@ register struct obj *obj;
         case CARROT:
             return herbi ? DOGFOOD : starving ? ACCFOOD : MANFOOD;
         case BANANA:
-            return (mptr->mlet == S_YETI)
-                      ? DOGFOOD
+            return (mptr->mlet == S_YETI && herbi)
+                      ? DOGFOOD /* for monkey and ape (tameable), sasquatch */
                       : (herbi || starving)
                          ? ACCFOOD
                          : MANFOOD;
index 7839b06cc6e1932e15612f0d013a25c453a54887..b99e445317220d0601f8b83b88fddfdfd2c43fd3 100644 (file)
@@ -1915,16 +1915,18 @@ struct permonst _mons2[] = {
     /*
      * Apelike beasts
      */
+    /* tameable via banana; does not grow up into ape...
+       not flagged as domestic, so no guilt penalty for eating non-pet one */
     MON("monkey", S_YETI, LVL(2, 12, 6, 0, 0), (G_GENO | 1),
         A(ATTK(AT_CLAW, AD_SITM, 0, 0), ATTK(AT_BITE, AD_PHYS, 1, 3), NO_ATTK,
           NO_ATTK, NO_ATTK, NO_ATTK),
         SIZ(100, 50, MS_GROWL, MZ_SMALL), 0, 0,
-        M1_ANIMAL | M1_HUMANOID | M1_CARNIVORE, 0, M3_INFRAVISIBLE, CLR_GRAY),
+        M1_ANIMAL | M1_HUMANOID | M1_OMNIVORE, 0, M3_INFRAVISIBLE, CLR_GRAY),
     MON("ape", S_YETI, LVL(4, 12, 6, 0, 0), (G_GENO | G_SGROUP | 2),
         A(ATTK(AT_CLAW, AD_PHYS, 1, 3), ATTK(AT_CLAW, AD_PHYS, 1, 3),
           ATTK(AT_BITE, AD_PHYS, 1, 6), NO_ATTK, NO_ATTK, NO_ATTK),
         SIZ(1100, 500, MS_GROWL, MZ_LARGE), 0, 0,
-        M1_ANIMAL | M1_HUMANOID | M1_CARNIVORE, M2_STRONG, M3_INFRAVISIBLE,
+        M1_ANIMAL | M1_HUMANOID | M1_OMNIVORE, M2_STRONG, M3_INFRAVISIBLE,
         CLR_BROWN),
     MON("owlbear", S_YETI, LVL(5, 12, 5, 0, 0), (G_GENO | 3),
         A(ATTK(AT_CLAW, AD_PHYS, 1, 6), ATTK(AT_CLAW, AD_PHYS, 1, 6),