summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-12-19 17:03:16 +0100
committerTor Andersson <tor@ccxvii.net>2022-11-16 19:12:55 +0100
commitd92e88b9d413fc11a39a249b539b38c6d4122997 (patch)
tree0d58a24b2cd3504ba5d5d599b89f7c454c7631ec /rules.js
parent6d081770ec81e431a050d9d7feac6ece4ba87d14 (diff)
downloadrichard-iii-d92e88b9d413fc11a39a249b539b38c6d4122997.tar.gz
Prettier logs with formatting and colors.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 521aa46..ee604ef 100644
--- a/rules.js
+++ b/rules.js
@@ -1428,6 +1428,7 @@ states.play_card = {
}
function reveal_cards() {
+ log("");
log("Lancaster plays " + CARDS[game.l_card].name + ".");
log("York plays " + CARDS[game.y_card].name + ".");
game.show_cards = true;
@@ -1748,6 +1749,9 @@ states.action_phase = {
}
},
end_action_phase: function () {
+ if (game.moves > 0 && game.turn_log.length === 0 && game.recruit_log.length === 0)
+ logp("does nothing.");
+
if (game.turn_log.length > 0)
print_turn_log(game.active + " moves:");
game.turn_log = game.recruit_log;
@@ -2659,6 +2663,8 @@ states.regroup_to = {
},
area: function (to) {
if (is_sea_area(to)) {
+ log_move_start(game.where);
+ log_move_continue(to);
game.location[game.who] = to;
game.state = 'sea_regroup_to';
} else {
@@ -2684,7 +2690,8 @@ states.sea_regroup_to = {
gen_action(view, 'area', to);
},
area: function (to) {
- logp("sea regroups to " + to + ".");
+ log_move_continue(to);
+ log_move_end();
game.location[game.who] = to;
game.who = null;
game.state = 'regroup'
@@ -2797,6 +2804,7 @@ states.enter_pretender_heir = {
game.who = null;
},
area: function (to) {
+ log("");
log(block_name(game.who) + " comes of age in " + to + ".");
--game.killed_heirs[game.active];
game.location[game.who] = to;
@@ -2879,6 +2887,7 @@ states.enter_royal_heir = {
game.who = null;
},
area: function (to) {
+ log("");
log(block_name(game.who) + " comes of age in " + to + ".");
--game.killed_heirs[game.active];
game.location[game.who] = to;
@@ -2940,6 +2949,7 @@ states.supply_limits_king = {
function goto_political_turn() {
log("");
log("Start Political Turn.");
+ log("");
game.turn_log = [];