diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 62 |
1 files changed, 30 insertions, 32 deletions
@@ -1480,8 +1480,7 @@ function roll_dice_in_pool() { } } - log("Roll") - log(">" + rolled.map(d => "D" + d).join(" ")) + log("Roll\n" + rolled.map(d => "D" + d).join(" ")) game.rolled = rolled.length game.summary = 0 @@ -1561,8 +1560,7 @@ function end_roll_phase() { if (game.summary & (1 << d)) if (get_dice_location(d) === c) s.push("D" + get_dice_value(d)) - log(">C" + c) - log(">>" + s.join(" ")) + log(">C" + c + "\n" + s.join(" ")) } } @@ -2158,8 +2156,7 @@ states.action = { retire(c) { push_undo() - log("C" + c) - log("> Retire") + log("Retire\nC" + c) if (game.scenario === S38_FLEURUS) { if (c === S38_LUXEMBOURGS_HORSE) { @@ -2310,9 +2307,7 @@ states.shift_to = { next() { // TODO: skip action phase? - log(`Shift ${get_shift_sticks(game.target2)}`) - log(">C" + game.selected) - log(">C" + game.target2) + log("Shift " + get_shift_sticks(game.target2) + "\nC" + game.selected + "\nC" + game.target2) end_action_phase() }, @@ -2387,8 +2382,7 @@ states.s42_marlborough = { } function goto_null(c) { - log("Null") - log(">C" + c) + log("Null\nC" + c) pay_for_action(c) end_action_phase() @@ -2518,8 +2512,7 @@ states.bombard = { view.actions.bombard = 1 }, bombard() { - log("Bombard") - log(">C" + c) + log("Bombard\nC" + c) let opp = 1 - player_index() game.morale[opp] -- @@ -2769,9 +2762,7 @@ states.attack = { view.actions.attack = 1 }, attack() { - log("Attack") - log(">C" + game.selected) - log(">C" + game.target) + log("Attack\nC" + game.selected + "\nC" + game.target) if (can_opponent_react()) { clear_undo() @@ -2837,12 +2828,25 @@ states.attack = { function resume_attack() { pay_for_action(game.selected) - if (game.self > 0) - remove_sticks(game.selected, game.self) + if (game.hits > 0 && game.self > 0) { + log(">" + game.hits + " hits. " + game.self + " self.") + } + else if (game.hits > 0) { + log(">" + game.hits + " hits.") + } + else if (game.self > 0) { + log(">" + game.self + " self.") + } + if (game.hits > 0) remove_sticks(game.target, game.hits) - if (game.target2 >= 0 && game.hits2 > 0) + if (game.self > 0) + remove_sticks(game.selected, game.self) + + if (game.target2 >= 0 && game.hits2 > 0) { + log(">" + game.hits2 + " hits on C" + game.target2) remove_sticks(game.target2, game.hits2) + } if (game.scenario === S44_HOHENFRIEDBERG) { // remove after first attack @@ -2897,9 +2901,7 @@ states.command = { gen_action_card(t) }, card(c) { - log("Command") - log(">C" + game.selected) - log(">C" + c) + log("Command\nC" + game.selected + "\nC" + c) let p = player_index() set_delete(game.reserve[p], c) @@ -3212,8 +3214,7 @@ states.screen = { view.actions.screen = 1 }, screen() { - log("Screen") - log(">C" + game.target) + log("Screen\nC" + game.target) pay_for_action(game.target) @@ -3289,8 +3290,7 @@ states.absorb = { view.actions.absorb = 1 }, absorb() { - log("Absorb") - log(">C" + game.target) + log("Absorb\nC" + game.target) pay_for_action(game.target) end_reaction() @@ -3354,8 +3354,7 @@ states.counterattack = { view.actions.counterattack = 1 }, counterattack() { - log("Counterattack") - log(">C" + game.target) + log("Counterattack\nC" + game.target) pay_for_action(game.target) end_reaction() @@ -3581,11 +3580,10 @@ states.routing = { game.routed[p] += data.cards[c].morale rout_card(c) } else if (should_retire_card(c)) { - log("C" + c + " retired.") + log("Retire\nC" + c) retire_card(c) } else if (should_pursue(c)) { - log("C" + c) - log(">Pursuit") + log("Pursuit\nC" + c) pursue_card(c) } else { remove_card(c) @@ -3689,7 +3687,7 @@ function end_reserve() { } function bring_out_of_reserve(c) { - log("C" + c + " came out of reserve.") + log("Reserve\nC" + c) let p = find_card_owner(c) set_delete(game.reserve[p], c) set_add(game.front[p], c) |