Attempt to look up a description of this mutation in the database. Not to be confused with mutation_desc().
| 2438 | /// Attempt to look up a description of this mutation in the database. |
| 2439 | /// Not to be confused with mutation_desc(). |
| 2440 | string get_mutation_desc(mutation_type mut) |
| 2441 | { |
| 2442 | const char* const name = mutation_name(mut); |
| 2443 | const string key = make_stringf("%s mutation", name); |
| 2444 | string lookup = getLongDescription(key); |
| 2445 | hint_replace_cmds(lookup); |
| 2446 | |
| 2447 | ostringstream desc; |
| 2448 | desc << lookup; |
| 2449 | if (lookup.empty()) // Nothing found? |
| 2450 | desc << mutation_desc(mut, -1, false) << "\n"; |
| 2451 | |
| 2452 | desc << mut_aux_attack_desc(mut); |
| 2453 | |
| 2454 | string mut_tags = get_mutation_tags(mut); |
| 2455 | if (!mut_tags.empty()) |
| 2456 | { |
| 2457 | mut_tags = "Category: " + mut_tags; |
| 2458 | const int spacing = 80 - formatted_string::parse_string(mut_tags).width(); |
| 2459 | desc << "\n" << string(spacing, ' ') << mut_tags; |
| 2460 | } |
| 2461 | |
| 2462 | // TODO: consider adding other fun facts here |
| 2463 | // _get_mutation_def(mut).form_based |
| 2464 | // type of mutation (species, etc) |
| 2465 | // if we tracked it: source (per level, I guess?) |
| 2466 | // gain/loss messages (to clarify to players when they get a |
| 2467 | // confusing message) |
| 2468 | |
| 2469 | const string quote = getQuoteString(key); |
| 2470 | if (!quote.empty()) |
| 2471 | desc << "\n_________________\n\n<darkgrey>" << quote << "</darkgrey>"; |
| 2472 | return desc.str(); |
| 2473 | } |
| 2474 | |
| 2475 | static void _add_mut_tag(vector<string>& tags, string str, bool disabled) |
| 2476 | { |
no test coverage detected