diff --git a/Games/types/Mafia/Game.js b/Games/types/Mafia/Game.js index 34238759e..c583fe659 100644 --- a/Games/types/Mafia/Game.js +++ b/Games/types/Mafia/Game.js @@ -160,6 +160,13 @@ module.exports = class MafiaGame extends Game { this.alivePlayers()[0].holdItem("EventManager", 1); this.events.emit("ManageRandomEvents"); } + if(this.getStateName() == "Day" && (this.setup.RoleShare || this.setup.AlignmentShare || this.setup.PrivateShare || this.setup.PublicShare)){ + for(let player of this.alivePlayers()){ + if(player.items.filter((i) => i.name == "RoleSharing").length <= 0){ + player.holdItem("RoleSharing", 1, this.setup.RoleShare, this.setup.AlignmentShare, this.setup.PrivateShare,this.setup.PublicShare); + } + } + } } getStateInfo(state) { diff --git a/Games/types/Mafia/items/RoleShareAccept.js b/Games/types/Mafia/items/RoleShareAccept.js new file mode 100644 index 000000000..fde8b461d --- /dev/null +++ b/Games/types/Mafia/items/RoleShareAccept.js @@ -0,0 +1,61 @@ +const Item = require("../Item"); + +module.exports = class RoleShareAccept extends Item { + constructor(proposer, type, accepter) { + super("RoleShareAccept"); + + this.proposer = proposer; + this.type = type; + this.cannotBeStolen = true; + this.cannotBeSnooped = true; + let meetingName; + if(this.type == "Role Share"){ + meetingName = "Role Share between " + accepter.name + " and " + this.proposer.name; + } + else{ + meetingName = "Alignment Share between " + accepter.name + " and " + this.proposer.name; + } + + this.meetings[meetingName] = { + states: ["Day"], + flags: ["voting", "instant"], + inputType: "boolean", + action: { + labels: ["marriage"], + item: this, + run: function () { + if (this.target == "Yes") { + if(this.item.type == "Role Share"){ + this.actor.role.revealToPlayer(this.item.proposer); + this.item.proposer.role.revealToPlayer(this.actor); + this.game.events.emit("ShareRole", this.actor, this.item.proposer, false); + } + else if(this.item.type == "Alignment Share"){ + + var roleActor = this.actor.getAppearance("reveal", true); + var alignmentActor = this.game.getRoleAlignment(roleActor); + var roleProposer = this.item.proposer.getAppearance("reveal", true); + var alignmentProposer = this.game.getRoleAlignment(roleProposer); + + + this.actor.queueAlert( + `${this.item.proposer.name}'s Alignment is ${alignmentProposer}.` + ); + this.item.proposer.queueAlert( + `${this.actor.name}'s Alignment is ${alignmentActor}.` + ); + this.game.events.emit("ShareRole", this.actor, this.item.proposer, true); + } + + } + else{ + this.item.proposer.queueAlert( + `${this.actor.name} has declined to Share.` + ); + } + this.item.drop(); + }, + }, + }; + } +}; diff --git a/Games/types/Mafia/items/RoleSharing.js b/Games/types/Mafia/items/RoleSharing.js new file mode 100644 index 000000000..bf9509abc --- /dev/null +++ b/Games/types/Mafia/items/RoleSharing.js @@ -0,0 +1,155 @@ +const Item = require("../Item"); +const Random = require("../../../../lib/Random"); +const Action = require("../Action"); +const { PRIORITY_INVESTIGATIVE_DEFAULT } = require("../const/Priority"); + +module.exports = class RoleSharing extends Item { + constructor(lifespan, roleShare, alignmentShare, privateShare, publicShare) { + super("RoleSharing"); + + //this.magicCult = options?.magicCult; + //this.broken = options?.broken; + this.canRoleShare = roleShare; + this.canAlignmentShare = alignmentShare; + this.canPrivateReveal = privateShare; + this.canPublicReveal = privateShare; + this.cannotBeStolen = true; + this.cannotBeSnooped = true; + this.lifespan = lifespan || Infinity; + + this.shareTypes = [ + "None", + ]; + +if(this.canRoleShare == true){ + this.shareTypes.push("Role Share"); +} +if( this.canAlignmentShare == true){ + this.shareTypes.push("Alignment Share"); +} +if(this.canPrivateReveal == true){ + this.shareTypes.push("Private Reveal"); +} +if(this.canPublicReveal == true){ + this.shareTypes.push("Public Reveal"); +} + + this.meetings = { + "Choose Share Method": { + states: ["Day"], + flags: ["voting"], + inputType: "custom", + targets: this.shareTypes, + }, + "Share With Target": { + states: ["Day"], + flags: ["voting"], + }, + }; + + + this.listeners = { + state: function (stateInfo) { + this.hasSharedWith = []; + //var currentFungusList = this.shareTypes.filter((h)); + + //this.meetings["Choose Share Method"].targets = currentFungusList; + }, + vote: function (vote) { + if ( + (vote.meeting.name === "Choose Share Method") && + vote.voter === this.holder + ) { + this.currentShareMethod = vote.target; + } + else if((vote.meeting.name === "Share With Target") && + vote.voter === this.holder && vote.target){ + + + let targetPlayer = this.game.alivePlayers().filter((p) => p.id == vote.target); + if(targetPlayer.length > 0){ + targetPlayer = targetPlayer[0]; + } + else{ + return; + } + if(this.currentShareMethod == null || this.currentShareMethod == "None") return; + + + if(this.hasSharedWith.includes(targetPlayer)) return; + this.hasSharedWith.push(targetPlayer); + + if(this.currentShareMethod == "Role Share" || this.currentShareMethod == "Alignment Share"){ + var action = new Action({ + actor: this.holder, + target: targetPlayer, + game: this.game, + item: this, + labels: ["hidden"], + run: function () { + this.target.queueAlert( + `${this.actor.name} wants to ${this.item.currentShareMethod}.` + ); + this.actor.queueAlert( + `You offer to ${this.item.currentShareMethod} with ${this.target.name}.` + ); + }, + }); + this.game.instantAction(action); + + let ShareWith = targetPlayer.holdItem("RoleShareAccept", this.holder,this.currentShareMethod,targetPlayer); + this.game.instantMeeting(ShareWith.meetings, [targetPlayer]); + } + else if(this.currentShareMethod == "Private Reveal"){ + //this.holder.role.revealToPlayer(targetPlayer); + var action = new Action({ + actor: this.holder, + target: targetPlayer, + game: this.game, + item: this, + labels: ["hidden"], + run: function () { + this.target.queueAlert( + `${this.actor.name} ${this.item.currentShareMethod}s to you.` + ); + this.actor.queueAlert( + `You ${this.item.currentShareMethod} to ${this.target.name}.` + ); + this.actor.role.revealToPlayer(targetPlayer); + }, + }); + this.game.instantAction(action); + } + else if(this.currentShareMethod == "Public Reveal"){ + //this.holder.role.revealToAll(); + var action = new Action({ + actor: this.holder, + target: targetPlayer, + game: this.game, + item: this, + labels: ["hidden"], + run: function () { + this.game.queueAlert( + `${this.actor.name} ${this.item.currentShareMethod}s to everyone.` + ); + this.actor.role.revealToAll(); + }, + }); + this.game.instantAction(action); + } + + } + }, + }; + + + + } + + hold(player) { + + + super.hold(player); + //this.data.currentShareMethod = null; + } +}; diff --git a/Games/types/Mafia/roles/cards/Complex.js b/Games/types/Mafia/roles/cards/Complex.js index fca5711c5..ac23f4ae2 100644 --- a/Games/types/Mafia/roles/cards/Complex.js +++ b/Games/types/Mafia/roles/cards/Complex.js @@ -1,4 +1,5 @@ const Card = require("../../Card"); +const Player = require("../../../../core/Player"); const { PRIORITY_NIGHT_ROLE_BLOCKER } = require("../../const/Priority"); module.exports = class Complex extends Card { @@ -10,15 +11,48 @@ module.exports = class Complex extends Card { priority: PRIORITY_NIGHT_ROLE_BLOCKER, labels: ["block", "hidden"], run: function () { - if (this.game.getStateName() != "Night") return; + if ( + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" + ) + return; if (!this.actor.alive) return; - const vanillaVisits = this.getVisits(this.actor).filter((p) => - this.isVanillaRole(p) - ); - if (vanillaVisits.length > 0) { - this.blockActions(this.actor); + for (let action of this.game.actions[0]) { + if (action.hasLabel("absolute")) { + continue; + } + if (action.hasLabel("mafia")) { + continue; + } + if (action.hasLabel("hidden")) { + continue; + } + + let toCheck = action.target; + if (!Array.isArray(action.target)) { + toCheck = [action.target]; + } + + if ( + action.actors.indexOf(this.actor) != -1 && + !action.hasLabel("hidden") && + action.target && + toCheck[0] instanceof Player + ) { + for (let y = 0; y < toCheck.length; y++) { + if (this.isVanillaRole(toCheck[y])) { + if ( + action.priority > this.priority && + !action.hasLabel("absolute") + ) { + action.cancelActor(this.actor); + break; + } + } + } + } } }, }, diff --git a/Games/types/Mafia/roles/cards/Disloyal.js b/Games/types/Mafia/roles/cards/Disloyal.js index d3202bf48..bb348b674 100644 --- a/Games/types/Mafia/roles/cards/Disloyal.js +++ b/Games/types/Mafia/roles/cards/Disloyal.js @@ -11,7 +11,11 @@ module.exports = class Disloyal extends Card { priority: PRIORITY_NIGHT_ROLE_BLOCKER - 1, labels: ["block", "hidden", "absolute"], run: function () { - if (this.game.getStateName() != "Night") return; + if ( + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" + ) + return; if (!this.actor.alive) return; diff --git a/Games/types/Mafia/roles/cards/Loyal.js b/Games/types/Mafia/roles/cards/Loyal.js index e5410a828..fc1a4c549 100644 --- a/Games/types/Mafia/roles/cards/Loyal.js +++ b/Games/types/Mafia/roles/cards/Loyal.js @@ -11,7 +11,11 @@ module.exports = class Loyal extends Card { priority: PRIORITY_NIGHT_ROLE_BLOCKER - 1, labels: ["block", "hidden", "absolute"], run: function () { - if (this.game.getStateName() != "Night") return; + if ( + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" + ) + return; if (!this.actor.alive) return; diff --git a/Games/types/Mafia/roles/cards/ModifierLoud.js b/Games/types/Mafia/roles/cards/ModifierLoud.js index 773d8682b..05d8ba8e1 100644 --- a/Games/types/Mafia/roles/cards/ModifierLoud.js +++ b/Games/types/Mafia/roles/cards/ModifierLoud.js @@ -24,6 +24,14 @@ module.exports = class ModifierLoud extends Card { if (this.game.getStateName() != "Night") return; let visitors = this.getVisitors(); + let MafiaKill = this.getVisitors(this.actor, "mafia"); + + if (MafiaKill && MafiaKill.length > 1) { + for (let x = 1; x < MafiaKill.length; x++) { + visitors.splice(visitors.indexOf(MafiaKill[x]), 1); + } + } + if (visitors?.length) { let names = visitors?.map((visitor) => visitor.name); diff --git a/Games/types/Mafia/roles/cards/Simple.js b/Games/types/Mafia/roles/cards/Simple.js index 8e9678d84..124714eba 100644 --- a/Games/types/Mafia/roles/cards/Simple.js +++ b/Games/types/Mafia/roles/cards/Simple.js @@ -1,4 +1,5 @@ const Card = require("../../Card"); +const Player = require("../../../../core/Player"); const { PRIORITY_NIGHT_ROLE_BLOCKER } = require("../../const/Priority"); module.exports = class Simple extends Card { @@ -10,15 +11,48 @@ module.exports = class Simple extends Card { priority: PRIORITY_NIGHT_ROLE_BLOCKER, labels: ["block", "hidden"], run: function () { - if (this.game.getStateName() != "Night") return; + if ( + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" + ) + return; if (!this.actor.alive) return; - const nonVanillaVisits = this.getVisits(this.actor).filter( - (p) => !this.isVanillaRole(p) - ); - if (nonVanillaVisits.length > 0) { - this.blockActions(this.actor); + for (let action of this.game.actions[0]) { + if (action.hasLabel("absolute")) { + continue; + } + if (action.hasLabel("mafia")) { + continue; + } + if (action.hasLabel("hidden")) { + continue; + } + + let toCheck = action.target; + if (!Array.isArray(action.target)) { + toCheck = [action.target]; + } + + if ( + action.actors.indexOf(this.actor) != -1 && + !action.hasLabel("hidden") && + action.target && + toCheck[0] instanceof Player + ) { + for (let y = 0; y < toCheck.length; y++) { + if (!this.isVanillaRole(toCheck[y])) { + if ( + action.priority > this.priority && + !action.hasLabel("absolute") + ) { + action.cancelActor(this.actor); + break; + } + } + } + } } }, }, diff --git a/Games/types/Mafia/roles/cards/Vain.js b/Games/types/Mafia/roles/cards/Vain.js index 1f2e6ac37..2dc43cf2a 100644 --- a/Games/types/Mafia/roles/cards/Vain.js +++ b/Games/types/Mafia/roles/cards/Vain.js @@ -1,4 +1,6 @@ const Card = require("../../Card"); +const Action = require("../../Action"); +const Player = require("../../../../core/Player"); const { PRIORITY_KILL_DEFAULT } = require("../../const/Priority"); module.exports = class Vain extends Card { @@ -8,26 +10,51 @@ module.exports = class Vain extends Card { this.actions = [ { priority: PRIORITY_KILL_DEFAULT, - labels: ["kill", "hidden", "absolute"], + labels: ["kill", "hidden"], run: function () { - if (this.game.getStateName() != "Night") return; + if ( - this.actor.getMeetingByName("Mafia") || - this.actor.getMeetingByName("Cultists") + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" ) return; if (!this.actor.alive) return; - let visits = this.getVisits(this.actor); - let sameAlignmentVisits = visits.filter( - (v) => v.role.alignment == this.actor.role.alignment - ); - if (sameAlignmentVisits.length > 0 && this.dominates(this.actor)) { + for (let action of this.game.actions[0]) { + if (action.hasLabel("absolute")) { + continue; + } + if (action.hasLabel("mafia")) { + continue; + } + if (action.hasLabel("hidden")) { + continue; + } + + let toCheck = action.target; + if (!Array.isArray(action.target)) { + toCheck = [action.target]; + } + + if ( + action.actors.indexOf(this.actor) != -1 && + !action.hasLabel("hidden") && + action.target && + toCheck[0] instanceof Player + ) { + for (let y = 0; y < toCheck.length; y++) { + if (toCheck[y].role.alignment == this.actor.role.alignment) { + if(this.dominates(this.actor)){ this.actor.kill("basic", this.actor); + } + } + } + } } }, }, ]; + } }; diff --git a/Games/types/Mafia/roles/cards/Weak.js b/Games/types/Mafia/roles/cards/Weak.js index 2977f5fa3..7d205f4ff 100644 --- a/Games/types/Mafia/roles/cards/Weak.js +++ b/Games/types/Mafia/roles/cards/Weak.js @@ -1,4 +1,6 @@ const Card = require("../../Card"); +const Action = require("../../Action"); +const Player = require("../../../../core/Player"); const { PRIORITY_KILL_DEFAULT } = require("../../const/Priority"); module.exports = class Weak extends Card { @@ -8,27 +10,49 @@ module.exports = class Weak extends Card { this.actions = [ { priority: PRIORITY_KILL_DEFAULT, - labels: ["kill", "hidden", "absolute"], + labels: ["kill", "hidden"], run: function () { - if (this.game.getStateName() != "Night") return; - if ( - this.actor.getMeetingByName("Mafia") || - this.actor.getMeetingByName("Cultists") + + if ( + this.game.getStateName() != "Night" && + this.game.getStateName() != "Dawn" ) return; if (!this.actor.alive) return; - let visits = this.getVisits(this.actor); - let differentAlignmentVisits = visits.filter( - (v) => v.role.alignment != this.actor.role.alignment - ); - if ( - differentAlignmentVisits.length > 0 && - this.dominates(this.actor) - ) { - this.actor.kill("basic", this.actor); + for (let action of this.game.actions[0]) { + if (action.hasLabel("absolute")) { + continue; + } + if (action.hasLabel("mafia")) { + continue; + } + if (action.hasLabel("hidden")) { + continue; + } + + let toCheck = action.target; + if (!Array.isArray(action.target)) { + toCheck = [action.target]; + } + + if ( + action.actors.indexOf(this.actor) != -1 && + !action.hasLabel("hidden") && + action.target && + toCheck[0] instanceof Player + ) { + for (let y = 0; y < toCheck.length; y++) { + if (toCheck[y].role.alignment != this.actor.role.alignment) { + if(this.dominates(this.actor)){ + this.actor.kill("basic", this.actor); + } + } + } + } } + }, }, ]; diff --git a/db/schemas.js b/db/schemas.js index 661fd8428..808c3928b 100644 --- a/db/schemas.js +++ b/db/schemas.js @@ -138,6 +138,10 @@ var schemas = { votingDead: Boolean, OneNightMode: Boolean, hiddenConverts: Boolean, + RoleShare: Boolean, + AlignmentShare: Boolean, + PrivateShare: Boolean, + PublicShare: Boolean, swapAmt: Number, roundAmt: Number, firstTeamSize: Number, diff --git a/package-lock.json b/package-lock.json index e44a15908..019237c0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,35 +5,34 @@ "requires": true, "dependencies": { "@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "optional": true }, "@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "optional": true }, "@babel/parser": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", - "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.2.tgz", + "integrity": "sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==", "optional": true, "requires": { - "@babel/types": "^7.25.6" + "@babel/types": "^7.26.0" } }, "@babel/types": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", - "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.0.tgz", + "integrity": "sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==", "optional": true, "requires": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" } }, "@braintree/wrap-promise": { @@ -586,6 +585,32 @@ } } }, + "@pm2/pm2-version-check": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz", + "integrity": "sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA==", + "dev": true, + "requires": { + "debug": "^4.3.1" + }, + "dependencies": { + "debug": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -699,9 +724,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.19.5", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", - "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", "requires": { "@types/node": "*", "@types/qs": "*", @@ -781,17 +806,17 @@ } }, "@types/node": { - "version": "22.5.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.5.tgz", - "integrity": "sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==", + "version": "22.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.1.tgz", + "integrity": "sha512-p8Yy/8sw1caA8CdRIQBG5tiLHmxtQKObCijiAa9Ez+d4+PRffM4054xbju0msf+cvhJpnFEeNjxmVT/0ipktrg==", "requires": { - "undici-types": "~6.19.2" + "undici-types": "~6.19.8" } }, "@types/qs": { - "version": "6.9.16", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.16.tgz", - "integrity": "sha512-7i+zxXdPD0T4cKDuxCUXJ4wHcsJLwENa6Z3dCu8cfCK743OGy5Nu1RmAGqDPsoTDINVEcdXKRvR/zre+P2Ku1A==" + "version": "6.9.17", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==" }, "@types/range-parser": { "version": "1.2.7", @@ -850,9 +875,9 @@ } }, "acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "optional": true }, "acorn-jsx": { @@ -2097,9 +2122,9 @@ "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" }, "es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "version": "1.23.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.5.tgz", + "integrity": "sha512-vlmniQ0WNPwXqA0BnmwV3Ng7HxiGlh6r5U6JcTMNx8OilcAGqVJBHJcPjqOMaczU9fRuRK5Px2BdVyPRnKMMVQ==", "dev": true, "requires": { "array-buffer-byte-length": "^1.0.1", @@ -2117,7 +2142,7 @@ "function.prototype.name": "^1.1.6", "get-intrinsic": "^1.2.4", "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", + "globalthis": "^1.0.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2", "has-proto": "^1.0.3", @@ -2133,10 +2158,10 @@ "is-string": "^1.0.7", "is-typed-array": "^1.1.13", "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", + "object-inspect": "^1.13.3", "object-keys": "^1.1.1", "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", + "regexp.prototype.flags": "^1.5.3", "safe-array-concat": "^1.1.2", "safe-regex-test": "^1.0.3", "string.prototype.trim": "^1.2.9", @@ -2150,6 +2175,12 @@ "which-typed-array": "^1.1.15" }, "dependencies": { + "object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "dev": true + }, "object.assign": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", @@ -2657,9 +2688,9 @@ } }, "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3624,9 +3655,9 @@ "dev": true }, "jsdoc": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.3.tgz", - "integrity": "sha512-Nu7Sf35kXJ1MWDZIMAuATRQTg1iIPdzh7tqJ6jjvaU/GfDf+qi5UV8zJR3Mo+/pYFvm8mzay4+6O5EWigaQBQw==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.4.tgz", + "integrity": "sha512-zeFezwyXeG4syyYHbvh1A967IAqq/67yXtXvuL5wnqCkFZe8I0vKfm+EO+YEvLguo6w9CDUbrAXVtJSHh2E8rw==", "optional": true, "requires": { "@babel/parser": "^7.20.15", @@ -3932,9 +3963,9 @@ } }, "logform": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.1.tgz", - "integrity": "sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", "requires": { "@colors/colors": "1.6.0", "@types/triple-beam": "^1.3.2", @@ -5265,15 +5296,6 @@ "yamljs": "0.3.0" }, "dependencies": { - "@pm2/pm2-version-check": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@pm2/pm2-version-check/-/pm2-version-check-1.0.4.tgz", - "integrity": "sha512-SXsM27SGH3yTWKc2fKR4SYNxsmnvuBQ9dd6QHtEWmiZ/VqaOYPAIlS8+vMcn27YLtAEBGvNRSh3TPNvtjZgfqA==", - "dev": true, - "requires": { - "debug": "^4.3.1" - } - }, "chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -5873,15 +5895,15 @@ "integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==" }, "regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", + "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", "dev": true, "requires": { - "call-bind": "^1.0.6", + "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "set-function-name": "^2.0.2" } }, "remark-parse": { @@ -6821,12 +6843,6 @@ "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", "integrity": "sha512-LhVdShQD/4Mk4zXNroIQZJC+Ap3zgLcDuwEdcmLv9CCO73NWockQDwyUnW/m8VX/EElfL6FcYx7EeutN4HJA6A==" }, - "to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "optional": true - }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7296,11 +7312,11 @@ } }, "winston-transport": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.1.tgz", - "integrity": "sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", "requires": { - "logform": "^2.6.1", + "logform": "^2.7.0", "readable-stream": "^3.6.2", "triple-beam": "^1.3.0" }, diff --git a/react_main/src/pages/Play/CreateSetup/CreateMafiaSetup.jsx b/react_main/src/pages/Play/CreateSetup/CreateMafiaSetup.jsx index cd408d0aa..1e2f38339 100644 --- a/react_main/src/pages/Play/CreateSetup/CreateMafiaSetup.jsx +++ b/react_main/src/pages/Play/CreateSetup/CreateMafiaSetup.jsx @@ -174,6 +174,30 @@ export default function CreateMafiaSetup() { value: false, type: "boolean", }, + { + label: "Role Sharing", + ref: "RoleShare", + value: false, + type: "boolean", + }, + { + label: "Alignment Sharing", + ref: "AlignmentShare", + value: false, + type: "boolean", + }, + { + label: "Private Role Revealing", + ref: "PrivateShare", + value: false, + type: "boolean", + }, + { + label: "Public Role Revealing", + ref: "PublicShare", + value: false, + type: "boolean", + }, ]); const formFieldValueMods = { @@ -219,6 +243,10 @@ export default function CreateMafiaSetup() { votingDead: formFields[22].value, OneNightMode: formFields[23].value, hiddenConverts: formFields[24].value, + RoleShare: formFields[25].value, + AlignmentShare: formFields[26].value, + PrivateShare: formFields[27].value, + PublicShare: formFields[28].value, editing: editing, id: params.get("edit"), }) diff --git a/routes/setup.js b/routes/setup.js index 9c0571e47..95d24d2c3 100644 --- a/routes/setup.js +++ b/routes/setup.js @@ -401,6 +401,10 @@ router.post("/create", async function (req, res) { setup.votingDead = Boolean(setup.votingDead); setup.OneNightMode = Boolean(setup.OneNightMode); setup.hiddenConverts = Boolean(setup.hiddenConverts); + setup.RoleShare = Boolean(setup.RoleShare); + setup.AlignmentShare = Boolean(setup.AlignmentShare); + setup.PrivateShare = Boolean(setup.PrivateShare); + setup.PublicShare = Boolean(setup.PublicShare); if ( !routeUtils.validProp(setup.gameType) ||