version 1.5 | | version 1.6 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.5 1999/08/06 21:04:58 cvs Exp $"; | | * "$Id: apply.c,v 1.6 1999/08/18 20:43:54 damn Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
return 1; | | return 1; |
} | | } |
/* only players get this */ | | /* only players get this */ |
if(op->type==PLAYER&&tmp->attacktype&AT_GODPOWER) { | | if(op->type==PLAYER&&tmp->attacktype&AT_GODPOWER) { /* improvement potion */ |
int i; | | int i; |
| | |
for(i=1;i<MIN(11,op->level);i++) { | | for(i=1;i<MIN(11,op->level);i++) { |
| | |
return 0; /* This might change */ | | return 0; /* This might change */ |
| | |
if (sack==NULL || sack->type != CONTAINER) { | | if (sack==NULL || sack->type != CONTAINER) { |
LOG (llevError, "apply_container: %s is not container!\n",sack->name); | | LOG (llevError, "apply_container: %s is not container!\n",sack?sack->name:"NULL"); |
return 0; | | return 0; |
} | | } |
op->contr->last_used = NULL; | | op->contr->last_used = NULL; |
| | |
} | | } |
} else { /* not applied */ | | } else { /* not applied */ |
if (sack->slaying) { /* it's locked */ | | if (sack->slaying) { /* it's locked */ |
for (tmp=op->inv; tmp; tmp=tmp->below) | | tmp = FindKey(sack, op->inv); |
if (tmp->type == SPECIAL_KEY && | | |
tmp->slaying == sack->slaying) | | |
break; | | |
if (tmp) { | | if (tmp) { |
sprintf (buf, "You unlock %s with ", query_name(sack)); | | sprintf (buf, "You unlock %s with %s.", query_name(sack), query_name(tmp)); |
strcat (buf, query_name(tmp)); | | |
strcat (buf, "."); | | |
SET_FLAG (sack, FLAG_APPLIED); | | SET_FLAG (sack, FLAG_APPLIED); |
if (sack->env == NULL) { /* if it's on ground,open it also */ | | if (sack->env == NULL) { /* if it's on ground,open it also */ |
new_draw_info (NDI_UNIQUE,0,op, buf); | | new_draw_info (NDI_UNIQUE,0,op, buf); |
| | |
| | |
int esrv_apply_container (object *op, object *sack) | | int esrv_apply_container (object *op, object *sack) |
{ | | { |
char buf[MAX_BUF]; | | |
object *tmp=op->container; | | object *tmp=op->container; |
| | |
if(op->type!=PLAYER) | | if(op->type!=PLAYER) |
return 0; /* This might change */ | | return 0; /* This might change */ |
| | |
if (sack==NULL || sack->type != CONTAINER) { | | if (sack==NULL || sack->type != CONTAINER) { |
LOG (llevError, "esrv_apply_container: %s is not container!\n",sack->name); | | LOG (llevError, "esrv_apply_container: %s is not container!\n",sack?sack->name:"NULL"); |
return 0; | | return 0; |
} | | } |
| | |
| | |
*/ | | */ |
| | |
if (sack->slaying) { /* it's locked */ | | if (sack->slaying) { /* it's locked */ |
for (tmp=op->inv; tmp; tmp=tmp->below) | | tmp=FindKey(sack, op->inv); |
if (tmp->type == SPECIAL_KEY && | | |
tmp->slaying == sack->slaying) | | |
break; | | |
| | |
if (tmp) { | | if (tmp) { |
sprintf (buf, "You unlock %s with ", query_name(sack)); | | new_draw_info_format(NDI_UNIQUE, 0, op, "You unlock %s with %s.", query_name(sack), query_name(tmp)); |
strcat (buf, query_name(tmp)); | | |
strcat (buf, "."); | | |
new_draw_info(NDI_UNIQUE, 0, op, buf); | | |
} else { | | } else { |
new_draw_info_format(NDI_UNIQUE, 0, op, "You don't have the key to unlock %s.", | | new_draw_info_format(NDI_UNIQUE, 0, op, "You don't have the key to unlock %s.", |
query_name(sack)); | | query_name(sack)); |