summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--about.html1
-rw-r--r--info/notes.html28
-rw-r--r--rules.js83
3 files changed, 61 insertions, 51 deletions
diff --git a/about.html b/about.html
index 7a26c64..b8014f8 100644
--- a/about.html
+++ b/about.html
@@ -23,4 +23,5 @@ Copyright © 2019
<li><a href="/nevsky/info/pac.html">Reference Sheets</a>
<li><a href="/nevsky/info/cards.html">Arts of War</a>
<li><a href="/nevsky/info/lords.html">Lord Mats</a>
+<li><a href="/nevsky/info/notes.html">Implementation Notes</a>
</ul>
diff --git a/info/notes.html b/info/notes.html
new file mode 100644
index 0000000..b88e5ea
--- /dev/null
+++ b/info/notes.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<head>
+<title>Nevsky - Notes</title>
+<link rel="stylesheet" href="/fonts/fonts.css">
+<link rel="stylesheet" href="/style.css">
+<style>h1{text-align:center}body{max-width:50rem;margin:0 auto;}</style>
+</head>
+<body>
+<article>
+
+<h1>
+Nevsky: Implementation Notes</h1>
+
+<hr>
+
+<p>
+
+<p>
+Sequence of play changes for expediency:
+
+<ul>
+<li> One side does all of Feed, Pay, and Disband before next side.
+<li> Russians Feed, Pay, and Disband first after a Russian command card.
+<li> One side does both Wastage and Discard before next side.
+</ul>
+
+<hr>
+<p style="font-style:normal;font-size:36px;text-align:center;margin:0">&#x2766;</p>
diff --git a/rules.js b/rules.js
index 24ef9ab..4e9cda8 100644
--- a/rules.js
+++ b/rules.js
@@ -35,14 +35,7 @@ const RUSSIANS = "Russians"
const P1 = TEUTONS
const P2 = RUSSIANS
-// NOTE: With Hidden Mats option, the player order of feed/pay may matter.
-const FEED_PAY_DISBAND = true // feed, pay, disband in one go
-const WASTAGE_DISCARD = true // wastage, discard in one go
-// option ACTIVE_FEED_FIRST // active card feeds first (instead of P1 always first)
-// option DELAY_PAY_IF_NO_FEED_OR_DISBAND
-// TODO service shift before spoils
-// option SERVICE_BEFORE_SPOILS
-// option AUTO_SELECT_STRIKE_GROUPS
+// TODO: service shift before spoils ?
const DIE_HIT = "01234567"
const DIE_MISS = "01234567"
@@ -4219,6 +4212,20 @@ function goto_command_activation() {
// === CAMPAIGN: ACTIONS ===
+function set_active_command() {
+ if (game.command >= first_p1_lord && game.command <= last_p1_lord)
+ set_active(P1)
+ else
+ set_active(P2)
+}
+
+function is_active_command() {
+ if (game.command >= first_p1_lord && game.command <= last_p1_lord)
+ return game.active === P1
+ else
+ return game.active === P2
+}
+
function is_first_action() {
return game.flags.first_action
}
@@ -4286,8 +4293,6 @@ function spend_all_actions() {
function end_actions() {
log_br()
- set_active(P1)
- game.command = NOBODY
game.group = 0
game.pieces.legate_selected = 0
@@ -4296,6 +4301,8 @@ function end_actions() {
game.flags.teutonic_raiders = 0
game.flags.famine = 0
+ // NOTE: Feed currently acting side first for expedience.
+ set_active_command()
goto_feed()
}
@@ -9047,15 +9054,7 @@ states.feed_lord_shared = {
function end_feed() {
clear_undo()
- if (FEED_PAY_DISBAND) {
- goto_pay()
- } else {
- set_active_enemy()
- if (game.active === P2)
- goto_feed()
- else
- goto_pay()
- }
+ goto_pay()
}
// === LEVY & CAMPAIGN: PAY ===
@@ -9271,16 +9270,16 @@ function end_disband() {
return
set_active_enemy()
- if (game.active === P2) {
- if (FEED_PAY_DISBAND)
- goto_feed()
+ if (is_campaign_phase()) {
+ if (is_active_command())
+ goto_remove_markers()
else
- goto_pay()
+ goto_feed()
} else {
- if (is_levy_phase())
+ if (game.active === P1)
goto_levy_muster()
else
- goto_remove_markers()
+ goto_feed()
}
}
@@ -9681,17 +9680,8 @@ states.wastage = {
}
function end_wastage() {
- if (WASTAGE_DISCARD) {
- push_undo()
- goto_reset()
- } else {
- clear_undo()
- set_active_enemy()
- if (game.active === P2)
- goto_plow_and_reap()
- else
- goto_reset()
- }
+ push_undo()
+ goto_reset()
}
// === END CAMPAIGN: RESET (DISCARD ARTS OF WAR) ===
@@ -9757,21 +9747,12 @@ states.reset = {
}
function end_reset() {
- if (WASTAGE_DISCARD) {
- clear_undo()
- set_active_enemy()
- if (game.active === P2)
- goto_plow_and_reap()
- else
- goto_advance_campaign()
- } else {
- clear_undo()
- set_active_enemy()
- if (game.active === P2)
- goto_reset()
- else
- goto_advance_campaign()
- }
+ clear_undo()
+ set_active_enemy()
+ if (game.active === P2)
+ goto_plow_and_reap()
+ else
+ goto_advance_campaign()
}
// === END CAMPAIGN: RESET (ADVANCE CAMPAIGN) ===