summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 15:13:06 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-06 15:13:06 +0000
commit5d283404c9129d20b6d8f8c6dd2f051838e2d10d (patch)
treeaadfed893cfbc5647d027271345adfe0f9a9815f /crawl-ref
parent8dbcc4dbe18b959b2eab5a2c20aac3f97c6179f9 (diff)
downloadcrawl-ref-5d283404c9129d20b6d8f8c6dd2f051838e2d10d.tar.gz
crawl-ref-5d283404c9129d20b6d8f8c6dd2f051838e2d10d.zip
Don't allow monsters wielding two-handed weapons to pick up shields.
Partial fix for [2508934]; the bug is still there because monster nagas count as SIZE_BIG, not SIZE_LARGE. I'll let dolorous fix the monster flags. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8926 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/describe.cc3
-rw-r--r--crawl-ref/source/mon-util.cc13
-rw-r--r--crawl-ref/source/newgame.cc10
3 files changed, 17 insertions, 9 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index f5ebbfa8a4..80744767a5 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1083,7 +1083,8 @@ static std::string _describe_weapon(const item_def &item, bool verbose)
break;
}
- const int str_weight = weapon_str_weight(item.base_type, item.sub_type);
+ const int str_weight = weapon_str_weight(item.base_type,
+ item.sub_type);
if (str_weight >= 8)
description += ", and it is best used by the strong";
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 9f87b8bb5f..7c3fd563d8 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4345,6 +4345,19 @@ bool monsters::pickup(item_def &item, int slot, int near, bool force_merge)
return (false);
}
+ // Similarly, monsters won't pick up shields if they're
+ // wielding (or alt-wielding) a two-handed weapon.
+ if (slot == MSLOT_SHIELD)
+ {
+ const item_def* wpn = mslot_item(MSLOT_WEAPON);
+ const item_def* alt = mslot_item(MSLOT_ALT_WEAPON);
+ if (wpn && hands_reqd(*wpn, body_size(PSIZE_BODY)) == HANDS_TWO)
+ return false;
+
+ if (alt && hands_reqd(*alt, body_size(PSIZE_BODY)) == HANDS_TWO)
+ return false;
+ }
+
if (inv[slot] != NON_ITEM)
{
item_def &dest(mitm[inv[slot]]);
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index bbcf16d52a..61894e43cb 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -5077,14 +5077,9 @@ bool _give_items_skills()
{
_print_character_info();
- textcolor( CYAN );
+ textcolor(CYAN);
cprintf(EOL "From where do you draw your power?" EOL);
-
- if (_necromancy_okay())
- textcolor(LIGHTGREY);
- else
- textcolor(DARKGREY);
-
+ textcolor(_necromancy_okay() ? LIGHTGREY : DARKGREY);
cprintf("a - Necromantic magic" EOL);
// Yredelemnul is an okay choice for everyone.
@@ -5191,7 +5186,6 @@ bool _give_items_skills()
you.piety = 28;
you.inv[0].plus = 1 + random2(2);
you.inv[0].plus2 = 3 - you.inv[0].plus;
- you.inv[2].quantity = 0;
you.skills[SK_INVOCATIONS] = 3;
break;
}