summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-16 22:17:14 +0200
committerTor Andersson <tor@ccxvii.net>2023-06-16 22:31:57 +0200
commit9f1f44f15cb680d31b772ae6fb9f0b8b80397c53 (patch)
tree7efca8873d0d56adfc7d3d5c80e5218c066a15c4
parent0e42289516dd4f2282dc08f3bb7314cd185fce3e (diff)
downloadred-flag-over-paris-9f1f44f15cb680d31b772ae6fb9f0b8b80397c53.tar.gz
Event 12 and 21 - increasing player momentum is optional.
-rw-r--r--events.txt4
-rw-r--r--rules.js52
2 files changed, 52 insertions, 4 deletions
diff --git a/events.txt b/events.txt
index 25751b7..430b120 100644
--- a/events.txt
+++ b/events.txt
@@ -88,7 +88,7 @@ CARD 12 - Otto von Bismarck
# must remove own cube from National Assembly
prompt "Remove 1 from National Assembly."
remove_own NATIONAL_ASSEMBLY
- increase_prussian_collaboration
+ may_increase_prussian_collaboration
ops 2 MILITARY
CARD 13 - Général Ernest de Cissey
@@ -134,7 +134,7 @@ CARD 20 - Banque de France
CARD 21 - Le Réveil
# must not have played Socialist Newspaper Ban
- increase_revolutionary_momentum
+ may_increase_revolutionary_momentum
prompt "Place up to 1 in Press."
place_up_to 1 PRESS
diff --git a/rules.js b/rules.js
index 368637a..6f5a5d5 100644
--- a/rules.js
+++ b/rules.js
@@ -2663,6 +2663,20 @@ function vm_increase_prussian_collaboration() {
vm_next()
}
+function vm_may_increase_revolutionary_momentum() {
+ if (game.red_momentum < 3)
+ game.state = "vm_may_increase_revolutionary_momentum"
+ else
+ vm_next()
+}
+
+function vm_may_increase_prussian_collaboration() {
+ if (game.blue_momentum < 3)
+ game.state = "vm_may_increase_prussian_collaboration"
+ else
+ vm_next()
+}
+
function vm_decrease_revolutionary_momentum() {
if (game.red_momentum > 0)
game.state = "vm_decrease_revolutionary_momentum"
@@ -2832,6 +2846,23 @@ states.vm_increase_revolutionary_momentum = {
},
}
+states.vm_may_increase_revolutionary_momentum = {
+ inactive: "increase Revolutionary Momentum",
+ prompt() {
+ event_prompt("Increase Revolutionary Momentum.")
+ view.actions.red_momentum = 1
+ view.actions.pass = 1
+ },
+ red_momentum() {
+ push_undo()
+ increase_revolutionary_momentum()
+ },
+ pass() {
+ push_undo()
+ vm_next()
+ },
+}
+
states.vm_increase_prussian_collaboration = {
inactive: "increase Prussian Collaboration",
prompt() {
@@ -2844,6 +2875,23 @@ states.vm_increase_prussian_collaboration = {
},
}
+states.vm_may_increase_prussian_collaboration = {
+ inactive: "increase Prussian Collaboration",
+ prompt() {
+ event_prompt("Increase Prussian Collaboration.")
+ view.actions.blue_momentum = 1
+ view.actions.pass = 1
+ },
+ blue_momentum() {
+ push_undo()
+ increase_prussian_collaboration()
+ },
+ pass() {
+ push_undo()
+ vm_next()
+ },
+}
+
states.vm_decrease_revolutionary_momentum = {
inactive: "decrease Revolutionary Momentum",
prompt() {
@@ -3785,7 +3833,7 @@ CODE[11] = [ // Adolphe Thiers
CODE[12] = [ // Otto von Bismarck
[ vm_prompt, "Remove 1 from National Assembly." ],
[ vm_remove_own, NATIONAL_ASSEMBLY ],
- [ vm_increase_prussian_collaboration ],
+ [ vm_may_increase_prussian_collaboration ],
[ vm_ops, 2, MILITARY ],
[ vm_return ],
]
@@ -3844,7 +3892,7 @@ CODE[20] = [ // Banque de France
]
CODE[21] = [ // Le Réveil
- [ vm_increase_revolutionary_momentum ],
+ [ vm_may_increase_revolutionary_momentum ],
[ vm_prompt, "Place up to 1 in Press." ],
[ vm_place_up_to, 1, PRESS ],
[ vm_return ],