diff --git a/db.sqlite b/db.sqlite index 182d051..5029786 100644 Binary files a/db.sqlite and b/db.sqlite differ diff --git a/db.sqlite-shm b/db.sqlite-shm index fe9ac28..f35daa8 100644 Binary files a/db.sqlite-shm and b/db.sqlite-shm differ diff --git a/db.sqlite-wal b/db.sqlite-wal index e69de29..8c48a87 100644 Binary files a/db.sqlite-wal and b/db.sqlite-wal differ diff --git a/pages/character/[id]/edit.client.vue b/pages/character/[id]/edit.client.vue index c386022..3ea156a 100644 --- a/pages/character/[id]/edit.client.vue +++ b/pages/character/[id]/edit.client.vue @@ -4,9 +4,9 @@ function raceOptionToText(option: RaceOption): string { const text = []; if(option.training) text.push(`+${option.training} point${option.training > 1 ? 's' : ''} de statistique${option.training > 1 ? 's' : ''}.`); - if(option.spec) text.push(`+${option.spec} spécialisation${option.spec > 1 ? 's' : ''}.`); if(option.shaping) text.push(`+${option.shaping} transformation${option.shaping > 1 ? 's' : ''} par jour.`); if(option.modifier) text.push(`+${option.modifier} au modifieur de votre choix.`); + if(option.abilities) text.push(`+${option.abilities} point${option.abilities > 1 ? 's' : ''} de compétence${option.abilities > 1 ? 's' : ''}.`); if(option.health) text.push(`+${option.health} PV max.`); if(option.mana) text.push(`+${option.mana} mana max.`); return text.join('\n'); @@ -31,9 +31,9 @@ function abilitySpecialFeatures(type: "points" | "max", curiosity: DoubleIndex e[0] == 7 && e[1] === 0)) + if(curiosity.find(e => e[0] == 6 && e[1] === 0)) return Math.max(6, value); - if(curiosity.find(e => e[0] == 7 && e[1] === 2)) + if(curiosity.find(e => e[0] == 6 && e[1] === 2)) return value + 1; } return value; @@ -80,13 +80,13 @@ const raceOptions = computed(() => data.value.progress.race.index !== undefined const selectedRaceOptions = computed(() => raceOptions !== undefined ? data.value.progress.race.progress!.map(e => raceOptions.value![e[0]][e[1]]) : undefined); const trainingPoints = computed(() => raceOptions.value ? data.value.progress.race.progress?.reduce((p, v) => p + (raceOptions.value![v[0]][v[1]].training ?? 0), 0) : 0); const training = computed(() => Object.entries(characterConfig.training).map(e => [e[0], getFeaturesOf(e[0] as MainStat, data.value.progress.training[e[0] as MainStat])]) as [MainStat, TrainingOption[]][]); -const maxTraining = computed(() => Object.entries(data.value.progress.training).reduce((p, v) => { p[v[0]] = v[1].reduce((_p, _v) => Math.max(_p, _v[0]) , 0); return p; }, {} as Record)); +const maxTraining = computed(() => Object.entries(data.value.progress.training).reduce((p, v) => { p[v[0] as MainStat] = v[1].reduce((_p, _v) => Math.max(_p, _v[0]) , 0); return p; }, {} as Record)); const trainingSpent = computed(() => Object.values(maxTraining.value).reduce((p, v) => p + v, 0)); -const modifiers = computed(() => Object.entries(maxTraining.value).reduce((p, v) => { p[v[0]] = Math.floor(v[1] / 3) + (data.value.progress.modifiers ? (data.value.progress.modifiers[v[0] as MainStat] ?? 0) : 0); return p; }, {} as Record)) +const modifiers = computed(() => Object.entries(maxTraining.value).reduce((p, v) => { p[v[0] as MainStat] = Math.floor(v[1] / 3) + (data.value.progress.modifiers ? (data.value.progress.modifiers[v[0] as MainStat] ?? 0) : 0); return p; }, {} as Record)) const modifierPoints = computed(() => (selectedRaceOptions.value ? selectedRaceOptions.value.reduce((p, v) => p + (v?.modifier ?? 0), 0) : 0) + training.value.reduce((p, v) => p + v[1].reduce((_p, _v) => _p + (_v?.modifier ?? 0), 0), 0)); const modifierSpent = computed(() => Object.values(data.value.progress.modifiers ?? {}).reduce((p, v) => p + v, 0)); const abilityPoints = computed(() => training.value.flatMap(e => e[1].filter(_e => _e.ability !== undefined)).reduce((p, v) => p + v.ability!, 0)); -const abilityMax = computed(() => Object.entries(characterConfig.ability).reduce((p, v) => { p[v[0]] = abilitySpecialFeatures("max", data.value.progress.training.curiosity, Math.floor(maxTraining.value[v[1].max[0]] / 3) + Math.floor(maxTraining.value[v[1].max[1]] / 3)); return p; }, {} as Record)); +const abilityMax = computed(() => Object.entries(characterConfig.abilities).reduce((p, v) => { p[v[0] as Ability] = abilitySpecialFeatures("max", data.value.progress.training.curiosity, Math.floor(maxTraining.value[v[1].max[0]] / 3) + Math.floor(maxTraining.value[v[1].max[1]] / 3)); return p; }, {} as Record)); const abilitySpent = computed(() => Object.values(data.value.progress.abilities ?? {}).reduce((p, v) => p + v[0], 0)); if(id !== 'new') @@ -277,14 +277,14 @@ useShortcuts({