version 1.139 | | version 1.140 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.139 2005/10/01 16:36:35 ryo_saeba Exp $"; | | * "$Id: apply.c,v 1.140 2005/10/03 03:29:41 cavesomething Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
static int apply_shop_mat (object *shop_mat, object *op) | | static int apply_shop_mat (object *shop_mat, object *op) |
{ | | { |
int rv = 0; | | int rv = 0; |
| | double opinion; |
object *tmp, *next; | | object *tmp, *next; |
| | |
SET_FLAG (op,FLAG_NO_APPLY); /* prevent loops */ | | SET_FLAG (op,FLAG_NO_APPLY); /* prevent loops */ |
| | |
*/ | | */ |
else if ( ! rv && (tmp = get_map_ob (op->map, op->x, op->y)) != NULL | | else if ( ! rv && (tmp = get_map_ob (op->map, op->x, op->y)) != NULL |
&& tmp->type != SHOP_FLOOR) { | | && tmp->type != SHOP_FLOOR) { |
new_draw_info (NDI_UNIQUE, 0, op, "Thank you for visiting our shop."); | | opinion = shopkeeper_approval(op->map, op); |
| | if ( opinion > 0.9) |
| | new_draw_info (NDI_UNIQUE, 0, op, "The shopkeeper gives you a friendly wave."); |
| | else if ( opinion > 0.75) |
| | new_draw_info (NDI_UNIQUE, 0, op, "The shopkeeper waves to you."); |
| | else if ( opinion > 0.5) |
| | new_draw_info (NDI_UNIQUE, 0, op, "The shopkeeper ignores you."); |
| | else |
| | new_draw_info (NDI_UNIQUE, 0, op, "The shopkeeper glares at you with contempt."); |
} | | } |
} | | } |
else { | | else { |