diff options
author | Shmuale Mark <shm.mark@gmail.com> | 2014-06-12 13:26:47 -0400 |
---|---|---|
committer | Shmuale Mark <shm.mark@gmail.com> | 2014-06-12 13:41:10 -0400 |
commit | e561a6638b9c70b2f3ad265faa83520c7af28226 (patch) | |
tree | eb7e8c675d6119f1f1915ce90d3b26ef922b3973 /crawl-ref/source/player-reacts.cc | |
parent | b80c8152ad0ca63863a0ba367b1fede1f4b36504 (diff) | |
download | crawl-ref-e561a6638b9c70b2f3ad265faa83520c7af28226.tar.gz crawl-ref-e561a6638b9c70b2f3ad265faa83520c7af28226.zip |
Allow temporary branding to go over a permanent brand.
Toting around an unbranded weapon just to be able to swap to it
is no fun, and not even that much more of a difficulty; maybe it
just means getting pain out takes 0.7 more turns or so. You still
can't overwrite artefacts, of course.
Diffstat (limited to 'crawl-ref/source/player-reacts.cc')
-rw-r--r-- | crawl-ref/source/player-reacts.cc | 60 |
1 files changed, 4 insertions, 56 deletions
diff --git a/crawl-ref/source/player-reacts.cc b/crawl-ref/source/player-reacts.cc index 6673e5921b..6d9e2c92bf 100644 --- a/crawl-ref/source/player-reacts.cc +++ b/crawl-ref/source/player-reacts.cc @@ -127,6 +127,7 @@ #include "spl-summoning.h" #include "spl-transloc.h" #include "spl-util.h" +#include "spl-wpnench.h" #include "stairs.h" #include "stash.h" #include "state.h" @@ -505,67 +506,14 @@ static void _decrement_durations() } //jmf: More flexible weapon branding code. - int last_value = you.duration[DUR_WEAPON_BRAND]; - - if (last_value > 0) + if (you.duration[DUR_WEAPON_BRAND] > 0) { you.duration[DUR_WEAPON_BRAND] -= delay; if (you.duration[DUR_WEAPON_BRAND] <= 0) { - you.duration[DUR_WEAPON_BRAND] = 0; - item_def& weapon = *you.weapon(); - const int temp_effect = get_weapon_brand(weapon); - - set_item_ego_type(weapon, OBJ_WEAPONS, SPWPN_NORMAL); - const char *msg = nullptr; - - switch (temp_effect) - { - case SPWPN_VORPAL: - if (get_vorpal_type(weapon) == DVORP_SLICING) - msg = " seems blunter."; - else - msg = " feels lighter."; - break; - case SPWPN_FLAMING: - msg = " goes out."; - break; - case SPWPN_FREEZING: - msg = " stops glowing."; - break; - case SPWPN_VENOM: - msg = " stops dripping with poison."; - break; - case SPWPN_DRAINING: - msg = " stops crackling."; - break; - case SPWPN_DISTORTION: - msg = " seems straighter."; - break; - case SPWPN_PAIN: - msg = " seems less pained."; - break; - case SPWPN_CHAOS: - msg = " seems more stable."; - break; - case SPWPN_ELECTROCUTION: - msg = " stops emitting sparks."; - break; - case SPWPN_HOLY_WRATH: - msg = "'s light goes out."; - break; - case SPWPN_ANTIMAGIC: - msg = " stops repelling magic."; - calc_mp(); - break; - default: - msg = " seems inexplicably less special."; - break; - } - - mprf(MSGCH_DURATION, "%s%s", weapon.name(DESC_YOUR).c_str(), msg); - you.wield_change = true; + you.duration[DUR_WEAPON_BRAND] = 1; + end_weapon_brand(true); } } |