Merge branch 'main' of https://github.com/davotronic5000/townsquare into #43_gender_pronouns

This commit is contained in:
Dave 2021-01-25 22:22:23 +00:00
commit d74a9f2d76
11 changed files with 182 additions and 99 deletions

View File

@ -1,5 +1,18 @@
# Release Notes # Release Notes
## Version 2.5.0
- all travelers from the base editions are now optionally available (thanks @davotronic5000)
- night order shows player names near roles now
---
## Version 2.4.0
- added spoiler role (Pixie!)
- fixed bug with ST sending out roles that are not part of the current edition / script (ie. travelers or base set roles)
- better Lycanthrope icon (thanks @AWConant)
---
## Version 2.3.1 ## Version 2.3.1
- better vote history design and added timestamps - better vote history design and added timestamps
- adjusted player menu styling on smaller screens - adjusted player menu styling on smaller screens

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "townsquare", "name": "townsquare",
"version": "2.3.1", "version": "2.5.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "townsquare", "name": "townsquare",
"version": "2.3.1", "version": "2.5.0",
"description": "Blood on the Clocktower Town Square", "description": "Blood on the Clocktower Town Square",
"author": "Steffen Baumgart", "author": "Steffen Baumgart",
"scripts": { "scripts": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 95 KiB

BIN
src/assets/icons/pixie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View File

@ -24,7 +24,13 @@
:class="[role.team]" :class="[role.team]"
> >
<span class="name"> <span class="name">
{{ role.name }} {{ role.name }}<br />
<small>{{
players
.filter(p => p.role.id === role.id)
.map(p => p.name)
.join(", ")
}}</small>
</span> </span>
<span <span
class="icon" class="icon"
@ -52,7 +58,13 @@
}" }"
></span> ></span>
<span class="name"> <span class="name">
{{ role.name }} {{ role.name }}<br />
<small>{{
players
.filter(p => p.role.id === role.id)
.map(p => p.name)
.join(", ")
}}</small>
</span> </span>
</li> </li>
</ul> </ul>
@ -179,57 +191,42 @@ h4 {
} }
.fabled { .fabled {
.name, .name {
.player, background: linear-gradient(90deg, $fabled, transparent 35%);
h4 { .night .other & {
color: $fabled; background: linear-gradient(-90deg, $fabled, transparent 35%);
&:before,
&:after {
background-color: $fabled;
} }
} }
} }
.townsfolk { .townsfolk {
.name, .name {
.player, background: linear-gradient(90deg, $townsfolk, transparent 35%);
h4 { .night .other & {
color: $townsfolk; background: linear-gradient(-90deg, $townsfolk, transparent 35%);
&:before,
&:after {
background-color: $townsfolk;
} }
} }
} }
.outsider { .outsider {
.name, .name {
.player, background: linear-gradient(90deg, $outsider, transparent 35%);
h4 { .night .other & {
color: $outsider; background: linear-gradient(-90deg, $outsider, transparent 35%);
&:before,
&:after {
background-color: $outsider;
} }
} }
} }
.minion { .minion {
.name, .name {
.player, background: linear-gradient(90deg, $minion, transparent 35%);
h4 { .night .other & {
color: $minion; background: linear-gradient(-90deg, $minion, transparent 35%);
&:before,
&:after {
background-color: $minion;
} }
} }
} }
.demon { .demon {
.name, .name {
.player, background: linear-gradient(90deg, $demon, transparent 35%);
h4 { .night .other & {
color: $demon; background: linear-gradient(-90deg, $demon, transparent 35%);
&:before,
&:after {
background-color: $demon;
} }
} }
} }
@ -237,20 +234,15 @@ ul {
li { li {
display: flex; display: flex;
width: 100%; width: 100%;
align-items: center; margin-bottom: 3px;
align-content: center;
/*background: linear-gradient(0deg, #ffffff0f, transparent);*/
border-radius: 10px;
.icon { .icon {
width: 6vh; width: 6vh;
background-size: cover; background-size: cover;
background-position: 0 -5px; background-position: 0 0;
flex-grow: 0; flex-grow: 0;
flex-shrink: 0; flex-shrink: 0;
margin: 0 10px;
text-align: center; text-align: center;
border-left: 1px solid #ffffff1f; margin: 0 2px;
border-right: 1px solid #ffffff1f;
&:after { &:after {
content: " "; content: " ";
display: block; display: block;
@ -261,19 +253,14 @@ ul {
flex-grow: 0; flex-grow: 0;
flex-shrink: 0; flex-shrink: 0;
width: 15%; width: 15%;
font-weight: bold;
text-align: right; text-align: right;
font-family: "Papyrus", sans-serif;
font-size: 110%; font-size: 110%;
padding: 5px;
border-left: 1px solid rgba(255, 255, 255, 0.4);
border-right: 1px solid rgba(255, 255, 255, 0.4);
small {
color: #888;
} }
.player {
flex-grow: 0;
flex-shrink: 1;
text-align: right;
margin: 0 10px;
}
.ability {
flex-grow: 1;
} }
} }
&.legend { &.legend {
@ -307,28 +294,23 @@ ul {
.headline { .headline {
display: block; display: block;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid white; border-bottom: 1px solid rgba(255, 255, 255, 0.4);
padding: 5px 10px; padding: 5px 10px;
border-radius: 0; border-radius: 0;
text-align: center; text-align: center;
} }
.icon {
border-color: white;
}
.name { .name {
flex-grow: 1; flex-grow: 1;
} }
.first { .first {
.icon { .name {
border-right: 0; border-left: 0;
} }
} }
.other { .other {
li .name { li .name {
text-align: left; text-align: left;
} border-right: 0;
.icon {
border-left: 0;
} }
} }
} }

View File

@ -82,6 +82,21 @@ export default {
})) }))
]; ];
}); });
// add out of script traveler reminders
this.$store.state.otherTravelers.forEach(role => {
if (players.some(p => p.role.id === role.id)) {
reminders = [
...reminders,
...role.reminders.map(name => ({
role: role.id,
image: role.image,
name
}))
];
}
});
reminders.push({ role: "good", name: "Good" }); reminders.push({ role: "good", name: "Good" });
reminders.push({ role: "evil", name: "Evil" }); reminders.push({ role: "evil", name: "Evil" });
reminders.push({ role: "custom", name: "Custom note" }); reminders.push({ role: "custom", name: "Custom note" });

