summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/it_use2.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-22 09:21:32 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-22 09:21:32 +0000
commitfaa6d08c428ad8280f84707fa8d4586440b98631 (patch)
tree9efc32b7df06c6ecc579766f5b0a7ab24c4a73d1 /crawl-ref/source/it_use2.cc
parentcce90fadce5dca04e3000cf488e619975bddd8ae (diff)
downloadcrawl-ref-faa6d08c428ad8280f84707fa8d4586440b98631.tar.gz
crawl-ref-faa6d08c428ad8280f84707fa8d4586440b98631.zip
Added additional optional parameter to item_def::name(), ignore_flags,
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
Diffstat (limited to 'crawl-ref/source/it_use2.cc')
-rw-r--r--crawl-ref/source/it_use2.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index cd805455fc..d370aae720 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -109,7 +109,7 @@ bool potion_effect( potion_type pot_eff, int pow )
if ( were_mighty )
contaminate_player(1);
else
- modify_stat(STAT_STRENGTH, 5, true);
+ modify_stat(STAT_STRENGTH, 5, true, "");
// conceivable max gain of +184 {dlb}
you.duration[DUR_MIGHT] += 35 + random2(pow);
@@ -215,7 +215,8 @@ bool potion_effect( potion_type pot_eff, int pow )
case POT_DEGENERATION:
mpr("There was something very wrong with that liquid!");
- if (lose_stat(STAT_RANDOM, 1 + random2avg(4, 2)))
+ if (lose_stat(STAT_RANDOM, 1 + random2avg(4, 2), false,
+ "drinking a potion of degeneration"))
xom_is_stimulated(64);
break;
@@ -500,7 +501,9 @@ void unwear_armour(char unw)
you.redraw_armour_class = 1;
you.redraw_evasion = 1;
- switch (get_armour_ego_type( you.inv[unw] ))
+ item_def &item(you.inv[unw]);
+
+ switch (get_armour_ego_type( item ))
{
case SPARM_RUNNING:
mpr("You feel rather sluggish.");
@@ -530,15 +533,15 @@ void unwear_armour(char unw)
break;
case SPARM_STRENGTH:
- modify_stat(STAT_STRENGTH, -3, false);
+ modify_stat(STAT_STRENGTH, -3, false, item, true);
break;
case SPARM_DEXTERITY:
- modify_stat(STAT_DEXTERITY, -3, false);
+ modify_stat(STAT_DEXTERITY, -3, false, item, true);
break;
case SPARM_INTELLIGENCE:
- modify_stat(STAT_INTELLIGENCE, -3, false);
+ modify_stat(STAT_INTELLIGENCE, -3, false, item, true);
break;
case SPARM_PONDEROUSNESS:
@@ -621,9 +624,12 @@ void unuse_randart(const item_def &item)
}
// modify ability scores, always output messages
- 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);
if (proprt[RAP_NOISES] != 0)
you.special_wield = SPWLD_NONE;