Add petless conduct

Breaks saves.
This commit is contained in:
Pasi Kallinen
2023-04-11 14:07:46 +03:00
parent ffb61612e3
commit 8b32ae98e9
7 changed files with 22 additions and 2 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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 */
};

View File

@@ -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.");

View File

@@ -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");

View File

@@ -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)

View File

@@ -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;
}