From bf0eea693a4291fd86dfb6c426a81d545a5db4d8 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 4 Dec 2024 00:24:59 +0100 Subject: [PATCH] Migration draconic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Utilisation des noms de compétences draconiques standard --- module/migrations.js | 19 +++++++++++++++---- ...=> competence_Hypnos_bt2cR4aE6lIOeg4F.yml} | 2 +- ...=> competence_Narcos_u1Peok1EYkBcVsmN.yml} | 2 +- ...=> competence_Oniros_nnR2UHelUaF8dxYn.yml} | 2 +- ... competence_Thanatos_dPlTQzvU3CEg5qKc.yml} | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) rename packs_src/competences/{competence_Voie_d_Hypnos_bt2cR4aE6lIOeg4F.yml => competence_Hypnos_bt2cR4aE6lIOeg4F.yml} (96%) rename packs_src/competences/{competence_Voie_de_Narcos_u1Peok1EYkBcVsmN.yml => competence_Narcos_u1Peok1EYkBcVsmN.yml} (95%) rename packs_src/competences/{competence_Voie_d_Oniros_nnR2UHelUaF8dxYn.yml => competence_Oniros_nnR2UHelUaF8dxYn.yml} (96%) rename packs_src/competences/{competence_Voie_de_Thanatos_dPlTQzvU3CEg5qKc.yml => competence_Thanatos_dPlTQzvU3CEg5qKc.yml} (95%) diff --git a/module/migrations.js b/module/migrations.js index 26c84756..4e2e3ef4 100644 --- a/module/migrations.js +++ b/module/migrations.js @@ -137,7 +137,7 @@ class _10_0_21_VehiculeStructureResistanceMax extends Migration { } class _10_0_33_MigrationNomsDraconic extends Migration { - get code() { return "competences-creature-parade"; } + get code() { return "competences-nom-draconic"; } get version() { return "10.0.33"; } migrationNomDraconic(ancien) { @@ -530,15 +530,25 @@ class _11_2_20_MigrationAstrologie extends Migration { } } -class _12_0_24_MigrationVoieSorts extends Migration { +class _12_0_26_MigrationVoieSorts extends Migration { get code() { return "migration-voies-sorts" } - get version() { return "12.0.24" } + get version() { return "12.0.26" } async migrate() { await this.applyItemsUpdates(items => items - .filter(it => ITEM_TYPES.sort == it.type) + .filter(it => [ITEM_TYPES.sort, ITEM_TYPES.sortreserve].includes(it.type)) .map(it => this.migrateSort(it)) ) + await this.applyItemsUpdates(items => items + .filter(it => ITEM_TYPES.competence == it.type && it.system.categorie == 'draconic') + .map(it => this.migrateDraconic(it)) + ) + } + migrateDraconic(it) { + return { + _id: it.id, + name: this.convertDraconic(it.name), + } } migrateSort(it) { return { @@ -575,6 +585,7 @@ export class Migrations { new _10_7_19_CategorieCompetenceCreature(), new _10_7_19_PossessionsEntiteVictime(), new _11_2_20_MigrationAstrologie(), + new _12_0_26_MigrationVoieSorts() ]; } diff --git a/packs_src/competences/competence_Voie_d_Hypnos_bt2cR4aE6lIOeg4F.yml b/packs_src/competences/competence_Hypnos_bt2cR4aE6lIOeg4F.yml similarity index 96% rename from packs_src/competences/competence_Voie_d_Hypnos_bt2cR4aE6lIOeg4F.yml rename to packs_src/competences/competence_Hypnos_bt2cR4aE6lIOeg4F.yml index 61144e04..b6a76376 100644 --- a/packs_src/competences/competence_Voie_d_Hypnos_bt2cR4aE6lIOeg4F.yml +++ b/packs_src/competences/competence_Hypnos_bt2cR4aE6lIOeg4F.yml @@ -1,4 +1,4 @@ -name: Voie d'Hypnos +name: Hypnos type: competence img: systems/foundryvtt-reve-de-dragon/icons/competence_hypnos.webp _id: bt2cR4aE6lIOeg4F diff --git a/packs_src/competences/competence_Voie_de_Narcos_u1Peok1EYkBcVsmN.yml b/packs_src/competences/competence_Narcos_u1Peok1EYkBcVsmN.yml similarity index 95% rename from packs_src/competences/competence_Voie_de_Narcos_u1Peok1EYkBcVsmN.yml rename to packs_src/competences/competence_Narcos_u1Peok1EYkBcVsmN.yml index 2e50bd38..bf21b1b1 100644 --- a/packs_src/competences/competence_Voie_de_Narcos_u1Peok1EYkBcVsmN.yml +++ b/packs_src/competences/competence_Narcos_u1Peok1EYkBcVsmN.yml @@ -1,4 +1,4 @@ -name: Voie de Narcos +name: Narcos type: competence img: systems/foundryvtt-reve-de-dragon/icons/competence_narcos.webp _id: u1Peok1EYkBcVsmN diff --git a/packs_src/competences/competence_Voie_d_Oniros_nnR2UHelUaF8dxYn.yml b/packs_src/competences/competence_Oniros_nnR2UHelUaF8dxYn.yml similarity index 96% rename from packs_src/competences/competence_Voie_d_Oniros_nnR2UHelUaF8dxYn.yml rename to packs_src/competences/competence_Oniros_nnR2UHelUaF8dxYn.yml index 0570fa06..7c472840 100644 --- a/packs_src/competences/competence_Voie_d_Oniros_nnR2UHelUaF8dxYn.yml +++ b/packs_src/competences/competence_Oniros_nnR2UHelUaF8dxYn.yml @@ -1,4 +1,4 @@ -name: Voie d'Oniros +name: Oniros type: competence img: systems/foundryvtt-reve-de-dragon/icons/competence_oniros.webp _id: nnR2UHelUaF8dxYn diff --git a/packs_src/competences/competence_Voie_de_Thanatos_dPlTQzvU3CEg5qKc.yml b/packs_src/competences/competence_Thanatos_dPlTQzvU3CEg5qKc.yml similarity index 95% rename from packs_src/competences/competence_Voie_de_Thanatos_dPlTQzvU3CEg5qKc.yml rename to packs_src/competences/competence_Thanatos_dPlTQzvU3CEg5qKc.yml index 9073849b..f7897b36 100644 --- a/packs_src/competences/competence_Voie_de_Thanatos_dPlTQzvU3CEg5qKc.yml +++ b/packs_src/competences/competence_Thanatos_dPlTQzvU3CEg5qKc.yml @@ -1,4 +1,4 @@ -name: Voie de Thanatos +name: Thanatos type: competence img: systems/foundryvtt-reve-de-dragon/icons/competence_thanatos.webp _id: dPlTQzvU3CEg5qKc