1 | /* |
1 | /* |
2 | * static char *rcsid_shop_c = |
2 | * static char *rcsid_shop_c = |
3 | * "$Id: shop.C,v 1.4 2006/08/26 23:36:34 root Exp $"; |
3 | * "$Id: shop.C,v 1.5 2006/08/29 07:34:00 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
181 | val/=50; |
181 | val/=50; |
182 | } |
182 | } |
183 | |
183 | |
184 | /* Limit amount of money you can get for really great items. */ |
184 | /* Limit amount of money you can get for really great items. */ |
185 | if (flag==F_SELL) |
185 | if (flag==F_SELL) |
186 | val=value_limit(val, number, who, shop); |
186 | val=value_limit((uint64)val, number, who, shop); |
187 | |
187 | |
188 | // use a nonlinear price adjustment. as my predecessor said, don't change |
188 | // use a nonlinear price adjustment. as my predecessor said, don't change |
189 | // the archetypes, its work required for balancing, and we don't care. |
189 | // the archetypes, its work required for balancing, and we don't care. |
190 | //val = pow (val, 1.05); |
190 | //val = pow (val, 1.05); |
191 | |
191 | |
… | |
… | |
239 | else if (flag == F_SELL) val -= (val * diff); |
239 | else if (flag == F_SELL) val -= (val * diff); |
240 | |
240 | |
241 | // now find a price range. the less good we can judge, the larger the range is |
241 | // now find a price range. the less good we can judge, the larger the range is |
242 | // then the range is adjusted randomly around the correct value |
242 | // then the range is adjusted randomly around the correct value |
243 | if (approximate) |
243 | if (approximate) |
244 | approx_range = (val / sqrt (lev_identify * 3 + 1)); |
244 | approx_range = uint64 (val / sqrt (lev_identify * 3 + 1)); |
245 | } |
245 | } |
246 | |
246 | |
247 | /* I don't think this should really happen - if it does, it indicates and |
247 | /* I don't think this should really happen - if it does, it indicates and |
248 | * overflow of diff above. That shoudl only happen if |
248 | * overflow of diff above. That shoudl only happen if |
249 | * we are selling objects - in that case, the person just |
249 | * we are selling objects - in that case, the person just |
… | |
… | |
299 | * pointful, and could give fun with rounding. |
299 | * pointful, and could give fun with rounding. |
300 | */ |
300 | */ |
301 | if(who->map->path!=NULL && val > 50) |
301 | if(who->map->path!=NULL && val > 50) |
302 | val= (val+0.05*(sint64)val*cos(tmp->count+strlen(who->map->path))); |
302 | val= (val+0.05*(sint64)val*cos(tmp->count+strlen(who->map->path))); |
303 | } |
303 | } |
304 | return val; |
304 | return (uint64)val; |
305 | } |
305 | } |
306 | |
306 | |
307 | /* Find the coin type that is worth more the 'c'. Starts at the |
307 | /* Find the coin type that is worth more the 'c'. Starts at the |
308 | * cointype placement. |
308 | * cointype placement. |
309 | */ |
309 | */ |