diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 26 |
1 files changed, 23 insertions, 3 deletions
@@ -1115,7 +1115,7 @@ function goto_attack_space() { set_add(game.cmd.selected, p) set_add(game.cmd.pieces, p) game.cmd.n_units[1] += 1 - if (game.cmd.target === BK || game.cmd.target === VE) + if (game.cmd.attacker === DS) to_rebel(p) } }) @@ -1128,6 +1128,8 @@ function goto_attack_space() { set_add(game.cmd.selected, p) set_add(game.cmd.pieces, p) game.cmd.n_units[0] += 1 + if ((game.cmd.attacker === BK || game.cmd.attacker === VE) && game.cmd.target === DS) + to_rebel(p) } }) game.cmd.n_adj = (game.current === VE) ? 1 : 2 @@ -1310,12 +1312,30 @@ function end_attack_casualties() { } function goto_attack_resolution() { - if (is_rebel_faction(game.cmd.target) && is_rebel_faction(game.cmd.attacker)) - console.log("Implement shift") game.dice = [0, 0, 0, 0, 0, 0] + if (is_rebel_faction(game.cmd.target) && is_rebel_faction(game.cmd.attacker)) + attack_influence_shift() game.state = "attack" } +function attack_influence_shift() { + let up = null, down = null + if (game.cmd.a_hit > game.cmd.d_hit) { + up = game.cmd.attacker + down = game.cmd.target + } else if (game.cmd.a_hit < game.cmd.d_hit) { + down = game.cmd.attacker + up = game.cmd.target + } + + if (up) { + game.inf_shift = { "next": "attack" } + add_influence(up) + remove_influence(down) + } else { + game.state = "attack" + } +} /* DELHI SULTANATE COMMANDS */ |