Reduce AI chance of attacking.
This commit is contained in:
parent
73fcdbf3ee
commit
7c6a881dff
|
@ -237,10 +237,12 @@ static void doFighterAI(void)
|
||||||
|
|
||||||
static void doGunAI(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 */
|
/* 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->action = doAI;
|
||||||
self->target = NULL;
|
self->target = NULL;
|
||||||
|
@ -258,6 +260,11 @@ static void doGunAI(void)
|
||||||
|
|
||||||
r = rand() % 100;
|
r = rand() % 100;
|
||||||
|
|
||||||
|
if (!game.currentMission->challengeData.isChallenge && game.difficulty == DIFFICULTY_EASY)
|
||||||
|
{
|
||||||
|
r -= 35;
|
||||||
|
}
|
||||||
|
|
||||||
if (r <= 50)
|
if (r <= 50)
|
||||||
{
|
{
|
||||||
self->action = huntTarget;
|
self->action = huntTarget;
|
||||||
|
|
Loading…
Reference in New Issue