diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index c8e6ba70b..c9e0cb3d8 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1309,6 +1309,8 @@ if a monster fled from hero by intentionally jumping into a vault teleporter, it would teleport randomly instead of into the vault, and if the teleport trap's niche wasn't mapped yet, the trap would become mapped but the spot would remain a secret corridor and not become accessible +spellbooks weight 50 units but Book of the Dead only 20, and novels only 1; + the Book of the Dead has been changed to 50 and novels to 10 Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/include/objects.h b/include/objects.h index 2bf90dd5a..11de04b07 100644 --- a/include/objects.h +++ b/include/objects.h @@ -1401,12 +1401,12 @@ MARKER(LAST_SPELL, SPE_BLANK_PAPER) /* tribute book for 3.6 */ OBJECT(OBJ("novel", "paperback"), BITS(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, P_NONE, PAPER), - 0, SPBOOK_CLASS, 1, 0, 0, 20, 0, 0, 0, 1, 20, CLR_BRIGHT_BLUE, + 0, SPBOOK_CLASS, 1, 0, 10, 20, 0, 0, 0, 1, 20, CLR_BRIGHT_BLUE, SPE_NOVEL), /* a special, one of a kind, spellbook */ OBJECT(OBJ("Book of the Dead", "papyrus"), BITS(0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, P_NONE, PAPER), - 0, SPBOOK_CLASS, 0, 0, 20, 10000, 0, 0, 0, 7, 20, HI_PAPER, + 0, SPBOOK_CLASS, 0, 0, 50, 10000, 0, 0, 0, 7, 20, HI_PAPER, SPE_BOOK_OF_THE_DEAD), #undef SPELL diff --git a/src/trap.c b/src/trap.c index e4d9b7d07..8dee860a3 100644 --- a/src/trap.c +++ b/src/trap.c @@ -4475,26 +4475,23 @@ water_damage( update_inventory(); return ER_DAMAGED; } else if (obj->oclass == SPBOOK_CLASS) { - if (obj->otyp == SPE_BOOK_OF_THE_DEAD) { - /* - * FIXME? - * This might be given when hero can't see or feel it. - * The book can't be inside a container but it could get - * dunked away from hero if laying on ice which melts. - */ - pline("Steam rises from %s.", the(xname(obj))); + int otyp = obj->otyp; + + if (otyp == SPE_BOOK_OF_THE_DEAD) { + coordxy ox = 0, oy = 0; + + /* note: The Book of the Dead can't be contained or buried */ + if (get_obj_location(obj, &ox, &oy, CONTAINED_TOO | BURIED_TOO)) + obj->ox = ox, obj->oy = oy; + if (isok(ox, oy) && cansee(ox, oy)) + pline("Steam rises from %s.", the(xname(obj))); return 0; - } else if (obj->otyp == SPE_BLANK_PAPER) { + } else if (otyp == SPE_BLANK_PAPER) { return 0; } if (in_invent) Your("%s %s.", ostr, vtense(ostr, "fade")); - if (obj->otyp == SPE_NOVEL) { - obj->novelidx = 0; - free_oname(obj); - } - obj->otyp = SPE_BLANK_PAPER; /* same re-init as over-reading or polymorph; matters if it gets polymorphed into non-blank; doesn't matter if eventually written @@ -4502,6 +4499,17 @@ water_damage( if (obj->spestudied) obj->spestudied = rn2(obj->spestudied); obj->dknown = 0; + /* blanking a novel is more involved than blanking a spellbook */ + if (otyp == SPE_NOVEL) { /* old type */ + obj->novelidx = 0; /* overloads corpsenm, not used for splbooks */ + free_oname(obj); + /* novels weigh less than spellbooks; apparently blanking them + magically makes them become heavier */ + do { + obj->owt = weight(obj); + obj = (obj->where == OBJ_CONTAINED) ? obj->ocontainer : 0; + } while (obj); + } if (in_invent) update_inventory(); return ER_DAMAGED;