version 1.41 | | version 1.42 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.41 2001/11/27 04:33:46 michtoen Exp $"; | | * "$Id: monster.c,v 1.42 2001/12/23 08:17:36 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
return 0; | | return 0; |
} | | } |
| | |
/* find_mon_throw_ob() - modeled on find_throw_ob */ | | /* find_mon_throw_ob() - modeled on find_throw_ob |
/* this is far to complex, and the result is bad */ | | * This is probably overly simplistic as it is now - We want |
/* Where is the sense to throw gold coins or fethers??! */ | | * monsters to throw things like chairs and other pieces of |
/* Not the dumbest goblin is stupid enough to throw with his money. */ | | * furniture, even if they are not good throwable objects. |
/* Now, we just go through the inventory and we ONLY throw is_thrown | | * Probably better to have the monster throw a throwable object |
/* items - and thats how this should work. */ | | * first, then throw any non equipped weapon. |
| | */ |
| | |
object *find_mon_throw_ob( object *op ) { | | object *find_mon_throw_ob( object *op ) { |
object *tmp = NULL; | | object *tmp = NULL; |
| | |
if(op->head) tmp=op->head; else tmp=op; | | if(op->head) tmp=op->head; else tmp=op; |
| | |
/* New throw code: look through the inventory. Grap the first legal is_thrown */ | | /* New throw code: look through the inventory. Grap the first legal is_thrown |
/* marked item and throw it to the enemy. */ | | * marked item and throw it to the enemy. |
/* Some of the original code was a bit ... strange. */ | | */ |
/* At all, i shrink this code to 5% */ | | |
for(tmp=op->inv;tmp;tmp=tmp->below) { | | for(tmp=op->inv;tmp;tmp=tmp->below) { |
| | |
/* the first is only for secure. The second is for monster useful */ | | /* Can't throw invisible objects or items that are applied */ |
if(tmp->invisible || QUERY_FLAG(tmp,FLAG_APPLIED)) continue; | | if(tmp->invisible || QUERY_FLAG(tmp,FLAG_APPLIED)) continue; |
| | |
if(QUERY_FLAG(tmp,FLAG_IS_THROWN)) | | if(QUERY_FLAG(tmp,FLAG_IS_THROWN)) |