la-cosa-nostra
Version:
A Mafia bot designed to run in Discord - beware the traitors and the lies!
26 lines (16 loc) • 671 B
JavaScript
var lcn = require("../../../../../source/lcn.js");
var rs = lcn.rolesystem;
module.exports = function (actionable, game, params) {
var target = game.getPlayerByIdentifier(actionable.to);
var roleblocker = game.getPlayerByIdentifier(actionable.from);
game.execute("roleblock", {roleblocker: actionable.from,
target: actionable.to,
priority: actionable.priority,
reason: "Modular-roleblock"});
var immunity = target.getStat("roleblock-immunity", Math.max);
if (immunity < 1) {
// Delete all
game.actions.delete(x => x.from === target.identifier && x.tags.includes("roleblockable"));
target.setStatus("roleblocked", true);
};
};