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