version 1.16 | | version 1.17 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.16 2001/02/11 09:12:14 cvs Exp $"; | | * "$Id: monster.c,v 1.17 2001/02/23 06:06:35 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
strcpy(op->name,enemy->name); | | strcpy(op->name,enemy->name); |
} | | } |
| | |
#define NEW_MON_ATTACK | | |
#ifndef NEW_MON_ATTACK | | |
part = get_nearest_part(op,enemy); | | |
#else | | |
for (part=op; part!=NULL; part=part->more) { | | for (part=op; part!=NULL; part=part->more) { |
#endif | | |
dir=find_dir_2(part->x-enemy->x,part->y-enemy->y); | | dir=find_dir_2(part->x-enemy->x,part->y-enemy->y); |
| | |
if(QUERY_FLAG(op, FLAG_SCARED) || QUERY_FLAG(op,FLAG_RUN_AWAY)) | | if(QUERY_FLAG(op, FLAG_SCARED) || QUERY_FLAG(op,FLAG_RUN_AWAY)) |
| | |
if(monster_use_bow(op,part,enemy,dir)) | | if(monster_use_bow(op,part,enemy,dir)) |
return 0; | | return 0; |
} | | } |
#ifdef NEW_MON_ATTACK | | |
} | | } |
part = get_nearest_part(op,enemy); | | part = get_nearest_part(op,enemy); |
#endif | | dir=find_dir_2(part->x-enemy->x,part->y-enemy->y); |
if ((op->move_type & LO4) && !QUERY_FLAG(op, FLAG_SCARED)) { | | if ((op->move_type & LO4) && !QUERY_FLAG(op, FLAG_SCARED)) { |
switch (op->move_type & LO4) { | | switch (op->move_type & LO4) { |
case DISTATT: | | case DISTATT: |
| | |
int dist; | | int dist; |
if (can_hit(part,enemy)) | | if (can_hit(part,enemy)) |
return dir; | | return dir; |
dist = distance (ob,enemy); | | dist = distance (part,enemy); |
if (dist < 10) | | if (dist < 10) |
return absdir(dir+4); | | return absdir(dir+4); |
else if (dist>81) { | | else if (dist>81) { |