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.20 by root, Mon Feb 5 01:24:45 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
856 * too long, making it difficult to read. This function deals 856 * too long, making it difficult to read. This function deals
857 * with describing the monsters & players abilities. It should only 857 * with describing the monsters & players abilities. It should only
858 * be called with monster & player objects. Returns a description 858 * be called with monster & player objects. Returns a description
859 * in a static buffer. 859 * in a static buffer.
860 */ 860 */
861
862static char * 861static char *
863describe_monster (const object *op) 862describe_monster (const object *op)
864{ 863{
865 char buf[MAX_BUF]; 864 char buf[MAX_BUF];
866 static char retbuf[VERY_BIG_BUF]; 865 static char retbuf[VERY_BIG_BUF];
992 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 991 for (tmp = op->inv; tmp != NULL; tmp = tmp->below)
993 if (tmp->type == SKILL && !strcmp (tmp->name, "clawing")) 992 if (tmp->type == SKILL && !strcmp (tmp->name, "clawing"))
994 break; 993 break;
995 994
996 if (tmp && tmp->attacktype != 0) 995 if (tmp && tmp->attacktype != 0)
997 {
998 DESCRIBE_ABILITY (retbuf, tmp->attacktype, "Claws"); 996 { DESCRIBE_ABILITY (retbuf, tmp->attacktype, "Claws") }
999 }
1000 else 997 else
1001 {
1002 DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks"); 998 { DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks") }
1003 }
1004 } 999 }
1005 else 1000 else
1006 {
1007 DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks"); 1001 { DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks") }
1008 } 1002
1009 DESCRIBE_PATH (retbuf, op->path_attuned, "Attuned"); 1003 DESCRIBE_PATH (retbuf, op->path_attuned, "Attuned");
1010 DESCRIBE_PATH (retbuf, op->path_repelled, "Repelled"); 1004 DESCRIBE_PATH (retbuf, op->path_repelled, "Repelled");
1011 DESCRIBE_PATH (retbuf, op->path_denied, "Denied"); 1005 DESCRIBE_PATH (retbuf, op->path_denied, "Denied");
1006
1012 for (i = 0; i < NROFATTACKS; i++) 1007 for (i = 0; i < NROFATTACKS; i++)
1013 {
1014 if (op->resist[i]) 1008 if (op->resist[i])
1015 { 1009 {
1016 sprintf (buf, "(%s %+d)", resist_plus[i], op->resist[i]); 1010 sprintf (buf, "(%s %+d)", resist_plus[i], op->resist[i]);
1017 strcat (retbuf, buf); 1011 strcat (retbuf, buf);
1018 } 1012 }
1019 } 1013
1020 return retbuf; 1014 return retbuf;
1021} 1015}
1022 1016
1023 1017
1024/* 1018/*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines