pettype=horse

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?
This commit is contained in:
nethack.rankin
2005-06-01 04:11:55 +00:00
parent be61667b31
commit ff54d82b00
3 changed files with 22 additions and 8 deletions

View 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

View 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}]

View 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] );