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.236 by root, Sat Apr 3 17:15:19 2010 UTC vs.
Revision 1.240 by root, Mon Apr 5 20:33:13 2010 UTC

948 item->nrof *= nr; 948 item->nrof *= nr;
949 949
950 if (converter->flag [FLAG_PRECIOUS]) 950 if (converter->flag [FLAG_PRECIOUS])
951 SET_FLAG (item, FLAG_UNPAID); 951 SET_FLAG (item, FLAG_UNPAID);
952 952
953 if (is_in_shop (converter)) 953 if (converter->is_in_shop ())
954 { 954 {
955 // converters on shop floors don't work anymore, bug lets check for it 955 // converters on shop floors don't work anymore, bug lets check for it
956 // and report in case someone still does it. 956 // and report in case someone still does it.
957 LOG (llevDebug, "ITEMBUG: broken converter, converters on shop floor don't work: %s\n", 957 LOG (llevDebug, "ITEMBUG: broken converter, converters on shop floor don't work: %s\n",
958 converter->debug_desc ()); 958 converter->debug_desc ());
1161 /* this is only used for players */ 1161 /* this is only used for players */
1162 rv = teleport (shop_mat, SHOP_MAT, op); 1162 rv = teleport (shop_mat, SHOP_MAT, op);
1163 1163
1164 if (has_unpaid) 1164 if (has_unpaid)
1165 op->contr->play_sound (sound_find ("shop_buy")); 1165 op->contr->play_sound (sound_find ("shop_buy"));
1166 else if (is_in_shop (op)) 1166 else if (op->is_in_shop ())
1167 op->contr->play_sound (sound_find ("shop_enter")); 1167 op->contr->play_sound (sound_find ("shop_enter"));
1168 else 1168 else
1169 op->contr->play_sound (sound_find ("shop_leave")); 1169 op->contr->play_sound (sound_find ("shop_leave"));
1170 1170
1171 if (shop_mat->msg) 1171 if (shop_mat->msg)
1172 op->statusmsg (shop_mat->msg); 1172 op->statusmsg (shop_mat->msg);
1173 /* This check below is a bit simplistic - generally it should be correct, 1173 /* This check below is a bit simplistic - generally it should be correct,
1174 * but there is never a guarantee that the bottom space on the map is 1174 * but there is never a guarantee that the bottom space on the map is
1175 * actually the shop floor. 1175 * actually the shop floor.
1176 */ 1176 */
1177 else if (!rv && !is_in_shop (op)) 1177 else if (!rv && !op->is_in_shop ())
1178 { 1178 {
1179 opinion = shopkeeper_approval (op->map, op); 1179 opinion = shopkeeper_approval (op->map, op);
1180 1180
1181 op->statusmsg ( 1181 op->statusmsg (
1182 opinion >= 0.90 ? "The shopkeeper gives you a friendly wave." 1182 opinion >= 0.90 ? "The shopkeeper gives you a friendly wave."
1805 op->failmsg (format ("You are unable to decipher the strange symbols. H<Your %s level is too low, it must be at least %d.>", 1805 op->failmsg (format ("You are unable to decipher the strange symbols. H<Your %s level is too low, it must be at least %d.>",
1806 &tmp->skill, learn_level)); 1806 &tmp->skill, learn_level));
1807 return; 1807 return;
1808 } 1808 }
1809 1809
1810 op->statusmsg (format ("The spellbook contains the %s level spell %s.", get_levelnumber (spell->level), &spell->name)); 1810 op->statusmsg (format ("The spellbook contains the %s level spell %s.", ordinal (spell->level), &spell->name));
1811 1811
1812 if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED)) 1812 if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED))
1813 identify (tmp); 1813 identify (tmp);
1814 1814
1815 /* I removed the check for special_prayer_mark here - it didn't make 1815 /* I removed the check for special_prayer_mark here - it didn't make
2631static int 2631static int
2632manual_apply (object *who, object *op, int aflag) 2632manual_apply (object *who, object *op, int aflag)
2633{ 2633{
2634 op = op->head_ (); 2634 op = op->head_ ();
2635 2635
2636 if (QUERY_FLAG (op, FLAG_UNPAID) && !QUERY_FLAG (op, FLAG_APPLIED)) 2636 if (op->flag [FLAG_UNPAID] && !op->flag [FLAG_APPLIED])
2637 { 2637 {
2638 if (who->type == PLAYER) 2638 if (who->type == PLAYER)
2639 { 2639 {
2640 examine (who, op); 2640 examine (who, op);
2641 //who->failmsg ("You should pay for it first! H<You cannot use items marked as unpaid.>");//TODO remove 2641 //who->failmsg ("You should pay for it first! H<You cannot use items marked as unpaid.>");//TODO remove
3524 //TODO: unapplying should unapply the skill, though 3524 //TODO: unapplying should unapply the skill, though
3525 SET_FLAG (op, FLAG_APPLIED); 3525 SET_FLAG (op, FLAG_APPLIED);
3526 break; 3526 break;
3527 3527
3528 case SKILL: 3528 case SKILL:
3529 if (skill_flags [op->subtype] & SF_NEED_ITEM && !(aflags & AP_NO_SLOT)) 3529 if (!(aflags & AP_NO_SLOT))
3530 { 3530 {
3531 // skill is used on it's own, as opposed to being a chosen_skill
3532
3533 if (skill_flags [op->subtype] & (SF_NEED_ITEM | SF_MANA))
3534 {
3531 who->failmsg (format ( 3535 who->failmsg (format (
3532 "You feel as if you wanted to do something funny, but you can't remember what. " 3536 "You feel as if you wanted to do something funny, but you can't remember what. "
3533 "H<The %s skill needs an item to function, it cannot be used on its own.>", 3537 "H<The %s skill needs something else to function, for example a tool, weapon, rod, or spell. "
3538 "It cannot be used on its own.>",
3534 &op->skill 3539 &op->skill
3535 )); 3540 ));
3536 if (tmp) who->insert (tmp); 3541 if (tmp) who->insert (tmp);
3537 return 1; 3542 return 1;
3538 } 3543 }
3539 3544
3540 if (player *pl = who->contr) 3545 if (skill_flags [op->subtype] & SF_AUTARK
3546 || !(skill_flags [op->subtype] & (SF_COMBAT | SF_RANGED)))
3541 { 3547 {
3542 if (op->invisible) 3548 if (skill_flags [op->subtype] & SF_USE)
3543 who->statusmsg (format ("Readied skill: %s.", op->skill ? &op->skill : &op->name)); 3549 who->failmsg (format (
3550 "You feel as if you wanted to do something funny, but you can't remember what. "
3551 "H<The %s skill cannot be readied, instead, try C<use_skill %s>.>",
3552 &op->skill, &op->skill
3553 ));
3544 else 3554 else
3555 who->failmsg (format (
3556 "You feel as if you wanted to do something funny, but you can't remember what. "
3557 "H<The %s skill cannot be readied or used, it is always active.>",
3558 &op->skill, &op->skill
3559 ));
3560
3561 if (tmp) who->insert (tmp);
3562 return 1;
3563 }
3564
3565 if (who->contr)
3545 who->statusmsg (format ( 3566 who->statusmsg (format (
3546 "You ready %s." 3567 op->invisible ? "You can now use the %s skill." : "You ready %s.",
3547 "You can now use the %s skill.",
3548 query_name (op), 3568 query_name (op),
3549 &op->skill 3569 &op->skill
3550 )); 3570 ));
3551 } 3571 }
3552 3572

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines