UNPKG

la-cosa-nostra

Version:

A Mafia bot designed to run in Discord - beware the traitors and the lies!

29 lines (19 loc) 811 B
module.exports = function (actionable, game, params) { var target = game.getPlayerByIdentifier(actionable.to); var roleblocker = game.getPlayerByIdentifier(actionable.from); // Considered as visit game.execute("visit", {visitor: actionable.from, target: actionable.to, priority: actionable.priority, reason: "Mafia-Roleblocker-visit"}); game.execute("roleblock", {roleblocker: actionable.from, target: actionable.to, priority: actionable.priority, reason: "Mafia-Roleblocker-roleblock"}); var immunity = target.getStat("roleblock-immunity", Math.max); if (immunity < 1) { game.actions.delete(x => x.from === target.identifier && x.tags.includes("roleblockable")); target.setStatus("roleblocked", true); }; }; module.exports.TAGS = ["drivable", "visit"];