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.172 by root, Mon Sep 29 10:32:50 2008 UTC vs.
Revision 1.175 by root, Sat Dec 27 02:31:19 2008 UTC

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 /**
2170 op->statusmsg (buf); 2179 op->statusmsg (buf);
2171 2180
2172 /* now choose a winner if we have any */ 2181 /* now choose a winner if we have any */
2173 i = -1; 2182 i = -1;
2174 if (winners > 0) 2183 if (winners > 0)
2175 i = atnr_winner[RANDOM () % winners]; 2184 i = atnr_winner [rndm (winners)];
2176 2185
2177 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95) 2186 if (i >= 0 && i < NROFATTACKS && skin->resist[i] < 95)
2178 { 2187 {
2179 /* resistance increased! */ 2188 /* resistance increased! */
2180 skin->resist[i]++; 2189 skin->resist[i]++;
2660 * person moving on it, also activate. Added code to make it 2669 * person moving on it, also activate. Added code to make it
2661 * so that at least one of players movement types be that which 2670 * so that at least one of players movement types be that which
2662 * the item needs. 2671 * the item needs.
2663 */ 2672 */
2664 if (!tmp->invisible || (tmp->move_on & pl->move_type)) 2673 if (!tmp->invisible || (tmp->move_on & pl->move_type))
2665 {
2666 if (player_apply (pl, tmp, 0, 1) == 1) 2674 if (player_apply (pl, tmp, 0, 1) == 1)
2667 return; 2675 return;
2668 } 2676
2669 if (floors >= 2) 2677 if (floors >= 2)
2670 return; /* process at most two floor objects */ 2678 return; /* process at most two floor objects */
2671 } 2679 }
2672} 2680}
2673 2681
2767 op->destroy (); 2775 op->destroy ();
2768 who->insert (tmp2); 2776 who->insert (tmp2);
2769 who->update_stats (); 2777 who->update_stats ();
2770 2778
2771 if (who->contr) 2779 if (who->contr)
2772 {
2773 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 2780 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
2774 { 2781 {
2775 who->failmsg ("Oops, it feels deadly cold!"); 2782 who->failmsg ("Oops, it feels deadly cold!");
2776 SET_FLAG (tmp2, FLAG_KNOWN_CURSED); 2783 SET_FLAG (tmp2, FLAG_KNOWN_CURSED);
2777 } 2784 }
2778 }
2779 } 2785 }
2780 2786
2781 return 1; /* otherwise, an attempt to drop causes problems */ 2787 return 1; /* otherwise, an attempt to drop causes problems */
2782 2788
2783 case BOW: 2789 case BOW:
3305 who->update_stats (); 3311 who->update_stats ();
3306 3312
3307 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 3313 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
3308 if (who->type == PLAYER) 3314 if (who->type == PLAYER)
3309 { 3315 {
3310 who->failmsg ("Oops, it feels deadly cold! H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>"); 3316 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); 3317 SET_FLAG (tmp2, FLAG_KNOWN_CURSED);
3312 } 3318 }
3313 3319
3314 return 0; 3320 return 0;
3315 3321
3493 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED)) 3499 if (QUERY_FLAG (op, FLAG_CURSED) || QUERY_FLAG (op, FLAG_DAMNED))
3494 if (who->type == PLAYER) 3500 if (who->type == PLAYER)
3495 { 3501 {
3496 who->failmsg ( 3502 who->failmsg (
3497 "Oops, it feels deadly cold! " 3503 "Oops, it feels deadly cold! "
3498 "H<Maybe it wasn't such a bright idea to apply this cursed/damned item.>" 3504 "H<Maybe it wasn't such a bright idea to apply this cursed or damned item.>"
3499 ); 3505 );
3500 SET_FLAG (op, FLAG_KNOWN_CURSED); 3506 SET_FLAG (op, FLAG_KNOWN_CURSED);
3501 } 3507 }
3502 3508
3503 if (object *pl = op->visible_to ()) 3509 if (object *pl = op->visible_to ())

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines