summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 18:04:13 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-19 18:04:13 +0000
commit607f6940b50647c04665447b8cbf45cb54d68104 (patch)
treeb592118a3e8552a3fbf354ba9a95724abbc54261 /crawl-ref/source/religion.cc
parentd4f5ea97b24ac25f12a12450b2a79c7ac1ff66e5 (diff)
downloadcrawl-ref-607f6940b50647c04665447b8cbf45cb54d68104.tar.gz
crawl-ref-607f6940b50647c04665447b8cbf45cb54d68104.zip
Make the code to turn all your fellow slimes against you upon being
excommunicated by Jiyva actually work. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10330 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc54
1 files changed, 51 insertions, 3 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 2ed62704b2..841875fbd8 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -392,6 +392,7 @@ static bool _chaotic_beings_attitude_change();
static bool _magic_users_attitude_change();
static bool _yred_slaves_abandon_you();
static bool _beogh_followers_abandon_you();
+static bool _jiyva_slimes_abandon_you();
static void _god_smites_you(god_type god, const char *message = NULL,
kill_method_type death_type = NUM_KILLBY);
static bool _beogh_idol_revenge();
@@ -5165,7 +5166,7 @@ static bool _jiyva_retribution()
const monster_type mon = RANDOM_ELEMENT(slimes);
if (create_monster(
- mgen_data::hostile_at( static_cast<monster_type>(mon),
+ mgen_data::hostile_at(static_cast<monster_type>(mon),
you.pos(), 0, 0, true, god)) != -1)
{
success = true;
@@ -5180,7 +5181,9 @@ static bool _jiyva_retribution()
else
{
const int mutat = 1 + random2(4);
+
god_speaks(god, "You feel Jiyva alter your body.");
+
for (int i = 0; i < mutat; ++i)
mutate(RANDOM_BAD_MUTATION, true, false, true);
}
@@ -5663,6 +5666,33 @@ static bool _beogh_followers_on_level_abandon_you()
return (success);
}
+static bool _jiyva_slimes_on_level_abandon_you()
+{
+ bool success = false;
+
+ for (int i = 0; i < MAX_MONSTERS; ++i)
+ {
+ monsters *monster = &menv[i];
+ if (is_fellow_slime(monster))
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "Slime abandoning: %s on level %d, branch %d",
+ monster->name(DESC_PLAIN).c_str(),
+ static_cast<int>(you.your_level),
+ static_cast<int>(you.where_are_you));
+#endif
+
+ monster->attitude = ATT_HOSTILE;
+ behaviour_event(monster, ME_ALERT, MHITYOU);
+ // For now WAS_NEUTRAL stays.
+
+ success = true;
+ }
+ }
+
+ return (success);
+}
+
static bool _yred_souls_disappear()
{
return (apply_to_all_dungeons(_yred_enslaved_souls_on_level_disappear));
@@ -5826,6 +5856,21 @@ static bool _beogh_followers_abandon_you()
return (false);
}
+// Upon excommunication, ex-Jiyvaites lose all their fellow slimes.
+static bool _jiyva_slimes_abandon_you()
+{
+ if (apply_to_all_dungeons(_jiyva_slimes_on_level_abandon_you))
+ {
+ std::ostream& chan = msg::streams(MSGCH_MONSTER_ENCHANT);
+
+ chan << "All of your fellow slimes turn on you." << std::endl;
+
+ return (true);
+ }
+
+ return (false);
+}
+
// Currently only used when orcish idols have been destroyed.
static std::string _get_beogh_speech(const std::string key)
{
@@ -6347,11 +6392,14 @@ void excommunication(god_type new_god)
break;
case GOD_JIYVA:
- for (int i = 0; i < 3; ++i)
+ _jiyva_slimes_abandon_you();
+
+ god_speaks(old_god, "You feel Jiyva alter your body.");
+
+ for (int i = 0; i < 4; ++i)
mutate(RANDOM_BAD_MUTATION, true, false, true);
_inc_penance(old_god, 30);
- _make_god_gifts_hostile(false);
break;
default: