mirror of
https://github.com/bra1n/townsquare.git
synced 2025-04-04 22:24:36 +00:00
Removed travelers from majority calculation
This commit is contained in:
parent
f98b43e304
commit
7a7b478a9f
3 changed files with 8 additions and 2 deletions
|
@ -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]];
|
||||
},
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Add table
Reference in a new issue