From 7a440d2a31363e42a094c751f053b010d9b96511 Mon Sep 17 00:00:00 2001 From: Golbolco Date: Thu, 9 Nov 2023 23:04:00 -0500 Subject: [PATCH] audit: oracle visits and can be roleblocked (use astral/unblockable mods) --- Games/types/Mafia/Winners.js | 4 ++- Games/types/Mafia/roles/Hostile/Tofurkey.js | 17 ++++++++++ Games/types/Mafia/roles/Hostile/Turkey.js | 1 + .../types/Mafia/roles/cards/MeetingTurkey.js | 14 ++++++++ .../Mafia/roles/cards/RevealTargetOnDeath.js | 1 - .../roles/cards/SubtractTurkeyOnDeath.js | 31 ++++++++++++++++++ .../Mafia/roles/cards/WinIfOnlyTurkeyAlive.js | 6 ++-- data/contributors.js | 3 +- data/roles.js | 11 ++++++- .../public/images/roles/tofurkey-vivid.png | Bin 0 -> 514 bytes react_main/src/css/roles.css | 4 +++ 11 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 Games/types/Mafia/roles/Hostile/Tofurkey.js create mode 100644 Games/types/Mafia/roles/cards/MeetingTurkey.js create mode 100644 Games/types/Mafia/roles/cards/SubtractTurkeyOnDeath.js create mode 100644 react_main/public/images/roles/tofurkey-vivid.png diff --git a/Games/types/Mafia/Winners.js b/Games/types/Mafia/Winners.js index 028a83bad..4a0e6632b 100644 --- a/Games/types/Mafia/Winners.js +++ b/Games/types/Mafia/Winners.js @@ -83,8 +83,10 @@ module.exports = class MafiaWinners extends Winners { return "Here's a little lesson in trickery, this is going down in history. If you wanna be a villain number one, then look no further than the Supervillain."; case "Survivor": return "Through the carnage, the Survivor drifted on."; + case "Tofurkey": + return ":turkey: The grain shipments arrived in town a day too late. The streets were filled with wild Turkeys..."; case "Turkey": - return "The grain shipments arrived in town a day too late and found bodies being pecked at by Turkeys..."; + return ":turkey: The grain shipments arrived in town a day too late. The streets were filled with wild Turkeys..."; case "Usurper": return "The Mafia thought that they had claimed the town, but they were stripped of their power by the Usurper."; case "Vengeful Spirit": diff --git a/Games/types/Mafia/roles/Hostile/Tofurkey.js b/Games/types/Mafia/roles/Hostile/Tofurkey.js new file mode 100644 index 000000000..279073dbc --- /dev/null +++ b/Games/types/Mafia/roles/Hostile/Tofurkey.js @@ -0,0 +1,17 @@ +const Role = require("../../Role"); + +module.exports = class Tofurkey extends Role { + constructor(player, data) { + super("Tofurkey", player, data); + + this.alignment = "Hostile"; + this.cards = [ + "VillageCore", + "MeetingTurkey", + "SubtractTurkeyOnDeath", + "FamineStarter", + "FamineImmune", + "WinIfOnlyTurkeyAlive", + ]; + } +}; diff --git a/Games/types/Mafia/roles/Hostile/Turkey.js b/Games/types/Mafia/roles/Hostile/Turkey.js index 134a658e3..44b37f1b4 100644 --- a/Games/types/Mafia/roles/Hostile/Turkey.js +++ b/Games/types/Mafia/roles/Hostile/Turkey.js @@ -7,6 +7,7 @@ module.exports = class Turkey extends Role { this.alignment = "Hostile"; this.cards = [ "VillageCore", + "MeetingTurkey", "GiveTurkeyOnDeath", "FamineStarter", "FamineImmune", diff --git a/Games/types/Mafia/roles/cards/MeetingTurkey.js b/Games/types/Mafia/roles/cards/MeetingTurkey.js new file mode 100644 index 000000000..a34d2612e --- /dev/null +++ b/Games/types/Mafia/roles/cards/MeetingTurkey.js @@ -0,0 +1,14 @@ +const Card = require("../../Card"); + +module.exports = class MeetingTurkey extends Card { + constructor(role) { + super(role); + + this.meetings = { + "Turkey Meeting": { + states: ["Night"], + flags: ["group", "speech"], + }, + }; + } +}; diff --git a/Games/types/Mafia/roles/cards/RevealTargetOnDeath.js b/Games/types/Mafia/roles/cards/RevealTargetOnDeath.js index 02c386925..fffd5e1b9 100644 --- a/Games/types/Mafia/roles/cards/RevealTargetOnDeath.js +++ b/Games/types/Mafia/roles/cards/RevealTargetOnDeath.js @@ -11,7 +11,6 @@ module.exports = class RevealTargetOnDeath extends Card { states: ["Night"], flags: ["voting"], action: { - labels: ["hidden", "absolute"], priority: PRIORITY_REVEAL_DEFAULT, run: function () { this.actor.role.data.playerToReveal = this.target; diff --git a/Games/types/Mafia/roles/cards/SubtractTurkeyOnDeath.js b/Games/types/Mafia/roles/cards/SubtractTurkeyOnDeath.js new file mode 100644 index 000000000..b4b201af6 --- /dev/null +++ b/Games/types/Mafia/roles/cards/SubtractTurkeyOnDeath.js @@ -0,0 +1,31 @@ +const Card = require("../../Card"); +const { PRIORITY_ITEM_TAKER_DEFAULT } = require("../../const/Priority"); + +module.exports = class SubtractTurkeyOnDeath extends Card { + constructor(role) { + super(role); + + this.meetings = { + "Turkey Meeting": { + states: ["Night"], + flags: ["group", "speech"], + }, + }; + + this.listeners = { + priority: PRIORITY_ITEM_TAKER_DEFAULT, + death: function (player, killer, deathType) { + if (player === this.player) { + this.game.queueAlert( + ":turkey: The town thought they caught a Turkey, but instead you lose your lunch..." + ); + for (let person of this.game.players) { + if (person.alive && person.role.name !== "Turkey" || person.role.name !== "Tofurkey") { + this.stealItemByName("Food", "Turkey"); + } + } + } + }, + }; + } +}; diff --git a/Games/types/Mafia/roles/cards/WinIfOnlyTurkeyAlive.js b/Games/types/Mafia/roles/cards/WinIfOnlyTurkeyAlive.js index c54c7951e..7d157c80a 100644 --- a/Games/types/Mafia/roles/cards/WinIfOnlyTurkeyAlive.js +++ b/Games/types/Mafia/roles/cards/WinIfOnlyTurkeyAlive.js @@ -11,7 +11,7 @@ module.exports = class WinIfOnlyTurkeyAlive extends Card { check: function (counts, winners, aliveCount) { if ( this.player.alive && - this.game.alivePlayers().filter((p) => p.role.name === "Turkey") + this.game.alivePlayers().filter((p) => p.role.name === "Turkey" || p.role.name === "Tofurkey") .length === aliveCount ) { winners.addPlayer(this.player, this.name); @@ -21,14 +21,14 @@ module.exports = class WinIfOnlyTurkeyAlive extends Card { this.listeners = { start: function () { for (let player of this.game.players) { - if (player.role.name === "Turkey" && player !== this.player) { + if (player.role.name === "Turkey" || player.role.name === "Tofurkey" && player !== this.player) { this.revealToPlayer(player); } } if (!this.game.alertedTurkeyInGame) { this.game.queueAlert( - "A turkey runs rampant, consuming all the food." + "A Turkey runs rampant, consuming all the food." ); this.game.alertedTurkeyInGame = true; } diff --git a/data/contributors.js b/data/contributors.js index 57aa81f3d..1bdab7c82 100644 --- a/data/contributors.js +++ b/data/contributors.js @@ -157,7 +157,7 @@ const artContributors = { "Dodo", "Amnesiac", "Autocrat", - "Vice President" + "Vice President", "Politician", "Warlock", "Gingerbread Man", @@ -170,6 +170,7 @@ const artContributors = { "Nyarlathotep", "Leprechaun", "Benandante", + "Tofurkey", ], }, grr: { diff --git a/data/roles.js b/data/roles.js index c98d17ea5..a79d4540f 100644 --- a/data/roles.js +++ b/data/roles.js @@ -70,7 +70,7 @@ const roleData = { Oracle: { alignment: "Village", description: [ - "Chooses one player each night whose role will be revealed upon death.", + "Visits one player each night whose role will be revealed upon death.", ], }, Vigilante: { @@ -1784,6 +1784,15 @@ const roleData = { "Wins if all players left alive have went on a successful date.", ], }, + Tofurkey: { + alignment: "Hostile", + description: [ + "The game begins with a famine, with each player starting with four bread.", + "Tofurkeys are immune to the famine.", + "If a Tofurkey dies, each remaining player loses one meal.", + "Wins if they survive to the end of the game and everyone else dies of famine.", + ], + }, Turkey: { alignment: "Hostile", description: [ diff --git a/react_main/public/images/roles/tofurkey-vivid.png b/react_main/public/images/roles/tofurkey-vivid.png new file mode 100644 index 0000000000000000000000000000000000000000..c31676677416b41e8e0e6c7f3285e59d56b84058 GIT binary patch literal 514 zcmV+d0{#7oP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGmbN~PnbOGLGA9w%&0hdWcK~zXft&+=4 z#6S=Q_lSfLgu#^qK@h@5KqRC=5(GdvoDmXNqaM2KH|?H}yxUR_H04)<2(w%b#<9w z`T0%7h6WREKQlQql^U+v>f`lhF)|^jm|#$GoHfNJ{QkTzAj#gmCpM7s3(#+hk*YX@ zuuMuHsfwBH+~>0^|4RoW2%16fT(vJ<8j(qqxaW#?X?PEnD6O69|C*H^j>u%%2foGNs(slo zhV_Udh(g6xbur8&5q1yDV)YKQnc?HhYZN+~kLz^$13FtXs6KuvumAu607*qoM6N<$ Ef~W1?W&i*H literal 0 HcmV?d00001 diff --git a/react_main/src/css/roles.css b/react_main/src/css/roles.css index 862a90d55..b07eb9e03 100644 --- a/react_main/src/css/roles.css +++ b/react_main/src/css/roles.css @@ -2443,6 +2443,10 @@ background-image: url("/images/roles/mistletoe-retro.png"); } +.role-icon-scheme-vivid .role-Mafia-Tofurkey { + background-image: url("/images/roles/tofurkey-vivid.png"); +} + .role-icon-scheme-vivid .role-Mafia-Turkey { background-image: url("/images/roles/turkey-vivid.png"); }