Vampires' drinking habits.
Allow other channels than MSGCH_TUTORIAL to use formatted strings and use it to send a coloured string through the butcher prompt, thus visibly setting off dangerous corpses. I'd like normal corpses (no patterns in food_colouring.txt matching) not to be highlighted at all, but they're currently shown in lightgrey, that will have to be improved.
Fix Vampire mutation screen displaying poison resistance wrongly.
Add a new option force_more_message whose syntax is copied from travel_stop_message. Any message containing a regex within this listing will enforce a -More- prompt. By default, it's only enabled for "You start to lose your buoyoncy."
Tweak the messages for Kenku flying to fix 1823833.
Make Xom be amused at players teleporting in a labyrinth or when becoming (Near) Starving while in a labyrinth and with little food at their disposal.
Yes, it's one of those "Something for everyone" commits. :D
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5416 c06c8d41-db1a-0410-9941-cceddc491573
57E4T664CXRFPVW2BZBYI33UIHFS4PSEZURZYPSYSZK5DRLJJ5CQC VSP2UVEASZS7NATQOC6C73SGVLLVVLFEPFSQKYGBM4I4D3HFE77QC ZPYW5XKEOCWWBR2RSIKRLKAHI3KQJNYWM4PBV5LFYWSL4RWL2HOQC SBTVKHKZRMVDBYLGQNMZMJXPAYJG43UWBBD7HQJWIPN3BMMHUBJAC 4DGRUR65VRRSNJH33DNNC5IWLDXEYF4MDE5CPNYQE7DPLQOC5THQC IOMV4CS3PJA6VO3NYB6T45OTXQ5QYP6LT4JOCSLPKP22HWZ3FFKQC RX6575DZOHRUXQUZH34YZGPZJF4STUPLBQDIVTINA2L6LVCKRIGQC QTFUA7DXD2QGKBXT7S5Z7RDHZ7BYFYWZOZPOTP5ZBR3PMKH257NQC 6I5DGAACRD7U5HAN3EEKPL7MPZXEVGUNJU5REFL4Q2SRZJ5WKDDAC KZQCE332EGX6EOALDW5QKS7CBYORFCOOM7UYE3B2U5PCOIKTMWYQC 5BJPWUPLJFS34FUTFJVKA4A52YMIGV6EWDXLNSDCWBJWBGVSQFGQC UM2LNJ6FBISGASDHAZZPJEHTXRW4HPQZUTJPMZQ5PGWZOQEQB6RAC KFUL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V6NHWFLTGUYAC RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC WL5WZXFJ6TONUQRSHUY4GQ5USU47ILWNN5X2JDQZO4CRJJZSRQIAC EOMCPVNQLX3IMLC46EAO67DPBH5KEG2FQTPBLGU62HIRWA3UQ7XQC EHSY6DVGUMI6C67WKET3GDJVLWJWGYBYQONNDK5JVT7BCTHBEZVAC // like yesno(), but returns 0 for no, 1 for yes, and -1 for quit// alt_yes and alt_yes2 allow up to two synonyms for 'Y'
// Like yesno(), but returns 0 for no, 1 for yes, and -1 for quit.// alt_yes and alt_yes2 allow up to two synonyms for 'Y'.// FIXME: This function is shaping up to be a monster. Help!
if (randtele && player_in_a_dangerous_place()&& you.level_type != LEVEL_ABYSS)
// Teleporting in a labyrinth is also funny, but only for non-minotaurs.if (randtele&& (you.level_type == LEVEL_LABYRINTH && you.species != SP_MINOTAUR|| you.level_type != LEVEL_ABYSS && player_in_a_dangerous_place()))
return;}std::string help = inf;if (help.find("</") != std::string::npos){std::string col = colour_to_str(channel_to_colour(channel));if (!col.empty())help = "<" + col + ">" + help + "</" + col + ">";// Handing over to the experts...formatted_mpr(formatted_string::parse_string(help), channel);
// checks whether a given message contains patterns relevant for// notes, stop_running or sounds and handles these cases
// Checks whether a given message contains patterns relevant for// notes, stop_running or sounds and handles these cases.
// message playback explicitly only handles colors for// the tutorial channel... guess we'll store bare strings// for the rest, then.if (channel == MSGCH_TUTORIAL)mpr_store_messages(fs.to_colour_string(), channel, param);elsempr_store_messages(unformatted, channel, param);
for (unsigned f = 0; f < Options.force_more_message.size(); ++f){if (Options.force_more_message[f].is_filtered(channel, st_nocolor)){more();New_Message_Count = 0;// One more() is quite enough, thank you!break;}}mpr_store_messages(fs.to_colour_string(), channel, param);
// for tutorial texts (for now, used for debugging)// allow formatted output of tagged messagesif (Store_Message[ line ].channel == MSGCH_TUTORIAL)
// Allow formatted output of tagged messages.formatted_string fs = formatted_string::parse_string(text, true);int curcol = 1;for ( unsigned int j = 0; j < fs.ops.size(); ++j )
switch ( fs.ops[j].type ){case FSOP_COLOUR:colour = fs.ops[j].x;break;case FSOP_TEXT:textcolor( colour );cgotoxy(curcol, wherey(), GOTO_CRT);cprintf(fs.ops[j].text.c_str());curcol += multibyte_strlen(fs.ops[j].text);break;case FSOP_CURSOR:break;}
case FSOP_COLOUR:colour = fs.ops[j].x;break;case FSOP_TEXT:textcolor( colour );cgotoxy(curcol, wherey(), GOTO_CRT);cprintf(fs.ops[j].text.c_str());curcol += multibyte_strlen(fs.ops[j].text);break;case FSOP_CURSOR:break;
else#if DEBUG_DIAGNOSTICScprintf( "%d: %s", line, text.c_str() );#elsecprintf( "%s", text.c_str() );#endif
message_filter( fragments[i] ) );}}else if (key == "force_more_message"){std::vector<std::string> fragments = split_string(",", field);for (int i = 0, count = fragments.size(); i < count; ++i){if (fragments[i].length() == 0)continue;std::string::size_type pos = fragments[i].find(":");if (pos && pos != std::string::npos){std::string prefix = fragments[i].substr(0, pos);int channel = str_to_channel( prefix );if (channel != -1 || prefix == "any"){std::string s = fragments[i].substr( pos + 1 );trim_string( s );force_more_message.push_back(message_filter( channel, s ) );continue;}}force_more_message.push_back(
text << "If you dropped the " << noun << " in your pack on solid "<< "ground then you could " << verb << " " << pronoun << ".";
text << "If you dropped the " << noun << " in your pack "<< "then you could " << verb << " " << pronoun << ".";
std::string corpse_name = mitm[o].name(DESC_NOCAP_A);const bool sacrifice = (you.duration[DUR_PRAYER]&& god_likes_butchery(you.religion));// We don't need to check for undead because// * Mummies can't eat// * Ghouls relish the bad things// * Vampires won't bottle bad corpsesif (!sacrifice && !you.is_undead){// Don't bother colouring if it's only for sacrificing.std::string cprf = menu_colour_item_prefix(mitm[o]);std::string colour = "";std::string colour_off = "";int col = menu_colour(corpse_name, cprf, "pickup");if (col != LIGHTGRAY)colour = colour_to_str( col );if (!colour.empty()){// Order is important here.colour_off = "</" + colour + ">";colour = "<" + colour + ">";corpse_name = colour + corpse_name + colour_off;}}
(!can_bottle_blood_from_corpse(mitm[o].plus)|| you.duration[DUR_PRAYER]&& god_likes_butchery(you.religion)) ? "Butcher": "Bottle",mitm[o].name(DESC_NOCAP_A).c_str());
(sacrifice|| !can_bottle_blood_from_corpse(mitm[o].plus)) ?"Butcher" : "Bottle",corpse_name.c_str());
static bool _player_has_enough_food(){int food_value = 0;item_def item;for (unsigned slot = 0; slot < ENDOFPACK; ++slot){item = you.inv[slot];if (!is_valid_item(item))continue;if (!can_ingest(item.base_type, item.sub_type, true, true, false))continue;if (food_is_rotten(item) && !player_mutation_level(MUT_SAPROVOROUS))continue;if (is_poisonous(item))continue;if (is_mutagenic(item))continue;if (causes_rot(item) && you.species != SP_GHOUL)continue;// Vampires can only drain corpses.if (you.species == SP_VAMPIRE)food_value += 3;else{if (item.base_type != OBJ_FOOD)continue;switch (item.sub_type){case FOOD_CHUNK:if (!player_mutation_level(MUT_HERBIVOROUS))food_value += 2 * item.quantity;break;case FOOD_MEAT_RATION:if (!player_mutation_level(MUT_HERBIVOROUS))food_value += 3 * item.quantity;break;case FOOD_BREAD_RATION:if (!player_mutation_level(MUT_CARNIVOROUS))food_value += 3 * item.quantity;break;default:// Only count snacks if we really like themif (is_preferred_food(item))food_value += item.quantity;break;}}}// You have "enough" food if you have, e.g.// 1 meat ration + 1 chunk, or 2 chunks for carnivores, or// 5 items of fruit, or 1 bread ration and 2 fruit items as a herbivore.return (food_value > 5);}
// Now you can only turn levitation off if you have an// activatable item. Potions and miscast effects will// have to time out (this makes the miscast effect actually// a bit annoying). -- bwr_add_talent(talents, you.duration[DUR_LEVITATION] ?ABIL_EVOKE_STOP_LEVITATING : ABIL_EVOKE_LEVITATE,check_confused);
// Has no effect on permanently flying Kenku.if (!you.permanent_levitation() && you.flight_mode() != FL_FLY){// Now you can only turn levitation off if you have an// activatable item. Potions and miscast effects will// have to time out (this makes the miscast effect actually// a bit annoying). -- bwr_add_talent(talents, you.duration[DUR_LEVITATION] ?ABIL_EVOKE_STOP_LEVITATING : ABIL_EVOKE_LEVITATE,check_confused);}
travel_stop_message, runrest_ignore_message,runrest_ignore_poison, runrest_ignore_monster,trapwalk_safe_hp, trap_prompt, rest_wait_both
travel_stop_message, force_more_message,runrest_ignore_message, runrest_ignore_poison,runrest_ignore_monster, trapwalk_safe_hp,trap_prompt, rest_wait_both