Don't become suspicious of the player immediately after combat ends.

This commit is contained in:
Steve 2016-05-17 11:34:32 +01:00
parent d3091caed5
commit 60d477b754
2 changed files with 8 additions and 4 deletions

View File

@ -974,16 +974,19 @@ void checkSuspicionLevel(void)
{ {
battle.hasSuspicionLevel = 1; battle.hasSuspicionLevel = 1;
/* raise if player is too far away */ battle.suspicionCoolOff = MAX(battle.suspicionCoolOff - 1, 0);
if (getDistance(self->x, self->y, player->x, player->y) > SCREEN_WIDTH / 2)
/* raise if player is too far away and there are no enemies */
if (battle.suspicionCoolOff == 0 && battle.numEnemies == 0 && getDistance(self->x, self->y, player->x, player->y) > SCREEN_HEIGHT / 2)
{ {
battle.suspicionLevel++; battle.suspicionLevel++;
} }
/* raise if there are active enemies */ /* raise while there are enemies around, to spir the player into taking action */
if (battle.numEnemies) if (battle.numEnemies > 0 && battle.stats[STAT_TIME] % 5 == 0)
{ {
battle.suspicionLevel++; battle.suspicionLevel++;
battle.suspicionCoolOff = FPS * 10;
} }
if (battle.suspicionLevel >= MAX_SUSPICION_LEVEL) if (battle.suspicionLevel >= MAX_SUSPICION_LEVEL)

View File

@ -352,6 +352,7 @@ typedef struct {
int hasThreats; int hasThreats;
int hasSuspicionLevel; int hasSuspicionLevel;
int suspicionLevel; int suspicionLevel;
int suspicionCoolOff;
Entity *missionTarget; Entity *missionTarget;
Entity *jumpgate; Entity *jumpgate;
Entity *messageSpeaker; Entity *messageSpeaker;