diff --git a/src/battle/ai.c b/src/battle/ai.c index cd3ec30..3ae40ef 100644 --- a/src/battle/ai.c +++ b/src/battle/ai.c @@ -237,10 +237,12 @@ static void doFighterAI(void) static void doGunAI(void) { - int r; + int r, breakOffChance; + + breakOffChance = (game.currentMission->challengeData.isChallenge || game.difficulty == DIFFICULTY_NORMAL) ? 5 : 1; /* don't hold a grudge against current target */ - if ((self->target != NULL && self->target->health <= 0) || rand() % 5 == 0) + if ((self->target != NULL && self->target->health <= 0) || rand() % breakOffChance == breakOffChance) { self->action = doAI; self->target = NULL; @@ -258,6 +260,11 @@ static void doGunAI(void) r = rand() % 100; + if (!game.currentMission->challengeData.isChallenge && game.difficulty == DIFFICULTY_EASY) + { + r -= 35; + } + if (r <= 50) { self->action = huntTarget;