CleverRaven/Cataclysm-DDA — pull request #9102 by BevapDin (2014-09-18 15:00:17+00:00)
Title: Random descriptions for item.

I came across the `it_stationary`, the flyer / survivor's note. It already implements random description, but they are only used for items of that type, so I moved the snippet category into the base item type class. Now all items can have random descriptions. Add this to an item type definition (e.g. for t-shirts):
```
"snippet_category" : [
"A short-sleeved cotton shirt. There is a big smiley on it.",
"A short-sleeved cotton shirt. It used to be white, now it is gray.",
"A short-sleeved cotton shirt. There is an add for a local grocery store on it."
],
```

----

There is however no way to request a specific description for a specific item (for example to make the t-shirt item that a profession starts with always have the same specific description). It's always randomly pulled from the snippet list.

That would require either a rework of how the profession items are stored - they would have to include a reference to the description into the profession items (not a list of simple strings, but a list of pairs of item type id and reference to the description).

Or it could be implemented with a pseudo item type id e.g. "thirt:blue". The `item_factory` returns the tshirt item type (the string before the `:`). The item constructor would examine the requested item type id, find the substring `:blue` and use the matching description instead of the randomly chosen one. That would be transparent for most of the code (profession items can still be defined as a list of simple strings).