ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/item.C
(Generate patch)

Comparing deliantra/server/common/item.C (file contents):
Revision 1.74 by root, Fri Mar 26 01:04:44 2010 UTC vs.
Revision 1.78 by root, Sat Apr 3 03:13:47 2010 UTC

47 * Note that using the term 'human' may not be very accurate, humanoid 47 * Note that using the term 'human' may not be very accurate, humanoid
48 * may be better. 48 * may be better.
49 * Basically, for the use/nonuse, the code does something like: 49 * Basically, for the use/nonuse, the code does something like:
50 * "This item goes %s\n", with the use/nonuse values filling in the %s 50 * "This item goes %s\n", with the use/nonuse values filling in the %s
51 */ 51 */
52// see include/object.h
52Body_Locations body_locations[NUM_BODY_LOCATIONS] = { 53Body_Locations body_locations[NUM_BODY_LOCATIONS] = {
53 {KW_body_skill , "You can use it as your skill" , "It is used as a skill"}, 54 {KW_body_skill , "You can use it as your skill" , "It is used as a skill"},
54 {KW_body_combat , "You can wield it as your weapon" , "It is used as a combat weapon"}, 55 {KW_body_combat , "You can wield it as your weapon" , "It is used as a combat weapon"},
55 {KW_body_range , "You can use it as your range weapon" , "It is used as a range weapon"}, 56 {KW_body_range , "You can use it as your range weapon" , "It is used as a range weapon"},
56 {KW_body_shield , "You can wield it as a shield" , "It is used as a shield"}, 57 {KW_body_shield , "You can wield it as a shield" , "It is used as a shield"},
625 { 626 {
626 case BOW: 627 case BOW:
627 case WAND: 628 case WAND:
628 case ROD: 629 case ROD:
629 case HORN: 630 case HORN:
630 buf << (op->env && op->env->current_weapon == op ? " (readied)" : " (applied)"); 631 buf << " (applied)";
631 break; 632 break;
632 case WEAPON: 633 case WEAPON:
633 buf << (op->env && op->env->current_weapon == op ? " (wielded)" : " (applied)"); 634 buf << " (applied)";
634 break; 635 break;
635 case ARMOUR: 636 case ARMOUR:
636 case HELMET: 637 case HELMET:
637 case SHIELD: 638 case SHIELD:
638 case RING: 639 case RING:
744 } 745 }
745 break; 746 break;
746 747
747 case EXIT: 748 case EXIT:
748 // random map exits "unfortunately" get patched, so this only works before entering 749 // random map exits "unfortunately" get patched, so this only works before entering
749 buf << (EXIT_PATH (op) == shstr_random_map_exit ? " (random map)" : " (exit)"); 750 if (EXIT_PATH (op) == shstr_random_map_exit)
751 buf << " (random map)";
752 else if (!EXIT_PATH (op))
753 buf << " (closed)";
750 break; 754 break;
751 755
752 default: 756 default:
753 if (op->magic && ((QUERY_FLAG (op, FLAG_BEEN_APPLIED) && need_identify (op)) || QUERY_FLAG (op, FLAG_IDENTIFIED))) 757 if (op->magic && ((QUERY_FLAG (op, FLAG_BEEN_APPLIED) && need_identify (op)) || QUERY_FLAG (op, FLAG_IDENTIFIED)))
754 buf.printf (" %+d", op->magic); 758 buf.printf (" %+d", op->magic);
944 if (op->stats.maxsp > 1000) 948 if (op->stats.maxsp > 1000)
945 { /*higher capacity crystals */ 949 { /*higher capacity crystals */
946 i = (op->stats.maxsp % 1000) / 100; 950 i = (op->stats.maxsp % 1000) / 100;
947 951
948 if (i) 952 if (i)
949 buf.printf ("(capacity %d.%dk). It is ", op->stats.maxsp / 1000, i); 953 buf.printf ("(capacity %d.%dk; it is ", op->stats.maxsp / 1000, i);
950 else 954 else
951 buf.printf ("(capacity %dk). It is ", op->stats.maxsp / 1000); 955 buf.printf ("(capacity %dk; it is ", op->stats.maxsp / 1000);
952 } 956 }
953 else 957 else
954 buf.printf ("(capacity %d). It is ", op->stats.maxsp); 958 buf.printf ("(capacity %d; it is ", op->stats.maxsp);
955 959
956 i = (op->stats.sp * 10) / op->stats.maxsp; 960 i = (op->stats.sp * 10) / op->stats.maxsp;
957 if (op->stats.sp == 0) 961 if (op->stats.sp == 0)
958 buf << "empty."; 962 buf << "empty";
959 else if (i == 0) 963 else if (i == 0)
960 buf << "almost empty."; 964 buf << "almost empty";
961 else if (i < 3) 965 else if (i < 3)
962 buf << "partially filled."; 966 buf << "partially filled";
963 else if (i < 6) 967 else if (i < 6)
964 buf << "half full."; 968 buf << "half full";
965 else if (i < 9) 969 else if (i < 9)
966 buf << "well charged."; 970 buf << "well charged";
967 else if (op->stats.sp == op->stats.maxsp) 971 else if (op->stats.sp == op->stats.maxsp)
968 buf << "fully charged."; 972 buf << "fully charged";
969 else 973 else
970 buf << "almost full."; 974 buf << "almost full";
975
976 buf << ')';
971 break; 977 break;
972 978
973 case LAMP: 979 case LAMP:
974 { 980 {
975 int percent = ((double) 100 / op->arch->stats.food) * op->stats.food; 981 int percent = ((double) 100 / op->arch->stats.food) * op->stats.food;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines