summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-17 22:04:34 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-17 22:04:34 +0000
commitaeb4ec07c472d019e92cd769bbd6484439aa7f86 (patch)
tree03c4c044279ea4ce43e39311cf820d5b4237adc5
parentd636d3368b6441379025477373212cd203fe16bf (diff)
downloadcrawl-ref-aeb4ec07c472d019e92cd769bbd6484439aa7f86.tar.gz
crawl-ref-aeb4ec07c472d019e92cd769bbd6484439aa7f86.zip
Add a check for whether a monster with water habitat can reach the
player and only consider such monster unsafe if there is a path. Replace the old runrest_ignore_monster checks for aquatic monsters with this one, which has the side effect of being nicer to Merfolk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10701 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/settings/init.txt7
-rw-r--r--crawl-ref/source/debug.cc6
-rw-r--r--crawl-ref/source/misc.cc12
-rw-r--r--crawl-ref/source/mon-util.cc7
-rw-r--r--crawl-ref/source/monstuff.cc2
-rw-r--r--crawl-ref/source/mstuff2.cc2
6 files changed, 19 insertions, 17 deletions
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index 44df7f194d..4206f804df 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -185,13 +185,6 @@ runrest_ignore_message = safely over a trap
runrest_ignore_message = You feel.*sick
runrest_ignore_poison = 2:30
runrest_ignore_monster = butterfly:1
-# acquatic monsters
-runrest_ignore_monster = fish:2
-runrest_ignore_monster = shark:2
-runrest_ignore_monster = kraken:2
-# special case for tentacled monstrosity
-runrest_ignore_monster = tentacled:8
-runrest_ignore_monster = tentacle:2
# runrest_ignore_monster = swamp worm:3
# trap_prompt = false
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 2cf9b2130c..8f230dff00 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -549,9 +549,9 @@ void wizard_create_spec_monster_name()
{
if (menv[mid].type == MONS_KRAKEN && menv[mid].alive())
{
- menv[mid].colour = random_choose(GREEN, LIGHTGREY,
- LIGHTGREEN, LIGHTCYAN,
- LIGHTRED, YELLOW, WHITE,
+ menv[mid].colour = random_choose(GREEN, LIGHTGREEN,
+ LIGHTCYAN, LIGHTBLUE,
+ RED, LIGHTRED, MAGENTA,
-1);
return;
}
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 177e235569..26d5a59a00 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2703,10 +2703,14 @@ bool mons_is_safe(const monsters *mon, bool want_move,
// Wizmode skill setting enforces hiddenness.
|| you.skills[SK_STEALTH] > 27 && dist > 2
#endif
- // Only seen through glass walls?
- || !see_grid_no_trans(mon->pos())
- && !_mons_has_path_to_player(mon)
- && !mons_has_los_attack(mon));
+ // Only seen through glass walls or within water?
+ || (!see_grid_no_trans(mon->pos())
+ || mons_class_habitat(mon->type) == HT_WATER
+ || mons_class_habitat(mon->type) == HT_LAVA)
+ && !_mons_has_path_to_player(mon)
+ && !mons_has_los_attack(mon)
+ && (!see_grid_no_trans(mon->pos())
+ || !mons_has_ranged_attack(mon)));
#ifdef CLUA_BINDINGS
if (consider_user_options)
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 8e85a80a1a..0b59250376 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2556,7 +2556,7 @@ bool mons_is_summoned(const monsters *m, int *duration, int *summon_type)
// Clones aren't really summoned (though their equipment might be).
case MON_SUMM_CLONE:
-
+
// Nor are body parts.
case SPELL_KRAKEN_TENTACLES:
@@ -3189,6 +3189,11 @@ bool ms_waste_of_time( const monsters *mon, spell_type monspell )
static bool _ms_los_spell( spell_type monspell )
{
+ // True, the tentacles _are_ summoned but they are restricted to water
+ // just like the kraken is, so it makes more sense not to count them here.
+ if (SPELL_KRAKEN_TENTACLES)
+ return (false);
+
if (monspell == SPELL_SMITING || spell_typematch(monspell, SPTYP_SUMMONING))
return (true);
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a7f15367a1..358b1da0c2 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -1220,7 +1220,7 @@ void mons_relocated(monsters *monster)
else if (monster->type == MONS_KRAKEN_TENTACLE)
{
if (invalid_monster_index(monster->number)
- || menv[monster->number].type!=MONS_KRAKEN
+ || menv[monster->number].type != MONS_KRAKEN
|| _tentacle_too_far(&menv[monster->number], monster))
{
monster_die(monster, KILL_RESET, -1, true, false);
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index f7b08a5523..cb21b973f1 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -263,7 +263,7 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
MSGCH_ERROR);
return;
}
- sumcount2 = random2(9); // up to eight tentacles
+ sumcount2 = std::max(random2(9), random2(9)); // up to eight tentacles
if (sumcount2 == 0)
return;