From 24e15f7b2eeffbe23c414afa9983f9548e29196d Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 7 Feb 2006 05:20:16 +0000 Subject: [PATCH] `spestudied' manipulation again (trunk only) Refine last week's change dealing with polymorphing spellbooks: when a spellbook has faded to blank after multiple readings, randomize its spestudied value so that it doesn't always polymorph into another blank book on the first subsequent transformation attempt. --- src/spell.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spell.c b/src/spell.c index b11118ca9..e85abb6b7 100644 --- a/src/spell.c +++ b/src/spell.c @@ -356,6 +356,8 @@ learn() if (book->spestudied > MAX_SPELL_STUDY) { pline("This spellbook is too faint to be read any more."); book->otyp = booktype = SPE_BLANK_PAPER; + /* reset spestudied as if polymorph had taken place */ + book->spestudied = rn2(book->spestudied); } else if (spellknow(i) <= 1000) { Your("knowledge of %s is keener.", splname); incrnknow(i); @@ -376,6 +378,8 @@ learn() /* pre-used due to being the product of polymorph */ pline("This spellbook is too faint to read even once."); book->otyp = booktype = SPE_BLANK_PAPER; + /* reset spestudied as if polymorph had taken place */ + book->spestudied = rn2(book->spestudied); } else { spl_book[i].sp_id = booktype; spl_book[i].sp_lev = objects[booktype].oc_level; -- 2.40.0