summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-06-27 14:29:50 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 12:31:29 +0100
commitbd0792e2d55d15a6a25f8332476ee6ce65000b44 (patch)
treeefb105f04069c181f9527d47eeae4e90ac5b21a2
parentfcd3c32cb666357443393d8a498271a9b25db1de (diff)
downloadpax-pamir-bd0792e2d55d15a6a25f8332476ee6ce65000b44.tar.gz
Rename action to abort action after being denied a beg "cancel".
-rw-r--r--play.js1
-rw-r--r--rules.js8
2 files changed, 7 insertions, 2 deletions
diff --git a/play.js b/play.js
index 5f8ad64..107b699 100644
--- a/play.js
+++ b/play.js
@@ -540,6 +540,7 @@ function on_update() {
confirm_action_button("end_turn_pass", "End turn",
"Are you sure you want to END TURN while you still have actions?")
action_button("end_turn", "End turn")
+ action_button("cancel", "Cancel")
action_button("undo", "Undo")
ui.favored1.className = view.favored
diff --git a/rules.js b/rules.js
index 3df00d2..e146625 100644
--- a/rules.js
+++ b/rules.js
@@ -821,7 +821,7 @@ states.bribe = {
if (player.events.courtly_manners)
gen_action('courtly_manners')
if (game.undo.length === 0)
- gen_action('refuse')
+ gen_action('cancel')
},
courtly_manners() {
log(`Did not pay bribe.`)
@@ -841,6 +841,10 @@ states.bribe = {
set_active(p)
},
refuse() {
+ // for old replays
+ states.bribe.cancel()
+ },
+ cancel() {
game.card = 0
game.where = 0
resume_actions()
@@ -3161,7 +3165,7 @@ exports.action = function (state, current, action, arg) {
load_game(state)
let S = states[game.state]
if (action in S) {
- S[action](arg, current)
+ S[action](arg)
} else {
if (action === 'undo' && game.undo && game.undo.length > 0)
pop_undo()