version 1.30 | | version 1.31 |
---|
| | |
/* | | /* |
* static char *rcsid_skill_util_c = | | * static char *rcsid_skill_util_c = |
* "$Id: skill_util.c,v 1.30 2002/09/11 06:21:46 mwedel Exp $"; | | * "$Id: skill_util.c,v 1.31 2002/11/11 08:59:09 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
int do_skill (object *op, int dir, char *string) { | | int do_skill (object *op, int dir, char *string) { |
int success=0; /* needed for monster_skill_use() too */ | | int success=0; /* needed for monster_skill_use() too */ |
int skill = op->chosen_skill->stats.sp; | | int skill = op->chosen_skill->stats.sp; |
| | int did_alc = 0; |
| | int x, y; |
| | object *tmp, *next; |
| | |
switch(skill) { | | switch(skill) { |
case SK_LEVITATION: | | case SK_LEVITATION: |
| | |
case SK_ALCHEMY: | | case SK_ALCHEMY: |
case SK_THAUMATURGY: | | case SK_THAUMATURGY: |
case SK_LITERACY: | | case SK_LITERACY: |
| | case SK_WOODSMAN: |
| | /* first, we try to find a cauldron, and do the alchemy thing. |
| | failing that, we go and identify stuff. */ |
| | #ifdef ALCHEMY |
| | for (y=op->y-1; y <= op->y+1; y++) { |
| | for (x=op->x-1; x <= op->x+1; x++) { |
| | if (out_of_map(op->map, x, y) || wall(op->map, x, y) || |
| | blocks_view(op->map, x, y)) |
| | continue; |
| | for (tmp=get_map_ob(op->map, x, y); tmp != NULL; tmp=next) { |
| | next=tmp->above; |
| | if(QUERY_FLAG(tmp, FLAG_IS_CAULDRON)) { |
| | attempt_do_alchemy(op, tmp); |
| | did_alc=1; |
| | continue; |
| | } |
| | } |
| | } |
| | } |
| | #endif |
| | if (did_alc == 0) |
| | success = skill_ident(op); |
| | break; |
case SK_DET_MAGIC: | | case SK_DET_MAGIC: |
case SK_DET_CURSE: | | case SK_DET_CURSE: |
case SK_WOODSMAN: | | |
success = skill_ident(op); | | success = skill_ident(op); |
break; | | break; |
case SK_REMOVE_TRAP: | | case SK_REMOVE_TRAP: |