Fix TMR accessibles par une rencontre

Les cases n'étaient polus accessibles, ni coloriées
This commit is contained in:
Vincent Vandemeulebrouck 2022-09-17 23:44:51 +02:00
parent 7a92ee85ef
commit c4392f0320

View File

@ -322,8 +322,8 @@ export class RdDTMRDialog extends Dialog {
this.currentRencontre.graphics = []; // Keep track of rectangles to delete it this.currentRencontre.graphics = []; // Keep track of rectangles to delete it
this.currentRencontre.locList = duplicate(listCoordTMR); // And track of allowed location this.currentRencontre.locList = duplicate(listCoordTMR); // And track of allowed location
for (let coordTMR of listCoordTMR) { for (let coordTMR of listCoordTMR) {
let rect = this._getCaseRectangleCoord(coordTMR); const rect = this._getCaseRectangleCoord(coordTMR);
var rectDraw = new PIXI.Graphics(); const rectDraw = new PIXI.Graphics();
rectDraw.beginFill(0xffff00, 0.3); rectDraw.beginFill(0xffff00, 0.3);
// set the line style to have a width of 5 and set the color to red // set the line style to have a width of 5 and set the color to red
rectDraw.lineStyle(5, 0xff0000); rectDraw.lineStyle(5, 0xff0000);
@ -342,18 +342,13 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */ /* -------------------------------------------- */
async choisirCasePortee(coord, portee) { async choisirCasePortee(coord, portee) {
if (this.actor.isTMRCache()) {
return;
}
// Récupère la liste des cases à portées // Récupère la liste des cases à portées
let locList = TMRUtility.getTMRPortee(coord, portee); this.colorierZoneRencontre(TMRUtility.getTMRPortee(coord, portee));
this.colorierZoneRencontre(locList);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async choisirCaseType(type) { async choisirCaseType(type) {
const locList = TMRUtility.filterTMR(it => it.type == type).map(it => it.coord); this.colorierZoneRencontre(TMRUtility.filterTMR(it => it.type == type).map(it => it.coord));
this.colorierZoneRencontre(locList);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -932,7 +927,7 @@ export class RdDTMRDialog extends Dialog {
const isInArea = this.rencontreState == 'aucune' const isInArea = this.rencontreState == 'aucune'
? (this.isTerreAttache(targetCoord) || this.isConnaissanceFleuve(currentCoord, targetCoord) || TMRUtility.distanceOddq(fromOddq, toOddq) <= 1) ? (this.isTerreAttache(targetCoord) || this.isConnaissanceFleuve(currentCoord, targetCoord) || TMRUtility.distanceOddq(fromOddq, toOddq) <= 1)
: this.currentRencontre?.locList.find(coord => coord == targetCoord) ?? false : this.currentRencontre?.locList?.find(coord => coord == targetCoord) ?? false
if (isInArea) { if (isInArea) {
switch (this.rencontreState) { switch (this.rencontreState) {
case 'aucune': return 'normal'; case 'aucune': return 'normal';