which will cause the name to be constructed as if those item flags had been unset.
Give an auxiliary cause of death for a stat going below 1. (Death by stat loss is already pretty rare, and death by stat loss with confusion as to what caused the stat loss must be really rare, but still, if you were confused about what caused the stat loss that lead to death, that'd be pretty frustrating)
ouch() is now called from within modify_stat() and lose_stat() right after the stat is lowered, rather than when the stat is updated on the screen. This incidentally fixes the minor annoyance of saying "no" to stat loss death in wizard mode, only to be asked if you want to die every time the screen is updated until you fix having a non-positive stat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2179 c06c8d41-db1a-0410-9941-cceddc491573
CLIEHAE2PP7ZIGLLIMYCWM4FC54KBOAN5AILOLAZJ5S26GTJM4RQC KBBSDMAXAGEDFMIVL6BSPMMSOBZKWPJTFCLBGCHRLE5DGTVAACSAC HFCPPPYI366EDKNBDGVNSAW76OGQA2NYTKLSP4LC3VYKHPLWFJ6QC SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC WUTE7R6SROKLIWR3QASJSH2IZDJNPAIMWJRUSISQTN4YMKNFTODQC KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC P2ZCF3BBG523ZEOD6XQA4X5YEHBTWH3IM33YVHXP2SQ5POXZIH4QC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC HVNEDQRIUCCAUXUYVAGIUUKPUPU6JFA2PJ5LHPMIBICCCAAVVJEQC AREBCIU2RU2RNHBWD4GARWEBKSL7HDFGDLII22H56OJO2AQUOMLQC GNJGG33CNP6IWUW4V2JKIFAC5N43TP5MX4PZOTXROBYZVXQEAJLAC SWOYPTHJAWFEDBMB3ROT33VQZIXGZD5UOXEV456DDUENW2HGA66QC LABXKXWWQY2V4FUDLGVTDYHXINAP6KRHZDHBQ2FE22FFOEIZPL6QC IIN7AVA6JYRBXH6ZYRR7BY7TV6PW7ANAQ2A3PD55FKBKKQFEEF2AC XRZPPYWPWUOM4SFNI6BHKH2UKJQNLKOV6Y7XIEPEZXE5QYRT26PAC QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC JW2KRJHES33W7UTWZ6NDO4TLMK4EFU4HKZXBWR2UJOMPCCOTR4CQC I2B33Z7NZGC33AMDSSK446AZZYWKPHWLAGULVHKKZU4MVB4BNJOAC 5V47S4NNTHWTSAHV3YLO2VGH7JTUIYJ3GBPDN5ZM4UQALT2ZEXDQC BWAQ3FHBBM6G3K3KYP75CRTR343RDQZJRYX5ZGYUEXYBAC3APDLAC VNHFP63ZLLZU3A3PLXP4BITX57DUIYDHFOHQYK3BOBHV3S64G26QC 2KTJHQUX2LTU2BCLS5YXVRRKMOYKKIZAPF2LBKORFGSHEN5IO3IAC 6GDKXNFXPKQ6AVNOSMJECN7CLELM2KCMVRM2A7BARLK2NNILN6SAC JK3HFJG76OOQHJMXJUSZRTR5CX5ZMS52LRVBLOR7E2NBI6PRSHHAC JVSCP4FTW2G57C6YD5HZOZXTODGZH7TR75JQGFJBEPX3LCZH236QC SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC R22TTMI6WXWULC7ODKFF3QCB7MOTETQQ6IR4BUCUPOCQKQNCTT5AC 3KAINFIXO7WNWGUGZB43EUNFRS2ZPBLQZDTY456QACMRHYIJ7WDAC LKLHWERPXMDTRNYPEXVDVB6PE7CT5PZ6WMNJJDTBBE5FBHOCEK5AC modify_stat( STAT_DEXTERITY, -5, true );modify_stat( STAT_STRENGTH, 5, true );
modify_stat( STAT_DEXTERITY, -5, true,"losing the bat transformation" );modify_stat( STAT_STRENGTH, 5, true,"losing the bat transformation" );
void modify_stat(stat_type which_stat, char amount, bool suppress_msg);
void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const std::string cause, bool see_source = true);void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const char* cause, bool see_source = true);void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const monsters* cause);void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const item_def &cause, bool removed = false);
void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const std::string cause, bool see_source){modify_stat(which_stat, amount, suppress_msg, cause.c_str(), see_source);}void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const monsters* cause){if (cause == NULL || invalid_monster(cause)){modify_stat(which_stat, amount, suppress_msg, NULL, true);return;}bool vis = mons_near(cause) && player_monster_visible(cause);std::string name = cause->name(DESC_NOCAP_A, true);if (cause->has_ench(ENCH_SHAPESHIFTER))name += " (shapeshifter)";else if (cause->has_ench(ENCH_GLOWING_SHAPESHIFTER))name += " (glowing shapeshifter)";modify_stat(which_stat, amount, suppress_msg, name, vis);}void modify_stat(stat_type which_stat, char amount, bool suppress_msg,const item_def &cause, bool removed){std::string name = cause.name(DESC_NOCAP_THE, false, true, false, false,ISFLAG_KNOW_CURSE | ISFLAG_KNOW_PLUSES);std::string verb;
switch(cause.base_type){case OBJ_ARMOUR:case OBJ_JEWELLERY:if (removed)verb = "removing";elseverb = "wearing";break;case OBJ_WEAPONS:case OBJ_STAVES:if (removed)verb = "unwielding";elseverb = "wielding";break;case OBJ_WANDS: verb = "zapping"; break;case OBJ_FOOD: verb = "eating"; break;case OBJ_SCROLLS: verb = "reading"; break;case OBJ_POTIONS: verb = "drinking"; break;default: verb = "using";}modify_stat(which_stat, amount, suppress_msg,verb + " " + name, true);}
lose_stat(stat, amount);
if (attacker == NULL)lose_stat(stat, amount, false, "");else if (attacker->atype() == ACT_MONSTER)lose_stat(stat, amount, dynamic_cast<monsters*>(attacker), false);else if (attacker->atype() == ACT_PLAYER)lose_stat(stat, amount, false, "suicide");elselose_stat(stat, amount, false, "");
modify_stat(STAT_STRENGTH, 1, true);modify_stat(STAT_INTELLIGENCE, 1, true);modify_stat(STAT_DEXTERITY, 1, true);
modify_stat(STAT_STRENGTH, 1, true, "demonspawn mutation");modify_stat(STAT_INTELLIGENCE, 1, true, "demonspawn mutation");modify_stat(STAT_DEXTERITY, 1, true, "demonspawn mutation");
modify_stat( STAT_STRENGTH, proprt[RAP_STRENGTH], false );modify_stat( STAT_INTELLIGENCE, proprt[RAP_INTELLIGENCE], false );modify_stat( STAT_DEXTERITY, proprt[RAP_DEXTERITY], false );
modify_stat( STAT_STRENGTH, proprt[RAP_STRENGTH], false, item );modify_stat( STAT_INTELLIGENCE, proprt[RAP_INTELLIGENCE], false, item );modify_stat( STAT_DEXTERITY, proprt[RAP_DEXTERITY], false, item );
modify_stat( STAT_STRENGTH, -proprt[RAP_STRENGTH], false );modify_stat( STAT_INTELLIGENCE, -proprt[RAP_INTELLIGENCE], false );modify_stat( STAT_DEXTERITY, -proprt[RAP_DEXTERITY], false );
modify_stat( STAT_STRENGTH, -proprt[RAP_STRENGTH], false, item,true);modify_stat( STAT_INTELLIGENCE, -proprt[RAP_INTELLIGENCE], false, item,true);modify_stat( STAT_DEXTERITY, -proprt[RAP_DEXTERITY], false, item,true);
bool force = false);
bool force = false, const std::string cause = "",bool see_source = true);bool lose_stat(unsigned char which_stat, unsigned char stat_loss,bool force = false, const char* cause = NULL,bool see_source = true);bool lose_stat(unsigned char which_stat, unsigned char stat_loss,const monsters* cause, bool force = false);bool lose_stat(unsigned char which_stat, unsigned char stat_loss,const item_def &cause, bool removed, bool force = false);
bool lose_stat(unsigned char which_stat, unsigned char stat_loss, bool force,const std::string cause, bool see_source){return lose_stat(which_stat, stat_loss, force, cause.c_str(), see_source);}bool lose_stat(unsigned char which_stat, unsigned char stat_loss,const monsters* cause, bool force){if (cause == NULL || invalid_monster(cause))return lose_stat(which_stat, stat_loss, force, NULL, true);bool vis = mons_near(cause) && player_monster_visible(cause);std::string name = cause->name(DESC_NOCAP_A, true);if (cause->has_ench(ENCH_SHAPESHIFTER))name += " (shapeshifter)";else if (cause->has_ench(ENCH_GLOWING_SHAPESHIFTER))name += " (glowing shapeshifter)";return lose_stat(which_stat, stat_loss, force, name, vis);}bool lose_stat(unsigned char which_stat, unsigned char stat_loss,const item_def &cause, bool removed, bool force){std::string name = cause.name(DESC_NOCAP_THE, false, true, false, false,ISFLAG_KNOW_CURSE | ISFLAG_KNOW_PLUSES);std::string verb;switch(cause.base_type){case OBJ_ARMOUR:case OBJ_JEWELLERY:if (removed)verb = "removing";elseverb = "wearing";break;case OBJ_WEAPONS:case OBJ_STAVES:if (removed)verb = "unwielding";elseverb = "wielding";break;case OBJ_WANDS: verb = "zapping"; break;case OBJ_FOOD: verb = "eating"; break;case OBJ_SCROLLS: verb = "reading"; break;case OBJ_POTIONS: verb = "drinking"; break;default: verb = "using";}return lose_stat(which_stat, stat_loss, force, verb + " " + name, true);}