summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-09 09:28:31 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-09 09:28:31 +0000
commite67248cc8e088c6531ef4a23b79f7310af807836 (patch)
tree35e2f5c6a674cee45e443776ad905f65e4db27f5 /crawl-ref/source/effects.cc
parent60f91a809bee95fcb61e5d0a03fb447c8199e1e9 (diff)
downloadcrawl-ref-e67248cc8e088c6531ef4a23b79f7310af807836.tar.gz
crawl-ref-e67248cc8e088c6531ef4a23b79f7310af807836.zip
Another armour acquirement tweak:
* Seeing how animal skins never get an ego property, lower the chance of acquirement handing out animal skins. * For armour-restricted species slightly increase the chance of getting one of the simpler hide armours (troll, steam, swamp, dragon). * Remove the chance to reroll for items with egos you already have, but increase the chance to reroll for mundane items if all secondary slots are already filled. * Make Oki's armour acquirements a bit more expensive. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10504 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc35
1 files changed, 25 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 74859e2f43..4f445579fd 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1005,7 +1005,22 @@ static armour_type _acquirement_armour_subtype(bool divine)
{
// Start with normal base armour.
if (result == ARM_ROBE)
- result = coinflip() ? ARM_ROBE : ARM_ANIMAL_SKIN;
+ {
+ // Animal skins don't get egos, so make them less likely.
+ result = (one_chance_in(4) ? ARM_ANIMAL_SKIN : ARM_ROBE);
+
+ // Armour-restricted species get a bonus chance at troll/dragon
+ // armour. (In total, the chance is almost 10%.)
+ if (one_chance_in(20))
+ {
+ result = static_cast<armour_type>(
+ random_choose_weighted(3, ARM_TROLL_LEATHER_ARMOUR,
+ 3, ARM_STEAM_DRAGON_ARMOUR,
+ 1, ARM_SWAMP_DRAGON_ARMOUR,
+ 1, ARM_DRAGON_ARMOUR,
+ 0));
+ }
+ }
else
{
if (divine)
@@ -1020,7 +1035,7 @@ static armour_type _acquirement_armour_subtype(bool divine)
if (one_chance_in(10) && you.skills[SK_ARMOUR] >= 10)
result = ARM_CRYSTAL_PLATE_MAIL;
- if (one_chance_in(10))
+ if (one_chance_in(12))
result = ARM_ANIMAL_SKIN;
}
else
@@ -1863,14 +1878,15 @@ bool acquirement(object_class_type class_wanted, int agent,
if (eq == EQ_BODY_ARMOUR || you.equip[eq] != -1)
{
const special_armour_type sparm = get_armour_ego_type(doodad);
- bool mundane_check = (sparm == SPARM_NORMAL);
+ bool is_mundane = (sparm == SPARM_NORMAL);
+ bool is_redundant = false;
// If the created item is an ego item, check whether we're
// already wearing an item with this ego in the same slot, and
// whether the enchantment is worse than that of the current
// item. (For armour, only consider items of the same subtype.)
// If so, try filling an unfilled equipment slot after all.
- if (!mundane_check && agent != GOD_XOM)
+ if (!is_mundane && agent != GOD_XOM)
{
if (you.equip[eq] != -1
&& (eq != EQ_BODY_ARMOUR
@@ -1879,11 +1895,11 @@ bool acquirement(object_class_type class_wanted, int agent,
&& doodad.plus <= you.inv[you.equip[eq]].plus)
{
// Ego type is cleared later.
- mundane_check = true;
+ is_redundant = true;
}
}
- if (mundane_check)
+ if (is_mundane || is_redundant)
{
if (_try_give_mundane_armour(doodad))
{
@@ -1897,11 +1913,10 @@ bool acquirement(object_class_type class_wanted, int agent,
else if (agent == GOD_XOM && doodad.plus > 0)
doodad.plus *= -1;
}
- else if (eq != EQ_BODY_ARMOUR && agent != GOD_XOM
- && one_chance_in(5))
+ else if (is_mundane && agent != GOD_XOM && one_chance_in(3))
{
- // If there weren't any unfilled slots, there's a 20%
- // chance for non-body armour to roll again.
+ // If the item is mundane and there aren't any
+ // unfilled slots, we might want to roll again.
destroy_item(thing_created, true);
thing_created = NON_ITEM;
continue;