la-cosa-nostra
Version:
A Mafia bot designed to run in Discord - beware the traitors and the lies!
19 lines (12 loc) • 567 B
JavaScript
var lcn = require("../../../../../source/lcn.js");
var fs = require("fs");
var rs = lcn.rolesystem;
var joat_config = JSON.parse(fs.readFileSync(__dirname + "/../config.json"));
module.exports = function (actionable, game, params) {
var joat = game.getPlayerByIdentifier(actionable.from);
if (joat.misc.joat_actions_left < 1 && joat_config["leaves-game-upon-winning"]) {
// Has won
game.kill(joat, "removed from the game, having fulfilled their win condition", "removed from the game, having fulfilled your win condition");
return null;
};
};