summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-12 12:58:16 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-20 18:54:21 +0200
commit0920295b9ad52bd2c6ef383b88a7e6e7313caa47 (patch)
treef2ed0d23a40618cd7cdd1c0f77ef48819c8a3180
parent17e9c3d2393ee698b088735a9a382c102c38a8a4 (diff)
downloadjulius-caesar-0920295b9ad52bd2c6ef383b88a7e6e7313caa47.tar.gz
Make delayed hit assignment default.
-rw-r--r--about.html2
-rw-r--r--create.html23
-rw-r--r--rules.js34
3 files changed, 17 insertions, 42 deletions
diff --git a/about.html b/about.html
index 9982fda..6e7457b 100644
--- a/about.html
+++ b/about.html
@@ -4,8 +4,6 @@ control of the legions of Caesar or Pompey and fight to determine the future of
Rome: republic or empire. Marc Antony, Cleopatra, Octavian, and Brutus also
play key roles.
-<br clear=left>
-
<p>
Designer: Justin Thompson and Grant Dalgliesh.
diff --git a/create.html b/create.html
index 729f63f..a8eabf1 100644
--- a/create.html
+++ b/create.html
@@ -17,22 +17,6 @@ deployed blocks in each city is maintained.
Julius Caesar goes first on the first turn regardless of the cards played.
</dl>
-<dl>
-<dt>
-<label>
-<input type="checkbox" id="delay_hits" name="delay_hits" value="true">
-Delayed hit assignment
-</label>
-<dd>Fire blocks with the same initiative together.
-
-<dt>
-<label>
-<input type="checkbox" id="autohit" name="autohit" value="true">
-Automatic hit assignment
-</label>
-<dd>Assign hits automatically when there is no choice.
-</dl>
-
<p>
House rules:
<br><label><input type="checkbox" name="max_2_events" value="true">Max 2 event cards per hand.</label>
@@ -48,10 +32,3 @@ House rules:
<br><label><input type="checkbox" name="remove_pluto" value="true">Remove Pluto.</label>
<br><label><input type="checkbox" name="remove_vulcan" value="true">Remove Vulcan.</label>
-->
-
-<script>
-let cb1 = document.getElementById("autohit")
-let cb2 = document.getElementById("delay_hits")
-cb1.onchange = function () { if (cb1.checked) cb2.checked = false }
-cb2.onchange = function () { if (cb2.checked) cb1.checked = false }
-</script>
diff --git a/rules.js b/rules.js
index 8997c88..f082338 100644
--- a/rules.js
+++ b/rules.js
@@ -1927,7 +1927,7 @@ function pump_battle_round() {
if (game.battle_list) {
if (game.active !== active) {
game.active = active
- if (game.delay_hits && game.hits > 0) {
+ if (game.hits > 0) {
goto_battle_hits()
return true
}
@@ -1965,7 +1965,7 @@ function pump_battle_round() {
if (battle_step(attacker, 'D', is_attacker)) return
}
- if (game.delay_hits && game.hits > 0) {
+ if (game.hits > 0) {
game.active = enemy(game.active)
return goto_battle_hits()
}
@@ -2004,9 +2004,9 @@ function count_enemy_hp_in_battle() {
}
function must_apply_hits() {
- if (game.delay_hits)
- return game.hits >= count_enemy_hp_in_battle()
- return game.hits > 0
+ if (game.immediate)
+ return game.hits > 0
+ return game.hits >= count_enemy_hp_in_battle()
}
function fire_with_block(b) {
@@ -2030,15 +2030,7 @@ function fire_with_block(b) {
log_battle(name + " fired " + rolls.join("") + ".")
- if (game.delay_hits) {
- game.flash = name + " fired " + rolls.join(" ")
- if (game.hits === 0)
- game.flash += "."
- else if (game.hits === 1)
- game.flash += " for a total of 1 hit."
- else if (game.hits > 1)
- game.flash += " for a total of " + game.hits + " hits."
- } else {
+ if (game.immediate) {
game.flash = name + " fired " + rolls.join(" ")
if (hits === 0)
game.flash += " and missed."
@@ -2046,6 +2038,14 @@ function fire_with_block(b) {
game.flash += " and scored 1 hit."
else
game.flash += " and scored " + hits + " hits."
+ } else {
+ game.flash = name + " fired " + rolls.join(" ")
+ if (game.hits === 0)
+ game.flash += "."
+ else if (game.hits === 1)
+ game.flash += " for a total of 1 hit."
+ else if (game.hits > 1)
+ game.flash += " for a total of " + game.hits + " hits."
}
if (must_apply_hits()) {
@@ -2124,7 +2124,7 @@ states.battle_round = {
if (can_pass) gen_action_battle(view, 'battle_pass', b)
gen_action_block(view, b)
}
- if (game.delay_hits && game.hits > 0)
+ if (game.hits > 0)
gen_action(view, 'assign')
},
assign: function () {
@@ -2697,8 +2697,8 @@ exports.setup = function (seed, scenario, options) {
// Option for backwards compatible replays.
if (options.autohit)
game.autohit = 1
- if (options.delay_hits)
- game.delay_hits = 1
+ if (options.immediate)
+ game.immediate = 1
setup_historical_deployment()
if (scenario === "Free Deployment")