13.0.7 - Sous le signe d'Illysis #768

Merged
uberwald merged 6 commits from VincentVk/foundryvtt-reve-de-dragon:v13 into v13 2025-09-12 20:56:25 +02:00
7 changed files with 26 additions and 13 deletions
Showing only changes of commit 15e6127e02 - Show all commits

View File

@@ -7,6 +7,7 @@
- en cas d'appel au moral lorsqu'une double significative est requise,
le moral est perdu si la réussite est insuffisante
- transformation du niveau des musiques/danses/chants/recettes de cuisine en valeur numérique
- les effets draconiques sur une case inconnue (A0) ne causent plus de problèmes dans les TMRs
## 13.0.6 - Le bandage d'Illysis

View File

@@ -1,7 +1,7 @@
import { SHOW_DICE, SYSTEM_RDD } from "./constants.js";
import { RollDataAjustements } from "./rolldata-ajustements.js";
import { RdDUtility } from "./rdd-utility.js";
import { TMRUtility } from "./tmr-utility.js";
import { COORD_TMR_INCONNU, TMRUtility } from "./tmr-utility.js";
import { RdDResolutionTable } from "./rdd-resolution-table.js";
import { RdDTMRRencontreDialog } from "./rdd-tmr-rencontre-dialog.js";
import { ChatUtility } from "./chat-utility.js";
@@ -996,6 +996,10 @@ export class RdDTMRDialog extends Dialog {
const targetOddq = this.pixiTMR.computeEventOddq(event)
const targetCoord = TMRUtility.oddqToCoordTMR(targetOddq)
if (targetCoord == COORD_TMR_INCONNU){
ui.notifications.error("Vous ne pouvez pas vous déplacer ici");
return
}
// Validation de la case de destination (gestion du cas des rencontres qui peuvent téléporter)
const typeDeplacement = this._calculDeplacement(targetCoord, currentCoord, currentOddq, targetOddq);

View File

@@ -2,6 +2,9 @@ import { Misc } from "./misc.js";
import { Grammar } from "./grammar.js";
import { RdDDice } from "./rdd-dice.js";
const TMR_INCONNU = "inconnu"
export const COORD_TMR_INCONNU = "A0"
export const TMRType = {
cite: { type: 'cite', name: "cité", genre: "f" },
sanctuaire: { type: 'sanctuaire', name: "sanctuaire", genre: 'm' },
@@ -16,13 +19,15 @@ export const TMRType = {
marais: { type: 'marais', name: "marais", genre: "m" },
gouffre: { type: 'gouffre', name: "gouffre", genre: "m" },
necropole: { type: 'necropole', name: "nécropole", genre: "f" },
desolation: { type: 'desolation', name: "désolation", genre: "f" }
desolation: { type: 'desolation', name: "désolation", genre: "f" },
[TMR_INCONNU]: { type: TMR_INCONNU, name: TMR_INCONNU, genre: "m" }
}
export const FLEUVE_COORD = 'Fleuve'
const TMRMapping = {
Fleuve: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli", generique: 'fleuve' },
[COORD_TMR_INCONNU]: { type: TMR_INCONNU, label: TMR_INCONNU },
A1: { type: TMRType.cite.type, label: "Cité Vide" },
B1: { type: TMRType.plaines.type, label: "Plaines dAssorh" },
C1: { type: TMRType.necropole.type, label: "Nécropole de Kroak" },
@@ -272,7 +277,7 @@ export class TMRUtility {
}
static getTMRType(coord) {
const tmr = TMRUtility.getTMR(coord);
const tmr = TMRUtility.getTMR(coord)
return Misc.upperFirst(TMRType[tmr.type].name);
}

View File

@@ -13,7 +13,7 @@ export class Conquete extends Draconique {
async onActorCreateOwned(actor, item) { await this._creerConquete(actor, item); }
code() { return 'conquete' }
tooltip(linkData) { return `Doit être conquis` }
tooltip(linkData) { return 'Doit être conquis' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/conquete.svg' }
createSprite(pixiTMR) {

View File

@@ -1,5 +1,5 @@
import { ITEM_TYPES } from "../constants.js";
import { TMRUtility } from "../tmr-utility.js";
import { COORD_TMR_INCONNU, TMRUtility } from "../tmr-utility.js";
import { PixiTMR } from "./pixi-tmr.js";
const registeredEffects = [
@@ -12,7 +12,7 @@ export class Draconique {
static init() {
}
static isCaseTMR(item) { return item.type == ITEM_TYPES.casetmr; }
static isCaseTMR(item) { return item.type == ITEM_TYPES.casetmr }
static isQueueDragon(item) { return item.isQueueDragon(); }
static isSouffleDragon(item) { return item.type == ITEM_TYPES.souffle; }
static isTeteDragon(item) { return item.type == ITEM_TYPES.tete; }
@@ -92,7 +92,7 @@ export class Draconique {
const tooltip = this.tooltip(linkData);
return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip);
}
tokens(pixiTMR, linkData, coordTMR, type = undefined) {
const tooltip = this.tooltip(linkData);
return [this._createToken(pixiTMR, linkData, coordTMR, type, tooltip)];
@@ -127,7 +127,7 @@ export class Draconique {
* @param {*} coord les coordonnées d'une case. Si undefined toute case du type correspondra,
*/
isCase(item, coord = undefined) {
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && (coord ? item.system.coord == coord : true);
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && (coord ? (coord != COORD_TMR_INCONNU && item.system.coord == coord) : true);
}
find(list, coord = undefined) {
@@ -150,7 +150,7 @@ export class Draconique {
}
isCaseForSource(item, draconique) {
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && item.system.sourceid == draconique.id;
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && item.system.sourceid == draconique.id
}
async onVisiteSupprimer(actor, tmr, onRemoveToken) {

View File

@@ -1,6 +1,6 @@
import { Grammar } from "../grammar.js";
import { tmrTokenZIndex } from "../tmr-constants.js";
import { TMRUtility } from "../tmr-utility.js";
import { COORD_TMR_INCONNU, TMRUtility } from "../tmr-utility.js";
import { Draconique } from "./draconique.js";
export class QueteEaux extends Draconique {
@@ -9,11 +9,13 @@ export class QueteEaux extends Draconique {
match(item) { return Draconique.isTeteDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes("quete des eaux"); }
manualMessage() { return "Vous devrez re-configurer votre Nouvelle Quête des Eaux une fois un lac ou marais vaincu" }
async onActorCreateOwned(actor, tete) {
await this.createCaseTmr(actor, "Nouvelle Quête des Eaux", { coord: 'A0' }, tete.id);
await this.createCaseTmr(actor, "Nouvelle Quête des Eaux", { coord: COORD_TMR_INCONNU }, tete.id);
}
code() { return 'maitrisee' }
tooltip(linkData) { return `Quête des eaux, ${TMRUtility.getTMRType(linkData.system.coord)} maîtrisé` }
tooltip(linkData) {
return linkData.system.coord == COORD_TMR_INCONNU ? 'Nouvelle Quête des eaux en cours' : `Quête des eaux, ${TMRUtility.getTMRType(linkData.system.coord)} maîtrisé`
}
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/maitrisee.svg' }
createSprite(pixiTMR) {

View File

@@ -1,5 +1,6 @@
import { Grammar } from "../grammar.js";
import { tmrTokenZIndex } from "../tmr-constants.js";
import { COORD_TMR_INCONNU } from "../tmr-utility.js";
import { Draconique } from "./draconique.js";
export class TerreAttache extends Draconique {
@@ -9,7 +10,7 @@ export class TerreAttache extends Draconique {
manualMessage() { return "Vous pouvez re-configurer votre Nouvelle Terre d'attache" }
async onActorCreateOwned(actor, tete) {
await this.createCaseTmr(actor, "Nouvelle Terre d'attache", { coord: 'A0' }, tete.id);
await this.createCaseTmr(actor, "Nouvelle Terre d'attache", { coord: COORD_TMR_INCONNU }, tete.id);
}
code() { return 'attache' }