View File

@ -1,8 +1,5 @@
<template> <template>
<Modal <Modal v-if="modals.role && availableRoles.length" @close="close">
v-if="modals.role && availableRoles.length"
@close="toggleModal('role')"
>
<h3> <h3>
Choose a new character for Choose a new character for
{{ {{
@ -11,7 +8,7 @@
: "bluffing" : "bluffing"
}} }}
</h3> </h3>
<ul class="tokens"> <ul class="tokens" v-if="tab === 'editionRoles' || !otherTravelers.size">
<li <li
v-for="role in availableRoles" v-for="role in availableRoles"
:class="[role.team]" :class="[role.team]"
@ -21,6 +18,33 @@
<Token :role="role" /> <Token :role="role" />
</li> </li>
</ul> </ul>
<ul class="tokens" v-if="tab === 'otherTravelers' && otherTravelers.size">
<li
v-for="role in otherTravelers.values()"
:class="[role.team]"
:key="role.id"
@click="setRole(role)"
>
<Token :role="role" />
</li>
</ul>
<div
class="button-group"
v-if="playerIndex >= 0 && otherTravelers.size && !session.isSpectator"
>
<span
class="button"
:class="{ townsfolk: tab === 'editionRoles' }"
@click="tab = 'editionRoles'"
>Edtition Roles</span
>
<span
class="button"
:class="{ townsfolk: tab === 'otherTravelers' }"
@click="tab = 'otherTravelers'"
>Other Travelers</span
>
</div>
</Modal> </Modal>
</template> </template>
@ -50,7 +74,13 @@ export default {
return availableRoles; return availableRoles;
}, },
...mapState(["modals", "roles", "session"]), ...mapState(["modals", "roles", "session"]),
...mapState("players", ["players"]) ...mapState("players", ["players"]),
...mapState(["otherTravelers"])
},
data() {
return {
tab: "editionRoles"
};
}, },
methods: { methods: {
setRole(role) { setRole(role) {
@ -72,6 +102,10 @@ export default {
} }
this.$store.commit("toggleModal", "role"); this.$store.commit("toggleModal", "role");
}, },
close() {
this.tab = "editionRoles";
this.toggleModal("role");
},
...mapMutations(["toggleModal"]) ...mapMutations(["toggleModal"])
} }
}; };

