Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
feat(log): the log now tells you how much SP/KP you gained on a game …
Browse files Browse the repository at this point in the history
…over

closes #29
  • Loading branch information
seiyria committed Dec 22, 2015
1 parent d8a214d commit 6fb8988
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/angular/controllers/Log.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ module.controller('Log', ($scope, $localStorage) => {
}
};

const addMetaMessage = (msg) => {
addMessage({ message: msg, type: MessageTypes.META, turn: $scope.log[$scope.log.length-1].turn+1 });
};

GameState.on('gameover', () => {
addMessage({ message: 'Game over! Everyone died.', type: MessageTypes.META, turn: $scope.log[$scope.log.length-1].turn+1 });
addMetaMessage('Game over! Everyone died.');
addMetaMessage(`You earned ${GameState.spEarned} SP and ${GameState.kpEarned} KP.`);
});

GameState.on('log', (logObj) => {
Expand Down

0 comments on commit 6fb8988

Please sign in to comment.