summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-03 22:52:08 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-03 23:54:25 +1000
commit196415dd325aa0fbe4c309f29d86a07a3988cb4a (patch)
tree7803b54e9c4b1358471630b50cd63f27e42b37f8
parenta0c81e59f0325e542ecf2feaa21b29cd3ffc0bc1 (diff)
downloadcrawl-ref-196415dd325aa0fbe4c309f29d86a07a3988cb4a.tar.gz
crawl-ref-196415dd325aa0fbe4c309f29d86a07a3988cb4a.zip
New (ranged) weapon brand: evasion.
This replaces "protection" on all ranged weapons, and will only generate on those. This commit also fixes shopping values for the new needle brands.
-rw-r--r--crawl-ref/source/artefact.cc8
-rw-r--r--crawl-ref/source/describe.cc3
-rw-r--r--crawl-ref/source/it_use2.cc6
-rw-r--r--crawl-ref/source/item_use.cc4
-rw-r--r--crawl-ref/source/itemname.cc1
-rw-r--r--crawl-ref/source/itemprop-enum.h3
-rw-r--r--crawl-ref/source/makeitem.cc5
-rw-r--r--crawl-ref/source/monster.cc9
-rw-r--r--crawl-ref/source/player.cc4
-rw-r--r--crawl-ref/source/shopping.cc7
10 files changed, 41 insertions, 9 deletions
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index cb9e135e63..007a799cfe 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -742,8 +742,8 @@ void static _get_randart_properties(const item_def &item,
if (one_chance_in(6))
proprt[ARTP_BRAND] = SPWPN_VORPAL;
- if (proprt[ARTP_BRAND] == SPWPN_PROTECTION)
- proprt[ARTP_BRAND] = SPWPN_NORMAL; // no protection
+ if (proprt[ARTP_BRAND] == SPWPN_PROTECTION || proprt[ARTP_BRAND] == SPWPN_EVASION)
+ proprt[ARTP_BRAND] = SPWPN_NORMAL; // no protection or evasion
if (is_range_weapon(item))
{
@@ -756,13 +756,13 @@ void static _get_randart_properties(const item_def &item,
proprt[ARTP_BRAND] = (tmp >= 18) ? SPWPN_SPEED :
(tmp >= 16) ? SPWPN_PENETRATION :
(tmp >= 13) ? SPWPN_REAPING :
- (tmp >= 10) ? SPWPN_PROTECTION :
+ (tmp >= 10) ? SPWPN_EVASION :
(tmp >= 7) ? SPWPN_VENOM
: SPWPN_VORPAL + random2(3);
if (atype == WPN_BLOWGUN
&& proprt[ARTP_BRAND] != SPWPN_SPEED
- && proprt[ARTP_BRAND] != SPWPN_PROTECTION)
+ && proprt[ARTP_BRAND] != SPWPN_EVASION)
{
proprt[ARTP_BRAND] = SPWPN_NORMAL;
}
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 426f4527ef..30fef96674 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -776,6 +776,9 @@ static std::string _describe_weapon(const item_def &item, bool verbose)
description += "It protects the one who wields it against "
"injury (+5 to AC).";
break;
+ case SPWPN_EVASION:
+ description += "It affects your evasion (+5 to EV).";
+ break;
case SPWPN_DRAINING:
description += "A truly terrible weapon, it drains the "
"life of those it strikes.";
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 1588e86e84..53cdb875dc 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -523,6 +523,12 @@ bool unwield_item(bool showMsgs)
you.redraw_armour_class = true;
break;
+ case SPWPN_EVASION:
+ if (showMsgs)
+ mpr("You feel like more of a target.");
+ you.redraw_evasion = true;
+ break;
+
case SPWPN_VAMPIRICISM:
if (showMsgs)
{
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 618720050c..07f25baf8b 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -613,6 +613,10 @@ void wield_effects(int item_wield_2, bool showMsgs)
mpr("You feel protected!");
break;
+ case SPWPN_EVASION:
+ mpr("You feel nimbler!");
+ break;
+
case SPWPN_DRAINING:
mpr("You sense an unholy aura.");
break;
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 2c1be54220..d2a9bbdfdf 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -308,6 +308,7 @@ const char* weapon_brand_name(const item_def& item, bool terse)
case SPWPN_DRAGON_SLAYING: return ((terse) ? " (slay drac)":" of dragon slaying");
case SPWPN_VENOM: return ((terse) ? " (venom)" : " of venom");
case SPWPN_PROTECTION: return ((terse) ? " (protect)" : " of protection");
+ case SPWPN_EVASION: return ((terse) ? " (evade)" : " of evasion");
case SPWPN_DRAINING: return ((terse) ? " (drain)" : " of draining");
case SPWPN_SPEED: return ((terse) ? " (speed)" : " of speed");
case SPWPN_PAIN: return ((terse) ? " (pain)" : " of pain");
diff --git a/crawl-ref/source/itemprop-enum.h b/crawl-ref/source/itemprop-enum.h
index 624221f688..b1401d3e9c 100644
--- a/crawl-ref/source/itemprop-enum.h
+++ b/crawl-ref/source/itemprop-enum.h
@@ -95,8 +95,9 @@ enum brand_type // equivalent to (you.inv[].special or mitm[].special) % 30
SPWPN_REACHING,
SPWPN_RETURNING, // 18
SPWPN_CHAOS,
+ SPWPN_EVASION,
- MAX_PAN_LORD_BRANDS = SPWPN_CHAOS,
+ MAX_PAN_LORD_BRANDS = SPWPN_EVASION,
SPWPN_CONFUSE, // 20
SPWPN_PENETRATION,
diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc
index 07473975b8..551e148820 100644
--- a/crawl-ref/source/makeitem.cc
+++ b/crawl-ref/source/makeitem.cc
@@ -1419,7 +1419,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level)
else if (tmp < 880 && (item.sub_type == WPN_BOW || item.sub_type == WPN_LONGBOW))
rc = SPWPN_REAPING;
else if (tmp < 880)
- rc = SPWPN_PROTECTION;
+ rc = SPWPN_EVASION;
else if (tmp < 990)
rc = SPWPN_VORPAL;
@@ -1441,7 +1441,7 @@ static brand_type _determine_weapon_brand(const item_def& item, int item_level)
if (one_chance_in(10))
rc = SPWPN_VORPAL;
- if (one_chance_in(5))
+ if (one_chance_in(6))
rc = SPWPN_PROTECTION;
break;
@@ -1567,6 +1567,7 @@ bool is_weapon_brand_ok(int type, int brand)
case SPWPN_FLAME:
case SPWPN_FROST:
case SPWPN_PENETRATION:
+ case SPWPN_EVASION:
if (!is_range_weapon(item))
return (false);
break;
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 1171a3c2c3..4f41076b68 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -788,6 +788,8 @@ void monsters::equip_weapon(item_def &item, int near, bool msg)
const int brand = get_weapon_brand(item);
if (brand == SPWPN_PROTECTION)
ac += 5;
+ if (brand == SPWPN_EVASION)
+ ev += 5;
if (msg)
{
@@ -915,6 +917,8 @@ void monsters::unequip_weapon(item_def &item, int near, bool msg)
const int brand = get_weapon_brand(item);
if (brand == SPWPN_PROTECTION)
ac -= 5;
+ if (brand == SPWPN_EVASION)
+ ev -= 5;
if (msg && brand != SPWPN_NORMAL)
{
@@ -1299,9 +1303,10 @@ static int _ego_damage_bonus(item_def &item)
switch (get_weapon_brand(item))
{
case SPWPN_NORMAL: return 0;
- case SPWPN_PROTECTION: return 1;
+ case SPWPN_VORPAL: // deliberate
+ case SPWPN_PROTECTION: // fall through
+ case SPWPN_EVASION: return 1;
default: return 2;
- case SPWPN_VORPAL: return 1;
}
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index b4a2611d9e..d29a361040 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2134,6 +2134,10 @@ int player_evasion(ev_ignore_type evit)
ev -= 2;
ev += player_equip( EQ_RINGS_PLUS, RING_EVASION );
+
+ if (player_equip_ego_type( EQ_WEAPON, SPWPN_EVASION ))
+ ev += 5;
+
ev += scan_artefacts( ARTP_EVASION );
// ponderous ev mod
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index ac20af1433..5606ef4428 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1061,6 +1061,7 @@ unsigned int item_value( item_def item, bool ident )
case SPWPN_VORPAL:
case SPWPN_PROTECTION:
+ case SPWPN_EVASION:
valued *= 20;
break;
}
@@ -1197,6 +1198,12 @@ unsigned int item_value( item_def item, bool ident )
break;
case SPMSL_POISONED:
+ case SPMSL_PARALYSIS:
+ case SPMSL_SLOW:
+ case SPMSL_SLEEP:
+ case SPMSL_CONFUSION:
+ case SPMSL_SICKNESS:
+ case SPMSL_RAGE:
valued *= 23;
break;
}