summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/godabil.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2010-01-17 17:36:51 -0500
committerCharles Otto <ottochar@gmail.com>2010-01-17 17:36:51 -0500
commitf903462645b80653998fe987732752038be862d4 (patch)
tree9131a4fec9252e1f2eb872874948bfb9cb9c8cac /crawl-ref/source/godabil.cc
parent13ba95e8a77fc50cf9fe1e7438a13a17c349d390 (diff)
downloadcrawl-ref-f903462645b80653998fe987732752038be862d4.tar.gz
crawl-ref-f903462645b80653998fe987732752038be862d4.zip
Allow toadstools on tiles Fedhas worshipers are standing on
Mostly this is so that decomposition can work on corpses the player is standing on. Update the decomposition ability description accordingly.
Diffstat (limited to 'crawl-ref/source/godabil.cc')
-rw-r--r--crawl-ref/source/godabil.cc59
1 files changed, 30 insertions, 29 deletions
diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc
index 2c42e8f9e6..fc4e9712dc 100644
--- a/crawl-ref/source/godabil.cc
+++ b/crawl-ref/source/godabil.cc
@@ -315,13 +315,19 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
}
}
+bool fedhas_passthrough_class(const monster_type mc)
+{
+ return (you.religion == GOD_FEDHAS
+ && mons_class_is_plant(mc)
+ && mons_class_is_stationary(mc));
+}
+
// Fedhas allows worshipers to walk on top of stationary plants and
// fungi.
bool fedhas_passthrough(const monsters * target)
{
- return (target && you.religion == GOD_FEDHAS
- && mons_is_plant(target)
- && mons_is_stationary(target)
+ return (target
+ && fedhas_passthrough_class(target->type)
&& (target->type != MONS_OKLOB_PLANT
|| target->attitude != ATT_HOSTILE));
}
@@ -371,47 +377,42 @@ int fungal_bloom()
for (radius_iterator i(you.pos(), LOS_RADIUS); i; ++i)
{
- actor *target = actor_at(*i);
- if (target && (target->atype() == ACT_PLAYER
- || target->is_summoned()))
- {
+ monsters * target = monster_at(*i);
+ if (target && target->is_summoned())
continue;
- }
-
- monsters * mons = monster_at(*i);
- if (mons && mons->mons_species() != MONS_TOADSTOOL)
+ if (target && target->mons_species() != MONS_TOADSTOOL)
{
- switch (mons_genus(mons->mons_species()))
+ switch (mons_genus(target->mons_species()))
{
case MONS_ZOMBIE_SMALL:
// Maybe turn a zombie into a skeleton.
- if (mons_skeleton(mons_zombie_base(mons)))
+ if (mons_skeleton(mons_zombie_base(target)))
{
processed_count++;
monster_type skele_type = MONS_SKELETON_LARGE;
- if (mons_zombie_size(mons_zombie_base(mons)) == Z_SMALL)
+ if (mons_zombie_size(mons_zombie_base(target)) == Z_SMALL)
skele_type = MONS_SKELETON_SMALL;
// Killing and replacing the zombie since upgrade_type
// doesn't get skeleton speed right (and doesn't
// reduce the victim's HP). This is awkward. -cao
- mgen_data mg(skele_type, mons->behaviour, NULL, 0, 0,
- mons->pos(),
- mons->foe,
+ mgen_data mg(skele_type, target->behaviour, NULL, 0, 0,
+ target->pos(),
+ target->foe,
MG_FORCE_BEH | MG_FORCE_PLACE,
- mons->god,
- mons_zombie_base(mons),
- mons->number);
+ target->god,
+ mons_zombie_base(target),
+ target->number);
- unsigned monster_flags = mons->flags;
- int current_hp = mons->hit_points;
- mon_enchant_list ench = mons->enchantments;
+ unsigned monster_flags = target->flags;
+ int current_hp = target->hit_points;
+ mon_enchant_list ench = target->enchantments;
- simple_monster_message(mons, "'s flesh rots away.");
+ simple_monster_message(target, "'s flesh rots away.");
- monster_die(mons, KILL_MISC, NON_MONSTER, true);
+ monster_die(target, KILL_MISC, NON_MONSTER, true);
int monster = create_monster(mg);
env.mons[monster].flags = monster_flags;
env.mons[monster].enchantments = ench;
@@ -427,11 +428,11 @@ int fungal_bloom()
// Ghoul-type monsters are always destroyed.
case MONS_GHOUL:
{
- simple_monster_message(mons, " rots away and dies.");
+ simple_monster_message(target, " rots away and dies.");
- coord_def pos = mons->pos();
- int colour = mons->colour;
- int corpse = monster_die(mons, KILL_MISC, NON_MONSTER, true);
+ coord_def pos = target->pos();
+ int colour = target->colour;
+ int corpse = monster_die(target, KILL_MISC, NON_MONSTER, true);
kills = true;
// If a corpse didn't drop, create a toadstool.