Tweaks to suspicion logic - reduce significantly if the player shoot or kills a civilian craft. Limit reduction to -10%.

This commit is contained in:
Steve 2017-06-16 18:34:44 +01:00
parent 438dd14dca
commit 0449dba7a1
4 changed files with 25 additions and 5 deletions

View File

@ -1115,7 +1115,7 @@ void checkSuspicionLevel(void)
} }
else if (distance <= SCREEN_HEIGHT / 2) else if (distance <= SCREEN_HEIGHT / 2)
{ {
battle.suspicionLevel = MAX(battle.suspicionLevel - 1, 0); battle.suspicionLevel--;
} }
} }
} }

View File

@ -187,7 +187,14 @@ static void checkCollisions(Bullet *b)
if (battle.hasSuspicionLevel) if (battle.hasSuspicionLevel)
{ {
battle.suspicionLevel -= 2; if (e->aiFlags & (AIF_AVOIDS_COMBAT|AIF_DEFENSIVE))
{
battle.suspicionLevel -= (MAX_SUSPICION_LEVEL * 0.1);
}
else
{
battle.suspicionLevel -= (MAX_SUSPICION_LEVEL * 0.001);
}
} }
} }

View File

@ -177,9 +177,16 @@ void doEntities(void)
} }
if (e->killedBy == player && battle.hasSuspicionLevel) if (e->killedBy == player && battle.hasSuspicionLevel)
{
if (e->aiFlags & (AIF_AVOIDS_COMBAT|AIF_DEFENSIVE))
{
battle.suspicionLevel -= (MAX_SUSPICION_LEVEL * 0.5);
}
else
{ {
battle.suspicionLevel -= (MAX_SUSPICION_LEVEL * 0.12); battle.suspicionLevel -= (MAX_SUSPICION_LEVEL * 0.12);
} }
}
if (e == player) if (e == player)
{ {

View File

@ -353,10 +353,16 @@ static void handleMouse(void)
fireRocket(player); fireRocket(player);
} }
if (battle.hasSuspicionLevel && !battle.numEnemies && !battle.suspicionCoolOff) if (battle.hasSuspicionLevel)
{
if (!battle.numEnemies && !battle.suspicionCoolOff)
{ {
battle.suspicionLevel += (MAX_SUSPICION_LEVEL * 0.05); battle.suspicionLevel += (MAX_SUSPICION_LEVEL * 0.05);
} }
/* don't allow the suspicion level to drop too far */
battle.suspicionLevel = MAX(battle.suspicionLevel, -(MAX_SUSPICION_LEVEL * 0.1));
}
} }
if (isControl(CONTROL_ACCELERATE)) if (isControl(CONTROL_ACCELERATE))