summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-28 11:28:03 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commit5bd0eda4db476f29fd8f29532f2f9135fb9bc295 (patch)
tree27906e950fc96164934e2737803a82b6156a7895
parent7f0bc6422715e637ec3b80f1426b3ae512298f4e (diff)
downloadfriedrich-5bd0eda4db476f29fd8f29532f2f9135fb9bc295.tar.gz
Allow "stop" before moving to flag lord as unmoved.
-rw-r--r--play.js3
-rw-r--r--rules.js23
2 files changed, 16 insertions, 10 deletions
diff --git a/play.js b/play.js
index 82b264b..be86670 100644
--- a/play.js
+++ b/play.js
@@ -305,6 +305,7 @@ const fate_effect_text = [
const panel_order = [ P_PRUSSIA, P_HANOVER, P_RUSSIA, P_SWEDEN, P_AUSTRIA, P_IMPERIAL, P_FRANCE, P_FRANCE+1 ]
const panel_start = {
+ "Observer": P_PRUSSIA,
"Frederick": P_PRUSSIA,
"Elisabeth": P_RUSSIA,
"Maria Theresa": P_AUSTRIA,
@@ -344,7 +345,7 @@ function animate_position(e) {
}
function sort_power_panel(animate) {
- let start = panel_start[params.role]
+ let start = panel_start[params.role] | 0
if (animate)
for (let i = 0; i < 8; ++i)
diff --git a/rules.js b/rules.js
index c56e879..ea98774 100644
--- a/rules.js
+++ b/rules.js
@@ -1508,10 +1508,9 @@ states.move_supply_train = {
if (!has_any_piece(next))
gen_action_space(next)
- if (game.count > 0) {
+ if (game.count > 0)
gen_action_piece(who)
- view.actions.stop = 1
- }
+ view.actions.stop = 1
},
piece(_) {
this.stop()
@@ -1579,6 +1578,12 @@ states.move_general = {
view.actions.take = 1
if (s_give > 0 && u_take > 0)
view.actions.give = 1
+
+ if (forbid_stopping_at(here)) {
+ view.actions.stop = 0
+ } else {
+ view.actions.stop = 1
+ }
} else {
if (forbid_stopping_at(here)) {
view.actions.stop = 0
@@ -1760,12 +1765,6 @@ function can_re_enter_supply_train(s) {
function goto_recruit() {
game.count = 0
- // TODO: reveal too much if we skip recruitment phase?
- if (!can_recruit_anything()) {
- end_recruit()
- return
- }
-
game.recruit = {
pool: [],
used: [],
@@ -1774,6 +1773,12 @@ function goto_recruit() {
troops: 0,
}
+ // TODO: reveal too much if we skip recruitment phase?
+ if (!can_recruit_anything()) {
+ end_recruit()
+ return
+ }
+
// if all depots have enemy pieces, choose ONE city in given sector and COST is 8
if (has_available_depot())
game.state = "recruit"