diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-12-03 12:55:02 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-12-03 12:55:02 +0100 |
commit | 5d80614b1c0bf1d7cf1c0fe42186e5288cf8e389 (patch) | |
tree | 50d9993b2a9fffc9f1b1b346091a5dc2170b6b64 | |
parent | 9181610c086caf49c1addaff73801342e9ea766b (diff) | |
download | maria-5d80614b1c0bf1d7cf1c0fe42186e5288cf8e389.tar.gz |
Notify players of accepted deals too.
-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() }, } |