Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

miller refactor #1646

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Games/types/Mafia/items/Suit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = class Suit extends Item {
constructor(options) {
super("Suit");
this.type = options?.type;
this.identity = options?.identity;
this.concealed = options?.concealed;
if (this.concealed) {
this.cannotBeSnooped = true;
Expand All @@ -16,6 +17,7 @@ module.exports = class Suit extends Item {
player.role.appearance.reveal = this.type;
player.role.appearance.investigate = this.type;
player.role.appearance.condemn = this.type;
player.role.appearance.self = this.identity;
player.role.hideModifier = {
death: true,
reveal: true,
Expand Down
2 changes: 1 addition & 1 deletion Games/types/Mafia/roles/Village/Miller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ module.exports = class Miller extends Role {
super("Miller", player, data);

this.alignment = "Village";
this.cards = ["VillageCore", "WinWithVillage", "AppearAsMafioso"];
this.cards = ["VillageCore", "WinWithVillage", "AppearAsRandomEvil"];
}
};
10 changes: 0 additions & 10 deletions Games/types/Mafia/roles/Village/Occultist.js

This file was deleted.

22 changes: 0 additions & 22 deletions Games/types/Mafia/roles/cards/AppearAsCultist.js

This file was deleted.

22 changes: 0 additions & 22 deletions Games/types/Mafia/roles/cards/AppearAsMafioso.js

This file was deleted.

33 changes: 33 additions & 0 deletions Games/types/Mafia/roles/cards/AppearAsRandomEvil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const Card = require("../../Card");
const Random = require("../../../../../lib/Random");

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

this.listeners = {
roleAssigned: function (player) {
if (player !== this.player) {
return;
}

let roles = [];

for (let player of this.game.players) {
let roleName = player.role.name;
let roleAignment = player.role.alignment;
if (
roleAignment === "Mafia" ||
roleAignment === "Cult"
) {
roles.push(roleName);
}
}

const roleAppearance = Random.randArrayVal(roles);
const selfAppearance = role.name == "Miller" ? "Villager" : "real";
this.player.holdItem("Suit", { type: roleAppearance, identity: selfAppearance, concealed: true });
},
};
}
};
1 change: 0 additions & 1 deletion Games/types/Mafia/roles/cards/AppearAsRandomRole.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ module.exports = class AppearAsRandomRole extends Card {

const roleAppearance = Random.randArrayVal(roles);
this.player.holdItem("Suit", { type: roleAppearance, concealed: true });
this.player.queueAlert(roleAppearance);
},
};
}
Expand Down
23 changes: 9 additions & 14 deletions data/modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,27 +195,27 @@ const modifierData = {
"If this player is shot or targeted for a kill, will bleed and then die in one day.",
},
Shady: {
internal: ["AppearAsMafioso"],
internal: ["AppearAsRandomEvil"],
description:
"Appears as Mafioso when investigated or condemned. Appears as their real role on death.",
incompatible: ["Blasphemous", "Faceless", "Unassuming"],
"Appears as a random role in the game that is Mafia/Cult-aligned.",
incompatible: ["Camouflaged", "Faceless", "Unassuming"],
},
Blasphemous: {
internal: ["AppearAsCultist"],
Camouflaged: {
internal: ["AppearAsRandomRole"],
description:
"Appears as Cultist when investigated or condemned. Appears as their real role on death.",
"Appears as a random role in the game that is not Villager, Impersonator or Impostor.",
incompatible: ["Shady", "Faceless", "Unassuming"],
},
},
Faceless: {
internal: ["AppearAsFliplessOnDeath"],
description:
"Player's role will be hidden from the town when condemned or on death.",
incompatible: ["Shady", "Blasphemous", "Unassuming"],
incompatible: ["Shady", "Camouflaged", "Unassuming"],
},
Unassuming: {
internal: ["AppearAsVillagerOnDeath"],
description: "Appears as Villager when condemned or on death.",
incompatible: ["Shady", "Blasphemous", "Faceless"],
incompatible: ["Shady", "Camouflaged", "Faceless"],
},
Noisy: {
internal: ["RevealNameToTarget"],
Expand Down Expand Up @@ -338,11 +338,6 @@ const modifierData = {
internal: ["DisguiseAsTarget"],
description: "Gains a suit of each target's role.",
},
Camouflaged: {
internal: ["AppearAsRandomRole"],
description:
"Appears as a random role in the game that is not Villager, Impersonator or Impostor.",
},
Omniscient: {
internal: ["Omniscient"],
description: "Each night see all visits and learn all players roles.",
Expand Down
1 change: 1 addition & 0 deletions data/renamedModifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module.exports = {
Loudmouthed: "Loud",
Gossipy: "Loud",
Oblivious: "Lone",
Blasphemous: "Shady",
},
};
1 change: 1 addition & 0 deletions data/renamedRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
Poltergeist: "Hooker",
Quartermaster: "Gunsmith",
Benandante: "Grouch",
Occultist: "Miller",
},
Ghost: {
Town: "Villager",
Expand Down
14 changes: 1 addition & 13 deletions data/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,7 @@ const roleData = {
category: "Basic",
description: [
"Appears as Villager to self.",
"Appears as Mafioso to investigative roles.",
"Appears as Mafioso upon being condemned.",
"Appears as Miller upon being killed.",
],
},
Occultist: {
alignment: "Village",
category: "Basic",
description: [
"Appears as Villager to self.",
"Appears as Cultist to investigative roles.",
"Appears as Cultist upon being condemned.",
"Appears as Occultist upon being killed.",
"Appears as a random role in the game that is Mafia/Cult-aligned to investigative roles and upon being killed.",
],
},
"Party Host": {
Expand Down
Loading