summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/artefact.cc
diff options
context:
space:
mode:
authorpubby <pubby8@gmail.com>2013-08-31 16:40:44 -0500
committerpubby <pubby8@gmail.com>2013-08-31 16:49:50 -0500
commit65c58ed6ccd53a9a080255ee37e131123ac65e96 (patch)
treed4a3d59267fa5c14ae7573b91f7dac9b66955159 /crawl-ref/source/artefact.cc
parentc4b51221cd6f40f90127768df0e2e1ad7ed7310e (diff)
parent70ca29ee15926336c0ab2369cb25743a9e510e08 (diff)
downloadcrawl-ref-65c58ed6ccd53a9a080255ee37e131123ac65e96.tar.gz
crawl-ref-65c58ed6ccd53a9a080255ee37e131123ac65e96.zip
Merge branch 'master' into dwants
Conflicts: crawl-ref/docs/crawl_manual.reST crawl-ref/source/abl-show.cc crawl-ref/source/dat/descript/ability.txt crawl-ref/source/delay.cc crawl-ref/source/enum.h crawl-ref/source/main.cc crawl-ref/source/mon-cast.cc crawl-ref/source/mon-gear.cc crawl-ref/source/mon-spll.h crawl-ref/source/mutation-data.h crawl-ref/source/mutation.cc crawl-ref/source/ng-restr.cc crawl-ref/source/ng-setup.cc crawl-ref/source/output.cc crawl-ref/source/player-act.cc crawl-ref/source/player.cc crawl-ref/source/species.cc crawl-ref/source/spl-data.h crawl-ref/source/wiz-you.cc
Diffstat (limited to 'crawl-ref/source/artefact.cc')
-rw-r--r--crawl-ref/source/artefact.cc90
1 files changed, 32 insertions, 58 deletions
diff --git a/crawl-ref/source/artefact.cc b/crawl-ref/source/artefact.cc
index a4561b9f89..92e306777d 100644
--- a/crawl-ref/source/artefact.cc
+++ b/crawl-ref/source/artefact.cc
@@ -135,12 +135,6 @@ static bool _god_fits_artefact(const god_type which_god, const item_def &item,
switch (which_god)
{
- case GOD_BEOGH:
- // Orc god: no orc slaying.
- if (brand == SPWPN_ORC_SLAYING)
- return false;
- break;
-
case GOD_ELYVILON:
// Peaceful healer god: no berserking.
if (artefact_wpn_property(item, ARTP_ANGRY)
@@ -708,19 +702,7 @@ static void _get_randart_properties(const item_def &item,
if (aclass == OBJ_WEAPONS) // Only weapons get brands, of course.
{
- proprt[ARTP_BRAND] = SPWPN_FLAMING + random2(16); // brand
-
- if (one_chance_in(6))
- proprt[ARTP_BRAND] = SPWPN_FLAMING + random2(2);
-
- if (one_chance_in(6))
- proprt[ARTP_BRAND] = SPWPN_ORC_SLAYING + random2(5);
-
- if (one_chance_in(6))
- proprt[ARTP_BRAND] = SPWPN_VORPAL;
-
- if (proprt[ARTP_BRAND] == SPWPN_PROTECTION || proprt[ARTP_BRAND] == SPWPN_EVASION)
- proprt[ARTP_BRAND] = SPWPN_NORMAL; // no protection or evasion
+ power_level++; // at least a brand
if (is_range_weapon(item))
{
@@ -744,50 +726,42 @@ static void _get_randart_properties(const item_def &item,
proprt[ARTP_BRAND] = SPWPN_PENETRATION;
}
}
-
- // Quarter of the chance of distortion elsewhere.
- if (!is_range_weapon(item) && one_chance_in(100))
- proprt[ARTP_BRAND] = SPWPN_DISTORTION;
- else if (is_demonic(item))
+ else if (is_demonic(item) && x_chance_in_y(7, 9))
{
- switch (random2(9))
- {
- case 0:
- proprt[ARTP_BRAND] = SPWPN_DRAINING;
- break;
- case 1:
- proprt[ARTP_BRAND] = SPWPN_FLAMING;
- break;
- case 2:
- proprt[ARTP_BRAND] = SPWPN_FREEZING;
- break;
- case 3:
- proprt[ARTP_BRAND] = SPWPN_ELECTROCUTION;
- break;
- case 4:
- proprt[ARTP_BRAND] = SPWPN_VAMPIRICISM;
- break;
- case 5:
- proprt[ARTP_BRAND] = SPWPN_PAIN;
- break;
- case 6:
- proprt[ARTP_BRAND] = SPWPN_VENOM;
- break;
- default:
- power_level -= 2;
- }
- power_level += 2;
+ proprt[ARTP_BRAND] = random_choose(
+ SPWPN_DRAINING,
+ SPWPN_FLAMING,
+ SPWPN_FREEZING,
+ SPWPN_ELECTROCUTION,
+ SPWPN_VAMPIRICISM,
+ SPWPN_PAIN,
+ SPWPN_VENOM,
+ -1);
+ power_level++; // Demon weapons get an extra penalty -- why?
+ // fall back to regular melee brands 2/9 of the time
}
- else if (one_chance_in(3))
- proprt[ARTP_BRAND] = SPWPN_NORMAL;
else
- power_level++;
+ {
+ proprt[ARTP_BRAND] = random_choose_weighted(
+ 73, SPWPN_VORPAL,
+ 34, SPWPN_FLAMING,
+ 34, SPWPN_FREEZING,
+ 26, SPWPN_DRAGON_SLAYING,
+ 26, SPWPN_VENOM,
+ 26, SPWPN_DRAINING,
+ 13, SPWPN_HOLY_WRATH,
+ 13, SPWPN_ELECTROCUTION,
+ 13, SPWPN_SPEED,
+ 13, SPWPN_VAMPIRICISM,
+ 13, SPWPN_PAIN,
+ 13, SPWPN_ANTIMAGIC,
+ 3, SPWPN_DISTORTION,
+ 0);
+ }
+ // no brand = magic flag to reject and retry
if (!is_weapon_brand_ok(atype, proprt[ARTP_BRAND], true))
- {
proprt[ARTP_BRAND] = SPWPN_NORMAL;
- power_level--;
- }
}
if (!one_chance_in(5))
@@ -1009,7 +983,7 @@ static void _get_randart_properties(const item_def &item,
power_level++;
}
- // Armours get fewer powers, and are also less likely to be cursed
+ // Armours get fewer powers, and are also more likely to be cursed
// than weapons.
if (aclass == OBJ_ARMOUR)
power_level -= 4;