summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-abil.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-06-20 23:49:56 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-06-20 23:53:54 -0700
commit25bcbd27cf7670b42741cb68ac8dfa3c48cf9ae5 (patch)
treeebac2dfcb878e268fd6eb4e970f3d5b54ce51a4d /crawl-ref/source/mon-abil.cc
parented8ba04e1629190c6c5c0db8fdf8240b4a20bb24 (diff)
downloadcrawl-ref-25bcbd27cf7670b42741cb68ac8dfa3c48cf9ae5.tar.gz
crawl-ref-25bcbd27cf7670b42741cb68ac8dfa3c48cf9ae5.zip
Make torpor snails give Slow instead of -Swift
To avoid certain issues with re-using durations in unexpected ways (-swift prevented casting Swiftness & gave a bad @ desc), and also allow the effect to straightforwardly be applied to player allies. (Answering the question, "wait, why does this only affect the player?) Their hd, ac, and damage have been shifted slightly downwards, and their xp multiplier has been shifted dramatically upward, in an attempt to avoid making them *too* much stronger.
Diffstat (limited to 'crawl-ref/source/mon-abil.cc')
-rw-r--r--crawl-ref/source/mon-abil.cc45
1 files changed, 30 insertions, 15 deletions
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index 1fe90f16e9..d7e2eb353d 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -4807,30 +4807,45 @@ void ancient_zyme_sicken(monster* mons)
}
/**
- * Apply the torpor snail -swift effect.
+ * Apply the torpor snail slowing effect.
*
* @param mons The snail applying the effect.
*/
-void torpor_snail_unswift(monster* mons)
+void torpor_snail_slow(monster* mons)
{
- if (is_sanctuary(mons->pos())
- || is_sanctuary(you.pos())
- || you_worship(GOD_CHEIBRIADOS)
- || !you.can_see(mons)
- || !cell_see_cell(you.pos(), mons->pos(), LOS_SOLID_SEE))
- {
+ // XXX: might be nice to refactor together with ancient_zyme_sicken().
+
+ if (is_sanctuary(mons->pos()))
return;
- }
- you.set_duration(DUR_SWIFTNESS, 9 + random2(6), 15);
- if (you.attribute[ATTR_SWIFTNESS] != -1)
+ if (!is_sanctuary(you.pos())
+ && !you.stasis()
+ && !you_worship(GOD_CHEIBRIADOS)
+ && you.can_see(mons)
+ && cell_see_cell(you.pos(), mons->pos(), LOS_SOLID_SEE))
{
- you.attribute[ATTR_SWIFTNESS] = -1;
- mprf("Being near %s leaves you feeling sluggish.",
- mons->name(DESC_THE).c_str());
+ if (!you.duration[DUR_SLOW])
+ {
+ mprf("Being near %s leaves you feeling lethargic.",
+ mons->name(DESC_THE).c_str());
+ }
+
+ if (you.duration[DUR_SLOW] < 27)
+ you.set_duration(DUR_SLOW, 18 + random2(10), 27);
+ // can't set this much shorter, or you periodically 'speed up'
+ // for a turn in the middle of TORPOR COMBAT
}
- // slow (friendly) monsters? (would need to change initial bloc)
+ for (radius_iterator ri(mons->pos(), LOS_RADIUS, C_ROUND); ri; ++ri)
+ {
+ monster *m = monster_at(*ri);
+ if (m && !mons_aligned(mons, m) && !m->check_stasis(true)
+ && !m->is_stationary() && !is_sanctuary(*ri)
+ && cell_see_cell(mons->pos(), *ri, LOS_SOLID_SEE))
+ {
+ m->add_ench(mon_enchant(ENCH_SLOW, 0, mons, 18 + random2(10)));
+ }
+ }
}
static bool _do_merge_masses(monster* initial_mass, monster* merge_to)