Cocytus Succeeder
Posts: 2184
Joined: Tuesday, 3rd February 2015, 22:05
Goldify spellbooks
I submitted this patch to mantis. From the commit message:
Saving/reloading doesn't work yet. If someone can tell me how to fix it, I'll do it.
- Code:
There are some issues with this (saving/reloading does not work yet).
Goldify (or runify) spellbooks. This is achieved by having a vector member in class "player" called "books_in_inventory". Picked up books go there instead of in the inventory. For characters which start with a book, the book is initially placed in the inventory, identified, then goldified and removed from inventory (an awful hack, but I don't know enough about the code to do it more elegantly).
Manuals are still treated normally. I tried to goldify them as well, but the code went into an infinite loop. In any case, there's no obvious way to show multiple manuals in the display otherwise, so it's probably better to keep them as it is.
Breaks old savefiles because books_in_inventory needs to be marshalled/unmarshalled. Saving/reloading does not actually work because tags.cc crashes with an error ("ERROR in 'tags.cc' at line 4089: Invalid item: book of Changes"). The code in tags.cc is currently commented out. If someone can tell me what's causing it, I'll fix it.
TODO: Fix saving/reloading. Optional: Remove Trog's book burning. Make Vehumet gift an artifact spellbook containing 1/3 spells, instead of a spell using the "M" screen.
Saving/reloading doesn't work yet. If someone can tell me how to fix it, I'll do it.
- For this message the author bel has received thanks: 2
- Hellmonk, VeryAngryFelid