summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-12 13:02:11 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-12 17:25:05 +0200
commit17e9c3d2393ee698b088735a9a382c102c38a8a4 (patch)
treecc06b51a2230619d161b97f297391d202b6f0c68
parent58bc6e156a3a7667a89e4bb9e14865ffa030c124 (diff)
downloadjulius-caesar-17e9c3d2393ee698b088735a9a382c102c38a8a4.tar.gz
Remove old replay compatibility options.
-rw-r--r--rules.js56
1 files changed, 14 insertions, 42 deletions
diff --git a/rules.js b/rules.js
index c2e2d25..8997c88 100644
--- a/rules.js
+++ b/rules.js
@@ -61,8 +61,6 @@ const RESERVE_MARK = ""
let game = null
function random(n) {
- if (game.rng === 1)
- return Math.floor(((game.seed = game.seed * 48271 % 0x7fffffff) / 0x7fffffff) * n)
return (game.seed = game.seed * 200105 % 34359738337) % n
}
@@ -1297,23 +1295,13 @@ states.vulcan = {
},
space: function (city) {
log("Vulcan struck #" + city + "!")
- if (game.automatic_disruption) {
- for (let b = 0; b < block_count; ++b)
- if (game.location[b] === city)
- reduce_block(b)
- // uh-oh! cleopatra switched sides!
- if (is_contested_city(city))
- set_attacker(city, game.active)
- end_player_turn()
- } else {
- game.where = city
- game.vulcan = []
- for (let b = 0; b < block_count; ++b)
- if (game.location[b] === city)
- game.vulcan.push(b)
- game.active = enemy(game.active)
- game.state = 'apply_vulcan'
- }
+ game.where = city
+ game.vulcan = []
+ for (let b = 0; b < block_count; ++b)
+ if (game.location[b] === city)
+ game.vulcan.push(b)
+ game.active = enemy(game.active)
+ game.state = 'apply_vulcan'
},
}
@@ -1844,21 +1832,13 @@ function bring_on_reserves() {
function goto_disrupt_reserves() {
game.flash = "Reserves were disrupted."
- if (game.automatic_disruption) {
- for (let b = 0; b < block_count; ++b)
- if (game.location[b] === game.where && block_owner(b) === get_attacker(game.where))
- if (game.reserves.includes(b))
- reduce_block(b)
- end_disrupt_reserves()
- } else {
- game.disrupted = []
- for (let b = 0; b < block_count; ++b)
- if (game.location[b] === game.where && block_owner(b) === get_attacker(game.where))
- if (game.reserves.includes(b))
- game.disrupted.push(b)
- game.active = get_attacker(game.where)
- game.state = 'disrupt_reserves'
- }
+ game.disrupted = []
+ for (let b = 0; b < block_count; ++b)
+ if (game.location[b] === game.where && block_owner(b) === get_attacker(game.where))
+ if (game.reserves.includes(b))
+ game.disrupted.push(b)
+ game.active = get_attacker(game.where)
+ game.state = 'disrupt_reserves'
}
function disrupt_block(who) {
@@ -2656,10 +2636,6 @@ exports.setup = function (seed, scenario, options) {
reserves: [],
}
- // Old RNG for ancient replays
- if (options.rng)
- game.rng = options.rng
-
if (scenario === "Historical")
log(".h1 Historical Deployment")
else
@@ -2719,12 +2695,8 @@ exports.setup = function (seed, scenario, options) {
logbr()
// Option for backwards compatible replays.
- if (options.automatic_disruption)
- game.automatic_disruption = 1
-
if (options.autohit)
game.autohit = 1
-
if (options.delay_hits)
game.delay_hits = 1