From 7a11c5382c66301e17d6d5af9b5cf3066f640e13 Mon Sep 17 00:00:00 2001 From: Peaceultime Date: Wed, 23 Apr 2025 22:44:34 +0200 Subject: [PATCH] Character creation UI fixes, updates and resistances are displayed. --- db.sqlite | Bin 614400 -> 614400 bytes db.sqlite-shm | Bin 32768 -> 32768 bytes db.sqlite-wal | Bin 0 -> 12392 bytes pages/character/[id]/edit.client.vue | 20 +-- pages/character/[id]/index.client.vue | 10 +- server/api/character/[id]/compiled.get.ts | 10 +- server/tasks/mail.ts | 2 +- shared/character-config.json | 164 ++++++++++++---------- types/character.d.ts | 29 ++-- 9 files changed, 135 insertions(+), 100 deletions(-) diff --git a/db.sqlite b/db.sqlite index 182d051aba979de77193a56faccbe3d65af814b2..502978611997e8e6d32510fa5245cde919a3b742 100644 GIT binary patch delta 444 zcmZoTpxSUib%SUC^8~(qn-vu*_$E(?)7Rx>3FTx-wzM!dOiVM^HMB@d)ip`9Ow&zF zO*YmwFfcMpOH4L1H%>{*;PijI`AwW0BOCv9{${@0n*|as@Tn4`lXEj`{&xWupni>} zhHVXuECL)%{KpyipYR{wELgCc-%^^1*_1`s!obqfz|z#*+}zB})Xc=#!oo6x{pU$3 zMrLCcLt}FbGYb=Ab0Z5&BSUjjb0c%0-1=<`7&#xXpJr?4H|KEQtSC^NY#c{6ghWwNn@M9o2>YZ%##Vs)aG%%YTmV(-(F#X>I@4&7{V-y`hWAn-RorVw~>K!Nf8BbQjav>AZbRLem$tGwDyS>0@%^ z)rnTJRMIhu1=5BF)A#i;m9YSsX6*+3OhC*G#4Otl`dP0O0NwwRf&V4{MWFkS^6QH; e8#7{YK9d-;F(($Mw+XPd39z>ba4Zwx3;+NDBy^jciS?YEnm{%i5OZv7Ob%pZ+SvG;m63U4<6b33#*K}EtN>pmG==~G delta 80 zcmZo@U}|V!;+1%$%K!t66DLZGTChv7nNGgVi7p`mlYpuI4+Il)WHv4c3Ea3qMGpX& C856|- diff --git a/db.sqlite-wal b/db.sqlite-wal index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8c48a87f5e3d23eed04ca13bfe33541d3d35bac3 100644 GIT binary patch literal 12392 zcmeI0&5ImG6u^5oyR$pU?uZvf5QY*>3|*l=s=uNl1~CDJM2LqtSx9wt^>mTm?xnkD zNeGL&BCCj!lagb=e?btD+`V}4;yE6?7|@d!FTSdt*`1wrKfDCQYM8F+>i1s1_j|AE zH66U)**5Sm<v&hCF`!-nB)s30MW2oGJBY?27meUGI)7)&L^#t0NKd2*31EN#-lqP$$0d}qmN8m$_3-=P>yTx(59lI06*n3 zSVk*RuTyE+R(2hAcGa1vGXjhD+M0=2S=5baMvW+o;}zi1;DT~>$^}Qd6ip0{DpA&= zxqX~9r8Q;Ek?sJUhF6Dbqa(l^^a|{WqTzWihP;scr+L85jrumrW~R--K}>Db%D=j) zcrk3U{k9G&%?78krn1$dQqJ1eIGy$+|MsK+YzS28*iZuS_5mnr0VpVJ5F!5G@-h7?9LL@))yCbZJo5X zq7&8D^Zl!^My?l^Z<>8}8vgdr4$Cq*d+yklaD36t=22}a`?i?JT#RjNIB7Yesou61 z3TW?Z0Y?{e+r|F5DJdM2rZn3IjyCJ54(G$ZYYu|8+wJE%-8zmlrFQYDzCGIsR2Sac znFj67cE~mXp+e(U{ounlmzRtey4$sJmBM!2zs7Eka(-v>`eFae4ep3qIk-2?_J-M&(ku#Ho2CJ_! K!m9jKa^`O{>`L7L literal 0 HcmV?d00001 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({