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-08 15:25:02 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-08-08 15:25:02 +0000
commitc4263fdd9aedbf0e51e65b84b1b5c630a3cf3643 (patch)
tree656e37b86ba4f1dff38adbdcfcb00140ae5fa827 /crawl-ref/source/effects.cc
parent8ec73a1e28b4f0695f567a76ed289836581130f6 (diff)
downloadcrawl-ref-c4263fdd9aedbf0e51e65b84b1b5c630a3cf3643.tar.gz
crawl-ref-c4263fdd9aedbf0e51e65b84b1b5c630a3cf3643.zip
More artefact/acquirement modifications:
* When handing out body armour via scroll acquirement, use a rough order of armour subtypes and assign weights according to Armour skill, i.e. robes are most likely at Armour skill 0 and crystal plate mail is most likely at Armour skill 27 (well, 24+, to be exact). * When handing out mundane items, consider the shield slot to be filled if the character is unarmed has a high UC skill, or is wielding a two-hander, a ranged weapon, or a rod. I don't know how much shields hamper spellcasting - that could be included as well. * In the creation of artefacts (also outside acquirement) make sure that those boring randarts that only have one stat property (AC, EV, Str, Dex, Int) get another one, and there's a chance of getting a third. Also, if the only property is Acc or Dam there's a 50% chance of getting one or two more. As before, the bonus properties are all stat properties, so this shouldn't be too powerful. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10501 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc67
1 files changed, 57 insertions, 10 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 95b0ee1319..81b80e9dc6 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1003,23 +1003,50 @@ static armour_type _acquirement_armour_subtype(bool okawaru)
// hides. -- bwr
if (result == NUM_ARMOURS || result == ARM_ROBE)
{
- // start with normal base armour
+ // Start with normal base armour.
if (result == ARM_ROBE)
result = coinflip() ? ARM_ROBE : ARM_ANIMAL_SKIN;
else
{
- const armour_type armours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR,
- ARM_RING_MAIL, ARM_SCALE_MAIL,
- ARM_CHAIN_MAIL, ARM_SPLINT_MAIL,
- ARM_BANDED_MAIL, ARM_PLATE_MAIL };
+ if (okawaru)
+ {
+ const armour_type armours[] = { ARM_ROBE, ARM_LEATHER_ARMOUR,
+ ARM_RING_MAIL, ARM_SCALE_MAIL,
+ ARM_CHAIN_MAIL, ARM_SPLINT_MAIL,
+ ARM_BANDED_MAIL, ARM_PLATE_MAIL };
- result = static_cast<armour_type>(RANDOM_ELEMENT(armours));
+ result = static_cast<armour_type>(RANDOM_ELEMENT(armours));
- if (one_chance_in(10) && you.skills[SK_ARMOUR] >= 10)
- result = ARM_CRYSTAL_PLATE_MAIL;
+ if (one_chance_in(10) && you.skills[SK_ARMOUR] >= 10)
+ result = ARM_CRYSTAL_PLATE_MAIL;
- if (one_chance_in(10))
- result = ARM_ANIMAL_SKIN;
+ if (one_chance_in(10))
+ result = ARM_ANIMAL_SKIN;
+ }
+ else
+ {
+ const armour_type armours[] =
+ { ARM_ANIMAL_SKIN, ARM_ROBE, ARM_LEATHER_ARMOUR,
+ ARM_RING_MAIL, ARM_SCALE_MAIL, ARM_CHAIN_MAIL,
+ ARM_BANDED_MAIL, ARM_SPLINT_MAIL, ARM_PLATE_MAIL,
+ ARM_CRYSTAL_PLATE_MAIL };
+
+ const int num_arms = ARRAYSZ(armours);
+
+ // Weight sub types relative to (armour skill + 3).
+ // Actually, the AC improvement is not linear, and we might
+ // also want to take into account Dodging/Stealth and Strength,
+ // but this is definitely better than the random chance above.
+ const int skill = std::min(27, you.skills[SK_ARMOUR] + 3);
+ int total = 0;
+ for (int i = 0; i < num_arms; ++i)
+ {
+ const int weight = std::max(1, 27 - abs(skill - i*3));
+ total += weight;
+ if (x_chance_in_y(weight, total))
+ result = armours[i];
+ }
+ }
}
// Everyone can wear things made from hides.
@@ -1060,6 +1087,26 @@ static bool _try_give_mundane_armour(item_def &arm)
if (you.equip[armour_slots[i]] != -1)
continue;
+ // Consider shield slot filled in some cases.
+ if (armour_slots[i] == EQ_SHIELD)
+ {
+ if (you.equip[EQ_WEAPON] == -1)
+ {
+ if (you.skills[SK_UNARMED_COMBAT] > random2(8))
+ continue;
+ }
+ else
+ {
+ const item_def weapon = you.inv[you.equip[EQ_WEAPON]];
+ const hands_reqd_type hand = hands_reqd(weapon, player_size());
+ if (hand == HANDS_TWO || item_is_rod(weapon)
+ || is_range_weapon(weapon))
+ {
+ continue;
+ }
+ }
+ }
+
if (one_chance_in(++count))
picked = armour_slots[i];
}