git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8442 c06c8d41-db1a-0410-9941-cceddc491573
3TYLZMKPDKBUM4NJ36PJIINJNTMXDYL7CSYW6VQNJ5U3XWCOLLJAC RUGNJUKFHD36CQCJO4XODEUS5P6XRI5CGEU5JJA6FYPSJ5YRAJGQC RBAGQ2PB7V5YAM5KSHSZR2E3MLKDSRVM5XYGI2TIXP5QMVBOQHDQC VK3LNDA3TXEPBMLDWBTEBDOZMPP3YUED3A624XMHWI6FI7LP3HGAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC MSQI3TH6T62JAXQGLL52QZCWAMC372TGB6ZNNRDGUGMJKBNNV2VAC WT66JDIRTLLP37SHTV4GI3V64JFJ4D25LNRLGCHFG6CLEFKJ3QGQC 7OC5HCGLN26GDA5SQTWKBSUZYZDZJXWIVMJ4NKKXREOEEPUGQ4YQC 4IE6LVHAQEALNGRIXCQZ7RINKLZ62TMCCKKD74Q7MCDSXLZOA2UQC KEYK3CH5J46U6TTOKTWRNMYTZXMQXFVEAZUC4ZQ4QCOSJHVIBDRQC short mon_resist_def::get_resist_level(mon_resist_flags res_type) const{switch (res_type){case MR_RES_ELEC:return elec;case MR_RES_POISON:return poison;case MR_RES_FIRE:return fire;case MR_RES_STEAM:return steam;case MR_RES_COLD:return cold;case MR_RES_ACID:return acid;default:return (0);}}
}}static int _get_resist_level(const mon_resist_def resist,mon_resist_flags res_type){switch (res_type){case MR_RES_ELEC:return resist.elec;case MR_RES_POISON:return resist.poison;case MR_RES_FIRE:return resist.fire;case MR_RES_STEAM:return resist.steam;case MR_RES_COLD:return resist.cold;case MR_RES_ACID:return resist.acid;default:return (0);
const char* modifiers[] = {"susceptible", // -1"resistant", // +1"very resistant", // +2"extremely resistant" // +3
const mon_resist_def resist = get_mons_resists(&mon);const mon_resist_flags resists[] = {MR_RES_ELEC, MR_RES_POISON, MR_RES_FIRE,MR_RES_STEAM, MR_RES_COLD, MR_RES_ACID
const mon_resist_def resist = get_mons_resists(&mon);std::vector<mon_resist_flags> resists;resists.push_back(MR_RES_ELEC);resists.push_back(MR_RES_POISON);resists.push_back(MR_RES_FIRE);resists.push_back(MR_RES_STEAM);resists.push_back(MR_RES_COLD);resists.push_back(MR_RES_ACID);
result = modifiers[3];result += " to ";result += comma_separated_line(extreme_resists.begin(),extreme_resists.end()," and ", ", ");all_resists.push_back(result);
const std::string tmp = "extremely resistant to "+ comma_separated_line(extreme_resists.begin(),extreme_resists.end());resist_descriptions.push_back(tmp);
result = modifiers[2];result += " to ";result += comma_separated_line(high_resists.begin(),high_resists.end()," and ", ", ");all_resists.push_back(result);
const std::string tmp = "very resistant to "+ comma_separated_line(high_resists.begin(), high_resists.end());resist_descriptions.push_back(tmp);
result = modifiers[1];result += " to ";result += comma_separated_line(base_resists.begin(),base_resists.end()," and ", ", ");all_resists.push_back(result);
const std::string tmp = "resistant to "+ comma_separated_line(base_resists.begin(), base_resists.end());resist_descriptions.push_back(tmp);
result = pronoun;result += " is ";result += comma_separated_line(all_resists.begin(),all_resists.end(),"; and ", "; ");result += ".$";
result << pronoun << " is "<< comma_separated_line(resist_descriptions.begin(),resist_descriptions.end(),"; and ", "; ")<< ".$";
result += pronoun;result += " is ";result += modifiers[0];result += " to ";result += comma_separated_line(suscept.begin(),suscept.end()," and ", ", ");result += ".$";
result << pronoun << " is susceptible to "<< comma_separated_line(suscept.begin(), suscept.end())<< ".$";
{result += pronoun;result += " can ";result += (fly == FL_FLY ? "fly" : "levitate");result += ".$";}return result;}/*// Return a string of the form "She is resistant to fire."static std::string _resistance_description(const char* pronoun,int level, const char* attackname){const char* modifiers[] = {"susceptible", // -1"resistant", // +1"very resistant", // +2"extremely resistant" // +3};std::string result;if (level != 0)
const int offset = (level < 0) ? 0 : std::min(level, 3);result = pronoun;result += " is ";result += modifiers[offset];result += " to ";result += attackname;result += ".$";
result << pronoun << " can "<< (fly == FL_FLY ? "fly" : "levitate") << ".$";
static std::string _monster_resists_string(const monsters& mon){const mon_resist_def resist = get_mons_resists(&mon);const char* pronoun = mons_pronoun(static_cast<monster_type>(mon.type),PRONOUN_CAP, true);std::string result;// Not shown: hellfire, asphyxiation, sticky flames.result += _resistance_description(pronoun, resist.elec, "electricity");result += _resistance_description(pronoun, resist.poison, "poison");result += _resistance_description(pronoun, resist.fire, "fire");result += _resistance_description(pronoun, resist.steam, "steam");result += _resistance_description(pronoun, resist.cold, "cold");result += _resistance_description(pronoun, resist.acid, "acid");return result;
return result.str();
//---------------------------------------------------------------//// describe_monsters//// Contains sketchy descriptions of every monster in the game.////---------------------------------------------------------------