Attached Files |
gearslot.patch [^] (6,122 bytes) 2014-02-09 03:05 [Show Content] [Hide Content]From d67a0f195f70230e948818bea11c8e36b99411e8 Mon Sep 17 00:00:00 2001
From: wheals <shm.mark@gmail.com>
Date: Sat, 8 Feb 2014 20:55:57 -0500
Subject: [PATCH] Remove arbitrary gear slot connections.
This was a constant source of nonsense: why can you not put on rings with
cursed gloves, but you can put on gloves with cursed two-handers? Why do cloaks
block armour but gloves don't block full plate? The only possible motivation
was "realism," but I'm usually capable of changing my clothes while wearing
another layer above them, and you can imagine that rings work both either above
or below gloves.
---
crawl-ref/source/item_use.cc | 77 +++-----------------------------------------
1 file changed, 4 insertions(+), 73 deletions(-)
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 71033e3..4a7d67f 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -876,40 +876,6 @@ bool do_wear_armour(int item, bool quiet)
return false;
}
- bool removed_cloak = false;
- int cloak = -1;
-
- // Removing body armour requires removing the cloak first.
- if (slot == EQ_BODY_ARMOUR
- && you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed())
- {
- if (you.equip[EQ_BODY_ARMOUR] != -1
- && you.inv[you.equip[EQ_BODY_ARMOUR]].cursed())
- {
- if (!quiet)
- {
- mprf("%s is stuck to your body!",
- you.inv[you.equip[EQ_BODY_ARMOUR]].name(DESC_YOUR)
- .c_str());
- }
- return false;
- }
- if (!you.inv[you.equip[EQ_CLOAK]].cursed())
- {
- cloak = you.equip[EQ_CLOAK];
- if (!takeoff_armour(you.equip[EQ_CLOAK]))
- return false;
-
- removed_cloak = true;
- }
- else
- {
- if (!quiet)
- mpr("Your cloak prevents you from wearing the armour.");
- return false;
- }
- }
-
if ((slot == EQ_CLOAK
|| slot == EQ_HELMET
|| slot == EQ_GLOVES
@@ -931,9 +897,6 @@ bool do_wear_armour(int item, bool quiet)
if (delay)
start_delay(DELAY_ARMOUR_ON, delay, item);
- if (removed_cloak)
- start_delay(DELAY_ARMOUR_ON, 1, cloak);
-
return true;
}
@@ -1064,14 +1027,6 @@ static vector<equipment_type> _current_jewellery_types()
return ret;
}
-static bool _ring_change_prohibited_by_gloves(equipment_type eq)
-{
- const item_def* gloves = you.slot_item(EQ_GLOVES, false);
- return gloves && gloves->cursed()
- && (eq == EQ_LEFT_RING
- || eq == EQ_RIGHT_RING);
-}
-
static int _prompt_ring_to_remove(int new_ring)
{
const vector<equipment_type> ring_types = _current_ring_types();
@@ -1317,7 +1272,6 @@ static bool _swap_rings(int ring_slot)
int available = 0;
bool all_same = true;
item_def* first_ring = NULL;
- bool gloves_prohibit = false;
for (vector<equipment_type>::iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
@@ -1325,8 +1279,6 @@ static bool _swap_rings(int ring_slot)
item_def* ring = you.slot_item(*eq_it, true);
if (!you_tran_can_wear(*eq_it) || you.melded[*eq_it])
melded++;
- else if (_ring_change_prohibited_by_gloves(*eq_it))
- gloves_prohibit = true;
else if (ring != NULL)
{
if (first_ring == NULL)
@@ -1362,12 +1314,9 @@ static bool _swap_rings(int ring_slot)
}
else if (available == 0)
{
- if (gloves_prohibit)
- mpr("You can't take your gloves off to put on a ring!");
- else
- mprf("You're already wearing %s cursed rings!%s",
- number_in_words(cursed).c_str(),
- (cursed == num_rings ? " Isn't that enough for you?" : ""));
+ mprf("You're already wearing %s cursed rings!%s",
+ number_in_words(cursed).c_str(),
+ (cursed == num_rings ? " Isn't that enough for you?" : ""));
return false;
}
// The simple case - only one available ring.
@@ -1445,15 +1394,11 @@ static bool _puton_item(int item_slot)
for (vector<equipment_type>::const_iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
- {
- if (_ring_change_prohibited_by_gloves(*eq_it))
- continue;
if (!you.slot_item(*eq_it, true))
{
need_swap = false;
break;
}
- }
if (need_swap)
return _swap_rings(item_slot);
@@ -1488,25 +1433,16 @@ static bool _puton_item(int item_slot)
hand_used = EQ_AMULET;
else
{
- bool gloves_prohibit = false;
for (vector<equipment_type>::const_iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
{
- if (_ring_change_prohibited_by_gloves(*eq_it))
- gloves_prohibit = true;
- else if (!you.slot_item(*eq_it, true))
+ if (!you.slot_item(*eq_it, true))
{
hand_used = *eq_it;
break;
}
}
- if (hand_used == EQ_NONE && gloves_prohibit)
- {
- // This shouldn't happen, but just in case...
- mpr("You can't take your gloves off to put on a ring!");
- return false;
- }
}
const unsigned int old_talents = your_talents(false).size();
@@ -1641,11 +1577,6 @@ bool remove_ring(int slot, bool announce)
mpr("You can't take that off while it's melded.");
return false;
}
- else if (_ring_change_prohibited_by_gloves(hand_used))
- {
- mpr("You can't take your gloves off to remove a ring!");
- return false;
- }
else if (hand_used == EQ_AMULET
&& you.equip[EQ_RING_AMULET] != -1
&& !remove_ring(you.equip[EQ_RING_AMULET], announce))
--
1.8.1.4
gearslot2.patch [^] (8,373 bytes) 2014-02-09 18:24 [Show Content] [Hide Content]From c7eb9ca98e2ecb38fcfdf2215cd489e9196e3f85 Mon Sep 17 00:00:00 2001
From: wheals <shm.mark@gmail.com>
Date: Sat, 8 Feb 2014 20:55:57 -0500
Subject: [PATCH] Remove arbitrary gear slot connections.
Specifically, body armour does not require taking on/off cloaks, and putting on
and removing rings with cursed gloves is allowed.
This was a constant source of nonsense: why can you not put on rings with
cursed gloves, but you can put on gloves with cursed two-handers? Why do cloaks
block armour but gloves don't block full plate? The only possible motivation
was "realism," but that's a weak argument in general and having the slots not
being connected is not particularly unrealistic.
---
crawl-ref/source/item_use.cc | 139 ++++++-------------------------------------
1 file changed, 17 insertions(+), 122 deletions(-)
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 71033e3..3c9c8b4 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -527,16 +527,6 @@ bool armour_prompt(const string & mesg, int *index, operation_types oper)
return false;
}
-static bool cloak_is_being_removed(void)
-{
- if (current_delay_action() != DELAY_ARMOUR_OFF)
- return false;
-
- if (you.delay_queue.front().parm1 != you.equip[ EQ_CLOAK ])
- return false;
-
- return true;
-}
//---------------------------------------------------------------
//
@@ -876,40 +866,6 @@ bool do_wear_armour(int item, bool quiet)
return false;
}
- bool removed_cloak = false;
- int cloak = -1;
-
- // Removing body armour requires removing the cloak first.
- if (slot == EQ_BODY_ARMOUR
- && you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed())
- {
- if (you.equip[EQ_BODY_ARMOUR] != -1
- && you.inv[you.equip[EQ_BODY_ARMOUR]].cursed())
- {
- if (!quiet)
- {
- mprf("%s is stuck to your body!",
- you.inv[you.equip[EQ_BODY_ARMOUR]].name(DESC_YOUR)
- .c_str());
- }
- return false;
- }
- if (!you.inv[you.equip[EQ_CLOAK]].cursed())
- {
- cloak = you.equip[EQ_CLOAK];
- if (!takeoff_armour(you.equip[EQ_CLOAK]))
- return false;
-
- removed_cloak = true;
- }
- else
- {
- if (!quiet)
- mpr("Your cloak prevents you from wearing the armour.");
- return false;
- }
- }
-
if ((slot == EQ_CLOAK
|| slot == EQ_HELMET
|| slot == EQ_GLOVES
@@ -931,9 +887,6 @@ bool do_wear_armour(int item, bool quiet)
if (delay)
start_delay(DELAY_ARMOUR_ON, delay, item);
- if (removed_cloak)
- start_delay(DELAY_ARMOUR_ON, 1, cloak);
-
return true;
}
@@ -982,47 +935,24 @@ bool takeoff_armour(int item)
if (!_safe_to_remove_or_wear(invitem, true))
return false;
- bool removed_cloak = false;
- int cloak = -1;
- if (slot == EQ_BODY_ARMOUR)
+ switch (slot)
{
- if (you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed())
+ case EQ_BODY_ARMOUR:
+ case EQ_SHIELD:
+ case EQ_CLOAK:
+ case EQ_HELMET:
+ case EQ_GLOVES:
+ case EQ_BOOTS:
+ if (item != you.equip[slot])
{
- if (!you.inv[you.equip[EQ_CLOAK]].cursed())
- {
- cloak = you.equip[ EQ_CLOAK ];
- if (!takeoff_armour(you.equip[EQ_CLOAK]))
- return false;
-
- removed_cloak = true;
- }
- else
- {
- mpr("Your cloak prevents you from removing the armour.");
- return false;
- }
+ mpr("You aren't wearing that!");
+ return false;
}
- }
- else
- {
- switch (slot)
- {
- case EQ_SHIELD:
- case EQ_CLOAK:
- case EQ_HELMET:
- case EQ_GLOVES:
- case EQ_BOOTS:
- if (item != you.equip[slot])
- {
- mpr("You aren't wearing that!");
- return false;
- }
- break;
+ break;
- default:
- break;
- }
+ default:
+ break;
}
you.turn_is_over = true;
@@ -1030,9 +960,6 @@ bool takeoff_armour(int item)
const int delay = armour_equip_delay(invitem);
start_delay(DELAY_ARMOUR_OFF, delay, item);
- if (removed_cloak)
- start_delay(DELAY_ARMOUR_ON, 1, cloak);
-
return true;
}
@@ -1064,14 +991,6 @@ static vector<equipment_type> _current_jewellery_types()
return ret;
}
-static bool _ring_change_prohibited_by_gloves(equipment_type eq)
-{
- const item_def* gloves = you.slot_item(EQ_GLOVES, false);
- return gloves && gloves->cursed()
- && (eq == EQ_LEFT_RING
- || eq == EQ_RIGHT_RING);
-}
-
static int _prompt_ring_to_remove(int new_ring)
{
const vector<equipment_type> ring_types = _current_ring_types();
@@ -1317,7 +1236,6 @@ static bool _swap_rings(int ring_slot)
int available = 0;
bool all_same = true;
item_def* first_ring = NULL;
- bool gloves_prohibit = false;
for (vector<equipment_type>::iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
@@ -1325,8 +1243,6 @@ static bool _swap_rings(int ring_slot)
item_def* ring = you.slot_item(*eq_it, true);
if (!you_tran_can_wear(*eq_it) || you.melded[*eq_it])
melded++;
- else if (_ring_change_prohibited_by_gloves(*eq_it))
- gloves_prohibit = true;
else if (ring != NULL)
{
if (first_ring == NULL)
@@ -1362,12 +1278,9 @@ static bool _swap_rings(int ring_slot)
}
else if (available == 0)
{
- if (gloves_prohibit)
- mpr("You can't take your gloves off to put on a ring!");
- else
- mprf("You're already wearing %s cursed rings!%s",
- number_in_words(cursed).c_str(),
- (cursed == num_rings ? " Isn't that enough for you?" : ""));
+ mprf("You're already wearing %s cursed rings!%s",
+ number_in_words(cursed).c_str(),
+ (cursed == num_rings ? " Isn't that enough for you?" : ""));
return false;
}
// The simple case - only one available ring.
@@ -1445,15 +1358,11 @@ static bool _puton_item(int item_slot)
for (vector<equipment_type>::const_iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
- {
- if (_ring_change_prohibited_by_gloves(*eq_it))
- continue;
if (!you.slot_item(*eq_it, true))
{
need_swap = false;
break;
}
- }
if (need_swap)
return _swap_rings(item_slot);
@@ -1488,25 +1397,16 @@ static bool _puton_item(int item_slot)
hand_used = EQ_AMULET;
else
{
- bool gloves_prohibit = false;
for (vector<equipment_type>::const_iterator eq_it = ring_types.begin();
eq_it != ring_types.end();
++eq_it)
{
- if (_ring_change_prohibited_by_gloves(*eq_it))
- gloves_prohibit = true;
- else if (!you.slot_item(*eq_it, true))
+ if (!you.slot_item(*eq_it, true))
{
hand_used = *eq_it;
break;
}
}
- if (hand_used == EQ_NONE && gloves_prohibit)
- {
- // This shouldn't happen, but just in case...
- mpr("You can't take your gloves off to put on a ring!");
- return false;
- }
}
const unsigned int old_talents = your_talents(false).size();
@@ -1641,11 +1541,6 @@ bool remove_ring(int slot, bool announce)
mpr("You can't take that off while it's melded.");
return false;
}
- else if (_ring_change_prohibited_by_gloves(hand_used))
- {
- mpr("You can't take your gloves off to remove a ring!");
- return false;
- }
else if (hand_used == EQ_AMULET
&& you.equip[EQ_RING_AMULET] != -1
&& !remove_ring(you.equip[EQ_RING_AMULET], announce))
--
1.8.1.4
|