summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2010-01-07 20:16:25 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2010-01-07 21:25:57 +1000
commit00005320c53fa3bdd66df6d805bf4f83fa43bec1 (patch)
tree02038aca86a5ce6d01965ba91b8e191ebe8a2e2b
parentcf714fb898d9a640ac9d7fc7f90d9a81294b572b (diff)
downloadcrawl-ref-00005320c53fa3bdd66df6d805bf4f83fa43bec1.tar.gz
crawl-ref-00005320c53fa3bdd66df6d805bf4f83fa43bec1.zip
Change "wrath" needles to "frenzy".
This introduces a new monster enchantment: ENCH_INSANE (or frenzy), sends the monster neutral and berserk at the same time. The needle now has the effect of causing this enchantment, instead of just sending monsters berserk. It now actually has some use, even if it is slightly risky.
-rw-r--r--crawl-ref/source/directn.cc1
-rw-r--r--crawl-ref/source/enum.h1
-rw-r--r--crawl-ref/source/item_use.cc9
-rw-r--r--crawl-ref/source/itemname.cc2
-rw-r--r--crawl-ref/source/mon-info.cc4
-rw-r--r--crawl-ref/source/monster.cc58
-rw-r--r--crawl-ref/source/monster.h2
7 files changed, 72 insertions, 5 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index bfbc35b166..8e17763165 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2994,6 +2994,7 @@ static std::string _describe_mons_enchantment(const monsters &mons,
case ENCH_ROT: return "rotting away"; //jmf: "covered in sores"?
case ENCH_CORONA: return "softly glowing";
case ENCH_SLOW: return "moving slowly";
+ case ENCH_INSANE: return "frenzied and insane";
case ENCH_BERSERK: return "berserk";
case ENCH_BATTLE_FRENZY: return "consumed by blood-lust";
case ENCH_HASTE: return "moving very quickly";
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 20afad48f0..623ee6b7c4 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -1243,6 +1243,7 @@ enum enchant_type
ENCH_SLOUCH,
ENCH_SWIFT,
ENCH_TIDE,
+ ENCH_INSANE,
// Update enchantment names in mon-util.cc when adding or removing
// enchantments.
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 90ecdf2038..0b08db911e 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2017,7 +2017,14 @@ static bool _rage_hit_victim (bolt &beam, actor* victim, int dmg,
if (!_blowgun_check(beam, victim))
return (false);
- victim->go_berserk(false);
+ if (victim->atype() == ACT_MONSTER)
+ {
+ monsters* mons = static_cast<monsters*>(victim);
+ mons->go_frenzy();
+ }
+ else
+ victim->go_berserk(false);
+
return (true);
}
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index beda8a3e5a..9a36074270 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1195,7 +1195,7 @@ std::string item_def::name_aux(description_level_type desc,
buff << ((terse) ? " (sick)" : " of sickening");
break;
case SPMSL_RAGE:
- buff << ((terse) ? " (wrath)" : " of wrath");
+ buff << ((terse) ? " (frenzy)" : " of frenzy");
break;
case SPMSL_RETURNING:
buff << ((terse) ? " (return)" : " of returning");
diff --git a/crawl-ref/source/mon-info.cc b/crawl-ref/source/mon-info.cc
index 07b0e4eab8..cf4b7d0b79 100644
--- a/crawl-ref/source/mon-info.cc
+++ b/crawl-ref/source/mon-info.cc
@@ -275,7 +275,9 @@ void monster_info::to_string(int count, std::string& desc,
if (count == 1)
{
- if (m_mon->berserk())
+ if (m_mon->frenzied())
+ out << " (frenzied)";
+ else if (m_mon->berserk())
out << " (berserk)";
else if (Options.verbose_monster_pane)
out << _verbose_info(m_mon);
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index b7218a97b6..f541ccd0f4 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -2731,6 +2731,37 @@ void monsters::attacking(actor * /* other */)
{
}
+// Sends a monster into a frenzy.
+void monsters::go_frenzy()
+{
+ if (!can_go_berserk())
+ return;
+
+ if (has_ench(ENCH_SLOW))
+ {
+ del_ench(ENCH_SLOW, true); // Give no additional message.
+ simple_monster_message(this,
+ make_stringf(" shakes off %s lethargy.",
+ pronoun(PRONOUN_NOCAP_POSSESSIVE).c_str()).c_str());
+ }
+ del_ench(ENCH_HASTE, true);
+ del_ench(ENCH_FATIGUE, true); // Give no additional message.
+
+ const int duration = 16 + random2avg(13, 2);
+
+ // store the attitude for later retrieval
+ props["old_attitude"] = short(attitude);
+
+ attitude = ATT_NEUTRAL;
+ add_ench(mon_enchant(ENCH_INSANE, 0, KC_OTHER, duration * 10));
+ add_ench(mon_enchant(ENCH_HASTE, 0, KC_OTHER, duration * 10));
+ add_ench(mon_enchant(ENCH_MIGHT, 0, KC_OTHER, duration * 10));
+
+ if (simple_monster_message(this, " flies into a frenzy!"))
+ // Xom likes monsters going insane.
+ xom_is_stimulated(friendly() ? 32 : 128);
+}
+
void monsters::go_berserk(bool /* intentional */)
{
if (!can_go_berserk())
@@ -4087,6 +4118,7 @@ void monsters::add_enchantment_effect(const mon_enchant &ench, bool quiet)
// Check for slow/haste.
switch (ench.ench)
{
+ case ENCH_INSANE:
case ENCH_BERSERK:
// Inflate hp.
scale_hp(2, 1);
@@ -4303,6 +4335,10 @@ void monsters::remove_enchantment_effect(const mon_enchant &me, bool quiet)
shoals_release_tide(this);
break;
+ case ENCH_INSANE:
+ attitude = static_cast<mon_attitude_type>(props["old_attitude"].get_short());
+ // deliberate fall through
+
case ENCH_BERSERK:
scale_hp(1, 2);
break;
@@ -4641,6 +4677,7 @@ void monsters::timeout_enchantments(int levels)
lose_ench_levels(i->second, levels);
break;
+ case ENCH_INSANE:
case ENCH_BERSERK:
del_ench(i->first);
del_ench(ENCH_HASTE, true);
@@ -4747,6 +4784,18 @@ void monsters::apply_enchantment(const mon_enchant &me)
const int spd = 10;
switch (me.ench)
{
+ case ENCH_INSANE:
+ if (decay_enchantment(me))
+ {
+ simple_monster_message(this, " is no longer in an insane frenzy.");
+ del_ench(ENCH_HASTE, true);
+ del_ench(ENCH_MIGHT, true);
+ const int duration = random_range(70, 130);
+ add_ench(mon_enchant(ENCH_FATIGUE, 0, KC_OTHER, duration));
+ add_ench(mon_enchant(ENCH_SLOW, 0, KC_OTHER, duration));
+ }
+ break;
+
case ENCH_BERSERK:
if (decay_enchantment(me))
{
@@ -5400,9 +5449,14 @@ bool monsters::can_go_berserk() const
return (true);
}
+bool monsters::frenzied() const
+{
+ return (has_ench(ENCH_INSANE));
+}
+
bool monsters::berserk() const
{
- return (has_ench(ENCH_BERSERK));
+ return (has_ench(ENCH_BERSERK) || has_ench(ENCH_INSANE));
}
bool monsters::needs_berserk(bool check_spells) const
@@ -6038,7 +6092,7 @@ static const char *enchant_names[] =
"short-lived", "paralysis", "sick", "sleep", "fatigue", "held",
"blood-lust", "neutral", "petrifying", "petrified", "magic-vulnerable",
"soul-ripe", "decay", "hungry", "flopping", "spore-producing",
- "downtrodden", "swift", "tide", "bug"
+ "downtrodden", "swift", "tide", "frenzied", "bug"
};
static const char *_mons_enchantment_name(enchant_type ench)
diff --git a/crawl-ref/source/monster.h b/crawl-ref/source/monster.h
index bae6cb4711..28acc4a729 100644
--- a/crawl-ref/source/monster.h
+++ b/crawl-ref/source/monster.h
@@ -296,7 +296,9 @@ public:
void attacking(actor *other);
bool can_go_berserk() const;
void go_berserk(bool intentional);
+ void go_frenzy();
bool berserk() const;
+ bool frenzied() const;
bool can_mutate() const;
bool can_safely_mutate() const;
bool can_bleed() const;