summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-03 06:17:51 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-03 06:17:51 +0000
commit05fae4acc24198bfec86f3a5797ab6aaae3ed1fc (patch)
treeadd9de210bca5bb6ad91d47345058a9d642046e7 /crawl-ref
parent357dd075e012861bac98f1e34d6a37b89cad85b4 (diff)
downloadcrawl-ref-05fae4acc24198bfec86f3a5797ab6aaae3ed1fc.tar.gz
crawl-ref-05fae4acc24198bfec86f3a5797ab6aaae3ed1fc.zip
Monsters are less likely to examine big stacks of items.
Fixed monsters being able to switch from cursed hand weapon to launcher. Updated CREDITS. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1724 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/CREDITS2
-rw-r--r--crawl-ref/source/monstuff.cc13
2 files changed, 14 insertions, 1 deletions
diff --git a/crawl-ref/CREDITS b/crawl-ref/CREDITS
index f0acb92f6a..c9c898fed4 100644
--- a/crawl-ref/CREDITS
+++ b/crawl-ref/CREDITS
@@ -34,6 +34,7 @@ R. Dan Henry
Benoit Hudson
Ilyak
Mitsuhiro Itakura
+Eino Keskitalo
Jarmo Kielosto
Kornel Kisielewicz
Ryan Kusnery
@@ -52,6 +53,7 @@ Lemuel Pitkin
Johanna Ploog
Remsleep
David Rose
+Brett Scarborough
Roman Sêk
Sigurd
Solf
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index d65704daf9..0c3dc4d02b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3353,11 +3353,20 @@ static bool handle_throw(monsters *monster, bolt & beem)
return (false);
item_def *launcher = NULL;
+ const item_def *weapon = NULL;
const int mon_item = mons_pick_best_missile(monster, &launcher);
if (mon_item == NON_ITEM || !is_valid_item(mitm[mon_item]))
return (false);
+ // If the attack needs a launcher that we can't wield, bail out.
+ if (launcher)
+ {
+ weapon = monster->mslot_item(MSLOT_WEAPON);
+ if (weapon && weapon != launcher && weapon->cursed())
+ return (false);
+ }
+
// ok, we'll try it.
setup_generic_throw( monster, beem );
@@ -3373,7 +3382,7 @@ static bool handle_throw(monsters *monster, bolt & beem)
// good idea?
if (mons_should_fire( beem ))
{
- if (launcher && launcher != monster->mslot_item(MSLOT_WEAPON))
+ if (launcher && launcher != weapon)
monster->swap_weapons();
beem.name.clear();
@@ -3956,6 +3965,8 @@ static bool handle_pickup(monsters *monster)
item = topickup.link;
if (monster->pickup_item(topickup, monsterNearby))
return (true);
+ if (coinflip())
+ break;
}
return (false);
} // end handle_pickup()