Made state changes in the AI affect the player score

This commit is contained in:
2014-06-28 08:48:26 -07:00
parent 6a5fa90484
commit e166d580fc
4 changed files with 26 additions and 3 deletions

View File

@@ -316,3 +316,18 @@ function isSet(x)
function getDOMValue(name) {
return document.getElementById(name).value
}
function awardPlayerScoreByState(state)
{
switch ( state ) {
case STATE_ALERTED: {
player.score += SCORE_ALERTED;
}
case STATE_CONCERNED: {
player.score += SCORE_CONCERNED;
}
case STATE_LOSTHIM: {
player.score += SCORE_LOSTHIM;
}
}
}