summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/item_use.cc38
-rw-r--r--crawl-ref/source/religion.cc41
-rw-r--r--crawl-ref/source/spells3.cc2
3 files changed, 44 insertions, 37 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 2a38a066b2..a96d9ef08a 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4394,7 +4394,7 @@ bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn)
wpn.name(DESC_CAP_YOUR).c_str());
}
- do_uncurse_item( wpn );
+ do_uncurse_item(wpn);
return (true);
}
else
@@ -4438,7 +4438,7 @@ bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn)
}
if (is_cursed)
- do_uncurse_item( wpn );
+ do_uncurse_item(wpn);
xom_is_stimulated(16);
return (true);
@@ -4496,7 +4496,7 @@ bool enchant_armour(int &ac_change, bool quiet, item_def &arm)
ac_change = property(arm, PARM_AC) - ac_change;
if (is_cursed)
- do_uncurse_item( arm );
+ do_uncurse_item(arm);
// No additional enchantment.
return (true);
@@ -4514,13 +4514,14 @@ bool enchant_armour(int &ac_change, bool quiet, item_def &arm)
mprf("%s glows silver for a moment.",
arm.name(DESC_CAP_YOUR).c_str());
}
- do_uncurse_item( arm );
+
+ do_uncurse_item(arm);
return (true);
}
else
{
if (!quiet)
- canned_msg( MSG_NOTHING_HAPPENS );
+ canned_msg(MSG_NOTHING_HAPPENS);
return (false);
}
@@ -4537,7 +4538,7 @@ bool enchant_armour(int &ac_change, bool quiet, item_def &arm)
ac_change++;
if (is_cursed)
- do_uncurse_item( arm );
+ do_uncurse_item(arm);
xom_is_stimulated(16);
return (true);
@@ -4944,11 +4945,11 @@ void read_scroll(int slot)
// Everything [in the switch] below this line is a nightmare {dlb}:
case SCR_ENCHANT_WEAPON_I:
- id_the_scroll = _handle_enchant_weapon( ENCHANT_TO_HIT );
+ id_the_scroll = _handle_enchant_weapon(ENCHANT_TO_HIT);
break;
case SCR_ENCHANT_WEAPON_II:
- id_the_scroll = _handle_enchant_weapon( ENCHANT_TO_DAM );
+ id_the_scroll = _handle_enchant_weapon(ENCHANT_TO_DAM);
break;
case SCR_ENCHANT_WEAPON_III:
@@ -4965,29 +4966,32 @@ void read_scroll(int slot)
{
mprf("%s glows bright yellow for a while.", iname.c_str());
- _handle_enchant_weapon( ENCHANT_TO_HIT, true );
+ _handle_enchant_weapon(ENCHANT_TO_HIT, true);
if (coinflip())
- _handle_enchant_weapon( ENCHANT_TO_HIT, true );
+ _handle_enchant_weapon(ENCHANT_TO_HIT, true);
- _handle_enchant_weapon( ENCHANT_TO_DAM, true );
+ _handle_enchant_weapon(ENCHANT_TO_DAM, true);
if (coinflip())
- _handle_enchant_weapon( ENCHANT_TO_DAM, true );
+ _handle_enchant_weapon(ENCHANT_TO_DAM, true);
+
+ if (is_cursed)
+ do_uncurse_item(wpn);
}
else if (wpn.base_type == OBJ_MISSILES)
{
mprf("%s glow%s bright yellow for a while.", iname.c_str(),
wpn.quantity > 1 ? "" : "s");
- _handle_enchant_weapon( ENCHANT_TO_HIT, true );
+ _handle_enchant_weapon(ENCHANT_TO_HIT, true);
if (coinflip())
- _handle_enchant_weapon( ENCHANT_TO_HIT, true );
- }
+ _handle_enchant_weapon(ENCHANT_TO_HIT, true);
- if (is_cursed)
- do_uncurse_item( wpn );
+ if (is_cursed)
+ do_uncurse_item(wpn);
+ }
}
else
{
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 00a274a019..dcb6d64fe3 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -6009,39 +6009,42 @@ void excommunication(god_type new_god)
coord_def((int)new_god, old_piety));
}
-static bool _bless_weapon( god_type god, brand_type brand, int colour )
+static bool _bless_weapon(god_type god, brand_type brand, int colour)
{
- item_def& weap = *you.weapon();
+ item_def& wpn = *you.weapon();
// Only bless melee weapons.
- if (!is_artefact(weap) && !is_range_weapon(weap))
+ if (!is_artefact(wpn) && !is_range_weapon(wpn))
{
you.duration[DUR_WEAPON_BRAND] = 0; // just in case
- set_equip_desc( weap, ISFLAG_GLOWING );
- set_item_ego_type( weap, OBJ_WEAPONS, brand );
- weap.colour = colour;
+ set_equip_desc(wpn, ISFLAG_GLOWING);
+ set_item_ego_type(wpn, OBJ_WEAPONS, brand);
+ wpn.colour = colour;
- do_uncurse_item( weap );
+ const bool is_cursed = item_cursed(wpn);
- enchant_weapon( ENCHANT_TO_HIT, true, weap );
+ enchant_weapon(ENCHANT_TO_HIT, true, wpn);
if (coinflip())
- enchant_weapon( ENCHANT_TO_HIT, true, weap );
+ enchant_weapon(ENCHANT_TO_HIT, true, wpn);
- enchant_weapon( ENCHANT_TO_DAM, true, weap );
+ enchant_weapon(ENCHANT_TO_DAM, true, wpn);
if (coinflip())
- enchant_weapon( ENCHANT_TO_DAM, true, weap );
+ enchant_weapon(ENCHANT_TO_DAM, true, wpn);
- if ( god == GOD_SHINING_ONE )
+ if (is_cursed)
+ do_uncurse_item(wpn);
+
+ if (god == GOD_SHINING_ONE)
{
- convert2good(weap);
+ convert2good(wpn);
- if (is_blessed_blade_convertible(weap))
+ if (is_blessed_blade_convertible(wpn))
{
- origin_acquired(weap, GOD_SHINING_ONE);
- make_item_blessed_blade(weap);
+ origin_acquired(wpn, GOD_SHINING_ONE);
+ make_item_blessed_blade(wpn);
}
burden_change();
@@ -6054,10 +6057,10 @@ static bool _bless_weapon( god_type god, brand_type brand, int colour )
you.flash_colour = colour;
viewwindow(true, false);
- mprf( MSGCH_GOD, "Your weapon shines brightly!" );
- simple_god_message( " booms: Use this gift wisely!" );
+ mprf(MSGCH_GOD, "Your weapon shines brightly!");
+ simple_god_message(" booms: Use this gift wisely!");
- if ( god == GOD_SHINING_ONE )
+ if (god == GOD_SHINING_ONE)
{
holy_word(100, HOLY_WORD_TSO, you.pos(), true);
#ifndef USE_TILE
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 7bbe991901..dd8736e367 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -136,7 +136,7 @@ bool remove_curse(bool suppress_msg)
if (you.equip[i] != -1 && item_cursed(you.inv[you.equip[i]])
&& you_tran_can_wear(you.equip[i]))
{
- do_uncurse_item( you.inv[you.equip[i]] );
+ do_uncurse_item(you.inv[you.equip[i]]);
success = true;
}
}