CleverRaven/Cataclysm-DDA — pull request #10439 by BevapDin (2014-12-11 23:36:44+00:00)
Title: Implement book item slot, so all items can be books.

Basically the same as with containers: moves the book specific data into a separate property of the basic `itype`.

Additionally, the book data has its own use functions, which are called only when the reading has finished. The normal use functions (directly in `itype`) are called when the item is `a`ctivated. This is needed for tools (have their use functions in `itype`) that can be read like a book (use functions in `islot_book`).

The number of unread chapters is now stored in an entry in `item::item_vars`, the name of it contains the player character id, so different characters on the same world can read the book independently.

All numeric book data (intelligence/skill requirement etc.) is changed to plain and simple `int` to avoid the casting all around (character intelligence is already an int, skill levels are int etc.), and the member storing the skill that the book gives is named `skill`, not `type`.

----

Random thought: road maps and similar items could be changed into books, with their current use function moved into the book data. Players would need to read them (instead of activating them, but activating a book will automatically read it). This also makes the process take some time (the book data could contain a time value, the use function is only called after the reading has been done). Slight advantage: reading is a long action, so reading the maps can take time *and* can be interrupted.

This could also allow a intelligence check (illiterate characters can only read books with required intelligence=0) and a skill check (required skill level).