*** oldsrc\include\config.h Wed Mar 20 16:42:44 2002 --- include\config.h Tue Jun 18 19:05:26 2002 *************** *** 2,7 **** --- 2,10 ---- /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + + #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */ #define CONFIG_H *************** *** 338,343 **** --- 341,349 ---- #define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ + #define EXOTIC_PETS /* Rob Ellwood June 2002 */ + + /* * Section 5: EXPERIMENTAL STUFF * *** oldsrc\include\decl.h Wed Mar 20 16:42:44 2002 --- include\decl.h Tue Jun 18 19:06:00 2002 *************** *** 2,7 **** --- 2,9 ---- /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #ifndef DECL_H #define DECL_H *************** *** 185,190 **** --- 187,197 ---- E NEARDATA char dogname[]; E NEARDATA char catname[]; E NEARDATA char horsename[]; + #ifdef EXOTIC_PETS + E NEARDATA char monkeyname[]; + E NEARDATA char wolfname[]; + E NEARDATA char crocodilename[]; + #endif E char preferred_pet; E const char *occtxt; /* defined when occupation != NULL */ E const char *nomovemsg; *** oldsrc\util\makedefs.c Wed Mar 20 16:44:06 2002 --- util\makedefs.c Fri Jun 21 10:16:30 2002 *************** *** 4,9 **** --- 4,11 ---- /* Copyright (c) Dean Luick, 1990. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #define MAKEDEFS_C /* use to conditionally include file sections */ /* #define DEBUG */ /* uncomment for debugging info */ *************** *** 725,730 **** --- 727,735 ---- #ifdef ZEROCOMP "zero-compressed save files", #endif + #ifdef EXOTIC_PETS + "patch: pet monkeys / wolves / crocodiles", + #endif "basic NetHack features" }; *** oldsrc\src\dog.c Wed Mar 20 16:43:04 2002 --- src\dog.c Fri Jun 21 10:17:24 2002 *************** *** 2,7 **** --- 2,9 ---- /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #include "hack.h" #include "edog.h" *************** *** 41,46 **** --- 43,59 ---- return (PM_KITTEN); else if (preferred_pet == 'd') return (PM_LITTLE_DOG); + #ifdef EXOTIC_PETS + else if (Role_if(PM_ROGUE) + && ((preferred_pet == 'e') || (!rn2(3)) ) ) + return (PM_MONKEY); + else if ((Role_if(PM_RANGER) || Role_if(PM_CAVEMAN) ) + && ((preferred_pet == 'e') || (!rn2(3)) ) ) + return (rn2(4) ? PM_WOLF : PM_WINTER_WOLF_CUB); + else if (Role_if(PM_TOURIST) + && ((preferred_pet == 'e') || (!rn2(3)) ) ) + return (PM_BABY_CROCODILE); + #endif else return (rn2(2) ? PM_KITTEN : PM_LITTLE_DOG); } *************** *** 127,132 **** --- 140,153 ---- petname = dogname; else if (pettype == PM_PONY) petname = horsename; + #ifdef EXOTIC_PETS + else if (pettype == PM_MONKEY) + petname = monkeyname; + else if ((pettype == PM_WOLF) || (pettype == PM_WINTER_WOLF_CUB)) + petname = wolfname; + else if (pettype == PM_BABY_CROCODILE) + petname = crocodilename; + #endif else petname = catname; *************** *** 143,148 **** --- 164,181 ---- if(!mtmp) return((struct monst *) 0); /* pets were genocided */ + #ifdef EXOTIC_PETS + /* Keep the exotic pets from being higher-level than normal starting + pets. (makedog is only called once, during game setup, so this + is the place to put it.) */ + + if ( (pettype == PM_WOLF) || (pettype == PM_WINTER_WOLF_CUB) + || (pettype == PM_MONKEY) || (pettype == PM_BABY_CROCODILE) ) { + mtmp->m_lev = 1; + mtmp->mhpmax = mtmp->mhp = d(1,8); + } + #endif + #ifdef STEED /* Horses already wear a saddle */ if (pettype == PM_PONY && !!(otmp = mksobj(SADDLE, TRUE, FALSE))) { *** oldsrc\src\decl.c Wed Mar 20 16:43:02 2002 --- src\decl.c Tue Jun 18 19:24:06 2002 *************** *** 2,7 **** --- 2,9 ---- /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #include "hack.h" int NDECL((*afternmv)); *************** *** 199,204 **** --- 201,214 ---- NEARDATA char dogname[PL_PSIZ] = DUMMY; NEARDATA char catname[PL_PSIZ] = DUMMY; NEARDATA char horsename[PL_PSIZ] = DUMMY; + + #ifdef EXOTIC_PETS + NEARDATA char monkeyname[PL_PSIZ] = DUMMY; + NEARDATA char wolfname[PL_PSIZ] = DUMMY; + NEARDATA char crocodilename[PL_PSIZ] = DUMMY; + /* ...and 'preferred_pet', just below, can now be 'e'. */ + #endif + char preferred_pet; /* '\0', 'c', 'd', 'n' (none) */ /* monsters that went down/up together with @ */ NEARDATA struct monst *mydogs = (struct monst *)0; *** oldsrc\src\options.c Wed Mar 20 16:43:12 2002 --- src\options.c Tue Jun 18 19:27:00 2002 *************** *** 2,7 **** --- 2,9 ---- /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #ifdef OPTION_LISTS_ONLY /* (AMIGA) external program for opt lists */ #include "config.h" #include "objclass.h" *************** *** 68,73 **** --- 70,79 ---- {"color", &iflags.wc_color, FALSE, SET_IN_GAME}, /*WC*/ # endif {"confirm",&flags.confirm, TRUE, SET_IN_GAME}, + #ifdef EXOTIC_PETS + { "crocodilename", "the name of your (first) crocodile (e.g., crocodilename:TickTock)", + PL_PSIZ, DISP_IN_GAME }, + #endif #if defined(TERMLIB) && !defined(MAC_GRAPHICS_ENV) {"DECgraphics", &iflags.DECgraphics, FALSE, SET_IN_GAME}, #else *************** *** 122,127 **** --- 128,137 ---- #else {"menu_tab_sep", (boolean *)0, FALSE, SET_IN_FILE}, #endif + #ifdef EXOTIC_PETS + { "monkeyname", "the name of your (first) monkey (e.g., monkeyname:Bonzo)", + PL_PSIZ, DISP_IN_GAME }, + #endif #ifdef TTY_GRAPHICS {"msg_window", &iflags.prevmsg_window, FALSE, SET_IN_GAME}, #else *************** *** 183,188 **** --- 193,202 ---- {"toptenwin",&flags.toptenwin, FALSE, SET_IN_GAME}, {"use_inverse", &iflags.wc_inverse, FALSE, SET_IN_GAME}, /*WC*/ {"verbose", &flags.verbose, TRUE, SET_IN_GAME}, + #ifdef EXOTIC_PETS + { "wolfname", "the name of your (first) wolf (e.g., wolfname:Gnasher)", + PL_PSIZ, DISP_IN_GAME }, + #endif {(char *)0, (boolean *)0, FALSE, 0} }; *************** *** 1013,1018 **** --- 1027,1038 ---- case 'F': preferred_pet = 'c'; break; + #ifdef EXOTIC_PETS + case 'e': /* exotic */ + case 'E': + preferred_pet = 'e'; + break; + #endif case 'n': /* no pet */ case 'N': preferred_pet = 'n'; *************** *** 1049,1054 **** --- 1069,1100 ---- return; } + #ifdef EXOTIC_PETS + fullname = "monkeyname"; + if (match_optname(opts, fullname, 6, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + nmcpy(monkeyname, op, PL_PSIZ); + return; + } + + fullname = "wolfname"; + if (match_optname(opts, fullname, 4, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + nmcpy(wolfname, op, PL_PSIZ); + return; + } + + fullname = "crocodilename"; + if (match_optname(opts, fullname, 9, TRUE)) { + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + nmcpy(crocodilename, op, PL_PSIZ); + return; + } + #endif + fullname = "msghistory"; if (match_optname(opts, fullname, 3, TRUE)) { op = string_for_env_opt(fullname, opts, negated); *************** *** 2506,2511 **** --- 2552,2561 ---- iflags.bouldersym : oc_syms[(int)objects[BOULDER].oc_class]); else if (!strcmp(optname, "catname")) Sprintf(buf, "%s", catname[0] ? catname : none ); + #ifdef EXOTIC_PETS + else if (!strcmp(optname, "crocodilename")) + Sprintf(buf, "%s", crocodilename[0] ? crocodilename : none); + #endif else if (!strcmp(optname, "disclose")) { for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) { char topt[2]; *************** *** 2598,2603 **** --- 2648,2657 ---- Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "menu_select_page")) Sprintf(buf, "%s", to_be_done); + #ifdef EXOTIC_PETS + else if (!strcmp(optname, "monkeyname")) + Sprintf(buf, "%s", monkeyname[0] ? monkeyname : none); + #endif else if (!strcmp(optname, "monsters")) Sprintf(buf, "%s", to_be_done); else if (!strcmp(optname, "msghistory")) *************** *** 2617,2622 **** --- 2671,2677 ---- else if (!strcmp(optname, "pettype")) Sprintf(buf, "%s", (preferred_pet == 'c') ? "cat" : (preferred_pet == 'd') ? "dog" : + (preferred_pet == 'e') ? "exotic" : (preferred_pet == 'n') ? "none" : "random"); else if (!strcmp(optname, "pickup_burden")) Sprintf(buf, "%s", burdentype[flags.pickup_burden] ); *************** *** 2697,2702 **** --- 2752,2761 ---- iflags.wc_foregrnd_text ? iflags.wc_foregrnd_text : defbrief, iflags.wc_backgrnd_text ? iflags.wc_backgrnd_text : defbrief); #ifdef PREFIXES_IN_USE + #ifdef EXOTIC_PETS + else if (!strcmp(optname, "wolfname")) + Sprintf(buf, "%s", wolfname[0] ? wolfname : none); + #endif else { for (i = 0; i < PREFIX_COUNT; ++i) if (!strcmp(optname, fqn_prefix_names[i]) && fqn_prefix[i]) *** oldsrc\src\role.c Wed Mar 20 16:43:16 2002 --- src\role.c Tue Jun 18 22:09:22 2002 *************** *** 89,95 **** {"Pioneer", 0} }, "Anu", "_Ishtar", "Anshar", /* Babylonian */ "Cav", "the Caves of the Ancestors", "the Dragon's Lair", ! PM_CAVEMAN, PM_CAVEWOMAN, PM_LITTLE_DOG, PM_SHAMAN_KARNOV, PM_NEANDERTHAL, PM_CHROMATIC_DRAGON, PM_BUGBEAR, PM_HILL_GIANT, S_HUMANOID, S_GIANT, ART_SCEPTRE_OF_MIGHT, --- 89,95 ---- {"Pioneer", 0} }, "Anu", "_Ishtar", "Anshar", /* Babylonian */ "Cav", "the Caves of the Ancestors", "the Dragon's Lair", ! PM_CAVEMAN, PM_CAVEWOMAN, NON_PM, PM_SHAMAN_KARNOV, PM_NEANDERTHAL, PM_CHROMATIC_DRAGON, PM_BUGBEAR, PM_HILL_GIANT, S_HUMANOID, S_GIANT, ART_SCEPTRE_OF_MIGHT, *************** *** 260,266 **** {"Marksman", "Markswoman"} }, "Mercury", "_Venus", "Mars", /* Roman/planets */ "Ran", "Orion's camp", "the cave of the wumpus", ! PM_RANGER, NON_PM, PM_LITTLE_DOG /* Orion & canis major */, PM_ORION, PM_HUNTER, PM_SCORPIUS, PM_FOREST_CENTAUR, PM_SCORPION, S_CENTAUR, S_SPIDER, ART_LONGBOW_OF_DIANA, --- 260,266 ---- {"Marksman", "Markswoman"} }, "Mercury", "_Venus", "Mars", /* Roman/planets */ "Ran", "Orion's camp", "the cave of the wumpus", ! PM_RANGER, NON_PM, NON_PM /* Orion & canis major */, PM_ORION, PM_HUNTER, PM_SCORPIUS, PM_FOREST_CENTAUR, PM_SCORPION, S_CENTAUR, S_SPIDER, ART_LONGBOW_OF_DIANA, *** oldsrc\src\sounds.c Wed Mar 20 16:43:18 2002 --- src\sounds.c Tue Jun 18 20:20:10 2002 *************** *** 2,7 **** --- 2,9 ---- /* Copyright (c) 1989 Janet Walz, Mike Threepoint */ /* NetHack may be freely redistributed. See license for details. */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #include "hack.h" #include "edog.h" #ifdef USER_SOUNDS *************** *** 567,572 **** --- 569,591 ---- break; } /* else FALLTHRU */ case MS_GROWL: + #ifdef EXOTIC_PETS + if (mtmp->mtame && + ( mtmp->data == &mons[PM_MONKEY ] + || mtmp->data == &mons[PM_APE ] + || mtmp->data == &mons[PM_CARNIVOROUS_APE] ) ) { + if (mtmp->mconf || mtmp->mflee || mtmp->mtrapped || + moves > EDOG(mtmp)->hungrytime || mtmp->mtame < 5) { + pline_msg = "shrieks."; + wake_nearto(mtmp->mx, mtmp->my, 8*8); + } else if (EDOG(mtmp)->hungrytime > moves + 1000) + pline_msg = "chatters."; + else + pline_msg = "hoots."; + break; + } + else + #endif pline_msg = mtmp->mpeaceful ? "snarls." : "growls!"; break; case MS_ROAR: *** oldsrc\src\dothrow.c Wed Mar 20 16:43:04 2002 --- src\dothrow.c Fri Jun 21 10:22:38 2002 *************** *** 4,9 **** --- 4,11 ---- /* Contains code for 't' (throw) */ + /* Change EXOTIC_PETS Rob Ellwood June 2002 */ + #include "hack.h" STATIC_DCL int FDECL(throw_obj, (struct obj *,int)); *************** *** 1310,1316 **** --- 1312,1329 ---- potionhit(mon, obj, TRUE); return 1; + #ifdef EXOTIC_PETS + } else if ( (befriend_with_obj(mon->data, obj)) + || (obj->oclass == FOOD_CLASS && + ( ( Role_if(PM_ROGUE) && mon->data == &mons[PM_MONKEY] + && (obj->otyp == BANANA || !rn2(2)) ) + || ( Role_if(PM_TOURIST) && (mon->data == &mons[PM_CROCODILE] + || mon->data == &mons[PM_BABY_CROCODILE]) ) + || ( (Role_if(PM_RANGER) || Role_if(PM_CAVEMAN)) + && mon->data == &mons[PM_WINTER_WOLF_CUB] )) )) { + #else } else if (befriend_with_obj(mon->data, obj)) { + #endif if (tamedog(mon, obj)) return 1; /* obj is gone */ else {