View File

@ -4,7 +4,7 @@
"name": "Washerwoman", "name": "Washerwoman",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 19, "firstNight": 20,
"firstNightReminder": "Show the character token of a Townsfolk in play. Point to two players, one of which is that character.", "firstNightReminder": "Show the character token of a Townsfolk in play. Point to two players, one of which is that character.",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "", "otherNightReminder": "",
@ -18,7 +18,7 @@
"name": "Librarian", "name": "Librarian",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 20, "firstNight": 21,
"firstNightReminder": "Show the character token of an Outsider in play. Point to two players, one of which is that character.", "firstNightReminder": "Show the character token of an Outsider in play. Point to two players, one of which is that character.",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "", "otherNightReminder": "",
@ -32,7 +32,7 @@
"name": "Investigator", "name": "Investigator",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 21, "firstNight": 22,
"firstNightReminder": "Show the character token of a Minion in play. Point to two players, one of which is that character.", "firstNightReminder": "Show the character token of a Minion in play. Point to two players, one of which is that character.",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "", "otherNightReminder": "",
@ -46,7 +46,7 @@
"name": "Chef", "name": "Chef",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 22, "firstNight": 23,
"firstNightReminder": "Show the finger signal (0, 1, 2, \u2026) for the number of pairs of neighbouring evil players.", "firstNightReminder": "Show the finger signal (0, 1, 2, \u2026) for the number of pairs of neighbouring evil players.",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "", "otherNightReminder": "",
@ -59,7 +59,7 @@
"name": "Empath", "name": "Empath",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 23, "firstNight": 24,
"firstNightReminder": "Show the finger signal (0, 1, 2) for the number of evil alive neighbours of the Empath.", "firstNightReminder": "Show the finger signal (0, 1, 2) for the number of evil alive neighbours of the Empath.",
"otherNight": 43, "otherNight": 43,
"otherNightReminder": "Show the finger signal (0, 1, 2) for the number of evil neighbours.", "otherNightReminder": "Show the finger signal (0, 1, 2) for the number of evil neighbours.",
@ -72,7 +72,7 @@
"name": "Fortune Teller", "name": "Fortune Teller",
"edition": "tb", "edition": "tb",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 24, "firstNight": 25,
"firstNightReminder": "The Fortune Teller points to two players. Give the head signal (nod yes, shake no) for whether one of those players is the Demon. ", "firstNightReminder": "The Fortune Teller points to two players. Give the head signal (nod yes, shake no) for whether one of those players is the Demon. ",
"otherNight": 44, "otherNight": 44,
"otherNightReminder": "The Fortune Teller points to two players. Show the head signal (nod 'yes', shake 'no') for whether one of those players is the Demon.", "otherNightReminder": "The Fortune Teller points to two players. Show the head signal (nod 'yes', shake 'no') for whether one of those players is the Demon.",
@ -176,7 +176,7 @@
"name": "Butler", "name": "Butler",
"edition": "tb", "edition": "tb",
"team": "outsider", "team": "outsider",
"firstNight": 25, "firstNight": 26,
"firstNightReminder": "The Butler points to a player. Mark that player as 'Master'.", "firstNightReminder": "The Butler points to a player. Mark that player as 'Master'.",
"otherNight": 45, "otherNight": 45,
"otherNightReminder": "The Butler points to a player. Mark that player as 'Master'.", "otherNightReminder": "The Butler points to a player. Mark that player as 'Master'.",
@ -242,7 +242,7 @@
"name": "Spy", "name": "Spy",
"edition": "tb", "edition": "tb",
"team": "minion", "team": "minion",
"firstNight": 33, "firstNight": 34,
"firstNightReminder": "Show the Grimoire to the Spy for as long as they need.", "firstNightReminder": "Show the Grimoire to the Spy for as long as they need.",
"otherNight": 56, "otherNight": 56,
"otherNightReminder": "Show the Grimoire to the Spy for as long as they need.", "otherNightReminder": "Show the Grimoire to the Spy for as long as they need.",
@ -359,7 +359,7 @@
"name": "Grandmother", "name": "Grandmother",
"edition": "bmr", "edition": "bmr",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 26, "firstNight": 27,
"firstNightReminder": "Show the marked character token. Point to the marked player.", "firstNightReminder": "Show the marked character token. Point to the marked player.",
"otherNight": 39, "otherNight": 39,
"otherNightReminder": "If the Grandmother\u2019s grandchild was killed by the Demon tonight: The Grandmother dies.", "otherNightReminder": "If the Grandmother\u2019s grandchild was killed by the Demon tonight: The Grandmother dies.",
@ -385,7 +385,7 @@
"name": "Chambermaid", "name": "Chambermaid",
"edition": "bmr", "edition": "bmr",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 36, "firstNight": 37,
"firstNightReminder": "The Chambermaid points to two players. Show the number signal (0, 1, 2, \u2026) for how many of those players wake tonight for their ability.", "firstNightReminder": "The Chambermaid points to two players. Show the number signal (0, 1, 2, \u2026) for how many of those players wake tonight for their ability.",
"otherNight": 59, "otherNight": 59,
"otherNightReminder": "The Chambermaid points to two players. Show the number signal (0, 1, 2, \u2026) for how many of those players wake tonight for their ability.", "otherNightReminder": "The Chambermaid points to two players. Show the number signal (0, 1, 2, \u2026) for how many of those players wake tonight for their ability.",
@ -400,7 +400,7 @@
"team": "townsfolk", "team": "townsfolk",
"firstNight": 0, "firstNight": 0,
"firstNightReminder": "", "firstNightReminder": "",
"otherNight": 18, "otherNight": 17,
"otherNightReminder": "The Exorcist points to a player, different from the previous night. If that player is the Demon: Wake the Demon. Show the Exorcist token. Point to the Exorcist. The Demon does not act tonight.", "otherNightReminder": "The Exorcist points to a player, different from the previous night. If that player is the Demon: Wake the Demon. Show the Exorcist token. Point to the Exorcist. The Demon does not act tonight.",
"reminders": ["Chosen"], "reminders": ["Chosen"],
"setup": false, "setup": false,
@ -574,7 +574,7 @@
"team": "outsider", "team": "outsider",
"firstNight": 3, "firstNight": 3,
"firstNightReminder": "If 7 or more players: Show the Lunatic a number of arbitrary 'Minions', players equal to the number of Minions in play. Show 3 character tokens of arbitrary good characters. If the token received by the Lunatic is a Demon that would wake tonight: Allow the Lunatic to do the Demon actions. Place their 'attack' markers. Wake the Demon. Show the Demon\u2019s real character token. Show them the Lunatic player. If the Lunatic attacked players: Show the real demon each marked player. Remove any Lunatic 'attack' markers.", "firstNightReminder": "If 7 or more players: Show the Lunatic a number of arbitrary 'Minions', players equal to the number of Minions in play. Show 3 character tokens of arbitrary good characters. If the token received by the Lunatic is a Demon that would wake tonight: Allow the Lunatic to do the Demon actions. Place their 'attack' markers. Wake the Demon. Show the Demon\u2019s real character token. Show them the Lunatic player. If the Lunatic attacked players: Show the real demon each marked player. Remove any Lunatic 'attack' markers.",
"otherNight": 17, "otherNight": 16,
"otherNightReminder": "Allow the Lunatic to do the actions of the Demon. Place their 'attack' markers. If the Lunatic selected players: Wake the Demon. Show the 'attack' marker, then point to each marked player. Remove any Lunatic 'attack' markers.", "otherNightReminder": "Allow the Lunatic to do the actions of the Demon. Place their 'attack' markers. If the Lunatic selected players: Wake the Demon. Show the 'attack' marker, then point to each marked player. Remove any Lunatic 'attack' markers.",
"reminders": ["Attack 1", "reminders": ["Attack 1",
"Attack 2", "Attack 2",
@ -763,7 +763,7 @@
"name": "Clockmaker", "name": "Clockmaker",
"edition": "snv", "edition": "snv",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 27, "firstNight": 28,
"firstNightReminder": "Show the hand signal for the number (1, 2, 3, etc.) of places from Demon to closest Minion.", "firstNightReminder": "Show the hand signal for the number (1, 2, 3, etc.) of places from Demon to closest Minion.",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "", "otherNightReminder": "",
@ -776,7 +776,7 @@
"name": "Dreamer", "name": "Dreamer",
"edition": "snv", "edition": "snv",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 28, "firstNight": 29,
"firstNightReminder": "The Dreamer points to a player. Show 1 good and 1 evil character token; one of these is correct.", "firstNightReminder": "The Dreamer points to a player. Show 1 good and 1 evil character token; one of these is correct.",
"otherNight": 47, "otherNight": 47,
"otherNightReminder": "The Dreamer points to a player. Show 1 good and 1 evil character token; one of these is correct.", "otherNightReminder": "The Dreamer points to a player. Show 1 good and 1 evil character token; one of these is correct.",
@ -802,7 +802,7 @@
"name": "Mathematician", "name": "Mathematician",
"edition": "snv", "edition": "snv",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 35, "firstNight": 36,
"firstNightReminder": "Show the hand signal for the number (0, 1, 2, etc.) of players whose ability malfunctioned due to other abilities.", "firstNightReminder": "Show the hand signal for the number (0, 1, 2, etc.) of players whose ability malfunctioned due to other abilities.",
"otherNight": 58, "otherNight": 58,
"otherNightReminder": "Show the hand signal for the number (0, 1, 2, etc.) of players whose ability malfunctioned due to other abilities.", "otherNightReminder": "Show the hand signal for the number (0, 1, 2, etc.) of players whose ability malfunctioned due to other abilities.",
@ -869,7 +869,7 @@
"name": "Seamstress", "name": "Seamstress",
"edition": "snv", "edition": "snv",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 29, "firstNight": 30,
"firstNightReminder": "The Seamstress either shows a 'no' head signal, or points to two other players. If the Seamstress chose players , nod 'yes' or shake 'no' for whether they are of same alignment.", "firstNightReminder": "The Seamstress either shows a 'no' head signal, or points to two other players. If the Seamstress chose players , nod 'yes' or shake 'no' for whether they are of same alignment.",
"otherNight": 51, "otherNight": 51,
"otherNightReminder": "If the Seamstress has not yet used their ability: the Seamstress either shows a 'no' head signal, or points to two other players. If the Seamstress chose players , nod 'yes' or shake 'no' for whether they are of same alignment.", "otherNightReminder": "If the Seamstress has not yet used their ability: the Seamstress either shows a 'no' head signal, or points to two other players. If the Seamstress chose players , nod 'yes' or shake 'no' for whether they are of same alignment.",
@ -1161,7 +1161,7 @@
"name": "Bounty Hunter", "name": "Bounty Hunter",
"edition": "", "edition": "",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 31, "firstNight": 32,
"firstNightReminder": "Point to 1 evil player. Wake the townsfolk who is evil and show them the 'You are' card and the thumbs down evil sign.", "firstNightReminder": "Point to 1 evil player. Wake the townsfolk who is evil and show them the 'You are' card and the thumbs down evil sign.",
"otherNight": 54, "otherNight": 54,
"otherNightReminder": "If the known evil player has died, point to another evil player. ", "otherNightReminder": "If the known evil player has died, point to another evil player. ",
@ -1169,6 +1169,20 @@
"setup": true, "setup": true,
"ability": "You start knowing 1 evil player. If the player you know dies, you learn another evil player tonight. [1 Townsfolk is evil]" "ability": "You start knowing 1 evil player. If the player you know dies, you learn another evil player tonight. [1 Townsfolk is evil]"
}, },
{
"id": "pixie",
"name": "Pixie",
"edition": "",
"team": "townsfolk",
"firstNight": 19,
"firstNightReminder": "Show the Pixie 1 in-play Townsfolk role.",
"otherNight": 0,
"otherNightReminder": "",
"reminders": ["Mad",
"Has ability"],
"setup": false,
"ability": "You start knowing 1 in-play Townsfolk. If you were mad that you were this character, you gain their ability when they die."
},
{ {
"id": "preacher", "id": "preacher",
"name": "Preacher", "name": "Preacher",
@ -1187,7 +1201,7 @@
"name": "General", "name": "General",
"edition": "", "edition": "",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 34, "firstNight": 35,
"firstNightReminder": "Show the General thumbs up for good winning, thumbs down for evil winning or thumb to the side for neither.", "firstNightReminder": "Show the General thumbs up for good winning, thumbs down for evil winning or thumb to the side for neither.",
"otherNight": 57, "otherNight": 57,
"otherNightReminder": "Show the General thumbs up for good winning, thumbs down for evil winning or thumb to the side for neither.", "otherNightReminder": "Show the General thumbs up for good winning, thumbs down for evil winning or thumb to the side for neither.",
@ -1200,7 +1214,7 @@
"name": "Balloonist", "name": "Balloonist",
"edition": "", "edition": "",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 30, "firstNight": 31,
"firstNightReminder": "Choose a character type. Point to a player whose character is of that type. Place the Balloonist's Seen reminder next to that character.", "firstNightReminder": "Choose a character type. Point to a player whose character is of that type. Place the Balloonist's Seen reminder next to that character.",
"otherNight": 53, "otherNight": 53,
"otherNightReminder": "Choose a character type that does not yet have a Seen reminder next to a character of that type. Point to a player whose character is of that type, if there are any. Place the Balloonist's Seen reminder next to that character.", "otherNightReminder": "Choose a character type that does not yet have a Seen reminder next to a character of that type. Point to a player whose character is of that type, if there are any. Place the Balloonist's Seen reminder next to that character.",
@ -1217,7 +1231,7 @@
"name": "Cult Leader", "name": "Cult Leader",
"edition": "", "edition": "",
"team": "townsfolk", "team": "townsfolk",
"firstNight": 32, "firstNight": 33,
"firstNightReminder": "If the cult leader changed alignment, show them the thumbs up good signal of the thumbs down evil signal accordingly.", "firstNightReminder": "If the cult leader changed alignment, show them the thumbs up good signal of the thumbs down evil signal accordingly.",
"otherNight": 55, "otherNight": 55,
"otherNightReminder": "If the cult leader changed alignment, show them the thumbs up good signal of the thumbs down evil signal accordingly.", "otherNightReminder": "If the cult leader changed alignment, show them the thumbs up good signal of the thumbs down evil signal accordingly.",
@ -1232,7 +1246,7 @@
"team": "townsfolk", "team": "townsfolk",
"firstNight": 0, "firstNight": 0,
"firstNightReminder": "", "firstNightReminder": "",
"otherNight": 16, "otherNight": 18,
"otherNightReminder": "The Lycanthrope points to a living player: if good, they die and no one else can die tonight.", "otherNightReminder": "The Lycanthrope points to a living player: if good, they die and no one else can die tonight.",
"reminders": ["Dead"], "reminders": ["Dead"],
"setup": false, "setup": false,
@ -1340,8 +1354,9 @@
"firstNightReminder": "", "firstNightReminder": "",
"otherNight": 29, "otherNight": 29,
"otherNightReminder": "Choose a player, that player dies.", "otherNightReminder": "Choose a player, that player dies.",
"reminders": ["Dead", "reminders": [],
"Is the Demon"], "remindersGlobal": ["Is the Demon",
"Dead"],
"setup": true, "setup": true,
"ability": "Each night, Minions choose who babysits Lil Monsta's token & \"is the Demon\". A player dies each night*. [+1 Minion]" "ability": "Each night, Minions choose who babysits Lil Monsta's token & \"is the Demon\". A player dies each night*. [+1 Minion]"
}, },
@ -1350,7 +1365,7 @@
"name": "Leviathan", "name": "Leviathan",
"edition": "", "edition": "",
"team": "demon", "team": "demon",
"firstNight": 38, "firstNight": 39,
"firstNightReminder": "Place the Leviathan 'Day 1' marker. Announce 'The Leviathan is in play; this is Day 1.'", "firstNightReminder": "Place the Leviathan 'Day 1' marker. Announce 'The Leviathan is in play; this is Day 1.'",
"otherNight": 0, "otherNight": 0,
"otherNightReminder": "Place the next Leviathan 'Day n' marker, where 'n' is the next day number. Announce 'The Leviathan is in play; this is Day n.'.", "otherNightReminder": "Place the next Leviathan 'Day n' marker, where 'n' is the next day number. Announce 'The Leviathan is in play; this is Day n.'.",

