Don't become suspicious of the player immediately after combat ends.
This commit is contained in:
parent
d3091caed5
commit
60d477b754
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue