version 1.125 | | version 1.126 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.125 2005/05/21 17:18:23 akirschbaum Exp $"; | | * "$Id: apply.c,v 1.126 2005/05/21 17:35:31 tchize Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
/** | | /** |
* Handles applying a sign. | | * Handles applying a sign. |
*/ | | */ |
static void apply_sign (object *op, object *sign) | | static void apply_sign (object *op, object *sign, int autoapply) |
{ | | { |
| | readable_message_type* msgType; |
| | char newbuf[HUGE_BUF]; |
if (sign->msg == NULL) { | | if (sign->msg == NULL) { |
new_draw_info (NDI_UNIQUE, 0, op, "Nothing is written on it."); | | new_draw_info (NDI_UNIQUE, 0, op, "Nothing is written on it."); |
return; | | return; |
| | |
"You are unable to read while blind."); | | "You are unable to read while blind."); |
return; | | return; |
} | | } |
| | msgType=get_readable_message_type(sign); |
new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, sign->msg); | | snprintf(newbuf,sizeof(newbuf),"%hhu %s", autoapply?1:0,sign->msg); |
| | draw_ext_info(NDI_UNIQUE | NDI_NAVY, 0, op, msgType->message_type, msgType->message_subtype, newbuf, sign->msg); |
} | | } |
| | |
| | |
| | |
case SIGN: | | case SIGN: |
if (victim->type != PLAYER && trap->stats.food > 0) | | if (victim->type != PLAYER && trap->stats.food > 0) |
goto leave; /* monsters musn't apply magic_mouths with counters */ | | goto leave; /* monsters musn't apply magic_mouths with counters */ |
apply_sign (victim, trap); | | apply_sign (victim, trap, 1); |
goto leave; | | goto leave; |
| | |
case CONTAINER: | | case CONTAINER: |
| | |
return 1; | | return 1; |
| | |
case SIGN: | | case SIGN: |
apply_sign (op, tmp); | | apply_sign (op, tmp, 0); |
return 1; | | return 1; |
| | |
case BOOK: | | case BOOK: |