version 1.37 | | version 1.38 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.37 2001/11/11 09:39:54 gros Exp $"; | | * "$Id: monster.c,v 1.38 2001/11/13 08:14:26 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
strcpy(op->name,enemy->name); | | strcpy(op->name,enemy->name); |
} | | } |
| | |
for (part=op; part!=NULL; part=part->more) { | | /* 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 |
| | * a few cpu cycles. |
| | */ |
| | if (!QUERY_FLAG(op, FLAG_SCARED)) { |
rv_vector rv1; | | rv_vector rv1; |
| | for (part=op; part!=NULL; part=part->more) { |
| | |
get_rangevector(part, enemy, &rv1, 0x1); | | get_rangevector(part, enemy, &rv1, 0x1); |
| | |
| | |
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 (!QUERY_FLAG(op, FLAG_SCARED)) { | | |
if(QUERY_FLAG(op,FLAG_CAST_SPELL)) | | if(QUERY_FLAG(op,FLAG_CAST_SPELL)) |
if(monster_cast_spell(op,part,enemy,dir,&rv1)) | | if(monster_cast_spell(op,part,enemy,dir,&rv1)) |
return 0; | | return 0; |
| | |
if(QUERY_FLAG(op,FLAG_READY_BOW)&&!(RANDOM()%2)) | | if(QUERY_FLAG(op,FLAG_READY_BOW)&&!(RANDOM()%2)) |
if(monster_use_bow(op,part,enemy,dir)) | | if(monster_use_bow(op,part,enemy,dir)) |
return 0; | | return 0; |
} | | |
} /* for processing of all parts */ | | } /* for processing of all parts */ |
| | } /* If not scared */ |
| | |
| | |
get_rangevector(op, enemy, &rv, 0); | | get_rangevector(op, enemy, &rv, 0); |
| | |
msgs->keywords[msgnr][keywordnr-2]); | | msgs->keywords[msgnr][keywordnr-2]); |
else | | else |
LOG(llevDebug, "Msgnr %d, first keyword\n",msgnr+1); | | LOG(llevDebug, "Msgnr %d, first keyword\n",msgnr+1); |
| | #if 0 |
| | /* Removed this block - according to the compiler, this has no effect, |
| | * and looking at the if statement above, the certainly appears to be the |
| | * case. |
| | */ |
for(keywordnr; keywordnr <= nrofkeywords; keywordnr++) | | for(keywordnr; keywordnr <= nrofkeywords; keywordnr++) |
msgs->keywords[msgnr][keywordnr] = strdup_local("xxxx"); | | msgs->keywords[msgnr][keywordnr] = strdup_local("xxxx"); |
| | #endif |
} | | } |
last = cp; | | last = cp; |
} | | } |