]> granicus.if.org Git - nethack/commitdiff
pettype=horse
authornethack.rankin <nethack.rankin>
Wed, 1 Jun 2005 04:11:55 +0000 (04:11 +0000)
committernethack.rankin <nethack.rankin>
Wed, 1 Jun 2005 04:11:55 +0000 (04:11 +0000)
     Accept OPTIONS=pettype:horse quietly instead of issuing "unrecognized
pet type 'horse'" message.  It doesn't actually do anything from player's
perspective--knights always get a pony and other roles always get a cat or
dog, as before.

     I had a much more elaborate version which recognized "pony" (plus
"kitten", "little dog", "puppy" and assorted other variations of the
acceptable types), but it was absurd overkill for something that never
come up during actual play.  If someone tries to specify "kitten" and gets
"unrecongized type", it shouldn't take him longer to figure out "cat" is
what's needed even without resorting to actually reading the Guidebook.

     Can someone generate an up to date Guidebook.txt and check it in?

doc/Guidebook.mn
doc/Guidebook.tex
src/options.c

index dc7cbfbaf1971b9cd20860517ae186254ecba765..84b2717fb5522af1fe0261d1898338955024d894 100644 (file)
@@ -2051,7 +2051,11 @@ makes sense for windowing system interfaces that implement this feature.
 .lp pettype
 Specify the type of your initial pet, if you are playing a character class
 that uses multiple types of pets; or choose to have no initial pet at all.
-Possible values are ``cat'', ``dog'' and ``none''.
+Possible values are ``cat'', ``dog'', ``horse'',
+and ``none''.
+If the choice is not allowed for the role you are currently playing,
+it will be silently ignored.  For example, ``horse'' will only be
+honored when playing a knight.
 Cannot be set with the `O' command.
 .lp pickup_burden
 When you pick up an item that would exceed this encumbrance
index bdb61084ecfea6908de19c7987d5d55833011ddc..e3d9f34d10be633c792bb5ce10f0aa01116a842b 100644 (file)
@@ -27,7 +27,7 @@
 \begin{document}
 %
 % input file: guidebook.mn
-% $Revision: 1.91 $ $Date: 2005/01/22 15:27:20 $
+% $Revision: 1.92 $ $Date: 2005/01/23 14:33:46 $
 %
 %.ds h0 "
 %.ds h1 %.ds h2 \%
@@ -2514,7 +2514,11 @@ makes sense for windowing system interfaces that implement this feature.
 \item[\ib{pettype}]
 Specify the type of your initial pet, if you are playing a character class
 that uses multiple types of pets; or choose to have no initial pet at all.
-Possible values are ``{\tt cat}'', ``{\tt dog}'' and ``{\tt none}''.
+Possible values are ``{\tt cat}'', ``{\tt dog}'', ``{\tt horse}''
+and ``{\tt none}''.
+If the choice is not allowed for the role you are currently playing,
+it will be silently ignored.  For example, ``{\tt horse}'' will only be
+honored when playing a knight.
 Cannot be set with the `{\tt O}' command.
 %.Ip
 \item[\ib{pickup\_burden}]
index 50ce41dbfe74ec9153555a5ecc87e76568ffb58b..ddd1a029f1bc005243427844916f568ebbd9b46e 100644 (file)
@@ -1200,21 +1200,26 @@ boolean tinitial, tfrom_file;
                if (duplicate) complain_about_duplicate(opts,1);
                if ((op = string_for_env_opt(fullname, opts, negated)) != 0) {
                    if (negated) bad_negation(fullname, TRUE);
-                   else switch (*op) {
+                   else switch (lowc(*op)) {
                        case 'd':       /* dog */
-                       case 'D':
                            preferred_pet = 'd';
                            break;
                        case 'c':       /* cat */
-                       case 'C':
                        case 'f':       /* feline */
-                       case 'F':
                            preferred_pet = 'c';
                            break;
+                       case 'h':       /* horse */
+                       case 'q':       /* quadruped */
+                           /* avoids giving "unrecognized type of pet" but
+                              pet_type(dog.c) won't actually honor this */
+                           preferred_pet = 'h';
+                           break;
                        case 'n':       /* no pet */
-                       case 'N':
                            preferred_pet = 'n';
                            break;
+                       case '*':       /* random */
+                           preferred_pet = '\0';
+                           break;
                        default:
                            pline("Unrecognized pet type '%s'.", op);
                            break;
@@ -3271,6 +3276,7 @@ char *buf;
        else if (!strcmp(optname, "pettype"))
                Sprintf(buf, "%s", (preferred_pet == 'c') ? "cat" :
                                (preferred_pet == 'd') ? "dog" :
+                               (preferred_pet == 'h') ? "horse" :
                                (preferred_pet == 'n') ? "none" : "random");
        else if (!strcmp(optname, "pickup_burden"))
                Sprintf(buf, "%s", burdentype[flags.pickup_burden] );