summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-13 20:34:46 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-13 20:34:46 +0000
commitdf31ea9fdcfedf252e62f6bf0c5cff53df4b93d0 (patch)
tree2d7966f0f0eac61f1c17fa7182aa2ea22490a98f /crawl-ref/source/effects.cc
parent0962c7818135807861f1f8d659a952a8ea8f4ddb (diff)
downloadcrawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.tar.gz
crawl-ref-df31ea9fdcfedf252e62f6bf0c5cff53df4b93d0.zip
Mixed commit of small additions/changes.
FR 1870139: output "Tele" among enchantment abbrevs when "about to teleport" FR 1834016: print item slots along with rotting message (I added an option for this as I personally don't need this.) Gods: * Add ^ line for Zin's mutation protection. * Modify protection from harm adjectives in ^ screen to make difference between Ely and Zin/TSO more obvious. Tiles: Bug 1870238: Show mimics to be "autopickuable" (green frame). * Smarter handling of L-click actions in inventory. * code clean-up git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3269 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc40
1 files changed, 26 insertions, 14 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index f73e2a233f..9e761c6841 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -1912,7 +1912,7 @@ static void hell_effects()
(temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
(temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone." :
- "Brimstone rains from above." :
+ "Brimstone rains from above." :
(temp_rand == 8) ? "You feel lost and a long, long way from home..." :
(temp_rand == 9) ? "You shiver with fear." :
// warning
@@ -2028,7 +2028,7 @@ static void rot_inventory_food(long time_delta)
// inventory {should be moved elsewhere - dlb}
bool burden_changed_by_rot = false;
- bool new_rotting_item = false;
+ std::vector<char> rotten_items;
for (int i = 0; i < ENDOFPACK; i++)
{
if (you.inv[i].quantity < 1)
@@ -2083,14 +2083,15 @@ static void rot_inventory_food(long time_delta)
if (you.inv[i].special < 100 && (you.inv[i].special + (time_delta / 20)>=100))
{
- new_rotting_item = true;
+ rotten_items.push_back(index_to_letter( i ));
}
}
//mv: messages when chunks/corpses become rotten
- if (new_rotting_item)
+ if (!rotten_items.empty())
{
- // XXX: should probably still notice?
+ std::string msg = "";
+
// Races that can't smell don't care, and trolls are stupid and
// don't care.
if (player_can_smell() && you.species != SP_TROLL)
@@ -2102,33 +2103,44 @@ static void rot_inventory_food(long time_delta)
case 1:
case 2:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "You smell rotting flesh." :
(temp_rand == 6) ? "You smell decay."
- : "There is something rotten in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "There is something rotten in your inventory.";
break;
// level 3 saprovores like it
case 3:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "The smell of rotting flesh makes you hungry." :
(temp_rand == 6) ? "You smell decay. Yum-yum."
- : "Wow! There is something tasty in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "Wow! There is something tasty in your inventory.";
break;
default:
temp_rand = random2(8);
- mpr( ((temp_rand < 5) ? "You smell something rotten." :
+ msg = (temp_rand < 5) ? "You smell something rotten." :
(temp_rand == 5) ? "The smell of rotting flesh makes you sick." :
(temp_rand == 6) ? "You smell decay. Yuck!"
- : "Ugh! There is something really disgusting in your inventory."),
- MSGCH_ROTTEN_MEAT );
+ : "Ugh! There is something really disgusting in your inventory.";
break;
}
}
+ else if (Options.list_rotten)
+ msg = "Something in your inventory has become rotten.";
+
+ if (Options.list_rotten)
+ {
+ mprf(MSGCH_ROTTEN_MEAT, "%s (slot%s %s)",
+ msg.c_str(),
+ rotten_items.size() > 1 ? "s" : "",
+ comma_separated_line(rotten_items.begin(),
+ rotten_items.end()).c_str());
+ }
+ else if (!msg.empty())
+ mpr(msg.c_str(), MSGCH_ROTTEN_MEAT);
+
learned_something_new(TUT_ROTTEN_FOOD);
}
if (burden_changed_by_rot)