diff options
-rw-r--r-- | create.html | 20 | ||||
-rw-r--r-- | rules.js | 8 |
2 files changed, 26 insertions, 2 deletions
diff --git a/create.html b/create.html index 5eb0076..f1cc31b 100644 --- a/create.html +++ b/create.html @@ -1,3 +1,6 @@ +<style> +input:disabled + span { color: gray; } +</style> <p> Player count: <br> @@ -11,3 +14,20 @@ Player count: <label> <input type="checkbox" value="true" name="emperor">Optional Emperor Rules </label> + +<p> +<label> +<input type="checkbox" value="true" name="no_demagogue" disabled><span>No Demagogue</span> +</label> + +<script> +document.querySelector("select[name='scenario']").onchange = function (event) { + let input = document.querySelector("input[name='no_demagogue']") + if (/Expansion/.test(event.target.value)) { + input.removeAttribute("disabled") + } else { + input.setAttribute("disabled", true) + input.checked = false + } +} +</script> @@ -5535,8 +5535,9 @@ exports.setup = function (seed, scenario, options) { setup_market_pile(CARD_P4), setup_market_pile(CARD_M4X), setup_market_pile(CARD_S4X), - setup_market_pile(CARD_P4X), ] + if (!options.no_demagogue) + game.market.push(setup_market_pile(CARD_P4X)) break case "Expansion - Random": game.market = [ @@ -5548,8 +5549,11 @@ exports.setup = function (seed, scenario, options) { setup_market_pile(random(2) ? CARD_P3 : CARD_P3X), setup_market_pile(random(2) ? CARD_M4 : CARD_M4X), setup_market_pile(random(2) ? CARD_S4B : CARD_S4X), - setup_market_pile(random(2) ? CARD_P4 : CARD_P4X), ] + if (!options.no_demagogue) + game.market.push(setup_market_pile(random(2) ? CARD_P4 : CARD_P4X)) + else + game.market.push(setup_market_pile(CARD_P4)) break } |