Skip to content

Commit

Permalink
audit: oracle visits and can be roleblocked (use astral/unblockable m…
Browse files Browse the repository at this point in the history
…ods)
  • Loading branch information
Golbolco authored Nov 10, 2023
1 parent 099ed73 commit 7a440d2
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Games/types/Mafia/Winners.js
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
17 changes: 17 additions & 0 deletions Games/types/Mafia/roles/Hostile/Tofurkey.js
Original file line number Diff line number Diff line change
@@ -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",
];
}
};
1 change: 1 addition & 0 deletions Games/types/Mafia/roles/Hostile/Turkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = class Turkey extends Role {
this.alignment = "Hostile";
this.cards = [
"VillageCore",
"MeetingTurkey",
"GiveTurkeyOnDeath",
"FamineStarter",
"FamineImmune",
Expand Down
14 changes: 14 additions & 0 deletions Games/types/Mafia/roles/cards/MeetingTurkey.js
Original file line number Diff line number Diff line change
@@ -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"],
},
};
}
};
1 change: 0 additions & 1 deletion Games/types/Mafia/roles/cards/RevealTargetOnDeath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
31 changes: 31 additions & 0 deletions Games/types/Mafia/roles/cards/SubtractTurkeyOnDeath.js
Original file line number Diff line number Diff line change
@@ -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");
}
}
}
},
};
}
};
6 changes: 3 additions & 3 deletions Games/types/Mafia/roles/cards/WinIfOnlyTurkeyAlive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion data/contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ const artContributors = {
"Dodo",
"Amnesiac",
"Autocrat",
"Vice President"
"Vice President",
"Politician",
"Warlock",
"Gingerbread Man",
Expand All @@ -170,6 +170,7 @@ const artContributors = {
"Nyarlathotep",
"Leprechaun",
"Benandante",
"Tofurkey",
],
},
grr: {
Expand Down
11 changes: 10 additions & 1 deletion data/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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: [
Expand Down
Binary file added react_main/public/images/roles/tofurkey-vivid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions react_main/src/css/roles.css
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 7a440d2

Please sign in to comment.