forked from public/foundryvtt-reve-de-dragon
Merge
This commit is contained in:
@ -243,14 +243,14 @@ const rencontresTable = [
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const tmrMovePattern =
|
||||
[ { name: 'top', x: 'zero', y: 'dec' },
|
||||
{ name: 'topright', x: 'inc', y: 'dec' },
|
||||
{ name: 'left', x: 'inc', y: 'alt' },
|
||||
{ name: 'botright', x: 'inc', y: 'inc' },
|
||||
{ name: 'bot', x: 'zero', y: 'inc' },
|
||||
{ name: 'botleft', x: 'dec', y: 'inc' },
|
||||
{ name: 'left', x: 'dec', y: 'alt' },
|
||||
{ name: 'topleft', x: 'dec', y: 'dec' }
|
||||
[ { name: 'top', x: 0, y: -1 },
|
||||
{ name: 'topright', x: 1, y: -1 },
|
||||
{ name: 'left', x: 1, y: 'alt' },
|
||||
{ name: 'botright', x: 1, y: 1 },
|
||||
{ name: 'bot', x: 0, y: 1 },
|
||||
{ name: 'botleft', x: -1, y: 1 },
|
||||
{ name: 'left', x: -1, y: 'alt' },
|
||||
{ name: 'topleft', x: -1, y: -1 }
|
||||
]
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -298,6 +298,26 @@ export class TMRUtility {
|
||||
return tmrMovePattern[index];
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static deplaceTMRSelonPattern( pos, pattern, nTime ) {
|
||||
for (let i=0; i <nTime; i++) {
|
||||
let currentPosXY = TMRUtility.convertToCellCoord(pos);
|
||||
currentPosXY.x = currentPosXY.x + pattern.x;
|
||||
if (pattern.y == 'alt' ) { // Alternate version
|
||||
pattern.y += (pattern.x % 2 == 0 ) ? -1 : 1;
|
||||
} else {
|
||||
currentPosXY.y = currentPosXY.y + pattern.y;
|
||||
}
|
||||
if ( this._checkTMRCoord(currentPosXY.x, currentPosXY.y) ) { // Sortie de carte ! Ré-insertion aléatoire
|
||||
pos = TMRUtility.convertToTMRCoord(currentPosXY.x, currentPosXY.y);
|
||||
} else {
|
||||
pos = this.getTMRAleatoire();
|
||||
}
|
||||
console.log("Nouvelle case iteration !!!", i, pos);
|
||||
}
|
||||
return pos;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async rencontreTMRRoll( coordTMR, cellDescr )
|
||||
{
|
||||
@ -365,12 +385,6 @@ export class TMRUtility {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getRandomLocationType( coordTMR ) {
|
||||
let descr = this.getTMRDescription( coordTMR );
|
||||
// TODO random get same type
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getLocationTypeList( coordTMR ) {
|
||||
let descr = this.getTMRDescription( coordTMR );
|
||||
|
Reference in New Issue
Block a user