summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 19:31:33 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-03 19:31:33 +0000
commitca9a2e31faaa300c8091dd88b406efc9ae6f32d1 (patch)
tree5ecb45ed11bbcdcec02c66f0af8f70ba6e22d2f1 /crawl-ref/source/describe.cc
parente31e50c63a31aa249510d5c23e9a6d7c26e5dfb5 (diff)
downloadcrawl-ref-ca9a2e31faaa300c8091dd88b406efc9ae6f32d1.tar.gz
crawl-ref-ca9a2e31faaa300c8091dd88b406efc9ae6f32d1.zip
Update ammo descriptions to account for branded ammo's working when
thrown. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6371 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc65
1 files changed, 34 insertions, 31 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 7986ee8663..af2ae40193 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1136,19 +1136,33 @@ static std::string _describe_ammo( const item_def &item )
}
}
+ bool can_launch = has_launcher(item);
+ bool can_throw = is_throwable(item);
bool need_new_line = true;
+
if (item.special && item_type_known(item))
{
description += "$$";
+
switch (item.special)
{
case SPMSL_FLAME:
- description += "When fired from an appropriate launcher, "
- "it turns into a bolt of flame.";
- break;
case SPMSL_ICE:
- description += "When fired from an appropriate launcher, "
- "it turns into a bolt of ice.";
+ description += "When ";
+
+ if (can_throw)
+ {
+ description += "thrown, ";
+ if (can_launch)
+ description += "or ";
+ }
+
+ if (can_launch)
+ description += "fired from an appropriate launcher, ";
+
+ description += "it turns into a bolt of ";
+ description += (item.special == SPMSL_FLAME) ? "flame" : "ice";
+ description += ".";
break;
case SPMSL_POISONED:
case SPMSL_POISONED_II:
@@ -1159,54 +1173,43 @@ static std::string _describe_ammo( const item_def &item )
break;
case SPMSL_RETURNING:
description += "A skilled user can throw it in such a way "
- "that it will return to its owner.";
+ "that it will return to its owner.";
break;
}
+
need_new_line = false;
}
if (get_equip_race(item) != ISFLAG_NO_RACE)
{
- bool can_launch = has_launcher(item);
- bool can_throw = is_throwable(item);
-
description += "$";
+
if (need_new_line)
description += "$";
if (can_throw)
{
- switch ( get_equip_race(item) )
- {
- case ISFLAG_DWARVEN:
- description +=
- "It is more deadly when thrown by dwarves";
- break;
- case ISFLAG_ELVEN:
- description +=
- "It is more deadly when thrown by elves";
- break;
- case ISFLAG_ORCISH:
- description +=
- "It is more deadly when thrown by orcs";
- break;
- }
- }
+ unsigned long race = get_equip_race(item);
- if (can_throw && !can_launch)
- description += ".";
- else if (!can_throw && can_launch)
- description += "It ";
- else if (can_throw && can_launch)
- description += ", and it ";
+ description += "It is more deadly when thrown by ";
+ description += (race == ISFLAG_DWARVEN) ? "dwarfs" :
+ (race == ISFLAG_ELVEN) ? "elves"
+ : "orcs";
+ description += (can_launch) ? ", and it" : ".";
+ description += " ";
+ }
if (can_launch)
{
+ if (!can_throw)
+ description += "It ";
+
description += "is more effective in conjunction with ";
description += racial_description_string(item);
description += "launchers.";
}
}
+
return (description);
}