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.22 by root, Mon Feb 5 01:42:22 2007 UTC vs.
Revision 1.23 by root, Fri Feb 16 19:43:40 2007 UTC

456 strcpy (buf, numbers_10[i / 10]); 456 strcpy (buf, numbers_10[i / 10]);
457 strcat (buf, levelnumbers[i % 10]); 457 strcat (buf, levelnumbers[i % 10]);
458 return buf; 458 return buf;
459} 459}
460 460
461
462/* 461/*
463 * get_number(integer) returns the text-representation of the given number 462 * get_number(integer) returns the text-representation of the given number
464 * in a static buffer. The buffer might be overwritten at the next 463 * in a static buffer. The buffer might be overwritten at the next
465 * call to get_number(). 464 * call to get_number().
466 * It is currently only used by the query_name() function. 465 * It is currently only used by the query_name() function.
467 */ 466 */
468
469char * 467char *
470get_number (int i) 468get_number (int i)
471{ 469{
472 if (i <= 20) 470 if (i <= 20)
473 return numbers[i]; 471 return numbers[i];
647 * 645 *
648 */ 646 */
649char * 647char *
650query_name (const object *op) 648query_name (const object *op)
651{ 649{
652 static char buf[5][HUGE_BUF]; 650 static char buf[5][HUGE_BUF]; // OMFG
653 static int use_buf = 0; 651 static int use_buf = 0;
654 int len = 0; 652 int len = 0;
655 653
656#ifdef NEW_MATERIAL_CODE 654#ifdef NEW_MATERIAL_CODE
657 materialtype_t *mt; 655 materialtype_t *mt;
684 if (QUERY_FLAG (op, FLAG_DAMNED)) 682 if (QUERY_FLAG (op, FLAG_DAMNED))
685 safe_strcat (buf[use_buf], " (damned)", &len, HUGE_BUF); 683 safe_strcat (buf[use_buf], " (damned)", &len, HUGE_BUF);
686 else if (QUERY_FLAG (op, FLAG_CURSED)) 684 else if (QUERY_FLAG (op, FLAG_CURSED))
687 safe_strcat (buf[use_buf], " (cursed)", &len, HUGE_BUF); 685 safe_strcat (buf[use_buf], " (cursed)", &len, HUGE_BUF);
688 } 686 }
687
689 /* Basically, if the object is known magical (detect magic spell on it), 688 /* Basically, if the object is known magical (detect magic spell on it),
690 * and it isn't identified, print out the fact that 689 * and it isn't identified, print out the fact that
691 * it is magical. Assume that the detect magical spell will only set 690 * it is magical. Assume that the detect magical spell will only set
692 * KNOWN_MAGICAL if the item actually is magical. 691 * KNOWN_MAGICAL if the item actually is magical.
693 * 692 *
709 708
710 if (QUERY_FLAG (op, FLAG_APPLIED)) 709 if (QUERY_FLAG (op, FLAG_APPLIED))
711 { 710 {
712 switch (op->type) 711 switch (op->type)
713 { 712 {
714 case BOW: 713 case BOW:
715 case WAND: 714 case WAND:
716 case ROD: 715 case ROD:
717 case HORN: 716 case HORN:
718 safe_strcat (buf[use_buf], " (readied)", &len, HUGE_BUF); 717 safe_strcat (buf[use_buf], " (readied)", &len, HUGE_BUF);
719 break; 718 break;
720 case WEAPON: 719 case WEAPON:
721 safe_strcat (buf[use_buf], " (wielded)", &len, HUGE_BUF); 720 safe_strcat (buf[use_buf], " (wielded)", &len, HUGE_BUF);
722 break; 721 break;
723 case ARMOUR: 722 case ARMOUR:
724 case HELMET: 723 case HELMET:
725 case SHIELD: 724 case SHIELD:
726 case RING: 725 case RING:
727 case BOOTS: 726 case BOOTS:
728 case GLOVES: 727 case GLOVES:
729 case AMULET: 728 case AMULET:
730 case GIRDLE: 729 case GIRDLE:
731 case BRACERS: 730 case BRACERS:
732 case CLOAK: 731 case CLOAK:
733 safe_strcat (buf[use_buf], " (worn)", &len, HUGE_BUF); 732 safe_strcat (buf[use_buf], " (worn)", &len, HUGE_BUF);
734 break; 733 break;
735 case CONTAINER: 734 case CONTAINER:
736 safe_strcat (buf[use_buf], " (active)", &len, HUGE_BUF); 735 safe_strcat (buf[use_buf], " (active)", &len, HUGE_BUF);
737 break; 736 break;
738 case SKILL: 737 case SKILL:
739 default: 738 default:
740 safe_strcat (buf[use_buf], " (applied)", &len, HUGE_BUF); 739 safe_strcat (buf[use_buf], " (applied)", &len, HUGE_BUF);
741 } 740 }
742 } 741 }
742
743 if (QUERY_FLAG (op, FLAG_UNPAID)) 743 if (QUERY_FLAG (op, FLAG_UNPAID))
744 safe_strcat (buf[use_buf], " (unpaid)", &len, HUGE_BUF); 744 safe_strcat (buf[use_buf], " (unpaid)", &len, HUGE_BUF);
745 745
746 return buf[use_buf]; 746 return buf [use_buf];
747} 747}
748 748
749/* 749/*
750 * query_base_name(object) returns a character pointer pointing to a static 750 * query_base_name(object) returns a character pointer pointing to a static
751 * buffer which contains a verbose textual representation of the name 751 * buffer which contains a verbose textual representation of the name

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines