diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a66a139..b4ea5af 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -89,17 +89,17 @@ module.exports = { hostname: 'https://heros-et-dragons.fr' } ], - [ - '@vuepress/pwa', - { - serviceWorker: true, - updatePopup: true, - generateSWConfig: { - cacheId: 'hddrs', - globIgnores: ['**/*.js', '**/*.css', '**/*.html'] - } - } - ], + // [ + // '@vuepress/pwa', + // { + // serviceWorker: true, + // updatePopup: true, + // generateSWConfig: { + // cacheId: 'hddrs', + // globIgnores: ['**/*.js', '**/*.css', '**/*.html'] + // } + // } + // ], [ 'seo', { @@ -117,10 +117,16 @@ module.exports = { // modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated), } ], + // [ + // '@vuepress/google-analytics', + // { + // 'ga': '' // UA-00000000-0 + // } + // ] ], - // extendPageData ($page) { - // $page.rawContent = ($page._strippedContent) - // }, + extendPageData ($page) { + $page.rawContent = ($page._strippedContent) + }, markdown: { anchor: { permalinkBefore: false, @@ -135,6 +141,44 @@ module.exports = { }) } }, + additionalPages: [ + { + path: '/mon-grimoire/', + frontmatter: { + layout: 'MySpellsLayout' + } + }, + { + path: '/mon-bestiaire/', + frontmatter: { + layout: 'MyMonstersLayout' + } + }, + { + path: '/mes-objets-magiques/', + frontmatter: { + layout: 'MyMagicItemsLayout' + } + }, + { + path: '/creation-de-sort/', + frontmatter: { + layout: 'CreateSpellLayout' + } + }, + { + path: '/creation-de-monstre-pnj/', + frontmatter: { + layout: 'CreateMonsterLayout' + } + }, + { + path: '/creation-d-objet-magique/', + frontmatter: { + layout: 'CreateMagicItemLayout' + } + } + ], themeConfig: { domain: 'https://staging.heros-et-dragons.fr', repository: 'https://github.com/em-squared/heros-et-dragons-drs', @@ -150,7 +194,7 @@ module.exports = { sidebar: [ { title: 'Pour les joueurs', - expanded: true, + icon: 'mdi-book-open-variant', children: [ { title: "Création du personnage", @@ -426,6 +470,7 @@ module.exports = { }, { title: 'Pour les meneurs', + icon: 'mdi-map', children: [ { title: "Créatures & oppositions", @@ -487,6 +532,46 @@ module.exports = { ] }, {type: 'divider'}, + { + title: 'Bibliothèques', + icon: 'mdi-book', + children: [ + { + title: 'Mon grimoire', + path: '/mon-grimoire/', + badge: 'mySpells' + }, + { + title: 'Mon bestiaire', + path: '/mon-bestiaire/', + badge: 'myMonsters' + }, + { + title: 'Mes objets magiques', + path: '/mes-objets-magiques/', + badge: 'myMagicItems' + } + ] + }, + { + title: 'Outils de création', + icon: 'mdi-tools', + children: [ + { + title: 'Création de sort', + path: '/creation-de-sort/' + }, + { + title: 'Création de monstre/PNJ', + path: '/creation-de-monstre-pnj/' + }, + { + title: "Création d'objet magique", + path: '/creation-d-objet-magique/' + }, + ] + }, + {type: 'divider'}, { title: "Licence OGL", path: '/licence-ogl/', diff --git a/docs/.vuepress/data/armorTypes.js b/docs/.vuepress/data/armorTypes.js index 74cda56..4edd658 100644 --- a/docs/.vuepress/data/armorTypes.js +++ b/docs/.vuepress/data/armorTypes.js @@ -12,3 +12,22 @@ export const armorTypes = { "clibanion": { value: 17, maxDex: 0 }, "harnois": { value: 18, maxDex: 0 }, } + +export const ARMORTYPES = [ + { label: "Aucune", value: null }, + { label: "Armure du mage", value: 'armure du mage' }, + { label: "Armure naturelle", value: 'armure naturelle' }, + { label: "Armure matelassée", value: 'armure matelassée' }, + { label: "Armure de cuir", value: 'armure de cuir' }, + { label: "Armure de cuir clouté", value: 'armure de cuir clouté' }, + { label: "Armure de peau", value: 'armure de peau' }, + { label: "Chemise de maille", value: 'chemise de maille' }, + { label: "Armure d'écailles", value: "armure d'écailles" }, + { label: "Cuirasse", value: 'cuirasse' }, + { label: "Demi-plate", value: 'demi-plate' }, + { label: "Armure annelée", value: 'armure annelée' }, + { label: "Cotte de mailles", value: 'cotte de mailles' }, + { label: "Clibanion", value: 'clibanion' }, + { label: "Harnois", value: 'harnois' }, + { label: "Autre", value: 'custom' }, +] diff --git a/docs/.vuepress/data/classes.js b/docs/.vuepress/data/classes.js new file mode 100644 index 0000000..6429699 --- /dev/null +++ b/docs/.vuepress/data/classes.js @@ -0,0 +1,11 @@ +export const CLASSES = [ + "Barde", + "Clerc", + "Druide", + "Ensorceleur/Sorcelame", + "Magicien", + "Ombrelame", + "Paladin", + "Rôdeur", + "Sorcier", +] diff --git a/docs/.vuepress/data/conditions.js b/docs/.vuepress/data/conditions.js new file mode 100644 index 0000000..f1bccca --- /dev/null +++ b/docs/.vuepress/data/conditions.js @@ -0,0 +1,17 @@ +export const CONDITIONS = [ + { text: "À terre", value:'a-terre' }, + { text: "Assourdi", value: 'assourdi' }, + { text: "Aveuglé", value: 'aveugle' }, + { text: "Charmé", value: 'charme' }, + { text: "Épuisé", value: 'epuise' }, + { text: "Empoigné", value: 'empoigne' }, + { text: "Empoisonné", value: 'empoisonne' }, + { text: "Entravé", value: 'entrave' }, + { text: "Étourdi", value: 'etourdi' }, + { text: "Inconscient", value: 'inconscient' }, + { text: "Invisible", value: 'invisible' }, + { text: "Neutralisé", value: 'neutralise' }, + { text: "Paralysé", value: 'paralyse' }, + { text: "Pétrifié", value: 'petrifie' }, + { text: "Terrorisé", value: 'terrorise' }, +] diff --git a/docs/.vuepress/data/damageTypes.js b/docs/.vuepress/data/damageTypes.js new file mode 100644 index 0000000..9e07368 --- /dev/null +++ b/docs/.vuepress/data/damageTypes.js @@ -0,0 +1,36 @@ +export const DAMAGETYPES = [ + { text: "contondants, perforants et tranchants infligés par des attaques non-magiques", value: 'c-p-t-non-magique' }, + { text: "contondants, perforants et tranchants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'c-p-t-non-argent' }, + { text: "contondants, perforants et tranchants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'c-p-t-non-adamantite' }, + { text: "contondants et perforants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'c-p-non-argent' }, + { text: "contondants et perforants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'c-p-non-adamantite' }, + { text: "contondants et perforants infligés par des attaques non-magiques", value: 'c-p-non-magique' }, + { text: "contondants et tranchants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'c-t-non-argent' }, + { text: "contondants et tranchants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'c-t-non-adamantite' }, + { text: "contondants et tranchants infligés par des attaques non-magiques", value: 'c-t-non-magique' }, + { text: "perforants et tranchants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'p-t-non-argent' }, + { text: "perforants et tranchants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'p-t-non-adamantite' }, + { text: "perforants et tranchants infligés par des attaques non-magiques", value: 'p-t-non-magique' }, + { text: "tranchants infligés par des attaques non-magiques qui ne sont pas en argent", value: 't-non-argent' }, + { text: "tranchants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 't-non-adamantite' }, + { text: "tranchants infligés par des attaques non-magiques", value: 't-non-magique' }, + { text: "perforants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'p-non-argent' }, + { text: "perforants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'p-non-adamantite' }, + { text: "perforants infligés par des attaques non-magiques", value: 'p-non-magique' }, + { text: "contondants infligés par des attaques non-magiques qui ne sont pas en argent", value: 'c-non-argent' }, + { text: "contondants infligés par des attaques non-magiques qui ne sont pas en adamantite", value: 'c-non-adamantite' }, + { text: "contondants infligés par des attaques non-magiques", value: 'c-non-magique' }, + { text: "d'acide", value: 'acide' }, + { text: "contondants", value: 'contondant' }, + { text: "de feu", value: 'feu' }, + { text: "de force", value: 'force' }, + { text: "de foudre", value: 'foudre' }, + { text: "de froid", value: 'froid' }, + { text: "nécrotiques", value: 'necrotique' }, + { text: "perforants", value: 'perforant' }, + { text: "de poison", value: 'poison' }, + { text: "psychiques", value: 'psychique' }, + { text: "radiants", value: 'radiant' }, + { text: "de tonnerre", value: 'tonnerre' }, + { text: "tranchants", value: 'tranchant' }, +] diff --git a/docs/.vuepress/data/languages.js b/docs/.vuepress/data/languages.js new file mode 100644 index 0000000..e754d0f --- /dev/null +++ b/docs/.vuepress/data/languages.js @@ -0,0 +1,19 @@ +export const LANGUAGES = [ + { text: 'Commun', value: 'commun' }, + { text: 'Elfe', value: 'elfe' }, + { text: 'Géant', value: 'géant' }, + { text: 'Gnome', value: 'gnome' }, + { text: 'Gobelin', value: 'gobelin' }, + { text: 'Halfelin', value: 'halfelin' }, + { text: 'Nain', value: 'nain' }, + { text: 'Orc', value: 'orc' }, + { text: 'Abyssal', value: 'abyssal' }, + { text: 'Céleste', value: 'céleste' }, + { text: 'Commun des profondeurs', value: 'commun des profondeurs' }, + { text: 'Draconique', value: 'draconique' }, + { text: 'Infernal', value: 'infernal' }, + { text: 'Primordial', value: 'primordial' }, + { text: 'Noir parler', value: 'noir parler' }, + { text: 'Sselish', value: 'sselish' }, + { text: 'Sylvestre', value: 'sylvestre' }, +] diff --git a/docs/.vuepress/data/magicItems.js b/docs/.vuepress/data/magicItems.js new file mode 100644 index 0000000..f4f5f5c --- /dev/null +++ b/docs/.vuepress/data/magicItems.js @@ -0,0 +1,20 @@ +export const MAGICITEMTYPES = [ + "Anneau", + "Arme", + "Armure", + "Baguette", + "Bâton", + "Objet merveilleux", + "Parchemin", + "Potion", + "Sceptre", +] + +export const RARITIES = [ + "Courant", + "Peu courant", + "Rare", + "Très rare", + "Légendaire", + "Artefact", +] diff --git a/docs/.vuepress/data/monsters.js b/docs/.vuepress/data/monsters.js new file mode 100644 index 0000000..e8945c5 --- /dev/null +++ b/docs/.vuepress/data/monsters.js @@ -0,0 +1,92 @@ +export const MONSTERTYPES = [ + "Aberration", + "Bête", + "Céleste", + "Créature artificielle", + "Créature monstrueuse", + "Dragon", + "Élémentaire", + "Fées", + "Fiélon", + "Géant", + "Humanoide", + "Mort-vivant", + "Plante", + "Vase", +] + +export const MONSTERSIZES = [ + { label: "Très petit", abbr: "TP", hitDie: 4 }, + { label: "Petit", abbr: "P", hitDie: 6 }, + { label: "Moyen", abbr: "M", hitDie: 8 }, + { label: "Grand", abbr: "G", hitDie: 10 }, + { label: "Très grand", abbr: "TG", hitDie: 12 }, + { label: "Gigantesque", abbr: "Gig", hitDie: 20 }, +] + +export const CHALLENGES = [ + { label: "0", value:'0', xp: "0 ou 10" }, + { label: "1/8", value:'0.125', xp: 25 }, + { label: "1/4", value:'0.25', xp: 50 }, + { label: "1/2", value:'0.5', xp: 100 }, + { label: "1", value:'1', xp: 200 }, + { label: "2", value:'2', xp: 450 }, + { label: "3", value:'3', xp: 700 }, + { label: "4", value:'4', xp: 1100 }, + { label: "5", value:'5', xp: 1800 }, + { label: "6", value:'6', xp: 2300 }, + { label: "7", value:'7', xp: 2900 }, + { label: "8", value:'8', xp: 3900 }, + { label: "9", value:'9', xp: 5000 }, + { label: "10", value:'10', xp: 5900 }, + { label: "11", value:'11', xp: 7200 }, + { label: "12", value:'12', xp: 8400 }, + { label: "13", value:'13', xp: 10000 }, + { label: "14", value:'14', xp: 11500 }, + { label: "15", value:'15', xp: 13000 }, + { label: "16", value:'16', xp: 15000 }, + { label: "17", value:'17', xp: 18000 }, + { label: "18", value:'18', xp: 20000 }, + { label: "19", value:'19', xp: 22000 }, + { label: "20", value:'20', xp: 25000 }, + { label: "21", value:'21', xp: 33000 }, + { label: "22", value:'22', xp: 41000 }, + { label: "23", value:'23', xp: 50000 }, + { label: "24", value:'24', xp: 62000 }, + { label: "25", value:'25', xp: 75000 }, + { label: "26", value:'26', xp: 90000 }, + { label: "27", value:'27', xp: 105000 }, + { label: "28", value:'28', xp: 120000 }, + { label: "29", value:'29', xp: 135000 }, + { label: "30", value:'30', xp: 155000 }, +] + +export const ABILITIES = [ + { label: 'Force', value: 'for', abbr: 'For' }, + { label: 'Dextérité', value: 'dex', abbr: 'Dex' }, + { label: 'Constitution', value: 'con', abbr: 'Con' }, + { label: 'Intelligence', value: 'int', abbr: 'Int' }, + { label: 'Sagesse', value: 'sag', abbr: 'Sag' }, + { label: 'Charisme', value: 'cha', abbr: 'Cha' }, +] + +export const SKILLS = [ + { label: "Acrobaties", value:"acrobaties", ability: "dex" }, + { label: "Arcanes", value:"arcanes", ability: "int" }, + { label: "Athlétisme", value:"athletisme", ability: "for" }, + { label: "Discrétion", value:"discretion", ability: "dex" }, + { label: "Dressage", value:"dressage", ability: "sag" }, + { label: "Escamotage", value:"escamotage", ability: "dex" }, + { label: "Histoire", value:"histoire", ability: "int" }, + { label: "Intimidation", value:"intimidation", ability: "cha" }, + { label: "Investigation", value:"investigation", ability: "int" }, + { label: "Médecine", value:"medecine", ability: "sag" }, + { label: "Nature", value:"nature", ability: "int" }, + { label: "Perception", value:"perception", ability: "sag" }, + { label: "Perspicacité", value:"perspicacite", ability: "sag" }, + { label: "Persuasion", value:"persuasion", ability: "cha" }, + { label: "Religion", value:"religion", ability: "int" }, + { label: "Représentation", value:"representation", ability: "cha" }, + { label: "Supercherie", value:"supercherie", ability: "cha" }, + { label: "Survie", value:"survie", ability: "sag" }, +] diff --git a/docs/.vuepress/data/spells.js b/docs/.vuepress/data/spells.js new file mode 100644 index 0000000..c240ae2 --- /dev/null +++ b/docs/.vuepress/data/spells.js @@ -0,0 +1,23 @@ +export const SPELLSCHOOLS = [ + "Abjuration", + "Enchantement", + "Divination", + "Évocation", + "Illusion", + "Invocation", + "Nécromancie", + "Transmutation", +] + +export const SPELLLEVELS = [ + { value: 0, label: "Tour de magie" }, + { value: 1, label: "1" }, + { value: 2, label: "2" }, + { value: 3, label: "3" }, + { value: 4, label: "4" }, + { value: 5, label: "5" }, + { value: 6, label: "6" }, + { value: 7, label: "7" }, + { value: 8, label: "8" }, + { value: 9, label: "9" }, +] diff --git a/docs/.vuepress/data/stats.js b/docs/.vuepress/data/stats.js index 09676ab..d96087a 100644 --- a/docs/.vuepress/data/stats.js +++ b/docs/.vuepress/data/stats.js @@ -1,19 +1,19 @@ export const stats = { monsterTypes: { - "Aberration": { plural: "Aberrations", swarm: "d'aberrations" }, - "Bête": { plural: "Bêtes", swarm: "de bêtes"}, - "Céleste": { plural: "Célestes", swarm: "de célestes" }, - "Créature artificielle": { plural: "Créatures artificielles", swarm: "de créatures artificielles"}, - "Créature monstrueuse": { plural: "Créatures monstrueuses", swarm: "de créatures monstrueuses"}, - "Dragon": { plural: "Dragons", swarm: "de dragons"}, - "Élémentaire": { plural: "Élémentaires", swarm: "d'élémentaires"}, - "Fées": { plural: "Fées", swarm: "de fées"}, - "Fiélon": { plural: "Fiélons", swarm: "de fiélons"}, - "Géant": { plural: "Géants", swarm: "de géants"}, - "Humanoide": { plural: "Humanoïdes", swarm: "d'humanoïdes"}, - "Mort-vivant": { plural: "Morts-vivants", swarm: "de morts-vivants"}, - "Plante": { plural: "Plantes", swarm: "de plantes"}, - "Vase": { plural: "Vases", swarm: "de vases"} + "Aberration": { plural: "Aberrations", swarm: "d'aberrations" , label: "Aberration"}, + "Bête": { plural: "Bêtes", swarm: "de bêtes", label: "Bête"}, + "Céleste": { plural: "Célestes", swarm: "de célestes" , label: "Céleste"}, + "Créature artificielle": { plural: "Créatures artificielles", swarm: "de créatures artificielles", label: "Créature artificielle"}, + "Créature monstrueuse": { plural: "Créatures monstrueuses", swarm: "de créatures monstrueuses", label: "Créature monstrueuse"}, + "Dragon": { plural: "Dragons", swarm: "de dragons", label: "Dragon"}, + "Élémentaire": { plural: "Élémentaires", swarm: "d'élémentaires", label: "Élémentaire"}, + "Fées": { plural: "Fées", swarm: "de fées", label: "Fées"}, + "Fiélon": { plural: "Fiélons", swarm: "de fiélons", label: "Fiélon"}, + "Géant": { plural: "Géants", swarm: "de géants", label: "Géant"}, + "Humanoide": { plural: "Humanoïdes", swarm: "d'humanoïdes", label: "Humanoide"}, + "Mort-vivant": { plural: "Morts-vivants", swarm: "de morts-vivants", label: "Mort-vivant"}, + "Plante": { plural: "Plantes", swarm: "de plantes", label: "Plante"}, + "Vase": { plural: "Vases", swarm: "de vases", label: "Vase"}, }, abilities: { diff --git a/docs/.vuepress/store/index.js b/docs/.vuepress/store/index.js index e319d08..902069a 100644 --- a/docs/.vuepress/store/index.js +++ b/docs/.vuepress/store/index.js @@ -5,6 +5,10 @@ import spellFilters from './modules/spellFilters' import magicItemFilters from './modules/magicItemFilters' import monsterFilters from './modules/monsterFilters' +import mySpells from './modules/mySpells' +import myMonsters from './modules/myMonsters' +import myMagicItems from './modules/myMagicItems' + Vue.use(Vuex) import Cookies from 'js-cookie' @@ -13,7 +17,10 @@ export default new Vuex.Store({ modules: { spellFilters, magicItemFilters, - monsterFilters + monsterFilters, + mySpells, + myMonsters, + myMagicItems }, state: { diff --git a/docs/.vuepress/store/modules/myMagicItems.js b/docs/.vuepress/store/modules/myMagicItems.js new file mode 100644 index 0000000..cd6d273 --- /dev/null +++ b/docs/.vuepress/store/modules/myMagicItems.js @@ -0,0 +1,63 @@ +import {sortByString} from '@theme/util/filterHelpers' + +export default { + namespaced: true, + + state: { + magicItems: [], + }, + + getters: { + magicItems: state => state.magicItems, + }, + + actions: { + reset: ({ commit }) => { + commit('resetMagicItems') + }, + updateMagicItems: ({ commit }, payload) => { + commit('setMagicItems', payload) + }, + addMagicItem: ({ commit }, payload) => { + commit('addMagicItem', payload) + }, + removeMagicItem: ({ commit }, payload) => { + commit('removeMagicItem', payload) + }, + }, + + mutations: { + initialiseStore (state) { + // Récupération des données utilisateurs depuis le navigateur + if(localStorage.getItem('myMagicItems') && localStorage.getItem('myMagicItems') !== undefined) { + let localStorageData = JSON.parse(localStorage.getItem('myMagicItems')) + state.magicItems = localStorageData.magicItems + } + }, + setMagicItems: (state, payload) => { + state.magicItems = payload + }, + resetMagicItems: (state) => { + state.magicItems = [] + }, + addMagicItem: (state, payload) => { + state.magicItems.push(payload) + state.magicItems.sort((a, b) => { return sortByString(a.title, b.title) }) + }, + updateMagicItem: (state, payload) => { + state.magicItems.forEach((magicItem, idx) => { + if (magicItem.key == payload.key) { + state.magicItems[idx] = payload + } + }) + }, + removeMagicItem: (state, payload) => { + state.magicItems.forEach((magicItem, idx) => { + if (magicItem.key == payload.key) { + state.magicItems.splice(idx, 1) + } + }) + }, + } + +} diff --git a/docs/.vuepress/store/modules/myMonsters.js b/docs/.vuepress/store/modules/myMonsters.js new file mode 100644 index 0000000..7652220 --- /dev/null +++ b/docs/.vuepress/store/modules/myMonsters.js @@ -0,0 +1,63 @@ +import {sortByString} from '@theme/util/filterHelpers' + +export default { + namespaced: true, + + state: { + monsters: [], + }, + + getters: { + monsters: state => state.monsters, + }, + + actions: { + reset: ({ commit }) => { + commit('resetMonsters') + }, + updateMonsters: ({ commit }, payload) => { + commit('setMonsters', payload) + }, + addMonster: ({ commit }, payload) => { + commit('addMonster', payload) + }, + removeMonster: ({ commit }, payload) => { + commit('removeMonster', payload) + }, + }, + + mutations: { + initialiseStore (state) { + // Récupération des données utilisateurs depuis le navigateur + if(localStorage.getItem('myMonsters') && localStorage.getItem('myMonsters') !== undefined) { + let localStorageData = JSON.parse(localStorage.getItem('myMonsters')) + state.monsters = localStorageData.monsters + } + }, + setMonsters: (state, payload) => { + state.monsters = payload + }, + resetMonsters: (state) => { + state.monsters = [] + }, + addMonster: (state, payload) => { + state.monsters.push(payload) + state.monsters.sort((a, b) => { return sortByString(a.title, b.title) }) + }, + updateMonster: (state, payload) => { + state.monsters.forEach((monster, idx) => { + if (monster.key == payload.key) { + state.monsters[idx] = payload + } + }) + }, + removeMonster: (state, payload) => { + state.monsters.forEach((monster, idx) => { + if (monster.key == payload.key) { + state.monsters.splice(idx, 1) + } + }) + }, + } + +} diff --git a/docs/.vuepress/store/modules/mySpells.js b/docs/.vuepress/store/modules/mySpells.js new file mode 100644 index 0000000..41db64d --- /dev/null +++ b/docs/.vuepress/store/modules/mySpells.js @@ -0,0 +1,63 @@ +import {sortByString} from '@theme/util/filterHelpers' + +export default { + namespaced: true, + + state: { + spells: [], + }, + + getters: { + spells: state => state.spells, + }, + + actions: { + reset: ({ commit }) => { + commit('resetSpells') + }, + updateSpells: ({ commit }, payload) => { + commit('setSpells', payload) + }, + addSpell: ({ commit }, payload) => { + commit('addSpell', payload) + }, + removeSpell: ({ commit }, payload) => { + commit('removeSpell', payload) + }, + }, + + mutations: { + initialiseStore (state) { + // Récupération des données utilisateurs depuis le navigateur + if(localStorage.getItem('mySpells') && localStorage.getItem('mySpells') !== undefined) { + let localStorageData = JSON.parse(localStorage.getItem('mySpells')) + state.spells = localStorageData.spells + } + }, + setSpells: (state, payload) => { + state.spells = payload + }, + resetSpells: (state) => { + state.spells = [] + }, + addSpell: (state, payload) => { + state.spells.push(payload) + state.spells.sort((a, b) => { return sortByString(a.title, b.title) }) + }, + updateSpell: (state, payload) => { + state.spells.forEach((spell, idx) => { + if (spell.key == payload.key) { + state.spells[idx] = payload + } + }) + }, + removeSpell: (state, payload) => { + state.spells.forEach((spell, idx) => { + if (spell.key == payload.key) { + state.spells.splice(idx, 1) + } + }) + }, + } + +} diff --git a/docs/.vuepress/theme/components/Breadcrumb.vue b/docs/.vuepress/theme/components/Breadcrumb.vue index 0d4ec32..74f0680 100644 --- a/docs/.vuepress/theme/components/Breadcrumb.vue +++ b/docs/.vuepress/theme/components/Breadcrumb.vue @@ -43,6 +43,16 @@ crumbs.push({to: page.path, disabled: disabled, text: 'Bestiaire'}) } else if (page.path == '/liste-objets-magiques/') { crumbs.push({to: page.path, disabled: disabled, text: 'Liste des objets magiques'}) + } else if (page.path == '/mon-grimoire/') { + crumbs.push({to: page.path, disabled: disabled, text: 'Mon grimoire'}) + } else if (page.path == '/mon-bestiaire/') { + crumbs.push({to: page.path, disabled: disabled, text: 'Mon bestiaire'}) + } else if (page.path == '/mes-objets-magiques/') { + crumbs.push({to: page.path, disabled: disabled, text: 'Mes objets magiques'}) + } else if (page.path == '/creation-de-sort/') { + crumbs.push({to: page.path, disabled: disabled, text: 'Création de sort'}) + } else if (page.path == '/creation-de-monstre-pnj/') { + crumbs.push({to: page.path, disabled: disabled, text: 'Création de monstre ou PNJ'}) } else { crumbs.push({to: page.path, disabled: disabled, text: page.frontmatter.breadcrumb || page.title}) } diff --git a/docs/.vuepress/theme/components/MagicItem.vue b/docs/.vuepress/theme/components/MagicItem.vue index dca600f..f650b46 100644 --- a/docs/.vuepress/theme/components/MagicItem.vue +++ b/docs/.vuepress/theme/components/MagicItem.vue @@ -2,13 +2,17 @@
-

{{ $page.title }}

-
+ +
{{displayItemMeta()}}
- + +

Source : {{ $page.frontmatter.source }}

@@ -17,11 +21,22 @@ + + diff --git a/docs/.vuepress/theme/components/Monster.vue b/docs/.vuepress/theme/components/Monster.vue index 2cce670..64edc1c 100644 --- a/docs/.vuepress/theme/components/Monster.vue +++ b/docs/.vuepress/theme/components/Monster.vue @@ -2,133 +2,140 @@
-

{{ $page.title }}

-
+ +
{{ displayMonsterTypeSizeAlignment() }}
- -
- Classe d'armure - {{ displayAC() }} -
-
- Points de vie - {{ displayHP() }} -
-
- Vitesse - -
-
-
-
-
- For -
-
- {{ displayAbilityScore(monster.abilityScores.for) }} -
-
-
-
- Dex -
-
- {{ displayAbilityScore(monster.abilityScores.dex) }} -
-
-
-
- Con -
-
- {{ displayAbilityScore(monster.abilityScores.con) }} -
-
+
+ +
+ Classe d'armure + {{ displayAC() }}
-
-
-
- Int +
+ Points de vie + {{ hp }} +
+
+ Vitesse + +
+
+
+
+
+ For +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.for) }} +
-
- {{ displayAbilityScore(monster.abilityScores.int) }} +
+
+ Dex +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.dex) }} +
+
+
+
+ Con +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.con) }} +
-
-
- Sag +
+
+
+ Int +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.int) }} +
-
- {{ displayAbilityScore(monster.abilityScores.sag) }} +
+
+ Sag +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.sag) }} +
-
-
-
- Cha -
-
- {{ displayAbilityScore(monster.abilityScores.cha) }} +
+
+ Cha +
+
+ {{ displayAbilityScore(monsterStats.abilityScores.cha) }} +
-
- Jets de sauvegarde - - - -
-
- Compétences - - - -
-
- Vulnérabilité aux dégâts - -
-
- Résistance aux dégâts - -
-
- Immunité contre les dégâts - -
-
- Immunité contre les états - -
-
- Sens - -
-
- Langes - - -
-
- Dangerosité - -
-
- Environnements : - -
-
- Types de donjons : - +
+
+ Jets de sauvegarde + + + +
+
+ Compétences + + + +
+
+ Vulnérabilité aux dégâts + +
+
+ Résistance aux dégâts + +
+
+ Immunité contre les dégâts + +
+
+ Immunité contre les états + +
+
+ Sens + +
+
+ Langes + +
+
+ Dangerosité + +
+
+ Environnements : + +
+
+ Types de donjons : + +
- + +
-

