ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/apply.C
(Generate patch)

Comparing deliantra/server/server/apply.C (file contents):
Revision 1.124 by root, Thu Aug 16 11:01:10 2007 UTC vs.
Revision 1.125 by root, Thu Aug 16 11:34:29 2007 UTC

197 197
198 floor = GET_MAP_OB (op->map, op->x, op->y); 198 floor = GET_MAP_OB (op->map, op->x, op->y);
199 199
200 if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) 200 if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE)
201 { 201 {
202 op->errormsg ("Gods prevent you from using this here, it's sacred ground!"); 202 op->failmsg ("Gods prevent you from using this here, it's sacred ground!");
203 203
204 CLEAR_FLAG (tmp, FLAG_APPLIED); 204 CLEAR_FLAG (tmp, FLAG_APPLIED);
205 return 0; 205 return 0;
206 } 206 }
207 207
314 else 314 else
315 { /* cursed potion */ 315 { /* cursed potion */
316 if (got_one) 316 if (got_one)
317 { 317 {
318 op->update_stats (); 318 op->update_stats ();
319 op->errormsg ("The Gods are angry and punish you."); 319 op->failmsg ("The Gods are angry and punish you.");
320 } 320 }
321 else 321 else
322 op->statusmsg ("You are fortunate that you are so pathetic.", NDI_DK_ORANGE); 322 op->statusmsg ("You are fortunate that you are so pathetic.", NDI_DK_ORANGE);
323 } 323 }
324 324
336 { 336 {
337 if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)) 337 if (QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED))
338 { 338 {
339 object *fball; 339 object *fball;
340 340
341 op->errormsg ("Yech! Your lungs are on fire!"); 341 op->failmsg ("Yech! Your lungs are on fire!");
342 342
343 /* Explodes a fireball centered at player */ 343 /* Explodes a fireball centered at player */
344 fball = get_archetype (EXPLODING_FIREBALL); 344 fball = get_archetype (EXPLODING_FIREBALL);
345 fball->dam_modifier = random_roll (1, op->level, op, PREFER_LOW) / 5 + 1; 345 fball->dam_modifier = random_roll (1, op->level, op, PREFER_LOW) / 5 + 1;
346 fball->stats.maxhp = random_roll (1, op->level, op, PREFER_LOW) / 10 + 2; 346 fball->stats.maxhp = random_roll (1, op->level, op, PREFER_LOW) / 10 + 2;
552 if (improver->slaying) 552 if (improver->slaying)
553 { 553 {
554 count = check_item (op, improver->slaying); 554 count = check_item (op, improver->slaying);
555 if (count < 1) 555 if (count < 1)
556 { 556 {
557 op->errormsg (format ("The gods want more %ss", &improver->slaying)); 557 op->failmsg (format ("The gods want more %ss", &improver->slaying));
558 return 0; 558 return 0;
559 } 559 }
560 } 560 }
561 else 561 else
562 count = 1; 562 count = 1;
576 576
577 /* So it updates the players stats and the window */ 577 /* So it updates the players stats and the window */
578 op->update_stats (); 578 op->update_stats ();
579 579
580 op->statusmsg (format ( 580 op->statusmsg (format (
581 "Your sacrifice was accepted.\n" 581 "Your sacrifice was accepted.\n"
582 "Weapon's bonus to %s improved by %d.", 582 "Weapon's bonus to %s improved by %d.",
583 statname, sacrifice_count 583 statname, sacrifice_count
584 )); 584 ));
585 585
586 return 1; 586 return 1;
587} 587}
588 588
609 int sacrifice_count, i; 609 int sacrifice_count, i;
610 char buf[MAX_BUF]; 610 char buf[MAX_BUF];
611 611
612 if (weapon->level != 0) 612 if (weapon->level != 0)
613 { 613 {
614 op->errormsg ("Weapon is already prepared!"); 614 op->failmsg ("Weapon is already prepared!");
615 return 0; 615 return 0;
616 } 616 }
617 617
618 for (i = 0; i < NROFATTACKS; i++) 618 for (i = 0; i < NROFATTACKS; i++)
619 if (weapon->resist[i]) 619 if (weapon->resist[i])
625 if (i < NROFATTACKS || weapon->stats.hp || /* regeneration */ 625 if (i < NROFATTACKS || weapon->stats.hp || /* regeneration */
626 (weapon->stats.sp && weapon->type == WEAPON) || /* sp regeneration */ 626 (weapon->stats.sp && weapon->type == WEAPON) || /* sp regeneration */
627 weapon->stats.exp || /* speed */ 627 weapon->stats.exp || /* speed */
628 weapon->stats.ac) /* AC - only taifu's I think */ 628 weapon->stats.ac) /* AC - only taifu's I think */
629 { 629 {
630 op->errormsg ("You cannot prepare magic weapons."); 630 op->failmsg ("You cannot prepare magic weapons.");
631 return 0; 631 return 0;
632 } 632 }
633 633
634 sacrifice_count = check_sacrifice (op, improver); 634 sacrifice_count = check_sacrifice (op, improver);
635 if (sacrifice_count <= 0) 635 if (sacrifice_count <= 0)
637 637
638 weapon->level = isqrt (sacrifice_count); 638 weapon->level = isqrt (sacrifice_count);
639 eat_item (op, improver->slaying, sacrifice_count); 639 eat_item (op, improver->slaying, sacrifice_count);
640 640
641 op->statusmsg (format ( 641 op->statusmsg (format (
642 "Your sacrifice was accepted." 642 "Your sacrifice was accepted."
643 "Your *%s may be improved %d times.", 643 "Your *%s may be improved %d times.",
644 &weapon->name, weapon->level 644 &weapon->name, weapon->level
645 )); 645 ));
646 646
647 sprintf (buf, "%s's %s", &op->name, &weapon->name); 647 sprintf (buf, "%s's %s", &op->name, &weapon->name);
648 weapon->name = weapon->name_pl = buf; 648 weapon->name = weapon->name_pl = buf;
649 weapon->nrof = 0; /* prevents preparing n weapons in the same 649 weapon->nrof = 0; /* prevents preparing n weapons in the same
673 if (improver->stats.sp == IMPROVE_PREPARE) 673 if (improver->stats.sp == IMPROVE_PREPARE)
674 return prepare_weapon (op, improver, weapon); 674 return prepare_weapon (op, improver, weapon);
675 675
676 if (weapon->level == 0) 676 if (weapon->level == 0)
677 { 677 {
678 op->errormsg ("This weapon has not been prepared. H<You first ahve to prepare a weapon with a prepare weapon scroll.>"); 678 op->failmsg ("This weapon has not been prepared. H<You first ahve to prepare a weapon with a prepare weapon scroll.>");
679 return 0; 679 return 0;
680 } 680 }
681 681
682 if (weapon->level == weapon->last_eat && weapon->item_power >= 100) 682 if (weapon->level == weapon->last_eat && weapon->item_power >= 100)
683 { 683 {
684 op->errormsg ("This weapon cannot be improved any more."); 684 op->failmsg ("This weapon cannot be improved any more.");
685 return 0; 685 return 0;
686 } 686 }
687 687
688 if (QUERY_FLAG (weapon, FLAG_APPLIED) && !check_weapon_power (op, weapon->last_eat + 1)) 688 if (QUERY_FLAG (weapon, FLAG_APPLIED) && !check_weapon_power (op, weapon->last_eat + 1))
689 { 689 {
690 op->errormsg ("Improving the weapon will make it too " 690 op->failmsg ("Improving the weapon will make it too "
691 "powerful for you to use. Unready it if you " 691 "powerful for you to use. Unready it if you "
692 "really want to improve it."); 692 "really want to improve it.");
693 return 0; 693 return 0;
694 } 694 }
695 695
741 sacrifice_needed *= 2; 741 sacrifice_needed *= 2;
742 742
743 sacrifice_count = check_sacrifice (op, improver); 743 sacrifice_count = check_sacrifice (op, improver);
744 if (sacrifice_count < sacrifice_needed) 744 if (sacrifice_count < sacrifice_needed)
745 { 745 {
746 op->errormsg (format ("You need at least %d %s.", sacrifice_needed, &improver->slaying)); 746 op->failmsg (format ("You need at least %d %s.", sacrifice_needed, &improver->slaying));
747 return 0; 747 return 0;
748 } 748 }
749 749
750 eat_item (op, improver->slaying, sacrifice_needed); 750 eat_item (op, improver->slaying, sacrifice_needed);
751 weapon->item_power++; 751 weapon->item_power++;
758 case IMPROVE_WIS: return improve_weapon_stat (op, improver, weapon, weapon->stats.Wis, 1, "wisdom"); 758 case IMPROVE_WIS: return improve_weapon_stat (op, improver, weapon, weapon->stats.Wis, 1, "wisdom");
759 case IMPROVE_CHA: return improve_weapon_stat (op, improver, weapon, weapon->stats.Cha, 1, "charisma"); 759 case IMPROVE_CHA: return improve_weapon_stat (op, improver, weapon, weapon->stats.Cha, 1, "charisma");
760 case IMPROVE_INT: return improve_weapon_stat (op, improver, weapon, weapon->stats.Int, 1, "intelligence"); 760 case IMPROVE_INT: return improve_weapon_stat (op, improver, weapon, weapon->stats.Int, 1, "intelligence");
761 case IMPROVE_POW: return improve_weapon_stat (op, improver, weapon, weapon->stats.Pow, 1, "power"); 761 case IMPROVE_POW: return improve_weapon_stat (op, improver, weapon, weapon->stats.Pow, 1, "power");
762 default: 762 default:
763 op->errormsg ("Unknown improvement type."); 763 op->failmsg ("Unknown improvement type.");
764 } 764 }
765 765
766 LOG (llevError, "improve_weapon: Got to end of function\n"); 766 LOG (llevError, "improve_weapon: Got to end of function\n");
767 return 0; 767 return 0;
768} 768}
780 if (op->type != PLAYER) 780 if (op->type != PLAYER)
781 return 0; 781 return 0;
782 782
783 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_NO_MAGIC)) 783 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_NO_MAGIC))
784 { 784 {
785 op->errormsg ("Something blocks the magic of the scroll!"); 785 op->failmsg ("Something blocks the magic of the scroll!");
786 return 0; 786 return 0;
787 } 787 }
788 788
789 otmp = find_marked_object (op); 789 otmp = find_marked_object (op);
790 if (!otmp) 790 if (!otmp)
791 { 791 {
792 op->errormsg ("You need to mark a weapon object. H<Use the mark command or the mark option from the item popup menu.>"); 792 op->failmsg ("You need to mark a weapon object. H<Use the mark command or the mark option from the item popup menu.>");
793 return 0; 793 return 0;
794 } 794 }
795 795
796 if (otmp->type != WEAPON && otmp->type != BOW) 796 if (otmp->type != WEAPON && otmp->type != BOW)
797 { 797 {
798 op->errormsg ("Marked item is not a weapon or bow!"); 798 op->failmsg ("Marked item is not a weapon or bow!");
799 return 0; 799 return 0;
800 } 800 }
801 801
802 op->statusmsg ("Applied weapon builder."); 802 op->statusmsg ("Applied weapon builder.");
803 803
833{ 833{
834 object *tmp; 834 object *tmp;
835 835
836 if (armour->magic >= settings.armor_max_enchant) 836 if (armour->magic >= settings.armor_max_enchant)
837 { 837 {
838 op->errormsg ("This armour can not be enchanted any further!"); 838 op->failmsg ("This armour can not be enchanted any further!");
839 return 0; 839 return 0;
840 } 840 }
841 /* Dealing with random artifact armor is a lot trickier (in terms of value, weight, 841 /* Dealing with random artifact armor is a lot trickier (in terms of value, weight,
842 * etc), so take the easy way out and don't worry about it. 842 * etc), so take the easy way out and don't worry about it.
843 * Note - maybe add scrolls which make the random artifact versions (eg, armour 843 * Note - maybe add scrolls which make the random artifact versions (eg, armour
844 * of gnarg and what not?) 844 * of gnarg and what not?)
845 */ 845 */
846 if (armour->title) 846 if (armour->title)
847 { 847 {
848 op->errormsg ("This armour will not accept further enchantment."); 848 op->failmsg ("This armour will not accept further enchantment.");
849 return 0; 849 return 0;
850 } 850 }
851 851
852 /* Split objects if needed. Can't insert tmp until the 852 /* Split objects if needed. Can't insert tmp until the
853 * end of this function - otherwise it will just re-merge. 853 * end of this function - otherwise it will just re-merge.
1054 1054
1055 op->contr->last_used = 0; 1055 op->contr->last_used = 0;
1056 1056
1057 if (sack->env && sack->env != op) 1057 if (sack->env && sack->env != op)
1058 { 1058 {
1059 op->errormsg ("You must put it onto the floor or into your inventory first."); 1059 op->failmsg ("You must put it onto the floor or into your inventory first.");
1060 return 1; 1060 return 1;
1061 } 1061 }
1062 1062
1063 // already applied == open on ground, or open in inv, or active in inv 1063 // already applied == open on ground, or open in inv, or active in inv
1064 if (sack->flag [FLAG_APPLIED]) 1064 if (sack->flag [FLAG_APPLIED])
1070 return 1; 1070 return 1;
1071 } 1071 }
1072 else if (!sack->env) 1072 else if (!sack->env)
1073 { 1073 {
1074 // active, but not ours: some other player has opened it 1074 // active, but not ours: some other player has opened it
1075 op->errormsg (format ("Somebody else is using the %s already.", query_name (sack))); 1075 op->failmsg (format ("Somebody else is using the %s already.", query_name (sack)));
1076 return 1; 1076 return 1;
1077 } 1077 }
1078 1078
1079 // fall through to opening it (active in inv) 1079 // fall through to opening it (active in inv)
1080 } 1080 }
1305 * move_on is zero, it needs to be manually applied (doesn't talk 1305 * move_on is zero, it needs to be manually applied (doesn't talk
1306 * to us). 1306 * to us).
1307 */ 1307 */
1308 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ) && !sign->move_on) 1308 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ) && !sign->move_on)
1309 { 1309 {
1310 op->errormsg ("You are unable to read while blind!"); 1310 op->failmsg ("You are unable to read while blind!");
1311 return; 1311 return;
1312 } 1312 }
1313 1313
1314 if (op->contr) 1314 if (op->contr)
1315 if (client *ns = op->contr->ns) 1315 if (client *ns = op->contr->ns)
1481 } 1481 }
1482 1482
1483 case CONVERTER: 1483 case CONVERTER:
1484 if (convert_item (victim, trap) < 0) 1484 if (convert_item (victim, trap) < 0)
1485 { 1485 {
1486 originator->errormsg (format ("The %s seems to be broken!", query_name (trap))); 1486 originator->failmsg (format ("The %s seems to be broken!", query_name (trap)));
1487 get_archetype ("burnout")->insert_at (trap, trap); 1487 get_archetype ("burnout")->insert_at (trap, trap);
1488 } 1488 }
1489 1489
1490 goto leave; 1490 goto leave;
1491 1491
1583 int lev_diff; 1583 int lev_diff;
1584 object *skill_ob; 1584 object *skill_ob;
1585 1585
1586 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ)) 1586 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ))
1587 { 1587 {
1588 op->errormsg ("You are unable to read while blind!"); 1588 op->failmsg ("You are unable to read while blind!");
1589 return; 1589 return;
1590 } 1590 }
1591 1591
1592 if (!tmp->msg) 1592 if (!tmp->msg)
1593 { 1593 {
1594 op->errormsg (format ("You open the %s and find it empty.", &tmp->name)); 1594 op->failmsg (format ("You open the %s and find it empty.", &tmp->name));
1595 return; 1595 return;
1596 } 1596 }
1597 1597
1598 /* need a literacy skill to read stuff! */ 1598 /* need a literacy skill to read stuff! */
1599 skill_ob = find_skill_by_name (op, tmp->skill); 1599 skill_ob = find_skill_by_name (op, tmp->skill);
1600 if (!skill_ob) 1600 if (!skill_ob)
1601 { 1601 {
1602 op->errormsg (format ("You are unable to decipher the strange symbols. H<You lack the %s skill to read this.>", &tmp->skill)); 1602 op->failmsg (format ("You are unable to decipher the strange symbols. H<You lack the %s skill to read this.>", &tmp->skill));
1603 return; 1603 return;
1604 } 1604 }
1605 1605
1606 lev_diff = tmp->level - (skill_ob->level + 5); 1606 lev_diff = tmp->level - (skill_ob->level + 5);
1607 if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0) 1607 if (!QUERY_FLAG (op, FLAG_WIZ) && lev_diff > 0)
1608 { 1608 {
1609 op->errormsg (lev_diff < 2 ? "This book is just barely beyond your comprehension." 1609 op->failmsg (lev_diff < 2 ? "This book is just barely beyond your comprehension."
1610 : lev_diff < 3 ? "This book is slightly beyond your comprehension." 1610 : lev_diff < 3 ? "This book is slightly beyond your comprehension."
1611 : lev_diff < 5 ? "This book is beyond your comprehension." 1611 : lev_diff < 5 ? "This book is beyond your comprehension."
1612 : lev_diff < 8 ? "This book is quite a bit beyond your comprehension." 1612 : lev_diff < 8 ? "This book is quite a bit beyond your comprehension."
1613 : lev_diff < 15 ? "This book is way beyond your comprehension." 1613 : lev_diff < 15 ? "This book is way beyond your comprehension."
1614 : "This book is totally beyond your comprehension."); 1614 : "This book is totally beyond your comprehension.");
1665{ 1665{
1666 switch (learn_skill (op, tmp)) 1666 switch (learn_skill (op, tmp))
1667 { 1667 {
1668 case 0: 1668 case 0:
1669 op->play_sound (sound_find ("generic_fail")); 1669 op->play_sound (sound_find ("generic_fail"));
1670 op->errormsg (format ("You already possess the knowledge held within the %s.", query_name (tmp))); 1670 op->failmsg (format ("You already possess the knowledge held within the %s.", query_name (tmp)));
1671 break; 1671 break;
1672 1672
1673 case 1: 1673 case 1:
1674 decrease_ob (tmp); 1674 decrease_ob (tmp);
1675 op->play_sound (sound_find ("skill_learn")); 1675 op->play_sound (sound_find ("skill_learn"));
1677 break; 1677 break;
1678 1678
1679 default: 1679 default:
1680 decrease_ob (tmp); 1680 decrease_ob (tmp);
1681 op->play_sound (sound_find ("generic_fail")); 1681 op->play_sound (sound_find ("generic_fail"));
1682 op->errormsg (format ("You fail to learn the knowledge of the %s.\n", query_name (tmp))); 1682 op->failmsg (format ("You fail to learn the knowledge of the %s.\n", query_name (tmp)));
1683 break; 1683 break;
1684 } 1684 }
1685} 1685}
1686 1686
1687/** 1687/**
1738 { 1738 {
1739 LOG (llevError, "BUG: do_forget_spell(): spell not known\n"); 1739 LOG (llevError, "BUG: do_forget_spell(): spell not known\n");
1740 return; 1740 return;
1741 } 1741 }
1742 1742
1743 new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You lose knowledge of %s.", spell); 1743 op->failmsg (format ("You lose knowledge of %s.", spell));
1744 player_unready_range_ob (op->contr, spob); 1744 player_unready_range_ob (op->contr, spob);
1745 esrv_remove_spell (op->contr, spob); 1745 esrv_remove_spell (op->contr, spob);
1746 spob->destroy (); 1746 spob->destroy ();
1747} 1747}
1748 1748
1756{ 1756{
1757 object *skop, *spell, *spell_skill; 1757 object *skop, *spell, *spell_skill;
1758 1758
1759 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ)) 1759 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ))
1760 { 1760 {
1761 op->errormsg ("You are unable to read while blind."); 1761 op->failmsg ("You are unable to read while blind.");
1762 return; 1762 return;
1763 } 1763 }
1764 1764
1765 /* artifact_spellbooks have 'slaying' field point to a spell name, 1765 /* artifact_spellbooks have 'slaying' field point to a spell name,
1766 * instead of having their spell stored in stats.sp. These are 1766 * instead of having their spell stored in stats.sp. These are
1769 if (tmp->slaying) 1769 if (tmp->slaying)
1770 { 1770 {
1771 spell = arch_to_object (find_archetype_by_object_name (tmp->slaying)); 1771 spell = arch_to_object (find_archetype_by_object_name (tmp->slaying));
1772 if (!spell) 1772 if (!spell)
1773 { 1773 {
1774 op->errormsg (format ("The book's formula for %s is incomplete.", &tmp->slaying)); 1774 op->failmsg (format ("The book's formula for %s is incomplete.", &tmp->slaying));
1775 return; 1775 return;
1776 } 1776 }
1777 else 1777 else
1778 insert_ob_in_ob (spell, tmp); 1778 insert_ob_in_ob (spell, tmp);
1779 1779
1784 1784
1785 /* need a literacy skill to learn spells. Also, having a literacy level 1785 /* need a literacy skill to learn spells. Also, having a literacy level
1786 * lower than the spell will make learning the spell more difficult */ 1786 * lower than the spell will make learning the spell more difficult */
1787 if (!skop) 1787 if (!skop)
1788 { 1788 {
1789 op->errormsg (format ("You can't read! Your attempt fails. H<You lack the %s skill.>", &tmp->skill)); 1789 op->failmsg (format ("You can't read! Your attempt fails. H<You lack the %s skill.>", &tmp->skill));
1790 return; 1790 return;
1791 } 1791 }
1792 1792
1793 spell = tmp->inv; 1793 spell = tmp->inv;
1794 1794
1795 if (!spell) 1795 if (!spell)
1796 { 1796 {
1797 LOG (llevError, "apply_spellbook: Book %s has no spell in it!\n", &tmp->name); 1797 LOG (llevError, "apply_spellbook: Book %s has no spell in it!\n", &tmp->name);
1798 op->errormsg ("The spellbook symbols make no sense. This is a bug, please report!"); 1798 op->failmsg ("The spellbook symbols make no sense. This is a bug, please report!");
1799 return; 1799 return;
1800 } 1800 }
1801 1801
1802 if (skop->level < int (sqrtf (spell->level) * 1.5f)) 1802 if (skop->level < int (sqrtf (spell->level) * 1.5f))
1803 { 1803 {
1804 op->errormsg (format ("You are unable to decipher the strange symbols. H<Your %s level is too low.>", &tmp->skill)); 1804 op->failmsg (format ("You are unable to decipher the strange symbols. H<Your %s level is too low.>", &tmp->skill));
1805 return; 1805 return;
1806 } 1806 }
1807 1807
1808 op->statusmsg (format ("The spellbook contains the %s level spell %s.", get_levelnumber (spell->level), &spell->name)); 1808 op->statusmsg (format ("The spellbook contains the %s level spell %s.", get_levelnumber (spell->level), &spell->name));
1809 1809
1832 { 1832 {
1833 spell_skill = find_skill_by_name (op, spell->skill); 1833 spell_skill = find_skill_by_name (op, spell->skill);
1834 1834
1835 if (!spell_skill) 1835 if (!spell_skill)
1836 { 1836 {
1837 op->errormsg (format ("You lack the skill %s to use this spell.", &spell->skill)); 1837 op->failmsg (format ("You lack the skill %s to use this spell.", &spell->skill));
1838 return; 1838 return;
1839 } 1839 }
1840 1840
1841 if (spell_skill->level < spell->level) 1841 if (spell_skill->level < spell->level)
1842 { 1842 {
1843 op->errormsg (format ("You need to be level %d in %s to learn this spell.", spell->level, &spell->skill)); 1843 op->failmsg (format ("You need to be level %d in %s to learn this spell.", spell->level, &spell->skill));
1844 return; 1844 return;
1845 } 1845 }
1846 } 1846 }
1847 1847
1848 /* Logic as follows 1848 /* Logic as follows
1857 * Overall, chances are the same but a player will find having a high 1857 * Overall, chances are the same but a player will find having a high
1858 * literacy rate very useful! -b.t. 1858 * literacy rate very useful! -b.t.
1859 */ 1859 */
1860 if (QUERY_FLAG (op, FLAG_CONFUSED)) 1860 if (QUERY_FLAG (op, FLAG_CONFUSED))
1861 { 1861 {
1862 op->errormsg ("In your confused state you flub the wording of the text!"); 1862 op->failmsg ("In your confused state you flub the wording of the text!");
1863 scroll_failure (op, 0 - random_roll (0, spell->level, op, PREFER_LOW), MAX (spell->stats.sp, spell->stats.grace)); 1863 scroll_failure (op, 0 - random_roll (0, spell->level, op, PREFER_LOW), MAX (spell->stats.sp, spell->stats.grace));
1864 } 1864 }
1865 else if (QUERY_FLAG (tmp, FLAG_STARTEQUIP) || 1865 else if (QUERY_FLAG (tmp, FLAG_STARTEQUIP) ||
1866 (random_roll (0, 100, op, PREFER_LOW) - (5 * skop->level)) < learn_spell[spell->stats.grace ? op->stats.Wis : op->stats.Int]) 1866 (random_roll (0, 100, op, PREFER_LOW) - (5 * skop->level)) < learn_spell[spell->stats.grace ? op->stats.Wis : op->stats.Int])
1867 { 1867 {
1873 change_exp (op, calc_skill_exp (op, tmp, skop), skop->skill, 0); 1873 change_exp (op, calc_skill_exp (op, tmp, skop), skop->skill, 0);
1874 } 1874 }
1875 else 1875 else
1876 { 1876 {
1877 op->contr->play_sound (sound_find ("fumble_spell")); 1877 op->contr->play_sound (sound_find ("fumble_spell"));
1878 op->errormsg ("You fail to learn the spell. H<Wis (priests) or Int (wizards) governs the chance of learning a prayer or spell.>\n"); 1878 op->failmsg ("You fail to learn the spell. H<Wis (priests) or Int (wizards) governs the chance of learning a prayer or spell.>\n");
1879 } 1879 }
1880 1880
1881 decrease_ob (tmp); 1881 decrease_ob (tmp);
1882} 1882}
1883 1883
1889{ 1889{
1890 object *skop; 1890 object *skop;
1891 1891
1892 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ)) 1892 if (QUERY_FLAG (op, FLAG_BLIND) && !QUERY_FLAG (op, FLAG_WIZ))
1893 { 1893 {
1894 op->errormsg ("You are unable to read while blind."); 1894 op->failmsg ("You are unable to read while blind.");
1895 return; 1895 return;
1896 } 1896 }
1897 1897
1898 if (!tmp->inv || tmp->inv->type != SPELL) 1898 if (!tmp->inv || tmp->inv->type != SPELL)
1899 { 1899 {
1900 op->errormsg ("The scroll just doesn't make sense! H<...and never will make sense.>"); 1900 op->failmsg ("The scroll just doesn't make sense! H<...and never will make sense.>");
1901 return; 1901 return;
1902 } 1902 }
1903 1903
1904 if (op->type == PLAYER) 1904 if (op->type == PLAYER)
1905 { 1905 {
1911 */ 1911 */
1912 skop = find_skill_by_name (op, skill_names[SK_LITERACY]); 1912 skop = find_skill_by_name (op, skill_names[SK_LITERACY]);
1913 1913
1914 if (!skop) 1914 if (!skop)
1915 { 1915 {
1916 op->errormsg (format ("You are unable to decipher the strange symbols. H<You lack the %s skill.>", &skill_names[SK_LITERACY])); 1916 op->failmsg (format ("You are unable to decipher the strange symbols. H<You lack the %s skill.>", &skill_names[SK_LITERACY]));
1917 return; 1917 return;
1918 } 1918 }
1919 1919
1920 if ((exp_gain = calc_skill_exp (op, tmp, skop))) 1920 if ((exp_gain = calc_skill_exp (op, tmp, skop)))
1921 change_exp (op, exp_gain, skop->skill, 0); 1921 change_exp (op, exp_gain, skop->skill, 0);
1998 { 1998 {
1999 /* usual case - no dragon meal: */ 1999 /* usual case - no dragon meal: */
2000 if (op->stats.food + tmp->stats.food > 999) 2000 if (op->stats.food + tmp->stats.food > 999)
2001 { 2001 {
2002 if (tmp->type == FOOD || tmp->type == FLESH) 2002 if (tmp->type == FOOD || tmp->type == FLESH)
2003 op->errormsg ("You feel full, but what a waste of food!"); 2003 op->failmsg ("You feel full, but what a waste of food!");
2004 else 2004 else
2005 op->statusmsg ("Most of the drink goes down your face not your throat!"); 2005 op->statusmsg ("Most of the drink goes down your face not your throat!");
2006 } 2006 }
2007 2007
2008 if (!QUERY_FLAG (tmp, FLAG_CURSED)) 2008 if (!QUERY_FLAG (tmp, FLAG_CURSED))
2189 { 2189 {
2190 abil->last_eat = meal->last_eat; /* write: last_eat <new attnr focus> */ 2190 abil->last_eat = meal->last_eat; /* write: last_eat <new attnr focus> */
2191 2191
2192 if (meal->last_eat != abil->stats.exp) 2192 if (meal->last_eat != abil->stats.exp)
2193 op->statusmsg (format ( 2193 op->statusmsg (format (
2194 "Your metabolism prepares to focus on %s!\n" 2194 "Your metabolism prepares to focus on %s!\n"
2195 "The change will happen at level %d.", 2195 "The change will happen at level %d.",
2196 change_resist_msg[meal->last_eat], 2196 change_resist_msg[meal->last_eat],
2197 abil->level + 1 2197 abil->level + 1
2198 )); 2198 ));
2199 else 2199 else
2200 { 2200 {
2201 op->statusmsg (format ("Your metabolism will continue to focus on %s.", change_resist_msg[meal->last_eat])); 2201 op->statusmsg (format ("Your metabolism will continue to focus on %s.", change_resist_msg[meal->last_eat]));
2202 abil->last_eat = 0; 2202 abil->last_eat = 0;
2215{ 2215{
2216 object *armor; 2216 object *armor;
2217 2217
2218 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (get_map_flags (op->map, 0, op->x, op->y, 0, 0) & P_NO_MAGIC)) 2218 if (!QUERY_FLAG (op, FLAG_WIZCAST) && (get_map_flags (op->map, 0, op->x, op->y, 0, 0) & P_NO_MAGIC))
2219 { 2219 {
2220 op->errormsg ("Something blocks the magic of the scroll. H<This area prevents magic effects.>"); 2220 op->failmsg ("Something blocks the magic of the scroll. H<This area prevents magic effects.>");
2221 return; 2221 return;
2222 } 2222 }
2223 2223
2224 armor = find_marked_object (op); 2224 armor = find_marked_object (op);
2225 2225
2226 if (!armor) 2226 if (!armor)
2227 { 2227 {
2228 op->errormsg ("You need to mark an armor object. Use the right mouse button popup or the mark command to do this."); 2228 op->failmsg ("You need to mark an armor object. Use the right mouse button popup or the mark command to do this.");
2229 return; 2229 return;
2230 } 2230 }
2231 2231
2232 if (armor->type != ARMOUR 2232 if (armor->type != ARMOUR
2233 && armor->type != CLOAK 2233 && armor->type != CLOAK
2234 && armor->type != BOOTS && armor->type != GLOVES && armor->type != BRACERS && armor->type != SHIELD && armor->type != HELMET) 2234 && armor->type != BOOTS && armor->type != GLOVES && armor->type != BRACERS && armor->type != SHIELD && armor->type != HELMET)
2235 { 2235 {
2236 op->errormsg ("Your marked item is not armour!\n"); 2236 op->failmsg ("Your marked item is not armour!\n");
2237 return; 2237 return;
2238 } 2238 }
2239 2239
2240 op->statusmsg ("Applying armour enchantment."); 2240 op->statusmsg ("Applying armour enchantment.");
2241 improve_armour (op, tmp, armor); 2241 improve_armour (op, tmp, armor);
2245apply_poison (object *op, object *tmp) 2245apply_poison (object *op, object *tmp)
2246{ 2246{
2247 if (op->type == PLAYER) 2247 if (op->type == PLAYER)
2248 { 2248 {
2249 op->contr->play_sound (sound_find ("drink_poison")); 2249 op->contr->play_sound (sound_find ("drink_poison"));
2250 op->errormsg ("Yech! That tasted poisonous!"); 2250 op->failmsg ("Yech! That tasted poisonous!");
2251 strcpy (op->contr->killer, "poisonous booze"); 2251 strcpy (op->contr->killer, "poisonous booze");
2252 } 2252 }
2253 2253
2254 if (tmp->stats.hp > 0) 2254 if (tmp->stats.hp > 0)
2255 { 2255 {
2374 2374
2375 if (QUERY_FLAG (tmp, FLAG_UNPAID) && !QUERY_FLAG (tmp, FLAG_APPLIED)) 2375 if (QUERY_FLAG (tmp, FLAG_UNPAID) && !QUERY_FLAG (tmp, FLAG_APPLIED))
2376 { 2376 {
2377 if (op->type == PLAYER) 2377 if (op->type == PLAYER)
2378 { 2378 {
2379 op->errormsg ("You should pay for it first! H<You cannot use items marked as unpaid.>"); 2379 op->failmsg ("You should pay for it first! H<You cannot use items marked as unpaid.>");
2380 return 1; 2380 return 1;
2381 } 2381 }
2382 else 2382 else
2383 return 0; /* monsters just skip unpaid items */ 2383 return 0; /* monsters just skip unpaid items */
2384 } 2384 }
2402 { 2402 {
2403 op->statusmsg ("You turn the handle."); 2403 op->statusmsg ("You turn the handle.");
2404 op->play_sound (sound_find ("turn_handle")); 2404 op->play_sound (sound_find ("turn_handle"));
2405 } 2405 }
2406 else 2406 else
2407 op->errormsg ("The handle doesn't move."); 2407 op->failmsg ("The handle doesn't move.");
2408 2408
2409 return 1; 2409 return 1;
2410 2410
2411 case EXIT: 2411 case EXIT:
2412 if (op->type != PLAYER) 2412 if (op->type != PLAYER)
2413 return 0; 2413 return 0;
2414 2414
2415 if (!EXIT_PATH (tmp) || !is_legal_2ways_exit (op, tmp)) 2415 if (!EXIT_PATH (tmp) || !is_legal_2ways_exit (op, tmp))
2416 op->errormsg (format ("The %s is closed.", query_name (tmp))); 2416 op->failmsg (format ("The %s is closed.", query_name (tmp)));
2417 else 2417 else
2418 { 2418 {
2419 /* Don't display messages for random maps. */ 2419 /* Don't display messages for random maps. */
2420 if (tmp->msg && strncmp (EXIT_PATH (tmp), "/!", 2)) 2420 if (tmp->msg && strncmp (EXIT_PATH (tmp), "/!", 2))
2421 op->statusmsg (tmp->msg, NDI_NAVY); 2421 op->statusmsg (tmp->msg, NDI_NAVY);
2546 timeofday_t tod; 2546 timeofday_t tod;
2547 2547
2548 get_tod (&tod); 2548 get_tod (&tod);
2549 op->play_sound (sound_find ("sound_clock")); 2549 op->play_sound (sound_find ("sound_clock"));
2550 op->statusmsg (format ( 2550 op->statusmsg (format (
2551 "It is %d minute%s past %d o'clock %s", 2551 "It is %d minute%s past %d o'clock %s",
2552 tod.minute + 1, ((tod.minute + 1 < 2) ? "" : "s"), 2552 tod.minute + 1, ((tod.minute + 1 < 2) ? "" : "s"),
2553 ((tod.hour % 14 == 0) ? 14 : ((tod.hour) % 14)), ((tod.hour >= 14) ? "pm" : "am") 2553 ((tod.hour % 14 == 0) ? 14 : ((tod.hour) % 14)), ((tod.hour >= 14) ? "pm" : "am")
2554 )); 2554 ));
2555 return 1; 2555 return 1;
2556 } 2556 }
2557 else 2557 else
2558 return 0; 2558 return 0;
2603 if (op->env && (pl->move_type & MOVE_FLYING)) 2603 if (op->env && (pl->move_type & MOVE_FLYING))
2604 { 2604 {
2605 /* player is flying and applying object not in inventory */ 2605 /* player is flying and applying object not in inventory */
2606 if (!QUERY_FLAG (pl, FLAG_WIZ) && !(op->move_type & MOVE_FLYING)) 2606 if (!QUERY_FLAG (pl, FLAG_WIZ) && !(op->move_type & MOVE_FLYING))
2607 { 2607 {
2608 op->errormsg ("But you are floating high above the ground! H<You have to stop levitating first, if you can.>"); 2608 op->failmsg ("But you are floating high above the ground! H<You have to stop levitating first, if you can.>");
2609 return 0; 2609 return 0;
2610 } 2610 }
2611 } 2611 }
2612 2612
2613 pl->contr->last_used = op; 2613 pl->contr->last_used = op;
2616 if (!quiet) 2616 if (!quiet)
2617 { 2617 {
2618 if (tmp == 0) 2618 if (tmp == 0)
2619 op->statusmsg (format ("I don't know how to apply the %s.", query_name (op))); 2619 op->statusmsg (format ("I don't know how to apply the %s.", query_name (op)));
2620 else if (tmp == 2) 2620 else if (tmp == 2)
2621 op->errormsg ("You must get it first!\n"); 2621 op->failmsg ("You must get it first!\n");
2622 } 2622 }
2623 2623
2624 return tmp; 2624 return tmp;
2625} 2625}
2626 2626
2763 2763
2764 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 2764 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
2765 { 2765 {
2766 if (who->contr) 2766 if (who->contr)
2767 { 2767 {
2768 who->errormsg ("Oops, it feels deadly cold!"); 2768 who->failmsg ("Oops, it feels deadly cold!");
2769 SET_FLAG (tmp2, FLAG_KNOWN_CURSED); 2769 SET_FLAG (tmp2, FLAG_KNOWN_CURSED);
2770 } 2770 }
2771 } 2771 }
2772 2772
2773 if (who->contr) 2773 if (who->contr)
2883 for (object *tmp = who->inv; tmp; tmp = tmp->below) 2883 for (object *tmp = who->inv; tmp; tmp = tmp->below)
2884 if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->is_range ()) 2884 if (QUERY_FLAG (tmp, FLAG_APPLIED) && tmp->is_range ())
2885 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) || (!QUERY_FLAG (tmp, FLAG_CURSED) && !QUERY_FLAG (tmp, FLAG_DAMNED))) 2885 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) || (!QUERY_FLAG (tmp, FLAG_CURSED) && !QUERY_FLAG (tmp, FLAG_DAMNED)))
2886 { 2886 {
2887 if (aflags & AP_PRINT) 2887 if (aflags & AP_PRINT)
2888 new_draw_info (NDI_UNIQUE, 0, who, query_name (tmp)); 2888 who->failmsg (query_name (tmp));
2889 else 2889 else
2890 unapply_special (who, tmp, aflags); 2890 unapply_special (who, tmp, aflags);
2891 } 2891 }
2892 else 2892 else
2893 { 2893 {
2894 /* In this case, we want to try and remove a cursed item. 2894 /* In this case, we want to try and remove a cursed item.
2895 * While we know it won't work, we want unapply_special to 2895 * While we know it won't work, we want unapply_special to
2896 * at least generate the message. 2896 * at least generate the message.
2897 */ 2897 */
2898 new_draw_info_format (NDI_UNIQUE, 0, who, 2898 who->failmsg (format ("No matter how hard you try, you just can't remove the %s." CANNOT_REMOVE_CURSED, query_name (tmp)));
2899 "No matter how hard you try, you just can't remove the %s." CANNOT_REMOVE_CURSED,
2900 query_name (tmp));
2901 return 1; 2899 return 1;
2902 } 2900 }
2903 2901
2904 for (int i = 0; i < NUM_BODY_LOCATIONS; i++) 2902 for (int i = 0; i < NUM_BODY_LOCATIONS; i++)
2905 { 2903 {
2928 2926
2929 /* If we are just printing, we don't care about cursed status */ 2927 /* If we are just printing, we don't care about cursed status */
2930 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) || (!(QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED)))) 2928 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) || (!(QUERY_FLAG (tmp, FLAG_CURSED) || QUERY_FLAG (tmp, FLAG_DAMNED))))
2931 { 2929 {
2932 if (aflags & AP_PRINT) 2930 if (aflags & AP_PRINT)
2933 new_draw_info (NDI_UNIQUE, 0, who, query_name (tmp)); 2931 who->failmsg (query_name (tmp));
2934 else 2932 else
2935 unapply_special (who, tmp, aflags); 2933 unapply_special (who, tmp, aflags);
2936 } 2934 }
2937 else 2935 else
2938 { 2936 {
2939 /* Cursed item that we can't unequip - tell the player. 2937 /* Cursed item that we can't unequip - tell the player.
2940 * Note this could be annoying if this is just one of a few, 2938 * Note this could be annoying if this is just one of a few,
2941 * so it may not be critical (eg, putting on a ring and you have 2939 * so it may not be critical (eg, putting on a ring and you have
2942 * one cursed ring.) 2940 * one cursed ring.)
2943 */ 2941 */
2944 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s just won't come off." CANNOT_REMOVE_CURSED, query_name (tmp)); 2942 who->failmsg (format ("The %s just won't come off." CANNOT_REMOVE_CURSED, query_name (tmp)));
2945 } 2943 }
2946 2944
2947 last = tmp->below; 2945 last = tmp->below;
2948 } 2946 }
2949 /* if we got here, this slot is freed up - otherwise, if it wasn't freed up, the 2947 /* if we got here, this slot is freed up - otherwise, if it wasn't freed up, the
3130 if (basic_flag == AP_APPLY) 3128 if (basic_flag == AP_APPLY)
3131 return 0; 3129 return 0;
3132 3130
3133 if (!(aflags & AP_IGNORE_CURSE) && (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))) 3131 if (!(aflags & AP_IGNORE_CURSE) && (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)))
3134 { 3132 {
3135 new_draw_info_format (NDI_UNIQUE, 0, who, 3133 who->failmsg (format ("No matter how hard you try, you just can't remove %s." CANNOT_REMOVE_CURSED, query_name (op)));
3136 "No matter how hard you try, you just can't remove %s." CANNOT_REMOVE_CURSED,
3137 query_name (op));
3138 return 1; 3134 return 1;
3139 } 3135 }
3140 3136
3141 return unapply_special (who, op, aflags); 3137 return unapply_special (who, op, aflags);
3142 } 3138 }
3158 /* Can't just apply this object. Lets see what not and what to do */ 3154 /* Can't just apply this object. Lets see what not and what to do */
3159 if (int i = can_apply_object (who, op)) 3155 if (int i = can_apply_object (who, op))
3160 { 3156 {
3161 if (i & CAN_APPLY_NEVER) 3157 if (i & CAN_APPLY_NEVER)
3162 { 3158 {
3163 new_draw_info_format (NDI_UNIQUE, 0, who, 3159 who->failmsg (format ("You don't have the body to use a %s. H<You can never apply this item.>", query_name (op)));
3164 "You don't have the body to use a %s. H<You can never apply this item.>",
3165 query_name (op));
3166 return 1; 3160 return 1;
3167 } 3161 }
3168 else if (i & CAN_APPLY_RESTRICTION) 3162 else if (i & CAN_APPLY_RESTRICTION)
3169 { 3163 {
3170 new_draw_info_format (NDI_UNIQUE, 0, who, 3164 who->failmsg (format (
3171 "You have a prohibition against using a %s. " 3165 "You have a prohibition against using a %s. "
3172 "H<Your belief, profession or class prevents you from applying this item.>", 3166 "H<Your belief, profession or class prevents you from applying this item.>",
3173 query_name (op)); 3167 query_name (op)
3168 ));
3174 return 1; 3169 return 1;
3175 } 3170 }
3176 3171
3177 if (who->type != PLAYER) 3172 if (who->type != PLAYER)
3178 { 3173 {
3182 } 3177 }
3183 else 3178 else
3184 { 3179 {
3185 if (who->contr->unapply == unapply_never || (i & CAN_APPLY_UNAPPLY_CHOICE && who->contr->unapply == unapply_nochoice)) 3180 if (who->contr->unapply == unapply_never || (i & CAN_APPLY_UNAPPLY_CHOICE && who->contr->unapply == unapply_nochoice))
3186 { 3181 {
3187 new_draw_info (NDI_UNIQUE, 0, who, "You need to unapply some of the following item(s) or change your applymode:"); 3182 who->failmsg ("You need to unapply some of the following item(s) or change your applymode:");
3188 unapply_for_ob (who, op, AP_PRINT); 3183 unapply_for_ob (who, op, AP_PRINT);
3189 return 1; 3184 return 1;
3190 } 3185 }
3191 else if (who->contr->unapply == unapply_always || !(i & CAN_APPLY_UNAPPLY_CHOICE)) 3186 else if (who->contr->unapply == unapply_always || !(i & CAN_APPLY_UNAPPLY_CHOICE))
3192 if (unapply_for_ob (who, op, aflags)) 3187 if (unapply_for_ob (who, op, aflags))
3198 { 3193 {
3199 skop = find_skill_by_name (who, op->skill); 3194 skop = find_skill_by_name (who, op->skill);
3200 3195
3201 if (!skop) 3196 if (!skop)
3202 { 3197 {
3203 new_draw_info_format (NDI_UNIQUE, 0, who, "You need the %s skill to use this item!", &op->skill); 3198 who->failmsg (format ("You need the %s skill to use this item!", &op->skill));
3204 return 1; 3199 return 1;
3205 } 3200 }
3206 else 3201 else
3207 /* While experience will be credited properly, we want to change the 3202 /* While experience will be credited properly, we want to change the
3208 * skill so that the dam and wc get updated 3203 * skill so that the dam and wc get updated
3212 3207
3213 if (who->type == PLAYER 3208 if (who->type == PLAYER
3214 && op->item_power 3209 && op->item_power
3215 && op->item_power + who->contr->item_power > settings.item_power_factor * who->level) 3210 && op->item_power + who->contr->item_power > settings.item_power_factor * who->level)
3216 { 3211 {
3217 new_draw_info (NDI_UNIQUE, 0, who,
3218 "Equipping that combined with other items would consume your soul!" LACK_ITEM_POWER); 3212 who->failmsg ("Equipping that combined with other items would consume your soul!" LACK_ITEM_POWER);
3219 return 1; 3213 return 1;
3220 } 3214 }
3221 3215
3222 /* Ok. We are now at the state where we can apply the new object. 3216 /* Ok. We are now at the state where we can apply the new object.
3223 * Note that we don't have the checks for can_use_... 3217 * Note that we don't have the checks for can_use_...
3234 switch (op->type) 3228 switch (op->type)
3235 { 3229 {
3236 case WEAPON: 3230 case WEAPON:
3237 if (!check_weapon_power (who, op->last_eat)) 3231 if (!check_weapon_power (who, op->last_eat))
3238 { 3232 {
3239 new_draw_info (NDI_UNIQUE, 0, who, "This weapon is too powerful for you to use. " 3233 op->failmsg ("This weapon is too powerful for you to use. It would consume your soul!." LACK_ITEM_POWER);
3240 "It would consume your soul!." LACK_ITEM_POWER);
3241 3234
3242 if (tmp) 3235 if (tmp)
3243 insert_ob_in_ob (tmp, who); 3236 insert_ob_in_ob (tmp, who);
3244 3237
3245 return 1; 3238 return 1;
3249 // i.e. "R" can use Ragnarok's sword. 3242 // i.e. "R" can use Ragnarok's sword.
3250 if (op->level && (strncmp (op->name, who->name, strlen (who->name)))) 3243 if (op->level && (strncmp (op->name, who->name, strlen (who->name))))
3251 { 3244 {
3252 /* if the weapon does not have the name as the character, can't use it. */ 3245 /* if the weapon does not have the name as the character, can't use it. */
3253 /* (Ragnarok's sword attempted to be used by Foo: won't work) */ 3246 /* (Ragnarok's sword attempted to be used by Foo: won't work) */
3254 new_draw_info (NDI_UNIQUE, 0, who, 3247 who->failmsg ("The weapon does not recognize you as its owner. H<Its name indicates that it belongs to somebody else.>");
3255 "The weapon does not recognize you as its owner. "
3256 "H<Its name indicates that it belongs to somebody else.>");
3257 3248
3258 if (tmp) 3249 if (tmp)
3259 insert_ob_in_ob (tmp, who); 3250 insert_ob_in_ob (tmp, who);
3260 3251
3261 return 1; 3252 return 1;
3262 } 3253 }
3263 3254
3264 if (!skop) 3255 if (!skop)
3265 { 3256 {
3266 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO 3257 who->failmsg (format ("The %s is broken, please report this to the dungeon master!", query_name (op)));//TODO
3267 return 1; 3258 return 1;
3268 } 3259 }
3269 3260
3270 SET_FLAG (op, FLAG_APPLIED); 3261 SET_FLAG (op, FLAG_APPLIED);
3271 who->change_skill (skop); 3262 who->change_skill (skop);
3272 3263
3273 if (who->contr) 3264 if (who->contr)
3274 who->change_weapon (who->contr->combat_ob = op); 3265 who->change_weapon (who->contr->combat_ob = op);
3275 3266
3276 new_draw_info_format (NDI_UNIQUE, 0, who, "You wield %s.", query_name (op)); 3267 who->statusmsg (format ("You wield %s.", query_name (op)));
3277 3268
3278 SET_FLAG (who, FLAG_READY_WEAPON); 3269 SET_FLAG (who, FLAG_READY_WEAPON);
3279 change_abil (who, op); 3270 change_abil (who, op);
3280 break; 3271 break;
3281 3272
3288 case BRACERS: 3279 case BRACERS:
3289 case CLOAK: 3280 case CLOAK:
3290 case RING: 3281 case RING:
3291 case AMULET: 3282 case AMULET:
3292 SET_FLAG (op, FLAG_APPLIED); 3283 SET_FLAG (op, FLAG_APPLIED);
3293 new_draw_info_format (NDI_UNIQUE, 0, who, "You wear %s.", query_name (op)); 3284 who->statusmsg (format ("You wear %s.", query_name (op)));
3294 change_abil (who, op); 3285 change_abil (who, op);
3295 break; 3286 break;
3296 3287
3297 case LAMP: 3288 case LAMP:
3298 if (op->stats.food < 1) 3289 if (op->stats.food < 1)
3299 { 3290 {
3300 new_draw_info_format (NDI_UNIQUE, 0, who, 3291 who->failmsg (format (
3301 "Your %s is out of fuel! " 3292 "Your %s is out of fuel! "
3302 "H<Lamps and similar items need fuel. They cannot be refilled.>", &op->name); 3293 "H<Lamps and similar items need fuel. They cannot be refilled.>",
3294 &op->name
3295 ));
3303 return 1; 3296 return 1;
3304 } 3297 }
3305 3298
3306 new_draw_info_format (NDI_UNIQUE, 0, who, "You turn on your %s.", &op->name); 3299 who->statusmsg (format ("You turn on your %s.", &op->name));
3300
3307 tmp2 = arch_to_object (op->other_arch); 3301 tmp2 = arch_to_object (op->other_arch);
3308 tmp2->stats.food = op->stats.food; 3302 tmp2->stats.food = op->stats.food;
3309 SET_FLAG (tmp2, FLAG_APPLIED); 3303 SET_FLAG (tmp2, FLAG_APPLIED);
3310 3304
3311 if (QUERY_FLAG (op, FLAG_INV_LOCKED)) 3305 if (QUERY_FLAG (op, FLAG_INV_LOCKED))
3330 who->update_stats (); 3324 who->update_stats ();
3331 3325
3332 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 3326 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
3333 if (who->type == PLAYER) 3327 if (who->type == PLAYER)
3334 { 3328 {
3335 new_draw_info (NDI_UNIQUE, 0, who,
3336 "Oops, it feels deadly cold! "
3337 "H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>"); 3329 who->failmsg ("Oops, it feels deadly cold! H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>");
3338 SET_FLAG (tmp2, FLAG_KNOWN_CURSED); 3330 SET_FLAG (tmp2, FLAG_KNOWN_CURSED);
3339 } 3331 }
3340 3332
3341 if (who->type == PLAYER) 3333 if (who->type == PLAYER)
3342 esrv_send_item (who, tmp2); 3334 esrv_send_item (who, tmp2);
3370 who->change_weapon (pl->combat_ob = item); 3362 who->change_weapon (pl->combat_ob = item);
3371 goto found_weapon; 3363 goto found_weapon;
3372 } 3364 }
3373 } 3365 }
3374 3366
3375 new_draw_info_format (NDI_UNIQUE, 0, who, 3367 who->failmsg (format (
3376 "You need to apply a '%s' melee weapon before readying this skill. " 3368 "You need to apply a '%s' melee weapon before readying this skill. "
3377 "H<Some skills need an item, in this case a melee weapon, to function.>", 3369 "H<Some skills need an item, in this case a melee weapon, to function.>",
3378 &op->skill); 3370 &op->skill
3371 ));
3379 return 1; 3372 return 1;
3380 3373
3381 found_weapon:; 3374 found_weapon:;
3382 } 3375 }
3383 else 3376 else
3393 //TODO: bows should/must all have skill missile weapon right now 3386 //TODO: bows should/must all have skill missile weapon right now
3394 who->change_weapon (pl->ranged_ob = item); 3387 who->change_weapon (pl->ranged_ob = item);
3395 goto found_bow; 3388 goto found_bow;
3396 } 3389 }
3397 3390
3398 new_draw_info (NDI_UNIQUE, 0, who, 3391 who->failmsg (
3399 "You need to apply a missile weapon before readying this skill. " 3392 "You need to apply a missile weapon before readying this skill. "
3400 "H<Some skills need an item, in this case a missile weapon, to function.>"); 3393 "H<Some skills need an item, in this case a missile weapon, to function.>"
3394 );
3401 return 1; 3395 return 1;
3402 3396
3403 found_bow:; 3397 found_bow:;
3404 } 3398 }
3405 else 3399 else
3406 who->change_weapon (pl->ranged_ob = op); 3400 who->change_weapon (pl->ranged_ob = op);
3407 } 3401 }
3408 3402
3409 if (!op->invisible) 3403 if (!op->invisible)
3410 { 3404 {
3411 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op)); 3405 who->statusmsg (format (
3412 new_draw_info_format (NDI_UNIQUE, 0, who, "You can now use the skill: %s.", &op->skill); 3406 "You ready %s."
3407 "You can now use the skill: %s.",
3408 query_name (op),
3409 &op->skill
3410 ));
3413 } 3411 }
3414 else 3412 else
3415 new_draw_info_format (NDI_UNIQUE, 0, who, "Readied skill: %s.", op->skill ? &op->skill : &op->name); 3413 who->statusmsg (format ("Readied skill: %s.", op->skill ? &op->skill : &op->name));
3416 } 3414 }
3417 else 3415 else
3418 { 3416 {
3419 SET_FLAG (op, FLAG_APPLIED); 3417 SET_FLAG (op, FLAG_APPLIED);
3420 change_abil (who, op); 3418 change_abil (who, op);
3425 break; 3423 break;
3426 3424
3427 case BOW: 3425 case BOW:
3428 if (!check_weapon_power (who, op->last_eat)) 3426 if (!check_weapon_power (who, op->last_eat))
3429 { 3427 {
3430 new_draw_info (NDI_UNIQUE, 0, who,
3431 "That weapon is too powerful for you to use. It would consume your soul!" LACK_ITEM_POWER); 3428 who->failmsg ("That weapon is too powerful for you to use. It would consume your soul!" LACK_ITEM_POWER);
3432 3429
3433 if (tmp) 3430 if (tmp)
3434 insert_ob_in_ob (tmp, who); 3431 insert_ob_in_ob (tmp, who);
3435 3432
3436 return 1; 3433 return 1;
3437 } 3434 }
3438 3435
3439 if (op->level && (strncmp (op->name, who->name, strlen (who->name)))) 3436 if (op->level && (strncmp (op->name, who->name, strlen (who->name))))
3440 { 3437 {
3441 new_draw_info (NDI_UNIQUE, 0, who,
3442 "The weapon does not recognize you as its owner. " 3438 who->failmsg ("The weapon does not recognize you as its owner. "
3443 "H<Its name indicates that it belongs to somebody else.>"); 3439 "H<Its name indicates that it belongs to somebody else.>");
3444 if (tmp) 3440 if (tmp)
3445 insert_ob_in_ob (tmp, who); 3441 insert_ob_in_ob (tmp, who);
3446 3442
3447 return 1; 3443 return 1;
3453 case HORN: 3449 case HORN:
3454 /* check for skill, alter player status */ 3450 /* check for skill, alter player status */
3455 3451
3456 if (!skop) 3452 if (!skop)
3457 { 3453 {
3458 new_draw_info_format (NDI_UNIQUE, 0, who, "The %s is broken, please report this to the dungeon master!", query_name (op));//TODO 3454 who->failmsg (format ("The %s is broken, please report this to the dungeon master!", query_name (op)));//TODO
3459 return 1; 3455 return 1;
3460 } 3456 }
3461 3457
3462 SET_FLAG (op, FLAG_APPLIED); 3458 SET_FLAG (op, FLAG_APPLIED);
3463 who->change_skill (skop); 3459 who->change_skill (skop);
3464 3460
3465 if (who->contr) 3461 if (who->contr)
3466 { 3462 {
3467 who->contr->ranged_ob = op; 3463 who->contr->ranged_ob = op;
3468 3464
3469 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready %s.", query_name (op)); 3465 who->statusmsg (format ("You ready %s.", query_name (op)));
3470 3466
3471 if (op->type == BOW) 3467 if (op->type == BOW)
3472 { 3468 {
3473 who->current_weapon = op; 3469 who->current_weapon = op;
3474 change_abil (who, op); 3470 change_abil (who, op);
3475 new_draw_info_format (NDI_UNIQUE, 0, who,
3476 "You will now fire %s with %s.", op->race ? &op->race : "nothing", query_name (op)); 3471 who->statusmsg (format ("You will now fire %s with %s.", op->race ? &op->race : "nothing", query_name (op)));
3477 } 3472 }
3478 } 3473 }
3479 else 3474 else
3480 { 3475 {
3481 if (op->type == BOW) 3476 if (op->type == BOW)
3491 { 3486 {
3492 //TODO: wtf does this do? shouldn't this be managed automatically (slots?) 3487 //TODO: wtf does this do? shouldn't this be managed automatically (slots?)
3493 if (who->contr->ranged_ob && who->contr->ranged_ob->type == BUILDER) 3488 if (who->contr->ranged_ob && who->contr->ranged_ob->type == BUILDER)
3494 unapply_special (who, who->contr->ranged_ob, 0); 3489 unapply_special (who, who->contr->ranged_ob, 0);
3495 3490
3496 new_draw_info_format (NDI_UNIQUE, 0, who, "You ready your %s.", query_name (op)); 3491 who->statusmsg (format ("You ready your %s.", query_name (op)));
3497 3492
3498 who->contr->ranged_ob = op; 3493 who->contr->ranged_ob = op;
3499 } 3494 }
3500 break; 3495 break;
3501 3496
3502 default: 3497 default:
3503 new_draw_info_format (NDI_UNIQUE, 0, who, "You apply %s.", query_name (op)); 3498 who->statusmsg (format ("You apply %s.", query_name (op)));
3504 } /* end of switch op->type */ 3499 }
3505 3500
3506 SET_FLAG (op, FLAG_APPLIED); 3501 SET_FLAG (op, FLAG_APPLIED);
3507 3502
3508 if (tmp) 3503 if (tmp)
3509 tmp = insert_ob_in_ob (tmp, who); 3504 tmp = insert_ob_in_ob (tmp, who);
3518 SET_FLAG (op, FLAG_BEEN_APPLIED); 3513 SET_FLAG (op, FLAG_BEEN_APPLIED);
3519 3514
3520 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 3515 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
3521 if (who->type == PLAYER) 3516 if (who->type == PLAYER)
3522 { 3517 {
3523 new_draw_info (NDI_UNIQUE, 0, who, 3518 who->failmsg (
3524 "Oops, it feels deadly cold! " 3519 "Oops, it feels deadly cold! "
3525 "H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>"); 3520 "H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>"
3521 );
3526 SET_FLAG (op, FLAG_KNOWN_CURSED); 3522 SET_FLAG (op, FLAG_KNOWN_CURSED);
3527 } 3523 }
3528 3524
3529 if (who->type == PLAYER) 3525 if (who->type == PLAYER)
3530 { 3526 {
3768 { 3764 {
3769 if (QUERY_FLAG (food, FLAG_CURSED)) 3765 if (QUERY_FLAG (food, FLAG_CURSED))
3770 { 3766 {
3771 assign (who->contr->killer, food->name); 3767 assign (who->contr->killer, food->name);
3772 hit_player (who, food->stats.hp, food, AT_POISON, 1); 3768 hit_player (who, food->stats.hp, food, AT_POISON, 1);
3773 new_draw_info (NDI_UNIQUE, 0, who, "Eck!...that was poisonous!"); 3769 who->failmsg ("Eck!...that was poisonous!");
3774 } 3770 }
3775 else 3771 else
3776 { 3772 {
3777 if (food->stats.hp > 0) 3773 if (food->stats.hp > 0)
3778 new_draw_info (NDI_UNIQUE, 0, who, "You begin to feel better."); 3774 who->statusmsg ("You begin to feel better.");
3779 else 3775 else
3780 new_draw_info (NDI_UNIQUE, 0, who, "Eck!...that was poisonous!"); 3776 who->failmsg ("Eck!...that was poisonous!");
3777
3781 who->stats.hp += food->stats.hp; 3778 who->stats.hp += food->stats.hp;
3782 } 3779 }
3783 } 3780 }
3784 if (food->stats.sp != 0) 3781 if (food->stats.sp != 0)
3785 { 3782 {
3786 if (QUERY_FLAG (food, FLAG_CURSED)) 3783 if (QUERY_FLAG (food, FLAG_CURSED))
3787 { 3784 {
3788 new_draw_info (NDI_UNIQUE, 0, who, "You are drained of mana!"); 3785 who->failmsg ("You are drained of mana!");
3789 who->stats.sp -= food->stats.sp; 3786 who->stats.sp -= food->stats.sp;
3790 if (who->stats.sp < 0) 3787 if (who->stats.sp < 0)
3791 who->stats.sp = 0; 3788 who->stats.sp = 0;
3792 } 3789 }
3793 else 3790 else
3794 { 3791 {
3795 new_draw_info (NDI_UNIQUE, 0, who, "You feel a rush of magical energy!"); 3792 who->statusmsg ("You feel a rush of magical energy!");
3796 who->stats.sp += food->stats.sp; 3793 who->stats.sp += food->stats.sp;
3797 /* place limit on max sp from food? */ 3794 /* place limit on max sp from food? */
3798 } 3795 }
3799 } 3796 }
3797
3800 who->update_stats (); 3798 who->update_stats ();
3801} 3799}
3802 3800
3803/** 3801/**
3804 * Designed primarily to light torches/lanterns/etc. 3802 * Designed primarily to light torches/lanterns/etc.
3831 } 3829 }
3832 else 3830 else
3833 lighter->stats.food--; 3831 lighter->stats.food--;
3834 } 3832 }
3835 else if (lighter->last_eat) 3833 else if (lighter->last_eat)
3834 {
3836 { /* no charges left in lighter */ 3835 /* no charges left in lighter */
3837 new_draw_info_format (NDI_UNIQUE, 0, who, "You attempt to light the %s with a used up %s.", &item->name, &lighter->name); 3836 who->failmsg (format ("You attempt to light the %s with a used up %s.", &item->name, &lighter->name));
3838 return; 3837 return;
3839 } 3838 }
3840 3839
3841 /* Perhaps we should split what we are trying to light on fire? 3840 /* Perhaps we should split what we are trying to light on fire?
3842 * I can't see many times when you would want to light multiple 3841 * I can't see many times when you would want to light multiple
3848 3847
3849 save_throw_object (item, AT_FIRE, who); 3848 save_throw_object (item, AT_FIRE, who);
3850 3849
3851 if (item->destroyed ()) 3850 if (item->destroyed ())
3852 { 3851 {
3853 new_draw_info_format (NDI_UNIQUE, 0, who, "You light the %s with the %s.", &item->name, &lighter->name); 3852 who->statusmsg (format ("You light the %s with the %s.", &item->name, &lighter->name));
3854 /* Need to update the player so that the players glow radius 3853 /* Need to update the player so that the players glow radius
3855 * gets changed. 3854 * gets changed.
3856 */ 3855 */
3857 if (is_player_env) 3856 if (is_player_env)
3858 who->update_stats (); 3857 who->update_stats ();
3859 } 3858 }
3860 else 3859 else
3861 new_draw_info_format (NDI_UNIQUE, 0, who, "You attempt to light the %s with the %s and fail.", &item->name, &lighter->name); 3860 who->failmsg (format ("You attempt to light the %s with the %s and fail.", &item->name, &lighter->name));
3862 } 3861 }
3863 else /* nothing to light */ 3862 else
3864 new_draw_info (NDI_UNIQUE, 0, who, "You need to mark a lightable object."); 3863 who->failmsg ("You need to mark a lightable object.");
3865 3864
3866} 3865}
3867 3866
3868/** 3867/**
3869 * op made some mistake with a scroll, this takes care of punishment. 3868 * op made some mistake with a scroll, this takes care of punishment.
3877 3876
3878 if (failure <= -1 && failure > -15) 3877 if (failure <= -1 && failure > -15)
3879 { /* wonder */ 3878 { /* wonder */
3880 object *tmp; 3879 object *tmp;
3881 3880
3882 new_draw_info (NDI_UNIQUE, 0, op, "Your spell warps!"); 3881 op->failmsg ("Your spell warps!");
3883 tmp = get_archetype (SPELL_WONDER); 3882 tmp = get_archetype (SPELL_WONDER);
3884 cast_wonder (op, op, 0, tmp); 3883 cast_wonder (op, op, 0, tmp);
3885 tmp->destroy (); 3884 tmp->destroy ();
3886 } 3885 }
3887 else if (failure <= -15 && failure > -35) 3886 else if (failure <= -15 && failure > -35)
3888 { /* drain mana */ 3887 { /* drain mana */
3889 new_draw_info (NDI_UNIQUE, 0, op, "Your mana is drained!."); 3888 op->failmsg ("Your mana is drained!");
3890 op->stats.sp -= random_roll (0, power - 1, op, PREFER_LOW); 3889 op->stats.sp -= random_roll (0, power - 1, op, PREFER_LOW);
3891 if (op->stats.sp < 0) 3890 if (op->stats.sp < 0)
3892 op->stats.sp = 0; 3891 op->stats.sp = 0;
3893 } 3892 }
3894 else if (settings.spell_failure_effects == TRUE) 3893 else if (settings.spell_failure_effects == TRUE)
3895 { 3894 {
3896 if (failure <= -35 && failure > -60) 3895 if (failure <= -35 && failure > -60)
3897 { /* confusion */ 3896 { /* confusion */
3898 new_draw_info (NDI_UNIQUE, 0, op, "The magic recoils on you!"); 3897 op->failmsg ("The magic recoils on you!");
3899 confuse_player (op, op, power); 3898 confuse_player (op, op, power);
3900 } 3899 }
3901 else if (failure <= -60 && failure > -70) 3900 else if (failure <= -60 && failure > -70)
3902 { /* paralysis */ 3901 { /* paralysis */
3903 new_draw_info (NDI_UNIQUE, 0, op, "The magic recoils and paralyzes " "you!"); 3902 op->failmsg ("The magic recoils and paralyzes you!");
3904 paralyze_player (op, op, power); 3903 paralyze_player (op, op, power);
3905 } 3904 }
3906 else if (failure <= -70 && failure > -80) 3905 else if (failure <= -70 && failure > -80)
3907 { /* blind */ 3906 { /* blind */
3908 new_draw_info (NDI_UNIQUE, 0, op, "The magic recoils on you!"); 3907 op->failmsg ("The magic recoils on you!");
3909 blind_player (op, op, power); 3908 blind_player (op, op, power);
3910 } 3909 }
3911 else if (failure <= -80) 3910 else if (failure <= -80)
3912 { /* blast the immediate area */ 3911 { /* blast the immediate area */
3913 object *tmp = get_archetype (LOOSE_MANA); 3912 object *tmp = get_archetype (LOOSE_MANA);
3914 cast_magic_storm (op, tmp, power); 3913 cast_magic_storm (op, tmp, power);
3915 new_draw_info (NDI_UNIQUE, 0, op, "You unleash uncontrolled mana!"); 3914 op->failmsg ("You unleash uncontrolled mana!");
3916 tmp->destroy (); 3915 tmp->destroy ();
3917 } 3916 }
3918 } 3917 }
3919} 3918}
3920 3919
4032 4031
4033 marked = find_marked_object (pl); 4032 marked = find_marked_object (pl);
4034 4033
4035 if (!marked) 4034 if (!marked)
4036 { 4035 {
4037 new_draw_info_format (NDI_UNIQUE, 0, pl, "Use the %s with what item?", query_name (transformer)); 4036 pl->failmsg (format ("Use the %s with what item?", query_name (transformer)));
4038 return; 4037 return;
4039 } 4038 }
4040 4039
4041 if (!marked->slaying) 4040 if (!marked->slaying)
4042 { 4041 {
4043 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked)); 4042 pl->failmsg (format ("You can't use the %s with your %s!", query_name (transformer), query_name (marked)));
4044 return; 4043 return;
4045 } 4044 }
4046 4045
4047 /* check whether they are compatible or not */ 4046 /* check whether they are compatible or not */
4048 find = strstr (marked->slaying, transformer->arch->archname); 4047 find = strstr (marked->slaying, transformer->arch->archname);
4049 if (!find || (*(find + strlen (transformer->arch->archname)) != ':')) 4048 if (!find || (*(find + strlen (transformer->arch->archname)) != ':'))
4050 { 4049 {
4051 new_draw_info_format (NDI_UNIQUE, 0, pl, "You can't use the %s with your %s!", query_name (transformer), query_name (marked)); 4050 pl->failmsg (format ("You can't use the %s with your %s!", query_name (transformer), query_name (marked)));
4052 return; 4051 return;
4053 } 4052 }
4054 4053
4055 find += strlen (transformer->arch->archname) + 1; 4054 find += strlen (transformer->arch->archname) + 1;
4056 /* Item can be used, now find how many and what it yields */ 4055 /* Item can be used, now find how many and what it yields */
4066 else 4065 else
4067 yield = 1; 4066 yield = 1;
4068 4067
4069 while (isdigit (*find)) 4068 while (isdigit (*find))
4070 find++; 4069 find++;
4070
4071 while (*find == ' ') 4071 while (*find == ' ')
4072 find++; 4072 find++;
4073 4073
4074 memset (got, 0, MAX_BUF); 4074 memset (got, 0, MAX_BUF);
4075 4075
4086 4086
4087 /* Now create new item, remove used ones when required. */ 4087 /* Now create new item, remove used ones when required. */
4088 new_item = get_archetype (got); 4088 new_item = get_archetype (got);
4089 if (!new_item) 4089 if (!new_item)
4090 { 4090 {
4091 pl->errormsg (format ("This %s is strange, better to not use it.", query_base_name (marked, 0))); 4091 pl->failmsg (format ("This %s is strange, better to not use it.", query_base_name (marked, 0)));
4092 return; 4092 return;
4093 } 4093 }
4094 4094
4095 new_item->nrof = yield; 4095 new_item->nrof = yield;
4096 4096

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines