summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-24 21:55:23 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commit6f5be691ae545b8e85ca9549bb8eddb23f567ba2 (patch)
tree9bcc03cf73785f1b17161acd5728c9936b9cb8b2
parentf8ca38194025196483cbf0a1fcbe43383f1f27dc (diff)
downloadfriedrich-6f5be691ae545b8e85ca9549bb8eddb23f567ba2.tar.gz
sign
-rw-r--r--rules.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/rules.js b/rules.js
index 332336d..64ae5ab 100644
--- a/rules.js
+++ b/rules.js
@@ -1945,10 +1945,14 @@ function prompt_combat(value, extra = null) {
prompt(format_combat(value) + ".")
}
-function inactive_combat() {
+function inactive_attack() {
return "play TC for " + format_combat(game.count)
}
+function inactive_defend() {
+ return "play TC for " + format_combat(-game.count)
+}
+
function goto_combat() {
set_clear(game.moved)
@@ -2083,7 +2087,7 @@ function gen_play_card(suit) {
}
states.combat_attack = {
- inactive: inactive_combat,
+ inactive: inactive_attack,
prompt() {
prompt_combat(game.count)
view.selected = [ get_supreme_commander(game.attacker) ]
@@ -2113,7 +2117,7 @@ states.combat_attack = {
}
states.combat_defend = {
- inactive: inactive_combat,
+ inactive: inactive_defend,
prompt() {
prompt_combat(-game.count)
@@ -2144,7 +2148,7 @@ states.combat_defend = {
}
states.combat_attack_reserve = {
- inactive: inactive_combat,
+ inactive: inactive_attack,
prompt() {
prompt_combat(game.count, "Choose value.")
view.selected = [ get_supreme_commander(game.attacker)]
@@ -2158,7 +2162,7 @@ states.combat_attack_reserve = {
}
states.combat_defend_reserve = {
- inactive: inactive_combat,
+ inactive: inactive_defend,
prompt() {
prompt_combat(-game.count, "Choose value.")
view.selected = [ get_supreme_commander(game.defender) ]
@@ -2172,7 +2176,7 @@ states.combat_defend_reserve = {
}
states.combat_attack_swap = {
- inactive: inactive_combat,
+ inactive: inactive_attack,
prompt() {
prompt_combat(game.count)
view.selected = [ get_supreme_commander(game.attacker) ]
@@ -2186,7 +2190,7 @@ states.combat_attack_swap = {
}
states.combat_defend_swap = {
- inactive: inactive_combat,
+ inactive: inactive_defend,
prompt() {
prompt_combat(-game.count)
view.selected = [ get_supreme_commander(game.defender) ]