summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-29 19:27:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-29 19:27:55 +0000
commit85e282c81b99e4c0a1f6433a25a55179f8481b0d (patch)
tree2ebc1f172917b0d0b9c376a76a75921081fff3c4 /crawl-ref
parentfca2ba3fa41951c7337c13a7a147bcbe5ba8f671 (diff)
downloadcrawl-ref-85e282c81b99e4c0a1f6433a25a55179f8481b0d.tar.gz
crawl-ref-85e282c81b99e4c0a1f6433a25a55179f8481b0d.zip
* Also describe enchantment limits for weapons (+9, right?), missiles,
and armour (+5 for body armour and bardings, else +2). Tidied up the code a bit. * Prettify waypoint messages as suggested by slinkies in FR 2329972. (I really should reread those tracker items before starting to code them...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8021 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/describe.cc32
-rw-r--r--crawl-ref/source/itemprop.cc15
-rw-r--r--crawl-ref/source/travel.cc25
3 files changed, 61 insertions, 11 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 11892384bf..1ec8ed1c21 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1116,6 +1116,17 @@ static std::string _describe_weapon(const item_def &item, bool verbose)
}
}
+ if (!is_artefact(item))
+ {
+ if (item_ident( item, ISFLAG_KNOW_PLUSES )
+ && item.plus >= 9 && item.plus2 >= 9)
+ {
+ description += "$It is maximally enchanted.";
+ }
+ else
+ description += "$It can be maximally enchanted to +9, +9.";
+ }
+
return (description);
}
@@ -1243,6 +1254,11 @@ static std::string _describe_ammo( const item_def &item )
append_missile_info(description);
+ if (item_ident( item, ISFLAG_KNOW_PLUSES ) && item.plus >= 9)
+ description += "$It is maximally enchanted.";
+ else
+ description += "$It can be maximally enchanted to +9.";
+
return (description);
}
@@ -1414,6 +1430,19 @@ static std::string _describe_armour( const item_def &item, bool verbose )
}
}
+ if (!is_artefact(item))
+ {
+ const int max_ench = armour_max_enchant(item);
+ if (item.plus < max_ench || !item_ident( item, ISFLAG_KNOW_PLUSES ))
+ {
+ description += "$It can be maximally enchanted to ";
+ _append_value(description, max_ench, false);
+ description += ".";
+ }
+ else
+ description += "$It is maximally enchanted.";
+ }
+
return description;
}
@@ -1881,7 +1910,8 @@ std::string get_item_description( const item_def &item, bool verbose,
if (item_type_known(item))
{
const int max_charges = 3 * wand_charge_value(item.sub_type);
- if (item.plus < max_charges)
+ if (item.plus < max_charges
+ || !item_ident(item, ISFLAG_KNOW_PLUSES))
{
description << "$It can have at most " << max_charges
<< " charges.";
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc
index 401b4cba87..1ee5c195f9 100644
--- a/crawl-ref/source/itemprop.cc
+++ b/crawl-ref/source/itemprop.cc
@@ -1004,8 +1004,11 @@ int armour_max_enchant( const item_def &item )
const int eq_slot = get_armour_slot( item );
int max_plus = MAX_SEC_ENCHANT;
- if (eq_slot == EQ_BODY_ARMOUR || eq_slot == EQ_SHIELD)
+ if (eq_slot == EQ_BODY_ARMOUR || item.sub_type == ARM_CENTAUR_BARDING
+ || item.sub_type == ARM_NAGA_BARDING)
+ {
max_plus = MAX_ARM_ENCHANT;
+ }
return (max_plus);
}
@@ -1366,8 +1369,8 @@ bool is_enchantable_weapon(const item_def &wpn, bool uncurse)
if (wpn.base_type != OBJ_WEAPONS && wpn.base_type != OBJ_MISSILES)
return (false);
- // Artefacts or highly enchanted weapons cannot be enchanted, only
- // uncursed.
+ // Artefacts or highly enchanted weapons cannot be enchanted,
+ // only uncursed.
if (wpn.base_type == OBJ_WEAPONS)
{
if (is_artefact(wpn) || wpn.plus >= 9 && wpn.plus2 >= 9)
@@ -1393,12 +1396,8 @@ bool is_enchantable_armour(const item_def &arm, bool uncurse)
// Artefacts or highly enchanted armour cannot be enchanted, only
// uncursed.
- if (is_artefact(arm) || (arm.plus >= 2
- && (arm.sub_type >= ARM_CLOAK && arm.sub_type <= ARM_BOOTS
- || is_shield(arm))))
- {
+ if (is_artefact(arm) || arm.plus >= armour_max_enchant(arm))
return (uncurse && item_cursed(arm));
- }
return (true);
}
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 4bf3c08b97..b8dff8d1f2 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -3753,7 +3753,10 @@ void TravelCache::add_waypoint(int x, int y)
}
if (keyin < '0' || keyin > '9')
+ {
+ canned_msg(MSG_OK);
return;
+ }
int waynum = keyin - '0';
@@ -3764,11 +3767,29 @@ void TravelCache::add_waypoint(int x, int y)
const level_id &lid = level_id::current();
const bool overwrite = waypoints[waynum].is_valid();
+
+ std::string old_dest =
+ overwrite ? get_trans_travel_dest(waypoints[waynum], false, true) : "";
+ level_id old_lid = (overwrite ? waypoints[waynum].id : lid);
+
waypoints[waynum].id = lid;
waypoints[waynum].pos = pos;
- mprf("%s waypoint %d to your current position.",
- overwrite ? "Reset" : "Set new", waynum);
+ std::string new_dest = get_trans_travel_dest(waypoints[waynum],
+ false, true);
+ mesclr();
+ if (overwrite)
+ {
+ if (lid == old_lid) // same level
+ mprf("Waypoint %d re-assigned to your current position.", waynum);
+ else
+ {
+ mprf("Waypoint %d re-assigned from %s to %s.",
+ waynum, old_dest.c_str(), new_dest.c_str());
+ }
+ }
+ else
+ mprf("Waypoint %d assigned to %s.", waynum, new_dest.c_str());
update_waypoints();
}