View File

@ -25,6 +25,19 @@ const getRolesByEdition = (edition = editionJSON[0]) => {
); );
}; };
const getTravelersNotInEdition = (edition = editionJSON[0]) => {
return new Map(
rolesJSON
.filter(
r =>
r.team === "traveler" &&
r.edition !== edition.id &&
!edition.roles.includes(r.id)
)
.map(role => [role.id, role])
);
};
// base definition for custom roles // base definition for custom roles
const imageBase = const imageBase =
"https://raw.githubusercontent.com/bra1n/townsquare/main/src/assets/icons/"; "https://raw.githubusercontent.com/bra1n/townsquare/main/src/assets/icons/";
@ -70,6 +83,7 @@ export default new Vuex.Store({
}, },
edition: editionJSONbyId.get("tb"), edition: editionJSONbyId.get("tb"),
roles: getRolesByEdition(), roles: getRolesByEdition(),
otherTravelers: getTravelersNotInEdition(),
fabled fabled
}, },
getters: { getters: {
@ -180,11 +194,18 @@ export default new Vuex.Store({
// convert to Map // convert to Map
.map(role => [role.id, role]) .map(role => [role.id, role])
); );
// update extraTravelers map to only show travelers not in this script
state.otherTravelers = new Map(
rolesJSON
.filter(r => r.team === "traveler" && !roles.some(i => i.id === r.id))
.map(role => [role.id, role])
);
}, },
setEdition(state, edition) { setEdition(state, edition) {
if (editionJSONbyId.has(edition.id)) { if (editionJSONbyId.has(edition.id)) {
state.edition = editionJSONbyId.get(edition.id); state.edition = editionJSONbyId.get(edition.id);
state.roles = getRolesByEdition(state.edition); state.roles = getRolesByEdition(state.edition);
state.otherTravelers = getTravelersNotInEdition(state.edition);
} else { } else {
state.edition = edition; state.edition = edition;
} }

View File

@ -444,8 +444,11 @@ class LiveSession {
value: {} value: {}
}); });
} else { } else {
// load role // load role, first from session, the global, then fail gracefully
const role = this._store.state.roles.get(value); const role =
this._store.state.roles.get(value) ||
this._store.getters.rolesJSONbyId.get(value) ||
{};
this._store.commit("players/update", { this._store.commit("players/update", {
player, player,
property: "role", property: "role",