summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-10 15:53:50 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-10 15:53:50 +0000
commitb9ec191e5b920fa949a4b82084d15337274e8640 (patch)
tree535470a79edb41283c774d3138ac64b8b5879258
parent49acbb9fe34fcd43074bc243569c7f3bfe064986 (diff)
downloadcrawl-ref-b9ec191e5b920fa949a4b82084d15337274e8640.tar.gz
crawl-ref-b9ec191e5b920fa949a4b82084d15337274e8640.zip
Implement [2805989]: Improve Yred's Enslave Soul ability. Remove the
HD-dependent random resistance check, replace it with an Invocations-dependent timeout, and restrict it to monsters that are no worse than lightly wounded/damaged. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10134 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/beam.cc14
-rw-r--r--crawl-ref/source/dat/descript/ability.txt6
-rw-r--r--crawl-ref/source/enum.h4
-rw-r--r--crawl-ref/source/mon-util.cc16
4 files changed, 30 insertions, 10 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 2065139a9d..5fc30f14f2 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -4816,6 +4816,7 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon)
}
case BEAM_ENSLAVE_SOUL:
+ {
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS,
"HD: %d; pow: %d", mon->hit_dice, ench_power);
@@ -4827,13 +4828,20 @@ mon_resist_type bolt::apply_enchantment_to_monster(monsters* mon)
return (MON_OTHER);
}
- if (mon->hit_dice >= random2(ench_power / 2))
- return (MON_RESIST);
+ // The monster can be no more than lightly wounded/damaged,
+ // using the formula from monstuff.cc:mons_get_damage_level().
+ if (mon->hit_points <= (mon->max_hit_points * 3) / 4)
+ {
+ simple_monster_message(mon, "'s soul is too badly injured.");
+ return (MON_OTHER);
+ }
obvious_effect = true;
- mon->flags |= MF_ENSLAVED_SOUL;
+ const int duration = 1 + you.skills[SK_INVOCATIONS] / 2;
+ mon->add_ench(mon_enchant(ENCH_SOUL_RIPE, 0, KC_YOU, duration * 10));
simple_monster_message(mon, "'s soul is now ripe for the taking.");
return (MON_AFFECTED);
+ }
case BEAM_ENSLAVE_DEMON:
#if DEBUG_DIAGNOSTICS
diff --git a/crawl-ref/source/dat/descript/ability.txt b/crawl-ref/source/dat/descript/ability.txt
index bf331c5ec0..88f898c583 100644
--- a/crawl-ref/source/dat/descript/ability.txt
+++ b/crawl-ref/source/dat/descript/ability.txt
@@ -209,7 +209,11 @@ Heal hit points by draining the life force of the living monsters surrounding yo
%%%%
Enslave Soul
-Mark a monster's living soul as yours, once the monster dies. The soul will retain at least some of the monster's innate healing ability and faculties, and sometimes even the monster's equipment. However, you can only enslave one soul at any given time. Note that enslaved souls, whether twisted or intact, can follow you beyond the level they were created on.
+Mark a monster's living soul as ripe for the taking. Once the marked monster dies, its soul will be yours.
+
+The soul will retain at least some of the monster's innate healing ability and faculties, and sometimes even the monster's equipment. However, only one soul can be enslaved at a time. Also, only a relatively uninjured monster can have its soul marked, and the duration of the mark is dependent on Invocations skill.
+
+Note that enslaved souls, whether twisted or intact, can follow you beyond the level they were created on.
%%%%
# Okawaru
Might
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index b31f0bd73e..46bbccfca1 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1239,6 +1239,7 @@ enum enchant_type
ENCH_PETRIFYING,
ENCH_PETRIFIED,
ENCH_LOWERED_MR,
+ ENCH_SOUL_RIPE,
ENCH_SLOWLY_DYING,
// Update enchantment names in mon-util.cc when adding or removing
@@ -2100,8 +2101,7 @@ enum monster_flag_type
// currently used for abominations created
// via Twisted Resurrection
MF_ENSLAVED_SOUL = 0x8000, // An undead monster soul enslaved by
- // Yredelemnul's power, or the natural
- // monster from whom the soul is taken
+ // Yredelemnul's power
MF_NAME_SUFFIX = 0x10000, // mname is a suffix.
MF_NAME_NO_THE = 0x20000, // mname is a prefix with no "the"
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index ad9bd09bd1..ed227e404c 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -982,8 +982,7 @@ bool mons_can_use_stairs(const monsters *mon)
bool mons_enslaved_body_and_soul(const monsters *mon)
{
- return (testbits(mon->flags, MF_ENSLAVED_SOUL)
- && mons_holiness(mon) == MH_NATURAL);
+ return (mon->has_ench(ENCH_SOUL_RIPE));
}
bool mons_enslaved_twisted_soul(const monsters *mon)
@@ -6989,6 +6988,14 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet)
}
break;
+ case ENCH_SOUL_RIPE:
+ if (!quiet)
+ {
+ simple_monster_message(this,
+ "'s soul is no longer ripe for the taking.");
+ }
+ break;
+
default:
break;
}
@@ -7076,7 +7083,7 @@ void monsters::timeout_enchantments(int levels)
case ENCH_SICK: case ENCH_SLEEPY: case ENCH_PARALYSIS:
case ENCH_PETRIFYING: case ENCH_PETRIFIED:
case ENCH_BATTLE_FRENZY: case ENCH_NEUTRAL:
- case ENCH_LOWERED_MR:
+ case ENCH_LOWERED_MR: case ENCH_SOUL_RIPE:
lose_ench_levels(i->second, levels);
break;
@@ -7217,6 +7224,7 @@ void monsters::apply_enchantment(const mon_enchant &me)
case ENCH_CHARM:
case ENCH_SLEEP_WARY:
case ENCH_LOWERED_MR:
+ case ENCH_SOUL_RIPE:
decay_enchantment(me);
break;
@@ -8233,7 +8241,7 @@ static const char *enchant_names[] =
"gloshifter", "shifter", "tp", "wary", "submerged",
"short-lived", "paralysis", "sick", "sleep", "fatigue", "held",
"blood-lust", "neutral", "petrifying", "petrified", "magic-vulnerable",
- "decay", "bug"
+ "soul-ripe", "decay", "bug"
};
static const char *_mons_enchantment_name(enchant_type ench)