Allow piety gain messages to contain color info. If the messages contain <> and </>, these are converted to color tags depending on the piety gain amount. Sorry David, no random rainbows.
Only changed Nemelex and Elyvilon messages for now (don't have a lot of time). David, you may not like the colors or the color placement; please change it if it's bad (see _print_sacrifice_message and _Sacrifice_Messages)
Elyvilon weapon destruction uses sacrifice messages when destroying weapons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4094 c06c8d41-db1a-0410-9941-cceddc491573
IIUK3DT26O7F4IBKB6QFTPLO4EVKBH55SAEXLNQEQRLDGJ37NDGAC
UFMLS3XTVA5IUYWNJUHXCR67X5QI26PRFKGWBM6CGWSE2VUPBBJQC
UFKLHUYL7WAQ3CI3D42T4C6KBGAUR63DSQAUQTTZG7GJMXSCVJWAC
3JDGJ4QUIV5G3A4CHT7OE3JVGJMXIY62OHVNS7A246HGGL3PDRDAC
VXMRWJ2CPHIB2NAHMZKUV7DAFA7GLVA32WDS53WNT3BIDHK6GOZQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
TZTHE3TEKUDMNLAXWKHO66SYIVCVCIOJLKF3MCHSNJTXCKTWK3LAC
DAVJD5BPBRHDN4EW4XOYJY4LEES76JCOV2N72Z7RS6QTS5BDIHGAC
KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC
PRQVFUGUGPKI2Q74ODEI3CYUJQB63CKC6ONQTE3BTOHKXG4JCNLQC
Y7ZDLE2BHSLBQUXBWLAFBJXXIH5WYGPBRJDIH33WX7VPLO7PFODQC
MOT3YZFRY3JG2MH3GN2VD6IY3IJSAXJUXMXS222TXWKRFCENOCDQC
WHY6LRRJ5T2NSBE3IUCR4X3TOAH7TTK5NPUPUIFT7TPNJ6J4HBDAC
2SU35FKBXMKAYJY76OXAC55R6JWTSHQSHBNBR3ICWUQREJME2ZSAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
UKN6HTZXDUUOWKNWNKWPHKGUGL474JIAQN5JU3DM3DU26WGMNP4AC
E42EFZ3RINKLTGOJJZAH2N5QF3P4S5NCO5T52HLXJRMBPP463HTAC
EFWEYIB2R3DPD3JWIPU6LS6SFLPMYN7J7X4GBZR7DJWKHJ3UELSAC
264FLET5STFALEWUDOEFCR273Y5CY2WZDHL56WHZUAQ635RUN6MAC
" disappear% without a glow.",
" glow% slightly and disappear%.",
" glow% with a rainbow of weird colours and disappear%.",
" disappear% <>without a glow</>.",
" <>glow% slightly</> and disappear%.",
" <>glow% with a rainbow of weird colours</> and disappear%.",
" slowly evaporate%.",
" evaporate%.",
" glow% and evaporate%.",
" <>barely shimmer%</> and break% into pieces.",
" <>shimmer%</> and break% into pieces.",
" <>turn% into a cloud of bugs</>.",
// " <>slowly evaporate%</>.",
// " <>evaporate%</>.",
// " <>glow% and evaporate%</>.",
std::ostream& strm = msg::streams(MSGCH_GOD);
strm << mitm[i].name(DESC_CAP_THE);
if (!pgain)
strm << " barely";
if ( mitm[i].quantity == 1 )
strm << " shimmers and breaks into pieces." << std::endl;
else
strm << " shimmer and break into pieces." << std::endl;
// Elyvilon doesn't care about item sacrifices at altars, so
// I'm stealing _Sacrifice_Messages.
_print_sacrifice_message(GOD_ELYVILON, mitm[i], pgain);
const char *msg = sacrifice[god][!!gained_piety];
const char *be = item.quantity == 1? "is" : "are";
std::string::size_type start = 0;
std::string::size_type found;
while ((found = s.find(find, start)) != std::string::npos)
{
s.replace( found, find.length(), repl );
start = found + repl.length();
}
}
// "The bread ration evaporates", "The arrows evaporate" - the s suffix
// is for verbs.
const char *ssuffix = item.quantity == 1? "s" : "";
return (replace_all(replace_all(msg, "%", ssuffix), "&", be));
static void _print_sacrifice_message(god_type god, const item_def &item,
piety_gain_t piety_gain)
{
std::string msg(_Sacrifice_Messages[god][piety_gain]);
_replace(msg, "%", (item.quantity == 1? "s" : ""));
_replace(msg, "&", (item.quantity == 1? "is" : "are"));
const char *tag_start, *tag_end;
switch (piety_gain)
{
case PIETY_NONE:
tag_start = "<lightgrey>";
tag_end = "</lightgrey>";
break;
default:
case PIETY_SOME:
tag_start = tag_end = "";
break;
case PIETY_LOTS:
tag_start = "<white>";
tag_end = "</white>";
break;
}
_replace(msg, "<>", tag_start);
_replace(msg, "</>", tag_end);
msg.insert(0, item.name(DESC_CAP_THE));
formatted_message_history(msg, MSGCH_GOD);