Modif sur gestion equipement
This commit is contained in:
parent
ec4166d2da
commit
db500e1b4c
@ -15,7 +15,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
classes: ["rdd", "sheet", "actor"],
|
||||
template: "systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html",
|
||||
width: 640,
|
||||
height: 720,
|
||||
//height: 720,
|
||||
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac"}],
|
||||
dragDrop: [{dragSelector: ".item-list .item", dropSelector: null}],
|
||||
editCaracComp: false
|
||||
|
@ -130,7 +130,7 @@ export class RdDActor extends Actor {
|
||||
let rolled = await RdDResolutionTable.roll(rollData.caracValue, rollData.finalLevel);
|
||||
//rolled.isPart = true; // Pour tester le particulières
|
||||
rollData.rolled = rolled; // garder le résultat
|
||||
console.log("performRoll", rollData, rolled)
|
||||
//console.log("performRoll", rollData, rolled)
|
||||
if ( !rollData.attackerRoll) // Store in the registry if not a defense roll
|
||||
game.system.rdd.rollDataHandler[this.data._id] = rollData;
|
||||
|
||||
@ -331,6 +331,8 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
if (closeTMR) {
|
||||
this.currentTMR.close(); // Close TMR !
|
||||
} else {
|
||||
this.currentTMR.maximize(); // Re-display TMR
|
||||
}
|
||||
return explications
|
||||
}
|
||||
@ -1097,6 +1099,7 @@ export class RdDActor extends Actor {
|
||||
isNatation: false,
|
||||
useEncForNatation: false
|
||||
}
|
||||
if ( this.currentTMR) this.currentTMR.minimize(); // Hide
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-sort.html', rollData);
|
||||
new RdDRollDialog("sort", html, rollData, this ).render(true);
|
||||
}
|
||||
@ -1157,6 +1160,10 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
// Notification au MJ
|
||||
ChatMessage.create( { content: game.user.name + " est monté dans les TMR en mode : " + mode, whisper: ChatMessage.getWhisperRecipients("GM") } );
|
||||
|
||||
// Ouverture TMR
|
||||
let data = {
|
||||
fatigue: {
|
||||
malus: RdDUtility.calculMalusFatigue(this.data.data.sante.fatigue.value, this.data.data.sante.endurance.max),
|
||||
|
@ -6,6 +6,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
import { TMRUtility } from "./tmr-utility.js";
|
||||
import { RdDRollTables } from "./rdd-rolltables.js";
|
||||
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||
import { RdDTMRRencontreDialog } from "./rdd-tmr-rencontre-dialog.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
const tmrConstants = {
|
||||
@ -253,6 +254,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
console.log("manageRencontre", rencontre)
|
||||
this.currentRencontre = duplicate(rencontre);
|
||||
|
||||
let dialog = new RdDTMRRencontreDialog("", this, this.currentRencontre);
|
||||
/*
|
||||
let dialog = new Dialog({
|
||||
title: "Rencontre en TMR!",
|
||||
content: "Vous recontrez un " + rencontre.name + " de force " + rencontre.force + "<br>",
|
||||
@ -262,7 +265,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
maitiser: { icon: '<i class="fas fa-check"></i>', label: "Maîtriser", callback: () => this.maitriser() }
|
||||
},
|
||||
default: "derober"
|
||||
});
|
||||
});*/
|
||||
dialog.render(true);
|
||||
}
|
||||
}
|
||||
@ -313,31 +316,39 @@ export class RdDTMRDialog extends Dialog {
|
||||
// TODO: ajouter l'état général?
|
||||
const etatGeneral = this.actor.data.data.compteurs.etat.value
|
||||
let difficulte = draconic.data.niveau - 7;
|
||||
let rolled = RdDResolutionTable.roll(carac, difficulte);
|
||||
let rolled = await RdDResolutionTable.roll(carac, difficulte);
|
||||
|
||||
console.log("manageCaseHumide >>", rolled);
|
||||
|
||||
let explication = "";
|
||||
let msg2MJ = "";
|
||||
this.toclose = rolled.isEchec;
|
||||
if (rolled.isEchec) {
|
||||
explication += "Vous êtes entré sur une case humide, et vous avez <strong>raté</strong> votre maîtrise ! Vous <strong>quittez les Terres Médianes</strong> !"
|
||||
msg2MJ += game.user.name + " est rentré sur une case humides : Echec !";
|
||||
}
|
||||
else {
|
||||
explication += "Vous êtes entré sur une case humide, et vous avez <strong>réussi</strong> votre maîtrise !"
|
||||
msg2MJ += game.user.name + " est rentré sur une case humides : Réussite !";
|
||||
}
|
||||
explication += "<br><strong>Test : Rêve actuel / " + draconic.name + " / " + cellDescr.type + "</strong>"
|
||||
+ RdDResolutionTable.explain(rolled);
|
||||
|
||||
if (rolled.isETotal) {
|
||||
let souffle = RdDRollTables.getSouffle();
|
||||
let souffle = await RdDRollTables.getSouffle();
|
||||
explication += "<br>Vous avez fait un Echec Total. Vous subissez un Souffle de Dragon : " + souffle.name;
|
||||
msg2MJ += "<br>Et a reçu un Souffle de Dragon : " + souffle.name;
|
||||
this.actor.createOwnedItem(souffle);
|
||||
}
|
||||
if (rolled.isPart) {
|
||||
explication += "<br>Vous avez fait une Réussite Particulière";
|
||||
explication += RdDResolutionTable.buildXpMessage(rolled, difficulte)
|
||||
explication += RdDResolutionTable.buildXpMessage(rolled, difficulte);
|
||||
msg2MJ += "<br>Et a fait une réussite particulière";
|
||||
}
|
||||
|
||||
// Notification au MJ
|
||||
ChatMessage.create( { content: msg2MJ, whisper: ChatMessage.getWhisperRecipients("GM") } );
|
||||
// Et au joueur (ca pourrait être un message de tchat d'ailleurs)
|
||||
let humideDiag = new Dialog({
|
||||
title: "Case humide",
|
||||
content: explication,
|
||||
|
39
module/rdd-tmr-rencontre-dialog.js
Normal file
39
module/rdd-tmr-rencontre-dialog.js
Normal file
@ -0,0 +1,39 @@
|
||||
/* -------------------------------------------- */
|
||||
export class RdDTMRRencontreDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, tmrApp, rencontreData) {
|
||||
const dialogConf = {
|
||||
title: "Rencontre en TMR!",
|
||||
content: "Vous recontrez un " + rencontreData.name + " de force " + rencontreData.force + "<br>",
|
||||
buttons: {
|
||||
derober: { icon: '<i class="fas fa-check"></i>', label: "Se dérober", callback: () => { this.toClose = true; this.tmrApp.derober() } },
|
||||
refouler: { icon: '<i class="fas fa-check"></i>', label: "Refouler", callback: () => { this.toClose = true;this.tmrApp.refouler() } },
|
||||
maitiser: { icon: '<i class="fas fa-check"></i>', label: "Maîtriser", callback: () => { this.toClose = true;this.tmrApp.maitriser() } }
|
||||
},
|
||||
default: "derober"
|
||||
}
|
||||
|
||||
const dialogOptions = {
|
||||
classes: ["tmrrencdialog"],
|
||||
width: 320, height: 240,
|
||||
'z-index': 20
|
||||
}
|
||||
super(dialogConf, dialogOptions);
|
||||
|
||||
this.toClose = false;
|
||||
this.rencontreData = duplicate(rencontreData);
|
||||
this.tmrApp = tmrApp;
|
||||
this.tmrApp.minimize();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
close() {
|
||||
if ( this.toClose ) {
|
||||
this.tmrApp.maximize();
|
||||
return super.close();
|
||||
}
|
||||
ui.notifications.info("Vous devez résoudre la rencontre.");
|
||||
}
|
||||
|
||||
}
|
@ -650,6 +650,7 @@ export class RdDUtility {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _handleMsgDefense(data) {
|
||||
let defenderActor = game.actors.get(data.defenderid);
|
||||
if (defenderActor) {
|
||||
|
Loading…
Reference in New Issue
Block a user