Gestion des désir lancinant/idée fixe
Ajout d'un flag pour les identifier.
This commit is contained in:
@ -179,6 +179,37 @@ class _10_2_5_ArmesTirLancer extends Migration {
|
||||
return Grammar.toLowerCaseNoAccent(it.system.competence);
|
||||
}
|
||||
}
|
||||
class _10_2_10_DesirLancinant_IdeeFixe extends Migration {
|
||||
get code() { return "desir-lancinat-idee-fixe"; }
|
||||
get version() { return "10.2.10"; }
|
||||
|
||||
migrateQueue(it) {
|
||||
let categorie = undefined
|
||||
let name = it.name
|
||||
if (Grammar.toLowerCaseNoAccent(name).includes('desir')) {
|
||||
categorie = 'lancinant';
|
||||
name = it.name.replace('Désir lancinant : ', '');
|
||||
|
||||
}
|
||||
if (Grammar.toLowerCaseNoAccent(name).includes('idee fixe')) {
|
||||
categorie = 'ideefixe';
|
||||
name = it.name.replace('Idée fixe : ', '')
|
||||
}
|
||||
return { _id: it.id, name: name,
|
||||
'system.ideefixe': undefined,
|
||||
'system.lancinant': undefined,
|
||||
'system.categorie': categorie
|
||||
}
|
||||
}
|
||||
|
||||
async migrate() {
|
||||
await this.applyItemsUpdates(items => items
|
||||
.filter(it => ['queue', 'ombre'].includes(it.type))
|
||||
.map(it => this.migrateQueue(it))
|
||||
//.filter(it => it.system.categorie )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class Migrations {
|
||||
static getMigrations() {
|
||||
@ -188,6 +219,7 @@ export class Migrations {
|
||||
new _10_0_21_VehiculeStructureResistanceMax(),
|
||||
new _10_0_33_MigrationNomsDraconic(),
|
||||
new _10_2_5_ArmesTirLancer(),
|
||||
new _10_2_10_DesirLancinant_IdeeFixe(),
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user