Merge v1.5 -> v10

This commit is contained in:
2022-06-26 16:55:59 +02:00
13 changed files with 326 additions and 136 deletions

View File

@ -1463,10 +1463,8 @@ export class RdDActor extends Actor {
isTMRCache() {
return this.system.reve.tmrpos.cache;
}
/* -------------------------------------------- */
async cacheTMRetMessage() {
await this.reinsertionAleatoire("Action MJ");
await this.cacheTMR();
notifyRefreshTMR() {
game.socket.emit(SYSTEM_SOCKET_ID, {
msg: "msg_tmr_move", data: {
actorId: this._id,
@ -1478,27 +1476,27 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async afficheTMRetMessage() {
await this.montreTMR();
game.socket.emit(SYSTEM_SOCKET_ID, {
msg: "msg_tmr_move", data: {
actorId: this._id,
tmrPos: this.system.reve.tmrpos
}
});
this.notifyRefreshTMR();
}
/* -------------------------------------------- */
async reinsertionAleatoire(raison) {
async reinsertionAleatoire(raison, accessible = tmr => true) {
const innaccessible = this.buildTMRInnaccessible();
let tmr = await TMRUtility.getTMRAleatoire(tmr => accessible(tmr) && !innaccessible.includes(tmr.coord));
ChatMessage.create({
content: `${raison} : ré-insertion aléatoire.`,
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name)
});
const innaccessible = this.buildTMRInnaccessible();
let tmr = await TMRUtility.getTMRAleatoire(tmr => !innaccessible.includes(tmr.coord));
this.updateCoordTMR(tmr.coord);
this.cacheTMR();
await this.forcerPositionTMRInconnue(tmr);
return tmr;
}
async forcerPositionTMRInconnue(tmr) {
await this.cacheTMR();
await this.updateCoordTMR(tmr.coord);
this.notifyRefreshTMR();
}
/* -------------------------------------------- */
buildTMRInnaccessible() {
const tmrInnaccessibles = this.filterItemsData(it => Draconique.isCaseTMR(it) &&
@ -2549,7 +2547,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
conjurerPossession(possession) {
let draconic = this.getBestDraconic()
let draconic = this.getBestDraconic();
RdDPossession.managePossession(this, draconic, possession)
}
@ -3127,9 +3125,9 @@ export class RdDActor extends Actor {
}
/* -------------------------------------------- */
refreshTMRView(tmrData) {
refreshTMRView() {
if (this.currentTMR) {
this.currentTMR.externalRefresh(tmrData)
this.currentTMR.externalRefresh();
}
}