la-cosa-nostra
Version:
A Mafia bot designed to run in Discord - beware the traitors and the lies!
58 lines (39 loc) • 1.33 kB
JavaScript
// Register heal
var rs = require("../../../rolesystem/rolesystem.js");
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"] + "shoot <alphabet/username/nobody>` instead!");
return null;
};
var to = game.getPlayerMatch(params[0]);
if (to.score < 0.7 || params[0].toLowerCase() === "nobody") {
message.channel.send(":x: Not shooting anybody.");
return null;
};
to = to.player;
if (!to.isAlive()) {
message.channel.send(":x: You cannot shoot a dead player!" + rs.misc.sarcasm(true));
return null;
};
if (to.id === message.author.id) {
message.channel.send(":x: You cannot shoot yourself!" + rs.misc.sarcasm(true));
return null;
} else {
game.addAction("a/fence_gun/shoot", ["instant"], {
name: "A/Fence-shoot",
expiry: 1,
from: message.author.id,
to: to.id
});
var mention = to.getDisplayName();
};
};
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 = false;
module.exports.DISALLOW_NIGHT = true;