summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:57:35 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-22 21:57:35 +0000
commitea78e3b88da2c70285b09f34c9c5d8230280405b (patch)
treeb4de694fd30792e67bf1ebde5e3f770794992949 /crawl-ref/source/item_use.cc
parentf7cb474e41b75c37273b79d4fe5e7e24da81950d (diff)
downloadcrawl-ref-ea78e3b88da2c70285b09f34c9c5d8230280405b.tar.gz
crawl-ref-ea78e3b88da2c70285b09f34c9c5d8230280405b.zip
Swap '.' and '!' in the targetting interface.
Forbid bats wearing hats/caps or rings. (That makes amulets the only type of equipment Vampires can keep on when transforming.) To make up for it, increase their damage stats again. Also fix it being possible to (un)equip the allowed items in Tiles while in bat form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6055 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc39
1 files changed, 34 insertions, 5 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index e462ffb936..6390e5b743 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -101,10 +101,11 @@ bool can_wield(const item_def *weapon, bool say_reason,
SAY(canned_msg(MSG_TOO_BERSERK));
return false;
}
+
if (!can_equip( EQ_WEAPON, ignore_temporary_disability ))
{
SAY(mpr("You can't wield anything in your present form."));
- return false;
+ return (false);
}
if (!ignore_temporary_disability
@@ -113,7 +114,7 @@ bool can_wield(const item_def *weapon, bool say_reason,
&& item_cursed( you.inv[you.equip[EQ_WEAPON]] ))
{
SAY(mpr("You can't unwield your weapon to draw a new one!"));
- return false;
+ return (false);
}
// If we don't have an actual weapon to check, return now.
@@ -818,6 +819,12 @@ static bool cloak_is_being_removed( void )
//---------------------------------------------------------------
void wear_armour( int slot ) // slot is for tiles
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't wear anything in your present form.");
+ return;
+ }
+
int armour_wear_2 = 0;
if (slot != -1)
@@ -2848,7 +2855,9 @@ static int prompt_ring_to_remove(int new_ring)
int c;
do
+ {
c = getch();
+ }
while (c != lslot && c != rslot && c != ESCAPE && c != ' ');
mesclr();
@@ -3072,6 +3081,12 @@ bool puton_item(int item_slot, bool prompt_finger)
bool puton_ring(int slot, bool prompt_finger)
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't put on anything in your present form.");
+ return (false);
+ }
+
int item_slot;
if (inv_count() < 1)
@@ -3186,6 +3201,12 @@ void jewellery_remove_effects(item_def &item)
bool remove_ring(int slot, bool announce)
{
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ mpr("You can't wear or remove anything in your present form.");
+ return (false);
+ }
+
equipment_type hand_used = EQ_NONE;
int ring_wear_2;
@@ -4804,26 +4825,34 @@ void tile_use_item(int idx, InvAction act)
// Use it
const int type = item.base_type;
+/*
+ if ((type == OBJ_ARMOUR || type == OBJ_JEWELLERY)
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ {
+ canned_msg(MSG_PRESENT_FORM);
+ return;
+ }
+*/
switch (type)
{
case OBJ_WEAPONS:
case OBJ_STAVES:
case OBJ_MISCELLANY:
- // wield any unwielded item of these types
+ // Wield any unwielded item of these types.
if (!equipped)
{
if (check_warning_inscriptions(item, OPER_WIELD))
wield_weapon(true, idx);
return;
}
- // evoke misc. items and rods
+ // Evoke misc. items and rods.
if (type == OBJ_MISCELLANY || item_is_rod(item))
{
if (check_warning_inscriptions(item, OPER_EVOKE))
evoke_wielded();
return;
}
- // unwield staves or weapons
+ // Unwield staves or weapons.
if (check_warning_inscriptions(item, OPER_WIELD))
wield_weapon(true, PROMPT_GOT_SPECIAL); // unwield
return;