summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-abil.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2014-05-10 19:27:10 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2014-05-10 21:38:07 -0600
commitd54608118996fe6861b0eaf66f1d4f0ca039359f (patch)
treea0ecacc9360879f820d73cf5af5d8c7791d04df7 /crawl-ref/source/mon-abil.cc
parent031a9a43fa11401b1d938bf9fa0d47109a02750f (diff)
downloadcrawl-ref-d54608118996fe6861b0eaf66f1d4f0ca039359f.tar.gz
crawl-ref-d54608118996fe6861b0eaf66f1d4f0ca039359f.zip
Revert "Remove silver statues."
Don't worry; the whole point of this set of commits is to fix the problems with them and their companion statues. This partially reverts commit b4c3b502143418fb4fdb3faaa29a2ef6e9eabce5. This reverts commit e1156a91a6a0b1bb26c7e7ee63710c3eefbd2739.
Diffstat (limited to 'crawl-ref/source/mon-abil.cc')
-rw-r--r--crawl-ref/source/mon-abil.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index d937e4b0cb..7ee9db409e 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -1086,6 +1086,37 @@ static bool _siren_movement_effect(const monster* mons)
return do_resist;
}
+static bool _silver_statue_effects(monster* mons)
+{
+ actor *foe = mons->get_foe();
+
+ int abjuration_duration = 5;
+
+ // Tone down friendly silver statues for Zotdef.
+ if (mons->attitude == ATT_FRIENDLY && !(foe && foe->is_player())
+ && crawl_state.game_is_zotdef())
+ {
+ if (!one_chance_in(3))
+ return false;
+ abjuration_duration = 1;
+ }
+
+ if (foe && mons->can_see(foe) && !one_chance_in(3))
+ {
+ const string msg = "'s eyes glow " + weird_glowing_colour() + '.';
+ simple_monster_message(mons, msg.c_str(), MSGCH_WARN);
+
+ create_monster(
+ mgen_data(
+ summon_any_demon((coinflip() ? RANDOM_DEMON_COMMON
+ : RANDOM_DEMON_LESSER)),
+ SAME_ATTITUDE(mons), mons, abjuration_duration, 0,
+ foe->pos(), mons->foe));
+ return true;
+ }
+ return false;
+}
+
static bool _orange_statue_effects(monster* mons)
{
actor *foe = mons->get_foe();
@@ -3481,6 +3512,13 @@ bool mon_special_ability(monster* mons, bolt & beem)
used = _orange_statue_effects(mons);
break;
+ case MONS_SILVER_STATUE:
+ if (player_or_mon_in_sanct(mons))
+ break;
+
+ used = _silver_statue_effects(mons);
+ break;
+
case MONS_BALL_LIGHTNING:
if (is_sanctuary(mons->pos()))
break;