diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d24ba..c480384 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ # Release Notes ## Upcomming Version -Correcting automatic adding/deletion of Fabled +- Updating night order (and its print) +- Correcting automatic adding/deletion of Fabled ### Version 3.17.0 diff --git a/src/assets/icons/dawn.png b/src/assets/icons/dawn.png new file mode 100644 index 0000000..4913f33 Binary files /dev/null and b/src/assets/icons/dawn.png differ diff --git a/src/assets/icons/dusk.png b/src/assets/icons/dusk.png new file mode 100644 index 0000000..c70ac4f Binary files /dev/null and b/src/assets/icons/dusk.png differ diff --git a/src/components/modals/NightOrderModal.vue b/src/components/modals/NightOrderModal.vue index dd80a98..2d00151 100644 --- a/src/components/modals/NightOrderModal.vue +++ b/src/components/modals/NightOrderModal.vue @@ -36,6 +36,17 @@ }} + +
+ +
+ +
+ +
{{ role.otherNightReminder }} @@ -113,13 +137,54 @@ export default { computed: { rolesFirstNight: function () { 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 - if (this.players.length > 6) { + if (this.players.length - nbTravelers > 6 || toymaker) { rolesFirstNight.push( { - id: "evil", + id: "minion", name: this.locale.modal.nightOrder.minionInfo, - firstNight: 5, + firstNight: 7, team: "minion", players: this.players.filter((p) => p.role.team === "minion"), firstNightReminder: @@ -128,7 +193,7 @@ export default { { id: "evil", name: this.locale.modal.nightOrder.demonInfo, - firstNight: 8, + firstNight: 10, team: "demon", players: this.players.filter((p) => p.role.team === "demon"), 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); return rolesFirstNight; }, rolesOtherNight: function () { const rolesOtherNight = []; - this.roles.forEach((role) => { - const players = this.players.filter((p) => p.role.id === role.id); - if (role.otherNight && (role.team !== "traveler" || players.length)) { - rolesOtherNight.push(Object.assign({ players }, role)); + rolesOtherNight.push( + { + id: "dusk", + 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 .filter(({ otherNight }) => otherNight) .forEach((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); return rolesOtherNight; }, - ...mapState(["roles", "modals", "edition", "grimoire", "locale"]), - ...mapState("players", ["players", "fabled"]), + ...mapState([ + "roles", + "modals", + "edition", + "grimoire", + "locale", + "session" + ]), + ...mapState("players", ["players", "fabled"]) }, methods: { ...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 { li { display: flex; width: 100%; margin-bottom: 3px; .icon { - width: 6vh; - background-size: cover; - background-position: 0 0; + width: 5vh; + background-size: 100% auto; + background-position: center center; + background-repeat: no-repeat; flex-grow: 0; flex-shrink: 0; text-align: center; @@ -277,7 +389,7 @@ ul { .name { flex-grow: 0; flex-shrink: 0; - width: 15%; + width: 5%; text-align: right; font-size: 110%; padding: 5px; diff --git a/src/store/locale/en/ui.json b/src/store/locale/en/ui.json index 8dad857..d8003c0 100644 --- a/src/store/locale/en/ui.json +++ b/src/store/locale/en/ui.json @@ -200,9 +200,14 @@ "firstNight": "First Night", "otherNights": "Other Nights", "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", - "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": { "title": "Character Reference", diff --git a/src/store/locale/fr/ui.json b/src/store/locale/fr/ui.json index 8f72eb5..152e55e 100644 --- a/src/store/locale/fr/ui.json +++ b/src/store/locale/fr/ui.json @@ -200,9 +200,14 @@ "firstNight": "Première Nuit", "otherNights": "Autres Nuits", "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", - "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": { "title": "Réference de rôles", diff --git a/src/vars.scss b/src/vars.scss index 79161d5..123438e 100644 --- a/src/vars.scss +++ b/src/vars.scss @@ -4,3 +4,4 @@ $outsider: #46d5ff; $minion: #ff6900; $demon: #ce0100; $traveler: #cc04ff; +$default: #4E4E4E;