summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/main.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 00:58:40 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 23:46:26 -0500
commitbd50c076d36322b58a7231a2300d1f391846da87 (patch)
tree6eeba8182133bd7ce2a2980d509f7034c48bb9f1 /crawl-ref/source/main.cc
parentb9151ca4e5fe8245f00cc998eb8179e6146b4a54 (diff)
downloadcrawl-ref-bd50c076d36322b58a7231a2300d1f391846da87.tar.gz
crawl-ref-bd50c076d36322b58a7231a2300d1f391846da87.zip
Modify temporary brand spells to be delay based
Diffstat (limited to 'crawl-ref/source/main.cc')
-rw-r--r--crawl-ref/source/main.cc85
1 files changed, 45 insertions, 40 deletions
diff --git a/crawl-ref/source/main.cc b/crawl-ref/source/main.cc
index 41acd40da2..7a8b162b12 100644
--- a/crawl-ref/source/main.cc
+++ b/crawl-ref/source/main.cc
@@ -2250,50 +2250,55 @@ static void _decrement_durations()
}
//jmf: More flexible weapon branding code.
- if (you.duration[DUR_WEAPON_BRAND] > 1)
- you.duration[DUR_WEAPON_BRAND]--;
- else if (you.duration[DUR_WEAPON_BRAND] == 1)
- {
- item_def& weapon = *you.weapon();
- const int temp_effect = get_weapon_brand(weapon);
+ int last_value = you.duration[DUR_WEAPON_BRAND];
- you.duration[DUR_WEAPON_BRAND] = 0;
- set_item_ego_type(weapon, OBJ_WEAPONS, SPWPN_NORMAL);
- std::string msg = weapon.name(DESC_CAP_YOUR);
+ if(last_value > 0)
+ {
+ you.duration[DUR_WEAPON_BRAND] -= delay;
- switch (temp_effect)
+ if (you.duration[DUR_WEAPON_BRAND] <= 0)
{
- 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 painful.";
- break;
- default:
- msg += " seems inexplicably less special.";
- break;
- }
+ 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);
+ std::string msg = weapon.name(DESC_CAP_YOUR);
- mpr(msg.c_str(), MSGCH_DURATION);
- you.wield_change = true;
+ 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 painful.";
+ break;
+ default:
+ msg += " seems inexplicably less special.";
+ break;
+ }
+
+ mpr(msg.c_str(), MSGCH_DURATION);
+ you.wield_change = true;
+ }
}
// Vampire bat transformations are permanent (until ended).