2021-02-11 02:48:27 +01:00
|
|
|
import { Debordement } from "./debordement.js";
|
|
|
|
import { FermetureCites } from "./fermeture-cites.js";
|
|
|
|
import { QueteEaux } from "./quete-eaux.js";
|
|
|
|
import { TerreAttache } from "./terre-attache.js";
|
|
|
|
import { ReserveExtensible } from "./reserve-extensible.js";
|
|
|
|
import { DemiReve } from "./demi-reve.js";
|
|
|
|
import { TrouNoir } from "./trou-noir.js";
|
|
|
|
import { Rencontre } from "./rencontre.js";
|
2023-12-09 01:04:33 +01:00
|
|
|
import { SortReserve, SortReserveHumide } from "./sort-reserve.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
import { CarteTmr } from "./carte-tmr.js";
|
|
|
|
import { PontImpraticable } from "./pont-impraticable.js";
|
|
|
|
import { Draconique } from "./draconique.js";
|
|
|
|
import { PresentCites } from "./present-cites.js";
|
2021-02-12 01:44:27 +01:00
|
|
|
import { Desorientation } from "./desorientation.js";
|
|
|
|
import { Conquete } from "./conquete.js";
|
2021-02-12 18:31:49 +01:00
|
|
|
import { Pelerinage } from "./pelerinage.js";
|
2021-02-28 01:56:17 +01:00
|
|
|
import { Periple } from "./periple.js";
|
|
|
|
import { UrgenceDraconique } from "./urgence-draconique.js";
|
2022-06-12 08:17:59 +02:00
|
|
|
import { Grammar } from "../grammar.js";
|
2022-11-10 00:25:51 +01:00
|
|
|
import { AugmentationSeuil } from "./augmentation-seuil.js";
|
2024-09-25 22:56:24 +02:00
|
|
|
import { ITEM_TYPES } from "../item.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
|
|
|
|
export class EffetsDraconiques {
|
|
|
|
static carteTmr = new CarteTmr();
|
2023-11-15 22:14:00 +01:00
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
static demiReve = new DemiReve();
|
|
|
|
static rencontre = new Rencontre();
|
|
|
|
static sortReserve = new SortReserve();
|
2023-12-09 01:04:33 +01:00
|
|
|
static sortReserveHumide = new SortReserveHumide();
|
2021-02-11 02:48:27 +01:00
|
|
|
static debordement = new Debordement();
|
|
|
|
static presentCites = new PresentCites();
|
|
|
|
static fermetureCites = new FermetureCites();
|
|
|
|
static queteEaux = new QueteEaux();
|
|
|
|
static reserveExtensible = new ReserveExtensible();
|
|
|
|
static terreAttache = new TerreAttache();
|
|
|
|
static trouNoir = new TrouNoir();
|
|
|
|
static pontImpraticable = new PontImpraticable();
|
2021-02-12 01:44:27 +01:00
|
|
|
static desorientation = new Desorientation();
|
|
|
|
static conquete = new Conquete();
|
2021-02-12 18:31:49 +01:00
|
|
|
static pelerinage = new Pelerinage();
|
2021-02-28 01:56:17 +01:00
|
|
|
static periple = new Periple();
|
|
|
|
static urgenceDraconique = new UrgenceDraconique();
|
2023-11-15 22:14:00 +01:00
|
|
|
|
2022-11-10 00:25:51 +01:00
|
|
|
static augmentationSeuil = new AugmentationSeuil();
|
2021-02-11 02:48:27 +01:00
|
|
|
|
|
|
|
static init() {
|
2023-11-15 22:14:00 +01:00
|
|
|
Draconique.init();
|
2021-02-11 02:48:27 +01:00
|
|
|
Draconique.register(EffetsDraconiques.carteTmr);
|
2023-11-15 22:14:00 +01:00
|
|
|
// icône TMR
|
2021-02-11 02:48:27 +01:00
|
|
|
Draconique.register(EffetsDraconiques.demiReve);
|
|
|
|
Draconique.register(EffetsDraconiques.rencontre);
|
|
|
|
Draconique.register(EffetsDraconiques.sortReserve);
|
2023-12-09 01:04:33 +01:00
|
|
|
Draconique.register(EffetsDraconiques.sortReserveHumide);
|
2021-02-11 02:48:27 +01:00
|
|
|
Draconique.register(EffetsDraconiques.debordement);
|
|
|
|
Draconique.register(EffetsDraconiques.fermetureCites);
|
|
|
|
Draconique.register(EffetsDraconiques.queteEaux);
|
|
|
|
Draconique.register(EffetsDraconiques.reserveExtensible);
|
|
|
|
Draconique.register(EffetsDraconiques.terreAttache);
|
|
|
|
Draconique.register(EffetsDraconiques.trouNoir);
|
|
|
|
Draconique.register(EffetsDraconiques.pontImpraticable);
|
|
|
|
Draconique.register(EffetsDraconiques.presentCites);
|
2021-02-12 01:44:27 +01:00
|
|
|
Draconique.register(EffetsDraconiques.desorientation);
|
|
|
|
Draconique.register(EffetsDraconiques.conquete);
|
2021-02-12 18:31:49 +01:00
|
|
|
Draconique.register(EffetsDraconiques.pelerinage);
|
2021-02-28 01:56:17 +01:00
|
|
|
Draconique.register(EffetsDraconiques.periple);
|
|
|
|
Draconique.register(EffetsDraconiques.urgenceDraconique);
|
2023-11-15 22:14:00 +01:00
|
|
|
// effets sans icône TMR
|
2022-11-10 00:25:51 +01:00
|
|
|
Draconique.register(EffetsDraconiques.augmentationSeuil)
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
static isCaseInondee(caseTMR, coord) {
|
2021-02-12 01:16:02 +01:00
|
|
|
return EffetsDraconiques.debordement.isCase(caseTMR, coord) ||
|
|
|
|
EffetsDraconiques.pontImpraticable.isCase(caseTMR, coord);
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2021-02-12 01:44:27 +01:00
|
|
|
|
|
|
|
static isInnaccessible(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.trouNoir.isCase(caseTMR, coord) ||
|
|
|
|
EffetsDraconiques.desorientation.isCase(caseTMR, coord);
|
|
|
|
}
|
2021-02-12 18:31:49 +01:00
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
static isCaseTrouNoir(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.trouNoir.isCase(caseTMR, coord);
|
|
|
|
}
|
2021-02-12 01:44:27 +01:00
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
static isCasePelerinage(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.pelerinage.isCase(caseTMR, coord);
|
|
|
|
}
|
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
static isReserveExtensible(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.reserveExtensible.isCase(caseTMR, coord);
|
|
|
|
}
|
2021-02-12 01:44:27 +01:00
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
static isTerreAttache(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.terreAttache.isCase(caseTMR, coord);
|
|
|
|
}
|
2021-02-12 01:44:27 +01:00
|
|
|
|
2021-02-11 02:48:27 +01:00
|
|
|
static isCiteFermee(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.fermetureCites.isCase(caseTMR, coord);
|
|
|
|
}
|
|
|
|
|
|
|
|
static isPresentCite(caseTMR, coord) {
|
|
|
|
return EffetsDraconiques.presentCites.isCase(caseTMR, coord);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* -------------------------------------------- */
|
2022-04-23 01:02:03 +02:00
|
|
|
static isSortImpossible(actor) {
|
2022-06-12 12:14:55 +02:00
|
|
|
return actor.items.find(it =>
|
2021-02-28 01:56:17 +01:00
|
|
|
EffetsDraconiques.conquete.match(it) ||
|
|
|
|
EffetsDraconiques.periple.match(it) ||
|
|
|
|
EffetsDraconiques.urgenceDraconique.match(it) ||
|
|
|
|
EffetsDraconiques.pelerinage.match(it)
|
|
|
|
);
|
|
|
|
}
|
2021-03-22 20:10:37 +01:00
|
|
|
|
2022-04-23 01:02:03 +02:00
|
|
|
static isSortReserveImpossible(actor) {
|
2022-06-12 12:14:55 +02:00
|
|
|
return actor.items.find(it =>
|
2021-02-28 01:56:17 +01:00
|
|
|
EffetsDraconiques.conquete.match(it) ||
|
|
|
|
EffetsDraconiques.periple.match(it) ||
|
|
|
|
EffetsDraconiques.pelerinage.match(it)
|
|
|
|
);
|
2021-02-12 18:31:49 +01:00
|
|
|
}
|
|
|
|
|
2023-05-12 22:56:45 +02:00
|
|
|
static tetesDragon(actor, name) {
|
2024-09-25 22:56:24 +02:00
|
|
|
return actor.itemTypes[ITEM_TYPES.tete].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
2023-05-12 22:56:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static soufflesDragon(actor, name) {
|
2024-09-25 22:56:24 +02:00
|
|
|
return actor.itemTypes[ITEM_TYPES.souffle].filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
2023-05-12 22:56:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static queuesDragon(actor, name) {
|
|
|
|
return actor.filterItems(it => it.isQueueDragon() && Grammar.includesLowerCaseNoAccent(it.name, name));
|
|
|
|
}
|
|
|
|
|
|
|
|
static queuesSoufflesDragon(actor, name) {
|
2024-09-25 22:56:24 +02:00
|
|
|
return actor.filterItems(it => [ITEM_TYPES.queue, ITEM_TYPES.ombre, ITEM_TYPES.souffle].includes(it.type) && Grammar.includesLowerCaseNoAccent(it.name, name));
|
2022-06-12 08:17:59 +02:00
|
|
|
}
|
|
|
|
|
2022-11-10 00:25:51 +01:00
|
|
|
static countAugmentationSeuil(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.tetesDragon(actor, 'Augmentation du seuil de rêve').length;
|
2022-11-10 00:25:51 +01:00
|
|
|
}
|
|
|
|
|
2022-04-23 01:02:03 +02:00
|
|
|
static isDonDoubleReve(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.tetesDragon(actor, 'Don de double-rêve').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
|
|
|
|
2022-04-23 01:02:03 +02:00
|
|
|
static isConnaissanceFleuve(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.tetesDragon(actor, 'connaissance du fleuve').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static isReserveEnSecurite(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.tetesDragon(actor, 'réserve en sécurité').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static isDeplacementAccelere(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.tetesDragon(actor, 'déplacement accéléré').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static isDoubleResistanceFleuve(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.soufflesDragon(actor, 'résistance du fleuve').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static countInertieDraconique(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.queuesDragon(actor, 'inertie draconique').length;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static countMonteeLaborieuse(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.queuesSoufflesDragon(actor, 'montée laborieuse').length;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static mauvaiseRencontre(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
const mauvaisesRencontres = EffetsDraconiques.queuesSoufflesDragon(actor, 'mauvaise rencontre');
|
|
|
|
return mauvaisesRencontres.length > 0 ? mauvaisesRencontres[0] : undefined;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static isPontImpraticable(actor) {
|
2022-06-12 12:14:55 +02:00
|
|
|
return actor.items.find(it => EffetsDraconiques.pontImpraticable.match(it));
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2022-04-23 01:02:03 +02:00
|
|
|
|
|
|
|
static isUrgenceDraconique(actor) {
|
2022-06-12 12:14:55 +02:00
|
|
|
return actor.items.find(it => EffetsDraconiques.urgenceDraconique.match(it));
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
|
|
|
|
2023-02-07 18:06:45 +01:00
|
|
|
static isSujetInsomnie(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.queuesDragon(actor, 'Insomnie').length > 0 ? true : false;
|
2023-02-07 18:06:45 +01:00
|
|
|
}
|
|
|
|
|
2022-04-23 01:02:03 +02:00
|
|
|
static isPeage(actor) {
|
2023-05-12 22:56:45 +02:00
|
|
|
return EffetsDraconiques.soufflesDragon(actor, 'péage').length > 0;
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|