version 1.87 | | version 1.88 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.87 2005/09/08 21:19:54 akirschbaum Exp $"; | | * "$Id: monster.c,v 1.88 2005/09/13 06:46:35 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/* if this is pet, let him attack the same enemy as his owner | | /* if this is pet, let him attack the same enemy as his owner |
* TODO: when there is no ower enemy, try to find a target, | | * TODO: when there is no ower enemy, try to find a target, |
* which CAN attack the owner. */ | | * which CAN attack the owner. */ |
if ((npc->move_type & HI4) == PETMOVE) | | if ((npc->attack_movement & HI4) == PETMOVE) |
{ | | { |
if (npc->owner == NULL) | | if (npc->owner == NULL) |
npc->enemy = NULL; | | npc->enemy = NULL; |
| | |
*/ | | */ |
| | |
/* pet move */ | | /* pet move */ |
if ((npc->move_type & HI4) == PETMOVE) { | | if ((npc->attack_movement & HI4) == PETMOVE) { |
tmp= get_pet_enemy(npc,rv); | | tmp= get_pet_enemy(npc,rv); |
if (tmp) get_rangevector(npc, tmp, rv, 0); | | if (tmp) get_rangevector(npc, tmp, rv, 0); |
return tmp; | | return tmp; |
| | |
* stand still and a movement type set. | | * stand still and a movement type set. |
*/ | | */ |
if(!QUERY_FLAG(op, FLAG_STAND_STILL)) { | | if(!QUERY_FLAG(op, FLAG_STAND_STILL)) { |
if (op->move_type & HI4) | | if (op->attack_movement & HI4) |
{ | | { |
switch (op->move_type & HI4) { | | switch (op->attack_movement & HI4) { |
case (PETMOVE): | | case (PETMOVE): |
pet_move (op); | | pet_move (op); |
break; | | break; |
| | |
if(QUERY_FLAG(op,FLAG_CONFUSED)) | | if(QUERY_FLAG(op,FLAG_CONFUSED)) |
dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); | | dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); |
| | |
if ((op->move_type & LO4) && !QUERY_FLAG(op, FLAG_SCARED)) | | if ((op->attack_movement & LO4) && !QUERY_FLAG(op, FLAG_SCARED)) |
{ | | { |
switch (op->move_type & LO4) { | | switch (op->attack_movement & LO4) { |
case DISTATT: | | case DISTATT: |
dir = dist_att (dir,op,enemy,part,&rv); | | dir = dist_att (dir,op,enemy,part,&rv); |
break; | | break; |
| | |
break; | | break; |
| | |
default: | | default: |
LOG(llevDebug,"Illegal low mon-move: %d\n",op->move_type & LO4); | | LOG(llevDebug,"Illegal low mon-move: %d\n",op->attack_movement & LO4); |
} | | } |
} | | } |
| | |