Source : {{ monster.source }}

+

Source : {{ monsterStats.source }}

@@ -145,26 +152,29 @@ import { import {stats} from '../../data/stats.js' import {armorTypes} from '../../data/armorTypes.js' +import MarkdownIt from 'markdown-it' export default { + props: ['monster', 'isList', 'hideTitle'], + data () { return { - + md: new MarkdownIt() } }, computed: { - monster () { - return this.$page.frontmatter + monsterStats () { + return this.monster.frontmatter }, proficiencyBonus () { return this.getProficiencyBonus() }, passivePerception () { - let result = 10 + getModifier(this.monster.abilityScores.sag) - if (this.monster.skills) { - this.monster.skills.forEach((skill, idx) => { + let result = 10 + getModifier(this.monsterStats.abilityScores.sag) + if (this.monsterStats.skills) { + this.monsterStats.skills.forEach((skill, idx) => { if (skill.name == 'perception') { if (skill.isExpert) { result += this.proficiencyBonus * 2 @@ -176,35 +186,73 @@ export default { } return result }, + + hp () { + if (this.monsterStats.customHP) { + return this.monsterStats.customHP + } else if (this.monsterStats.hitDiceCount) { + let hitDieSize = 8 // Dé de vie moyen par défaut + if (this.monsterStats.hitDieSize) { + hitDieSize = this.monsterStats.hitDieSize + } else if (this.monsterStats.size) { + hitDieSize = stats.sizes[this.monsterStats.size].hitDie + } + let hitPointsBonus = 1 + if (this.monsterStats.hitDiceCount > 1) { + hitPointsBonus = Math.floor(this.monsterStats.hitDiceCount / 2) + } + let averageHP = this.monsterStats.hitDiceCount * (hitDieSize / 2) + this.monsterStats.hitDiceCount * getModifier(this.monsterStats.abilityScores.con) + hitPointsBonus + let conMod = "" + if (getModifier(this.monsterStats.abilityScores.con) != 0) { + conMod = this.monsterStats.hitDiceCount * getModifier(this.monsterStats.abilityScores.con) + conMod = displayBonus(conMod) + } + return averageHP + ' (' + this.monsterStats.hitDiceCount + "d" + hitDieSize + conMod + ')' + } + return "" + }, + + languages () { + let result = this.monsterStats.languages.join(', ') + if (this.monsterStats.customLanguage) { + if (result != '') { + result += ', ' + } + result += this.monsterStats.customLanguage + } + if (this.monsterStats.telepathy) { + if (result != '') { + result += ', ' + } + result += 'télépathie ' + this.monsterStats.telepathy + ' m' + } + if (result == '') { + return '—' + } + return result + }, }, methods: { displayList (list) { return list.join(', ') }, displayAbilityScore (value) { return displayAbilityScore(value) }, getModifier (value) { return getModifier(value) }, - getProficiencyBonus () { return getProficiencyBonus(this.monster.challenge) }, + getProficiencyBonus () { return getProficiencyBonus(this.monsterStats.challenge) }, displayMonsterTypeSizeAlignment () { - return displayMonsterTypeSizeAlignment(this.monster) + return displayMonsterTypeSizeAlignment(this.monsterStats) }, displaySavingThrowBonus (ability) { let result = stats.abilities[ability].abbr - let bonus = displayBonus(getModifier(this.monster.abilityScores[ability]) + this.proficiencyBonus) + let bonus = displayBonus(getModifier(this.monsterStats.abilityScores[ability]) + this.proficiencyBonus) result += ' ' + bonus return result }, displaySkillBonus (skill) { - if (skill.name == 'Perception') { - if (skill.isExpert) { - this.monster.perceptionProficiency == 'expert' - } else { - this.monster.perceptionProficiency == 'proficient' - } - } let result = stats.skills[skill.name].label - let bonus = getModifier(this.monster.abilityScores[stats.skills[skill.name].ability]) + this.proficiencyBonus + let bonus = getModifier(this.monsterStats.abilityScores[stats.skills[skill.name].ability]) + this.proficiencyBonus if (skill.isExpert) { bonus += this.proficiencyBonus // Bonus de maître doublé pour les experts } @@ -213,66 +261,41 @@ export default { return result }, - displayHP () { - if (this.monster.customHP) { - return this.monster.customHP - } else if (this.monster.hitDiceCount) { - let hitDieSize = 8 // Dé de vie moyen par défaut - if (this.monster.hitDieSize) { - hitDieSize = this.monster.hitDieSize - } else if (this.monster.size) { - hitDieSize = stats.sizes[this.monster.size].hitDie - } - let hitPointsBonus = 1 - if (this.monster.hitDiceCount > 1) { - hitPointsBonus = Math.floor(this.monster.hitDiceCount / 2) - } - let averageHP = this.monster.hitDiceCount * (hitDieSize / 2) + this.monster.hitDiceCount * getModifier(this.monster.abilityScores.con) + hitPointsBonus - let conMod = "" - if (getModifier(this.monster.abilityScores.con) != 0) { - conMod = this.monster.hitDiceCount * getModifier(this.monster.abilityScores.con) - conMod = displayBonus(conMod) - } - return averageHP + ' (' + this.monster.hitDiceCount + "d" + hitDieSize + conMod + ')' - } - return "" - }, - displayChallenge () { - return displayChallenge(this.monster.challenge, true) + return displayChallenge(this.monsterStats.challenge, true) }, displayMovement () { let result = '' - if (this.monster.movement.walk) { - result += this.monster.movement.walk + ' m' + if (this.monsterStats.movement.walk) { + result += this.monsterStats.movement.walk + ' m' } else { result += '0 m' } - if (this.monster.movement.climb) { + if (this.monsterStats.movement.climb) { if (result != '') { result += ', ' } - result += 'escalade ' + this.monster.movement.climb + ' m' + result += 'escalade ' + this.monsterStats.movement.climb + ' m' } - if (this.monster.movement.burrow) { + if (this.monsterStats.movement.burrow) { if (result != '') { result += ', ' } - result += 'fouissement ' + this.monster.movement.burrow + ' m' + result += 'fouissement ' + this.monsterStats.movement.burrow + ' m' } - if (this.monster.movement.swim) { + if (this.monsterStats.movement.swim) { if (result != '') { result += ', ' } - result += 'nage ' + this.monster.movement.swim + ' m' + result += 'nage ' + this.monsterStats.movement.swim + ' m' } - if (this.monster.movement.fly) { + if (this.monsterStats.movement.fly) { if (result != '') { result += ', ' } - result += 'vol ' + this.monster.movement.fly + ' m' - if (this.monster.movement.hover) { + result += 'vol ' + this.monsterStats.movement.fly + ' m' + if (this.monsterStats.movement.hover) { result += ' (vol stationnaire)' } } @@ -287,44 +310,48 @@ export default { let armor = '' // Le monstre n'a pas d'armure. // CA = 10 + Dex - if (!this.monster.ac.armorType) { - ac = 10 + getModifier(this.monster.abilityScores.dex) + if (!this.monsterStats.ac.armorType) { + ac = 10 + getModifier(this.monsterStats.abilityScores.dex) } else { // Le type d'armure n'est pas formalisé. On prend la valeur brute - if (this.monster.ac.armorType == 'custom') { - return this.monster.ac.value + if (this.monsterStats.ac.armorType == 'custom') { + return this.monsterStats.ac.value } // Le monstre a une armure naturelle. // CA = 10 + Armure naturelle + Dex - if (this.monster.ac.armorType == 'armure naturelle') { - armor = this.monster.ac.armorType - ac = ac + this.monster.ac.value + getModifier(this.monster.abilityScores.dex) - } else if (this.monster.ac.armorType == 'armure du mage') { + if (this.monsterStats.ac.armorType == 'armure naturelle') { + armor = this.monsterStats.ac.armorType + if (parseInt(this.monsterStats.ac.value)) { + ac = ac + parseInt(this.monsterStats.ac.value) + getModifier(this.monsterStats.abilityScores.dex) + } else { + ac = ac + getModifier(this.monsterStats.abilityScores.dex) + } + } else if (this.monsterStats.ac.armorType == 'armure du mage') { hasMageArmor = true - ac = ac + getModifier(this.monster.abilityScores.dex) - mageArmorAc = mageArmorAc + getModifier(this.monster.abilityScores.dex) + ac = ac + getModifier(this.monsterStats.abilityScores.dex) + mageArmorAc = mageArmorAc + getModifier(this.monsterStats.abilityScores.dex) armor = mageArmorAc + ' avec armure du mage' } else { // Le monstre a un type d'armure défini. // On calcule sa CA selon le type - let armorType = armorTypes[this.monster.ac.armorType] + let armorType = armorTypes[this.monsterStats.ac.armorType] // Le type d'armure n'existe pas. On l'ignore. // CA = 10 + Dex if (!armorType) { - ac = ac + getModifier(this.monster.abilityScores.dex) + ac = ac + getModifier(this.monsterStats.abilityScores.dex) } else { // L'armure n'impose pas de limite de Dex - armor = this.monster.ac.armorType + armor = this.monsterStats.ac.armorType if (armorType.maxDex === false) { - ac = armorType.value + getModifier(this.monster.abilityScores.dex) + ac = armorType.value + getModifier(this.monsterStats.abilityScores.dex) } else { // La limite de Dex de l'armure est inférieure à la Dex du monstre - if (armorType.maxDex <= getModifier(this.monster.abilityScores.dex)) { + if (armorType.maxDex <= getModifier(this.monsterStats.abilityScores.dex)) { ac = armorType.value + armorType.maxDex } else { - ac = armorType.value + getModifier(this.monster.abilityScores.dex) + ac = armorType.value + getModifier(this.monsterStats.abilityScores.dex) } } } @@ -333,7 +360,7 @@ export default { // Le monstre a un bouclier. Sa CA augmente de 2. - if (this.monster.ac.hasShield) { + if (this.monsterStats.ac.hasShield) { ac = ac + 2 mageArmorAc = mageArmorAc + 2 if (armor != '') { @@ -353,33 +380,29 @@ export default { return ac }, - displayLanguages () { - return this.monster.languages.join(', ') - }, - displaySenses () { let result = '' - if (this.monster.senses) { - if (this.monster.senses.tremorsense) { - result += 'perception des vibrations ' + this.monster.senses.tremorsense + ' m' + if (this.monsterStats.senses) { + if (this.monsterStats.senses.tremorsense) { + result += 'perception des vibrations ' + this.monsterStats.senses.tremorsense + ' m' } - if (this.monster.senses.blindsight) { + if (this.monsterStats.senses.blindsight) { if (result != '') { result += ', ' } - result += 'vision aveugle ' + this.monster.senses.blindsight + ' m' + result += 'vision aveugle ' + this.monsterStats.senses.blindsight + ' m' } - if (this.monster.senses.darkvision) { + if (this.monsterStats.senses.darkvision) { if (result != '') { result += ', ' } - result += 'vision dans le noir ' + this.monster.senses.darkvision + ' m' + result += 'vision dans le noir ' + this.monsterStats.senses.darkvision + ' m' } - if (this.monster.senses.truesight) { + if (this.monsterStats.senses.truesight) { if (result != '') { result += ', ' } - result += 'vision parfaite ' + this.monster.senses.truesight + ' m' + result += 'vision parfaite ' + this.monsterStats.senses.truesight + ' m' } if (result != '') { result += ', ' @@ -392,9 +415,9 @@ export default { displayConditionImmunities () { let result = '' - this.monster.conditionImmunities.forEach((condition, idx) => { + this.monsterStats.conditionImmunities.forEach((condition, idx) => { if (result != '') { - if (idx == this.monster.conditionImmunities.length - 1) { + if (idx == this.monsterStats.conditionImmunities.length - 1) { result += ' et ' } else { result += ', ' @@ -432,7 +455,7 @@ export default { .monster-ability-scores { margin: 12px 0; - + .ability-label, .ability-score { padding: 0 8px; } diff --git a/docs/.vuepress/theme/components/MonsterCard.vue b/docs/.vuepress/theme/components/MonsterCard.vue new file mode 100644 index 0000000..85adb8c --- /dev/null +++ b/docs/.vuepress/theme/components/MonsterCard.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/docs/.vuepress/theme/components/MyMagicItems.vue b/docs/.vuepress/theme/components/MyMagicItems.vue new file mode 100644 index 0000000..50f8444 --- /dev/null +++ b/docs/.vuepress/theme/components/MyMagicItems.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/docs/.vuepress/theme/components/MyMonsters.vue b/docs/.vuepress/theme/components/MyMonsters.vue new file mode 100644 index 0000000..766f823 --- /dev/null +++ b/docs/.vuepress/theme/components/MyMonsters.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/docs/.vuepress/theme/components/MySpells.vue b/docs/.vuepress/theme/components/MySpells.vue new file mode 100644 index 0000000..7c64856 --- /dev/null +++ b/docs/.vuepress/theme/components/MySpells.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/docs/.vuepress/theme/components/NavDrawer.vue b/docs/.vuepress/theme/components/NavDrawer.vue index 2cd73d2..7383a2a 100644 --- a/docs/.vuepress/theme/components/NavDrawer.vue +++ b/docs/.vuepress/theme/components/NavDrawer.vue @@ -16,6 +16,9 @@