diff options
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 681d5cb0eb..588795ee8d 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -310,9 +310,35 @@ void sublimation(int power) { unsigned char loopy = 0; // general purpose loop variable {dlb} - if (you.equip[EQ_WEAPON] == -1 - || you.inv[you.equip[EQ_WEAPON]].base_type != OBJ_FOOD - || you.inv[you.equip[EQ_WEAPON]].sub_type != FOOD_CHUNK) + int wielded = you.equip[EQ_WEAPON]; + if (wielded != -1) + { + if (you.inv[wielded].base_type == OBJ_FOOD + && you.inv[wielded].sub_type == FOOD_CHUNK) + { + mpr("The chunk of flesh you are holding crumbles to dust."); + mpr("A flood of magical energy pours into your mind!"); + + inc_mp( 7 + random2(7), false ); + + dec_inv_item_quantity( wielded, 1 ); + } + else if (you.inv[wielded].base_type == OBJ_POTIONS + && you.inv[wielded].sub_type == POT_BLOOD) + { + mprf("The blood within %s frothes and boils.", + you.inv[wielded].quantity == 1 ? "the flask you are holding" + : "one of your flasks"); + split_blood_potions_into_decay( wielded, 1 ); + + mpr("A flood of magical energy pours into your mind!"); + inc_mp( 7 + random2(7), false ); + } + else // no appropriate item wielded + wielded = -1; + } + + if (wielded == -1) { if (you.duration[DUR_DEATHS_DOOR]) { @@ -343,15 +369,6 @@ void sublimation(int power) } } } - else - { - mpr("The chunk of flesh you are holding crumbles to dust."); - mpr("A flood of magical energy pours into your mind!"); - - inc_mp( 7 + random2(7), false ); - - dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 ); - } return; } // end sublimation() |