CleverRaven/Cataclysm-DDA — pull request #10402 by BevapDin (2014-12-09 18:29:17+00:00)
Title: [CR] Implement item type slots for items to be of multiple types.

Item slots replace (partially) the specific item subtypes: instead of an item type being `it_armor`, it is now of the base `itype` plus an armor slot. The armor slot contains the properties that have previously been stored in the `it_armor`.

This allows *all* items types to have armor properties, as all item types can have an armor slot. Access to the armor slot is wrapped in the item class (as was access to members of `it_armor`).

The same is done for containers.

I added the armor slot to all bows in archery.json, so they can be worn without modifications, but I'm not a bow person, so this is very much open for discussion. I also added the armor slot the wearable containers.

See #4189

----

TODO: document the stuff

Some things to consider:

- I'd like to move the flags SEALS, WATERTIGHT, PRESERVES, RIGID into boolean properties of the container slot. They are of no use and no meaning outside of it (on non-container items).

- Similar for armor flags (especially the layer).

- Further separation into different slots: it_spoils (contains spoilage, so that non-food can spoil as well, may even contain a item type. hat it spoils into). it_spawns_in for the container the item spawns in (applies to ammo and food, but could be used for anything else as well).

- Splitting bionic difficulty into install difficulty (property of the CBM item), and removal difficulty (property of the installed bionic). This would allow different CBM items (with different size/rarity/spawn location) that also differ by the install difficulty but grant the very same bionic. For example a CBM item commonly found in doctors office with high install difficulty (intended to be installed by experienced doctors) and another item (same bionic) very rarely found (in outposts?) that is easier to install but might be heavy and bulky.

- Several item types use `item::charges` for the very same thing (chapters for books, amount of loaded ammo for guns and tools, number of items for ammo and food). This limits the the compatibility: an item can not be a book and a tool (with charges).