This commit is contained in:
sladecraven 2021-04-02 17:31:18 +02:00
parent 3880dfb034
commit 2e4f94d7af
4 changed files with 12 additions and 4 deletions

View File

@ -93,9 +93,11 @@ export class VadentisActor extends Actor {
myRoll.evaluate();
myRoll.toMessage( { flavor: `Lancer de Sort : ${sort.name} (${formulaFull})` } );
console.log("ROLL", myRoll);
if (myRoll.total >= sort.data.difficulty) {
let content = `Votre sort ${sort.name} a réussi ! Vous perdez ${sort.data.pe} Points d'Energie et votre sort produit l'effet : <br>${sort.data.effect}`;
let newEnergie = this.data.data.stats.pointsenergie - sort.data.pe;
await this.update( {'data.stats.pointsenergie': newEnergie });
if ( sort.data.damage != "") {
if (myRoll.results[0] == 20 ) { // Critique ?
content += `<br>Et provoque les dégats critiques suivants : ${sort.data.damagecritical}`;
@ -129,6 +131,9 @@ export class VadentisActor extends Actor {
if (myRoll.total >= devotion.data.difficulty) {
let content = `Votre dévotion ${devotion.name} a réussie ! Vous perdez ${devotion.data.pe} Points d'Energie et votre dévotion produit l'effet : <br>${devotion.data.effect}`;
let newEnergie = this.data.data.stats.pointsenergie - devotion.data.pe;
await this.update( {'data.stats.pointsenergie': newEnergie });
if ( devotion.data.damage != "") {
if (myRoll.results[0] == 20 ) { // Critique ?
content += `<br>Et provoque les dégats critiques suivants : ${devotion.data.damagecritical}`;

View File

@ -51,7 +51,7 @@ export class VadentisItemSheet extends ItemSheet {
data.eglises = await VadentisUtility.getEglises();
}
data.isGM = game.user.isGM;
console.log("DATA", data);
return data;
}

View File

@ -11,6 +11,9 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label><input type="text" name="data.type" value="{{data.type}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="data.damage" value="{{data.damage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts critique</label><input type="text" name="data.criticaldamage" value="{{data.criticaldamage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/></li>
</ul>

View File

@ -15,8 +15,8 @@
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="data.damage" value="{{data.damage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts Critiques</label><input type="text" name="data.critical" value="{{data.critical}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Munitions</label><input type="text" name="data.munition" value="{{data.munition}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Munitions</label><input type="text" name="data.distance" value="{{data.distance}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Distance</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Distance</label><input type="text" name="data.distance" value="{{data.distance}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Encrombrement</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="data.cost" value="{{data.cost}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>