This commit is contained in:
sladecraven 2020-11-21 23:24:00 +01:00
parent 391af4bd3c
commit 6214df96da
6 changed files with 27 additions and 14 deletions

View File

@ -189,6 +189,8 @@ export class RdDActor extends Actor {
explications += "<br><strong>Attaque parée/esquivée !</strong>";
} else {
explications += "<br><strong>Esquive/Parade échouée, encaissement !</strong>";
if (rollData.needSignificative)
explications += "Significative nécessaire!";
encaisser = true;
}
} else { // This is the attack roll!
@ -770,7 +772,9 @@ export class RdDActor extends Actor {
async santeIncDec(name, inc ) {
const sante = duplicate(this.data.data.sante);
let data = sante[name];
let minValue = name == "vie" ? Number(-this.data.data.attributs.sconst.value) : 0;
let minValue = 0;
if (this.type == 'personnage')
minValue = name == "vie" ? Number(-this.data.data.attributs.sconst.value) : 0;
let newValue = Math.max(minValue, Math.min(data.value + inc, data.max));
if (name == "endurance" && this.data.type != 'entite' ) {
@ -1131,13 +1135,20 @@ export class RdDActor extends Actor {
const blessureLegere = (result.legeres > 0 ? "une blessure légère" : "");
const blessureGrave = (result.graves > 0 ? "une blessure grave" : "");
const blessureCritique = (result.critiques > 0 ? "une blessure critique" : "");
ChatMessage.create({
title: "Blessures !", content: this.data.name + " a encaissé : " +
"<br>Encaissement final : " + degatsReel +
"<br>" + blessureLegere + blessureGrave + blessureCritique +
"<br>Et a perdu : " +
"<br>" + result.endurance + " Endurance et " + result.vie + " Points de Vie"
});
let commonMsg = { title: "Blessures !", content: this.data.name + " a encaissé : " +
"<br>Encaissement final : " + degatsReel +
"<br>" + blessureLegere + blessureGrave + blessureCritique }
let addonMsg = "<br>Et a perdu : <br>" + result.endurance + " Endurance et " + result.vie + " Points de Vie";
if ( this.hasPlayerOwner ) {
commonMsg.content += addonMsg; // Message pour tout le monde
ChatMessage.create( commonMsg );
} else { // Le defenseur n'est pas un PJ, donc message complet uniquement pour le MJ
ChatMessage.create( commonMsg ); // Message pour tout le monde
let gmMsg = duplicate(commonMsg);
gmMsg.content = addonMsg; // Et message complémentaire uniquement pour le MJ
gmMsg.whisper = ChatMessage.getWhisperRecipients( "GM" );
ChatMessage.create( gmMsg );
}
this.computeEtatGeneral();
this.sheet.render(true);

View File

@ -398,6 +398,7 @@ export class RdDTMRDialog extends Dialog {
if (this.viewOnly) {
return;
}
let origEvent = event.data.originalEvent;
let myself = event.target.tmrObject;

View File

@ -342,10 +342,11 @@ table {border: 1px solid #7a7971;}
text-align: right;
}
.rdddialog {
.rdddialog .dialog-roll-sort s{
width: 600px;
height: 430px;
z-index: 99999;
z-index: 9999;
display: block;
}
.table-resolution-carac {

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.74",
"version": "0.9.75",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6",
"templateVersion": 47,

View File

@ -74,7 +74,7 @@
name="data.competencecreature[{{key}}].data.niveau" compname="{{comp.name}}"
value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" />
<input class="competence-value creature-dommages" type="text"
name="data.competencecreature[{{key}}]].data.dommages" compname="{{comp.name}}"
name="data.competencecreature[{{key}}].data.dommages" compname="{{comp.name}}"
value="{{numberFormat comp.data.dommages decimals=0 sign=true}}" data-dtype="number" />
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>

View File

@ -103,7 +103,7 @@
name="data.competencecreature[{{key}}].data.niveau" compname="{{comp.name}}"
value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" />
<input class="competence-value creature-dommages" type="text"
name="data.competencecreature[{{key}}]].data.dommages" compname="{{comp.name}}"
name="data.competencecreature[{{key}}].data.dommages" compname="{{comp.name}}"
value="{{numberFormat comp.data.dommages decimals=0 sign=true}}" data-dtype="number" />
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>