la-cosa-nostra
Version:
A Mafia bot designed to run in Discord - beware the traitors and the lies!
39 lines (26 loc) • 953 B
JavaScript
var lcn = require("../../../../../source/lcn.js");
var rs = lcn.rolesystem;
var auxils = lcn.auxils;
module.exports = function (actionable, game, params) {
// Check blessings for individual and delete
var blessings = game.actions.delete(x => (x.identifier === "a/blessing_security/bless" && x.to === actionable.to));
if (blessings.length > 1) {
// Use the blessing
game.addAction("a/blessing_security/protect", ["cycle"], {
name: "Modular-protect-blessing",
priority: 1,
expiry: 2,
from: actionable.from,
to: actionable.to
});
};
for (var i = 0; i < blessings.length; i++) {
// Seen as a visit
game.execute("visit", {visitor: blessings[i].from,
target: blessings[i].to,
priority: blessings[i].priority,
reason: "Modular-visit"});
rs.modular.attributeDecrement(blessings[i], game, params);
};
};
module.exports.TAGS = ["drivable", "roleblockable", "visit"];