diff options
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index d4f2989a2b..5ea049c087 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -36,7 +36,6 @@ #include "itemprop.h" #include "items.h" #include "item_use.h" -#include "it_use2.h" #include "message.h" #include "misc.h" #include "monplace.h" @@ -472,89 +471,6 @@ void simulacrum(int power) } } -bool dancing_weapon(int pow, bool force_hostile, - bool quiet_failure) -{ - bool success = true; - - const int dur = std::min(2 + (random2(pow) / 5), 6); - - const int wpn = you.equip[EQ_WEAPON]; - - // See if wielded item is appropriate: - if (wpn == -1 - || you.inv[wpn].base_type != OBJ_WEAPONS - || is_range_weapon(you.inv[wpn]) - || is_fixed_artefact( you.inv[wpn])) - { - success = false; - } - - // See if we can get an mitm for the dancing weapon: - int i = get_item_slot(); - - if (i == NON_ITEM) - success = false; - - int monster; - - if (success) - { - // Cursed weapons become hostile. - bool friendly = (!force_hostile && !item_cursed(you.inv[wpn])); - - monster = - create_monster( - mgen_data(MONS_DANCING_WEAPON, - friendly ? BEH_FRIENDLY : BEH_HOSTILE, - dur, you.pos(), - friendly ? you.pet_target : MHITYOU)); - - if (monster == -1) - success = false; - } - - if (!success) - { - destroy_item(i); - - if (!quiet_failure) - { - if (wpn != -1) - mpr("Your weapon vibrates crazily for a second."); - else - msg::stream << "Your " << your_hand(true) << " twitch." - << std::endl; - } - - return (false); - } - - // We are successful. Unwield the weapon, removing any wield effects. - unwield_item(); - - // Copy the unwielded item. - mitm[i] = you.inv[wpn]; - mitm[i].quantity = 1; - mitm[i].x = 0; - mitm[i].y = 0; - mitm[i].link = NON_ITEM; - - // Mark the weapon as thrown, so that we'll autograb it when the - // tango's done. - mitm[i].flags |= ISFLAG_THROWN; - - mprf("%s dances into the air!", you.inv[wpn].name(DESC_CAP_YOUR).c_str()); - - you.inv[wpn].quantity = 0; - - menv[monster].inv[MSLOT_WEAPON] = i; - menv[monster].colour = mitm[i].colour; - burden_change(); - - return (true); -} - // This function returns true if the player can use controlled teleport // here. bool allow_control_teleport( bool silent ) |