summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-24 19:15:20 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-24 19:15:20 +0000
commit19036a55ba3c1f5c9a4e09b3a82ef2caa07f8bdf (patch)
treea473f085d3c331b039d9ffc7cecceb43f186b65e /crawl-ref/source/beam.cc
parentbbefa2c38bdcc3a38225b3eed7a8475764c5671d (diff)
downloadcrawl-ref-19036a55ba3c1f5c9a4e09b3a82ef2caa07f8bdf.tar.gz
crawl-ref-19036a55ba3c1f5c9a4e09b3a82ef2caa07f8bdf.zip
Fix 1892007: (oklob) plants being confusable
(There's probably some source of poison or other where I forgot to add the mons_class_is_confuseable check. Feel free to add as needed.) Fix 1897271: potions of poison being treatened like poisoned ammo (There's actually a much bigger issue: now that randart names are configurable players could name half of their randarts "poisoned" and make them *be* poisoned. In short, the beam string comparison find("poison") needs to be replaced with something more sensible.) Also some more comment clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3461 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index b7eff94ea5..a2c7096746 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -1919,6 +1919,12 @@ static bool monster_resists_mass_enchantment(monsters *monster,
else if (wh_enchant == ENCH_CONFUSION
|| mons_holiness(monster) == MH_NATURAL)
{
+ if (wh_enchant == ENCH_CONFUSION &&
+ !mons_class_is_confusable(monster->type))
+ {
+ return (true);
+ }
+
if (check_mons_resist_magic( monster, pow ))
{
simple_monster_message(monster, mons_immune_magic(monster) ?
@@ -2094,19 +2100,21 @@ int mons_ench_f2(monsters *monster, bolt &pbolt)
return (MON_AFFECTED);
case BEAM_CONFUSION: /* 4 = confusion */
+ if (!mons_class_is_confusable(monster->type))
+ return (MON_UNAFFECTED);
+
if (monster->add_ench(
mon_enchant(ENCH_CONFUSION, 0, whose_kill(pbolt))))
{
- // put in an exception for fungi, plants and other things you won't
- // notice becoming confused.
+ // put in an exception for things you won't notice becoming confused.
if (simple_monster_message(monster, " appears confused."))
pbolt.obvious_effect = true;
}
return (MON_AFFECTED);
case BEAM_INVISIBILITY: /* 5 = invisibility */
- // Store the monster name before it becomes an "it" -- bwr
{
+ // Store the monster name before it becomes an "it" -- bwr
const std::string monster_name = monster->name(DESC_CAP_THE);
if (!monster->has_ench(ENCH_INVIS)
@@ -4054,7 +4062,7 @@ static int affect_monster(bolt &beam, monsters *mon)
/* looks for missiles which aren't poison but
are poison*ed* */
- if (beam.name.find("poison") != std::string::npos
+ if (beam.name.find("poisoned") != std::string::npos
&& beam.flavour != BEAM_POISON
&& beam.flavour != BEAM_POISON_ARROW)
{