From 89366b0aff5217665ea511f856681f9a60602c2e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 22 Jun 2021 12:10:07 +0200 Subject: crusader: Change role names to noun form. --- data.js | 5 +++-- play.html | 20 ++++++++++---------- rules.js | 57 ++++++++++++++++++++++++++------------------------------- ui.js | 8 ++++---- 4 files changed, 43 insertions(+), 47 deletions(-) diff --git a/data.js b/data.js index 07178c6..780dd50 100644 --- a/data.js +++ b/data.js @@ -105,6 +105,7 @@ const TOWNS = { "England3":{"x":138,"y":1047}, "FP":{"x":120,"y":2150}, "SP":{"x":120,"y":2150}, + "Dead":{"x":120,"y":2150}, */ "Germania":{"x":139,"y":273}, "France":{"x":140,"y":573}, @@ -142,10 +143,10 @@ const PORTS = []; } function frank(rc, name, home, move, steps, combat, order, plural) { - army(rc, "Frank", name, home, move, steps, combat, order, plural); + army(rc, "Franks", name, home, move, steps, combat, order, plural); } function saracen(rc, name, home, move, steps, combat, order, plural) { - army(rc, "Saracen", name, home, move, steps, combat, order, plural); + army(rc, "Saracens", name, home, move, steps, combat, order, plural); } diff --git a/play.html b/play.html index 73e2833..025f1d3 100644 --- a/play.html +++ b/play.html @@ -19,8 +19,8 @@ .grid_log { background-color: ghostwhite; } .grid_top { background-color: gainsboro; } .grid_top.your_turn { background-color: orange; } -.grid_top.Frank.your_turn { background-color: gold; } -.grid_top.Saracen.your_turn { background-color: lightgreen; } +.grid_top.Franks.your_turn { background-color: gold; } +.grid_top.Saracens.your_turn { background-color: lightgreen; } .grid_top.disconnected { background-color: red; } .role_info { background-color: silver; } .one .role_name { background-color: khaki; } @@ -149,15 +149,15 @@ body.shift .block.known:hover { box-shadow: 0px 0px 4px 0px black; } -.block.Frank { border: 3px solid darkkhaki; background-color: khaki; } -.block.Saracen { border: 3px solid seagreen; background-color: darkseagreen; } +.block.Franks { border: 3px solid darkkhaki; background-color: khaki; } +.block.Saracens { border: 3px solid seagreen; background-color: darkseagreen; } .block.Assassins { border: 3px solid rebeccapurple; background-color: rebeccapurple; } -.block.Frank.highlight { border-color: white; } -.block.Saracen.highlight { border-color: white; } +.block.Franks.highlight { border-color: white; } +.block.Saracens.highlight { border-color: white; } -.block.Frank.selected { border-color: gold; } -.block.Saracen.selected { border-color: lightgreen; } +.block.Franks.selected { border-color: gold; } +.block.Saracens.selected { border-color: lightgreen; } .block.Assassins.selected { border-color: hotpink; box-shadow: none; } .block.highlight { cursor: pointer; } @@ -374,13 +374,13 @@ body.shift .block.known:hover {
-
Frank ($USER)
+
Franks ($USER)
-
Saracen ($USER)
+
Saracens ($USER)
diff --git a/rules.js b/rules.js index 4a43391..22aadc1 100644 --- a/rules.js +++ b/rules.js @@ -23,10 +23,10 @@ exports.scenarios = [ const { CARDS, BLOCKS, TOWNS, PORTS, ROADS } = require('./data'); -const FRANK = "Frank"; -const SARACEN = "Saracen"; +const FRANK = "Franks"; +const SARACEN = "Saracens"; const ASSASSINS = "Assassins"; -const ENEMY = { Frank: "Saracen", Saracen: "Frank" }; +const ENEMY = { Franks: "Saracens", Saracens: "Franks" }; const OBSERVER = "Observer"; const BOTH = "Both"; const DEAD = "Dead"; @@ -34,7 +34,7 @@ const F_POOL = "FP"; const S_POOL = "SP"; const ENGLAND = "England"; const FRANCE = "France"; -const GERMANY = "Germany"; +const GERMANIA = "Germania"; const INTRIGUE = 3; const WINTER_CAMPAIGN = 6; @@ -58,11 +58,6 @@ function log(...args) { game.log.push(s); } -function logp(...args) { - let s = game.active + " " + Array.from(args).join(""); - game.log.push(s); -} - function log_move_start(from) { game.move_buf = [ from ]; } @@ -266,7 +261,7 @@ function is_block_on_map(who) { function is_block_on_land(who) { let location = game.location[who]; return location && location != DEAD && location != F_POOL && location != S_POOL && - location != ENGLAND && location != FRANCE && location != GERMANY; + location != ENGLAND && location != FRANCE && location != GERMANIA; } function can_activate(who) { @@ -868,7 +863,7 @@ states.play_card = { if (current == FRANK) { view.prior_s_card = game.prior_s_card; if (game.f_card) { - view.prompt = "Waiting for Saracen to play a card."; + view.prompt = "Waiting for Saracens to play a card."; gen_action(view, 'undo'); } else { view.prompt = "Play a card."; @@ -880,7 +875,7 @@ states.play_card = { if (current == SARACEN) { view.prior_f_card = game.prior_f_card; if (game.s_card) { - view.prompt = "Waiting for Frank to play a card."; + view.prompt = "Waiting for Franks to play a card."; gen_action(view, 'undo'); } else { view.prompt = "Play a card."; @@ -915,8 +910,8 @@ states.play_card = { } function reveal_cards() { - log("Frank plays " + CARDS[game.f_card].name + "."); - log("Saracen plays " + CARDS[game.s_card].name + "."); + log("Franks play " + CARDS[game.f_card].name + "."); + log("Saracens play " + CARDS[game.s_card].name + "."); game.show_cards = true; let fc = CARDS[game.f_card]; @@ -1102,7 +1097,7 @@ states.manna = { game.moved[who] = 1; }, next: function () { - print_summary(game.active + " Manna:"); + print_summary(game.active + " use Manna:"); clear_undo(); game.moved = {}; end_player_turn(); @@ -1327,7 +1322,7 @@ function end_move() { } function end_group_move() { - print_summary(game.active + " activates " + game.where + ":"); + print_summary(game.active + " activate " + game.where + ":"); game.state = 'move_phase'; } @@ -1382,17 +1377,17 @@ states.sea_move_to = { if (besieged_player(to) == game.active) { // Move into besieged fortified port game.castle.push(game.who); - log(game.active + " sea moves:\n" + from + " \u2192 " + to + " castle."); + log(game.active + " sea move:\n" + from + " \u2192 " + to + " castle."); } else if (!is_friendly_port(to)) { // English Crusaders attack! game.attacker[to] = FRANK; game.main_road[to] = "England"; - log(game.active + " sea moves:\n" + from + " \u2192 " + to + ATTACK_MARK + "."); + log(game.active + " sea move:\n" + from + " \u2192 " + to + ATTACK_MARK + "."); } else { // Normal move. - log(game.active + " sea moves:\n" + from + " \u2192 " + to + "."); + log(game.active + " sea move:\n" + from + " \u2192 " + to + "."); } game.who = null; @@ -1448,7 +1443,7 @@ states.muster_who = { game.state = 'muster_move_1'; }, end_muster: function () { - print_summary(game.active + " musters to " + game.where + ":"); + print_summary(game.active + " muster to " + game.where + ":"); game.where = null; game.state = 'move_phase'; }, @@ -1711,9 +1706,9 @@ states.combat_deployment = { clear_undo(); let n = count_blocks_in_castle(game.where); if (n == 1) - log(game.active + " withdraws 1 block."); + log(game.active + " withdraw 1 block."); else - log(game.active + " withdraws " + n + " blocks."); + log(game.active + " withdraw " + n + " blocks."); game.active = game.attacker[game.where]; if (count_enemy_in_field_and_reserve(game.where) == 0) { console.log("DEFENDER REFUSED FIELD BATTLE"); @@ -1756,7 +1751,7 @@ states.regroup = { }, end_regroup: function () { clear_undo(); - print_summary(game.active + " regroups:"); + print_summary(game.active + " regroup:"); if (is_contested_town(game.where)) next_combat_round(); else @@ -1881,7 +1876,7 @@ states.declare_storm = { let n = game.storming.length; console.log("STORM DECLARATION", n); if (n == 0) { - log(game.active + " declines to storm."); + log(game.active + " decline to storm."); goto_declare_sally(); } else { goto_storm_battle(); @@ -1932,10 +1927,10 @@ states.declare_sally = { let n = game.sallying.length; console.log("SALLY DECLARATION", n); if (n == 0) - log(game.active + " declines to sally."); + log(game.active + " decline to sally."); if (is_contested_battle_field()) { if (!game.was_contested) { - log(game.active + " is now the attacker."); + log(game.active + " are now the attacker."); console.log("NEW ATTACKER IS", game.active); game.attacker[game.where] = game.active; } @@ -2008,7 +2003,7 @@ states.retreat = { for (let b in BLOCKS) if (game.location[b] == game.where && !is_block_in_castle(b) && block_owner(b) == game.active) eliminate_block(b); - print_summary(game.active + " retreats:"); + print_summary(game.active + " retreat:"); game.active = ENEMY[game.active]; console.log("ATTACKER RETREATED FROM THE FIELD"); goto_regroup(); @@ -2138,7 +2133,7 @@ function resume_field_battle() { if (is_friendly_field(game.where)) { console.log("FIELD BATTLE WON BY", game.active); - log("Field battle won by " + game.active); + log("Field battle won by " + game.active + "."); return goto_regroup(); } @@ -2211,7 +2206,7 @@ function resume_storm_battle() { if (is_friendly_town(game.where)) { console.log("STORM BATTLE WON BY ATTACKER", game.active); - log("Siege battle won by " + game.active); + log("Siege battle won by " + game.active + "."); return goto_regroup(); } @@ -2510,7 +2505,7 @@ states.harry = { game.flash = block_name(game.who) + " retreat."; else game.flash = block_name(game.who) + " retreats."; - logp("retreats to " + to + "."); + log(game.active + " retreat to " + to + "."); game.location[game.who] = to; move_block(game.who, game.where, to); game.who = null; @@ -2543,7 +2538,7 @@ states.retreat_in_battle = { game.flash = block_name(game.who) + " retreat."; else game.flash = block_name(game.who) + " retreats."; - logp("retreats to " + to + "."); + log(game.active + " retreat to " + to + "."); game.location[game.who] = to; move_block(game.who, game.where, to); game.who = null; diff --git a/ui.js b/ui.js index 3dd0b96..f25f5e4 100644 --- a/ui.js +++ b/ui.js @@ -1,9 +1,9 @@ "use strict"; -const FRANK = "Frank"; -const SARACEN = "Saracen"; +const FRANK = "Franks"; +const SARACEN = "Saracens"; const ASSASSINS = "Assassins"; -const ENEMY = { Saracen: "Frank", Frank: "Saracen" } +const ENEMY = { Saracens: "Franks", Franks: "Saracens" } const DEAD = "Dead"; const F_POOL = "FP"; const S_POOL = "SP"; @@ -753,4 +753,4 @@ drag_element_with_mouse(".battle", ".battle_header"); scroll_with_middle_mouse(".grid_center", 3); init_map_zoom(); init_shift_zoom(); -init_client(["Frank", "Saracen"]); +init_client(["Franks", "Saracens"]); -- cgit v1.2.3