la-cosa-nostra
Version:
A Mafia bot designed to run in Discord - beware the traitors and the lies!
38 lines (28 loc) • 968 B
JavaScript
var lcn = require("../../../../../source/lcn.js");
var rs = lcn.rolesystem;
module.exports = function (actionable, game, params) {
// Seen as a visit
game.execute("visit", {visitor: actionable.from,
target: actionable.to,
priority: actionable.priority,
reason: "JOAT-stop-vote"});
game.addAction("jack_of_all_trades/stop_vote", ["postcycle"], {
name: "JOAT-stop-vote",
expiry: 2,
from: actionable.from,
to: actionable.to
});
var from = game.getPlayerByIdentifier(actionable.from);
var target = game.getPlayerByIdentifier(actionable.to);
if (target.isAlive()) {
game.addMessage(from, ":exclamation: You successfully executed your action!");
from.misc.joat_actions_left--;
};
game.addAction("jack_of_all_trades/remove_on_win", ["cycle"], {
name: "JOAT-remove-on-win",
expiry: 1,
from: actionable.from,
to: actionable.to
});
};
module.exports.TAGS = ["drivable", "roleblockable", "visit"];