summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-19 23:22:55 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-19 23:35:48 +0100
commit3da77df81e8aed49a3c2935b7cc3ff1a735e7924 (patch)
treea093aba3904e4bc4a03041d548bde0282ae3ace8
parent7ed5936e81547858673806c9092ff0b370a9e656 (diff)
downloadland-and-freedom-3da77df81e8aed49a3c2935b7cc3ff1a735e7924.tar.gz
Fix bugs.
-rw-r--r--play.css8
-rw-r--r--play.js3
-rw-r--r--rules.js5
-rw-r--r--rules.ts6
4 files changed, 10 insertions, 12 deletions
diff --git a/play.css b/play.css
index 78fd426..843c4d6 100644
--- a/play.css
+++ b/play.css
@@ -9,10 +9,10 @@ body header.fascist.your_turn { background-color: hsl(30, 35%, 65%); }
#role_Communist { background-color: hsl(0, 55%, 70%); }
#role_Moderate { background-color: hsl(325, 30%, 70%); }
-#log div.h.a { background-color: hsl(257, 10%, 75%); }
-#log div.h.c { background-color: hsl(0, 55%, 75%); }
-#log div.h.m { background-color: hsl(325, 30%, 75%); }
-#log div.h.f { background-color: hsl(30, 35%, 75%); }
+#log div.h.anarchist { background-color: hsl(257, 10%, 75%); }
+#log div.h.communist { background-color: hsl(0, 55%, 75%); }
+#log div.h.moderate { background-color: hsl(325, 30%, 75%); }
+#log div.h.fascist { background-color: hsl(30, 35%, 75%); }
.panel { background-image: url(images/texture.png) }
.panel { background-color: hsl(0, 0%, 60%); }
diff --git a/play.js b/play.js
index fd11f20..f182f97 100644
--- a/play.js
+++ b/play.js
@@ -364,6 +364,7 @@ const faction_class = {
"0": "anarchist",
"1": "communist",
"2": "moderate",
+ "f": "fascist",
}
function update_front(status_card, str_container, con_container, front, front_id) {
@@ -647,7 +648,7 @@ function on_log(text) { // eslint-disable-line no-unused-vars
// text = text.replace(/\bHP\b/g, sub_token)
if (text.startsWith("#")) {
- p.className = "h " + text[1]
+ p.className = "h " + faction_class[text[1]]
text = text.substring(3)
}
diff --git a/rules.js b/rules.js
index 3f1c52c..30c59f9 100644
--- a/rules.js
+++ b/rules.js
@@ -37,7 +37,6 @@ const faction_cards = [
make_list(19, 36),
make_list(1, 18),
];
-console.log(faction_cards);
const fascist_decks = {
1: make_list(55, 72),
2: make_list(73, 90),
@@ -311,7 +310,7 @@ function next(checkpoint = false) {
const node = get_active_node(game.engine);
if (node.t === function_node && engine_functions[node.f]) {
const args = node.a;
- if (args) {
+ if (args !== undefined) {
engine_functions[node.f](args);
}
else {
@@ -1474,7 +1473,7 @@ states.peek_fascist_cards = {
inactive: 'peek at Fascist cards',
prompt() {
gen_spend_hero_points();
- view.prompt = 'Choose one card to return to the top of the deck';
+ view.prompt = 'Return one card to the top of the Fascist deck.';
view.fascist_cards = game.fascist_cards;
for (const c of game.fascist_cards) {
gen_action_card(c);
diff --git a/rules.ts b/rules.ts
index 0e50af6..ca1f191 100644
--- a/rules.ts
+++ b/rules.ts
@@ -119,8 +119,6 @@ const faction_cards = [
make_list(1, 18) as CardId[],
];
-console.log(faction_cards)
-
const fascist_decks = {
1: make_list(55, 72) as CardId[],
2: make_list(73, 90) as CardId[],
@@ -470,7 +468,7 @@ function next(checkpoint = false) {
const node = get_active_node(game.engine);
if (node.t === function_node && engine_functions[node.f]) {
const args = node.a;
- if (args) {
+ if (args !== undefined) {
engine_functions[node.f](args);
} else {
engine_functions[node.f]();
@@ -1808,7 +1806,7 @@ states.peek_fascist_cards = {
inactive: 'peek at Fascist cards',
prompt() {
gen_spend_hero_points();
- view.prompt = 'Choose one card to return to the top of the deck';
+ view.prompt = 'Return one card to the top of the Fascist deck.';
view.fascist_cards = game.fascist_cards;
for (const c of game.fascist_cards) {
gen_action_card(c);