mirror of
https://github.com/bra1n/townsquare.git
synced 2025-04-04 22:24:36 +00:00
Updating night order print (#108)
This commit is contained in:
parent
efde95a34a
commit
3f666ce5f4
7 changed files with 155 additions and 31 deletions
|
@ -1,7 +1,8 @@
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
## Upcomming Version
|
## Upcomming Version
|
||||||
Correcting automatic adding/deletion of Fabled
|
- Updating night order (and its print)
|
||||||
|
- Correcting automatic adding/deletion of Fabled
|
||||||
|
|
||||||
### Version 3.17.0
|
### Version 3.17.0
|
||||||
|
|
||||||
|
|
BIN
src/assets/icons/dawn.png
Normal file
BIN
src/assets/icons/dawn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 85 KiB |
BIN
src/assets/icons/dusk.png
Normal file
BIN
src/assets/icons/dusk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 79 KiB |
|
@ -36,6 +36,17 @@
|
||||||
}}</small
|
}}</small
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
<span
|
||||||
|
class="player"
|
||||||
|
v-if="
|
||||||
|
(role.id == 'dawn' || role.team == 'fabled') &&
|
||||||
|
!session.isSpectator &&
|
||||||
|
players.length && players[0].role.id
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<br />
|
||||||
|
<small> </small>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
class="icon"
|
class="icon"
|
||||||
|
@ -92,6 +103,19 @@
|
||||||
}}</small
|
}}</small
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
|
<span
|
||||||
|
class="player"
|
||||||
|
v-if="
|
||||||
|
(role.id == 'dawn' ||
|
||||||
|
role.id == 'dusk' ||
|
||||||
|
role.team == 'fabled') &&
|
||||||
|
!session.isSpectator &&
|
||||||
|
players.length && players[0].role.id
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<br />
|
||||||
|
<small> </small>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="reminder" v-if="role.otherNightReminder">
|
<span class="reminder" v-if="role.otherNightReminder">
|
||||||
{{ role.otherNightReminder }}
|
{{ role.otherNightReminder }}
|
||||||
|
@ -113,13 +137,54 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
rolesFirstNight: function () {
|
rolesFirstNight: function () {
|
||||||
const rolesFirstNight = [];
|
const rolesFirstNight = [];
|
||||||
|
// Ajouter le matin à l'ordre nocturne
|
||||||
|
rolesFirstNight.push({
|
||||||
|
id: "dawn",
|
||||||
|
name: this.locale.modal.nightOrder.dawn,
|
||||||
|
firstNight: 60,
|
||||||
|
team: "default",
|
||||||
|
players: [],
|
||||||
|
firstNightReminder: this.locale.modal.nightOrder.dawnDescription1
|
||||||
|
});
|
||||||
|
var toymaker = false;
|
||||||
|
// Ajout des fabuleux
|
||||||
|
this.fabled.forEach(fabled => {
|
||||||
|
if (fabled.firstNight) {
|
||||||
|
rolesFirstNight.push(Object.assign({ players: [] }, fabled));
|
||||||
|
} else if (fabled.id == "toymaker") {
|
||||||
|
toymaker = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.roles.forEach(role => {
|
||||||
|
const players = this.players.filter(p => p.role.id === role.id);
|
||||||
|
if (role.firstNight && role.team !== "traveler") {
|
||||||
|
rolesFirstNight.push(Object.assign({ players }, role));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double
|
||||||
|
const seenTravelers = [];
|
||||||
|
var nbTravelers = 0;
|
||||||
|
this.players.forEach(player => {
|
||||||
|
if (player.role.team == "traveler") {
|
||||||
|
nbTravelers++;
|
||||||
|
if (!seenTravelers.includes(player.role.id)) {
|
||||||
|
seenTravelers.push(player.role.id);
|
||||||
|
if (player.role.firstNight) {
|
||||||
|
const players = this.players.filter(
|
||||||
|
p => p.role.id === player.role.id
|
||||||
|
);
|
||||||
|
rolesFirstNight.push(Object.assign({ players }, player.role));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
// Ajouter minion / demon infos à l'ordre nocturne
|
// Ajouter minion / demon infos à l'ordre nocturne
|
||||||
if (this.players.length > 6) {
|
if (this.players.length - nbTravelers > 6 || toymaker) {
|
||||||
rolesFirstNight.push(
|
rolesFirstNight.push(
|
||||||
{
|
{
|
||||||
id: "evil",
|
id: "minion",
|
||||||
name: this.locale.modal.nightOrder.minionInfo,
|
name: this.locale.modal.nightOrder.minionInfo,
|
||||||
firstNight: 5,
|
firstNight: 7,
|
||||||
team: "minion",
|
team: "minion",
|
||||||
players: this.players.filter((p) => p.role.team === "minion"),
|
players: this.players.filter((p) => p.role.team === "minion"),
|
||||||
firstNightReminder:
|
firstNightReminder:
|
||||||
|
@ -128,7 +193,7 @@ export default {
|
||||||
{
|
{
|
||||||
id: "evil",
|
id: "evil",
|
||||||
name: this.locale.modal.nightOrder.demonInfo,
|
name: this.locale.modal.nightOrder.demonInfo,
|
||||||
firstNight: 8,
|
firstNight: 10,
|
||||||
team: "demon",
|
team: "demon",
|
||||||
players: this.players.filter((p) => p.role.team === "demon"),
|
players: this.players.filter((p) => p.role.team === "demon"),
|
||||||
firstNightReminder:
|
firstNightReminder:
|
||||||
|
@ -136,38 +201,68 @@ export default {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
this.roles.forEach((role) => {
|
|
||||||
const players = this.players.filter((p) => p.role.id === role.id);
|
|
||||||
if (role.firstNight && (role.team !== "traveler" || players.length)) {
|
|
||||||
rolesFirstNight.push(Object.assign({ players }, role));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.fabled
|
|
||||||
.filter(({ firstNight }) => firstNight)
|
|
||||||
.forEach((fabled) => {
|
|
||||||
rolesFirstNight.push(Object.assign({ players: [] }, fabled));
|
|
||||||
});
|
|
||||||
rolesFirstNight.sort((a, b) => a.firstNight - b.firstNight);
|
rolesFirstNight.sort((a, b) => a.firstNight - b.firstNight);
|
||||||
return rolesFirstNight;
|
return rolesFirstNight;
|
||||||
},
|
},
|
||||||
rolesOtherNight: function () {
|
rolesOtherNight: function () {
|
||||||
const rolesOtherNight = [];
|
const rolesOtherNight = [];
|
||||||
this.roles.forEach((role) => {
|
rolesOtherNight.push(
|
||||||
const players = this.players.filter((p) => p.role.id === role.id);
|
{
|
||||||
if (role.otherNight && (role.team !== "traveler" || players.length)) {
|
id: "dusk",
|
||||||
rolesOtherNight.push(Object.assign({ players }, role));
|
name: this.locale.modal.nightOrder.dusk,
|
||||||
|
team: "default",
|
||||||
|
otherNight: 1,
|
||||||
|
players: [],
|
||||||
|
otherNightReminder: this.locale.modal.nightOrder.duskDescription
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "dawn",
|
||||||
|
name: this.locale.modal.nightOrder.dawn,
|
||||||
|
team: "default",
|
||||||
|
otherNight: Infinity,
|
||||||
|
players: [],
|
||||||
|
otherNightReminder: this.locale.modal.nightOrder.dawnDescription2
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
this.fabled
|
this.fabled
|
||||||
.filter(({ otherNight }) => otherNight)
|
.filter(({ otherNight }) => otherNight)
|
||||||
.forEach((fabled) => {
|
.forEach((fabled) => {
|
||||||
rolesOtherNight.push(Object.assign({ players: [] }, fabled));
|
rolesOtherNight.push(Object.assign({ players: [] }, fabled));
|
||||||
});
|
});
|
||||||
|
this.roles.forEach(role => {
|
||||||
|
const players = this.players.filter(p => p.role.id === role.id);
|
||||||
|
if (role.otherNight && role.team !== "traveler") {
|
||||||
|
rolesOtherNight.push(Object.assign({ players }, role));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Ajout des Voyageurs, en n'ajoutant qu'une fois ceux en double
|
||||||
|
const seenTravelers = [];
|
||||||
|
this.players.forEach(player => {
|
||||||
|
if (
|
||||||
|
player.role.otherNight &&
|
||||||
|
player.role.team == "traveler" &&
|
||||||
|
!seenTravelers.includes(player.role.id)
|
||||||
|
) {
|
||||||
|
const players = this.players.filter(
|
||||||
|
p => p.role.id === player.role.id
|
||||||
|
);
|
||||||
|
seenTravelers.push(player.role.id);
|
||||||
|
rolesOtherNight.push(Object.assign({ players }, player.role));
|
||||||
|
}
|
||||||
|
});
|
||||||
rolesOtherNight.sort((a, b) => a.otherNight - b.otherNight);
|
rolesOtherNight.sort((a, b) => a.otherNight - b.otherNight);
|
||||||
return rolesOtherNight;
|
return rolesOtherNight;
|
||||||
},
|
},
|
||||||
...mapState(["roles", "modals", "edition", "grimoire", "locale"]),
|
...mapState([
|
||||||
...mapState("players", ["players", "fabled"]),
|
"roles",
|
||||||
|
"modals",
|
||||||
|
"edition",
|
||||||
|
"grimoire",
|
||||||
|
"locale",
|
||||||
|
"session"
|
||||||
|
]),
|
||||||
|
...mapState("players", ["players", "fabled"])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(["toggleModal"]),
|
...mapMutations(["toggleModal"]),
|
||||||
|
@ -255,15 +350,32 @@ h4 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.traveler {
|
||||||
|
.name {
|
||||||
|
background: linear-gradient(90deg, $traveler, transparent 35%);
|
||||||
|
.night .other & {
|
||||||
|
background: linear-gradient(-90deg, $traveler, transparent 35%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.default {
|
||||||
|
.name {
|
||||||
|
background: linear-gradient(90deg, $default, transparent 35%);
|
||||||
|
.night .other & {
|
||||||
|
background: linear-gradient(-90deg, $default, transparent 35%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ul {
|
ul {
|
||||||
li {
|
li {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
.icon {
|
.icon {
|
||||||
width: 6vh;
|
width: 5vh;
|
||||||
background-size: cover;
|
background-size: 100% auto;
|
||||||
background-position: 0 0;
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -277,7 +389,7 @@ ul {
|
||||||
.name {
|
.name {
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
width: 15%;
|
width: 5%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 110%;
|
font-size: 110%;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
|
|
|
@ -200,9 +200,14 @@
|
||||||
"firstNight": "First Night",
|
"firstNight": "First Night",
|
||||||
"otherNights": "Other Nights",
|
"otherNights": "Other Nights",
|
||||||
"minionInfo": "Minion info",
|
"minionInfo": "Minion info",
|
||||||
"minionInfoDescription": "• If more than one Minion, they all make eye contact with each other. • Show the “This is the Demon” card. Point to the Demon.",
|
"minionInfoDescription": "If more than one Minion, they all make eye contact with each other. Show the “This is the Demon” card. Point to the Demon.",
|
||||||
"demonInfo": "Demon info & bluffs",
|
"demonInfo": "Demon info & bluffs",
|
||||||
"demonInfoDescription": "• Show the “These are your minions” card. Point to each Minion. • Show the “These characters are not in play” card. Show 3 character tokens of good characters not in play."
|
"demonInfoDescription": "Show the “These are your minions” card. Point to each Minion. Show the “These characters are not in play” card. Show 3 character tokens of good characters not in play.",
|
||||||
|
"dawn": "Dawn",
|
||||||
|
"dawnDescription1": "Wake all players.",
|
||||||
|
"dawnDescription2": "Wake all players, then announce who died this night.",
|
||||||
|
"dusk": "Dusk",
|
||||||
|
"duskDescription": "End the day, and put all players to sleep."
|
||||||
},
|
},
|
||||||
"reference": {
|
"reference": {
|
||||||
"title": "Character Reference",
|
"title": "Character Reference",
|
||||||
|
|
|
@ -200,9 +200,14 @@
|
||||||
"firstNight": "Première Nuit",
|
"firstNight": "Première Nuit",
|
||||||
"otherNights": "Autres Nuits",
|
"otherNights": "Autres Nuits",
|
||||||
"minionInfo": "Informations Serviteurs",
|
"minionInfo": "Informations Serviteurs",
|
||||||
"minionInfoDescription": "• S'il y a plusieurs Serviteurs, ils apprennent qui sont les autres Serviteurs. • Indiquez aux Serviteurs qui est le Démon.",
|
"minionInfoDescription": "S'il y a plusieurs Serviteurs, ils apprennent qui sont les autres Serviteurs. Indiquez aux Serviteurs qui est le Démon.",
|
||||||
"demonInfo": "Info & Bluffs Démon",
|
"demonInfo": "Info & Bluffs Démon",
|
||||||
"demonInfoDescription": "• Indiquez au Démon qui sont ses serviteurs.• Indiquez les rôles de 3 personnages Bons qui ne sont pas en jeu."
|
"demonInfoDescription": "Indiquez au Démon qui sont ses serviteurs. Indiquez les rôles de 3 personnages bons qui ne sont pas en jeu.",
|
||||||
|
"dawn": "Matin",
|
||||||
|
"dawnDescription1": "Réveillez les joueurs.",
|
||||||
|
"dawnDescription2": "Réveillez les joueurs, puis annoncez qui est mort cette nuit",
|
||||||
|
"dusk": "Tombée de la nuit",
|
||||||
|
"duskDescription": "Terminez la journée, et endormez les joueurs."
|
||||||
},
|
},
|
||||||
"reference": {
|
"reference": {
|
||||||
"title": "Réference de rôles",
|
"title": "Réference de rôles",
|
||||||
|
|
|
@ -4,3 +4,4 @@ $outsider: #46d5ff;
|
||||||
$minion: #ff6900;
|
$minion: #ff6900;
|
||||||
$demon: #ce0100;
|
$demon: #ce0100;
|
||||||
$traveler: #cc04ff;
|
$traveler: #cc04ff;
|
||||||
|
$default: #4E4E4E;
|
||||||
|
|
Loading…
Add table
Reference in a new issue