summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
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
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')
-rw-r--r--crawl-ref/source/main.cc85
-rw-r--r--crawl-ref/source/spells1.cc4
-rw-r--r--crawl-ref/source/spells2.cc6
-rw-r--r--crawl-ref/source/spells4.cc9
4 files changed, 55 insertions, 49 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).
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc
index 61303fae0c..c52df3b731 100644
--- a/crawl-ref/source/spells1.cc
+++ b/crawl-ref/source/spells1.cc
@@ -1272,9 +1272,9 @@ void extension(int pow)
}
if ( !(you.duration[DUR_WEAPON_BRAND] < 1
- || you.duration[DUR_WEAPON_BRAND] > 80) )
+ || you.duration[DUR_WEAPON_BRAND] > 80 * BASELINE_DELAY) )
{
- you.duration[DUR_WEAPON_BRAND] += 5 + random2(8);
+ you.duration[DUR_WEAPON_BRAND] += (5 + random2(8)) * BASELINE_DELAY;
}
if (you.duration[DUR_SWIFTNESS])
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 8a325aba27..649c516bf0 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -368,10 +368,10 @@ bool brand_weapon(brand_type which_brand, int power)
const int dur_change = duration_affected + roll_dice(2, power);
- you.duration[DUR_WEAPON_BRAND] += dur_change;
+ you.duration[DUR_WEAPON_BRAND] += dur_change * BASELINE_DELAY;
- if (you.duration[DUR_WEAPON_BRAND] > 50)
- you.duration[DUR_WEAPON_BRAND] = 50;
+ if (you.duration[DUR_WEAPON_BRAND] > 50 * BASELINE_DELAY)
+ you.duration[DUR_WEAPON_BRAND] = 50 * BASELINE_DELAY;
return (true);
}
diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc
index 68c61ad0f9..3c934eb81e 100644
--- a/crawl-ref/source/spells4.cc
+++ b/crawl-ref/source/spells4.cc
@@ -611,11 +611,12 @@ void cast_ignite_poison(int pow)
you.weapon()->name(DESC_CAP_YOUR).c_str());
you.wield_change = true;
- you.duration[DUR_WEAPON_BRAND] +=
- 1 + you.duration[DUR_WEAPON_BRAND] / 2;
+ int increase = (1 + you.duration[DUR_WEAPON_BRAND]/2)
+ * BASELINE_DELAY;
+ you.duration[DUR_WEAPON_BRAND] += increase;
- if (you.duration[DUR_WEAPON_BRAND] > 80)
- you.duration[DUR_WEAPON_BRAND] = 80;
+ if (you.duration[DUR_WEAPON_BRAND] > 80 * BASELINE_DELAY)
+ you.duration[DUR_WEAPON_BRAND] = 80 * BASELINE_DELAY;
}
}