… | |
… | |
484 | * but that probably will make it more difficult to read, and |
484 | * but that probably will make it more difficult to read, and |
485 | * not make it any more efficient |
485 | * not make it any more efficient |
486 | */ |
486 | */ |
487 | if (params && item_matched_string (op, tmp, params)) |
487 | if (params && item_matched_string (op, tmp, params)) |
488 | { |
488 | { |
|
|
489 | if (--cnt < 0) break; |
489 | pick_up (op, tmp); |
490 | pick_up (op, tmp); |
490 | if (--cnt <= 0) break; |
|
|
491 | } |
491 | } |
492 | else if (can_pick (op, tmp) && !params) |
492 | else if (can_pick (op, tmp) && !params) |
493 | { |
493 | { |
|
|
494 | if (--cnt < 0) break; |
494 | pick_up (op, tmp); |
495 | pick_up (op, tmp); |
495 | break; |
496 | break; |
496 | } |
497 | } |
497 | |
498 | |
498 | tmp = next; |
499 | tmp = next; |
… | |
… | |
969 | dynbuf_text buf (512, 512); |
970 | dynbuf_text buf (512, 512); |
970 | |
971 | |
971 | object *mon = head ? head : this; |
972 | object *mon = head ? head : this; |
972 | |
973 | |
973 | if (QUERY_FLAG (mon, FLAG_UNDEAD)) |
974 | if (QUERY_FLAG (mon, FLAG_UNDEAD)) |
974 | buf << "It is an undead force.\n"; |
975 | buf << " - It is an undead force.\n"; |
975 | |
976 | |
976 | if (mon->level > who->level) |
977 | if (mon->level > who->level) |
977 | buf << "It is likely more powerful than you.\n"; |
978 | buf << " - It is likely more powerful than you.\n"; |
978 | else if (mon->level < who->level) |
979 | else if (mon->level < who->level) |
979 | buf << "It is likely less powerful than you.\n"; |
980 | buf << " - It is likely less powerful than you.\n"; |
980 | else |
981 | else |
981 | buf << "It is probably as powerful as you.\n"; |
982 | buf << " - It is probably as powerful as you.\n"; |
982 | |
983 | |
983 | if (mon->attacktype & AT_ACID) |
984 | if (mon->attacktype & AT_ACID) |
984 | buf << "You seem to smell an acrid odor.\n"; |
985 | buf << " - You seem to smell an acrid odor.\n"; |
985 | |
986 | |
986 | /* Anyone know why this used to use the clone value instead of the |
987 | /* Anyone know why this used to use the clone value instead of the |
987 | * maxhp field? This seems that it should give more accurate results. |
988 | * maxhp field? This seems that it should give more accurate results. |
988 | */ |
989 | */ |
989 | switch ((mon->stats.hp + 1) * 4 / (mon->stats.maxhp + 1)) |
990 | switch ((mon->stats.hp + 1) * 4 / (mon->stats.maxhp + 1)) |
990 | { /* From 1-4 */ |
991 | { /* From 1-4 */ |
991 | case 1: |
992 | case 1: |
992 | buf << "It is in a bad shape.\n"; |
993 | buf << " - It is in a bad shape.\n"; |
993 | break; |
994 | break; |
994 | case 2: |
995 | case 2: |
995 | buf << "It is hurt.\n"; |
996 | buf << " - It is hurt.\n"; |
996 | break; |
997 | break; |
997 | case 3: |
998 | case 3: |
998 | buf << "It is somewhat hurt.\n"; |
999 | buf << " - It is somewhat hurt.\n"; |
999 | break; |
1000 | break; |
1000 | case 4: |
1001 | case 4: |
1001 | buf << "It is in excellent shape.\n"; |
1002 | buf << " - It is in excellent shape.\n"; |
1002 | break; |
1003 | break; |
1003 | } |
1004 | } |
1004 | |
1005 | |
1005 | if (present_in_ob (POISONING, mon)) |
1006 | if (present_in_ob (POISONING, mon)) |
1006 | buf << "It looks very ill.\n"; |
1007 | buf << " - It looks very ill.\n"; |
1007 | |
1008 | |
1008 | return buf; |
1009 | return buf; |
1009 | } |
1010 | } |
1010 | |
1011 | |
1011 | /* tmp is the object being described, pl is who is examing it. */ |
1012 | /* tmp is the object being described, pl is who is examing it. */ |
… | |
… | |
1069 | std::string |
1070 | std::string |
1070 | object::describe (object *who) |
1071 | object::describe (object *who) |
1071 | { |
1072 | { |
1072 | dynbuf_text buf (1024, 1024); |
1073 | dynbuf_text buf (1024, 1024); |
1073 | |
1074 | |
1074 | buf.printf ("That is: %s.\n", long_desc (who).c_str ()); |
1075 | buf.printf ("That is: %s.\n\n", long_desc (who).c_str ()); |
1075 | |
1076 | |
1076 | if (custom_name) |
1077 | if (custom_name) |
1077 | buf.printf ("You call it %s\n", &custom_name); |
1078 | buf.printf ("You call it %s.\n\n", &custom_name); |
1078 | |
1079 | |
1079 | switch (type) |
1080 | switch (type) |
1080 | { |
1081 | { |
1081 | case SPELLBOOK: |
1082 | case SPELLBOOK: |
1082 | if (flag [FLAG_IDENTIFIED] && inv) |
1083 | if (flag [FLAG_IDENTIFIED] && inv) |
1083 | buf.printf ("%s is a %s %s spell\n", &inv->name, get_levelnumber (inv->level), &inv->skill); |
1084 | buf.printf ("%s is a %s %s spell.\n", &inv->name, get_levelnumber (inv->level), &inv->skill); |
1084 | break; |
1085 | break; |
1085 | |
1086 | |
1086 | case BOOK: |
1087 | case BOOK: |
1087 | if (msg) |
1088 | if (msg) |
1088 | buf << "Something is written in it.\n"; |
1089 | buf << "Something is written in it.\n"; |
… | |
… | |
1147 | buf << "This is a buildable item.\n"; |
1148 | buf << "This is a buildable item.\n"; |
1148 | |
1149 | |
1149 | /* Does the object have a message? Don't show message for all object |
1150 | /* Does the object have a message? Don't show message for all object |
1150 | * types - especially if the first entry is a match |
1151 | * types - especially if the first entry is a match |
1151 | */ |
1152 | */ |
1152 | if (msg && type != EXIT && type != BOOK && type != CORPSE && !move_on && *msg != '@') |
1153 | if (msg && type != EXIT && type != BOOK && type != CORPSE && !move_on && !has_dialogue ()) |
1153 | { |
1154 | { |
1154 | /* This is just a hack so when identifying the items, we print |
1155 | /* This is just a hack so when identifying the items, we print |
1155 | * out the extra message |
1156 | * out the extra message |
1156 | */ |
1157 | */ |
1157 | if (need_identify (this) && flag [FLAG_IDENTIFIED]) |
1158 | if (need_identify (this) && flag [FLAG_IDENTIFIED]) |
1158 | buf << "The object has a story:\n"; |
1159 | buf << "The object has a story:\n\n"; |
1159 | |
1160 | |
1160 | buf << msg << '\n'; |
1161 | buf << msg << '\n'; |
1161 | } |
1162 | } |
1162 | |
1163 | |
1163 | buf << '\n'; |
1164 | buf << '\n'; |