summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-06 19:36:52 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-04-06 19:36:52 +0000
commit1f949e4b0f972867e6274a8a4fc3db8d5fe924e8 (patch)
treea0668ece3d80e4b2409e8cff04e3351b406c20b1 /crawl-ref/source
parentc5887300c0f938671c78fc4a59f74ea98ac5bd04 (diff)
downloadcrawl-ref-1f949e4b0f972867e6274a8a4fc3db8d5fe924e8.tar.gz
crawl-ref-1f949e4b0f972867e6274a8a4fc3db8d5fe924e8.zip
* After some thought, remove the description toggle from the spell menu as
the double toggle makes everything much more complicated, and you can easily access the spell descriptions from the very similar 'I' menu. * Don't offer weapons of unknown brand types for ?recharging. I tested a few combination cases, but I might have overlooked something. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9589 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc22
-rw-r--r--crawl-ref/source/invent.cc2
-rw-r--r--crawl-ref/source/item_use.cc2
-rw-r--r--crawl-ref/source/itemprop.cc16
-rw-r--r--crawl-ref/source/itemprop.h4
-rw-r--r--crawl-ref/source/spl-cast.cc9
-rw-r--r--crawl-ref/source/transfor.cc5
7 files changed, 28 insertions, 32 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 241a1e909f..509fc8c2c8 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1903,20 +1903,24 @@ bool recharge_wand(int item_slot)
}
// Weapons of electrocution can be "charged", i.e. gain +1 damage.
- if (wand.base_type == OBJ_WEAPONS
- && get_weapon_brand(wand) == SPWPN_ELECTROCUTION)
+ if (wand.base_type == OBJ_WEAPONS)
{
- // Might fail because of already high enchantment.
- if (enchant_weapon( ENCHANT_TO_DAM, false, wand ))
+ if (get_weapon_brand(wand) == SPWPN_ELECTROCUTION)
{
- you.wield_change = true;
+ // Might fail because of already high enchantment.
+ if (enchant_weapon( ENCHANT_TO_DAM, false, wand ))
+ {
+ you.wield_change = true;
- if (!item_ident(wand, ISFLAG_KNOW_TYPE))
- set_ident_flags(wand, ISFLAG_KNOW_TYPE);
+ if (!item_ident(wand, ISFLAG_KNOW_TYPE))
+ set_ident_flags(wand, ISFLAG_KNOW_TYPE);
- return (true);
+ return (true);
+ }
+ return (false);
}
- return (false);
+ else
+ canned_msg( MSG_NOTHING_HAPPENS );
}
if (wand.base_type != OBJ_WANDS && !item_is_rod(wand))
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 6a7767f64c..0a4fa56f33 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -1015,7 +1015,7 @@ static bool _item_class_selected(const item_def &i, int selector)
return (itype == OBJ_SCROLLS || itype == OBJ_BOOKS);
case OSEL_RECHARGE:
- return (item_is_rechargeable(i, true, true));
+ return (item_is_rechargeable(i, true));
case OSEL_ENCH_ARM:
return (is_enchantable_armour(i, true, true));
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cbef83db3c..ac34457c8c 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -4674,7 +4674,7 @@ static bool _scroll_modify_item(item_def scroll)
}
break;
case SCR_RECHARGING:
- if (item_is_rechargeable(item, true))
+ if (item_is_rechargeable(item, false, true))
{
// Might still fail on highly enchanted weapons of electrocution.
// (If so, already prints the "Nothing happens" message.)
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index e0e6e5dc2b..829b6ca1b9 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1313,16 +1313,14 @@ bool check_armour_shape( const item_def &item, bool quiet )
// Returns whether a wand or rod can be charged, or a weapon of electrocution
// enchanted.
-// If unknown is true, wands with unknown charges and weapons with unknown
-// brand will also return true.
// If hide_charged is true, wands known to be full will return false.
// (This distinction is necessary because even full wands/rods give a message.)
-bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged)
+bool item_is_rechargeable(const item_def &it, bool hide_charged, bool weapons)
{
// These are obvious...
if (it.base_type == OBJ_WANDS)
{
- if (unknown && !hide_charged)
+ if (!hide_charged)
return (true);
// Don't offer wands already maximally charged.
@@ -1336,7 +1334,7 @@ bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged)
}
else if (item_is_rod(it))
{
- if (unknown && !hide_charged)
+ if (!hide_charged)
return (true);
if (item_ident(it, ISFLAG_KNOW_PLUSES))
@@ -1348,16 +1346,16 @@ bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged)
}
else if (it.base_type == OBJ_WEAPONS)
{
- if (unknown && !item_type_known(it)) // Could be electrocution.
+ // Might be electrocution.
+ if (weapons && !item_type_known(it))
return (true);
// Weapons of electrocution can get +1 to-dam this way.
if (!is_artefact(it)
&& get_weapon_brand(it) == SPWPN_ELECTROCUTION
&& item_type_known(it)
- && (unknown && !item_ident(it, ISFLAG_KNOW_PLUSES )
- || item_ident(it, ISFLAG_KNOW_PLUSES )
- && it.plus2 < MAX_WPN_ENCHANT))
+ && (!item_ident(it, ISFLAG_KNOW_PLUSES)
+ || it.plus2 < MAX_WPN_ENCHANT))
{
return (true);
}
diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h
index c908854657..e1b4755f8f 100644
--- a/crawl-ref/source/itemprop.h
+++ b/crawl-ref/source/itemprop.h
@@ -675,8 +675,8 @@ int fit_armour_size( const item_def &item, size_type size );
bool check_armour_size( const item_def &item, size_type size );
bool check_armour_shape( const item_def &item, bool quiet );
-bool item_is_rechargeable(const item_def &it, bool unknown = false,
- bool hide_charged = false);
+bool item_is_rechargeable(const item_def &it, bool hide_charged = false,
+ bool weapons = false);
int wand_charge_value(int type);
bool is_enchantable_weapon(const item_def &wpn, bool uncurse);
bool is_enchantable_armour(const item_def &arm, bool uncurse,
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 42c040a3c0..780d1184dc 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -216,14 +216,7 @@ int list_spells(bool toggle_with_I, bool viewing)
spell_menu.add_toggle_key('I');
more_str += "or 'I' ";
}
- more_str += "to toggle spell view";
- if (!viewing)
- {
- spell_menu.allow_toggle = true;
- spell_menu.menu_action = Menu::ACT_EXECUTE;
- more_str += ", or '?' to read the descriptions";
- }
- more_str += ".";
+ more_str += "to toggle spell view.";
spell_menu.set_more(formatted_string(more_str));
for (int i = 0; i < 52; ++i)
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index fe17503537..4724ef63f1 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -536,8 +536,9 @@ bool transform(int pow, transformation_type which_trans, bool force,
}
// The actual transformation may still fail later (e.g. due to cursed
- // equipment). In any case, untransforming costs us a turn but nothing
- // else (as does the "End Transformation" ability).
+ // equipment). Ideally, untransforming should cost a turn but nothing
+ // else (as does the "End Transformation" ability). As it is, you
+ // pay with mana and hunger if you already untransformed.
if (!just_check && you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE)
{
bool skip_wielding = false;