summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--create.html1
-rw-r--r--play.js179
-rw-r--r--rules.js107
-rw-r--r--tools/genmove.js59
4 files changed, 163 insertions, 183 deletions
diff --git a/create.html b/create.html
index bad574a..dffd67b 100644
--- a/create.html
+++ b/create.html
@@ -5,6 +5,5 @@ Player count:
<option value="">4 Player</option>
<option value="3">3 Player</option>
<option value="2">2 Player</option>
-<option value="1">Solo</option>
</select>
diff --git a/play.js b/play.js
index da4efe3..972754a 100644
--- a/play.js
+++ b/play.js
@@ -72,25 +72,25 @@ const MACEDONIA = 3
const PANNONIA = 4
const THRACIA = 5
-const AEGYPTUS = 6
-const AFRICA = 7
-const HISPANIA = 8
+const BRITANNIA = 6
+const GALATIA = 7
+const SYRIA = 8
-const BRITANNIA = 9
-const GALATIA = 10
-const SYRIA = 11
+const AEGYPTUS = 9
+const AFRICA = 10
+const HISPANIA = 11
const ALAMANNI = 0
const FRANKS = 1
const GOTHS = 2
-const NOMADS = 3
-const SASSANIDS = 4
+const SASSANIDS = 3
+const NOMADS = 4
const ALAMANNI_HOMELAND = 12
const FRANKS_HOMELAND = 13
const GOTHS_HOMELAND = 14
-const NOMADS_HOMELAND = 15
-const SASSANIDS_HOMELAND = 16
+const SASSANIDS_HOMELAND = 15
+const NOMADS_HOMELAND = 16
const MARE_OCCIDENTALE = 17
const MARE_ORIENTALE = 18
@@ -102,8 +102,8 @@ const UNAVAILABLE = 22
const ARMY = 23
-const first_barbarian = [ 0, 10, 20, 31, 41 ]
-const last_barbarian = [ 9, 19, 30, 40, 52 ]
+const first_barbarian = [ 0, 10, 20, 31, 43 ]
+const last_barbarian = [ 9, 19, 30, 42, 52 ]
const first_governor = [ 0, 6, 12, 18 ]
const first_general = [ 0, 6, 12, 18 ]
@@ -118,17 +118,17 @@ const REGION_NAME = [
"Macedonia",
"Pannonia",
"Thracia",
- "Aegyptus",
- "Africa",
- "Hispania",
"Britannia",
"Galatia",
"Syria",
+ "Aegyptus",
+ "Africa",
+ "Hispania",
"Alamanni Homeland",
"Franks Homeland",
"Goths Homeland",
- "Nomads Homeland",
"Sassanids Homeland",
+ "Nomads Homeland",
"Mare Occidentale",
"Mare Orientale",
"Oceanus Atlanticus",
@@ -230,7 +230,7 @@ function set_has(set, item) {
}
const PLAYER_CLASS = [ "red", "blue", "yellow", "green" ]
-const BARBARIAN_CLASS = [ "alamanni", "franks", "goths", "nomads", "sassanids" ]
+const BARBARIAN_CLASS = [ "alamanni", "franks", "goths", "sassanids", "nomads" ]
const BOXES = {
"Thracia Support": [ 1502, 720, 258, 52 ],
@@ -281,17 +281,17 @@ const LAYOUT_XY = [
BOXES["Macedonia Capital"],
BOXES["Pannonia Capital"],
BOXES["Thracia Capital"],
- BOXES["Aegyptus Capital"],
- BOXES["Africa Capital"],
- BOXES["Hispania Capital"],
BOXES["Britannia Capital"],
BOXES["Galatia Capital"],
BOXES["Syria Capital"],
+ BOXES["Aegyptus Capital"],
+ BOXES["Africa Capital"],
+ BOXES["Hispania Capital"],
BOXES["Alamanni XY"],
BOXES["Franks XY"],
BOXES["Goths XY"],
- BOXES["Nomads XY"],
BOXES["Sassanids XY"],
+ BOXES["Nomads XY"],
BOXES["Mare Occidentale XY"],
BOXES["Mare Orientale XY"],
BOXES["Oceanus Atlanticus XY"],
@@ -305,20 +305,20 @@ const LAYOUT_SUPPORT = [
BOXES["Macedonia Support"],
BOXES["Pannonia Support"],
BOXES["Thracia Support"],
- BOXES["Aegyptus Support"],
- BOXES["Africa Support"],
- BOXES["Hispania Support"],
BOXES["Britannia Support"],
BOXES["Galatia Support"],
BOXES["Syria Support"],
+ BOXES["Aegyptus Support"],
+ BOXES["Africa Support"],
+ BOXES["Hispania Support"],
]
const LAYOUT_DICE = [
BOXES["Alamanni Dice"],
BOXES["Franks Dice"],
BOXES["Goths Dice"],
- BOXES["Nomads Dice"],
BOXES["Sassanids Dice"],
+ BOXES["Nomads Dice"],
]
const LAYOUT_QUAESTOR = [
@@ -357,6 +357,19 @@ const LAYOUT_ALAMANNI = [
[ -2, -1 ],
]
+const LAYOUT_NOMADS = [
+ [ 0, 0 ],
+ [ 1, 0 ],
+ [ 4, 0 ],
+ [ 5, 0 ],
+ [ -1, -1 ],
+ [ 2, 0 ],
+ [ 3, 0 ],
+ [ -2, -1 ],
+ [ -3, -1 ],
+ [ 0, 1 ],
+]
+
const LAYOUT_SASSANIDS = [
[ 0, 0 ],
[ -1, 0 ],
@@ -372,19 +385,6 @@ const LAYOUT_SASSANIDS = [
[ 0, 2 ],
]
-const LAYOUT_NOMADS = [
- [ 0, 0 ],
- [ 1, 0 ],
- [ 4, 0 ],
- [ 5, 0 ],
- [ -1, -1 ],
- [ 2, 0 ],
- [ 3, 0 ],
- [ -2, -1 ],
- [ -3, -1 ],
- [ 0, 1 ],
-]
-
const LAYOUT_ITALIA = [
//[ 0, -2 ],
[ -1, -2 ],
@@ -458,6 +458,46 @@ const LAYOUT_THRACIA = [
[ -1, -2 ],
]
+const LAYOUT_BRITANNIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 2, 0 ],
+ [ -2, 0 ],
+ [ -3, 0 ],
+ [ -3, 1 ],
+ [ -3, 2 ],
+ [ -2, 1 ],
+ [ -2, 2 ],
+ [ -3, 3 ],
+]
+
+const LAYOUT_GALATIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 1, -1 ],
+ [ 0, -1 ],
+ [ -1, -1 ],
+ [ 1, -2 ],
+ [ 0, -2 ],
+ [ -1, -2 ],
+ [ -1, -3 ],
+]
+
+const LAYOUT_SYRIA = [
+ [ -1, 0 ],
+ [ 1, 0 ],
+ [ 1, -1 ],
+ [ 0, -1 ],
+ [ -1, -1 ],
+ [ -2, 0 ],
+ [ 2, 0 ],
+ [ -2, -1 ],
+ [ 2, -1 ],
+ [ 0, -2 ],
+ [ -1, -2 ],
+ [ 1, -2 ],
+]
+
const LAYOUT_AEGYPTUS = [
[ -1, 0 ],
[ -2, 0 ],
@@ -506,46 +546,6 @@ const LAYOUT_HISPANIA = [
[ -1, 3 ],
]
-const LAYOUT_BRITANNIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 2, 0 ],
- [ -2, 0 ],
- [ -3, 0 ],
- [ -3, 1 ],
- [ -3, 2 ],
- [ -2, 1 ],
- [ -2, 2 ],
- [ -3, 3 ],
-]
-
-const LAYOUT_GALATIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 1, -1 ],
- [ 0, -1 ],
- [ -1, -1 ],
- [ 1, -2 ],
- [ 0, -2 ],
- [ -1, -2 ],
- [ -1, -3 ],
-]
-
-const LAYOUT_SYRIA = [
- [ -1, 0 ],
- [ 1, 0 ],
- [ 1, -1 ],
- [ 0, -1 ],
- [ -1, -1 ],
- [ -2, 0 ],
- [ 2, 0 ],
- [ -2, -1 ],
- [ 2, -1 ],
- [ 0, -2 ],
- [ -1, -2 ],
- [ 1, -2 ],
-]
-
const LAYOUT_PATTERN = [
LAYOUT_ITALIA,
LAYOUT_ASIA,
@@ -554,19 +554,19 @@ const LAYOUT_PATTERN = [
LAYOUT_PANNONIA,
LAYOUT_THRACIA,
- LAYOUT_AEGYPTUS,
- LAYOUT_AFRICA,
- LAYOUT_HISPANIA,
-
LAYOUT_BRITANNIA,
LAYOUT_GALATIA,
LAYOUT_SYRIA,
+ LAYOUT_AEGYPTUS,
+ LAYOUT_AFRICA,
+ LAYOUT_HISPANIA,
+
LAYOUT_ALAMANNI,
LAYOUT_HOMELAND,
LAYOUT_HOMELAND,
- LAYOUT_NOMADS,
LAYOUT_SASSANIDS,
+ LAYOUT_NOMADS,
LAYOUT_SEA,
LAYOUT_SEA,
@@ -607,14 +607,14 @@ let ui = {
document.getElementById("mapsvg").getElementById("region_pannonia"),
document.getElementById("mapsvg").getElementById("region_thracia"),
- document.getElementById("mapsvg").getElementById("region_aegyptus"),
- document.getElementById("mapsvg").getElementById("region_africa"),
- document.getElementById("mapsvg").getElementById("region_hispania"),
-
document.getElementById("mapsvg").getElementById("region_britannia"),
document.getElementById("mapsvg").getElementById("region_galatia"),
document.getElementById("mapsvg").getElementById("region_syria"),
+ document.getElementById("mapsvg").getElementById("region_aegyptus"),
+ document.getElementById("mapsvg").getElementById("region_africa"),
+ document.getElementById("mapsvg").getElementById("region_hispania"),
+
document.getElementById("mapsvg").getElementById("region_alamanni"),
document.getElementById("mapsvg").getElementById("region_franks"),
document.getElementById("mapsvg").getElementById("region_goths"),
@@ -919,11 +919,6 @@ function on_update() {
ui.body.classList.toggle("p3", player_count === 3)
ui.body.classList.toggle("p4", player_count === 4)
- ui.header.classList.toggle("player_red", view.current === 0)
- ui.header.classList.toggle("player_blue", view.current === 1)
- ui.header.classList.toggle("player_yellow", view.current === 2)
- ui.header.classList.toggle("player_green", view.current === 3)
-
if (player_count < 4)
hide(document.getElementById("role_Green"))
else
diff --git a/rules.js b/rules.js
index 2c866d6..6259195 100644
--- a/rules.js
+++ b/rules.js
@@ -24,8 +24,6 @@ const P4 = "Green"
exports.scenarios = [ "Standard" ]
exports.roles = function (scenario, options) {
- if (options.players == 1)
- return [ "Solo" ]
if (options.players == 2)
return [ P1, P2 ]
if (options.players == 3)
@@ -42,7 +40,6 @@ const PLAYER_INDEX = {
[P2]: 1,
[P3]: 2,
[P4]: 3,
- "Solo": 4,
"Observer": -1,
}
@@ -61,17 +58,18 @@ const GALLIA = 2
const MACEDONIA = 3
const PANNONIA = 4
const THRACIA = 5
-const AEGYPTUS = 6
-const AFRICA = 7
-const HISPANIA = 8
-const BRITANNIA = 9
-const GALATIA = 10
-const SYRIA = 11
+const BRITANNIA = 6
+const GALATIA = 7
+const SYRIA = 8
+const AEGYPTUS = 9
+const AFRICA = 10
+const HISPANIA = 11
+
const ALAMANNI_HOMELAND = 12
const FRANKS_HOMELAND = 13
const GOTHS_HOMELAND = 14
-const NOMADS_HOMELAND = 15
-const SASSANIDS_HOMELAND = 16
+const SASSANIDS_HOMELAND = 15
+const NOMADS_HOMELAND = 16
const MARE_OCCIDENTALE = 17
const MARE_ORIENTALE = 18
const OCEANUS_ATLANTICUS = 19
@@ -87,17 +85,17 @@ const REGION_NAME = [
"Macedonia",
"Pannonia",
"Thracia",
- "Aegyptus",
- "Africa",
- "Hispania",
"Britannia",
"Galatia",
"Syria",
+ "Aegyptus",
+ "Africa",
+ "Hispania",
"Alamanni Homeland",
"Franks Homeland",
"Goths Homeland",
- "Nomads Homeland",
"Sassanids Homeland",
+ "Nomads Homeland",
"Mare Occidentale",
"Mare Orientale",
"Oceanus Atlanticus",
@@ -113,17 +111,17 @@ const ADJACENT = [
/* MACEDONIA */ [ PANNONIA, THRACIA, MARE_OCCIDENTALE, MARE_ORIENTALE ],
/* PANNONIA */ [ ITALIA, GALLIA, MACEDONIA, THRACIA, ALAMANNI_HOMELAND, FRANKS_HOMELAND, MARE_OCCIDENTALE ],
/* THRACIA */ [ ASIA, MACEDONIA, PANNONIA, ALAMANNI_HOMELAND, GOTHS_HOMELAND, MARE_ORIENTALE, PONTUS_EUXINUS ],
- /* AEGYPTUS */ [ AFRICA, SYRIA, NOMADS_HOMELAND, MARE_ORIENTALE ],
- /* AFRICA */ [ AEGYPTUS, HISPANIA, NOMADS_HOMELAND, MARE_OCCIDENTALE, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
- /* HISPANIA */ [ GALLIA, AFRICA, MARE_OCCIDENTALE, OCEANUS_ATLANTICUS ],
/* BRITANNIA */ [ OCEANUS_ATLANTICUS ],
/* GALATIA */ [ ASIA, SYRIA, SASSANIDS_HOMELAND, MARE_ORIENTALE, PONTUS_EUXINUS ],
/* SYRIA */ [ AEGYPTUS, GALATIA, SASSANIDS_HOMELAND, MARE_ORIENTALE ],
+ /* AEGYPTUS */ [ AFRICA, SYRIA, NOMADS_HOMELAND, MARE_ORIENTALE ],
+ /* AFRICA */ [ AEGYPTUS, HISPANIA, NOMADS_HOMELAND, MARE_OCCIDENTALE, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
+ /* HISPANIA */ [ GALLIA, AFRICA, MARE_OCCIDENTALE, OCEANUS_ATLANTICUS ],
/* ALAMANNI_HOMELAND */ [ PANNONIA, THRACIA, FRANKS_HOMELAND, GOTHS_HOMELAND ],
/* FRANKS_HOMELAND */ [ GALLIA, PANNONIA, ALAMANNI_HOMELAND ],
/* GOTHS_HOMELAND */ [ THRACIA, ALAMANNI_HOMELAND, PONTUS_EUXINUS ],
- /* NOMADS_HOMELAND */ [ AEGYPTUS, AFRICA, OCEANUS_ATLANTICUS ],
/* SASSANIDS_HOMELAND */ [ GALATIA, SYRIA, PONTUS_EUXINUS ],
+ /* NOMADS_HOMELAND */ [ AEGYPTUS, AFRICA, OCEANUS_ATLANTICUS ],
/* MARE_OCCIDENTALE */ [ ITALIA, GALLIA, MACEDONIA, PANNONIA, AFRICA, HISPANIA, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
/* MARE_ORIENTALE */ [ ASIA, MACEDONIA, THRACIA, AEGYPTUS, AFRICA, GALATIA, SYRIA, MARE_OCCIDENTALE ],
/* OCEANUS_ATLANTICUS */ [ GALLIA, AFRICA, HISPANIA, BRITANNIA, NOMADS_HOMELAND, MARE_OCCIDENTALE ],
@@ -137,17 +135,17 @@ const PRETENDER_ADJACENT = [
/* MACEDONIA */ [ PANNONIA, THRACIA, MARE_OCCIDENTALE, MARE_ORIENTALE ],
/* PANNONIA */ [ ITALIA, GALLIA, MACEDONIA, THRACIA, ALAMANNI_HOMELAND, FRANKS_HOMELAND, MARE_OCCIDENTALE ],
/* THRACIA */ [ ASIA, MACEDONIA, PANNONIA, ALAMANNI_HOMELAND, GOTHS_HOMELAND, MARE_ORIENTALE, PONTUS_EUXINUS ],
- /* AEGYPTUS */ [ AFRICA, SYRIA, NOMADS_HOMELAND, MARE_ORIENTALE ],
- /* AFRICA */ [ AEGYPTUS, HISPANIA, NOMADS_HOMELAND, MARE_OCCIDENTALE, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
- /* HISPANIA */ [ GALLIA, AFRICA, MARE_OCCIDENTALE, OCEANUS_ATLANTICUS ],
/* BRITANNIA */ [ GALLIA, OCEANUS_ATLANTICUS ],
/* GALATIA */ [ ASIA, SYRIA, SASSANIDS_HOMELAND, MARE_ORIENTALE, PONTUS_EUXINUS ],
/* SYRIA */ [ AEGYPTUS, GALATIA, SASSANIDS_HOMELAND, MARE_ORIENTALE ],
+ /* AEGYPTUS */ [ AFRICA, SYRIA, NOMADS_HOMELAND, MARE_ORIENTALE ],
+ /* AFRICA */ [ AEGYPTUS, HISPANIA, NOMADS_HOMELAND, MARE_OCCIDENTALE, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
+ /* HISPANIA */ [ GALLIA, AFRICA, MARE_OCCIDENTALE, OCEANUS_ATLANTICUS ],
/* ALAMANNI_HOMELAND */ [ PANNONIA, THRACIA, FRANKS_HOMELAND, GOTHS_HOMELAND ],
/* FRANKS_HOMELAND */ [ GALLIA, PANNONIA, ALAMANNI_HOMELAND ],
/* GOTHS_HOMELAND */ [ THRACIA, ALAMANNI_HOMELAND, PONTUS_EUXINUS ],
- /* NOMADS_HOMELAND */ [ AEGYPTUS, AFRICA, OCEANUS_ATLANTICUS ],
/* SASSANIDS_HOMELAND */ [ GALATIA, SYRIA, PONTUS_EUXINUS ],
+ /* NOMADS_HOMELAND */ [ AEGYPTUS, AFRICA, OCEANUS_ATLANTICUS ],
/* MARE_OCCIDENTALE */ [ ITALIA, GALLIA, MACEDONIA, PANNONIA, AFRICA, HISPANIA, MARE_ORIENTALE, OCEANUS_ATLANTICUS ],
/* MARE_ORIENTALE */ [ ASIA, MACEDONIA, THRACIA, AEGYPTUS, AFRICA, GALATIA, SYRIA, MARE_OCCIDENTALE ],
/* OCEANUS_ATLANTICUS */ [ GALLIA, AFRICA, HISPANIA, BRITANNIA, NOMADS_HOMELAND, MARE_OCCIDENTALE ],
@@ -159,11 +157,11 @@ const PRETENDER_ADJACENT = [
const ALAMANNI = 0
const FRANKS = 1
const GOTHS = 2
-const NOMADS = 3
-const SASSANIDS = 4
+const SASSANIDS = 3
+const NOMADS = 4
-const first_barbarian = [ 0, 10, 20, 31, 41 ]
-const last_barbarian = [ 9, 19, 30, 40, 52 ]
+const first_barbarian = [ 0, 10, 20, 31, 43 ]
+const last_barbarian = [ 9, 19, 30, 42, 52 ]
const CNIVA = first_barbarian[GOTHS] + 0
const ARDASHIR = first_barbarian[SASSANIDS] + 0
@@ -188,16 +186,16 @@ const BARBARIAN_NAME = [
"Alamanni",
"Franks",
"Goths",
- "Nomads",
"Sassanids",
+ "Nomads",
]
const BARBARIAN_HOMELAND = [
ALAMANNI_HOMELAND,
FRANKS_HOMELAND,
GOTHS_HOMELAND,
- NOMADS_HOMELAND,
SASSANIDS_HOMELAND,
+ NOMADS_HOMELAND,
]
const BARBARIAN_INVASION = [
@@ -218,16 +216,16 @@ const BARBARIAN_INVASION = [
[ 3, 4, [ ASIA, MACEDONIA ] ],
[ 5, 6, [ GALATIA, SYRIA ] ],
],
- // Nomads
- [
- [ 1, 3, [ AFRICA, HISPANIA ] ],
- [ 4, 6, [ AEGYPTUS, SYRIA ] ],
- ],
// Sassanids
[
[ 1, 3, [ GALATIA, ASIA ] ],
[ 4, 6, [ SYRIA, AEGYPTUS ] ],
],
+ // Nomads
+ [
+ [ 1, 3, [ AFRICA, HISPANIA ] ],
+ [ 4, 6, [ AEGYPTUS, SYRIA ] ],
+ ],
]
const CRISIS_TABLE_4P = [
@@ -1046,9 +1044,9 @@ function eliminate_militia(where) {
remove_militia_castra(where)
}
-function flip_discard_to_available() {
- game.draw[game.current] = game.discard[game.current]
- game.discard[game.current] = []
+function flip_discard_to_available(p) {
+ game.draw[p] = game.discard[p]
+ game.discard[p] = []
}
function assign_hit_to_legion(id) {
@@ -1113,7 +1111,7 @@ states.setup_province = {
view.selected_governor = game.current * 6
view.selected_general = game.current * 6
view.color = SENATE
- for (let where = 2; where <= 12; ++where)
+ for (let where = 1; where < 12; ++where)
if (is_neutral_province(where) && !is_no_place_governor(where))
gen_action("capital", where)
},
@@ -1520,7 +1518,7 @@ states.ludi_saeculares = {
},
card(c) {
push_undo()
- set_remove(current_hand(), c)
+ set_delete(current_hand(), c)
set_add(current_discard(), c)
award_legacy(game.current, "Ludi Saeculares", 2 * card_value(c))
game.state = "ludi_saeculares_done"
@@ -3641,7 +3639,7 @@ states.flip_inactive_barbarians = {
function goto_refill_hand() {
if (current_draw().length === 0)
- flip_discard_to_available()
+ flip_discard_to_available(game.current)
game.state = "refill_hand"
}
@@ -3664,7 +3662,7 @@ states.refill_hand = {
set_delete(draw, c)
set_add(hand, c)
if (draw.length === 0)
- flip_discard_to_available()
+ flip_discard_to_available(game.current)
},
done() {
clear_undo()
@@ -3735,7 +3733,7 @@ function goto_game_over(result, victory) {
game.active = "None"
game.result = result
game.victory = victory
- log_h1("Game Over")
+ log_br()
log(game.victory)
return true
}
@@ -3792,10 +3790,7 @@ function setup_barbarians(tribe, home) {
}
exports.setup = function (seed, scenario, options) {
- let real_player_count = options.players || 4
- let player_count = real_player_count
- if (player_count === 1)
- player_count = 4
+ let player_count = options.players || 4
game = {
seed: seed,
@@ -3850,9 +3845,6 @@ exports.setup = function (seed, scenario, options) {
discard: [],
}
- if (real_player_count === 1)
- game.solo = 1
-
game.events = setup_events()
game.market = [
@@ -3872,14 +3864,14 @@ exports.setup = function (seed, scenario, options) {
setup_barbarians(GOTHS, GOTHS_HOMELAND)
if (player_count >= 3)
- setup_barbarians(NOMADS, NOMADS_HOMELAND)
+ setup_barbarians(SASSANIDS, SASSANIDS_HOMELAND)
else
- setup_barbarians(NOMADS, UNAVAILABLE)
+ setup_barbarians(SASSANIDS, UNAVAILABLE)
if (player_count >= 4)
- setup_barbarians(SASSANIDS, SASSANIDS_HOMELAND)
+ setup_barbarians(NOMADS, NOMADS_HOMELAND)
else
- setup_barbarians(SASSANIDS, UNAVAILABLE)
+ setup_barbarians(NOMADS, UNAVAILABLE)
for (let player = 0; player < player_count; ++player) {
game.hand[player] = []
@@ -3901,10 +3893,7 @@ function load_game(state) {
}
function save_game() {
- if (game.solo)
- game.active = "Solo"
- else
- game.active = PLAYER_NAMES[game.current]
+ game.active = PLAYER_NAMES[game.current]
return game
}
@@ -3932,8 +3921,6 @@ exports.view = function (state, player_name) {
load_game(state)
let player = PLAYER_INDEX[player_name]
- if (game.solo)
- player = game.current
let player_count = game.legacy.length
view = {
@@ -3972,7 +3959,7 @@ exports.view = function (state, player_name) {
if (game.state === "game_over") {
view.prompt = game.victory
- } else if (player !== game.current && player_name !== "Solo") {
+ } else if (game.current !== player) {
let inactive = states[game.state].inactive || game.state
view.prompt = `Waiting for ${PLAYER_NAMES[game.current]} \u2014 ${inactive}...`
} else {
diff --git a/tools/genmove.js b/tools/genmove.js
index a1dbc19..52a87cd 100644
--- a/tools/genmove.js
+++ b/tools/genmove.js
@@ -22,46 +22,45 @@ function set_add(set, item) {
array_insert(set, a, item)
}
-const ITALIA = 1
-const ASIA = 2
-const GALLIA = 3
-const MACEDONIA = 4
-const PANNONIA = 5
-const THRACIA = 6
-
-const AEGYPTUS = 7
-const AFRICA = 8
-const HISPANIA = 9
-
-const BRITANNIA = 10
-const GALATIA = 11
-const SYRIA = 12
-
-const ALAMANNI_HOMELAND = 13
-const FRANKS_HOMELAND = 14
-const GOTHS_HOMELAND = 15
-const NOMADS_HOMELAND = 16
-const SASSANIDS_HOMELAND = 17
-
-const MARE_OCCIDENTALE = 18
-const MARE_ORIENTALE = 19
-const OCEANUS_ATLANTICUS = 20
-const PONTUS_EUXINUS = 21
+const ITALIA = 0
+const ASIA = 1
+const GALLIA = 2
+const MACEDONIA = 3
+const PANNONIA = 4
+const THRACIA = 5
+
+const BRITANNIA = 6
+const GALATIA = 7
+const SYRIA = 8
+
+const AEGYPTUS = 9
+const AFRICA = 10
+const HISPANIA = 11
+
+const ALAMANNI_HOMELAND = 12
+const FRANKS_HOMELAND = 13
+const GOTHS_HOMELAND = 14
+const NOMADS_HOMELAND = 15
+const SASSANIDS_HOMELAND = 16
+
+const MARE_OCCIDENTALE = 17
+const MARE_ORIENTALE = 18
+const OCEANUS_ATLANTICUS = 19
+const PONTUS_EUXINUS = 20
const names = [
- "null",
"ITALIA",
"ASIA",
"GALLIA",
"MACEDONIA",
"PANNONIA",
"THRACIA",
- "AEGYPTUS",
- "AFRICA",
- "HISPANIA",
"BRITANNIA",
"GALATIA",
"SYRIA",
+ "AEGYPTUS",
+ "AFRICA",
+ "HISPANIA",
"ALAMANNI_HOMELAND",
"FRANKS_HOMELAND",
"GOTHS_HOMELAND",
@@ -109,7 +108,7 @@ adj(MARE_OCCIDENTALE, OCEANUS_ATLANTICUS, MARE_ORIENTALE)
adj(ALAMANNI_HOMELAND)
console.log("const ADJACENT = [")
-for (let i = 0; i <= 21; ++i) {
+for (let i = 0; i < 21; ++i) {
console.log("\t/*", names[i], "*/ [", ADJACENT[i].map(i => names[i]).join(", "), "],")
}
console.log("]")