summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-10-27 19:33:59 +0100
committerTor Andersson <tor@ccxvii.net>2024-10-27 19:33:59 +0100
commita6776816e5493055ecf16d5ff9c81c4ebe131f0b (patch)
tree796171a86f9032074f485ff6c1b29741d713246e /rules.js
parent0f7c20a726225883da01cc0c6030a6641b4fbba2 (diff)
downloadmaria-a6776816e5493055ecf16d5ff9c81c4ebe131f0b.tar.gz
ui tweaks and undo steps
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js23
1 files changed, 18 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 57f0da4..c47801f 100644
--- a/rules.js
+++ b/rules.js
@@ -1244,7 +1244,7 @@ states.place_hussars = {
if (!set_has(game.moved, p))
gen_action_piece(p)
if (!has_any_hussar(ELIMINATED))
- view.actions.next = 1
+ view.actions.end_place_hussars = 1
},
piece(p) {
push_undo()
@@ -1252,7 +1252,7 @@ states.place_hussars = {
game.selected = p
game.state = "place_hussars_where"
},
- next() {
+ end_place_hussars() {
end_place_hussars()
},
}
@@ -2111,6 +2111,7 @@ states.movement = {
this.end_movement()
},
end_movement() {
+ push_undo()
if (game.flags & F_MOVE_FLANDERS) {
for (let p of all_power_pieces[game.power])
if (is_flanders_space(game.pos[p]))
@@ -4645,10 +4646,10 @@ states.offer_peace = {
inactive: "offer peace",
prompt() {
prompt("Annex Silesia and offer temporary peace with Austria?")
- view.actions.offer = 1
+ view.actions.peace = 1
view.actions.pass = 1
},
- offer() {
+ peace() {
set_active_to_power(P_AUSTRIA)
game.state = "accept_peace"
},
@@ -4894,6 +4895,7 @@ states.france_reduces_military_objectives = {
view.actions.pass = 1
},
reduce() {
+ push_undo()
game.flags |= F_FRANCE_REDUCED
let n = 0
for (let s of all_core_austria_fortresses) {
@@ -4906,13 +4908,24 @@ states.france_reduces_military_objectives = {
n = (n + 1) >> 1
log("France set aside " + n + " victory markers.")
game.vp[SET_ASIDE_FRANCE] = n
- next_sequence_of_play()
+ game.state = "france_reduces_military_objectives_done"
},
pass() {
next_sequence_of_play()
},
}
+states.france_reduces_military_objectives_done = {
+ inactive: "supply",
+ prompt() {
+ prompt("Set aside " + game.vp[SET_ASIDE_FRANCE] + " victory markers.")
+ view.actions.next = 1
+ },
+ next() {
+ next_sequence_of_play()
+ },
+}
+
/* IMPERIAL ELECTION */
const POWER_FROM_IMPERIAL_ELECTION_STAGE = [