Compare commits
No commits in common. "45a562f502ae2af5262f26bb3c8a79a5a4807337" and "e0049cc2f7deb3a15765b6c1e20d0d040e2c5ac4" have entirely different histories.
45a562f502
...
e0049cc2f7
@ -833,7 +833,7 @@ export class RdDCombat {
|
||||
// # utilisation esquive
|
||||
const corpsACorps = this.defender.getCompetence("Corps à corps", { onMessage: it => console.info(it, this.defender) });
|
||||
const esquives = duplicate(this.defender.getCompetences("esquive", { onMessage: it => console.info(it, this.defender) }))
|
||||
esquives.forEach(e => e.system.nbUsage = e?._id ? this.defender.getItemUse(e._id) : 0);
|
||||
esquives.forEach(e => e.usages = e?.id ? this.defender.getItemUse(e.id) : 0);
|
||||
|
||||
const paramChatDefense = {
|
||||
passeArme: attackerRoll.passeArme,
|
||||
|
@ -214,12 +214,24 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.actor.rollLireSigneDraconique(this._getActorCoord());
|
||||
});
|
||||
|
||||
html.find('#dir-top').click((event) => this.moveFromKey("top"));
|
||||
html.find('#dir-top-left').click((event) => this.moveFromKey("top-left"));
|
||||
html.find('#dir-top-right').click((event) => this.moveFromKey("top-right"));
|
||||
html.find('#dir-bottom-left').click((event) => this.moveFromKey("bottom-left"));
|
||||
html.find('#dir-bottom-right').click((event) => this.moveFromKey("bottom-right"));
|
||||
html.find('#dir-bottom').click((event) => this.moveFromKey("bottom"));
|
||||
html.find('#dir-top').click((event) => {
|
||||
this.moveFromKey("top");
|
||||
});
|
||||
html.find('#dir-top-left').click((event) => {
|
||||
this.moveFromKey("top-left");
|
||||
});
|
||||
html.find('#dir-top-right').click((event) => {
|
||||
this.moveFromKey("top-right");
|
||||
});
|
||||
html.find('#dir-bottom-left').click((event) => {
|
||||
this.moveFromKey("bottom-left");
|
||||
});
|
||||
html.find('#dir-bottom-right').click((event) => {
|
||||
this.moveFromKey("bottom-right");
|
||||
});
|
||||
html.find('#dir-bottom').click((event) => {
|
||||
this.moveFromKey("bottom");
|
||||
});
|
||||
|
||||
// Gestion du cout de montée en points de rêve
|
||||
let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse();
|
||||
@ -231,14 +243,13 @@ export class RdDTMRDialog extends Dialog {
|
||||
// Le reste...
|
||||
this.updateValuesDisplay();
|
||||
let tmr = TMRUtility.getTMR(this._getActorCoord());
|
||||
await this.manageRencontre(tmr);
|
||||
await this.manageRencontre(tmr, () => {
|
||||
this.postRencontre(tmr);
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateValuesDisplay() {
|
||||
if (!this.rendered) {
|
||||
return;
|
||||
}
|
||||
const coord = this._getActorCoord();
|
||||
|
||||
HtmlUtility._showControlWhen($(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord));
|
||||
@ -267,7 +278,6 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async close() {
|
||||
this.descenteTMR = true;
|
||||
if (this.actor.tmrApp) {
|
||||
this.actor.tmrApp = undefined; // Cleanup reference
|
||||
if (!this.viewOnly) {
|
||||
@ -473,13 +483,12 @@ export class RdDTMRDialog extends Dialog {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async manageRencontre(tmr) {
|
||||
async manageRencontre(tmr, postRencontre) {
|
||||
if (this.viewOnly) {
|
||||
return;
|
||||
}
|
||||
this.descenteTMR = false;
|
||||
this.currentRencontre = undefined;
|
||||
if (this._presentCite(tmr)) {
|
||||
if (this._presentCite(tmr, postRencontre)) {
|
||||
return;
|
||||
}
|
||||
let rencontre = await this._jetDeRencontre(tmr);
|
||||
@ -489,27 +498,27 @@ export class RdDTMRDialog extends Dialog {
|
||||
console.log("manageRencontre", rencontre);
|
||||
this.currentRencontre = duplicate(rencontre);
|
||||
|
||||
let dialog = new RdDTMRRencontreDialog(this, this.currentRencontre, () => this.postRencontre(tmr));
|
||||
let dialog = new RdDTMRRencontreDialog("", this, this.currentRencontre, postRencontre);
|
||||
dialog.render(true);
|
||||
}
|
||||
else {
|
||||
this.postRencontre(tmr);
|
||||
postRencontre();
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_presentCite(tmr) {
|
||||
_presentCite(tmr, postRencontre) {
|
||||
const presentCite = this.casesSpeciales.find(c => EffetsDraconiques.presentCites.isCase(c, tmr.coord));
|
||||
if (presentCite) {
|
||||
this.minimize();
|
||||
const caseData = presentCite;
|
||||
EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr)));
|
||||
EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr, postRencontre)));
|
||||
}
|
||||
return presentCite;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _utiliserPresentCite(presentCite, typeRencontre, tmr) {
|
||||
async _utiliserPresentCite(presentCite, typeRencontre, tmr, postRencontre) {
|
||||
this.currentRencontre = TMRRencontres.getRencontre(typeRencontre);
|
||||
await TMRRencontres.evaluerForceRencontre(this.currentRencontre);
|
||||
await EffetsDraconiques.presentCites.ouvrirLePresent(this.actor, presentCite);
|
||||
@ -528,7 +537,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
await this._tentativeMaitrise(rencontreData);
|
||||
|
||||
this.maximize();
|
||||
this.postRencontre(tmr);
|
||||
postRencontre();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -599,6 +608,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
async _resultatMaitriseCaseHumide(rollData) {
|
||||
await this.souffleSiEchecTotal(rollData);
|
||||
this.toclose = rollData.rolled.isEchec;
|
||||
if (rollData.rolled.isSuccess && rollData.double) {
|
||||
rollData.previous = { rolled: rollData.rolled, ajustements: rollData.ajustements };
|
||||
rollData.double = undefined;
|
||||
@ -611,7 +621,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.html`, rollData)
|
||||
});
|
||||
if (rollData.rolled.isEchec) {
|
||||
await this.close();
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
@ -721,6 +731,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (rollData.rolled.isETotal) {
|
||||
rollData.souffle = await this.actor.ajouterSouffle({ chat: false });
|
||||
}
|
||||
this.toclose = rollData.rolled.isEchec;
|
||||
|
||||
rollData.poesie = await Poetique.getExtrait();
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
@ -967,7 +979,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
this.actor.notifyRefreshTMR();
|
||||
|
||||
if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/...
|
||||
await this.manageRencontre(tmr);
|
||||
await this.manageRencontre(tmr, () => this.postRencontre(tmr));
|
||||
}
|
||||
else {
|
||||
await this.postRencontre(tmr);
|
||||
@ -987,13 +999,13 @@ export class RdDTMRDialog extends Dialog {
|
||||
async postRencontre(tmr) {
|
||||
if (!(this.viewOnly || this.currentRencontre)) {
|
||||
// TODO: vérifier que la méthode s'arrête en cas de non-maîtrise
|
||||
if (!this.descenteTMR) await this.manageCaseHumide(tmr);
|
||||
if (!this.descenteTMR) await this.conquerirCiteFermee(tmr);
|
||||
if (!this.descenteTMR) await this.purifierPeriple(tmr);
|
||||
if (!this.descenteTMR) await this.conquerirTMR(tmr);
|
||||
if (!this.descenteTMR) await this.validerVisite(tmr);
|
||||
if (!this.descenteTMR) await this.declencheSortEnReserve(tmr.coord);
|
||||
if (!this.descenteTMR) await this.actor.checkSoufflePeage(tmr);
|
||||
await this.manageCaseHumide(tmr);
|
||||
await this.conquerirCiteFermee(tmr);
|
||||
await this.purifierPeriple(tmr);
|
||||
await this.conquerirTMR(tmr);
|
||||
await this.validerVisite(tmr);
|
||||
await this.declencheSortEnReserve(tmr.coord);
|
||||
await this.actor.checkSoufflePeage(tmr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(tmrApp, rencontre, postRencontre) {
|
||||
constructor(html, tmrApp, rencontre, postRencontre) {
|
||||
const dialogConf = {
|
||||
title: "Rencontre en TMR!",
|
||||
content: "Vous rencontrez un " + rencontre.name + " de force " + rencontre.force + "<br>",
|
||||
|
@ -1146,16 +1146,9 @@ ul, li {
|
||||
|
||||
}
|
||||
|
||||
#sidebar #sidebar-tabs i:is(
|
||||
.fa-comments, .fa-fist-raised, .fa-swords,
|
||||
.fa-users, .fa-user, .fa-map, .fa-suitcase,
|
||||
.fa-book-open, .fa-th-list, .fa-music,
|
||||
.fa-atlas,.fa-cogs
|
||||
):before {content: "";}
|
||||
#sidebar #sidebar-tabs i.fa-comments:before, #sidebar #sidebar-tabs i.fa-fist-raised:before, #sidebar #sidebar-tabs i.fa-users:before, #sidebar #sidebar-tabs i.fa-map:before, #sidebar #sidebar-tabs i.fa-suitcase:before, #sidebar #sidebar-tabs i.fa-book-open:before, #sidebar #sidebar-tabs i.fa-th-list:before, #sidebar #sidebar-tabs i.fa-music:before, #sidebar #sidebar-tabs i.fa-atlas:before, #sidebar #sidebar-tabs i.fa-cogs:before {content: "";}
|
||||
#sidebar #sidebar-tabs i.fa-comments {background: url("img/ui/icon_sidebar_chat.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-fist-raised {background: url("img/ui/icon_sidebar_fight.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-swords {background: url("img/ui/icon_sidebar_fight.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-user {background: url("img/ui/icon_sidebar_actor.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-users {background: url("img/ui/icon_sidebar_actor.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-map {background: url("img/ui/icon_sidebar_scene.svg") no-repeat;}
|
||||
#sidebar #sidebar-tabs i.fa-suitcase {background: url("img/ui/icon_sidebar_item.svg") no-repeat;}
|
||||
|
@ -464,21 +464,24 @@
|
||||
</li>
|
||||
{{/if}}
|
||||
<li class="item flexrow">
|
||||
<span class="competence-label flex-shrink">Demi rêve :
|
||||
{{#if options.isGM}}
|
||||
{{caseTmr-label system.reve.tmrpos.coord}}
|
||||
</span><span>
|
||||
<input class="competence-value" type="text" name="system.reve.tmrpos.coord" value="{{system.reve.tmrpos.coord}}" data-dtype="String"/>
|
||||
{{else if hautreve.cacheTMR}}
|
||||
{{caseTmr-type system.reve.tmrpos.coord}}
|
||||
</span><span>
|
||||
??
|
||||
{{else}}
|
||||
{{caseTmr-label system.reve.tmrpos.coord}}
|
||||
</span><span>
|
||||
{{system.reve.tmrpos.coord}}
|
||||
{{/if}}
|
||||
<span class="competence-label flex-shrink">Demi rêve :
|
||||
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
|
||||
</span>
|
||||
<span>
|
||||
<input class="competence-value" type="text" name="system.reve.tmrpos.coord" value="{{system.reve.tmrpos.coord}}" data-dtype="String"/>
|
||||
</span>
|
||||
|
||||
{{else}}
|
||||
<span class="competence-label flex-shrink">Demi rêve :
|
||||
{{#unless hautreve.cacheTMR}}
|
||||
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
|
||||
{{/unless}}
|
||||
</span>
|
||||
<span>
|
||||
{{#if hautreve.cacheTMR}}??{{else}}{{system.reve.tmrpos.coord}}{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/if}}
|
||||
<li class="item flexrow">
|
||||
|
@ -50,11 +50,10 @@
|
||||
<br>
|
||||
{{/if}}
|
||||
{{#if (ne attaqueCategorie 'tir')}}
|
||||
{{#each esquives as |esquive key|}}
|
||||
{{#each esquives as |esq key|}}
|
||||
<a class='chat-card-button' id='esquiver-button' data-attackerId='{{../attackerId}}' data-defenderTokenId='{{../defenderTokenId}}'
|
||||
data-compid='{{esquive._id}}' data-competence='{{esquive.name}}'>
|
||||
{{log 'esquive' esquive}}
|
||||
{{esquive.name}} à {{../diffLibre}} {{#if esquive.system.nbUsage}} (Utilisations : {{esquive.system.nbUsage}}){{/if}}
|
||||
data-compid='{{esq._id}}' data-competence='{{esq.name}}'>
|
||||
{{esq.name}} à {{../diffLibre}} {{#if esq.usage}} (Utilisations : {{esq.usage}}){{/if}}
|
||||
</a>
|
||||
<br>
|
||||
{{/each}}
|
||||
|
@ -21,10 +21,6 @@
|
||||
<label for="system.coord">Case TMR</label>
|
||||
<input class="attribute-value" type="text" name="system.coord" value="{{system.coord}}" data-dtype="String"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label></label>
|
||||
<label class="attribute-value" >{{caseTmr-label system.coord}}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="system.ptreve">Rêve</label>
|
||||
<input class="attribute-value" type="text" name="system.ptreve" value="{{system.ptreve}}" data-dtype="String"/>
|
||||
|
Loading…
Reference in New Issue
Block a user