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

Function bane_long_description

crawl-ref/source/describe.cc:4883–4933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4881}
4882
4883string bane_long_description(bane_type bane, bool ignore_player)
4884{
4885 const bool player_has = !ignore_player && you.banes[bane];
4886 ostringstream output;
4887
4888 const string key = make_stringf("%s bane", bane_name(bane, true).c_str());
4889 string lookup = getLongDescription(key);
4890
4891 if (!lookup.empty())
4892 {
4893 hint_replace_cmds(lookup);
4894 output << lookup;
4895 }
4896 else
4897 output << bane_desc(bane) << "\n";
4898
4899 if (bane == BANE_DILETTANTE && player_has)
4900 {
4901 CrawlVector& vec = you.props[DILETTANTE_SKILL_KEY].get_vector();
4902 output << "\nYour " << skill_name(static_cast<skill_type>(vec[0].get_int()))
4903 << ", " << skill_name(static_cast<skill_type>(vec[1].get_int()))
4904 << ", and " << skill_name(static_cast<skill_type>(vec[2].get_int()))
4905 << " are currently affected.\n";
4906 }
4907
4908 const int dur = bane_base_duration(bane);
4909 string dur_str;
4910 if (dur > BANE_DUR_LONG)
4911 dur_str = "very long";
4912 else if (dur > BANE_DUR_MEDIUM)
4913 dur_str = "long";
4914 else if (dur > BANE_DUR_SHORT)
4915 dur_str = "moderate length of";
4916 else
4917 dur_str = "short length of";
4918
4919 output << make_stringf("\nThis bane usually lasts a %s time.\n", dur_str.c_str());
4920
4921 if (player_has)
4922 {
4923 int needed_xl = xl_to_remove_bane(bane);
4924 string desc = make_stringf("\n<lightmagenta>"
4925 "This bane will be lifted from you when you "
4926 "gain another %.1f XLs worth of experience."
4927 "</lightmagenta>",
4928 (float)needed_xl / 10.0f);
4929 output << desc;
4930 }
4931
4932 return output.str();
4933}
4934
4935void describe_bane(bane_type bane)
4936{

Callers 2

crawl_bane_descFunction · 0.85
describe_baneFunction · 0.85

Calls 11

make_stringfFunction · 0.85
bane_nameFunction · 0.85
getLongDescriptionFunction · 0.85
hint_replace_cmdsFunction · 0.85
bane_descFunction · 0.85
skill_nameFunction · 0.85
bane_base_durationFunction · 0.85
xl_to_remove_baneFunction · 0.85
get_intMethod · 0.80
emptyMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected