UNPKG

cosa-nostra-backstabbers

Version:
73 lines (50 loc) 1.95 kB
var lcn = require("../../../../../source/lcn.js"); // Register heal var rs = lcn.rolesystem; module.exports = function (game, message, params) { var actions = game.actions; var config = game.config; // Run checks, etc if (params[0] === undefined) { message.channel.send(":x: Wrong syntax! Please use `" + config["command-prefix"] + "recruit <alphabet/username/nobody>` instead!"); return null; }; var to = game.getPlayerMatch(params[0]); var from = game.getPlayerById(message.author.id); if (from.misc.neighbourises_left < 1) { message.channel.send(":x: You may not recruit any more people!"); return null; }; actions.delete(x => x.from === from.identifier && x.identifier === "neighbouriser/recruit"); if (to.score < 0.7 || params[0].toLowerCase() === "nobody") { message.channel.send(":speech_balloon: You have decided not to recruit anyone tonight."); return null; }; to = to.player; if (!to.isAlive()) { message.channel.send(":x: You cannot recruit a dead player!" + rs.misc.sarcasm(true)); return null; }; if (to.id === message.author.id) { message.channel.send(":x: You cannot recruit yourself!" + rs.misc.sarcasm(true)); return null; }; if (from.misc.neighbour_players.includes(to.identifier)) { message.channel.send(":x: That player has already been recruited into your neighbourhood!"); return null; }; game.addAction("neighbouriser/recruit", ["cycle"], { name: "Neighbouriser-recruit", expiry: 1, from: message.author.id, to: to.id }); var mention = to.getDisplayName(); message.channel.send(":speech_balloon: You have decided to recruit **" + mention + "** tonight."); }; module.exports.ALLOW_NONSPECIFIC = false; module.exports.PRIVATE_ONLY = true; module.exports.DEAD_CANNOT_USE = true; module.exports.ALIVE_CANNOT_USE = false; module.exports.DISALLOW_DAY = true; module.exports.DISALLOW_NIGHT = false;