diff --git a/src/battle/ai.c b/src/battle/ai.c index 7d37d4e..d43cc1d 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -319,11 +319,14 @@ static int canAttack(Entity *e) { self->selectedGunType = self->guns[0].type; - if (e->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE) || e->flags & EF_SECONDARY_TARGET) + if (!(e->flags & EF_AI_TARGET)) { - if (rand() % 10) + if (e->aiFlags & (AIF_AVOIDS_COMBAT | AIF_EVADE) || e->flags & EF_SECONDARY_TARGET) { - return 0; + if (rand() % 5) + { + return 0; + } } } diff --git a/src/battle/ai.h b/src/battle/ai.h index 9038b97..921282b 100644 --- a/src/battle/ai.h +++ b/src/battle/ai.h @@ -44,3 +44,4 @@ extern Colors colors; extern Dev dev; extern Entity *self; extern Entity *player; +extern Game game;