summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--create.html10
-rw-r--r--data.js3
-rw-r--r--rules.js21
3 files changed, 29 insertions, 5 deletions
diff --git a/create.html b/create.html
index e69de29..a9b870a 100644
--- a/create.html
+++ b/create.html
@@ -0,0 +1,10 @@
+<p>
+Optional rules:
+<dl>
+<dt>
+<label>
+<input type="checkbox" name="iron_bridge" value="true">
+Iron Bridge
+</label>
+<dd>The road between Antioch and Harim has a move limit of 3.
+</dl>
diff --git a/data.js b/data.js
index de6cacb..56a1d85 100644
--- a/data.js
+++ b/data.js
@@ -337,10 +337,11 @@ const PORTS = [];
TOWNS[B].exits.push(A);
}
+ function iron_bridge(A,B) { road(A,B,"iron-bridge"); }
function major(A,B) { road(A,B,"major"); }
function minor(A,B) { road(A,B,"minor"); }
- major("Antioch", "Harim");
+ iron_bridge("Antioch", "Harim");
major("Harim", "Artah");
major("Artah", "Aleppo");
major("Aleppo", "Zerdana");
diff --git a/rules.js b/rules.js
index 890120d..ae5b47b 100644
--- a/rules.js
+++ b/rules.js
@@ -659,13 +659,24 @@ function is_pinned(who, from) {
function can_block_use_road(from, to) {
if (game.active === game.guide) {
switch (road_type(from, to)) {
- case 'major': return road_limit(from, to) < 8;
- case 'minor': return road_limit(from, to) < 4;
+ case 'iron-bridge':
+ // https://boardgamegeek.com/thread/744750/20-rules-iron-bridge-question
+ case 'major':
+ return road_limit(from, to) < 8;
+ case 'minor':
+ return road_limit(from, to) < 4;
}
} else {
switch (road_type(from, to)) {
- case 'major': return road_limit(from, to) < 4;
- case 'minor': return road_limit(from, to) < 2;
+ case 'iron-bridge':
+ if (game.iron_bridge)
+ return road_limit(from, to) < 3;
+ else
+ return road_limit(from, to) < 4;
+ case 'major':
+ return road_limit(from, to) < 4;
+ case 'minor':
+ return road_limit(from, to) < 2;
}
}
return false;
@@ -3752,6 +3763,8 @@ exports.setup = function (seed, scenario, options) {
where: null,
undo: [],
}
+ if (options && options.iron_bridge)
+ game.iron_bridge = 1;
setup_game();
return game;
}