From 7eadd297b6c8b04d9636d61ce3742965ce8965de Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 5 Jun 2023 01:23:20 +0200 Subject: Skeleton. --- README | 5 ++ cover.1x.jpg | Bin 0 -> 20851 bytes cover.2x.jpg | Bin 0 -> 56869 bytes cover.png | Bin 0 -> 354781 bytes play.html | 167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ rules.js | 66 +++++++++++++++++++++++ thumbnail.jpg | Bin 0 -> 13104 bytes title.sql | 1 + 8 files changed, 239 insertions(+) create mode 100644 README create mode 100644 cover.1x.jpg create mode 100644 cover.2x.jpg create mode 100644 cover.png create mode 100644 play.html create mode 100644 rules.js create mode 100644 thumbnail.jpg create mode 100644 title.sql diff --git a/README b/README new file mode 100644 index 0000000..96aab78 --- /dev/null +++ b/README @@ -0,0 +1,5 @@ +This game is implemented with the generous permission of Hollandspiele. + +Rules and art copyright 2023 Hollandspiele. + +Copyright 2023 by Tor Andersson. diff --git a/cover.1x.jpg b/cover.1x.jpg new file mode 100644 index 0000000..be60411 Binary files /dev/null and b/cover.1x.jpg differ diff --git a/cover.2x.jpg b/cover.2x.jpg new file mode 100644 index 0000000..4339291 Binary files /dev/null and b/cover.2x.jpg differ diff --git a/cover.png b/cover.png new file mode 100644 index 0000000..32cd6fb Binary files /dev/null and b/cover.png differ diff --git a/play.html b/play.html new file mode 100644 index 0000000..dcdefed --- /dev/null +++ b/play.html @@ -0,0 +1,167 @@ + + + + + + +THE FIELD OF THE CLOTH OF GOLD + + + + + + + + + +
+
+ +
+
+
+
+
+ + + +
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
Hand
+
+ +
+
+
+
+
+ +
+
+ +
+ + + + diff --git a/rules.js b/rules.js new file mode 100644 index 0000000..6229427 --- /dev/null +++ b/rules.js @@ -0,0 +1,66 @@ +"use strict" + +const RED = "Red" +const BLUE = "Blue" + +var game, view, states + +exports.scenarios = [ "Standard" ] + +exports.roles = [ RED, BLUE ] + +exports.setup = function (seed, scenario, options) { + game = { + seed: seed, + state: null, + log: [], + undo: [], + } + return game +} + +exports.action = function (state, player, action, arg) { + game = state + let S = states[game.state] + if (action in S) + S[action](arg, player) + else + throw new Error("Invalid action: " + action) + return game +} + +exports.resign = function (state, player) { + game = state + if (game.state !== 'game_over') { + if (player === RED) + goto_game_over(BLUE, "Red resigned.") + if (player === BLUE) + goto_game_over(RED, "Blue resigned.") + } + return game +} + +exports.view = function(state, player) { + game = state + + let view = { + log: game.log, + prompt: null, + } + + if (game.state === "game_over") { + view.prompt = game.victory + } else if (player !== game.active) { + let inactive = states[game.state].inactive || game.state + view.prompt = `Waiting for ${game.active} \u2014 ${inactive}...` + } else { + view.actions = {} + states[game.state].prompt() + if (game.undo && game.undo.length > 0) + view.actions.undo = 1 + else + view.actions.undo = 0 + } + + return view; +} diff --git a/thumbnail.jpg b/thumbnail.jpg new file mode 100644 index 0000000..924bc94 Binary files /dev/null and b/thumbnail.jpg differ diff --git a/title.sql b/title.sql new file mode 100644 index 0000000..42a83d3 --- /dev/null +++ b/title.sql @@ -0,0 +1 @@ +insert or replace into titles ( title_id, title_name, bgg ) values ( 'field-cloth-gold', 'The Field of the Cloth of Gold', 309752 ); -- cgit v1.2.3