MCPcopy Create free account
hub / github.com/crawl/crawl / get_mutation_desc

Function get_mutation_desc

crawl-ref/source/mutation.cc:2440–2473  ·  view source on GitHub ↗

Attempt to look up a description of this mutation in the database. Not to be confused with mutation_desc().

Source from the content-addressed store, hash-verified

2438/// Attempt to look up a description of this mutation in the database.
2439/// Not to be confused with mutation_desc().
2440string 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
2475static void _add_mut_tag(vector<string>& tags, string str, bool disabled)
2476{

Callers 2

describe_mutationFunction · 0.85
get_ability_descFunction · 0.85

Calls 12

mutation_nameFunction · 0.85
make_stringfFunction · 0.85
getLongDescriptionFunction · 0.85
hint_replace_cmdsFunction · 0.85
mutation_descFunction · 0.85
mut_aux_attack_descFunction · 0.85
get_mutation_tagsFunction · 0.85
parse_stringFunction · 0.85
getQuoteStringFunction · 0.85
emptyMethod · 0.45
widthMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected