From bd50c076d36322b58a7231a2300d1f391846da87 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sun, 15 Nov 2009 00:58:40 -0500 Subject: Modify temporary brand spells to be delay based --- crawl-ref/source/main.cc | 85 ++++++++++++++++++++++++--------------------- crawl-ref/source/spells1.cc | 4 +-- crawl-ref/source/spells2.cc | 6 ++-- crawl-ref/source/spells4.cc | 9 ++--- 4 files changed, 55 insertions(+), 49 deletions(-) (limited to 'crawl-ref') 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; } } -- cgit v1.2.3-54-g00ecf