diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-06-24 12:42:51 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-16 19:19:38 +0100 |
commit | cbc1f4048a69dfe12ef16a63195d5a6088720495 (patch) | |
tree | 10d7e37140df98aae242ec631396a4e17acfd386 | |
parent | d4048c2c7c107fb74343fed686c4f28ca985a2a5 (diff) | |
download | crusader-rex-cbc1f4048a69dfe12ef16a63195d5a6088720495.tar.gz |
crusader: Fix drawing to home seat and friendly siege.
-rw-r--r-- | rules.js | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -267,6 +267,20 @@ function list_seats(who) { return list; } +function is_home_seat(where, who) { + if (is_saladin_family(who)) + who = SALADIN; + switch (block_type(who)) { + case 'nomads': return [ block_home(who) ]; + case 'turcopoles': who = "Turcopoles"; break; + case 'military_orders': who = BLOCKS[who].name; break; + } + for (let town in SHIELDS) + if (SHIELDS[town].includes(who)) + return true; + return false; +} + function block_pool(who) { if (BLOCKS[who].owner == FRANKS) return F_POOL; @@ -2986,19 +3000,18 @@ states.draw_phase = { view.prompt = "Draw Phase: Place " + BLOCKS[game.who].name + " at full strength in " + list_seats(game.who).join(", ") + " or at strength 1 in any friendly town."; for (let town in TOWNS) - if (is_friendly_town(town)) + if (is_friendly_field(town)) // TODO: FAQ claims besieger controls town for draw purposes gen_action(view, 'town', town); break; } }, town: function (where) { let type = block_type(game.who); - let home = block_home(game.who); log(game.active + " arrive in " + where + "."); game.location[game.who] = where; - if ((type == 'outremers' || type == 'emirs' || type == 'nomads') && (where != home)) + if ((type == 'outremers' || type == 'emirs' || type == 'nomads') && is_home_seat(where, game.who)); game.steps[game.who] = 1; else game.steps[game.who] = block_max_steps(game.who); |