summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js36
1 files changed, 22 insertions, 14 deletions
diff --git a/rules.js b/rules.js
index b644ddf..823226b 100644
--- a/rules.js
+++ b/rules.js
@@ -168,6 +168,8 @@ function setup_game(seed) {
b_hand: [],
a_queue: 0,
b_queue: 0,
+ a_draw: 0,
+ b_draw: 0,
card: 0,
last_played: 0,
@@ -1496,6 +1498,18 @@ function end_strategy_card() {
}
}
+ while (game.b_draw > 0) {
+ log("B drew replacement card.")
+ set_add(game.b_hand, deal_card())
+ game.b_draw--
+ }
+
+ while (game.a_draw > 0) {
+ log("A drew replacement card.")
+ set_add(game.a_hand, deal_card())
+ game.a_draw--
+ }
+
game.state = "end_strategy_card"
return true
}
@@ -2654,10 +2668,10 @@ states.play_attacker_battle_card = {
push_undo()
play_card(c, "for +2 DRM")
if (game.active === P_BRITAIN) {
- game.combat.b_draw_after_battle = true
+ game.b_draw += 1
game.combat.b_bonus += 2
} else {
- game.combat.a_draw_after_battle = true
+ game.a_draw += 1
game.combat.a_bonus += 2
}
if (is_trigger_remove_benedict_arnold(c))
@@ -2669,10 +2683,10 @@ states.play_attacker_battle_card = {
push_undo()
discard_card(c, "for +1 DRM")
if (game.active === P_BRITAIN) {
- game.combat.b_draw_after_battle = true
+ game.b_draw += 1
game.combat.b_bonus += 1
} else {
- game.combat.a_draw_after_battle = true
+ game.a_draw += 1
game.combat.a_bonus += 1
}
game.state = "play_attacker_battle_card_confirm"
@@ -2718,10 +2732,10 @@ states.play_defender_battle_card = {
push_undo()
play_card(c, "for +2 DRM")
if (game.active === P_BRITAIN) {
- game.combat.b_draw_after_battle = true
+ game.b_draw += 1
game.combat.b_bonus += 2
} else {
- game.combat.a_draw_after_battle = true
+ game.a_draw += 1
game.combat.a_bonus += 2
}
if (is_trigger_remove_benedict_arnold(c))
@@ -2733,10 +2747,10 @@ states.play_defender_battle_card = {
push_undo()
discard_card(c, "for +1 DRM")
if (game.active === P_BRITAIN) {
- game.combat.b_draw_after_battle = true
+ game.b_draw += 1
game.combat.b_bonus += 1
} else {
- game.combat.a_draw_after_battle = true
+ game.a_draw += 1
game.combat.a_bonus += 1
}
game.state = "play_defender_battle_card_confirm"
@@ -3202,12 +3216,6 @@ function end_battle() {
if (game.combat.british_losses >= 3)
lose_regular_advantage()
- // TODO: delay until end of campaign (at end of player's impulse)
- if (game.combat.b_draw_after_battle)
- set_add(game.b_hand, deal_card())
- if (game.combat.a_draw_after_battle)
- set_add(game.a_hand, deal_card())
-
delete game.combat
end_move(true)