Removed travelers from majority calculation

This commit is contained in:
Simon Balling 2022-06-26 01:05:50 +02:00
parent f98b43e304
commit 7a7b478a9f
3 changed files with 8 additions and 2 deletions

View file

@ -121,7 +121,7 @@ export default {
computed: {
...mapState("players", ["players"]),
...mapState(["session", "grimoire"]),
...mapGetters({ alive: "players/alive" }),
...mapGetters({ alive: "players/aliveNonTravelers" }),
nominator: function() {
return this.players[this.session.nomination[0]];
},

View file

@ -24,6 +24,12 @@ const getters = {
);
return Math.min(nonTravelers.length, 15);
},
aliveNonTravelers({ players }) {
const nonTravelers = players.filter(
player => !player.isDead && player.role.team !== "traveler"
);
return Math.min(nonTravelers.length, 15);
},
// calculate a Map of player => night order
nightOrder({ players, fabled }) {
const firstNight = [0];

View file

@ -84,7 +84,7 @@ const mutations = {
nominee: players[state.nomination[1]].name,
type: isExile ? "Exile" : "Execution",
majority: Math.ceil(
players.filter(player => !player.isDead || isExile).length / 2
players.filter(player => (!player.isDead && player.role.team !== "traveler") || isExile).length / 2
),
votes: players
.filter((player, index) => state.votes[index])