version 1.54 | | version 1.55 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.54 2002/11/26 08:48:20 garbled Exp $"; | | * "$Id: monster.c,v 1.55 2002/12/03 07:40:18 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
strcpy(op->name,enemy->name); | | strcpy(op->name,enemy->name); |
} | | } |
| | |
| | /* Calculate range information for closest body part - this |
| | * is used for the 'skill' code, which isn't that smart when |
| | * it comes to figuring it out - otherwise, giants throw boulders |
| | * into themselves. |
| | */ |
| | get_rangevector(op, enemy, &rv, 0); |
| | |
/* Move the check for scared up here - if the monster was scared, | | /* Move the check for scared up here - if the monster was scared, |
* we were not doing any of the logic below, so might as well save | | * we were not doing any of the logic below, so might as well save |
* a few cpu cycles. | | * a few cpu cycles. |
| | |
return 0; | | return 0; |
} | | } |
if(QUERY_FLAG(op,FLAG_READY_SKILL)&&!(RANDOM()%3)) { | | if(QUERY_FLAG(op,FLAG_READY_SKILL)&&!(RANDOM()%3)) { |
if(monster_use_skill(op,part,enemy,dir)) | | if(monster_use_skill(op,rv.part,enemy,rv.direction)) |
return 0; | | return 0; |
} | | } |
if(QUERY_FLAG(op,FLAG_READY_BOW)&&!(RANDOM()%2)) { | | if(QUERY_FLAG(op,FLAG_READY_BOW)&&!(RANDOM()%2)) { |
| | |
} /* If not scared */ | | } /* If not scared */ |
| | |
| | |
get_rangevector(op, enemy, &rv, 0); | | |
part = rv.part; | | part = rv.part; |
dir=rv.direction; | | dir=rv.direction; |
| | |
| | |
return 0; | | return 0; |
} | | } |
/* use skill */ | | /* use skill */ |
return do_skill(head,dir,NULL); | | return do_skill(head, part,dir,NULL); |
} | | } |
| | |
/* Monster will use a ranged spell attack. */ | | /* Monster will use a ranged spell attack. */ |