summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-26 13:18:19 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-26 13:18:19 +0000
commitc96c36a0477909874c98bdbda3d13333ddb453e2 (patch)
tree0c2a18233a65c55086d640be41685824c12d782e /crawl-ref/source/delay.cc
parenta2c2fe61d7f40cb8f5fecd84fdacfdf47d28f16a (diff)
downloadcrawl-ref-c96c36a0477909874c98bdbda3d13333ddb453e2.tar.gz
crawl-ref-c96c36a0477909874c98bdbda3d13333ddb453e2.zip
Implement FR 1894211: All transformations will now cause your equipment
to meld into your body than rather than being removed, so that when untransforming you don't have to put everything on again. * Wielded stuff cannot be melded, and does not yet use the autoswap function. * As before, the low-level transformation spells refuse to work with cursed equipment. * The messages are unnecessarily spammy if you change forms while already transformed (first everything is re-equipped, then unequipped again). Conversely, on simply untransforming the lack of messages might be confusing. * Might be buggy, feedback welcome! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7300 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc36
1 files changed, 20 insertions, 16 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 7debfe2fdb..0b1bbaae46 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -50,7 +50,6 @@ extern std::vector<SelItem> items_for_multidrop;
static int _interrupts_blocked = 0;
static void _xom_check_corpse_waste();
-static void _armour_wear_effects(const int item_inv_slot);
static void _handle_run_delays(const delay_queue_item &delay);
static void _handle_macro_delay();
static void _finish_delay(const delay_queue_item &delay);
@@ -943,7 +942,7 @@ static void _finish_delay(const delay_queue_item &delay)
break;
case DELAY_ARMOUR_ON:
- _armour_wear_effects(delay.parm1);
+ armour_wear_effects(delay.parm1);
break;
case DELAY_ARMOUR_OFF:
@@ -1234,7 +1233,7 @@ static void _finish_delay(const delay_queue_item &delay)
#endif
}
-static void _armour_wear_effects(const int item_slot)
+void armour_wear_effects(const int item_slot)
{
item_def &arm = you.inv[item_slot];
@@ -1244,6 +1243,10 @@ static void _armour_wear_effects(const int item_slot)
set_ident_flags(arm, ISFLAG_EQ_ARMOUR_MASK );
+ const equipment_type eq_slot = get_armour_slot(arm);
+ const bool melded = (arm.link == you.equip[eq_slot]);
+ const bool known_cursed = item_known_cursed(arm);
+
if (!was_known)
{
if (Options.autoinscribe_randarts && is_random_artefact( arm ))
@@ -1253,10 +1256,8 @@ static void _armour_wear_effects(const int item_slot)
take_note(Note(NOTE_ID_ITEM, 0, 0, arm.name(DESC_NOCAP_A).c_str(),
origin_desc(arm).c_str()));
}
- mprf("You finish putting on %s.", arm.name(DESC_NOCAP_YOUR).c_str());
-
- const equipment_type eq_slot = get_armour_slot(arm);
- const bool known_cursed = item_known_cursed(arm);
+ if (!melded)
+ mprf("You finish putting on %s.", arm.name(DESC_NOCAP_YOUR).c_str());
if (eq_slot == EQ_BODY_ARMOUR)
{
@@ -1269,17 +1270,20 @@ static void _armour_wear_effects(const int item_slot)
you.duration[DUR_ICY_ARMOUR] = 0;
}
}
- else
+ else if (eq_slot == EQ_SHIELD)
+ {
+ if (you.duration[DUR_CONDENSATION_SHIELD])
+ {
+ mpr( "Your icy shield evaporates.", MSGCH_DURATION );
+ you.duration[DUR_CONDENSATION_SHIELD] = 0;
+ }
+ you.equip[EQ_SHIELD] = item_slot;
+ }
+ else if (!melded)
{
switch (eq_slot)
{
case EQ_SHIELD:
- if (you.duration[DUR_CONDENSATION_SHIELD])
- {
- mpr( "Your icy shield evaporates.", MSGCH_DURATION );
- you.duration[DUR_CONDENSATION_SHIELD] = 0;
- }
- you.equip[EQ_SHIELD] = item_slot;
break;
case EQ_CLOAK:
you.equip[EQ_CLOAK] = item_slot;
@@ -1382,9 +1386,9 @@ static void _armour_wear_effects(const int item_slot)
}
if (is_random_artefact( arm ))
- use_randart( item_slot );
+ use_randart( arm, melded );
- if (item_cursed( arm ))
+ if (item_cursed( arm ) && !melded)
{
mpr( "Oops, that feels deathly cold." );
learned_something_new(TUT_YOU_CURSED);