summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 137e3ff..1292291 100644
--- a/rules.js
+++ b/rules.js
@@ -242,6 +242,10 @@ function enemy_corps() { return (game.active !== P1) ? p1_corps : p2_corps }
function friendly_units() { return (game.active === P1) ? p1_units : p2_units }
function enemy_units() { return (game.active !== P1) ? p1_units : p2_units }
+function are_pieces_different_nationality(a, b) {
+ return data.pieces[a].side !== data.pieces[b].side
+}
+
function set_piece_hex(p, hex) {
zoc_valid = false
game.pieces[p] &= 1
@@ -2038,18 +2042,29 @@ states.attack = {
function can_attack_cavalry_support(p) {
if (p === game.who)
return false
+ // no support between prussia/aa
+ if (are_pieces_different_nationality(game.who, p))
+ return false
return is_adjacent(piece_hex(p), piece_hex(game.who))
}
function can_defend_cavalry_support(p) {
if (p === game.target)
return false
+ // no support between prussia/aa
+ if (are_pieces_different_nationality(game.target, p))
+ return false
return is_adjacent(piece_hex(p), piece_hex(game.target))
}
function can_attack_infantry_support(p) {
if (p === game.who)
return false
+ // TODO: no support between prussia/aa infantry ?
+ /*
+ if (are_pieces_different_nationality(game.who, p))
+ return false
+ */
return is_adjacent(piece_hex(p), piece_hex(game.target))
}