summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-05 22:24:12 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit81dbcd7d664e81d82df2d17fd1fa2e6c6e8b84f9 (patch)
treefedbdede084d5a4da31e64841dadf17439b74b47
parent4b955e2222a58947693e689701601caeda2dbe5a (diff)
downloadtable-battles-81dbcd7d664e81d82df2d17fd1fa2e6c6e8b84f9.tar.gz
log improvements
-rw-r--r--rules.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/rules.js b/rules.js
index be6aefc..d3ea5e6 100644
--- a/rules.js
+++ b/rules.js
@@ -2305,6 +2305,7 @@ states.action = {
game.target2 = -1
game.self = Math.min(get_sticks(S41_PRINCE_EUGENE), count_dice_on_card(S41_PRINCE_EUGENE))
game.state = "s41_prince_eugene"
+ game.prince_eugene = 0
return
}
@@ -2414,7 +2415,7 @@ states.shift_to = {
next() {
// TODO: skip action phase?
- log("Shift " + get_shift_sticks(game.target2) + "\nC" + game.selected + "\nC" + game.target2)
+ log("Shift\nC" + game.selected + "\nC" + game.target2 + "\n" + get_shift_sticks(game.target2) + " sticks.")
end_action_phase()
},
@@ -2437,7 +2438,7 @@ states.s40_cassines = {
}
},
card(c) {
- log(game.selected + " moved one stick from " + c)
+ log("Shift\nC" + c + "\nC" + game.selected + "\n1 stick.")
move_sticks(c, game.selected, 1)
end_action_phase()
},
@@ -2458,14 +2459,14 @@ states.s41_prince_eugene = {
},
card(c) {
game.target2 = c
- log(game.target2 + " moved one stick from " + game.selected)
move_sticks(game.selected, game.target2, 1)
- if (--game.self === 0) {
- pay_for_action(game.selected)
- end_action_phase()
- }
+ ++game.prince_eugene
+ if (--game.self === 0)
+ this.next()
},
next() {
+ log("Shift\nC" + game.selected + "\nC" + game.target2 + "\n" + game.prince_eugene + " sticks.")
+ delete game.prince_eugene
pay_for_action(game.selected)
end_action_phase()
},
@@ -2479,7 +2480,8 @@ states.s42_marlborough = {
gen_action_card(c)
},
card(c) {
- log(game.selected + " moved 4 sticks to " + c)
+ log("Shift\nC" + game.selected + "\nC" + c + "\n4 sticks.")
+
move_sticks(S42_MARLBOROUGH, c, 4)
pay_for_action(S42_MARLBOROUGH)
if (get_sticks(S42_MARLBOROUGH) === 0)