summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-03 08:43:56 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-03 08:43:56 +0000
commitc0baf5ac213911f1c407b1cbb5b1c41c69375522 (patch)
tree073bf7cf2c444d9408ebf6345263aafa288bb628 /crawl-ref
parentc70705a813e3a43c321f024f952a07291bf28a5c (diff)
downloadcrawl-ref-c0baf5ac213911f1c407b1cbb5b1c41c69375522.tar.gz
crawl-ref-c0baf5ac213911f1c407b1cbb5b1c41c69375522.zip
* Change "Your inventory suddenly weighs less" message to messages which
are more self explanatory. * Remove tutorial event explaining the "Your inventory suddenly weighs less". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9885 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/effects.cc83
-rw-r--r--crawl-ref/source/enum.h33
-rw-r--r--crawl-ref/source/tutorial.cc8
3 files changed, 97 insertions, 27 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 52d7a395c8..670f4344eb 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2977,12 +2977,24 @@ static bool _food_item_needs_time_check(item_def &item)
return (true);
}
+#define ROTTING_WARNED_KEY "rotting_warned"
+
static void _rot_inventory_food(long time_delta)
{
// Update all of the corpses and food chunks in the player's
// inventory. {should be moved elsewhere - dlb}
bool burden_changed_by_rot = false;
std::vector<char> rotten_items;
+
+ int num_chunks = 0;
+ int num_chunks_rotting = 0;
+ int num_chunks_gone = 0;
+ int num_bones = 0;
+ int num_bones_gone = 0;
+ int num_corpses = 0;
+ int num_corpses_rotted = 0;
+ int num_corpses_gone = 0;
+
for (int i = 0; i < ENDOFPACK; i++)
{
if (you.inv[i].quantity < 1)
@@ -2999,6 +3011,13 @@ static void _rot_inventory_food(long time_delta)
continue;
}
+ if (you.inv[i].base_type == OBJ_FOOD)
+ num_chunks++;
+ else if (you.inv[i].sub_type == CORPSE_SKELETON)
+ num_bones++;
+ else
+ num_corpses++;
+
// Food item timed out -> make it disappear.
if ((time_delta / 20) >= you.inv[i].special)
{
@@ -3007,8 +3026,13 @@ static void _rot_inventory_food(long time_delta)
if (you.equip[EQ_WEAPON] == i)
unwield_item();
+ // In case time_delta >= 210
+ if (!you.inv[i].props.exists(ROTTING_WARNED_KEY))
+ num_chunks_gone++;
+
destroy_item(you.inv[i]);
burden_changed_by_rot = true;
+
continue;
}
@@ -3019,6 +3043,11 @@ static void _rot_inventory_food(long time_delta)
if (you.equip[EQ_WEAPON] == i)
unwield_item();
+ if (you.inv[i].sub_type == CORPSE_SKELETON)
+ num_bones_gone++;
+ else
+ num_corpses_gone++;
+
destroy_item(you.inv[i]);
burden_changed_by_rot = true;
continue;
@@ -3027,6 +3056,8 @@ static void _rot_inventory_food(long time_delta)
turn_corpse_into_skeleton(you.inv[i]);
you.wield_change = true;
burden_changed_by_rot = true;
+
+ num_corpses_rotted++;
continue;
}
@@ -3038,6 +3069,15 @@ static void _rot_inventory_food(long time_delta)
{
rotten_items.push_back(index_to_letter(i));
}
+
+ if (you.inv[i].base_type == OBJ_FOOD && you.inv[i].special <= 10
+ && !you.inv[i].props.exists(ROTTING_WARNED_KEY))
+ {
+ // In case time_delta >= 210
+ you.inv[i].props[ROTTING_WARNED_KEY] = true;
+
+ num_chunks_rotting++;
+ }
}
//mv: messages when chunks/corpses become rotten
@@ -3103,10 +3143,49 @@ static void _rot_inventory_food(long time_delta)
if (burden_changed_by_rot)
{
- mpr("Your equipment suddenly weighs less.", MSGCH_ROTTEN_MEAT);
- learned_something_new(TUT_ROTTEN_GONE);
+ if ((num_chunks_gone + num_bones_gone + num_corpses_gone) > 0)
+ {
+ std::vector<std::string> strs;
+ if (num_chunks_gone > 0)
+ strs.push_back(make_stringf("%s of the chunks of flesh",
+ num_chunks_gone < num_chunks ?
+ "some" : "all"));
+ if (num_bones_gone > 0)
+ strs.push_back(make_stringf("%s of the skeletons",
+ num_bones_gone < num_bones ?
+ "some" : "all"));
+
+ if (num_corpses_gone > 0)
+ strs.push_back(make_stringf("%s of the corpses",
+ num_corpses_gone < num_corpses ?
+ "some" : "all"));
+
+ strs[0] = upcase_first(strs[0]);
+
+ std::string line = comma_separated_line(strs.begin(), strs.end());
+ line += " in your inventory have completely rotted away.";
+ mprf("%s", line.c_str());
+ }
+
+ num_corpses -= num_corpses_gone;
+ if (num_corpses_rotted > 0)
+ {
+ mprf("%s of the %scorpses in your invetory rotted away into "
+ "skeletons.",
+ num_corpses_rotted < num_corpses ? "Some" : "All",
+ num_corpses_gone > 0 ? "remaining " : "");
+ }
burden_change();
}
+
+ num_chunks -= num_chunks_gone;
+ if (num_chunks_rotting > 0)
+ {
+ mprf("%s of the %schunks of flesh in your inventory are close to "
+ "completely rotting away.",
+ num_chunks_rotting < num_chunks ? "Some" : "All",
+ num_chunks_gone > 0 ? "remaining " : "");
+ }
}
// Do various time related actions...
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index 976ff874cb..da71bb4991 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -2918,48 +2918,47 @@ enum tutorial_event_type
TUT_NEW_ABILITY_ITEM, // 40
TUT_FLEEING_MONSTER,
TUT_ROTTEN_FOOD,
- TUT_ROTTEN_GONE,
TUT_CONVERT,
- TUT_GOD_DISPLEASED, // 45
- TUT_EXCOMMUNICATE,
+ TUT_GOD_DISPLEASED,
+ TUT_EXCOMMUNICATE, // 45
TUT_SPELL_MISCAST,
TUT_SPELL_HUNGER,
TUT_GLOWING,
- TUT_YOU_RESIST, // 50
+ TUT_YOU_RESIST,
// status changes
- TUT_YOU_ENCHANTED,
+ TUT_YOU_ENCHANTED, // 50
TUT_YOU_SICK,
TUT_YOU_POISON,
TUT_YOU_ROTTING,
- TUT_YOU_CURSED, // 55
- TUT_YOU_HUNGRY,
+ TUT_YOU_CURSED,
+ TUT_YOU_HUNGRY, // 55
TUT_YOU_STARVING,
TUT_YOU_MUTATED,
TUT_CAN_BERSERK,
- TUT_POSTBERSERK, // 60
- TUT_CAUGHT_IN_NET,
+ TUT_POSTBERSERK,
+ TUT_CAUGHT_IN_NET, // 60
// warning
TUT_RUN_AWAY,
TUT_RETREAT_CASTER,
TUT_WIELD_WEAPON,
- TUT_NEED_HEALING, // 65
- TUT_NEED_POISON_HEALING,
+ TUT_NEED_HEALING,
+ TUT_NEED_POISON_HEALING, // 65
TUT_INVISIBLE_DANGER,
TUT_NEED_HEALING_INVIS,
TUT_ABYSS,
// interface
- TUT_MULTI_PICKUP, // 70
- TUT_HEAVY_LOAD,
+ TUT_MULTI_PICKUP,
+ TUT_HEAVY_LOAD, // 70
TUT_SHIFT_RUN,
TUT_MAP_VIEW,
TUT_AUTO_EXPLORE,
- TUT_DONE_EXPLORE, // 75
- TUT_AUTO_EXCLUSION,
+ TUT_DONE_EXPLORE,
+ TUT_AUTO_EXCLUSION, // 75
TUT_STAIR_BRAND,
TUT_HEAP_BRAND,
TUT_TRAP_BRAND,
- TUT_LOAD_SAVED_GAME, // 80
- TUT_EVENTS_NUM // 81
+ TUT_LOAD_SAVED_GAME,
+ TUT_EVENTS_NUM // 80
};
// NOTE: For numbers higher than 85 change size of tutorial_events in externs.h.
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc
index c58cf6cd91..bacfeec055 100644
--- a/crawl-ref/source/tutorial.cc
+++ b/crawl-ref/source/tutorial.cc
@@ -405,8 +405,6 @@ static std::string _tut_debug_list(int event)
return "were encumbered";
case TUT_ROTTEN_FOOD:
return "carried rotten food";
- case TUT_ROTTEN_GONE:
- return "rotten food rotted away completely";
case TUT_NEED_HEALING:
return "needed healing";
case TUT_NEED_POISON_HEALING:
@@ -2520,12 +2518,6 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc)
"and rotten chunks or corpses in the stash at once.";
break;
- case TUT_ROTTEN_GONE:
- text << "One of the skeletons or rotten chunks of meat you carried "
- "rotted away completely, or one of the rotten corpses you "
- "carried rotted away into a skeleton.";
- break;
-
case TUT_MAKE_CHUNKS:
text << "How lucky! That monster left a corpse which you can now "
"<w>c</w>hop up";