… | |
… | |
995 | item->nrof = give; |
995 | item->nrof = give; |
996 | |
996 | |
997 | if (nr) |
997 | if (nr) |
998 | item->nrof *= nr; |
998 | item->nrof *= nr; |
999 | |
999 | |
1000 | if (is_in_shop (converter)) |
1000 | if (converter->flag [FLAG_PRECIOUS]) |
1001 | SET_FLAG (item, FLAG_UNPAID); |
1001 | SET_FLAG (item, FLAG_UNPAID); |
|
|
1002 | |
|
|
1003 | if (is_in_shop (converter)) |
|
|
1004 | { |
|
|
1005 | // converters on shop floors don't work anymore, bug lets check for it |
|
|
1006 | // and report in case someone still does it. |
|
|
1007 | LOG (llevDebug, "ITEMBUG: broken converter, converters on shop floor don't work: %s\n", |
|
|
1008 | converter->debug_desc ()); |
|
|
1009 | SET_FLAG (item, FLAG_UNPAID); |
|
|
1010 | } |
1002 | else if (price_in < sint64 (item->nrof) * item->value) |
1011 | else if (price_in < sint64 (item->nrof) * item->value) |
1003 | { |
1012 | { |
1004 | LOG (llevDebug, "converter output price higher than input: %s at %s (%d, %d) in value %d, out value %d for %s\n", |
1013 | LOG (llevDebug, "converter output price higher than input: %s at %s (%d, %d) in value %d, out value %d for %s\n", |
1005 | &converter->name, &converter->map->path, converter->x, converter->y, price_in, item->nrof * item->value, &item->name); |
1014 | &converter->name, &converter->map->path, converter->x, converter->y, price_in, item->nrof * item->value, &item->name); |
1006 | /** |
1015 | /** |
… | |
… | |
1305 | if (sign->sound) |
1314 | if (sign->sound) |
1306 | ns->play_sound (sign->sound); |
1315 | ns->play_sound (sign->sound); |
1307 | else if (autoapply) |
1316 | else if (autoapply) |
1308 | ns->play_sound (sound_find ("msg_voice")); |
1317 | ns->play_sound (sound_find ("msg_voice")); |
1309 | |
1318 | |
1310 | if (ns->can_msg) |
|
|
1311 | op->contr->infobox (MSG_CHANNEL ("examine"), format ("T<%s>\n\n%s", &sign->name, &sign->msg)); |
1319 | op->contr->infobox (MSG_CHANNEL ("examine"), format ("T<%s>\n\n%s", &sign->name, &sign->msg)); |
1312 | else |
|
|
1313 | { |
|
|
1314 | readable_message_type *msgType = get_readable_message_type (sign); |
|
|
1315 | const char *somemsg = format ("%u %s", autoapply ? 1 : 0, &sign->msg); |
|
|
1316 | draw_ext_info (NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, somemsg, &sign->msg); |
|
|
1317 | } |
|
|
1318 | } |
1320 | } |
1319 | } |
1321 | } |
1320 | |
1322 | |
1321 | static void |
1323 | static void |
1322 | move_apply_hole (object *trap, object *victim) |
1324 | move_apply_hole (object *trap, object *victim) |
… | |
… | |
1626 | |
1628 | |
1627 | readable_message_type *msgType = get_readable_message_type (tmp); |
1629 | readable_message_type *msgType = get_readable_message_type (tmp); |
1628 | |
1630 | |
1629 | if (player *pl = op->contr) |
1631 | if (player *pl = op->contr) |
1630 | if (client *ns = pl->ns) |
1632 | if (client *ns = pl->ns) |
1631 | if (ns->can_msg) |
|
|
1632 | pl->infobox (MSG_CHANNEL ("book"), format ("T<%s>\n\n%s", (char *)long_desc (tmp, op), &tmp->msg)); |
1633 | pl->infobox (MSG_CHANNEL ("book"), format ("T<%s>\n\n%s", (char *)long_desc (tmp, op), &tmp->msg)); |
1633 | else |
|
|
1634 | draw_ext_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, |
|
|
1635 | msgType->message_type, msgType->message_subtype, |
|
|
1636 | "You open the %s and start reading.\n%s", (char *)"%s\n%s", |
|
|
1637 | long_desc (tmp, op), &tmp->msg); |
|
|
1638 | |
1634 | |
1639 | /* gain xp from reading */ |
1635 | /* gain xp from reading */ |
1640 | if (!QUERY_FLAG (tmp, FLAG_NO_SKILL_IDENT)) |
1636 | if (!QUERY_FLAG (tmp, FLAG_NO_SKILL_IDENT)) |
1641 | { /* only if not read before */ |
1637 | { /* only if not read before */ |
1642 | int exp_gain = calc_skill_exp (op, tmp, skill_ob); |
1638 | int exp_gain = calc_skill_exp (op, tmp, skill_ob); |
… | |
… | |
2170 | op->statusmsg (buf); |
2166 | op->statusmsg (buf); |
2171 | |
2167 | |
2172 | /* now choose a winner if we have any */ |
2168 | /* now choose a winner if we have any */ |
2173 | i = -1; |
2169 | i = -1; |
2174 | if (winners > 0) |
2170 | if (winners > 0) |
2175 | i = atnr_winner[RANDOM () % winners]; |
2171 | i = atnr_winner [rndm (winners)]; |
2176 | |
2172 | |
2177 | if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) |
2173 | if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) |
2178 | { |
2174 | { |
2179 | /* resistance increased! */ |
2175 | /* resistance increased! */ |
2180 | skin->resist[i]++; |
2176 | skin->resist[i]++; |
… | |
… | |
2660 | * person moving on it, also activate. Added code to make it |
2656 | * person moving on it, also activate. Added code to make it |
2661 | * so that at least one of players movement types be that which |
2657 | * so that at least one of players movement types be that which |
2662 | * the item needs. |
2658 | * the item needs. |
2663 | */ |
2659 | */ |
2664 | if (!tmp->invisible || (tmp->move_on & pl->move_type)) |
2660 | if (!tmp->invisible || (tmp->move_on & pl->move_type)) |
2665 | { |
|
|
2666 | if (player_apply (pl, tmp, 0, 1) == 1) |
2661 | if (player_apply (pl, tmp, 0, 1) == 1) |
2667 | return; |
2662 | return; |
2668 | } |
2663 | |
2669 | if (floors >= 2) |
2664 | if (floors >= 2) |
2670 | return; /* process at most two floor objects */ |
2665 | return; /* process at most two floor objects */ |
2671 | } |
2666 | } |
2672 | } |
2667 | } |
2673 | |
2668 | |
… | |
… | |
2767 | op->destroy (); |
2762 | op->destroy (); |
2768 | who->insert (tmp2); |
2763 | who->insert (tmp2); |
2769 | who->update_stats (); |
2764 | who->update_stats (); |
2770 | |
2765 | |
2771 | if (who->contr) |
2766 | if (who->contr) |
2772 | { |
|
|
2773 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
2767 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
2774 | { |
2768 | { |
2775 | who->failmsg ("Oops, it feels deadly cold!"); |
2769 | who->failmsg ("Oops, it feels deadly cold!"); |
2776 | SET_FLAG (tmp2, FLAG_KNOWN_CURSED); |
2770 | SET_FLAG (tmp2, FLAG_KNOWN_CURSED); |
2777 | } |
2771 | } |
2778 | } |
|
|
2779 | } |
2772 | } |
2780 | |
2773 | |
2781 | return 1; /* otherwise, an attempt to drop causes problems */ |
2774 | return 1; /* otherwise, an attempt to drop causes problems */ |
2782 | |
2775 | |
2783 | case BOW: |
2776 | case BOW: |
… | |
… | |
3305 | who->update_stats (); |
3298 | who->update_stats (); |
3306 | |
3299 | |
3307 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
3300 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
3308 | if (who->type == PLAYER) |
3301 | if (who->type == PLAYER) |
3309 | { |
3302 | { |
3310 | who->failmsg ("Oops, it feels deadly cold! H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>"); |
3303 | who->failmsg ("Oops, it feels deadly cold! H<Maybe it wasn't such a bright (hrhrhr) idea to apply this cursed or damned item.>"); |
3311 | SET_FLAG (tmp2, FLAG_KNOWN_CURSED); |
3304 | SET_FLAG (tmp2, FLAG_KNOWN_CURSED); |
3312 | } |
3305 | } |
3313 | |
3306 | |
3314 | return 0; |
3307 | return 0; |
3315 | |
3308 | |
… | |
… | |
3493 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
3486 | if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) |
3494 | if (who->type == PLAYER) |
3487 | if (who->type == PLAYER) |
3495 | { |
3488 | { |
3496 | who->failmsg ( |
3489 | who->failmsg ( |
3497 | "Oops, it feels deadly cold! " |
3490 | "Oops, it feels deadly cold! " |
3498 | "H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>" |
3491 | "H<Maybe it wasn't such a bright idea to apply this cursed or damned item.>" |
3499 | ); |
3492 | ); |
3500 | SET_FLAG (op, FLAG_KNOWN_CURSED); |
3493 | SET_FLAG (op, FLAG_KNOWN_CURSED); |
3501 | } |
3494 | } |
3502 | |
3495 | |
3503 | if (object *pl = op->visible_to ()) |
3496 | if (object *pl = op->visible_to ()) |