summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-29 22:30:21 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit5d7400432889fb9de7be20fe6b8306e767b9ddbb (patch)
treedc6ffeb0f558148861f3b143934be2dcc1cdb6b6
parentf261d5350ce4eda5899893cb7f23833fc7d60db8 (diff)
downloadnevsky-5d7400432889fb9de7be20fe6b8306e767b9ddbb.tar.gz
Fix flip & reduce transports at start/end of winter.
-rw-r--r--data.js12
-rw-r--r--rules.js16
-rw-r--r--tools/gendata.js24
3 files changed, 26 insertions, 26 deletions
diff --git a/data.js b/data.js
index e61c286..5ddc6fa 100644
--- a/data.js
+++ b/data.js
@@ -204,9 +204,9 @@ cards:[
{"name":"T16","event":"Famine","when":"this_campaign","capability":"Ransom","this_lord":false,"lords":null},
{"name":"T17","event":"Dietrich von Grüningen","when":"hold","capability":"Stonemasons","this_lord":true,"lords":[0,1,2,3,4,5]},
{"name":"T18","event":"Swedish Crusade","when":"now","capability":"Cogs","this_lord":true,"lords":[0,1,3]},
-{"name":"T0","event":"No Event","when":"never","capability":null,"this_lord":false,"lords":null},
-{"name":"T0","event":"No Event","when":"never","capability":null,"this_lord":false,"lords":null},
-{"name":"T0","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"T0a","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"T0b","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"T0c","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
{"name":"R1","event":"Bridge","when":"hold","capability":"Luchniki","this_lord":true,"lords":[8,9,10,11]},
{"name":"R2","event":"Marsh","when":"hold","capability":"Luchniki","this_lord":true,"lords":[8,9,10,11]},
{"name":"R3","event":"Pogost","when":"hold","capability":"Streltsy","this_lord":true,"lords":[6,7,8,9,11]},
@@ -225,9 +225,9 @@ cards:[
{"name":"R16","event":"Tempest","when":"now","capability":"Lodya","this_lord":true,"lords":[6,7,8,9,10,11]},
{"name":"R17","event":"Dietrich von Grüningen","when":"this_levy","capability":"Veliky Knyaz","this_lord":true,"lords":[6,7,8,9,10,11]},
{"name":"R18","event":"Bountiful Harvest","when":"now","capability":"Stone Kremlin","this_lord":true,"lords":[6,7,8,9,10,11]},
-{"name":"R0","event":"No Event","when":"never","capability":null,"this_lord":false,"lords":null},
-{"name":"R0","event":"No Event","when":"never","capability":null,"this_lord":false,"lords":null},
-{"name":"R0","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"R0a","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"R0b","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
+{"name":"R0c","event":"No Event","when":"never","capability":"No Capability","this_lord":false,"lords":null},
],
}
if (typeof module !== 'undefined') module.exports = data
diff --git a/rules.js b/rules.js
index 5c0d16f..80788b5 100644
--- a/rules.js
+++ b/rules.js
@@ -2128,7 +2128,10 @@ states.levy_arts_of_war_first = {
let c = game.what[0]
view.arts_of_war = game.what
view.what = c
- if (data.cards[c].this_lord) {
+ if (is_no_event_card(c)) {
+ view.prompt = `Arts of War: No Capability.`
+ view.actions.discard = 1
+ } else if (data.cards[c].this_lord) {
view.prompt = `Arts of War: Assign ${data.cards[c].capability} to a Lord.`
let discard = true
for (let lord of data.cards[c].lords) {
@@ -2139,12 +2142,9 @@ states.levy_arts_of_war_first = {
}
if (discard)
view.actions.discard = 1
- } else if (data.cards[c].capability) {
+ } else {
view.prompt = `Arts of War: Deploy ${data.cards[c].capability}.`
view.actions.deploy = 1
- } else {
- view.prompt = `Arts of War: No Capability.`
- view.actions.discard = 1
}
},
lord(lord) {
@@ -6178,7 +6178,7 @@ function rout_lord(lord) {
function resume_hit_lord() {
if (
(game.battle.h1 === 0 && game.battle.h2 === 0) ||
- (game.who === GARRISON && game.battle.garrison) ||
+ (game.who === GARRISON && !game.battle.garrison) ||
(game.who !== GARRISON && !has_unrouted_units(game.who))
)
end_hit_lord()
@@ -7713,9 +7713,9 @@ function goto_plow_and_reap() {
}
function flip_and_discard_half(lord, from_type, to_type) {
- add_lord_assets(lord, get_lord_assets(lord, from_type, to_type))
+ add_lord_assets(lord, to_type, get_lord_assets(lord, from_type))
set_lord_assets(lord, from_type, 0)
- set_lord_assets(lord, to_type, Math.ceil(get_lord_assets(lord, to_type)))
+ set_lord_assets(lord, to_type, Math.ceil(get_lord_assets(lord, to_type) / 2))
}
states.plow_and_reap = {
diff --git a/tools/gendata.js b/tools/gendata.js
index 3d98773..0a1f5b4 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -650,9 +650,9 @@ arts_of_war_event("T15", "Mindaugas", "now")
arts_of_war_event("T16", "Famine", "this_campaign")
arts_of_war_event("T17", "Dietrich von Grüningen", "hold")
arts_of_war_event("T18", "Swedish Crusade", "now")
-arts_of_war_event("T0", "No Event", "never")
-arts_of_war_event("T0", "No Event", "never")
-arts_of_war_event("T0", "No Event", "never")
+arts_of_war_event("T0a", "No Event", "never")
+arts_of_war_event("T0b", "No Event", "never")
+arts_of_war_event("T0c", "No Event", "never")
arts_of_war_capability("T1", "Treaty of Stensby", false, [ "Heinrich", "Knud & Abel" ])
arts_of_war_capability("T2", "Raiders", true, "any")
@@ -672,9 +672,9 @@ arts_of_war_capability("T15", "Warrior Monks", true, [ "Andreas", "Rudolf" ])
arts_of_war_capability("T16", "Ransom", false, "ALL")
arts_of_war_capability("T17", "Stonemasons", true, "any")
arts_of_war_capability("T18", "Cogs", true, [ "Heinrich", "Knud & Abel", "Andreas" ])
-arts_of_war_capability("T0", "No Capability", false, null)
-arts_of_war_capability("T0", "No Capability", false, null)
-arts_of_war_capability("T0", "No Capability", false, null)
+arts_of_war_capability("T0a", "No Capability", false, null)
+arts_of_war_capability("T0b", "No Capability", false, null)
+arts_of_war_capability("T0c", "No Capability", false, null)
arts_of_war_event("R1", "Bridge", "hold")
arts_of_war_event("R2", "Marsh", "hold")
@@ -694,9 +694,9 @@ arts_of_war_event("R15", "Death of the Pope", "this_levy")
arts_of_war_event("R16", "Tempest", "now")
arts_of_war_event("R17", "Dietrich von Grüningen", "this_levy")
arts_of_war_event("R18", "Bountiful Harvest", "now")
-arts_of_war_event("R0", "No Event", "never")
-arts_of_war_event("R0", "No Event", "never")
-arts_of_war_event("R0", "No Event", "never")
+arts_of_war_event("R0a", "No Event", "never")
+arts_of_war_event("R0b", "No Event", "never")
+arts_of_war_event("R0c", "No Event", "never")
arts_of_war_capability("R1", "Luchniki", true, [ "Vladislav", "Karelians", "Gavrilo", "Domash" ])
arts_of_war_capability("R2", "Luchniki", true, [ "Vladislav", "Karelians", "Gavrilo", "Domash" ])
@@ -716,9 +716,9 @@ arts_of_war_capability("R15", "Archbishopric", false, "any")
arts_of_war_capability("R16", "Lodya", true, "any")
arts_of_war_capability("R17", "Veliky Knyaz", true, "any")
arts_of_war_capability("R18", "Stone Kremlin", true, "any")
-arts_of_war_capability("R0", "No Capability", false, null)
-arts_of_war_capability("R0", "No Capability", false, null)
-arts_of_war_capability("R0", "No Capability", false, null)
+arts_of_war_capability("R0a", "No Capability", false, null)
+arts_of_war_capability("R0b", "No Capability", false, null)
+arts_of_war_capability("R0c", "No Capability", false, null)
let vassals = []
for (let lord of lords)