summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 15:08:48 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 15:08:48 +0000
commita291e99809652bb3308f08d777bafb134328d835 (patch)
treee6fa16ffe6ec572ac2f8ba44a62575d70a2e6bfe
parent7dd20bb5af17f48ca9a2ff5e4d63cd494e0498de (diff)
downloadcrawl-ref-a291e99809652bb3308f08d777bafb134328d835.tar.gz
crawl-ref-a291e99809652bb3308f08d777bafb134328d835.zip
Disallow quivering equipped items. (You can still (fi)re your wielded
weapon if you insist, you just can't quiver it.) And another general clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6149 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/acr.cc11
-rw-r--r--crawl-ref/source/cloud.cc2
-rw-r--r--crawl-ref/source/debug.cc10
-rw-r--r--crawl-ref/source/delay.cc11
-rw-r--r--crawl-ref/source/it_use2.cc17
-rw-r--r--crawl-ref/source/item_use.cc8
-rw-r--r--crawl-ref/source/items.cc2
-rw-r--r--crawl-ref/source/mutation.cc60
-rw-r--r--crawl-ref/source/newgame.cc1
-rw-r--r--crawl-ref/source/ouch.cc17
-rw-r--r--crawl-ref/source/player.cc66
-rw-r--r--crawl-ref/source/quiver.cc16
-rw-r--r--crawl-ref/source/skills.cc4
13 files changed, 123 insertions, 102 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 3da9db5d82..171aef1108 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -532,7 +532,7 @@ static void _handle_wizard_command( void )
case 's':
you.exp_available = 20000;
- you.redraw_experience = 1;
+ you.redraw_experience = true;
break;
case 'S':
@@ -545,7 +545,7 @@ static void _handle_wizard_command( void )
case '$':
you.gold += 1000;
- you.redraw_gold = 1;
+ you.redraw_gold = true;
if (!Options.show_gold_turns)
mprf("You now have %d gold.", you.gold);
break;
@@ -729,21 +729,22 @@ static void _handle_wizard_command( void )
set_hunger( 10999, true );
break;
- case 'H':
+ case 'H': // super-heal
you.rotting = 0;
you.duration[DUR_CONF] = 0;
you.duration[DUR_POISONING] = 0;
+ you.duration[DUR_LIQUID_FLAMES] = 0;
if (you.duration[DUR_BEHELD])
{
you.duration[DUR_BEHELD] = 0;
you.beheld_by.clear();
}
- you.duration[DUR_LIQUID_FLAMES] = 0;
+ you.magic_contamination = 0;
you.disease = 0;
inc_hp( 10, true );
set_hp( you.hp_max, false );
set_hunger( 10999, true );
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
break;
case 'b':
diff --git a/crawl-ref/source/cloud.cc b/crawl-ref/source/cloud.cc
index daaa238c0e..863a6fcc26 100644
--- a/crawl-ref/source/cloud.cc
+++ b/crawl-ref/source/cloud.cc
@@ -404,7 +404,7 @@ void in_a_cloud()
{
mpr("Your icy shield dissipates!", MSGCH_DURATION);
you.duration[DUR_CONDENSATION_SHIELD] = 0;
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
}
switch (env.cloud[cl].type)
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 57482ca992..250b8caeba 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -2444,12 +2444,12 @@ void wizard_set_skill_level(void)
break;
case SK_DODGING:
- you.redraw_evasion = 1;
+ you.redraw_evasion = true;
break;
case SK_ARMOUR:
- you.redraw_armour_class = 1;
- you.redraw_evasion = 1;
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
default:
@@ -2509,8 +2509,8 @@ void wizard_set_all_skills(void)
calc_hp();
calc_mp();
- you.redraw_armour_class = 1;
- you.redraw_evasion = 1;
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
}
}
#endif
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 52d5dac604..174da7e550 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1264,7 +1264,7 @@ static void _armour_wear_effects(const int item_slot)
if (you.duration[DUR_ICY_ARMOUR] != 0)
{
mpr( "Your icy armour melts away.", MSGCH_DURATION );
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
you.duration[DUR_ICY_ARMOUR] = 0;
}
}
@@ -1344,7 +1344,7 @@ static void _armour_wear_effects(const int item_slot)
case SPARM_PONDEROUSNESS:
mpr("You feel rather ponderous.");
// you.speed += 2;
- you.redraw_evasion = 1;
+ you.redraw_evasion = true;
break;
case SPARM_LEVITATION:
@@ -1408,12 +1408,13 @@ static void _armour_wear_effects(const int item_slot)
static command_type _get_running_command()
{
- if ( kbhit() )
+ if (kbhit())
{
stop_running();
return CMD_NO_CMD;
}
- if ( is_resting() )
+
+ if (is_resting())
{
you.running.rest();
if (!is_resting() && you.running.hp == you.hp
@@ -1424,9 +1425,7 @@ static command_type _get_running_command()
return CMD_MOVE_NOWHERE;
}
else if (Options.travel_delay > 0)
- {
delay(Options.travel_delay);
- }
return direction_to_command( you.running.x, you.running.y );
}
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 69b29c372b..8953c4eb1c 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -234,7 +234,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
// Invisibility cancels backlight.
you.duration[DUR_BACKLIGHT] = 0;
- // now multiple invisiblity casts aren't as good -- bwr
+ // Now multiple invisiblity casts aren't as good. -- bwr
if (!you.duration[DUR_INVIS])
you.duration[DUR_INVIS] = 15 + random2(pow);
else
@@ -267,7 +267,7 @@ bool potion_effect( potion_type pot_eff, int pow, bool was_known )
xom_is_stimulated(64 / factor);
break;
- // Don't generate randomly - should be rare and interesting
+ // Don't generate randomly - should be rare and interesting.
case POT_DECAY:
if (rot_player((10 + random2(10)) / factor))
xom_is_stimulated(64 / factor);
@@ -424,11 +424,11 @@ bool unwield_item(bool showMsgs)
break;
case SPWPN_SCYTHE_OF_CURSES:
case SPWPN_STAFF_OF_OLGREB:
- item.plus = 0;
+ item.plus = 0;
item.plus2 = 0;
break;
case SPWPN_STAFF_OF_WUCAD_MU:
- item.plus = 0;
+ item.plus = 0;
item.plus2 = 0;
miscast_effect( SPTYP_DIVINATION, 9, 90, 100,
"the Staff of Wucad Mu" );
@@ -476,7 +476,7 @@ bool unwield_item(bool showMsgs)
case SPWPN_PROTECTION:
if (showMsgs)
mpr("You feel less protected.");
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
break;
case SPWPN_VAMPIRICISM:
@@ -580,7 +580,6 @@ void unwear_armour(char unw)
break;
case SPARM_LEVITATION:
- //you.duration[DUR_LEVITATION]++;
if (you.duration[DUR_LEVITATION])
you.duration[DUR_LEVITATION] = 1;
break;
@@ -617,7 +616,7 @@ void unwear_armour(char unw)
unuse_randart(unw);
return;
-} // end unwear_armour()
+}
void unuse_randart(unsigned char unw)
{
@@ -662,7 +661,7 @@ void unuse_randart(const item_def &item)
}
}
- // modify ability scores, always output messages
+ // Modify ability scores; always output messages.
modify_stat( STAT_STRENGTH, -proprt[RAP_STRENGTH], false, item,
true);
modify_stat( STAT_INTELLIGENCE, -proprt[RAP_INTELLIGENCE], false, item,
@@ -672,4 +671,4 @@ void unuse_randart(const item_def &item)
if (proprt[RAP_NOISES] != 0)
you.special_wield = SPWLD_NONE;
-} // end unuse_randart()
+}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 78393231c9..1bab2e6f70 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2716,7 +2716,7 @@ void jewellery_wear_effects(item_def &item)
break;
case RING_EVASION:
- you.redraw_evasion = 1;
+ you.redraw_evasion = true;
if (item.plus != 0)
{
if (!artefact)
@@ -3160,11 +3160,11 @@ void jewellery_remove_effects(item_def &item)
break;
case RING_PROTECTION:
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
break;
case RING_EVASION:
- you.redraw_evasion = 1;
+ you.redraw_evasion = true;
break;
case RING_STRENGTH:
@@ -4065,7 +4065,7 @@ static bool _handle_enchant_armour( int item_slot )
if (ac_change)
you.redraw_armour_class = true;
- return result;
+ return (result);
}
static void handle_read_book( int item_slot )
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 5cbccb4b46..690e072ed7 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1477,7 +1477,7 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
{
you.gold += quant_got;
dec_mitm_item_quantity( obj, quant_got );
- you.redraw_gold = 1;
+ you.redraw_gold = true;
if (!quiet)
{
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index e240da9408..c134478145 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1927,13 +1927,6 @@ bool mutate(mutation_type which_mutation, bool failMsg,
if (you.mutation[mutat] >= mutation_defs[mutat].levels)
return (false);
- // FIXME: Find where these things are actually changed.
- // -- Do not globally force redraw! {dlb}
- you.redraw_hit_points = 1;
- you.redraw_magic_points = 1;
- you.redraw_armour_class = 1;
- you.redraw_evasion = 1;
-
switch (mutat)
{
case MUT_STRONG:
@@ -1942,7 +1935,6 @@ bool mutate(mutation_type which_mutation, bool failMsg,
delete_mutation(MUT_WEAK);
return (true);
}
- // Replaces earlier, redundant code. - 12mar2000 {dlb}
modify_stat(STAT_STRENGTH, 1, false, "gaining a mutation");
break;
@@ -1952,7 +1944,6 @@ bool mutate(mutation_type which_mutation, bool failMsg,
delete_mutation(MUT_DOPEY);
return (true);
}
- // Replaces earlier, redundant code. - 12mar2000 {dlb}
modify_stat(STAT_INTELLIGENCE, 1, false, "gaining a mutation");
break;
@@ -1962,8 +1953,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
delete_mutation(MUT_CLUMSY);
return (true);
}
- // Replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_DEXTERITY, 1, false, "gaining a mutation");
+ you.redraw_evasion = true;
break;
case MUT_WEAK:
@@ -1993,6 +1984,7 @@ bool mutate(mutation_type which_mutation, bool failMsg,
return (true);
}
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
+ you.redraw_evasion = true;
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
break;
@@ -2095,6 +2087,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
modify_stat(STAT_STRENGTH, 1, true, "gaining a mutation");
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_FLEXIBLE_WEAK:
@@ -2106,6 +2100,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
modify_stat(STAT_STRENGTH, -1, true, "gaining a mutation");
modify_stat(STAT_DEXTERITY, 1, true, "gaining a mutation");
mpr(gain_mutation[mutat][0], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_FRAIL:
@@ -2119,6 +2115,7 @@ bool mutate(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]++;
calc_hp();
you.mutation[mutat]--;
+ you.redraw_hit_points = true;
break;
case MUT_ROBUST:
@@ -2132,6 +2129,7 @@ bool mutate(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]++;
calc_hp();
you.mutation[mutat]--;
+ you.redraw_hit_points = true;
break;
case MUT_LOW_MAGIC:
@@ -2145,6 +2143,7 @@ bool mutate(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]++;
calc_mp();
you.mutation[mutat]--;
+ you.redraw_magic_points = true;
break;
case MUT_HIGH_MAGIC:
@@ -2158,12 +2157,15 @@ bool mutate(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]++;
calc_mp();
you.mutation[mutat]--;
+ you.redraw_magic_points = true;
break;
case MUT_BLACK_SCALES:
case MUT_BONEY_PLATES:
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_GREY2_SCALES:
@@ -2171,6 +2173,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_METALLIC_SCALES:
@@ -2180,6 +2184,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_RED2_SCALES:
@@ -2188,10 +2194,14 @@ bool mutate(mutation_type which_mutation, bool failMsg,
modify_stat(STAT_DEXTERITY, -1, true, "gaining a mutation");
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
default:
mpr(gain_mutation[mutat][you.mutation[mutat]], MSGCH_MUTATION);
+ // For all those scale mutations.
+ you.redraw_armour_class = true;
break;
}
@@ -2302,6 +2312,7 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
case MUT_AGILE:
modify_stat(STAT_DEXTERITY, -1, true, "losing a mutation");
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
+ you.redraw_evasion = true;
break;
case MUT_WEAK:
@@ -2313,20 +2324,22 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
break;
case MUT_CLUMSY:
- // replaces earlier, redundant code - 12mar2000 {dlb}
modify_stat(STAT_DEXTERITY, 1, false, "losing a mutation");
+ you.redraw_evasion = true;
break;
case MUT_STRONG_STIFF:
modify_stat(STAT_STRENGTH, -1, true, "losing a mutation");
modify_stat(STAT_DEXTERITY, 1, true, "losing a mutation");
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
+ you.redraw_evasion = true;
break;
case MUT_FLEXIBLE_WEAK:
modify_stat(STAT_STRENGTH, 1, true, "losing a mutation");
modify_stat(STAT_DEXTERITY, -1, true, "losing a mutation");
mpr(lose_mutation[mutat][0], MSGCH_MUTATION);
+ you.redraw_evasion = true;
break;
case MUT_FRAIL:
@@ -2336,6 +2349,7 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]--;
calc_hp();
you.mutation[mutat]++;
+ you.redraw_hit_points = true;
break;
case MUT_LOW_MAGIC:
@@ -2345,12 +2359,15 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
you.mutation[mutat]--;
calc_mp();
you.mutation[mutat]++;
+ you.redraw_magic_points = true;
break;
case MUT_BLACK_SCALES:
case MUT_BONEY_PLATES:
modify_stat(STAT_DEXTERITY, 1, true, "losing a mutation");
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_CLAWS:
@@ -2363,6 +2380,8 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
if (you.mutation[mutat] != 2)
modify_stat(STAT_DEXTERITY, 1, true, "losing a mutation");
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_METALLIC_SCALES:
@@ -2371,6 +2390,8 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
else
modify_stat(STAT_DEXTERITY, 1, true, "losing a mutation");
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_RED2_SCALES:
@@ -2378,6 +2399,8 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
if (you.mutation[mutat] != 1)
modify_stat(STAT_DEXTERITY, 1, true, "losing a mutation");
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
+ you.redraw_armour_class = true;
+ you.redraw_evasion = true;
break;
case MUT_BREATHE_POISON:
@@ -2395,16 +2418,11 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
default:
mpr(lose_mutation[mutat][you.mutation[mutat] - 1], MSGCH_MUTATION);
+ // For all those various scale mutations.
+ you.redraw_armour_class = true;
break;
}
- // FIXME: Find where these things are actually altered.
- // -- Do not globally force redraw! {dlb}
- you.redraw_hit_points = 1;
- you.redraw_magic_points = 1;
- you.redraw_armour_class = 1;
- you.redraw_evasion = 1;
-
you.mutation[mutat]--;
take_note(Note(NOTE_LOSE_MUTATION, mutat, you.mutation[mutat]));
@@ -2445,7 +2463,7 @@ static int body_covered()
covered += you.mutation[MUT_IRIDESCENT_SCALES];
covered += you.mutation[MUT_PATTERNED_SCALES];
- return covered;
+ return (covered);
}
const char *mutation_name(mutation_type which_mutat, int level)
@@ -2817,7 +2835,7 @@ bool perma_mutate(mutation_type which_mut, int how_much)
you.demon_pow[which_mut] = levels;
return (levels > 0);
-} // end perma_mutate()
+}
bool give_bad_mutation(bool failMsg, bool force_mutation)
{
@@ -2845,4 +2863,4 @@ bool give_bad_mutation(bool failMsg, bool force_mutation)
learned_something_new(TUT_YOU_MUTATED);
return (result);
-} // end give_bad_mutation()
+}
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index b7483afdcc..a55d00d94d 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -3612,7 +3612,6 @@ job_query:
int j = 0;
job_type which_job;
- bool good_choice;
for (int i = 0; i < num_classes; i++)
{
which_job = _get_class(i);
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 588c4bdd8e..ca34b768e0 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -101,7 +101,7 @@ int check_your_resists(int hurted, beam_type flavour)
{
mpr( "Your icy shield dissipates!", MSGCH_DURATION );
you.duration[DUR_CONDENSATION_SHIELD] = 0;
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
}
}
@@ -426,7 +426,7 @@ void item_corrode( int itco )
else
item.plus = how_rusty;
- you.redraw_armour_class = 1; // for armour, rings, etc. {dlb}
+ you.redraw_armour_class = true; // for armour, rings, etc. {dlb}
if (you.equip[EQ_WEAPON] == itco)
you.wield_change = true;
@@ -665,9 +665,9 @@ void lose_level()
you.hp, you.hp_max, you.magic_points, you.max_magic_points);
take_note(Note(NOTE_XP_LEVEL_CHANGE, you.experience_level, 0, buf));
- you.redraw_experience = 1;
+ you.redraw_experience = true;
xom_is_stimulated(255);
-} // end lose_level()
+}
void drain_exp(bool announce_full)
{
@@ -733,19 +733,16 @@ void drain_exp(bool announce_full)
mprf(MSGCH_DIAGNOSTICS, "You lose %ld experience points.",exp_drained);
#endif
- you.redraw_experience = 1;
+ you.redraw_experience = true;
if (you.experience < exp_needed(you.experience_level + 1))
lose_level();
}
-} // end drain_exp()
+}
static void xom_checks_damage(kill_method_type death_type,
int dam, int death_source)
{
- //if (you.hp <= dam)
- // xom_is_stimulated(32);
-
if (death_type == KILLED_BY_TARGETTING)
{
// Xom thinks the player hurting him/herself is funny.
@@ -813,7 +810,7 @@ static void xom_checks_damage(kill_method_type death_type,
xom_is_stimulated(amusementvalue);
}
-// death_source should be set to zero for non-monsters {dlb}
+// death_source should be set to zero for non-monsters. {dlb}
void ouch( int dam, int death_source, kill_method_type death_type,
const char *aux, bool see_source )
{
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 9803ed1b75..2990c6a726 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -3151,7 +3151,7 @@ void level_change(bool skip_attribute_increase)
if (!(you.experience_level % 3))
{
mpr("Your skin feels tougher.", MSGCH_INTRINSIC_GAIN);
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
}
break;
@@ -3287,7 +3287,7 @@ void level_change(bool skip_attribute_increase)
if (you.experience_level > 7 && !(you.experience_level % 4))
{
mpr("Your scales feel tougher.", MSGCH_INTRINSIC_GAIN);
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
modify_stat(STAT_RANDOM, 1, false, "level gain");
}
break;
@@ -3310,7 +3310,7 @@ void level_change(bool skip_attribute_increase)
if (you.experience_level > 7 && !(you.experience_level % 2))
{
mpr("Your scales feel tougher.", MSGCH_INTRINSIC_GAIN);
- you.redraw_armour_class = 1;
+ you.redraw_armour_class = true;
}
if ((you.experience_level > 7 && !(you.experience_level % 3))
@@ -4640,10 +4640,8 @@ void dec_hp(int hp_loss, bool fatal, const char *aux)
else
you.hp -= hp_loss;
- you.redraw_hit_points = 1;
-
- return;
-} // end dec_hp()
+ you.redraw_hit_points = true;
+}
void dec_mp(int mp_loss)
{
@@ -4663,7 +4661,7 @@ void dec_mp(int mp_loss)
}
take_note(Note(NOTE_MP_CHANGE, you.magic_points, you.max_magic_points));
- you.redraw_magic_points = 1;
+ you.redraw_magic_points = true;
}
bool enough_hp(int minimum, bool suppress_msg)
@@ -4718,7 +4716,7 @@ void inc_mp(int mp_gain, bool max_too)
interrupt_activity(AI_FULL_MP);
take_note(Note(NOTE_MP_CHANGE, you.magic_points, you.max_magic_points));
- you.redraw_magic_points = 1;
+ you.redraw_magic_points = true;
}
// Note that "max_too" refers to the base potential, the actual
@@ -4742,7 +4740,7 @@ void inc_hp(int hp_gain, bool max_too)
if (wasnt_max && you.hp == you.hp_max)
interrupt_activity(AI_FULL_HP);
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
}
void rot_hp( int hp_loss )
@@ -4750,7 +4748,7 @@ void rot_hp( int hp_loss )
you.base_hp -= hp_loss;
calc_hp();
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
}
void unrot_hp( int hp_recovered )
@@ -4762,7 +4760,7 @@ void unrot_hp( int hp_recovered )
calc_hp();
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
}
int player_rotted( void )
@@ -4775,7 +4773,7 @@ void rot_mp( int mp_loss )
you.base_magic_points -= mp_loss;
calc_mp();
- you.redraw_magic_points = 1;
+ you.redraw_magic_points = true;
}
void inc_max_hp( int hp_gain )
@@ -4784,7 +4782,7 @@ void inc_max_hp( int hp_gain )
calc_hp();
take_note(Note(NOTE_MAXHP_CHANGE, you.hp_max));
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
}
void dec_max_hp( int hp_loss )
@@ -4793,7 +4791,7 @@ void dec_max_hp( int hp_loss )
calc_hp();
take_note(Note(NOTE_MAXHP_CHANGE, you.hp_max));
- you.redraw_hit_points = 1;
+ you.redraw_hit_points = true;
}
void inc_max_mp( int mp_gain )
@@ -4802,7 +4800,7 @@ void inc_max_mp( int mp_gain )
calc_mp();
take_note(Note(NOTE_MAXMP_CHANGE, you.max_magic_points));
- you.redraw_magic_points = 1;
+ you.redraw_magic_points = true;
}
void dec_max_mp( int mp_loss )
@@ -4811,10 +4809,10 @@ void dec_max_mp( int mp_loss )
calc_mp();
take_note(Note(NOTE_MAXMP_CHANGE, you.max_magic_points));
- you.redraw_magic_points = 1;
+ you.redraw_magic_points = true;
}
-// use of floor: false = hp max, true = hp min {dlb}
+// Use of floor: false = hp max, true = hp min. {dlb}
void deflate_hp(int new_level, bool floor)
{
if (floor && you.hp < new_level)
@@ -4822,12 +4820,9 @@ void deflate_hp(int new_level, bool floor)
else if (!floor && you.hp > new_level)
you.hp = new_level;
- // take_note(Note(NOTE_HP_CHANGE, you.hp, you.hp_max));
- // must remain outside conditional, given code usage {dlb}
- you.redraw_hit_points = 1;
-
- return;
-} // end deflate_hp()
+ // Must remain outside conditional, given code usage. {dlb}
+ you.redraw_hit_points = true;
+}
// Note that "max_too" refers to the base potential, the actual
// resulting max value is subject to penalties, bonuses, and scalings.
@@ -4845,14 +4840,12 @@ void set_hp(int new_amount, bool max_too)
if (you.hp > you.hp_max)
you.hp = you.hp_max;
- if ( max_too )
+ if (max_too)
take_note(Note(NOTE_MAXHP_CHANGE, you.hp_max));
- // must remain outside conditional, given code usage {dlb}
- you.redraw_hit_points = 1;
-
- return;
-} // end set_hp()
+ // Must remain outside conditional, given code usage. {dlb}
+ you.redraw_hit_points = true;
+}
// Note that "max_too" refers to the base potential, the actual
// resulting max value is subject to penalties, bonuses, and scalings.
@@ -4863,7 +4856,7 @@ void set_mp(int new_amount, bool max_too)
if (max_too && you.max_magic_points != new_amount)
{
- // note that this gets scaled down for values > 18
+ // Note that this gets scaled down for values > 18.
you.base_magic_points2 = 5000 + new_amount;
calc_mp();
}
@@ -4872,13 +4865,12 @@ void set_mp(int new_amount, bool max_too)
you.magic_points = you.max_magic_points;
take_note(Note(NOTE_MP_CHANGE, you.magic_points, you.max_magic_points));
- if ( max_too )
- take_note(Note(NOTE_MAXMP_CHANGE, you.max_magic_points));
- // must remain outside conditional, given code usage {dlb}
- you.redraw_magic_points = 1;
+ if (max_too)
+ take_note(Note(NOTE_MAXMP_CHANGE, you.max_magic_points));
- return;
-} // end set_mp()
+ // Must remain outside conditional, given code usage. {dlb}
+ you.redraw_magic_points = true;
+}
static int _get_contamination_level()
{
diff --git a/crawl-ref/source/quiver.cc b/crawl-ref/source/quiver.cc
index 8aa598d480..aa9f38e768 100644
--- a/crawl-ref/source/quiver.cc
+++ b/crawl-ref/source/quiver.cc
@@ -168,6 +168,22 @@ void choose_item_for_quiver()
: "hand crossbows");
return;
}
+ else if (slot == you.equip[EQ_WEAPON])
+ {
+ mpr("You can't quiver wielded items.");
+ return;
+ }
+ else
+ {
+ for (int i = 0; i < NUM_EQUIP; i++)
+ {
+ if (you.equip[i] == slot)
+ {
+ mpr("You can't quiver worn items.");
+ return;
+ }
+ }
+ }
const item_def item = you.inv[slot];
ASSERT(is_valid_item(item));
diff --git a/crawl-ref/source/skills.cc b/crawl-ref/source/skills.cc
index 4bdc9b55a8..051a8c0e4c 100644
--- a/crawl-ref/source/skills.cc
+++ b/crawl-ref/source/skills.cc
@@ -98,7 +98,7 @@ void calc_total_skill_points( void )
you.skill_cost_level = i - 1;
#if DEBUG_DIAGNOSTICS
- you.redraw_experience = 1;
+ you.redraw_experience = true;
#endif
}
@@ -446,7 +446,7 @@ static int _exercise2( int exsk )
calc_mp();
if (exsk == SK_DODGING || exsk == SK_ARMOUR)
- you.redraw_evasion = 1;
+ you.redraw_evasion = true;
if (exsk == SK_ARMOUR || exsk == SK_SHIELDS
|| exsk == SK_ICE_MAGIC || exsk == SK_EARTH_MAGIC