Fix: urgence draconique

This commit is contained in:
Vincent Vandemeulebrouck 2023-11-12 00:22:29 +01:00
parent 5821fc611f
commit 9093eadb23

View File

@ -8,15 +8,11 @@ import { Draconique } from "./draconique.js";
export class UrgenceDraconique extends Draconique { export class UrgenceDraconique extends Draconique {
constructor() {
super();
}
type() { return 'queue' } type() { return 'queue' }
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('urgence draconique'); } match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('urgence draconique'); }
manualMessage() { return false } manualMessage() { return false }
async onActorCreateOwned(actor, queue) { async onActorCreateOwned(actor, queue) {
const coordSortsReserve = (actor.system.reve.reserve?.list.map(it => it.coord)) ?? []; const coordSortsReserve = actor.itemTypes[TYPES.sortreserve].map(it => it.system.coord) ?? [];
if (coordSortsReserve.length == 0) { if (coordSortsReserve.length == 0) {
// La queue se transforme en idée fixe // La queue se transforme en idée fixe
const ideeFixe = await RdDRollTables.getIdeeFixe(); const ideeFixe = await RdDRollTables.getIdeeFixe();
@ -26,7 +22,6 @@ export class UrgenceDraconique extends Draconique {
}); });
await actor.createEmbeddedDocuments('Item', [ideeFixe]); await actor.createEmbeddedDocuments('Item', [ideeFixe]);
await actor.deleteEmbeddedDocuments('Item', [queue.id]); await actor.deleteEmbeddedDocuments('Item', [queue.id]);
return;
} }
else { else {
const demiReve = actor.getDemiReve(); const demiReve = actor.getDemiReve();