… | |
… | |
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 | |
|
|
469 | char * |
467 | char * |
470 | get_number (int i) |
468 | get_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 | */ |
649 | char * |
647 | char * |
650 | query_name (const object *op) |
648 | query_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 |
… | |
… | |
991 | for (tmp = op->inv; tmp != NULL; tmp = tmp->below) |
991 | for (tmp = op->inv; tmp != NULL; tmp = tmp->below) |
992 | if (tmp->type == SKILL && !strcmp (tmp->name, "clawing")) |
992 | if (tmp->type == SKILL && !strcmp (tmp->name, "clawing")) |
993 | break; |
993 | break; |
994 | |
994 | |
995 | if (tmp && tmp->attacktype != 0) |
995 | if (tmp && tmp->attacktype != 0) |
996 | DESCRIBE_ABILITY (retbuf, tmp->attacktype, "Claws"); |
996 | { DESCRIBE_ABILITY (retbuf, tmp->attacktype, "Claws") } |
997 | else |
997 | else |
998 | DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks"); |
998 | { DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks") } |
999 | } |
999 | } |
1000 | else |
1000 | else |
1001 | DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks"); |
1001 | { DESCRIBE_ABILITY (retbuf, op->attacktype, "Attacks") } |
1002 | |
1002 | |
1003 | DESCRIBE_PATH (retbuf, op->path_attuned, "Attuned"); |
1003 | DESCRIBE_PATH (retbuf, op->path_attuned, "Attuned"); |
1004 | DESCRIBE_PATH (retbuf, op->path_repelled, "Repelled"); |
1004 | DESCRIBE_PATH (retbuf, op->path_repelled, "Repelled"); |
1005 | DESCRIBE_PATH (retbuf, op->path_denied, "Denied"); |
1005 | DESCRIBE_PATH (retbuf, op->path_denied, "Denied"); |
|
|
1006 | |
1006 | for (i = 0; i < NROFATTACKS; i++) |
1007 | for (i = 0; i < NROFATTACKS; i++) |
1007 | { |
|
|
1008 | if (op->resist[i]) |
1008 | if (op->resist[i]) |
1009 | { |
1009 | { |
1010 | sprintf (buf, "(%s %+d)", resist_plus[i], op->resist[i]); |
1010 | sprintf (buf, "(%s %+d)", resist_plus[i], op->resist[i]); |
1011 | strcat (retbuf, buf); |
1011 | strcat (retbuf, buf); |
1012 | } |
1012 | } |
1013 | } |
1013 | |
1014 | return retbuf; |
1014 | return retbuf; |
1015 | } |
1015 | } |
1016 | |
1016 | |
1017 | |
1017 | |
1018 | /* |
1018 | /* |
… | |
… | |
1520 | } |
1520 | } |
1521 | } |
1521 | } |
1522 | |
1522 | |
1523 | /* If the object is on a map, make sure we update its face */ |
1523 | /* If the object is on a map, make sure we update its face */ |
1524 | if (op->map) |
1524 | if (op->map) |
1525 | update_object (op, UP_OBJ_FACE); |
1525 | update_object (op, UP_OBJ_CHANGE); |
1526 | else |
1526 | else |
1527 | { |
1527 | { |
1528 | pl = op->in_player (); |
1528 | pl = op->in_player (); |
1529 | if (pl) |
1529 | if (pl) |
1530 | /* A lot of the values can change from an update - might as well send |
1530 | /* A lot of the values can change from an update - might as well send |