summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-05-07 14:59:13 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:31:29 +0100
commit9f8548ad55e59fda73b6802193742664fe386d9e (patch)
tree675e06a2e31080b3ba1b2780dbe7af99ec1e5b64 /rules.js
parenta25bce3db39b7844aed34dc93940a7cd98888f26 (diff)
downloadpax-pamir-9f8548ad55e59fda73b6802193742664fe386d9e.tar.gz
Fix bribe on hostage.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 6e30820..1e31977 100644
--- a/rules.js
+++ b/rules.js
@@ -715,7 +715,7 @@ function check_region_overthrow(p, r) {
states.bribe = {
prompt() {
- let p = ruler_of_region(cards[game.card].region);
+ let p = game.bribe;
view.prompt = `Must pay ${game.count} rupee bribe to ${player_names[p]}.`;
if (player.coins - game.reserve >= game.count)
gen_action('pay');
@@ -730,14 +730,14 @@ states.bribe = {
end_bribe();
},
pay() {
- let p = ruler_of_region(cards[game.card].region);
+ let p = game.bribe;
game.players[p].coins += game.count;
game.players[game.active].coins -= game.count;
end_bribe();
},
beg() {
clear_undo();
- let p = ruler_of_region(cards[game.card].region);
+ let p = game.bribe;
game.state = 'waive';
set_active(p);
},
@@ -1046,6 +1046,7 @@ function do_play_1(c, side) {
game.state = 'bribe';
game.count = count_player_cylinders(ruler, cards[c].region);
game.reserve = 0;
+ game.bribe = ruler;
return;
}
}
@@ -1312,6 +1313,7 @@ function do_card_action_1(c, what, reserve) {
game.state = 'bribe';
game.count = count_player_cylinders(who, c);
game.reserve = reserve;
+ game.bribe = who;
return;
}
}
@@ -2689,11 +2691,12 @@ exports.setup = function (seed, scenario, options) {
state: "none",
used_cards: [],
used_pieces: [],
+ bribe: -1,
+ card: 0,
count: 0,
+ region: 0,
reserve: 0,
selected: -1,
- region: 0,
- card: 0,
where: 0,
phasing: null,