#27 Gestion des rencontres

This commit is contained in:
sladecraven 2020-11-20 12:06:54 +01:00
parent 163e85a82f
commit c6ed8db2fc
5 changed files with 165 additions and 79 deletions

View File

@ -17,7 +17,8 @@ export class RdDActorSheet extends ActorSheet {
width: 640,
height: 720,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac"}],
dragDrop: [{dragSelector: ".item-list .item", dropSelector: null}]
dragDrop: [{dragSelector: ".item-list .item", dropSelector: null}],
editCaracComp: false
});
}
@ -104,16 +105,19 @@ export class RdDActorSheet extends ActorSheet {
data.data.isGM = game.user.isGM;
data.ajustementsConditions = CONFIG.RDD.ajustementsConditions;
data.difficultesLibres = CONFIG.RDD.difficultesLibres;
// Gestion du lock/unlock des zones éditables (carac+compétences)
data.data.editCaracComp = this.options.editCaracComp;
data.data.lockUnlockText = (this.options.editCaracComp) ? "Bloquer" : "Debloquer";
// low is normal, this the base used to compute the grid.
data.data.fatigue = {
malus: RdDUtility.calculMalusFatigue(data.data.sante.fatigue.value, data.data.sante.endurance.max),
html: "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.endurance.max ).html() + "</table>"
}
RdDUtility.filterItemsPerTypeForSheet(data );
data.data.sortReserve = data.data.reve.reserve.list;
RdDUtility.filterItemsPerTypeForSheet(data );
data.data.sortReserve = data.data.reve.reserve.list;
RdDUtility.buildArbreDeConteneur( this, data );
return data;
@ -267,20 +271,32 @@ export class RdDActorSheet extends ActorSheet {
item.sheet.render(true);
});
// On carac change
html.find('.carac-value').change((event) => {
let caracName = event.currentTarget.name.replace(".value", "").replace("data.carac.", "");
//console.log("Value changed :", event, caracName);
this.actor.updateCarac( caracName, parseInt(event.target.value) );
} );
// On competence change
html.find('.competence-value').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
//console.log("Competence changed :", compName);
this.actor.updateCompetence( compName, parseInt(event.target.value) );
} );
if (this.options.editCaracComp) {
// On carac change
html.find('.carac-value').change((event) => {
let caracName = event.currentTarget.name.replace(".value", "").replace("data.carac.", "");
//console.log("Value changed :", event, caracName);
this.actor.updateCarac( caracName, parseInt(event.target.value) );
} );
// On competence change
html.find('.competence-value').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
//console.log("Competence changed :", compName);
this.actor.updateCompetence( compName, parseInt(event.target.value) );
} );
// On competence xp change
html.find('.competence-xp').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXP( compName, parseInt(event.target.value) );
} );
}
// Gestion du bouton lock/unlock
html.find('.lock-unlock-sheet a').click((event) => {
this.options.editCaracComp = !this.options.editCaracComp;
this.render(true);
});
// On pts de reve change
html.find('.pointsreve-value').change((event) => {
let reveValue = event.currentTarget.value;
@ -295,12 +311,6 @@ export class RdDActorSheet extends ActorSheet {
this.actor.setPointsDeSeuil(event.currentTarget.value);
} );
// On competence xp change
html.find('.competence-xp').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCompetenceXP( compName, parseInt(event.target.value) );
} );
// On stress change
html.find('.compteur-edit').change((event) => {
let fieldName = event.currentTarget.attributes.name.value;

View File

@ -46,6 +46,7 @@ export class RdDTMRDialog extends Dialog {
this.rencontresExistantes = duplicate(this.actor.data.data.reve.rencontre.list);
this.sortReserves = duplicate(this.actor.data.data.reve.reserve.list);
this.allTokens = [];
this.rencontreState = "aucune";
this.pixiApp = new PIXI.Application({ width: 720, height: 860 });
}
@ -101,6 +102,44 @@ export class RdDTMRDialog extends Dialog {
console.log("-> refouler", this.currentRencontre)
this.updateValuesDisplay();
}
/* -------------------------------------------- */
colorierZone( locList) {
this.currentRencontre.graphics = []; // Keep track of rectangles to delete it
this.currentRencontre.locList = duplicate(locList); // And track of allowed location
for (let loc of locList) {
let rect = this._getCaseRectangleCoord( loc);
var rectDraw = new PIXI.Graphics();
rectDraw.beginFill(0xFFFF00, 0.3);
// set the line style to have a width of 5 and set the color to red
rectDraw.lineStyle(5, 0xFF0000);
// draw a rectangle
rectDraw.drawRect(rect.x, rect.y, rect.w, rect.h);
this.pixiApp.stage.addChild(rectDraw);
this.currentRencontre.graphics.push(rectDraw); // garder les objets pour gestion post-click
}
}
/* -------------------------------------------- */
/** Gère les rencontres avec du post-processing graphique (passeur, messagers, tourbillons, ...) */
rencontrePostProcess( rencontreData) {
if (!rencontreData) return; // Sanity check
this.rencontreState = rencontreData.state; // garder la trace de l'état en cours
if ( this.rencontreState == "passeur") {
console.log("Processing passeur");
// Récupère la liste des cases à portées
let locList = TMRUtility.getTMRArea(this.actor.data.data.reve.tmrpos.coord, this.currentRencontre.force, tmrConstants );
this.colorierZone( locList );
} else if ( this.rencontreState == "messager") {
console.log("Processing messager");
// Récupère la liste des cases à portées
let locList = TMRUtility.getTMRArea(this.actor.data.data.reve.tmrpos.coord, this.currentRencontre.force, tmrConstants );
this.colorierZone( locList );
} else {
this.currentRencontre = undefined; // Cleanup, not used anymore
}
}
/* -------------------------------------------- */
async maitriser(data) {
this.actor.deleteTMRRencontreAtPosition(); // Remove the stored rencontre if necessary
@ -117,16 +156,22 @@ export class RdDTMRDialog extends Dialog {
let message = "<br><strong>Test : Rêve actuel / " + draconic.name + " / " + this.currentRencontre.name + "</strong>" + "<br>"
+ RdDResolutionTable.explain(rolled);
let rencontreData
if (rolled.isEchec) {
message += await TMRUtility.processRencontreEchec(this.actor, this.currentRencontre, rolled, this);
rencontreData = await TMRUtility.processRencontreEchec(this.actor, this.currentRencontre, rolled, this);
message += rencontreData.message;
this._tellToUser("Vous avez <strong>échoué</strong> à maîtriser un " + this.currentRencontre.name + " de force " + this.currentRencontre.force
+ "<br>Vous quittez brutalement les Terres Médianes !" + message);
if (this.currentRencontre.data.quitterTMR) // Selon les rencontres, quitter TMR ou pas
this.close();
} else {
message += await TMRUtility.processRencontreReussite(this.actor, this.currentRencontre, rolled);
rencontreData = await TMRUtility.processRencontreReussite(this.actor, this.currentRencontre, rolled);
message += rencontreData.message;
this._tellToUser("Vous avez <strong>réussi</strong> à maîtriser un " + this.currentRencontre.name + " de force " + this.currentRencontre.force + message);
}
this.rencontrePostProcess( rencontreData );
console.log("-> matriser", this.currentRencontre);
this.updateValuesDisplay();
}
@ -154,7 +199,7 @@ export class RdDTMRDialog extends Dialog {
rencontre = await TMRUtility.rencontreTMRRoll(coordTMR, cellDescr);
}
}
//rencontre = await TMRUtility.rencontreTMRRoll(coordTMR, cellDescr); To test
rencontre = await TMRUtility.rencontreTMRRoll(coordTMR, cellDescr);
if (rencontre) { // Manages it
if (rencontre.rencontre) rencontre = rencontre.rencontre; // Manage stored rencontres
@ -276,6 +321,19 @@ export class RdDTMRDialog extends Dialog {
}
}
/* -------------------------------------------- */
processClickPostRencontre( coord ) {
let deplacementType = "erreur";
if (this.rencontreState == "passeur" || this.rencontreState == "messager") {
let isInArea = this.currentRencontre.locList.find(locCoord => locCoord == coord );
if ( isInArea ) { // OK !
deplacementType = "saut";
}
}
}
/* -------------------------------------------- */
async deplacerDemiReve(event) {
if (this.viewOnly) {
@ -288,12 +346,19 @@ export class RdDTMRDialog extends Dialog {
let cellx = eventCoord.cellx;
let celly = eventCoord.celly;
console.log("deplacerDemiReve >>>>", cellx, celly);
let currentPos = TMRUtility.convertToCellCoord(myself.actor.data.data.reve.tmrpos.coord);
if (RdDTMRDialog._horsDePortee(currentPos, cellx, celly)) {
ui.notifications.error("Vous ne pouvez vous déplacer que sur des cases adjacentes à votre position");
// Validation de la case de destination (gestion du cas des rencontres qui peuvent téléporter)
let deplacementType = "erreur";
if ( this.rencontreState == "aucune") { // Pas de recontre en post-processing, donc deplacement normal
if ( !RdDTMRDialog._horsDePortee(currentPos, cellx, celly)) {
deplacementType = "normal";
}
} else {
deplacementType = this.processClickPostRencontre( currentPos );
}
// Si le deplacement est valide
if ( deplacementType == "normal" || deplacementType == "saut") {
let coordTMR = TMRUtility.convertToTMRCoord(cellx, celly);
let cellDescr = TMRUtility.getTMRDescription(coordTMR);
@ -306,9 +371,13 @@ export class RdDTMRDialog extends Dialog {
myself.nbFatigue += 1;
myself.updateValuesDisplay();
myself.manageRencontre(coordTMR, cellDescr);
if ( deplacementType == "normal") { // Pas de rencontres après un saut de type passeur/changeur/...
myself.manageRencontre(coordTMR, cellDescr);
}
myself.manageCaseHumide(cellDescr);
await myself.declencheSortEnReserve(coordTMR);
} else {
ui.notifications.error("Vous ne pouvez vous déplacer que sur des cases adjacentes à votre position ou valides dans le cas d'une rencontre");
}
}
@ -448,6 +517,16 @@ export class RdDTMRDialog extends Dialog {
myself._setTokenPosition(myself.demiReve);
}
/* -------------------------------------------- */
/** Retourne les coordonnées x, h, w, h du rectangle d'une case donnée */
_getCaseRectangleCoord( coord ) {
let coordXY = TMRUtility.convertToCellCoord( coord );
let decallagePairImpair = (coordXY.x % 2 == 0) ? tmrConstants.col1_y : tmrConstants.col2_y;
let x = tmrConstants.gridx + (coordXY.x * tmrConstants.cellw) - (tmrConstants.cellw /2);
let y = tmrConstants.gridy + (coordXY.y * tmrConstants.cellh) - (tmrConstants.cellh /2) + decallagePairImpair;
return {x: x, y: y, w: tmrConstants.cellw, h: tmrConstants.cellh}
}
/* -------------------------------------------- */
_setTokenPosition(token) {
let coordXY = TMRUtility.convertToCellCoord(token.coordTMR());

View File

@ -240,23 +240,9 @@ const rencontresTable = [
lac: "98-00", marais: "98-00", gouffre: "98-00", necropole: "98-00", desolation: "98-00" } }
]
/* -------------------------------------------- */
const tmrConstants = {
col1_y: 30,
col2_y: 55,
cellw: 55,
cellh: 55,
gridx: 28,
gridy: 28
}
/* -------------------------------------------- */
export class TMRUtility {
static getTMRConstants() {
return tmrConstants;
}
/* -------------------------------------------- */
static convertToTMRCoord( x, y )
{
@ -290,9 +276,9 @@ export class TMRUtility {
rencontre.coord = coordTMR;
}
// Forced
//rencontre = rencontresTable[4];
//rencontre.force = 11;
//rencontre.coord = coordTMR;
rencontre = rencontresTable[0];
rencontre.force = 1;
rencontre.coord = coordTMR;
return rencontre;
}
@ -379,13 +365,17 @@ export class TMRUtility {
/* -------------------------------------------- */
static async processRencontreReussite( actor, rencontre, rolled ) {
let msg = "<br>";
let state = "aucune";
console.log("processRencontreReussite", actor, rencontre);
if (rencontre.name == "Messagers des Rêves") {
msg += "Le Messager des Rêves vous permet de lancer votre sort à XX cases !";
state = "messager";
} else if (rencontre.name == "Passeur des Rêves") {
msg += "Le Passeur des Rêves vous téléporte sur une case à XX !";
msg += "Le Passeur des Rêves vous permet de vous téléporter à " + rencontre.force + " cases !";
state = "passeur";
} else if (rencontre.name == "Fleur des Rêves") {
await actor.updatePointsDeReve( rencontre.force );
msg += "La Fleur des rêves s'évanouit en vous fournissant " + rencontre.force + " Points de Rêve";
@ -419,13 +409,14 @@ export class TMRUtility {
msg += "Vous maîtrisez le Rêve de Dragon !"
msg += actor.appliquerReveDeDragon(rolled, rencontre.force);
}
return msg;
return { msg: msg, state: state };
}
/* -------------------------------------------- */
static async processRencontreEchec( actor, rencontre, rolled, tmrDialog ) {
let msg = "<br>";
let state = "aucune";
if (rencontre.name == "Messagers des Rêves") {
msg += "Le Messager des Rêves s'éloigne de vous !";
@ -453,18 +444,21 @@ export class TMRUtility {
} else if (rencontre.name == "Reflet d'ancien Rêve") {
msg += "Votre Rêve est Brisé, vous quittez les Terres Médianes";
state = "reflet"
} else if (rencontre.name == "Tourbillon blanc") {
msg += "Votre Rêve est Brisé, vous quittez les Terres Médianes";
state = "tourbillonblanc";
} else if (rencontre.name == "Tourbillon noir") {
msg += "Votre Rêve est Brisé, vous quittez les Terres Médianes";
state = "tourbillonnoir";
} else if (rencontre.name == "Rêve de Dragon") {
msg += "Le Rêve de Dragon tourne au cauchemar !"
msg += actor.appliquerReveDeDragon(rolled, rencontre.force);
}
return msg;
return { msg: msg, state: state };
}
/* -------------------------------------------- */
@ -502,7 +496,7 @@ export class TMRUtility {
}
/* -------------------------------------------- */
static computeRealPictureCoordinates( coordXY ) {
static computeRealPictureCoordinates( coordXY, tmrConstants ) {
let decallagePairImpair = (coordXY.x % 2 == 0) ? tmrConstants.col1_y : tmrConstants.col2_y;
return {
x: tmrConstants.gridx + (coordXY.x * tmrConstants.cellw),
@ -514,15 +508,15 @@ export class TMRUtility {
/** Returns a list of case inside a given distance
*
*/
static getTMRArea( coord, distance ) {
static getTMRArea( coord, distance, tmrConstants ) {
let pos = this.convertToCellCoord( coord );
let posPic = this.computeRealPictureCoordinates( pos );
let posPic = this.computeRealPictureCoordinates( pos, tmrConstants );
let caseList = [];
for (let x=pos.x-distance; x<=pos.x+distance; x++ ) { // Loop thru lines
for (let y=pos.y-distance; y<=pos.y+distance; y++ ) { // Loop thru lines
//console.log("Parsing position", x, y);
if ( this._checkTMRCoord(x, y) ) { // Coordinate is valie
let posPicNow = this.computeRealPictureCoordinates( {x: x, y: y} );
let posPicNow = this.computeRealPictureCoordinates( {x: x, y: y}, tmrConstants );
let dist = Math.sqrt(Math.pow(posPicNow.x - posPic.x,2) + Math.pow(posPicNow.y - posPic.y, 2)) / tmrConstants.cellw;
if ( dist < distance+0.5) {
caseList.push( this.convertToTMRCoord(x, y) ); // Inside the area

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.63",
"version": "0.9.64",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.6",
"templateVersion": 47,

View File

@ -35,6 +35,9 @@
<span class="tooltiptext">{{{data.fatigue.html}}}</span>
</div>
</div>
<div class="lock-unlock-sheet">
<span><a>{{data.lockUnlockText}}</a></span>
</div>
</div>
<div class="flexrow flex-wound">
<div class="flexrow">
@ -75,8 +78,8 @@
{{#if carac.derivee}}
<label class="competence-value flexrow">{{carac.value}}</label>
{{else}}
<input class="carac-value flexrow" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}"/>
<input class="competence-xp flexrow" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number"/>
<input class="carac-value flexrow" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.data.editCaracComp}}disabled{{/unless}} />
<input class="competence-xp flexrow" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}} />
{{/if}}
</li>
{{/each}}
@ -115,8 +118,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.generale[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.generale[{{key}}]].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.generale[{{key}}].data.value" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.generale[{{key}}]].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -133,8 +136,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.particuliere[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.particuliere[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -150,8 +153,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.specialisee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.specialisee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -170,8 +173,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.melee[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.melee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.melee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.melee[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.melee[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -188,8 +191,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.tir[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.tir[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.tir[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.tir[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -206,8 +209,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.lancer[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.lancer[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.lancer[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"{{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.lancer[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -224,8 +227,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.connaissance[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.connaissance[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
@ -242,8 +245,8 @@
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}"/>
<span class="competence-label" name="data.competenceByCategory.draconic[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number"/>
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number"/>
<input class="competence-value" type="text" name="data.competenceByCategory.draconic[{{key}}].data.niveau" compname="{{comp.name}}" value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<input class="competence-xp" type="text" name="data.competenceByCategory.draconic[{{key}}].data.xp" compname="{{comp.name}}" value="{{comp.data.xp}}" data-dtype="number" {{#unless @root.data.editCaracComp}}disabled{{/unless}}/>
<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-delete" title="Delete Item"><i class="fas fa-trash"></i></a>