61 lines
3.5 KiB
JavaScript
61 lines
3.5 KiB
JavaScript
|
import { RdDRollTables } from "./rdd-rolltables.js";
|
||
|
|
||
|
const tableEffets = [
|
||
|
{ code: "messager", resultat: "succes", description: "Envoie un message à (force) cases" },
|
||
|
{ code: "passeur", resultat: "succes", description: "Déplacer le demi-rêve à (force) cases" },
|
||
|
{ code: "reve+f", resultat: "succes", description: "Gain de (force) points de rêve" },
|
||
|
{ code: "teleport", resultat: "succes", description: "Déplacer le demi-rêve (même type de case)" },
|
||
|
{ code: "part+tete", resultat: "succes", description: "Tête de dragon sur réussite particulière" },
|
||
|
{ code: "part+xp", resultat: "succes", description: "Expérience sur réussite particulière" },
|
||
|
|
||
|
{ code: "reve-1", resultat: "echec", description: "Perte de 1 point de rêve" },
|
||
|
{ code: "reve-f", resultat: "echec", description: "Perte de (force) points de rêve" },
|
||
|
{ code: "vie-1", resultat: "echec", description: "Perte de 1 point de vie" },
|
||
|
{ code: "reinsere", resultat: "echec", description: "Réinsertion aléatoire" },
|
||
|
{ code: "declenhe", resultat: "echec", description: "Déclenche un sort aléatoire" },
|
||
|
{ code: "persistant", resultat: "echec", description: "Bloque le demi-rêve" },
|
||
|
{ code: "teleport-aleatoire", resultat: "echec", description: "Déplacement aléatoire (même type de case)" },
|
||
|
{ code: "aleatoire", resultat: "echec", description: "Déplacement aléatoire" },
|
||
|
{ code: "sort-aleatoire", resultat: "echec", description: "Déplacement pour déclencher un sort en réserve aléatoire" },
|
||
|
{ code: "rompu", resultat: "echec", description: "Demi-rêve interrompu" },
|
||
|
{ code: "echec-queue", resultat: "echec", description: "Queue de dragon sur échec" },
|
||
|
{ code: "etotal-queue", resultat: "echec", description: "Queue de dragon sur échec total" },
|
||
|
|
||
|
{ code: "moral+1", resultat: "succes", description: "Gain de 1 point de moral" },
|
||
|
{ code: "reve+1", resultat: "succes", description: "Gain de 1 point de rêve" },
|
||
|
{ code: "vie-f", resultat: "echec", description: "Perte de (force) point de vie" },
|
||
|
{ code: "endurance-1", resultat: "echec", description: "Perte de 1 point d'endurance" },
|
||
|
{ code: "endurance-f", resultat: "echec", description: "Perte de (force) point d'endurance" },
|
||
|
{ code: "fatigue-1", resultat: "echec", description: "Perte de 1 point de fatigue" },
|
||
|
{ code: "fatigue-f", resultat: "echec", description: "Perte de (force) point de fatigue" },
|
||
|
{ code: "moral-1", resultat: "echec", description: "Perte de 1 point de moral" },
|
||
|
{ code: "chance-1", resultat: "echec", description: "Perte de 1 point de chance actuelle" },
|
||
|
{ code: "chance-f", resultat: "echec", description: "Perte de (force) point de chance" },
|
||
|
{ code: "epart-queue", resultat: "echec", description: "Queue de dragon sur échec particulier" },
|
||
|
{ code: "etotal-souffle", resultat: "echec", description: "Souffle de dragon sur échec total" },
|
||
|
{ code: "epart-souffle", resultat: "echec", description: "Souffle de dragon sur échec particulier" },
|
||
|
];
|
||
|
|
||
|
export class RdDRencontre {
|
||
|
static getEffets(resultat) {
|
||
|
return tableEffets.filter(e => resultat == e.resultat);
|
||
|
}
|
||
|
static getEffetsSucces() { return RdDRencontre.getEffets("succes"); }
|
||
|
static getEffetsEchec() { return RdDRencontre.getEffets("echec"); }
|
||
|
|
||
|
static mapEffets(liste) {
|
||
|
return liste.map(it => tableEffets.find(e => it == e.code));
|
||
|
}
|
||
|
|
||
|
static getListeEffets(item, reussite) {
|
||
|
if (reussite == 'echec') {
|
||
|
return [...item.system.echec.effets];
|
||
|
}
|
||
|
if (reussite == 'succes') {
|
||
|
return [...item.system.succes.effets];
|
||
|
}
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
}
|