summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-15 15:34:56 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-15 15:34:56 +0000
commitc0447d60a042e50f127de3d8bde1868b648fd127 (patch)
tree6be6e149a4be10812ff306227d1b0ccf49980ec6 /crawl-ref/source/player.cc
parent6b01f8a9a0e4d0cfbad1beb76002810d8e0203a8 (diff)
downloadcrawl-ref-c0447d60a042e50f127de3d8bde1868b648fd127.tar.gz
crawl-ref-c0447d60a042e50f127de3d8bde1868b648fd127.zip
Add still more minor cosmetic fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5053 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc71
1 files changed, 36 insertions, 35 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index b131b2a2f8..5774d736e5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2986,7 +2986,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 4))
{
modify_stat( (coinflip() ? STAT_INTELLIGENCE
- : STAT_DEXTERITY), 1, false,
+ : STAT_DEXTERITY), 1, false,
"level gain");
}
break;
@@ -3021,7 +3021,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 5))
{
modify_stat( (coinflip() ? STAT_STRENGTH
- : STAT_DEXTERITY), 1, false,
+ : STAT_DEXTERITY), 1, false,
"level gain");
}
@@ -3113,7 +3113,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 4))
{
modify_stat( (coinflip() ? STAT_INTELLIGENCE
- : STAT_DEXTERITY), 1, false,
+ : STAT_DEXTERITY), 1, false,
"level gain");
}
break;
@@ -3272,7 +3272,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 4))
{
modify_stat( (coinflip() ? STAT_DEXTERITY
- : STAT_STRENGTH), 1, false,
+ : STAT_STRENGTH), 1, false,
"level gain");
}
@@ -3314,7 +3314,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 5))
{
modify_stat( (coinflip() ? STAT_INTELLIGENCE
- : STAT_DEXTERITY), 1, false,
+ : STAT_DEXTERITY), 1, false,
"level gain");
}
break;
@@ -4453,14 +4453,6 @@ void modify_stat(stat_type which_stat, char amount, bool suppress_msg,
msg += ((amount > 0) ? "stronger." : "weaker.");
break;
- case STAT_DEXTERITY:
- ptr_stat = &you.dex;
- ptr_stat_max = &you.max_dex;
- ptr_redraw = &you.redraw_dexterity;
- kill_type = KILLED_BY_CLUMSINESS;
- msg += ((amount > 0) ? "agile." : "clumsy.");
- break;
-
case STAT_INTELLIGENCE:
ptr_stat = &you.intel;
ptr_stat_max = &you.max_intel;
@@ -4469,6 +4461,14 @@ void modify_stat(stat_type which_stat, char amount, bool suppress_msg,
msg += ((amount > 0) ? "clever." : "stupid.");
break;
+ case STAT_DEXTERITY:
+ ptr_stat = &you.dex;
+ ptr_stat_max = &you.max_dex;
+ ptr_redraw = &you.redraw_dexterity;
+ kill_type = KILLED_BY_CLUMSINESS;
+ msg += ((amount > 0) ? "agile." : "clumsy.");
+ break;
+
default:
break;
}
@@ -5163,7 +5163,8 @@ int count_worn_ego( int which_ego )
static int _strength_modifier()
{
int result = 0;
- if ( you.duration[DUR_MIGHT] )
+
+ if (you.duration[DUR_MIGHT])
result += 5;
// ego items of strength
@@ -5194,6 +5195,26 @@ static int _strength_modifier()
return result;
}
+static int _int_modifier()
+{
+ int result = 0;
+
+ // ego items of intelligence
+ result += 3 * count_worn_ego(SPARM_INTELLIGENCE);
+
+ // rings of intelligence
+ result += player_equip( EQ_RINGS_PLUS, RING_INTELLIGENCE );
+
+ // randarts of intelligence
+ result += scan_randarts(RAP_INTELLIGENCE);
+
+ // mutations
+ result += player_mutation_level(MUT_CLEVER)
+ - player_mutation_level(MUT_DOPEY);
+
+ return result;
+}
+
static int _dex_modifier()
{
int result = 0;
@@ -5237,33 +5258,13 @@ static int _dex_modifier()
return result;
}
-static int _int_modifier()
-{
- int result = 0;
-
- // ego items of intelligence
- result += 3 * count_worn_ego(SPARM_INTELLIGENCE);
-
- // rings of intelligence
- result += player_equip( EQ_RINGS_PLUS, RING_INTELLIGENCE );
-
- // randarts of intelligence
- result += scan_randarts(RAP_INTELLIGENCE);
-
- // mutations
- result += player_mutation_level(MUT_CLEVER)
- - player_mutation_level(MUT_DOPEY);
-
- return result;
-}
-
int stat_modifier( stat_type stat )
{
switch ( stat )
{
case STAT_STRENGTH: return _strength_modifier();
- case STAT_DEXTERITY: return _dex_modifier();
case STAT_INTELLIGENCE: return _int_modifier();
+ case STAT_DEXTERITY: return _dex_modifier();
default:
mprf(MSGCH_DANGER, "Bad stat: %d", stat);
return 0;