summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js29
1 files changed, 24 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 5458cdc..2301087 100644
--- a/rules.js
+++ b/rules.js
@@ -2904,6 +2904,7 @@ function flush_withdraw_summary() {
function goto_move_phase() {
set_clear(game.fired)
+ game.used = 0
game.forced = []
game.state = 'select_moves'
@@ -3012,9 +3013,6 @@ states.select_moves = {
game.withdraw = null
goto_final_supply_check()
},
- confirm_end_turn() {
- this.end_turn()
- }
}
function list_valid_group_moves() {
@@ -3291,6 +3289,20 @@ function can_end_move() {
}
}
+function gen_action_end_move() {
+ if (game.turn_option === 'offensive') {
+ if (game.used !== 3)
+ gen_action('confirm_end_move')
+ else
+ gen_action('end_move')
+ } else {
+ if (game.used !== 1)
+ gen_action('confirm_end_move')
+ else
+ gen_action('end_move')
+ }
+}
+
states.move = {
inactive: "movement",
prompt() {
@@ -3378,14 +3390,14 @@ states.move = {
view.prompt = `Movement: You may retreat.`
gen_action('retreat')
if (can_end_move())
- gen_action('end_move')
+ gen_action_end_move()
} else {
if (can_end_move()) {
if (can_move)
view.prompt = `Movement: Select unit to move.`
else
view.prompt = `Movement: Done.`
- gen_action('end_move')
+ gen_action_end_move()
}
}
}
@@ -3437,6 +3449,9 @@ states.move = {
return goto_overrun(where)
}
},
+ confirm_end_move() {
+ this.end_move()
+ },
end_move() {
end_movement()
}
@@ -3644,6 +3659,8 @@ function move_via(who, to, speed, move) {
function move_unit(who, to, speed, move) {
let from = unit_hex(who)
+ game.used |= move
+
if (is_forced_march_move(from, to, speed) || has_enemy_unit(to)) {
if (move_via(who, to, speed, move)) {
if (game.hexside.forced[0])
@@ -4698,6 +4715,7 @@ function end_combat_phase() {
function goto_blitz_turn() {
log_h2(`Blitz Turn`)
+ game.used = 0
if (game.rommel)
game.rommel = 3
game.turn_option = 'second blitz'
@@ -6980,6 +6998,7 @@ exports.setup = function (seed, scenario, options) {
turn_option: null,
passed: 0,
side_limit: {},
+ used: 0,
forced: null,
rommel: 0,
from1: 0,