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.59 by root, Mon Oct 12 21:27:54 2009 UTC vs.
Revision 1.63 by root, Fri Nov 6 13:03:34 2009 UTC

207 {BUILDER, "item builder", "item builders", 0, 0}, 207 {BUILDER, "item builder", "item builders", 0, 0},
208 {MATERIAL, "building material", "building materials", 0, 0}, 208 {MATERIAL, "building material", "building materials", 0, 0},
209 {ITEM_TRANSFORMER, "item_transformer", "item_transformers", 0, 0}, 209 {ITEM_TRANSFORMER, "item_transformer", "item_transformers", 0, 0},
210}; 210};
211 211
212const int item_types_size = sizeof (item_types) / sizeof (*item_types); 212static const int item_types_size = sizeof (item_types) / sizeof (*item_types);
213 213
214materialtype_t *materialt; 214materialtype_t *materialt;
215 215
216/* 216/*
217materialtype material[NROFMATERIALS] = { 217materialtype material[NROFMATERIALS] = {
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().
459 * get_number(integer) returns the text-representation of the given number 446 * get_number(integer) returns the text-representation of the given number
460 * in a static buffer. The buffer might be overwritten at the next 447 * in a static buffer. The buffer might be overwritten at the next
461 * call to get_number(). 448 * call to get_number().
462 * It is currently only used by the query_name() function. 449 * It is currently only used by the query_name() function.
463 */ 450 */
464const char * 451static const char *
465get_number (int i) 452get_number (int i)
466{ 453{
467 if (i <= 20) 454 if (i <= 20)
468 return numbers[i]; 455 return numbers[i];
469 else 456 else
486 */ 473 */
487 474
488/* Aug 95 modified this slightly so that Skill tools don't have magic bonus 475/* Aug 95 modified this slightly so that Skill tools don't have magic bonus
489 * from stats.sp - b.t. 476 * from stats.sp - b.t.
490 */ 477 */
491const char * 478static const char *
492ring_desc (const object *op) 479ring_desc (const object *op)
493{ 480{
494 static dynbuf_text buf; buf.clear (); 481 static dynbuf_text buf; buf.clear ();
495 int attr, val, len; 482 int attr, val, len;
496 483
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