From 8b32ae98e9b2df54c76949c304487f781be5ada7 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Tue, 11 Apr 2023 14:07:46 +0300 Subject: [PATCH] Add petless conduct Breaks saves. --- doc/fixes3-7-0.txt | 1 + include/patchlevel.h | 2 +- include/you.h | 1 + src/dog.c | 2 ++ src/insight.c | 3 +++ src/minion.c | 12 +++++++++++- src/topten.c | 3 +++ 7 files changed, 22 insertions(+), 2 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 08f7a5d69..373dcb22d 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2038,6 +2038,7 @@ add a boolean option tips to disable all of the helpful tips add a tutorial level engravings appear on the map display option to create the character deaf +add conduct for petless Platform- and/or Interface-Specific New Features diff --git a/include/patchlevel.h b/include/patchlevel.h index c2e0d0a15..dfb9758b6 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 81 +#define EDITLEVEL 82 /* * Development status possibilities. diff --git a/include/you.h b/include/you.h index 155cbd038..f0ed074cf 100644 --- a/include/you.h +++ b/include/you.h @@ -154,6 +154,7 @@ struct u_conduct { /* number of times... */ long wishes; /* used a wish */ long wisharti; /* wished for an artifact */ long sokocheat; /* violated special 'rules' in Sokoban */ + long pets; /* obtained a pet */ /* genocides already listed at end of game */ }; diff --git a/src/dog.c b/src/dog.c index b1249f484..5773dcfa6 100644 --- a/src/dog.c +++ b/src/dog.c @@ -59,6 +59,7 @@ initedog(struct monst *mtmp) EDOG(mtmp)->revivals = 0; EDOG(mtmp)->mhpmax_penalty = 0; EDOG(mtmp)->killed_by_u = 0; + u.uconduct.pets++; } static int @@ -152,6 +153,7 @@ make_familiar(struct obj *otmp, coordxy x, coordxy y, boolean quietly) /* 0,1,2: b=80%,10,10; nc=10%,80,10; c=10%,10,80 */ if (chance > 0) { mtmp->mtame = 0; /* not tame after all */ + u.uconduct.pets--; /* doesn't count as creating a pet */ if (chance == 2) { /* hostile (cursed figurine) */ if (!quietly) You("get a bad feeling about this."); diff --git a/src/insight.c b/src/insight.c index 69a5bd526..84474365e 100644 --- a/src/insight.c +++ b/src/insight.c @@ -2047,6 +2047,9 @@ show_conduct(int final) you_have_X(buf); } + if (!u.uconduct.pets) + you_have_never("had a pet"); + ngenocided = num_genocides(); if (ngenocided == 0) { you_have_never("genocided any monsters"); diff --git a/src/minion.c b/src/minion.c index 28ea2f059..45affcf3b 100644 --- a/src/minion.c +++ b/src/minion.c @@ -520,7 +520,17 @@ gain_guardian_angel(void) * [Note: this predates mon->mextra which allows a monster * to have both emin and edog at the same time.] */ - mtmp->mtame = 10; + /* Too nasty for the game to unexpectedly break petless conduct on + * the final level of the game. The angel will still appear, but + * won't be tamed. */ + if (u.uconduct.pets) { + /* guardian angel -- the one case mtame doesn't + * imply an edog structure, so we don't want to + * call tamedog(). + */ + mtmp->mtame = 10; + u.uconduct.pets++; + } /* for 'hilite_pet'; after making tame, before next message */ newsym(mtmp->mx, mtmp->my); if (!Blind) diff --git a/src/topten.c b/src/topten.c index 96fe69a01..d86fdcc7e 100644 --- a/src/topten.c +++ b/src/topten.c @@ -439,6 +439,8 @@ encodeconduct(void) entered-sokoban bit in the 'achieve' field */ if (!u.uconduct.sokocheat && sokoban_in_play()) e |= 1L << 12; + if (!u.uconduct.pets) + e |= 1L << 13; return e; } @@ -594,6 +596,7 @@ encode_extended_conducts(char *buf) add_achieveX(buf, "deaf", u.uroleplay.deaf); add_achieveX(buf, "nudist", u.uroleplay.nudist); add_achieveX(buf, "bonesless", !flags.bones); + add_achieveX(buf, "petless", !u.uconduct.pets); return buf; }