From 6bc45a16ae8507bf7fb59d40d8d420de1f7193e1 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Sun, 8 Nov 2009 16:35:16 -0600 Subject: In Yred's retribution, replace forced Animate Dead with summoning hostile zombified monsters. --- crawl-ref/source/godwrath.cc | 43 +++++++++++++++++++++++++++++++------------ crawl-ref/source/monplace.cc | 6 +++--- crawl-ref/source/monplace.h | 2 ++ crawl-ref/source/religion.cc | 3 +-- 4 files changed, 37 insertions(+), 17 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/godwrath.cc b/crawl-ref/source/godwrath.cc index 8e3c769bed..2164bdc394 100644 --- a/crawl-ref/source/godwrath.cc +++ b/crawl-ref/source/godwrath.cc @@ -44,12 +44,29 @@ static bool _beogh_idol_revenge(); static void _tso_blasts_cleansing_flame(const char *message = NULL); static bool _tso_holy_revenge(); +static bool _yred_random_zombified_hostile() +{ + const bool skel = one_chance_in(4); + + monster_type z_type = MONS_PROGRAM_BUG; + monster_type z_base = pick_random_zombie(); + + if (mons_zombie_size(z_base) == Z_BIG) + z_type = skel ? MONS_SKELETON_LARGE : MONS_ZOMBIE_LARGE; + else + z_type = skel ? MONS_SKELETON_SMALL : MONS_ZOMBIE_SMALL; + + mgen_data mg(z_type, BEH_HOSTILE, + 0, 0, you.pos(), MHITYOU, 0, GOD_YREDELEMNUL, + z_base); + + return (create_monster(mg) != -1); +} static bool _okawaru_random_servant() { - // error trapping {dlb} monster_type mon = MONS_PROGRAM_BUG; - int temp_rand = random2(100); + const int temp_rand = random2(100); // warriors mon = ((temp_rand < 15) ? MONS_ORC_WARRIOR : // 15% @@ -456,25 +473,27 @@ static bool _yredelemnul_retribution() if (random2(you.experience_level) > 4) { - if (one_chance_in(4) && animate_dead(&you, you.experience_level * 5, - BEH_HOSTILE, MHITYOU, god, false)) - { - simple_god_message(" animates the dead around you.", god); - animate_dead(&you, you.experience_level * 5, BEH_HOSTILE, MHITYOU, - god); - } - else if (you.religion == god && coinflip() - && yred_slaves_abandon_you()) + if (you.religion == god && coinflip() && yred_slaves_abandon_you()) { ; } else { + const bool zombified = one_chance_in(4); + int how_many = 1 + random2(1 + (you.experience_level / 5)); int count = 0; for (; how_many > 0; --how_many) - count += yred_random_servants(100, true); + { + if (zombified) + { + if (_yred_random_zombified_hostile()) + count++; + } + else + count += yred_random_servants(100, true); + } simple_god_message(count > 1 ? " sends servants to punish you." : count > 0 ? " sends a servant to punish you." diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index 303d143e20..f7c1b7fb10 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -1310,7 +1310,7 @@ static int _place_monster_aux(const mgen_data &mg, return (id); } -static monster_type _pick_random_zombie() +monster_type pick_random_zombie() { static std::vector zombifiable; if (zombifiable.empty()) @@ -1344,7 +1344,7 @@ monster_type pick_local_zombifiable_monster_type(int power) int cls; while (true) { - cls = _pick_random_zombie(); + cls = pick_random_zombie(); bool ignore_rarity = false; // On certain branches, zombie creation will fail if we use the @@ -1442,7 +1442,7 @@ static void _define_zombie(int mid, monster_type ztype, monster_type cs, // incredible OOD zombies. while (true) { - cls = _pick_random_zombie(); + cls = pick_random_zombie(); // Actually pick a monster that is happy where we want to put it. // Fish zombies on land are helpless and uncool. diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index 20c1e8354e..22947911df 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -269,6 +269,8 @@ int mons_place(mgen_data mg); * *********************************************************************** */ int place_monster(mgen_data mg, bool force_pos = false); +monster_type pick_random_zombie(); + /* *********************************************************************** * Returns a monster class type of a zombie that would be generated * on the player's current level. diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 057824e1b0..a1fdbe1434 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -1099,10 +1099,9 @@ static void _inc_gift_timeout(int val) int yred_random_servants(int threshold, bool force_hostile) { - // error trapping {dlb} monster_type mon = MONS_PROGRAM_BUG; int how_many = 1; - int temp_rand = random2(std::min(100, threshold)); + const int temp_rand = random2(std::min(100, threshold)); // undead mon = ((temp_rand < 15) ? MONS_WRAITH : // 15% -- cgit v1.2.3-54-g00ecf