diff options
-rw-r--r-- | rules.js | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -6530,7 +6530,7 @@ states.accept_deal_to = { }, accept() { game.deals.push(game.proposal.deal) - end_accept_deal() + goto_notify_deal() }, reject() { goto_reject_deal() @@ -6538,34 +6538,42 @@ states.accept_deal_to = { } function goto_reject_deal() { + game.proposal.reject = 1 + goto_notify_deal() +} + +function goto_notify_deal() { let from = game.proposal.deal[DI_A_POWER] let to = game.proposal.deal[DI_B_POWER] if (game.power === to) set_active_to_power_keep_undo(from) else set_active_to_power_keep_undo(game.proposal.save_power) - game.state = "reject_deal" + game.state = "notify_deal" } -function next_reject_deal() { +function next_notify_deal() { if (game.power !== game.proposal.save_power) set_active_to_power_keep_undo(game.proposal.save_power) else end_accept_deal() } -states.reject_deal = { +states.notify_deal = { dont_snap: true, inactive: "resume play", prompt() { let from = game.proposal.deal[DI_A_POWER] let to = game.proposal.deal[DI_B_POWER] - prompt(`Deal between ${power_name[from]} and ${power_name[to]} was NOT accepted.`) + if (game.proposal.reject) + prompt(`Deal between ${power_name[from]} and ${power_name[to]} was NOT accepted.`) + else + prompt(`Deal between ${power_name[from]} and ${power_name[to]} accepted.`) view.actions.resume = 1 view.actions.undo = 0 }, resume() { - next_reject_deal() + next_notify_deal() }, } |