summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-16 21:31:23 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-16 21:31:23 +0000
commita3b6953864e93bab790e1de9ffa0092fd8383d2b (patch)
tree4be6142f31cf07ab24687473592d2df897f75c00
parent1e6ed3ddb747d9ac3e8d6b0b6944277006a160f0 (diff)
downloadcrawl-ref-a3b6953864e93bab790e1de9ffa0092fd8383d2b.tar.gz
crawl-ref-a3b6953864e93bab790e1de9ffa0092fd8383d2b.zip
Fix randart jewellery always named "of Bugginess".
Fix pickup.lua trying to find a butcher tool if the wielded edged weapon happens to be cursed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5889 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/settings/messages.txt10
-rw-r--r--crawl-ref/source/dat/lua/pickup.lua5
-rw-r--r--crawl-ref/source/describe.cc15
-rw-r--r--crawl-ref/source/randart.cc33
4 files changed, 37 insertions, 26 deletions
diff --git a/crawl-ref/settings/messages.txt b/crawl-ref/settings/messages.txt
index f21cca5b92..7b100596fe 100644
--- a/crawl-ref/settings/messages.txt
+++ b/crawl-ref/settings/messages.txt
@@ -31,9 +31,9 @@ msc = yellow:fails to return
# Unimportant messages and combat clutter
#
-message_colour = darkgrey:You start (resting|searching)
-message_colour = darkgrey:Unknown command
-message_colour = darkgrey:disappears in a puff of smoke
+msc = darkgrey:You start (resting|searching)
+msc = darkgrey:Unknown command
+msc = darkgrey:disappears in a puff of smoke
#
-message_colour = darkgrey:miss(es)? (the|you|it)
-message_colour = darkgrey:but (do no|doesn't do any) damage
+msc = darkgrey:miss(es)? (the|you|it)
+msc = darkgrey:but (do no|doesn't do any) damage
diff --git a/crawl-ref/source/dat/lua/pickup.lua b/crawl-ref/source/dat/lua/pickup.lua
index a07f82e21c..29bac13e3e 100644
--- a/crawl-ref/source/dat/lua/pickup.lua
+++ b/crawl-ref/source/dat/lua/pickup.lua
@@ -11,6 +11,11 @@ local function can_butcher(it, name)
return false
end
+ -- If we're already wielding a weapon capable of butchering, okay.
+ if item.equipped(it) then
+ return true
+ end
+
-- Don't make the user wield a known cursed weapon.
if item.cursed(it) then
return false
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index a5115e9c9b..877f61d546 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -2441,8 +2441,8 @@ static bool _print_god_abil_desc( int god, int numpower )
const char* pmsg = god_gain_power_messages[god][numpower];
// If no message then no power.
- if ( !pmsg[0] )
- return false;
+ if (!pmsg[0])
+ return (false);
std::ostringstream buf;
@@ -2957,6 +2957,10 @@ void describe_god( god_type which_god, bool give_title )
cprintf( "None." EOL );
}
+ int bottom_line = get_number_of_lines();
+ if (bottom_line > 30)
+ bottom_line = 30;
+
// Only give this additional information for worshippers.
if (which_god == you.religion)
{
@@ -2964,19 +2968,16 @@ void describe_god( god_type which_god, bool give_title )
|| you.religion == GOD_SHINING_ONE
|| you.religion == GOD_ELYVILON)
{
- cgotoxy(1, get_number_of_lines() - 1, GOTO_CRT);
+ cgotoxy(1, bottom_line - 1, GOTO_CRT);
}
else
- cgotoxy(1, get_number_of_lines() - 2, GOTO_CRT);
+ cgotoxy(1, bottom_line - 2, GOTO_CRT);
textcolor(LIGHTGRAY);
cprintf(get_linebreak_string(_religion_help(which_god),
numcols).c_str());
}
- int bottom_line = get_number_of_lines();
- if (bottom_line > 30)
- bottom_line = 30;
cgotoxy(1, bottom_line-1);
textcolor(LIGHTGRAY);
formatted_string::parse_string(
diff --git a/crawl-ref/source/randart.cc b/crawl-ref/source/randart.cc
index ad70985692..d5ee3b2243 100644
--- a/crawl-ref/source/randart.cc
+++ b/crawl-ref/source/randart.cc
@@ -1252,19 +1252,24 @@ bool randart_wpn_known_prop( const item_def &item, randart_prop_type prop )
return known;
}
-static std::string _get_artefact_type(const item_def &item)
+static std::string _get_artefact_type(const item_def &item,
+ bool appear = false)
{
switch (item.base_type)
{
- case OBJ_WEAPONS:
- return "weapon";
- case OBJ_ARMOUR:
- return "armour";
- case OBJ_JEWELLERY:
- if (jewellery_is_amulet(item))
- return "amulet";
- else
- return "ring";
+ case OBJ_WEAPONS:
+ return "weapon";
+ case OBJ_ARMOUR:
+ return "armour";
+ case OBJ_JEWELLERY:
+ // Only in appearance distinguish between amulets and rings.
+ if (!appear)
+ return "jewellery";
+
+ if (jewellery_is_amulet(item))
+ return "amulet";
+ else
+ return "ring";
default:
return "artefact";
}
@@ -1322,7 +1327,7 @@ std::string randart_name(const item_def &item, bool appearance)
}
// get base type
- lookup += _get_artefact_type(item);
+ lookup += _get_artefact_type(item, appearance);
rng_save_excursion rng_state;
seed_rng( seed );
@@ -1331,7 +1336,7 @@ std::string randart_name(const item_def &item, bool appearance)
{
std::string appear = getRandNameString(lookup, " appearance");
if (appear.empty() // nothing found for lookup
- // don't allow "jewelled jewelled helmet"
+ // Don't allow "jewelled jewelled helmet".
|| item.base_type == OBJ_ARMOUR
&& item.sub_type == ARM_HELMET
&& appear == "jewelled"
@@ -1360,13 +1365,13 @@ std::string randart_name(const item_def &item, bool appearance)
if (name.empty() && god_gift)
{
- // if nothing found, try god name alone
+ // If nothing found, try god name alone.
name = getRandNameString(
god_name(static_cast<god_type>(item_orig), false));
if (name.empty())
{
- // if still nothing found, try base type alone
+ // If still nothing found, try base type alone.
name = getRandNameString(
_get_artefact_type(item).c_str());
}