summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-03 23:21:52 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-03 23:21:52 +0000
commitc408f8b544f47a4d2e7aebc75c8ac5535d4767b6 (patch)
treec9f66c8020ed349f213e9e1835459b1feb473b88 /crawl-ref/source/ouch.cc
parent419f00a75943e625e36cb6fb2eafe6e4e11f6024 (diff)
downloadcrawl-ref-c408f8b544f47a4d2e7aebc75c8ac5535d4767b6.tar.gz
crawl-ref-c408f8b544f47a4d2e7aebc75c8ac5535d4767b6.zip
Harpies now also eat food on the ground.
Add a description (as suggested by David) and two quotes. Since harpies will eat anything they are now resistant to poison. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7737 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc70
1 files changed, 39 insertions, 31 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 436d24a82f..50b2dbb25f 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -490,6 +490,9 @@ static bool _expose_invent_to_element(beam_type flavour, int strength)
if (!num_dest)
return (false);
+ if (flavour == BEAM_STEAL_FOOD)
+ return (true);
+
switch (target_class)
{
case OBJ_SCROLLS:
@@ -506,8 +509,7 @@ static bool _expose_invent_to_element(beam_type flavour, int strength)
break;
case OBJ_FOOD:
- if (flavour == BEAM_SPORE)
- mpr("Some of your food is covered with spores!");
+ mpr("Some of your food is covered with spores!");
break;
default:
@@ -518,17 +520,18 @@ static bool _expose_invent_to_element(beam_type flavour, int strength)
}
xom_is_stimulated((num_dest > 1) ? 32 : 16);
+
return (true);
}
-void expose_items_to_element(beam_type flavour, const coord_def& where,
+bool expose_items_to_element(beam_type flavour, const coord_def& where,
int strength)
{
int num_dest = 0;
const int target_class = _get_target_class(flavour);
if (target_class == OBJ_UNASSIGNED)
- return;
+ return (false);
for (stack_iterator si(where); si; ++si)
{
@@ -550,37 +553,42 @@ void expose_items_to_element(beam_type flavour, const coord_def& where,
}
}
- if (num_dest)
+ if (!num_dest)
+ return (false);
+
+ if (flavour == BEAM_STEAL_FOOD)
+ return (true);
+
+ if (see_grid(where))
{
- if (see_grid(where))
+ switch (target_class)
{
- switch (target_class)
- {
- case OBJ_SCROLLS:
- mprf("You see %s of smoke.",
- (num_dest > 1) ? "some puffs" : "a puff");
- break;
-
- case OBJ_POTIONS:
- mprf("You see %s shatter.",
- (num_dest > 1) ? "some glass" : "glass");
- break;
-
- case OBJ_FOOD:
- mprf("You see %s of spores.",
- (num_dest > 1) ? "some clouds" : "a cloud");
- break;
-
- default:
- mprf("%s on the floor %s destroyed!",
- (num_dest > 1) ? "Some items" : "An item",
- (num_dest > 1) ? "were" : "was" );
- break;
- }
+ case OBJ_SCROLLS:
+ mprf("You see %s of smoke.",
+ (num_dest > 1) ? "some puffs" : "a puff");
+ break;
+
+ case OBJ_POTIONS:
+ mprf("You see %s shatter.",
+ (num_dest > 1) ? "some glass" : "glass");
+ break;
+
+ case OBJ_FOOD:
+ mprf("You see %s of spores.",
+ (num_dest > 1) ? "some clouds" : "a cloud");
+ break;
+
+ default:
+ mprf("%s on the floor %s destroyed!",
+ (num_dest > 1) ? "Some items" : "An item",
+ (num_dest > 1) ? "were" : "was" );
+ break;
}
-
- xom_is_stimulated((num_dest > 1) ? 32 : 16);
}
+
+ xom_is_stimulated((num_dest > 1) ? 32 : 16);
+
+ return (true);
}
// Handle side-effects for exposure to element other than damage. This