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.1.1.2 by elmex, Wed Feb 22 18:03:18 2006 UTC vs.
Revision 1.9 by root, Sun Jun 11 05:05:53 2006 UTC

1/* 1/*
2 * static char *rcsid_apply_c = 2 * static char *rcsid_apply_c =
3 * "$Id: apply.c,v 1.1.1.2 2006/02/22 18:03:18 elmex Exp $"; 3 * "$Id: apply.c,v 1.9 2006/06/11 05:05:53 root Exp $";
4 */ 4 */
5/* 5/*
6 CrossFire, A Multiplayer game for X-windows 6 CrossFire, A Multiplayer game for X-windows
7 7
8 Copyright (C) 2001 Mark Wedel & Crossfire Development Team 8 Copyright (C) 2001 Mark Wedel & Crossfire Development Team
981 * convert_item() returns 1 if anything was converted, 0 if the item was not 981 * convert_item() returns 1 if anything was converted, 0 if the item was not
982 * what the converter wants, -1 if the converter is broken. 982 * what the converter wants, -1 if the converter is broken.
983 */ 983 */
984#define CONV_FROM(xyz) xyz->slaying 984#define CONV_FROM(xyz) xyz->slaying
985#define CONV_TO(xyz) xyz->other_arch 985#define CONV_TO(xyz) xyz->other_arch
986#define CONV_NR(xyz) (unsigned char) xyz->stats.sp 986#define CONV_NR(xyz) xyz->stats.sp
987#define CONV_NEED(xyz) (unsigned long) xyz->stats.food 987#define CONV_NEED(xyz) xyz->stats.food
988 988
989/* Takes one items and makes another. 989/* Takes one items and makes another.
990 * converter is the object that is doing the conversion. 990 * converter is the object that is doing the conversion.
991 * item is the object that triggered the converter - if it is not 991 * item is the object that triggered the converter - if it is not
992 * what the converter wants, this will not do anything. 992 * what the converter wants, this will not do anything.
1070 if(nr) 1070 if(nr)
1071 item->nrof*=nr; 1071 item->nrof*=nr;
1072 if(is_in_shop) 1072 if(is_in_shop)
1073 SET_FLAG(item,FLAG_UNPAID); 1073 SET_FLAG(item,FLAG_UNPAID);
1074 else if(price_in < item->nrof*item->value) { 1074 else if(price_in < item->nrof*item->value) {
1075 LOG(llevError, "Broken converter %s at %s (%d, %d) in value %d, out value %d for %s\n", 1075 LOG(llevDebug, "converter output price higher than input: %s at %s (%d, %d) in value %d, out value %d for %s\n",
1076 converter->name, converter->map->path, converter->x, converter->y, price_in, 1076 converter->name, converter->map->path, converter->x, converter->y, price_in,
1077 item->nrof*item->value, item->name); 1077 item->nrof*item->value, item->name);
1078 free_object(item); 1078 /**
1079 return -1; 1079 * elmex: we are going to let the game continue, as the mapcreator
1080 * propably had something in mind when doing this
1081 */
1080 } 1082 }
1081 insert_ob_in_map_at(item, converter->map, converter, 0, converter->x, converter->y); 1083 insert_ob_in_map_at(item, converter->map, converter, 0, converter->x, converter->y);
1082 return 1; 1084 return 1;
1083} 1085}
1084 1086
2348 return 1; 2350 return 1;
2349} 2351}
2350 2352
2351static void apply_savebed (object *pl) 2353static void apply_savebed (object *pl)
2352{ 2354{
2355#ifndef COZY_SERVER
2353 if(!pl->contr->name_changed||!pl->stats.exp) { 2356 if(!pl->contr->name_changed||!pl->stats.exp) {
2354 new_draw_info(NDI_UNIQUE, 0,pl,"You don't deserve to save your character yet."); 2357 new_draw_info(NDI_UNIQUE, 0,pl,"You don't deserve to save your character yet.");
2355 return; 2358 return;
2356 } 2359 }
2357 if(QUERY_FLAG(pl,FLAG_WAS_WIZ)) { 2360#endif
2358 new_draw_info(NDI_UNIQUE, 0,pl,"Since you have cheated you can't save.");
2359 return;
2360 }
2361 2361
2362 /* Lauwenmark : Here we handle the LOGOUT global event */ 2362 /* Lauwenmark : Here we handle the LOGOUT global event */
2363 execute_global_event(EVENT_LOGOUT, pl->contr, pl->contr->socket.host); 2363 execute_global_event(EVENT_LOGOUT, pl->contr, pl->contr->socket.host);
2364 2364
2365 /* Need to call terminate_all_pets() before we remove the player ob */ 2365 /* Need to call terminate_all_pets() before we remove the player ob */
3053#endif 3053#endif
3054 return 1; 3054 return 1;
3055 } 3055 }
3056 /* If we are just printing, we don't care about cursed status */ 3056 /* If we are just printing, we don't care about cursed status */
3057 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) || 3057 if ((aflags & AP_IGNORE_CURSE) || (aflags & AP_PRINT) ||
3058 (!(QUERY_FLAG(tmp, FLAG_CURSED) && !QUERY_FLAG(tmp, FLAG_DAMNED)))) { 3058 (!(QUERY_FLAG(tmp, FLAG_CURSED) || QUERY_FLAG(tmp, FLAG_DAMNED)))) {
3059 if (aflags & AP_PRINT) 3059 if (aflags & AP_PRINT)
3060 new_draw_info(NDI_UNIQUE, 0, who, query_name(tmp)); 3060 new_draw_info(NDI_UNIQUE, 0, who, query_name(tmp));
3061 else 3061 else
3062 unapply_special(who, tmp, aflags); 3062 unapply_special(who, tmp, aflags);
3063 } 3063 }
3207} 3207}
3208 3208
3209 3209
3210 3210
3211/** 3211/**
3212 * who is the object using the object. It can be a monster 3212 * who is the object using the object. It can be a monster.
3213 * op is the object they are using. op is an equipment type item, 3213 * op is the object they are using. op is an equipment type item,
3214 * eg, one which you put on and keep on for a while, and not something 3214 * eg, one which you put on and keep on for a while, and not something
3215 * like a potion or scroll. 3215 * like a potion or scroll.
3216 * 3216 *
3217 * function returns 1 if the action could not be completed, 0 on 3217 * function returns 1 if the action could not be completed, 0 on

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines