diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-12-17 19:33:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-12-17 19:34:46 +0100 |
commit | f5345ae64df592884aa74920c7c77919d787ecdf (patch) | |
tree | b02730fda7cb26d193b2d437cb5b7d7c20e5c2b0 /rules.js | |
parent | 65ab63d1894ee9bb175adfa054793f01b667b02f (diff) | |
download | andean-abyss-f5345ae64df592884aa74920c7c77919d787ecdf.tar.gz |
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -8146,6 +8146,64 @@ function goto_game_over(result) { return true } +// === PING === + +function action_ping() { + game.ping = { save_current: game.current, save_state: game.state } + game.state = "ping" +} + +states.ping = { + disable_negotiation: true, + inactive: "Ping", + prompt() { + view.prompt = "Ping which faction to respond to chat?" + if (game.current !== GOVT) + view.actions.govt = 1 + if (game.current !== FARC) + view.actions.farc = 1 + if (game.current !== AUC) + view.actions.auc = 1 + if (game.current !== CARTELS) + view.actions.cartels = 1 + view.actions.undo = 1 + }, + govt() { + game.current = GOVT + game.state = "pong" + }, + farc() { + game.current = FARC + game.state = "pong" + }, + auc() { + game.current = AUC + game.state = "pong" + }, + cartels() { + game.current = CARTELS + game.state = "pong" + }, + undo() { + states.pong.resume() + }, +} + +states.pong = { + disable_negotiation: true, + inactive: "Ping", + prompt() { + view.prompt = faction_name[game.ping.save_current] + " has requested your response in chat." + view.actions.resume = 1 + view.actions.undo = 0 + }, + resume() { + game.current = game.ping.save_current + game.state = game.ping.save_state + delete game.ping + }, +} + // === UNCOMMON TEMPLATE === function gen_action(action, argument) { @@ -8306,6 +8364,14 @@ exports.view = function (state, role) { view.actions.ask_shipment = 1 else view.actions.ask_shipment = 0 + view.actions.ping = 1 + } else { + view.actions.remove_pieces = 0 + view.actions.ask_resources = 0 + view.actions.transfer_resources = 0 + view.actions.transfer_shipment = 0 + view.actions.ask_shipment = 0 + view.actions.ping = 1 } if (view.actions.undo === undefined) { @@ -8338,6 +8404,8 @@ exports.action = function (state, role, action, arg) { action_transfer_resources() else if (action === "transfer_shipment") action_transfer_shipment() + else if (action === "ping") + action_ping() else if (game.op && action in special_activities) special_activities[action](arg) else |