version 1.41 | | version 1.42 |
---|
| | |
/* | | /* |
* static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
* "$Id: shop.c,v 1.41 2005/10/04 04:39:19 cavesomething Exp $"; | | * "$Id: shop.c,v 1.42 2005/10/04 17:16:05 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* (we need a +1 there in case we would otherwise be dividing by zero. | | * (we need a +1 there in case we would otherwise be dividing by zero. |
*/ | | */ |
if (approximate) | | if (approximate) |
val = val + (sint64)(val*(sin(tmp->count)/sqrt(lev_bargain+lev_identify*2+1.0))); | | val = (sint64)val + (sint64)((sint64)val*(sin(tmp->count)/sqrt(lev_bargain+lev_identify*2+1.0))); |
} | | } |
| | |
/* I don't think this should really happen - if it does, it indicates and | | /* I don't think this should really happen - if it does, it indicates and |
| | |
/* if we are in a shop, check how the type of shop should affect the price */ | | /* if we are in a shop, check how the type of shop should affect the price */ |
if (shop) { | | if (shop) { |
if (flag==F_SELL) | | if (flag==F_SELL) |
val=val*shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who) | | val=(sint64)val*shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who) |
/shop_greed(who->map); | | /shop_greed(who->map); |
else if (flag==F_BUY) { | | else if (flag==F_BUY) { |
/* | | /* |
| | |
* antiques in a junk shop in real life). | | * antiques in a junk shop in real life). |
*/ | | */ |
if (QUERY_FLAG(tmp, FLAG_PLAYER_SOLD)) | | if (QUERY_FLAG(tmp, FLAG_PLAYER_SOLD)) |
val=val*shop_greed(who->map)*shop_specialisation_ratio(tmp, who->map) | | val=(sint64)val*shop_greed(who->map)*shop_specialisation_ratio(tmp, who->map) |
/shopkeeper_approval(who->map, who); | | /shopkeeper_approval(who->map, who); |
else | | else |
val=val*shop_greed(who->map) | | val=(sint64)val*shop_greed(who->map) |
/(shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who)); | | /(shop_specialisation_ratio(tmp, who->map)*shopkeeper_approval(who->map, who)); |
} | | } |
/* we will also have an extra 0-5% variation between shops of the same type | | /* we will also have an extra 0-5% variation between shops of the same type |
| | |
* pointful, and could give fun with rounding. | | * pointful, and could give fun with rounding. |
*/ | | */ |
if(who->map->path!=NULL && val > 50) | | if(who->map->path!=NULL && val > 50) |
val=val+0.05*val*cos(tmp->count+strlen(who->map->path)); | | val=(sint64)val+0.05*(sint64)val*cos(tmp->count+strlen(who->map->path)); |
} | | } |
return val; | | return val; |
} | | } |
| | |
} | | } |
else new_draw_info(NDI_UNIQUE,0,op,"There is no shop nearby."); | | else new_draw_info(NDI_UNIQUE,0,op,"There is no shop nearby."); |
| | |
| | return 1; |
} | | } |
typedef struct shopinv { | | typedef struct shopinv { |
char *item_sort; | | char *item_sort; |