functions of their own, and reuse them in the god descriptions ('^' screen, when praying at altars, and when searching the database).
What's still missing is some sort of "What this god offers you". The current handling makes gods like Lugonu, who have no restrictions and demand very little, appear like no-brainers, when of course the whole thing is much more complicated. I'll also be adding some extended information for the ^ screen (thus for your own god only).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5870 c06c8d41-db1a-0410-9941-cceddc491573
DF5LOTJFSXOT7UBDHLBDLGA22OY4L7ZF6CVFP6H3KL4N5CHB5C5QC
B4T5LFXNCR6YTS3CRTHOAUAPD52RFFSK4WN6XZ5TRP2JNY3LLPRAC
J75HE2PXUFFZORP4EZEBDO4LFR3QGSI3BOIC7M34ZKDVUWRXS2QQC
TDXC5VWE2B5VVGNXEF7V5E6UCKCSAIZVLJXFIOQ4G4A2PK5L7BBQC
JBZ7NU4BB5PGQWCOSZHD5OQUHQIVOD4XGJLSJQ7BUGQEGPRTVGZQC
KVBY4K2MCJZXNFVJZPKTYUXRXPH5LE6ZOJW4LTHOZPO6TD555IVQC
HQTS3VQ6PNUZKHNVEWMML7JNAAAKL4DSW3KFSRCCSLGYTDHZFCCAC
77H4BWWPPGLM3PLZH4QTAJRXIZTSDVNCOKZE223I437FN2UJ34RQC
NK2TBKWOQBD2ZRGAO4Z3HMZPIN7UX3HNUS2YHEIJUUINUTRMPODQC
LS5XCCGKQHSJQGWLWLGTP2F5OYWK4ND5AQQAGRN6H2HVBSXNCCZAC
IHOKNI4O7EEW4UBMKHP6XOZNEIQSW4AYOT4O3JXUIXNNR553IQAQC
IIN7AVA6JYRBXH6ZYRR7BY7TV6PW7ANAQ2A3PD55FKBKKQFEEF2AC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
F7Q7QRZACTDPP6KH3AB5J6B6B5PRVV4FURTOIGXHRHWNVSQT3TVAC
XDJGQNFELURGXMUAOOVALQMSLAJVHMG63KPKVA33HTJFVZROGZ4AC
KFULGQQOHWUTXOM3BX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case GOD_SIF_MUNA:
likes.push_back("train your various spell casting skills");
break;
case GOD_TROG:
likes.push_back("destroy spell books (especially ones you've"
"never read) via the <w>a</w> command");
break;
case GOD_NEMELEX_XOBEH:
likes.push_back("draw unmarked cards and use up decks");
break;
case GOD_ELYVILON:
likes.push_back("destroy weapons (especially evil ones) via "
"the <w>a</w> command");
break;
default:
break;
}
switch(you.religion)
{
case GOD_SHINING_ONE: case GOD_KIKUBAAQUDGHA: case GOD_OKAWARU:
case GOD_MAKHLEB: case GOD_SIF_MUNA: case GOD_TROG:
likes.push_back("sacrifice items (by dropping them on an altar "
"and praying)");
break;
case GOD_NEMELEX_XOBEH:
likes.push_back("sacrifice items (by standing over them and "
"praying)");
break;
case GOD_ZIN:
likes.push_back("sacrifice gold (by praying at an altar)");
break;
default:
break;
}
if (god_likes_butchery(you.religion))
likes.push_back("butcher corpses while praying");
switch(you.religion)
{
case GOD_KIKUBAAQUDGHA: case GOD_YREDELEMNUL: case GOD_OKAWARU:
case GOD_VEHUMET: case GOD_MAKHLEB: case GOD_TROG:
case GOD_BEOGH: case GOD_LUGONU:
likes.push_back("kill living beings");
break;
default:
break;
}
switch(you.religion)
{
case GOD_SHINING_ONE: case GOD_OKAWARU: case GOD_VEHUMET:
case GOD_MAKHLEB: case GOD_LUGONU:
likes.push_back("kill the undead");
break;
default:
break;
}
switch(you.religion)
{
case GOD_SHINING_ONE: case GOD_OKAWARU: case GOD_MAKHLEB:
likes.push_back("kill demons");
break;
default:
break;
}
// Unusual kills.
switch(you.religion)
{
case GOD_ZIN:
likes.push_back("kill monsters which cause mutation or rotting");
break;
case GOD_SHINING_ONE:
likes.push_back("kill living evil beings");
break;
case GOD_BEOGH:
likes.push_back("kill the priests of other religions");
break;
case GOD_TROG:
likes.push_back("kill wizards and other users of magic");
break;
default:
break;
}
if (likes.size() == 0)
{
mprf(MSGCH_ERROR,
" %s doesn't like anything? This a bug; please report it.",
new_god_name.c_str());
}
else
{
text << new_god_name << " likes it when you ";
text << comma_separated_line(likes.begin(), likes.end(),
" and ", ", ");
text << ".";
formatted_message_history(text.str(), MSGCH_TUTORIAL, 0,
_get_tutorial_cols());
text.str("");
}
std::vector<std::string> dislikes;
if (god_hates_butchery(you.religion))
dislikes.push_back("butcher corpses while praying");
if (is_good_god(you.religion))
{
dislikes.push_back("drink blood");
dislikes.push_back("perform cannibalism");
dislikes.push_back("use necromancy");
dislikes.push_back("use unholy magic or items");
dislikes.push_back("attack holy beings");
dislikes.push_back("attack neutral beings");
}
switch(you.religion)
{
case GOD_ZIN: case GOD_SHINING_ONE: case GOD_ELYVILON:
case GOD_OKAWARU:
dislikes.push_back("attack allies");
break;
case GOD_BEOGH:
dislikes.push_back("attack allied orcs");
break;
default:
break;
}
switch(you.religion)
{
case GOD_ELYVILON: case GOD_ZIN: case GOD_OKAWARU:
dislikes.push_back("allow an ally to die");
break;
default:
break;
}
switch(you.religion)
{
case GOD_ZIN:
dislikes.push_back("cause yourself to mutate in a way that could "
"have been avoided");
dislikes.push_back("eat the flesh of sentient beings");
break;
case GOD_SHINING_ONE:
dislikes.push_back("poison a monster");
dislikes.push_back("attack in an unchivalric manner");
break;
case GOD_ELYVILON:
dislikes.push_back("kill a living thing while praying");
break;
case GOD_TROG:
dislikes.push_back("memorize spells");
dislikes.push_back("cast spells");
break;
default:
break;
}
if (dislikes.size() > 0)
{
text << "\n";
text << new_god_name << " dislikes it when you ";
text << comma_separated_line(dislikes.begin(), dislikes.end(),
" or ", ", ");
text << ".";
formatted_message_history(text.str(), MSGCH_TUTORIAL, 0,
_get_tutorial_cols());
}
formatted_message_history(print_god_likes(you.religion, true).c_str(),
MSGCH_TUTORIAL, 0, _get_tutorial_cols());
formatted_message_history(print_god_dislikes(you.religion, true).c_str(),
MSGCH_TUTORIAL, 0, _get_tutorial_cols());
}
std::string print_god_likes(god_type which_god, bool verbose)
{
// Return early for the special cases.
if (which_god == GOD_NO_GOD || which_god == GOD_XOM)
return "";
std::string text = god_name(which_god);
std::vector<std::string> likes;
// Unique/unusual piety gain methods first.
switch (which_god)
{
case GOD_SIF_MUNA:
likes.push_back("train your various spell casting skills");
break;
case GOD_TROG:
snprintf(info, INFO_SIZE, "destroy spellbooks (especially ones you've"
"never read)%s",
verbose ? "via the <w>a</w> command" : "");
likes.push_back(info);
break;
case GOD_NEMELEX_XOBEH:
likes.push_back("draw unmarked cards and use up decks");
break;
case GOD_ELYVILON:
snprintf(info, INFO_SIZE, "destroy weapons (especially evil ones)%s",
verbose ? "via the <w>a</w> command" : "");
likes.push_back(info);
break;
default:
break;
}
switch (which_god)
{
case GOD_SHINING_ONE: case GOD_KIKUBAAQUDGHA: case GOD_OKAWARU:
case GOD_MAKHLEB: case GOD_SIF_MUNA: case GOD_TROG:
snprintf(info, INFO_SIZE, "sacrifice items%s",
verbose ? " (by dropping them on an altar and praying)" : "");
likes.push_back(info);
break;
case GOD_NEMELEX_XOBEH:
snprintf(info, INFO_SIZE, "sacrifice items%s",
verbose ? " (by standing over them and praying)" : "");
likes.push_back(info);
break;
case GOD_ZIN:
snprintf(info, INFO_SIZE, "sacrifice gold%s",
verbose ? " (by praying at an altar)" : "");
likes.push_back(info);
break;
default:
break;
}
if (god_likes_butchery(which_god))
likes.push_back("butcher corpses while praying");
switch (which_god)
{
case GOD_KIKUBAAQUDGHA: case GOD_YREDELEMNUL: case GOD_OKAWARU:
case GOD_VEHUMET: case GOD_MAKHLEB: case GOD_TROG:
case GOD_BEOGH: case GOD_LUGONU:
likes.push_back("kill living beings");
break;
default:
break;
}
switch (which_god)
{
case GOD_SHINING_ONE: case GOD_OKAWARU: case GOD_VEHUMET:
case GOD_MAKHLEB: case GOD_LUGONU:
likes.push_back("kill the undead");
break;
default:
break;
}
switch (which_god)
{
case GOD_SHINING_ONE: case GOD_OKAWARU: case GOD_MAKHLEB:
likes.push_back("kill demons");
break;
default:
break;
}
// Unusual kills.
switch (which_god)
{
case GOD_ZIN:
likes.push_back("kill monsters which cause mutation or rotting");
break;
case GOD_SHINING_ONE:
likes.push_back("kill living evil beings");
break;
case GOD_BEOGH:
likes.push_back("kill the priests of other religions");
break;
case GOD_TROG:
likes.push_back("kill wizards and other users of magic");
break;
default:
break;
}
if (likes.size() == 0)
{
text += " %s doesn't like anything? This a bug; please report it.";
}
else
{
text += " likes it when you ";
text += comma_separated_line(likes.begin(), likes.end(),
" and ", ", ");
text += ".";
}
return (text);
}
// verbose currently unused
std::string print_god_dislikes(god_type which_god, bool /*verbose*/)
{
// Return early for the special cases.
if (which_god == GOD_NO_GOD || which_god == GOD_XOM)
return "";
std::vector<std::string> dislikes;
if (god_hates_butchery(which_god))
dislikes.push_back("butcher corpses while praying");
if (is_good_god(which_god))
{
dislikes.push_back("drink blood");
dislikes.push_back("perform cannibalism");
dislikes.push_back("use necromancy");
dislikes.push_back("use unholy magic or items");
dislikes.push_back("attack holy beings");
dislikes.push_back("attack neutral beings");
}
switch (which_god)
{
case GOD_ZIN: case GOD_SHINING_ONE: case GOD_ELYVILON:
case GOD_OKAWARU:
dislikes.push_back("attack allies");
break;
case GOD_BEOGH:
dislikes.push_back("attack allied orcs");
break;
default:
break;
}
switch (which_god)
{
case GOD_ELYVILON: case GOD_ZIN: case GOD_OKAWARU:
dislikes.push_back("allow an ally to die");
break;
default:
break;
}
switch (which_god)
{
case GOD_ZIN:
dislikes.push_back("cause yourself to mutate in a way that could "
"have been avoided");
dislikes.push_back("eat the flesh of sentient beings");
break;
case GOD_SHINING_ONE:
dislikes.push_back("poison a monster");
dislikes.push_back("attack in an unchivalric manner");
break;
case GOD_ELYVILON:
dislikes.push_back("kill a living thing while praying");
break;
case GOD_TROG:
dislikes.push_back("memorize spells");
dislikes.push_back("cast spells");
break;
default:
break;
}
if (dislikes.empty())
return "";
std::string text = god_name(which_god);
text += " dislikes it when you ";
text += comma_separated_line(dislikes.begin(), dislikes.end(),
" or ", ", ");
text += ".";
return (text);
static void _detailed_god_description(god_type which_god)
{
clrscr();
int width = get_number_of_cols();
if (width > 80)
width = 80;
std::string godname = god_name(which_god, true);
int len = get_number_of_cols() - godname.length();
textcolor(god_colour(which_god));
cprintf("%s%s" EOL, std::string(len / 2, ' ').c_str(), godname.c_str());
textcolor(LIGHTGREY);
cprintf(EOL);
if (which_god == GOD_XOM)
{
cprintf("To worship Xom is to live riskily. In a good mood Xom may "
"shower you " EOL
"with gifts, while at other times this capricious god could "
"decide to " EOL
"\"spice things up a little\" and send you to your doom. If "
"you prove " EOL
"yourself the stronger, so much the better; if not, well, "
"there'll be " EOL
"other playthings..." EOL);
}
else
{
std::string broken = print_god_likes(which_god, true);
linebreak_string2(broken, width);
formatted_string::parse_block(broken, false).display();
cprintf(EOL);
cprintf(EOL);
broken = print_god_dislikes(which_god, true);
linebreak_string2(broken, width);
formatted_string::parse_block(broken, false).display();
}
int bottom_line = get_number_of_lines();
if (bottom_line > 30)
bottom_line = 30;
cgotoxy(1, bottom_line-1);
formatted_string::parse_string(
"Press '<w>!</w>' to toggle between the overview and the more detailed "
"description.").display();
#ifdef USE_TILE
mouse_control mc(MOUSE_MODE_MORE);
#endif
const int keyin = getch();
if (keyin == '!')
describe_god(which_god, true);
}
switch (mon_num)
{
case MONS_BLACK_DRACONIAN:
case MONS_MOTTLED_DRACONIAN:
case MONS_YELLOW_DRACONIAN:
case MONS_GREEN_DRACONIAN:
case MONS_PURPLE_DRACONIAN:
case MONS_RED_DRACONIAN:
case MONS_WHITE_DRACONIAN:
case MONS_PALE_DRACONIAN:
mon.base_monster = mon_num;
break;
default:
mon.base_monster = MONS_PROGRAM_BUG;
break;
}
switch (mon_num)
{
case MONS_BLACK_DRACONIAN:
case MONS_MOTTLED_DRACONIAN:
case MONS_YELLOW_DRACONIAN:
case MONS_GREEN_DRACONIAN:
case MONS_PURPLE_DRACONIAN:
case MONS_RED_DRACONIAN:
case MONS_WHITE_DRACONIAN:
case MONS_PALE_DRACONIAN:
mon.base_monster = mon_num;
break;
default:
mon.base_monster = MONS_PROGRAM_BUG;
break;
}
std::string symbol_prefix = "__";
symbol_prefix += symbol;
symbol_prefix += "_prefix";
desc = getLongDescription(symbol_prefix) + desc;
std::string symbol_prefix = "__";
symbol_prefix += symbol;
symbol_prefix += "_prefix";
desc = getLongDescription(symbol_prefix) + desc;
std::string symbol_suffix = "__";
symbol_suffix += symbol;
symbol_suffix += "_suffix";
desc += getLongDescription(symbol_suffix);
std::string symbol_suffix = "__";
symbol_suffix += symbol;
symbol_suffix += "_suffix";
desc += getLongDescription(symbol_suffix);
}