Skip to content

Commit

Permalink
feat: witch doctor (#1227)
Browse files Browse the repository at this point in the history
fixed previous issues, had to reopen branch due to conflict merges
messing stuff up

witch doctor is a cult-aligned role (alternative to cult leader and
doomsayer) that targets players and saves them from killers; if
successful, their targets convert to cultists
  • Loading branch information
Golbolco authored Nov 9, 2023
1 parent 4ce7869 commit 825b23d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
10 changes: 10 additions & 0 deletions Games/types/Mafia/roles/Cult/WitchDoctor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const Role = require("../../Role");

module.exports = class WitchDoctor extends Role {
constructor(player, data) {
super("Witch Doctor", player, data);

this.alignment = "Cult";
this.cards = ["VillageCore", "WinWithCult", "MeetingCult", "ConvertSave", "KillCultistsOnDeath"];
}
};
31 changes: 31 additions & 0 deletions Games/types/Mafia/roles/cards/ConvertSave.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const Card = require("../../Card");
const { PRIORITY_NIGHT_SAVER } = require("../../const/Priority");

module.exports = class ConvertSave extends Card {
constructor(role) {
super(role);

this.meetings = {
"Save": {
states: ["Night"],
flags: ["voting"],
action: {
labels: ["save", "convert", "cult"],
priority: PRIORITY_NIGHT_SAVER,
run: function () {
this.heal(1);

let killers = this.getVisitors(this.target, "kill");
if (killers.length == 0) {
return;
}

this.actor.role.killers = killers;
this.actor.role.savedRole = this.target.role.name;
this.target.setRole("Cultist");
},
},
},
};
}
};
18 changes: 10 additions & 8 deletions data/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1111,9 +1111,6 @@ const roleData = {
"If no one was condemned, chooses a player to jail after each day meeting.",
"Meets with the prisoner at night and the prisoner cannot perform actions or attend other meetings or be targeted.",
"Decides whether or not the prisoner should be executed.",
"Chooses a player to jail each day meeting.",
"Meets with the prisoner at night and the prisoner cannot perform actions or attend other meetings.",
"Decides whether or not the prisoner should be condemned.",
],
},
Hitman: {
Expand Down Expand Up @@ -1414,7 +1411,6 @@ const roleData = {
},
"Cat Lady": {
alignment: "Cult",
recentlyUpdated: true,
description: [
"Chooses a player to send them a cat, each day.",
"The player can choose to let the cat in during the night, or chase it out.",
Expand All @@ -1424,15 +1420,22 @@ const roleData = {
},
Diabolist: {
alignment: "Cult",
recentlyUpdated: true,
description: [
"Chooses a player to be a victim and a target each night.",
"Chooses a victim and a target each night.",
"If the victim votes for the target in the village meeting the following day, the victim will die.",
],
},
"Wei Boyang": {
"Witch Doctor": {
alignment: "Cult",
newlyAdded: true,
description: [
"Chooses a player each night.",
"If that player was targeted by a kiling role, that player is saved and converts to Cultist.",
"All Cultists die if the Witch Doctor dies.",
],
},
"Wei Boyang": {
alignment: "Cult",
description: [
"Gives out a gun each night.",
"If a player not aligned with the Cult is shot, they will survive and convert to Cultist.",
Expand All @@ -1441,7 +1444,6 @@ const roleData = {
},
Doomsayer: {
alignment: "Cult",
newlyAdded: true,
description: [
"Convert all players who visit during the night.",
"All Cultists die if the Doomsayer dies.",
Expand Down
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 @@ -2284,6 +2284,10 @@
background-image: url("/images/roles/snow-queen-vivid.png");
}

.role-icon-scheme-vivid .role-Mafia-Witch-Doctor {
background-image: url("/images/roles/witch-doctor-vivid.png");
}

/*
* Independent and Hostile (parse these out later)
*/
Expand Down

0 comments on commit 825b23d

Please sign in to comment.