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>"; explications += "<br><strong>Attaque parée/esquivée !</strong>";
} else { } else {
explications += "<br><strong>Esquive/Parade échouée, encaissement !</strong>"; explications += "<br><strong>Esquive/Parade échouée, encaissement !</strong>";
if (rollData.needSignificative)
explications += "Significative nécessaire!";
encaisser = true; encaisser = true;
} }
} else { // This is the attack roll! } else { // This is the attack roll!
@ -770,7 +772,9 @@ export class RdDActor extends Actor {
async santeIncDec(name, inc ) { async santeIncDec(name, inc ) {
const sante = duplicate(this.data.data.sante); const sante = duplicate(this.data.data.sante);
let data = sante[name]; 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)); let newValue = Math.max(minValue, Math.min(data.value + inc, data.max));
if (name == "endurance" && this.data.type != 'entite' ) { 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 blessureLegere = (result.legeres > 0 ? "une blessure légère" : "");
const blessureGrave = (result.graves > 0 ? "une blessure grave" : ""); const blessureGrave = (result.graves > 0 ? "une blessure grave" : "");
const blessureCritique = (result.critiques > 0 ? "une blessure critique" : ""); const blessureCritique = (result.critiques > 0 ? "une blessure critique" : "");
ChatMessage.create({ let commonMsg = { title: "Blessures !", content: this.data.name + " a encaissé : " +
title: "Blessures !", content: this.data.name + " a encaissé : " + "<br>Encaissement final : " + degatsReel +
"<br>Encaissement final : " + degatsReel + "<br>" + blessureLegere + blessureGrave + blessureCritique }
"<br>" + blessureLegere + blessureGrave + blessureCritique + let addonMsg = "<br>Et a perdu : <br>" + result.endurance + " Endurance et " + result.vie + " Points de Vie";
"<br>Et a perdu : " + if ( this.hasPlayerOwner ) {
"<br>" + result.endurance + " Endurance et " + result.vie + " Points de Vie" 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.computeEtatGeneral();
this.sheet.render(true); this.sheet.render(true);

View File

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

View File

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

View File

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

View File

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