[WIP] Overhaul of code involving requirements, recipes and skills.

From commit notes:

Includes:
 * A massive amount of const-correctness fixes, particularly to code involving the Skill class.
 * Removing differentiation between primary and secondary skill requirements
 * Moving skill requirements to src/requirements.cpp, paving way to using them for vehicles and construction
 * Modified recipe success formulas, they're reasonably similar to the previous ones, save for the 100% broken chance-to-learn recipe
 * Changing skill requirements internally to a more easily extensible format
 * [WIP] Ability to load said requirements from a different JSON structure, that can be more easily included in different entity types in the future. So far this is heavily WIP
 * Adding to above two points: Backwards-compatibility is kept, no data file changes included
 * [WIP] Crafting UI changes. WIP part includes showing a confidence/difficulty rating instead of a raw %
 * Minor fix for two typos in recipe_food.json

Also, changes I forgot to mention there:
 * Unlearnable recipes in books are shown in red
 * Recipe learning threshold from books now uses recipe skill requirements, due to there no longer being a primary skill/difficulty pair. This is probably the biggest non-structural change of them all, but I'm not sure anything can be done about it. Perhaps a flat bonus/penalty to skill levels required.
 * Skill requirements now include few more factors that can be overwritten in the new(wip) requirement JSON format, this includes base success chance, and splitting minimum required skill off from difficulty, meaning it will be possible to enable crafting higher-level recipes at a significant failure probability penalty, if that turns out to be a desirable thing, or to make recipes harder than their base requirement.
 * Some formatting changes - I upgraded bits of code to C++11, primarily just the for-in syntax, renamed some cryptic variable names, and added few intermediate variables in some places to make code more readable.

Forgive me for submitting a single huge monolithic commit, but the code was essentially spaghetti. From gameplay point of view, the changes are not significant, outside of the modified recipe success probabilities(they're reasonably close to before, though) necessitated by the fact that the old dice-based algorithms were impossible or at least very hard to extend to support multiple skills, and as such I have replaced it with a simple algorithm that can be modified by a single difficulty modifier parameter.

This is not yet finished, as it contains few issues that I ended up not fixing due to having to leave my development machine, notably probability of critical failure is way too high, and difficulty penalties for learning recipes need adjustments - currently, disassembly, learning by crafting, reading from books all use the same success chance as crafting.

And yet again, forgive me for how monolithic this is, trust me that the code was intertwined enough that the difficulty of changing it independent-bit-by-bit was somewhere between "impossible" and "I'm not good enough of a coder".
It would, but this is a piece of code that I merely updated, not written from scratch. It's a good point and I'll do that tomorrow. 

Davek <notifications@github.com> wrote:

>> @@ -882,14 +882,18 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump, bool debug) c
>>              if (!(book->recipes.empty())) {
>>                  std::string recipes = "";
>>                  size_t index = 1;
>> -                for( auto iter = book->recipes.begin();
>> -                     iter != book->recipes.end(); ++iter, ++index ) {
>> -                    if(g->u.knows_recipe(iter->first)) {
>> -                        recipes += "<color_ltgray>";
>> -                    }
>> -                    recipes += nname( iter->first->result, 1 );
>> -                    if(g->u.knows_recipe(iter->first)) {
>> -                        recipes += "</color>";
>> +                //
>> +                for( auto iter = book->recipes.begin(); iter != book->recipes.end(); ++iter, ++index ) {
>
>wouldn't a simple `for( auto &recipe : book->recipes )` work here?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/CleverRaven/Cataclysm-DDA/pull/10567/files#r22144821