2021-01-07 20:04:10 +01:00
|
|
|
import { Misc } from "./misc.js";
|
|
|
|
|
|
|
|
export class RdDAlchimie {
|
2025-01-12 02:38:31 +01:00
|
|
|
static getDifficulte(termes) {
|
|
|
|
let elements = termes.split('-');
|
2021-03-31 22:51:32 +02:00
|
|
|
let composantes = elements.length;
|
|
|
|
let distincts = Object.keys(Misc.classifyFirst(elements, it => it)).length;
|
|
|
|
if (distincts == 1) {
|
|
|
|
composantes--;
|
2021-01-07 20:04:10 +01:00
|
|
|
}
|
2021-03-31 22:51:32 +02:00
|
|
|
return Math.min(0, -composantes);
|
2021-01-07 20:04:10 +01:00
|
|
|
}
|
2021-04-20 23:16:18 +02:00
|
|
|
|
|
|
|
static getCaracTache(tache) {
|
|
|
|
switch (tache) {
|
|
|
|
case "consistance": return 'dexterite';
|
|
|
|
case "couleur": return 'vue';
|
|
|
|
}
|
|
|
|
return 'intellect';
|
|
|
|
}
|
2021-01-07 20:04:10 +01:00
|
|
|
}
|