diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-23 20:59:41 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:08:56 +0100 |
commit | 2faf64530e539863e603a4ec9faae56eabf10595 (patch) | |
tree | f73b10af8b6ba26f20d8a8901ad6209e0c503ff7 /rules.js | |
parent | bba2352b38b5ad5d25bb07198eed2d426ce1831d (diff) | |
download | julius-caesar-2faf64530e539863e603a4ec9faae56eabf10595.tar.gz |
caesar: Layout blocks by owner and show Jupiter badge for stolen blocks.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -2452,23 +2452,22 @@ exports.view = function(state, current) { } for (let b in BLOCKS) { + let jupiter = (BLOCKS[b].owner != block_owner(b)) ? 1 : 0; if (game.state == 'game_over') { if (game.location[b] != LEVY) - view.known[b] = [ game.location[b], game.steps[b], 0 ]; + view.known[b] = [ game.location[b], game.steps[b], 0, jupiter ]; } else if (block_owner(b) == current || game.location[b] == DEAD) { - view.known[b] = [ game.location[b], game.steps[b], game.moved[b]?1:0 ]; + view.known[b] = [ game.location[b], game.steps[b], game.moved[b]?1:0, jupiter ]; } else { - let o = BLOCKS[b].owner; let a = game.location[b]; + let o = BLOCKS[b].owner; if (b == CLEOPATRA) o = CLEOPATRA; if (a != LEVY) { let list = view.secret[o]; if (!(a in list)) - list[a] = [0, 0]; - list[a][0]++; - if (game.moved[b]) - list[a][1]++; + list[a] = []; + list[a].push([game.moved[b]?1:0, jupiter]); } } } |