From 26707f530e67655adc7a59cb8b510fd3d12cd754 Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sat, 9 Jan 2010 21:15:06 -0500 Subject: Make Fedhas' shoot through plants more lenient Allow players to fire through neutral (as well as friendly) plants and let explosion spells (fireball etc.) pass through plants although the explosion from those spells still affects plants. --- crawl-ref/source/godabil.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'crawl-ref/source/godabil.cc') diff --git a/crawl-ref/source/godabil.cc b/crawl-ref/source/godabil.cc index f5b0d609de..f6a1d82c1d 100644 --- a/crawl-ref/source/godabil.cc +++ b/crawl-ref/source/godabil.cc @@ -326,6 +326,37 @@ bool fedhas_passthrough(const monsters * target) || target->attitude != ATT_HOSTILE)); } +// Fedhas worshipers can shoot through non-hostile plants, can a +// particular beam go through a particular monster? +bool fedhas_shoot_through(const bolt & beam, const monsters * victim) +{ + actor * originator = beam.agent(); + if (!victim || !originator) + return (false); + + bool origin_worships_fedhas; + mon_attitude_type origin_attitude; + if (originator->atype() == ACT_PLAYER) + { + origin_worships_fedhas = you.religion == GOD_FEDHAS; + origin_attitude = ATT_FRIENDLY; + } + else + { + monsters * temp = dynamic_cast (originator); + if (!temp) + return false; + origin_worships_fedhas = temp->god == GOD_FEDHAS; + origin_attitude = temp->attitude; + } + + return (origin_worships_fedhas + && fedhas_protects(victim) + && !beam.is_enchantment() + && !(beam.is_explosion && beam.in_explosion_phase) + && (mons_atts_aligned(victim->attitude, origin_attitude) + || victim->neutral() )); +} // Turns corpses in LOS into skeletons and grows toadstools on them. // Can also turn zombies into skeletons and destroy ghoul-type monsters. -- cgit v1.2.3-54-g00ecf