]> granicus.if.org Git - nethack/commitdiff
starting the game without a pet
authorcohrs <cohrs>
Sun, 20 Jan 2002 21:05:29 +0000 (21:05 +0000)
committercohrs <cohrs>
Sun, 20 Jan 2002 21:05:29 +0000 (21:05 +0000)
Incorporate a slightly cleaned up version of <Someone>'s patch to enable a
"pettype:none" startup option that allows one to start the game without a pet.

dat/opthelp
doc/Guidebook.mn
doc/Guidebook.tex
doc/fixes33.2
src/decl.c
src/dog.c
src/options.c

index c7000da6825d38c630fc5c0bad353c12363aaa67..c287b110793963ea132ddf2b559e1ec99ac493f2 100644 (file)
@@ -184,7 +184,7 @@ name       the name of your character  [obtained by asking the system or
 objects    like dungeon, but for object symbols
            default:  ])[="(%!?+/$*`0_.
 pettype    your preferred type of pet (cat or dog), if your character
-           class uses both types  [RANDOM]
+           class uses both types; or none for no pet  [RANDOM]
 race       Your starting race (e.g., race:Human, race:Elf).  [RANDOM]
 role       Your starting role (e.g., role:Barbarian, role:Valk).
            Although you can specify just the first letter(s), it will
index d2c2f8f5992270c15da9ca546bc0fa491eba2cda..5548abf599f722e82fb8a3b9754f5095b5df4858 100644 (file)
@@ -1907,7 +1907,8 @@ If true, always display your current inventory in a window.  This only
 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.  Possible values are ``cat'' and ``dog''.
+that uses multiple types of pets; or choose to have no initial pet at all.
+Possible values are ``cat'', ``dog'' and ``none''.
 Cannot be set with the `O' command.
 .lp pickup_burden
 When you pick up an item that would exceed this encumbrance
index 90cd70e0998d50d06624f32df1d97af943e0dc25..3406d3fceb3e3a9f431d7e1864f4e853d002041b 100644 (file)
@@ -2349,8 +2349,8 @@ makes sense for windowing system interfaces that implement this feature.
 %.lp
 \item[\ib{pettype}]
 Specify the type of your initial pet, if you are playing a character class
-that uses multiple types of pets.  Possible values are ``{\tt cat}''
-and ``{\tt dog}''.
+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}''.
 Cannot be set with the `{\tt O}' command.
 %.Ip
 \item[\ib{pickup\_burden}]
index d6bf5da2ad30b7aef7654a101ce6f02e66a86d86..d8815dea2e2fe5093f2e2ebf9b082c78531b5427 100644 (file)
@@ -495,6 +495,7 @@ add new Gnomish Mines levels from Kelly Bailey's patch
 jousting by players wielding a lance while riding
 when reading spellbooks, don't "continue studying" wrong book if original one
        gets destroyed after previous reading attempt has been interrupted
+can start game without a pet via pettype:none (Dylan O'Donnell)
 
 
 Platform- and/or Interface-Specific New Features
index bdda5ec8f9c4c61da1a02063f116369618adeecd..4fdefdf465537497b377f56fe703766512e90c36 100644 (file)
@@ -195,7 +195,7 @@ NEARDATA struct obj zeroobj = DUMMY;
 NEARDATA char dogname[PL_PSIZ] = DUMMY;
 NEARDATA char catname[PL_PSIZ] = DUMMY;
 NEARDATA char horsename[PL_PSIZ] = DUMMY;
-char preferred_pet;    /* '\0', 'c', 'd' */
+char preferred_pet;    /* '\0', 'c', 'd', 'n' (none) */
 /* monsters that went down/up together with @ */
 NEARDATA struct monst *mydogs = (struct monst *)0;
 /* monsters that are moving to another dungeon level */
index d5266c477deb9335ac5f75b06fe9435be13cf443..55f7b6b6439428b014e4d4c547ba8cc0fa78d8bf 100644 (file)
--- a/src/dog.c
+++ b/src/dog.c
@@ -119,6 +119,8 @@ makedog()
        int   pettype;
        static int petname_used = 0;
 
+       if (preferred_pet == 'n') return((struct monst *) 0);
+
        pettype = pet_type();
        if (pettype == PM_LITTLE_DOG)
                petname = dogname;
index 5b7a72fdae4d12db673ca45852cd6af5eeed8bfb..865b1a7ecac027e9fde285084850e0bcfcaca17d 100644 (file)
@@ -1058,11 +1058,15 @@ boolean tinitial, tfrom_file;
                        case 'F':
                            preferred_pet = 'c';
                            break;
+                       case 'n':       /* no pet */
+                       case 'N':
+                           preferred_pet = 'n';
+                           break;
                        default:
                            pline("Unrecognized pet type '%s'", op);
                            break;
                    }
-               } else if (negated) preferred_pet = 0;
+               } else if (negated) preferred_pet = 'n';
                return;
        }
 
@@ -2262,7 +2266,8 @@ char *buf;
 #endif
        else if (!strcmp(optname, "pettype")) 
                Sprintf(buf, "%s", (preferred_pet == 'c') ? "cat" :
-                               (preferred_pet == 'd') ? "dog" : "random" );
+                               (preferred_pet == 'd') ? "dog" :
+                               (preferred_pet == 'n') ? "none" : "random");
        else if (!strcmp(optname, "pickup_burden"))
                Sprintf(buf, "%s", burdentype[flags.pickup_burden] );
        else if (!strcmp(optname, "pickup_types")) {