From 344b2d27b8059bfb1c267db903246fccadc1fdcc Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 16 Apr 2016 10:59:42 +0100 Subject: [PATCH] Give AIF_TARGET_FOCUS fighters a low chance of targetting something else. --- src/battle/ai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle/ai.c b/src/battle/ai.c index 39d4d4c..d0e382e 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -352,9 +352,10 @@ static int canAttack(Entity *e) } } + /* low chance of attacking something else */ if ((self->aiFlags & AIF_TARGET_FOCUS) && (!(e->flags & EF_AI_TARGET))) { - return 0; + return !(rand() % 100); } return 1;