summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-movetarget.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2013-08-12 15:43:42 +0200
committerRaphael Langella <raphael.langella@gmail.com>2013-08-12 15:49:00 +0200
commit40eb210485ae15fdf5be7e96104197e26b3fa5f6 (patch)
treeaa733e21ad970922b2df54b48ec35ad218da434f /crawl-ref/source/mon-movetarget.cc
parentd993d8a94ebf88d624d434119000bc7293dafba9 (diff)
downloadcrawl-ref-40eb210485ae15fdf5be7e96104197e26b3fa5f6.tar.gz
crawl-ref-40eb210485ae15fdf5be7e96104197e26b3fa5f6.zip
Revert "Bye bye clinging."
Clinging might be a minor feature, but it's a distinguishing one, it's thematic and it's working quite well. Player/monster symmetry has never been a goal, so it seems dubious to invoke it as the reason to throw away all the work that has been put into clinging. We can always say that the player turns into a different kind of spider which is unable to cling for some reason. This reverts commit bdc56382eacf7af1b2330dc6444916d368741fec. This reverts commit d689486464fcaaac025a6f469ab69674a2f4d173. This reverts commit 1addaaf8ee92de5060fdb436f93251843abd2035.
Diffstat (limited to 'crawl-ref/source/mon-movetarget.cc')
-rw-r--r--crawl-ref/source/mon-movetarget.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-movetarget.cc b/crawl-ref/source/mon-movetarget.cc
index 0fbd37fdc7..d8003f6bdf 100644
--- a/crawl-ref/source/mon-movetarget.cc
+++ b/crawl-ref/source/mon-movetarget.cc
@@ -61,6 +61,10 @@ static void _mark_neighbours_target_unreachable(monster* mon)
if (mons_primary_habitat(m) != habit)
continue;
+ // Wall clinging monsters use different pathfinding.
+ if (mon->can_cling_to_walls() != m->can_cling_to_walls())
+ continue;
+
// A flying monster has an advantage over a non-flying one.
// Same for a swimming one.
if (!flies && mons_flies(m)
@@ -171,9 +175,13 @@ bool try_pathfind(monster* mon)
// If the target is "unreachable" (the monster already tried,
// and failed, to find a path), there's a chance of trying again.
- // Retreating monsters retry every turn.
- if (target_is_unreachable(mon) && !one_chance_in(12))
+ // The chance is higher for wall clinging monsters to help them avoid
+ // shallow water. Retreating monsters retry every turn.
+ if (target_is_unreachable(mon) && !one_chance_in(12)
+ && !(mon->can_cling_to_walls() && one_chance_in(4)))
+ {
return false;
+ }
#ifdef DEBUG_PATHFIND
mprf("%s: Player out of reach! What now?",