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.58 by root, Mon Oct 12 14:00:57 2009 UTC vs.
Revision 1.62 by root, Thu Nov 5 15:43:21 2009 UTC

170 {SPELLBOOK, "spellbook", "spellbooks", SK_LITERACY, 0}, 170 {SPELLBOOK, "spellbook", "spellbooks", SK_LITERACY, 0},
171 {CLOAK, "cloak", "cloaks", SK_SMITHERY, 0}, 171 {CLOAK, "cloak", "cloaks", SK_SMITHERY, 0},
172 {SPINNER, "spinner", "spinners", 0, 0}, 172 {SPINNER, "spinner", "spinners", 0, 0},
173 {GATE, "gate", "gates", 0, 0}, 173 {GATE, "gate", "gates", 0, 0},
174 {BUTTON, "button", "buttons", 0, 0}, 174 {BUTTON, "button", "buttons", 0, 0},
175 {CF_HANDLE, "cf handle", "cf handles", 0, 0}, 175 {T_HANDLE, "cf handle", "cf handles", 0, 0},
176 {HOLE, "hole", "holes", 0, 0}, 176 {HOLE, "hole", "holes", 0, 0},
177 {TRAPDOOR, "trapdoor", "trapdoors", 0, 0}, 177 {TRAPDOOR, "trapdoor", "trapdoors", 0, 0},
178 {SIGN, "sign", "signs", 0, 0}, 178 {SIGN, "sign", "signs", 0, 0},
179 {BOOTS, "boots", "boots", SK_SMITHERY, 0}, 179 {BOOTS, "boots", "boots", SK_SMITHERY, 0},
180 {GLOVES, "gloves", "gloves", SK_SMITHERY, 0}, 180 {GLOVES, "gloves", "gloves", SK_SMITHERY, 0},
381 * but do put a newline at the end. Useful when dumping to files 381 * but do put a newline at the end. Useful when dumping to files
382 */ 382 */
383const char * 383const char *
384describe_resistance (const object *op, int newline) 384describe_resistance (const object *op, int newline)
385{ 385{
386 static char buf[VERY_BIG_BUF]; 386 static dynbuf_text buf; buf.clear ();
387 char buf1[VERY_BIG_BUF];
388 int tmpvar;
389 387
390 buf[0] = 0; 388 for (int i = 0; i < NROFATTACKS; i++)
391 for (tmpvar = 0; tmpvar < NROFATTACKS; tmpvar++)
392 {
393 if (op->resist[tmpvar] && (op->type != FLESH || atnr_is_dragon_enabled (tmpvar) == 1)) 389 if (op->resist[i] && (op->type != FLESH || atnr_is_dragon_enabled (i) == 1))
394 { 390 buf.printf (newline ? "%s %d\n" : "(%s %+d)", resist_plus[i], op->resist[i]);
395 if (!newline)
396 sprintf (buf1, "(%s %+d)", resist_plus[tmpvar], op->resist[tmpvar]);
397 else
398 sprintf (buf1, "%s %d\n", resist_plus[tmpvar], op->resist[tmpvar]);
399
400 strcat (buf, buf1);
401 }
402 }
403 391
404 return buf; 392 return buf;
405} 393}
406
407 394
408/* 395/*
409 * query_weight(object) returns a character pointer to a static buffer 396 * query_weight(object) returns a character pointer to a static buffer
410 * containing the text-representation of the weight of the given object. 397 * containing the text-representation of the weight of the given object.
411 * The buffer will be overwritten by the next call to query_weight(). 398 * The buffer will be overwritten by the next call to query_weight().
649 636
650 buf << query_short_name (op); 637 buf << query_short_name (op);
651 638
652 if (QUERY_FLAG (op, FLAG_INV_LOCKED)) 639 if (QUERY_FLAG (op, FLAG_INV_LOCKED))
653 buf << " *"; 640 buf << " *";
654 if (op->type == CONTAINER && ((op->env && op->env->container == op) || (!op->env && QUERY_FLAG (op, FLAG_APPLIED)))) 641 if (op->is_open_container ())
655 buf << " (open)"; 642 buf << " (open)";
656 643
657 if (QUERY_FLAG (op, FLAG_KNOWN_CURSED)) 644 if (QUERY_FLAG (op, FLAG_KNOWN_CURSED))
658 { 645 {
659 if (QUERY_FLAG (op, FLAG_DAMNED)) 646 if (QUERY_FLAG (op, FLAG_DAMNED))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines