spellbook of blank paper named Making Money

Reported directly to devteam, polymorphing a spellbook could produce
a blank spellbook with a Discworld novel's title attached.
This commit is contained in:
PatR
2024-02-27 11:27:02 -08:00
parent 334535e7b0
commit 1532a052c0
2 changed files with 9 additions and 3 deletions

View File

@@ -1367,6 +1367,9 @@ the number of items destroyed by elemental effects is based on the damage
randomize the spellbook in the second level of vlad's tower
monsters weren't randomly generating if exactly one square was outside LOS,
and it contained a monster
when a spellbook was polymorphed into a novel and then incrementing spestudied
field turned it into a blank spellbook, the novel's title would stick:
"{spellbook of blank paper|plain spellbook} named <Discworld title>"
Fixes to 3.7.0-x General Problems Exposed Via git Repository

View File

@@ -1789,9 +1789,12 @@ poly_obj(struct obj *obj, int id)
case SPBOOK_CLASS:
while (otmp->otyp == SPE_POLYMORPH)
otmp->otyp = rnd_class(SPE_DIG, SPE_BLANK_PAPER);
/* reduce spellbook abuse; non-blank books degrade */
if (otmp->otyp != SPE_BLANK_PAPER) {
otmp->otyp = rnd_class(gb.bases[SPBOOK_CLASS], SPE_BLANK_PAPER);
/* reduce spellbook abuse; non-blank books degrade;
3.7: novels don't use spestudied so shouldn't degrade to blank
(but don't force spestudied to zero for them since a non-zero
value could get passed along to a future polymorph) */
if (otmp->otyp != SPE_BLANK_PAPER && otmp->otyp != SPE_NOVEL) {
otmp->spestudied = obj->spestudied + 1;
if (otmp->spestudied > MAX_SPELL_STUDY) {
otmp->otyp = SPE_BLANK_PAPER;