… | |
… | |
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." |
… | |
… | |
2936 | switch (op->type) |
2936 | switch (op->type) |
2937 | { |
2937 | { |
2938 | case SKILL: |
2938 | case SKILL: |
2939 | if (player *pl = who->contr) |
2939 | if (player *pl = who->contr) |
2940 | if (op->invisible) |
2940 | if (op->invisible) |
2941 | pl->statusmsg (format ("You can no longer use the skill: %s.", &op->skill)); |
2941 | pl->statusmsg (format ("You can no longer use the %s skill.", &op->skill)); |
2942 | else |
2942 | else |
2943 | pl->statusmsg (format ("You stop using the %s.", query_name (op))); |
2943 | pl->statusmsg (format ("You stop using the %s.", query_name (op))); |
2944 | |
2944 | |
2945 | change_abil (who, op); |
2945 | change_abil (who, op); |
2946 | who->flag [FLAG_READY_SKILL] = false; |
2946 | who->flag [FLAG_READY_SKILL] = false; |
… | |
… | |
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 skill: %s.", |
|
|
3548 | query_name (op), |
3568 | query_name (op), |
3549 | &op->skill |
3569 | &op->skill |
3550 | )); |
3570 | )); |
3551 | } |
3571 | } |
3552 | |
3572 | |