--- deliantra/server/common/item.C 2007/03/18 03:05:39 1.25 +++ deliantra/server/common/item.C 2007/05/02 05:59:06 1.28 @@ -1,5 +1,5 @@ /* - * CrossFire, A Multiplayer game for X-windows + * CrossFire, A Multiplayer game * * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team * Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -252,10 +252,9 @@ int get_power_from_ench (int ench) { - if (ench < 0) - ench = 0; - if (ench > 20) - ench = 20; + if (ench < 0) ench = 0; + if (ench > 20) ench = 20; + return enc_to_item_power[ench]; } @@ -344,12 +343,10 @@ enc += 1; return get_power_from_ench (enc); - } /* returns the typedata that has a number equal to itemtype, if there * isn't one, returns NULL */ - const typedata * get_typedata (int itemtype) { @@ -364,7 +361,6 @@ /* returns the typedata that has a name equal to itemtype, if there * isn't one, return the plural name that matches, if there still isn't * one return NULL */ - const typedata * get_typedata_by_name (const char *name) { @@ -511,6 +507,7 @@ sprintf (buf + strlen (buf), "(%s%+d)", short_stat_name[attr], val); } } + if (op->stats.exp) sprintf (buf + strlen (buf), "(speed %+lld)", (long long) op->stats.exp); if (op->stats.wc) @@ -542,6 +539,7 @@ strcat (buf, "(reflect missiles)"); if (QUERY_FLAG (op, FLAG_STEALTH)) strcat (buf, "(stealth)"); + /* Shorten some of the names, so they appear better in the windows */ len = strlen (buf); DESCRIBE_PATH_SAFE (buf, op->path_attuned, "Attuned", &len, VERY_BIG_BUF); @@ -716,10 +714,10 @@ case WAND: case ROD: case HORN: - safe_strcat (buf[use_buf], " (readied)", &len, HUGE_BUF); + safe_strcat (buf[use_buf], op->env && op->env->current_weapon == op ? " (readied)" : " (applied)", &len, HUGE_BUF); break; case WEAPON: - safe_strcat (buf[use_buf], " (wielded)", &len, HUGE_BUF); + safe_strcat (buf[use_buf], op->env && op->env->current_weapon == op ? " (wielded)" : " (applied)", &len, HUGE_BUF); break; case ARMOUR: case HELMET: @@ -1363,6 +1361,12 @@ return retbuf; } +std::string +object::describe_item (object *who) +{ + return std::string (::describe_item (this, who)); +} + /* Return true if the item is magical. A magical item is one that * increases/decreases any abilities, provides a resistance, * has a generic magical bonus, or is an artifact.