Migration à Foundry v11/v12 + changes requests

This commit is contained in:
LeRatierBretonnien 2024-04-27 23:28:28 +02:00
parent 0b86c3b159
commit 1e0f982b90
30 changed files with 473 additions and 415 deletions

25
.gitignore vendored
View File

@ -1,11 +1,14 @@
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
.vscode/settings.json
.idea
.history
todo.md
/.vscode
/ignored/
/node_modules/
/jsconfig.json
/package.json
/package-lock.json
/packs/*/
/packs/*/CURRENT
/packs/*/LOG
/packs/*/LOCK

View File

@ -1 +0,0 @@
/home/morr/work/uberwald/fvtt-vadentis/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 3.6 MiB

View File

@ -13,7 +13,7 @@ export class VadentisActorSheet extends ActorSheet {
return mergeObject(super.defaultOptions, {
classes: ["vadentis", "sheet", "actor"],
template: "systems/foundryvtt-vadentis/templates/actor-sheet.html",
width: 640,
width: 680,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
@ -22,19 +22,17 @@ export class VadentisActorSheet extends ActorSheet {
}
/* -------------------------------------------- */
getData() {
async getData() {
this.actor.calculerSommeStats();
const objectData = VadentisUtility.data(this.object);
let actorData = duplicate(VadentisUtility.templateData(this.object));
let formData = {
let actorData = foundry.utils.duplicate(this.object.system);
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
id: this.object.id,
type: this.object.type,
img: this.object.img,
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
@ -43,28 +41,31 @@ export class VadentisActorSheet extends ActorSheet {
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
isGM: game.user.isGM,
history: await TextEditor.enrichHTML(this.object.system.history, { async: true }),
notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }),
gmnotes: await TextEditor.enrichHTML(this.object.system.gmnotes, { async: true }),
}
formData.editScore = this.options.editScore;
formData.donnees = this.actor.getDonnees();
formData.eglises = this.actor.getEglises();
formData.editScore = this.options.editScore;
formData.donnees = this.actor.getDonnees();
formData.eglises = this.actor.getEglises();
formData.competences = this.actor.getCompetences();
formData.sorts = this.actor.getSorts();
formData.devotions = this.actor.getDevotions();
formData.attributs = this.actor.getAttributs();
formData.techniques = this.actor.getTechniques();
formData.armes = this.actor.getArmes();
formData.armures = this.actor.getArmures();
formData.sorts = this.actor.getSorts();
formData.devotions = this.actor.getDevotions();
formData.attributs = this.actor.getAttributs();
formData.techniques = this.actor.getTechniques();
formData.armes = this.actor.getArmes();
formData.armures = this.actor.getArmures();
formData.equipements = this.actor.getEquipements();
formData.monnaies = this.actor.getMonnaies();
formData.optionsBase = VadentisUtility.createDirectOptionList(0, 50);
formData.monnaies = this.actor.getMonnaies();
formData.optionsBase = VadentisUtility.createDirectOptionList(0, 50);
formData.optionsMalus = VadentisUtility.createDirectReverseOptionList(-50, 0);
formData.optionsBonus = VadentisUtility.createDirectOptionList(0, 50);
formData.optionsPV = VadentisUtility.createOptionList(-50, 200);
formData.optionsPE = VadentisUtility.createOptionList(-50, 200);
formData.optionsPA = VadentisUtility.createOptionList(0, 20);
formData.optionsPV = VadentisUtility.createDirectIntegerOptionList(-50, 999);
formData.optionsPE = VadentisUtility.createOptionList(-50, 999);
formData.optionsPA = VadentisUtility.createOptionList(0, 20);
return formData;
@ -73,13 +74,25 @@ export class VadentisActorSheet extends ActorSheet {
/* -------------------------------------------- */
async checkSort(sortId) {
await Dialog.confirm({
title: "Lancer un sort",
content: "Etes vous certain de vouloir incanter ce sort ?",
title: "Lancer un Sort",
content: "Etes vous certain de vouloir incanter ce Sort ?",
yes: async () => {
this.actor.rollSort(sortId);
},
no: () => {},
});
no: () => { },
});
}
/* -------------------------------------------- */
async checkDevotion(devotionId) {
await Dialog.confirm({
title: "Lancer une Dévotion",
content: "Etes vous certain de vouloir incanter cette Dévotion ?",
yes: async () => {
this.actor.rollDevotion(devotionId);
},
no: () => { },
});
}
/* -------------------------------------------- */
@ -91,7 +104,7 @@ export class VadentisActorSheet extends ActorSheet {
console.log("Technique ", techniqueId)
this.actor.rollTechnique(techniqueId);
},
no: () => {},
no: () => { },
});
}
@ -114,38 +127,38 @@ export class VadentisActorSheet extends ActorSheet {
const li = $(ev.currentTarget).parents(".item");
VadentisUtility.confirmDelete(this, li);
});
html.find('.munition-moins').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.decrementeMunition( item );
} );
this.actor.decrementeMunition(item);
});
html.find('.munition-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.incrementeMunition( item );
} );
this.actor.incrementeMunition(item);
});
html.find('.equipement-moins').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.decrementeQuantite( item );
} );
this.actor.decrementeQuantite(item);
});
html.find('.equipement-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.incrementeQuantite( item );
} );
this.actor.incrementeQuantite(item);
});
html.find('.argent-moins').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.decrementeArgent( item );
} );
this.actor.decrementeArgent(item);
});
html.find('.argent-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
const item = this.actor.items.get(li.data("item-id"));
this.actor.incrementeArgent( item );
} );
this.actor.incrementeArgent(item);
});
html.find('.combat-label a').click((event) => {
let combatName = event.currentTarget.attributes.name.value;
@ -169,17 +182,17 @@ export class VadentisActorSheet extends ActorSheet {
const li = $(event.currentTarget).parents(".item");
const sortId = li.data("item-id");
this.checkSort(sortId);
});
});
html.find('.arme-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const armeId = li.data("item-id");
this.actor.rollArme(armeId);
});
});
html.find('.devotion-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const devotionId = li.data("item-id");
this.actor.rollDevotion(devotionId);
});
this.checkDevotion(devotionId);
});
html.find('.weapon-label a').click((event) => {
const li = $(event.currentTarget).parents(".item");
const weapon = this.actor.items.get(li.data("item-id"));
@ -205,7 +218,7 @@ export class VadentisActorSheet extends ActorSheet {
const weapon = this.actor.items.get(li.data("item-id"));
this.actor.rollSortDevotionDamage(weapon, 'damagecritical');
});
html.find('.competence-base').change((event) => {
let skillName = event.currentTarget.attributes.skillname.value;
this.actor.updateCompetence(skillName, "base", parseInt(event.target.value));
@ -221,15 +234,15 @@ export class VadentisActorSheet extends ActorSheet {
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
});
html.find('.item-link a').click((event) => {
const itemId = $(event.currentTarget).data("item-id");
const item = this.actor.items.get(itemId);
item.sheet.render(true);
});
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equiperObject( li.data("item-id") );
this.actor.equiperObject(li.data("item-id"));
this.render(true);
});

View File

@ -31,7 +31,7 @@ export class VadentisActor extends Actor {
return super.create(data, options);
}
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
if (data.items) {
if (system.items) {
let actor = super.create(data, options);
return actor;
}
@ -46,55 +46,55 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
getCompetences() {
return duplicate( this.data.items.filter( item => item.type == 'competence') || [] );
return duplicate( this.items.filter( item => item.type == 'competence') || [] );
}
/* -------------------------------------------- */
getDonnees() {
return duplicate( this.data.items.filter( item => item.type == 'donnee')|| [] );
return duplicate( this.items.filter( item => item.type == 'donnee')|| [] );
}
/* -------------------------------------------- */
getEglises() {
return duplicate( this.data.items.filter( item => item.type == 'eglise')|| [] );
return duplicate( this.items.filter( item => item.type == 'eglise')|| [] );
}
/* -------------------------------------------- */
getSorts() {
return duplicate( this.data.items.filter( item => item.type == 'sort')|| [] );
return duplicate( this.items.filter( item => item.type == 'sort')|| [] );
}
/* -------------------------------------------- */
getAttributs() {
return duplicate( this.data.items.filter( item => item.type == 'attribut')|| [] );
return duplicate( this.items.filter( item => item.type == 'attribut')|| [] );
}
/* -------------------------------------------- */
getTechniques() {
return duplicate( this.data.items.filter( item => item.type == 'technique') || [] );
return duplicate( this.items.filter( item => item.type == 'technique') || [] );
}
/* -------------------------------------------- */
getDevotions() {
return duplicate(this.data.items.filter( item => item.type == 'devotion')|| [] );
return duplicate(this.items.filter( item => item.type == 'devotion')|| [] );
}
/* -------------------------------------------- */
getEquipements() {
return duplicate(this.data.items.filter( item => item.type == 'equipement' ) || [] );
return duplicate(this.items.filter( item => item.type == 'equipement' ) || [] );
}
/* -------------------------------------------- */
getArmes() {
return duplicate(this.data.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] );
return duplicate(this.items.filter( item => item.type == 'armecc' || item.type == 'tir' ) || [] );
}
/* -------------------------------------------- */
getArmures() {
return duplicate(this.data.items.filter( item => item.type == 'armurebouclier' ) || [] );
return duplicate(this.items.filter( item => item.type == 'armurebouclier' ) || [] );
}
/* -------------------------------------------- */
getMonnaies() {
return duplicate(this.data.items.filter( item => item.type == 'monnaie' ) || [] );
return duplicate(this.items.filter( item => item.type == 'monnaie' ) || [] );
}
/* -------------------------------------------- */
async updateCompetence( name, field, value) {
let competence = this.data.items.find( item => item.type == 'competence' && item.name == name);
let competence = this.items.find( item => item.type == 'competence' && item.name == name);
if (competence) {
let dataPath = 'data.'+field;
let dataPath = 'system.'+field;
await this.updateEmbeddedDocuments( "Item", [{ _id: competence.id, [dataPath]:value }] );
}
}
@ -103,7 +103,7 @@ export class VadentisActor extends Actor {
async equiperObject( equipementId ) {
let item = this.items.get(equipementId)
if (item) {
let update = { _id: item.id, "data.equipee": !item.data.data.equipee };
let update = { _id: item.id, "system.equipee": !item.system.equipee };
await this.updateEmbeddedDocuments("Item", [ update ] );
}
}
@ -116,24 +116,24 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
calculerSommeStats( ) {
for (const key in this.data.data.combat) {
let combatData = this.data.data.combat[key];
for (const key in this.system.combat) {
let combatData = this.system.combat[key];
combatData.total = combatData.base + combatData.malus + combatData.bonus;
}
for (const key in this.data.data.magie) {
let magieData = this.data.data.magie[key];
for (const key in this.system.magie) {
let magieData = this.system.magie[key];
magieData.total = magieData.base + magieData.malus + magieData.bonus;
}
}
/* -------------------------------------------- */
async processSortDevotion( name, devotionSort ) {
if ( this.data.data.stats.pointsenergie.value == 0) { // Vérification du ~ de points d'énergie
if ( this.system.stats.pointsenergie.value == 0) { // Vérification du ~ de points d'énergie
ChatMessage.create({ content: `${this.name} n'a pas assez de Points d'Energie pour lancer ${name} ${devotionSort.name}` } );
return;
}
let scores = this.data.data.magie[(name =="devotion") ? 'devotion': 'matriseelementaire'];
let scores = this.system.magie[(name =="devotion") ? 'devotion': 'matriseelementaire'];
let statValue = scores.base + scores.malus + scores.bonus;
let formulaFull = this.buildTexteFormula( scores );
let myRoll = await VadentisUtility.processRoll("1d20+"+statValue );
@ -143,33 +143,33 @@ export class VadentisActor extends Actor {
isSort: true
}
if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= devotionSort.data.difficulty) {
if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= devotionSort.system.difficulty) {
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_sort_réussi.webp';
msgData.msg = `${this.name} a réussi son ${name} et perd ${devotionSort.data.pe} Points d'Energie (lancer : ${formulaFull} => <strong>${myRoll.total} / ${devotionSort.data.difficulty}</strong>).`;
msgData.msg = `${this.name} a réussi son ${name} et perd ${devotionSort.system.pe} Points d'Energie (lancer : ${formulaFull} => <strong>${myRoll.total} / ${devotionSort.system.difficulty}</strong>).`;
let maintain = (devotionSort.data.ismaintain)?"Oui":"Non";
let complex = (devotionSort.data.complexactions)?"Oui":"Non";
let maintain = (devotionSort.system.ismaintain)?"Oui":"Non";
let complex = (devotionSort.system.complexactions)?"Oui":"Non";
msgData.msg += `<br>Peut être maintenu: ${maintain}<br>Actions complexes : ${complex}`;
if ( !devotionSort.data.notes) devotionSort.data.notes = "";
msgData.msg += `<br><strong>Description : </strong>${devotionSort.data.notes.replace(/<\/?[^>]+(>|$)/g, "")}`;
if ( !devotionSort.system.notes) devotionSort.system.notes = "";
msgData.msg += `<br><strong>Description : </strong>${devotionSort.system.notes.replace(/<\/?[^>]+(>|$)/g, "")}`;
let newEnergie = this.data.data.stats.pointsenergie.value - devotionSort.data.pe;
await this.update( {'data.stats.pointsenergie.value': newEnergie });
if (myRoll.dice[0].results[0].result >= devotionSort.data.valuecritical ) { // Critique ?
let newEnergie = this.system.stats.pointsenergie.value - devotionSort.system.pe;
await this.update( {'system.stats.pointsenergie.value': newEnergie });
if (myRoll.dice[0].results[0].result >= devotionSort.system.valuecritical ) { // Critique ?
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_réussite_critique.webp';
msgData.msg += "<br>C'est une <strong>réussite critique</strong> !";
msgData.msg += `<br><strong>Effet critique : </strong>${devotionSort.data.criticaleffect.replace(/<\/?[^>]+(>|$)/g, "")}`;
msgData.msg += `<br><strong>Effet critique : </strong>${devotionSort.system.criticaleffect.replace(/<\/?[^>]+(>|$)/g, "")}`;
} else {
msgData.msg += `<br><strong>Effet : </strong>${devotionSort.data.effect.replace(/<\/?[^>]+(>|$)/g, "")}`;
msgData.msg += `<br><strong>Effet : </strong>${devotionSort.system.effect.replace(/<\/?[^>]+(>|$)/g, "")}`;
}
if ( devotionSort.data.damage != "") {
let formula = devotionSort.data.damage;
if (myRoll.dice[0].results[0].result >= devotionSort.data.valuecritical ) { // Critique ?
msgData.msg += `<br>Et provoque les dégats critiques suivants : [[/roll ${devotionSort.data.damagecritical}]]`;
formula = devotionSort.data.damagecritical;
if ( devotionSort.system.damage != "") {
let formula = devotionSort.system.damage;
if (myRoll.dice[0].results[0].result >= devotionSort.system.valuecritical ) { // Critique ?
msgData.msg += `<br>Et provoque les dégats critiques suivants : [[/roll ${devotionSort.system.damagecritical}]]`;
formula = devotionSort.system.damagecritical;
} else {
msgData.msg += `<br>Et provoque les dégats suivants : [[/roll ${devotionSort.data.damage}]]`;
msgData.msg += `<br>Et provoque les dégats suivants : [[/roll ${devotionSort.system.damage}]]`;
}
}
if ( newEnergie < 0) {
@ -184,7 +184,7 @@ export class VadentisActor extends Actor {
msgData.msg = `${this.name} a échoué son lancer de ${name}`;
}
}
console.log(devotionSort.data.description, msgData);
console.log(devotionSort.system.description, msgData);
ChatMessage.create({
//whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
content: await renderTemplate(`systems/foundryvtt-vadentis/templates/chat-generic-result.html`, msgData)
@ -193,7 +193,7 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollDamage( weapon, damageType ) {
let formula = VadentisUtility.processDamageString( weapon.data.data[damageType], this );
let formula = VadentisUtility.processDamageString( weapon.system.data[damageType], this );
let degatsRoll = await VadentisUtility.processRoll( formula );
let msgData = {
alias: this.name,
@ -209,7 +209,7 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollSortDevotionDamage( sort, damageType ) {
let formula = VadentisUtility.processDamageString( sort.data.data[damageType], this );
let formula = VadentisUtility.processDamageString( sort.system.data[damageType], this );
let degatsRoll = await VadentisUtility.processRoll( formula );
let msgData = {
alias: this.name,
@ -226,9 +226,9 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async applyDamage( damageValue ) {
let pvData = this.data.data.stats.pointsvie;
let pvData = this.system.stats.pointsvie;
let newValue = Math.max( pvData.value - damageValue, MIN_PV);
await this.update( {'data.stats.pointsvie.value': newValue });
await this.update( {'system.stats.pointsvie.value': newValue });
let msgData = {
alias: this.name,
@ -262,22 +262,22 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
getInitiativeScore( ) {
let initData = this.data.data.combat.initiative;
let initData = this.system.combat.initiative;
return this._getCombatValue( initData);
}
/* -------------------------------------------- */
getDefenseScore( ) {
let defenseData = this.data.data.combat.defense;
let defenseData = this.system.combat.defense;
return this._getCombatValue( defenseData);
}
/* -------------------------------------------- */
getForceScore( ) {
let forceData = this.data.data.combat.force;
let forceData = this.system.combat.force;
return this._getCombatValue( forceData);
}
/* -------------------------------------------- */
getAttaqueScore( ) {
let attaqueData = this.data.data.combat.attaque;
let attaqueData = this.system.combat.attaque;
return this._getCombatValue( attaqueData);
}
@ -289,7 +289,7 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollSort( sortId ) {
let sort = this.data.items.get( sortId );
let sort = this.items.get( sortId );
if ( sort ) {
sort = duplicate(sort)
this.processSortDevotion( "sort", sort);
@ -298,7 +298,7 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollDevotion( devotionId ) {
let devotion = this.data.items.get( devotionId );
let devotion = this.items.get( devotionId );
if ( devotion ) {
devotion = duplicate(devotion)
this.processSortDevotion( "devotion", devotion);
@ -307,14 +307,14 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
rollSortOuDevotion( sortId ) {
let sort = this.data.items.get( sortId );
let sort = this.items.get( sortId );
this.processSortDevotion( sort.type, sort);
}
/* -------------------------------------------- */
async rollTechnique( techniqueId ) {
let technique = this.data.items.get( techniqueId )
let technique = this.items.get( techniqueId )
if (technique) {
technique = duplicate(technique)
let msgData = {
@ -322,13 +322,13 @@ export class VadentisActor extends Actor {
img: technique.img,
title: `Technique ${technique.name}`
}
if ( this.data.data.stats.pointsadrenaline.value < technique.data.pacost) { // Vérification du ~ de points d'adrénaline
if ( this.system.stats.pointsadrenaline.value < technique.system.pacost) { // Vérification du ~ de points d'adrénaline
msgData.msg = `${this.name} n'a pas assez de Points d'Adrénaline pour éxecuter sa technique ${technique.name}`;
} else {
let newAdrenaline = this.data.data.stats.pointsadrenaline.value - technique.data.pacost;
await this.update( {'data.stats.pointsadrenaline.value': newAdrenaline });
msgData.msg = `${this.name} execute sa technique ${technique.name}, pour un côut de ${technique.data.pacost} Points d'Adrénaline<br>
Les effets sont : ${technique.data.effect}`;
let newAdrenaline = this.system.stats.pointsadrenaline.value - technique.system.pacost;
await this.update( {'system.stats.pointsadrenaline.value': newAdrenaline });
msgData.msg = `${this.name} execute sa technique ${technique.name}, pour un côut de ${technique.system.pacost} Points d'Adrénaline<br>
Les effets sont : ${technique.system.effect}`;
}
ChatMessage.create({
//whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
@ -342,7 +342,7 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollCompetence( competenceId ) {
console.log(competenceId)
let competence = this.data.items.get( competenceId);
let competence = this.items.get( competenceId);
if ( competence) {
competence = duplicate(competence)
let msgData = {
@ -352,7 +352,7 @@ export class VadentisActor extends Actor {
title: `Compétence ${competence.name}`
}
let statValue = competence.data.base + competence.data.malus + competence.data.bonus;
let statValue = competence.system.base + competence.system.malus + competence.system.bonus;
let formulaFull = this.buildTexteFormula( competence.data );
let myRoll = await VadentisUtility.processRoll("1d20+"+statValue, msgData.rollMode );
msgData.msg = `${formulaFull} => <strong>${myRoll.total}</strong>`;
@ -410,74 +410,74 @@ export class VadentisActor extends Actor {
/* -------------------------------------------- */
async rollCombat( combatName ) {
let stat = this.data.data.combat[combatName];
let stat = this.system.combat[combatName];
this.genericRoll( stat, combatName );
}
/* -------------------------------------------- */
rollMagie( magieName ) {
let stat = this.data.data.magie[magieName];
let stat = this.system.magie[magieName];
this.genericRoll( stat, magieName );
}
/* -------------------------------------------- */
async incrementeArgent( arme ) {
let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name);
let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name);
if (monnaie) {
monnaie = duplicate(monnaie)
let newValeur = monnaie.data.nombre + 1;
await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'data.nombre': newValeur }] );
let newValeur = monnaie.system.nombre + 1;
await this.updateEmbeddedDocuments( 'Item', [{ _id: monnaie._id, 'system.nombre': newValeur }] );
}
}
/* -------------------------------------------- */
async decrementeArgent( arme ) {
let monnaie = this.data.items.find( item => item.type == 'monnaie' && item.name == arme.name);
let monnaie = this.items.find( item => item.type == 'monnaie' && item.name == arme.name);
if (monnaie) {
monnaie = duplicate(monnaie)
let newValeur = monnaie.data.nombre - 1;
let newValeur = monnaie.system.nombre - 1;
newValeur = (newValeur <= 0) ? 0 : newValeur;
await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'data.nombre': newValeur }] );
await this.updateEmbeddedDocuments( "Item", [{ _id: monnaie._id, 'system.nombre': newValeur }] );
}
}
/* -------------------------------------------- */
async incrementeMunition( arme ) {
let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name);
let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name);
if (armeTir) {
armeTir = duplicate(armeTir)
let newMunition = armeTir.data.munition + 1;
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition }] );
let newMunition = armeTir.system.munition + 1;
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition }] );
}
}
/* -------------------------------------------- */
async decrementeMunition( arme ) {
let armeTir = this.data.items.find( item => item.type == 'tir' && item.name == arme.name);
let armeTir = this.items.find( item => item.type == 'tir' && item.name == arme.name);
if (armeTir) {
armeTir = duplicate(armeTir)
let newMunition = armeTir.data.munition - 1;
let newMunition = armeTir.system.munition - 1;
newMunition = (newMunition <= 0) ? 0 : newMunition;
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'data.munition': newMunition } ]);
await this.updateEmbeddedDocuments( "Item", [{ _id: armeTir._id, 'system.munition': newMunition } ]);
}
}
/* -------------------------------------------- */
async incrementeQuantite( objet ) {
let objetQ = this.data.items.find( item => item._id == objet._id );
let objetQ = this.items.find( item => item._id == objet._id );
if (objetQ) {
objetQ = duplicate(objetQ)
let newQ = objetQ.data.quantite + 1;
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ] );
let newQ = objetQ.system.quantite + 1;
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ] );
}
}
/* -------------------------------------------- */
async decrementeQuantite( objet ) {
let objetQ = this.data.items.find( item => item._id == objet._id );
let objetQ = this.items.find( item => item._id == objet._id );
if (objetQ) {
objetQ = duplicate(objetQ)
let newQ = objetQ.data.quantite - 1;
let newQ = objetQ.system.quantite - 1;
newQ = (newQ <= 0) ? 0 : newQ;
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'data.quantite': newQ } ]);
await this.updateEmbeddedDocuments( "Item", [{ _id: objetQ._id, 'system.quantite': newQ } ]);
}
}
@ -486,10 +486,10 @@ export class VadentisActor extends Actor {
let target = VadentisUtility.getTarget();
if ( target ) {
let arme = this.data.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item.id == armeId);
let arme = this.items.find( item => (item.type == 'armecc' || item.type == 'tir') && item.id == armeId);
if (arme) {
arme = duplicate(arme)
if ( arme.type == 'tir' && arme.data.munition <= 0 ) {
if ( arme.type == 'tir' && arme.system.munition <= 0 ) {
ui.notifications.warn("Vous n'avez plus de munitions avec cette arme.");
return;
}

View File

@ -8,7 +8,7 @@ export class VadentisCombat extends Combat {
console.log("Initiative is requested !!!");
ids = typeof ids === "string" ? [ids] : ids;
const currentId = this.combatant._id;
//const currentId = this.combatant.id;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]);
let initBonus = c.actor ? c.actor.getInitiativeScore() : 0;

View File

@ -22,24 +22,24 @@ export class VadentisTokenHud {
let token = canvas.tokens.get(tokenId);
let actor = token.actor;
let combatant = game.combat.data.combatants.find(c => c.tokenId == token.data._id);
//let combatant = game.combat.combatants.find(c => c.tokenId == token._id);
app.hasExtension = true;
let armesList = combatant.actor.getArmes() ;
let sortsList = combatant.actor.getSorts().concat( combatant.actor.getDevotions() );
const hudData = { combatant: combatant, armes: armesList, sorts: sortsList }
let armesList = actor.getArmes() ;
let sortsList = actor.getSorts().concat( actor.getDevotions() );
const hudData = { actor: actor, armes: armesList, sorts: sortsList }
// sort
await VadentisTokenHud._configureSubMenu(html.find('.control-icon.combat'), 'systems/foundryvtt-vadentis/templates/hud-actor-sort.html', hudData,
await VadentisTokenHud._configureSubMenu(html.find('.control-icon[data-action=combat]'), 'systems/foundryvtt-vadentis/templates/hud-actor-sort.html', hudData,
(event) => {
let combatantId = event.currentTarget.attributes['data-combatant-id'].value;
const combatant = game.combat.getCombatant(combatantId);
let actorId = event.currentTarget.attributes['data-actor-id'].value;
const actor = game.actors.get(actorId);
let sortId = event.currentTarget.attributes['data-sort-id'].value;
combatant.actor.rollSortOuDevotion( sortId );
actor.rollSortOuDevotion( sortId );
});
// combat
await VadentisTokenHud._configureSubMenu(html.find('.control-icon.target'), 'systems/foundryvtt-vadentis/templates/hud-actor-attaque.html', hudData,
await VadentisTokenHud._configureSubMenu(html.find('.control-icon[data-action=target]'), 'systems/foundryvtt-vadentis/templates/hud-actor-attaque.html', hudData,
(event) => {
let armeId = event.currentTarget.attributes['data-arme-id'].value;
actor.rollArme(armeId);
@ -49,7 +49,7 @@ export class VadentisTokenHud {
/* -------------------------------------------- */
static async addTokenHudExtensions(app, html, tokenId) {
html.find('.control-icon.combat').click(event => {
html.find('.control-icon[data-action=combat]').click(event => {
if ( event.currentTarget.className.includes('active')) {
VadentisTokenHud.removeExtensionHud( app, html, tokenId);
} else {
@ -57,9 +57,9 @@ export class VadentisTokenHud {
}
} );
let combatIcon = html.find('.control-icon.combat');
let combatIcon = html.find('.control-icon[data-action=combat]');
//console.log("COMBAT ICON", combatIcon)
if ( combatIcon[0] && combatIcon[0].className.includes('active') ) {
if ( combatIcon[0]?.className.includes('active') ) {
VadentisTokenHud.addExtensionHud( app, html, tokenId);
}
}

View File

@ -43,27 +43,38 @@ export class VadentisItemSheet extends ItemSheet {
/* -------------------------------------------- */
async getData() {
const objectData = VadentisUtility.data(this.object);
let itemData = foundry.utils.deepClone(VadentisUtility.templateData(this.object));
let itemData = foundry.utils.deepClone(this.object.system);
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
type: this.object.type,
img: this.object.img,
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: itemData,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
isGM: game.user.isGM
isGM: game.user.isGM,
}
if (objectData.type == 'sort') {
if (itemData.description) {
formData.description = await TextEditor.enrichHTML(this.object.system.description, { async: true })
}
if (itemData.notes) {
formData.notes = await TextEditor.enrichHTML(this.object.system.notes, { async: true })
}
if (itemData.effect) {
formData.effect = await TextEditor.enrichHTML(this.object.system.effect, { async: true })
}
if (itemData.criticaleffect) {
formData.criticaleffect = await TextEditor.enrichHTML(this.object.system.criticaleffect, { async: true })
}
if (this.object.type == 'sort') {
formData.donnees = await VadentisUtility.getDonnees();
}
if (objectData.type == 'devotion') {
if (this.object.type == 'devotion') {
formData.eglises = await VadentisUtility.getEglises();
}

View File

@ -19,9 +19,9 @@ export class VadentisUtility {
/* -------------------------------------------- */
static updateCombat( combat, round, diff, id ) {
if (game.user.isGM && combat.data.round != 0 && combat.turns && combat.data.active) {
if (game.user.isGM && combat.round != 0 && combat.turns && combat.active) {
let turn = combat.turns.find(t => t.tokenId == combat.current.tokenId);
ChatMessage.create( { content: `Round ${combat.data.round} : C'est au tour de ${turn.actor.name}<br>` } );
ChatMessage.create( { content: `Round ${combat.round} : C'est au tour de ${turn.actor.name}<br>` } );
canvas.tokens.get(turn.token._id).control();
canvas.tokens.cycleTokens(1, true);
@ -46,6 +46,14 @@ export class VadentisUtility {
return options;
}
/* -------------------------------------------- */
static createDirectIntegerOptionList( min, max) {
let options = {};
for(let i=min; i<=max; i++) {
options[i] = `${i}`;
}
return options;
}
/* -------------------------------------------- */
static createDirectReverseOptionList( min, max) {
let options = {};
for(let i=max; i>=min; i--) {
@ -64,19 +72,6 @@ export class VadentisUtility {
return undefined;
}
/* -------------------------------------------- */
static templateData(it) {
return VadentisUtility.data(it)?.data ?? {}
}
/* -------------------------------------------- */
static data(it) {
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
return it.data;
}
return it;
}
/* -------------------------------------------- */
static processDamageString( formula, actor ) {
let workFormula = formula.toLowerCase();
@ -90,7 +85,7 @@ export class VadentisUtility {
static async processRoll( formula, rollMode ) {
let myRoll = new Roll(formula);
myRoll.roll( { async: false} );
if (game.modules.get("dice-so-nice") && game.modules.get("dice-so-nice").active) {
if (game.modules.get("dice-so-nice")?.active) {
await game.dice3d.showForRoll(myRoll, game.user, true);
}
return myRoll;
@ -117,17 +112,17 @@ export class VadentisUtility {
}
let formulaTouche = "1d20+"+attaque;
let formulaFull = attacker.buildTexteFormula( attacker.data.data.combat.attaque );
let formulaFull = attacker.buildTexteFormula( attacker.system.combat.attaque );
let myRoll = await this.processRoll(formulaTouche);
if (myRoll.dice[0].results[0].result > 1 && myRoll.total >= defense) { // Success !
let degats = `normaux : ${combatData.arme.data.damage}`;
let formula = combatData.arme.data.damage.toLowerCase();
let degats = `normaux : ${combatData.arme.system.damage}`;
let formula = combatData.arme.system.damage.toLowerCase();
msgData.msg = `${attacker.name} a réussi son attaque sur ${defender.name} (${formulaFull} => ${myRoll.total} / ${defense}) !<br> Les dégâts sont ${degats}.`;
msgData.msg += tirMsg;
if ( myRoll.dice[0].results[0].result >= combatData.arme.data.valuecritical ) {
degats = `critiques : ${combatData.arme.data.criticaldamage}`;
formula = combatData.arme.data.criticaldamage.toLowerCase();
if ( myRoll.dice[0].results[0].result >= combatData.arme.system.valuecritical ) {
degats = `critiques : ${combatData.arme.system.criticaldamage}`;
formula = combatData.arme.system.criticaldamage.toLowerCase();
msgData.msg += `<br>C'est une <strong>réussite critique</strong> !`;
}
msgData.img = 'systems/foundryvtt-vadentis/images/icons/tchat_attaque_réussie.webp'

View File

@ -398,19 +398,19 @@ table {border: 1px solid #7a7971;}
/* ======================================== */
/* Sheet */
.window-app.sheet .window-content .sheet-header{
background: #011d33 url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat left top;
/*background: #011d33 url("../images/ui/texture_feuille_perso_onglets.webp") no-repeat left top;*/
color: rgba(255, 255, 255, 1);
}
.window-app.sheet .window-content .sheet-header input[type="text"], .window-app.sheet .window-content .sheet-header input[type="number"], .window-app.sheet .window-content .sheet-header input[type="password"], .window-app.sheet .window-content .sheet-header input[type="date"], .window-app.sheet .window-content .sheet-header input[type="time"] {
color: rgba(255, 255, 255, 0.75);
/*color: rgba(255, 255, 255, 0.75);*/
background: rgba(255, 255, 255, 0.05);
border: 0 none;
margin-bottom: 0.25rem;
}
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
background: rgb(245,245,240) url("../images/ui/texture_feuille_perso_principale.webp") no-repeat left top;
/*background: rgb(245,245,240) url("../images/ui/texture_feuille_perso_principale.webp") no-repeat left top;*/
}
section.sheet-body{padding: 0.25rem 0.5rem;}
@ -431,7 +431,8 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
padding: 0 0 0 0.25rem;
text-align: center;
text-transform: uppercase;
line-height: 2.5rem;
line-height: 1.5rem;
max-height: 2.0rem;
border-top: 0 none;
border-bottom: 0 none;
color: rgba(52, 52, 52, 0.95);
@ -895,7 +896,7 @@ ul, li {
border-radius: 0;
background: rgba(30, 25, 20, 1);
background-origin: padding-box;
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
}
@ -903,7 +904,7 @@ ul, li {
#controls .scene-control.active, #controls .control-tool.active, #controls .scene-control:hover, #controls .control-tool:hover {
background: rgba(72, 46, 28, 1);
background-origin: padding-box;
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
box-shadow: 0 0 3px #ff6400;
@ -915,7 +916,7 @@ ul, li {
}
#hotbar #action-bar .macro {
border-image: url(img/ui/bg_control.jpg) 21 repeat;
/*border-image: url(img/ui/bg_control.jpg) 21 repeat;*/
border-image-slice: 6 6 6 6 fill;
border-image-width: 6px 6px 6px 6px;
border-image-outset: 0px 0px 0px 0px;
@ -928,7 +929,7 @@ ul, li {
}
#players {
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
background: rgba(30, 25, 20, 1);
@ -941,7 +942,7 @@ ul, li {
#navigation #scene-list .scene.nav-item {
background: rgba(30, 25, 20, 1);
background-origin: padding-box;
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
}
@ -949,7 +950,7 @@ ul, li {
#navigation #scene-list .scene.view, #navigation #scene-list .scene.context {
background: rgba(72, 46, 28, 1);
background-origin: padding-box;
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
box-shadow: 0 0 3px #ff6400;
@ -958,7 +959,7 @@ ul, li {
#navigation #nav-toggle {
background: rgba(30, 25, 20, 1);
background-origin: padding-box;
border-image: url(img/ui/footer-button.png) 10 repeat;
/*border-image: url(img/ui/footer-button.png) 10 repeat;*/
border-image-width: 4px;
border-image-outset: 0px;
}
@ -987,9 +988,8 @@ ul, li {
.tooltip .ttt-fatigue{
width: 360px;
background: rgba(30, 25, 20, 0.9);
border-image: url(img/ui/bg_control.jpg) 21 repeat;
/*border-image: url(img/ui/bg_control.jpg) 21 repeat;*/
border-image-slice: 6 6 6 6 fill;
border-image-width: 6px 6px 6px 6px;
border-image-outset: 0px 0px 0px 0px;
@ -1075,6 +1075,17 @@ ul, li {
font-weight: bold;
}
.field-medium {
width: 8rem;
max-width: 8rem;
}
.item-filler {
flex-grow: 2;
flex-shrink: 3;
}
/*************************************************************/
#pause
{

View File

@ -1,16 +1,21 @@
{
"name": "foundryvtt-vadentis",
"id": "foundryvtt-vadentis",
"title": "Vadentis",
"description": "Système Vadentis pour FoundryVTT",
"version": "0.3.2",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.8.9",
"compatibleCoreVersion": "9",
"templateVersion": 17,
"author": "Uberwald",
"version": "11.0.0",
"compatibility": {
"minimum": "11",
"verified": "12"
},
"authors": [
{
"name": "Uberwald",
"flags": {}
}
],
"esmodules": [ "modules/vadentis-main.js" ],
"styles": ["styles/simple.css"],
"background" : "images/ui/vadentis_map.webp",
"background" : "systems/foundryvtt-vadentis/images/ui/vadentis_map.webp",
"media": [
],
"packs": [
@ -20,7 +25,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/eglises.db",
"entity": "Item",
"type": "Item",
"tags" : [ "eglise" ]
},
{
@ -29,7 +34,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/donnees.db",
"entity": "Item",
"type": "Item",
"tags" : [ "données", "donnee" ]
},
{
@ -38,7 +43,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/techniques.db",
"entity": "Item",
"type": "Item",
"tags" : [ "technique" ]
},
{
@ -47,7 +52,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/attributs.db",
"entity": "Item",
"type": "Item",
"tags" : [ "attribut" ]
},
{
@ -56,7 +61,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/competences.db",
"entity": "Item",
"type": "Item",
"tags" : [ "competence" ]
},
{
@ -65,7 +70,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/equipement-armes-de-corps-a-corps.db",
"entity": "Item",
"type": "Item",
"tags" : [ "armes", "corps à corps", "mêlée" ]
},
{
@ -74,7 +79,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/equipement-armes-de-tirs.db",
"entity": "Item",
"type": "Item",
"tags" : [ "armes", "tir" ]
},
{
@ -83,7 +88,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/equipement-armures.db",
"entity": "Item",
"type": "Item",
"tags" : [ "armure" ]
},
{
@ -92,7 +97,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/equipement-boucliers.db",
"entity": "Item",
"type": "Item",
"tags" : [ "bouclier" ]
},
{
@ -101,7 +106,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/equipement-materiel.db",
"entity": "Item",
"type": "Item",
"tags" : [ "materiel", "equipement" ]
},
{
@ -110,7 +115,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-deglises-eglise-des-26.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eglise des 26", "26" ]
},
{
@ -119,7 +124,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-deglises-eglise-des-ombres.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eglise des ombres", "ombres" ]
},
{
@ -128,7 +133,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-deglises-eglise-du-soleil.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eglise du soleil", "soleil" ]
},
{
@ -137,7 +142,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-deglises-eglise-du-temps.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eglise du temps", "temps" ]
},
{
@ -146,7 +151,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-deglises-eglise-estuanienne.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eglise estuanienne", "estuanienne" ]
},
{
@ -155,7 +160,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-de-la-foudre.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "foudre" ]
},
{
@ -164,7 +169,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-de-la-lumiere.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "lumiere" ]
},
{
@ -173,7 +178,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-de-la-terre.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "terre" ]
},
{
@ -182,7 +187,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-de-leau.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "eau" ]
},
{
@ -191,7 +196,7 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-du-feu.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "feu" ]
},
{
@ -200,11 +205,10 @@
"system": "foundryvtt-vadentis",
"module": "foundryvtt-vadentis",
"path": "./packs/sorts-elementaires-donnee-du-vent.db",
"entity": "Item",
"type": "Item",
"tags" : [ "sort", "vent" ]
}
],
"library": false,
"languages": [
{
"lang": "fr",

View File

@ -52,11 +52,11 @@
"bonus": 0,
"label": "Défense"
},
"esquive": {
"vitesse": {
"base": 0,
"malus": 0,
"bonus": 0,
"label": "Esquive"
"label": "Vitesse"
}
},
"magie": {

View File

@ -71,12 +71,12 @@
<li class="stat flexrow list-item" data-attribute="pointsvie">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_PV.webp"/>
<span class="stat-label flexrow tooltip tooltip-nobottom">Points de Vie</span>
<select class="stat-value flexrow" type="text" name="data.stats.pointsvie.value" value="{{data.stats.pointsvie.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsvie.value" value="{{data.stats.pointsvie.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsvie.value}}
{{{@root.optionsPV}}}
{{/select}}
</select>
<select class="stat-value flexrow" type="text" name="data.stats.pointsvie.max" value="{{data.stats.pointsvie.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsvie.max" value="{{data.stats.pointsvie.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsvie.max}}
{{{@root.optionsPV}}}
{{/select}}
@ -85,12 +85,12 @@
<li class="stat flexrow list-item" data-attribute="pointsenergie">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_PE.webp"/>
<span class="stat-label flexrow tooltip tooltip-nobottom">Points d'Energie</span>
<select class="stat-value flexrow" type="text" name="data.stats.pointsenergie.value" value="{{stats.pointsenergie.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsenergie.value" value="{{stats.pointsenergie.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsenergie.value}}
{{{@root.optionsPE}}}
{{/select}}
</select>
<select class="stat-value flexrow" type="text" name="data.stats.pointsenergie.max" value="{{data.stats.pointsenergie.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsenergie.max" value="{{data.stats.pointsenergie.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsenergie.max}}
{{{@root.optionsPE}}}
{{/select}}
@ -99,12 +99,12 @@
<li class="stat flexrow list-item" data-attribute="pointsadrenaline">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_PA.webp"/>
<span class="stat-label flexrow tooltip tooltip-nobottom">Points d'Adrénaline</span>
<select class="stat-value flexrow" type="text" name="data.stats.pointsadrenaline.value" value="{{data.stats.pointsadrenaline.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsadrenaline.value" value="{{data.stats.pointsadrenaline.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsadrenaline.value}}
{{{@root.optionsPA}}}
{{/select}}
</select>
<select class="stat-value flexrow" type="text" name="data.stats.pointsadrenaline.max" value="{{data.stats.pointsadrenaline.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.stats.pointsadrenaline.max" value="{{data.stats.pointsadrenaline.max}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{#select data.stats.pointsadrenaline.max}}
{{{@root.optionsPA}}}
{{/select}}
@ -116,7 +116,7 @@
<li class="stat flexrow list-item" data-attribute="experience">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_experience.webp"/>
<span class="stat-label flexrow tooltip tooltip-nobottom">Expérience</span>
<input type="text" name="data.experience.experience.total" value="{{data.experience.experience.total}}" data-dtype="Number"/>
<input type="text" name="system.experience.experience.total" value="{{data.experience.experience.total}}" data-dtype="Number"/>
</li>
</ul>
</div>
@ -131,20 +131,24 @@
<span class="flexrow tooltip tooltip-nobottom" name="statlabel">Score</span>
</li>
{{#each data.combat as |mycombat key|}}
{{#if (eq mycombat.label "Esquive")}}
{{else}}
<li class="stat flexrow list-item" data-attribute="{{key}}">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_{{key}}.webp"/>
<span class="stat-label combat-label flexrow tooltip tooltip-nobottom" name="data.combat.{{key}}.label"><a name="{{key}}">{{mycombat.label}}</a></span>
<select class="stat-value flexrow" type="text" name="data.combat.{{key}}.base" value="{{mycombat.base}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<span class="stat-label combat-label flexrow tooltip tooltip-nobottom" name="system.combat.{{key}}.label"><a name="{{key}}">{{mycombat.label}}</a></span>
<select class="stat-value flexrow" type="text" name="system.combat.{{key}}.base" value="{{mycombat.base}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBase selected=mycombat.base localize=false}}
</select>
<select class="stat-value flexrow" type="text" name="data.combat.{{key}}.malus" value="{{mycombat.malus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.combat.{{key}}.malus" value="{{mycombat.malus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsMalus selected=mycombat.malus localize=false}}
</select>
<select class="stat-value flexrow" type="text" name="data.combat.{{key}}.bonus" value="{{mycombat.bonus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.combat.{{key}}.bonus" value="{{mycombat.bonus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBonus selected=mycombat.bonus localize=false}}
</select>
<span class="score-label combat-label "><a name="{{key}}">&nbsp;1d20 + {{mycombat.total}}</a></span>
</li>
{{/if}}
{{/each}}
</ul>
<hr><span class="generic-label"><h3>Magie</h3></span>
@ -159,14 +163,14 @@
{{#each data.magie as |mymagie key|}}
<li class="stat flexrow list-item" data-attribute="{{key}}">
<img class="sheet-competence-img" src="systems/foundryvtt-vadentis/images/icons/feuille_perso_{{key}}.webp"/>
<span class="stat-label magie-label flexrow tooltip tooltip-nobottom" name="data.magie.{{key}}.label"><a name="{{key}}">{{mymagie.label}}</a></span>
<select class="stat-value flexrow" type="text" name="data.magie.{{key}}.base" value="{{mymagie.base}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<span class="stat-label magie-label flexrow tooltip tooltip-nobottom" name="system.magie.{{key}}.label"><a name="{{key}}">{{mymagie.label}}</a></span>
<select class="stat-value flexrow" type="text" name="system.magie.{{key}}.base" value="{{mymagie.base}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBase selected=mymagie.base localize=false}}
</select>
<select class="stat-value flexrow" type="text" name="data.magie.{{key}}.malus" value="{{mymagie.malus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.magie.{{key}}.malus" value="{{mymagie.malus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsMalus selected=mymagie.malus localize=false}}
</select>
<select class="stat-value flexrow" type="text" name="data.magie.{{key}}.bonus" value="{{mymagie.bonus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
<select class="stat-value flexrow" type="text" name="system.magie.{{key}}.bonus" value="{{mymagie.bonus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBonus selected=mymagie.bonus localize=false}}
</select>
<span class="score-label magie-label"><a name="{{key}}">&nbsp;1d20 + {{mymagie.total}}</a></span>
@ -192,7 +196,6 @@
<li class="item flexrow">
<span class=""></span>
<span class="generic-label">Compétence</span>
<span class="generic-label">Rôle?</span>
<span class="generic-label">Base</span>
<span class="generic-label">Malus</span>
<span class="generic-label">Bonus</span>
@ -202,15 +205,14 @@
<li class="item flexrow list-item" data-item-id="{{competence._id}}">
<img class="sheet-competence-img" src="{{competence.img}}"/>
<span class="competence-label"><a>{{competence.name}}</a></span>
<span>{{#if competence.data.competencerole}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</span>
<select class="competence-base flexrow" type="text" skillname="{{competence.name}}" value="{{competence.data.base}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBase selected=competence.data.base localize=false}}
{{selectOptions @root.optionsBase selected=competence.system.base localize=false}}
</select>
<select class="competence-malus flexrow" type="text" skillname="{{competence.name}}" value="{{competence.data.malus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsMalus selected=competence.data.malus localize=false}}
{{selectOptions @root.optionsMalus selected=competence.system.malus localize=false}}
</select>
<select class="competence-bonus flexrow" type="text" skillname="{{competence.name}}" value="{{competence.data.bonus}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
{{selectOptions @root.optionsBonus selected=competence.data.bonus localize=false}}
{{selectOptions @root.optionsBonus selected=competence.system.bonus localize=false}}
</select>
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
@ -265,7 +267,7 @@
</li>
{{#each data.combat as |mycombat key|}}
<li class="stat flexrow list-item" data-attribute="{{key}}">
<span class="stat-label combat-label flexrow tooltip tooltip-nobottom" name="data.combat.{{key}}.label"><a name="{{key}}">{{mycombat.label}}</a></span>
<span class="stat-label combat-label flexrow tooltip tooltip-nobottom" name="system.combat.{{key}}.label"><a name="{{key}}">{{mycombat.label}}</a></span>
<span class="stat-label combat-label">&nbsp;{{mycombat.base}}</span>
<span class="stat-label combat-label">&nbsp;{{mycombat.malus}}</span>
<span class="stat-label combat-label">&nbsp;{{mycombat.bonus}}</span>
@ -276,11 +278,11 @@
<div><h4>Armes équipées</h4></div>
<ul class="item-list alternate-list">
{{#each armes as |arme key|}}
{{#if arme.data.equipee}}
{{#if arme.system.equipee}}
<li class="item flexrow list-item" data-item-id="{{arme._id}}">
<img class="sheet-competence-img" src="{{arme.img}}"/>
<span class="arme-label"><a>{{arme.name}} {{#if (eq arme.type "tir")}}({{arme.data.munition}}){{/if}}</a></span>
<span class="generic-label"><a class="weapon-damage">{{arme.data.damage}}</a> / <a class="weapon-damage-critical">{{arme.data.criticaldamage}}</a></span>
<span class="arme-label"><a>{{arme.name}} {{#if (eq arme.type "tir")}}({{arme.system.munition}}){{/if}}</a></span>
<span class="generic-label"><a class="weapon-damage">{{arme.system.damage}}</a> / <a class="weapon-damage-critical">{{arme.system.criticaldamage}}</a></span>
</li>
{{/if}}
{{/each}}
@ -298,8 +300,8 @@
<li class="item flexrow list-item" data-item-id="{{sort._id}}">
<img class="sheet-competence-img" src="{{sort.img}}"/>
<span class="sort-label"><a>{{sort.name}}</a></span>
<span class="sort-difficulty"><a>{{sort.data.difficulty}}</a></span>
<span class="generic-label"><a class="sort-damage">{{sort.data.damage}}</a> / <a class="sort-damage-critical">{{sort.data.damagecritical}}</a></span>
<span class="sort-difficulty"><a>{{sort.system.difficulty}}</a></span>
<span class="generic-label"><a class="sort-damage">{{sort.system.damage}}</a> / <a class="sort-damage-critical">{{sort.system.damagecritical}}</a></span>
<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>
@ -314,8 +316,8 @@
<li class="item flexrow list-item" data-item-id="{{devotion._id}}">
<img class="sheet-competence-img" src="{{devotion.img}}"/>
<span class="devotion-label"><a>{{devotion.name}}</a></span>
<span class="sort-difficulty"><a>{{devotion.data.difficulty}}</a></span>
<span class="generic-label"><a class="sort-damage">{{devotion.data.damage}}</a> / <a class="sort-damage-critical">{{devotion.data.damagecritical}}</a></span>
<span class="sort-difficulty"><a>{{devotion.system.difficulty}}</a></span>
<span class="generic-label"><a class="sort-damage">{{devotion.system.damage}}</a> / <a class="sort-damage-critical">{{devotion.system.damagecritical}}</a></span>
<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>
@ -329,16 +331,17 @@
{{!-- Equipement Tab --}}
<div class="tab equipement" data-group="primary" data-tab="equipement">
<div><h4>Argent</h4></div>
<div><h3>Argent</h3></div>
<ul class="item-list alternate-list">
{{#each monnaies as |monnaie key|}}
<li class="item flexrow list-item" data-item-id="{{monnaie._id}}">
<img class="sheet-competence-img" src="{{monnaie.img}}"/>
<span class="generic-label">{{monnaie.name}}</span>
<span class="generic-label">{{monnaie.data.nombre}}
<span class="generic-label">{{monnaie.system.nombre}}
(<a class="argent-moins plus-moins-button"> -</a>/<a class="argent-plus plus-moins-button">+</a>)
</span>
</span>
<div class="item-filler">&nbsp;</div>
<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>
@ -346,51 +349,56 @@
</li>
{{/each}}
</ul>
<div><h4>Armes</h4></div>
<div><h3>Armes</h3></div>
<ul class="item-list alternate-list">
{{#each armes as |arme key|}}
<li class="item flexrow list-item" data-item-id="{{arme._id}}">
<img class="sheet-competence-img" src="{{arme.img}}"/>
<span class="arme-label"><a>{{arme.name}}</a></span>
<span class="">
{{#if (eq arme.type "tir")}}({{arme.data.munition}}
<span class="field-medium">
{{#if (eq arme.type "tir")}}({{arme.system.munition}}
<a class="munition-moins plus-moins-button">-</a>/<a class="munition-plus plus-moins-button">+</a>)
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls">
<a class="item-control item-equip" title="Equipé">{{#if arme.data.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-equip" title="Equipé">{{#if arme.system.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<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>
</div>
</li>
{{/each}}
</ul>
<div><h4>Armures</h4></div>
<div><h3>Armures</h3></div>
<ul class="item-list alternate-list">
{{#each armures as |armure key|}}
<li class="item flexrow list-item" data-item-id="{{armure._id}}">
<img class="sheet-competence-img" src="{{armure.img}}"/>
<span class="armure-label">{{armure.name}}</span>
<span class="field-medium">
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls">
<a class="item-control item-equip" title="Equipé">{{#if armure.data.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-equip" title="Equipé">{{#if armure.system.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<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>
</div>
</li>
{{/each}}
</ul>
<div><h4>Equipement</h4></div>
<div><h3>Equipement</h3></div>
<ul class="item-list alternate-list">
{{#each equipements as |equipement key|}}
<li class="item flexrow list-item" data-item-id="{{equipement._id}}">
<img class="sheet-competence-img" src="{{equipement.img}}"/>
<span class="equipement-label">{{equipement.name}}</span>
<span class="equipement-label">{{equipement.data.quantite}}</span>
<span class="equipement-label">
(<a class="equipement-moins plus-moins-button">-</a>/<a class="equipement-plus plus-moins-button">+</a>)
<span class="field-medium">
( <span class="equipement-label">{{equipement.system.quantite}}</span>
<a class="equipement-moins plus-moins-button">-</a>/<a class="equipement-plus plus-moins-button">+</a>)
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls">
<a class="item-control item-equip" title="Worn">{{#if equipement.data.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-equip" title="Worn">{{#if equipement.system.equipee}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<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>
</div>
@ -412,12 +420,12 @@
<hr>
<h3>Biography : </h3>
<div class="form-group editor">
{{editor content=data.history target="data.history" button=true owner=owner editable=editable}}
{{editor history target="system.history" button=true owner=owner editable=editable}}
</div>
<hr>
<h3>Notes : </h3>
<div class="form-group editor">
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
<hr>
{{>"systems/foundryvtt-vadentis/templates/editor-notes-gm.html"}}

View File

@ -1,6 +1,6 @@
{{#if data.isGM}}
<h3>GM Notes : </h3>
<div class="form-group editor">
{{editor content=data.gmnotes target="data.gmnotes" button=true owner=owner editable=editable}}
{{editor gmnotes target="system.gmnotes" button=true owner=owner editable=editable}}
</div>
{{/if}}

View File

@ -2,8 +2,8 @@
<img class="vadentis-hud-togglebutton" src="systems/foundryvtt-vadentis/images/icons/icone_item_armes_cac.webp" width="36" height="36" title="Attaque"/>
<div class="vadentis-hud-list tokenhudext left">
{{#each armes as |arme key|}}
{{#if arme.data.equipee}}
<div class="control-icon tokenhudicon vadentis-hud-menu vadentis-attaque" data-combatant-id="{{../combatant._id}}" data-arme-id="{{arme._id}}" title="{{arme.name}}">
{{#if arme.system.equipee}}
<div class="control-icon tokenhudicon vadentis-hud-menu vadentis-attaque" data-actor-id="{{../actor._id}}" data-arme-id="{{arme._id}}" title="{{arme.name}}">
<label>C:{{arme.name}}</label>
</div>
{{/if}}

View File

@ -2,7 +2,7 @@
<img class="vadentis-hud-togglebutton" src="systems/foundryvtt-vadentis/images/icons/icone_item_sorts_élémentaires.webp" width="36" height="36" title="Sorts"/>
<div class="vadentis-hud-list tokenhudext right">
{{#each sorts as |sort key|}}
<div class="control-icon tokenhudicon vadentis-hud-menu vadentis-attaque" data-combatant-id="{{../combatant._id}}" data-sort-id="{{sort._id}}" title="{{sort.name}}">
<div class="control-icon tokenhudicon vadentis-hud-menu vadentis-attaque" data-actor-id="{{../actor._id}}" data-sort-id="{{sort._id}}" title="{{sort.name}}">
<label>S:{{sort.name}}</label>
</div>
{{/each}}

View File

@ -12,7 +12,7 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="data.type" value="{{data.type}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.type" value="{{data.type}}" data-dtype="String">
{{#select data.type}}
<option value="legere">Légères</option>
<option value="unemain">A une main</option>
@ -20,16 +20,17 @@
{{/select}}
</select>
</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">Quantité</label><input type="text" name="data.quantite" value="{{data.quantite}}" 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>
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="system.damage" value="{{data.damage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts critique</label><input type="text" name="system.criticaldamage" value="{{data.criticaldamage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="system.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Quantité</label><input type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="system.cost" value="{{data.cost}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Valeur de critique</label>
<input type="text" name="data.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
<input type="text" name="system.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -12,7 +12,7 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="data.type" value="{{data.type}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.type" value="{{data.type}}" data-dtype="String">
{{#select data.type}}
<option value="legere">Légères</option>
<option value="intermediaire">Intermédiaire</option>
@ -21,14 +21,15 @@
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Bonus</label><input type="text" name="data.bonus" value="{{data.bonus}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Malus</label><input type="text" name="data.malus" value="{{data.malus}}" 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">Quantité</label><input type="text" name="data.quantite" value="{{data.quantite}}" 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>
<li class="flexrow"><label class="generic-label">Bonus</label><input type="text" name="system.bonus" value="{{data.bonus}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Malus</label><input type="text" name="system.malus" value="{{data.malus}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="system.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Quantité</label><input type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="system.cost" value="{{data.cost}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -11,11 +11,13 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<label class="generic-label">Effets</label>
{{editor content=data.effect target="data.effect" button=true owner=owner editable=editable}}
<label class="generic-label">Notes</label>
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<hr>
<h4 class="generic-label">Effets</h4>
{{editor effect target="system.effect" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Notes</h4>
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -11,16 +11,15 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Base</label><input type="text" name="data.base" value="{{data.base}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Malus</label><input type="text" name="data.malus" value="{{data.malus}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Bonus</label><input type="text" name="data.bonus" value="{{data.bonus}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Compétence de rôle</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.competencerole" {{checked data.competencerole}}/></label>
</li>
<li class="flexrow"><label class="generic-label">Base</label><input type="text" name="system.base" value="{{data.base}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Malus</label><input type="text" name="system.malus" value="{{data.malus}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Bonus</label><input type="text" name="system.bonus" value="{{data.bonus}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -12,7 +12,7 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Eglise</label>
<select class="competence-base flexrow" type="text" name="data.eglise" value="{{data.eglise}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.eglise" value="{{data.eglise}}" data-dtype="String">
{{#select data.eglise}}
{{#each @root.eglises as |eglise key|}}
<option value="{{eglise.name}}">{{eglise.name}}</option>
@ -20,25 +20,24 @@
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Points d'Energie</label><input type="text" name="data.pe" value="{{data.pe}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Cible</label><input type="text" name="data.target" value="{{data.target}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Difficulté</label><input type="text" name="data.difficulty" value="{{data.difficulty}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/></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 Critiques</label><input type="text" name="data.damagecritical" value="{{data.damagecritical}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Peut être maintenu ?</label>
<label class="attribute-value checkbox"><input type="checkbox" name="data.ismaintain" {{checked data.ismaintain}}/></label></li>
<li class="flexrow"><label class="generic-label">Actions complexes possibles ?</label><label class="attribute-value checkbox">
<input type="checkbox" name="data.complexactions" {{checked data.complexactions}}/></label></li>
<li class="flexrow"><label class="generic-label">Points d'Energie</label><input type="text" name="system.pe" value="{{data.pe}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Cible</label><input type="text" name="system.target" value="{{data.target}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Difficulté</label><input type="text" name="system.difficulty" value="{{data.difficulty}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="system.damage" value="{{data.damage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts Critiques</label><input type="text" name="system.damagecritical" value="{{data.damagecritical}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Valeur de critique</label>
<input type="text" name="data.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
<input type="text" name="system.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
<label class="generic-label">Effets</label>
{{editor content=data.effect target="data.effect" button=true owner=owner editable=editable}}
<label class="generic-label">Effets critiques</label>
{{editor content=data.criticaleffect target="data.criticaleffect" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Effets</h4>
{{editor effect target="system.effect" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Effets critiques</h4>
{{editor criticaleffect target="system.criticaleffect" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -10,8 +10,8 @@
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -10,8 +10,8 @@
<section class="sheet-body">
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -11,12 +11,13 @@
<div class="tab" data-group="primary">
<ul>
<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">Quantité</label><input type="text" name="data.quantite" value="{{data.quantite}}" 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>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="system.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Quantité</label><input type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="system.cost" value="{{data.cost}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -8,12 +8,12 @@
{{!-- Sheet Body --}}
<section class="sheet-body">
<li class="flexrow"><label class="generic-label">Nombre</label><input type="text" name="data.nombre" value="{{data.nombre}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<div class="tab" data-group="primary">
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
<li class="flexrow"><label class="generic-label">Nombre</label><input type="text" name="system.nombre" value="{{data.nombre}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="system.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</section>
</form>

View File

@ -5,11 +5,11 @@
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
<div class="resource">
<label>Quantity</label>
<input type="text" name="data.quantity" value="{{data.quantity}}" data-dtype="Number"/>
<input type="text" name="system.quantity" value="{{data.quantity}}" data-dtype="Number"/>
</div>
<div class="resource">
<label>Weight</label>
<input type="text" name="data.weight" value="{{data.weight}}" data-dtype="Number"/>
<input type="text" name="system.weight" value="{{data.weight}}" data-dtype="Number"/>
</div>
</div>
</header>
@ -41,14 +41,14 @@
<ol class="attributes-list">
{{#each data.attributes as |attr key|}}
<li class="attribute flexrow" data-attribute="{{key}}">
<input class="attribute-key" type="text" name="data.attributes.{{key}}.key" value="{{key}}"/>
<input class="attribute-key" type="text" name="system.attributes.{{key}}.key" value="{{key}}"/>
{{#if attr.isCheckbox}}
<label class="attribute-value checkbox"><input type="checkbox" name="data.attributes.{{key}}.value" {{checked attr.value}}/></label>
<label class="attribute-value checkbox"><input type="checkbox" name="system.attributes.{{key}}.value" {{checked attr.value}}/></label>
{{else}}
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
<input class="attribute-value" type="text" name="system.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
{{/if}}
<input class="attribute-label" type="text" name="data.attributes.{{key}}.label" value="{{attr.label}}"/>
<select class="attribute-dtype" name="data.attributes.{{key}}.dtype">
<input class="attribute-label" type="text" name="system.attributes.{{key}}.label" value="{{attr.label}}"/>
<select class="attribute-dtype" name="system.attributes.{{key}}.dtype">
{{#select attr.dtype}}
{{#each ../dtypes as |t|}}
<option value="{{t}}">{{t}}</option>

View File

@ -1,50 +1,58 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
<header class="sheet-header">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
</div>
</header>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Donnée</label>
<select class="competence-base flexrow" type="text" name="data.donnee" value="{{data.donnee}}" data-dtype="String">
{{#select data.donnee}}
{{#each @root.donnees as |donnee key|}}
<option value="{{donnee.name}}">{{donnee.name}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Points d'Energie</label><input type="text" name="data.pe" value="{{data.pe}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Cible</label><input type="text" name="data.target" value="{{data.target}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Difficulté</label><input type="text" name="data.difficulty" value="{{data.difficulty}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/></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 Critiques</label><input type="text" name="data.damagecritical" value="{{data.damagecritical}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Peut être maintenu ?</label><label class="attribute-value checkbox"><input type="checkbox" name="data.ismaintain" {{checked data.ismaintain}}/></label></li>
<li class="flexrow"><label class="generic-label">Actions complexes possibles ?</label><label class="attribute-value checkbox">
<input type="checkbox" name="data.complexactions" {{checked data.complexactions}}/></label></li>
<li class="flexrow"><label class="generic-label">Valeur de critique</label>
<input type="text" name="data.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
<div class="form-group small-editor">
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Effets</label>
<div class="form-group small-editor">
{{editor content=data.effect target="data.effect" button=true owner=owner editable=editable}}
</div>
<label class="generic-label">Effets critiques</label>
<div class="form-group small-editor">
{{editor content=data.criticaleffect target="data.criticaleffect" button=true owner=owner editable=editable}}
</div>
</div>
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Donnée</label>
<select class="competence-base flexrow" type="text" name="system.donnee" value="{{data.donnee}}"
data-dtype="String">
{{#select data.donnee}}
{{#each @root.donnees as |donnee key|}}
<option value="{{donnee.name}}">{{donnee.name}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow"><label class="generic-label">Points d'Energie</label><input type="text" name="system.pe"
value="{{data.pe}}" data-dtype="Number" /></li>
<li class="flexrow"><label class="generic-label">Cible</label><input type="text" name="system.target"
value="{{data.target}}" data-dtype="String" /></li>
<li class="flexrow"><label class="generic-label">Difficulté</label><input type="text" name="system.difficulty"
value="{{data.difficulty}}" data-dtype="Number" /></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="system.xp"
value="{{data.xp}}" data-dtype="Number" /></li>
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="system.damage"
value="{{data.damage}}" data-dtype="String" /></li>
<li class="flexrow"><label class="generic-label">Dégâts Critiques</label><input type="text"
name="system.damagecritical" value="{{data.damagecritical}}" data-dtype="String" /></li>
<li class="flexrow"><label class="generic-label">Valeur de critique</label>
<input type="text" name="system.valuecritical" value="{{data.valuecritical}}" data-dtype="Number" />
</li>
</ul>
<hr>
<h4 class="generic-label">Description</h4>
<div class="form-group small-editor">
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
<hr>
<h4 class="generic-label">Effets</h4>
<div class="form-group small-editor">
{{editor effect target="system.effect" button=true owner=owner editable=editable}}
</div>
<hr>
<h4 class="generic-label">Effets critiques</h4>
<div class="form-group small-editor">
{{editor criticaleffect target="system.criticaleffect" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>
</section>
</form>

View File

@ -11,13 +11,15 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Conditions</label><input type="text" name="data.condition" value="{{data.condition}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Cout en PA</label><input type="text" name="data.pacost" value="{{data.pacost}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="data.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<label class="generic-label">Effets</label>
{{editor content=data.effect target="data.effect" button=true owner=owner editable=editable}}
<label class="generic-label">Notes</label>
{{editor content=data.notes target="data.notes" button=true owner=owner editable=editable}}
<li class="flexrow"><label class="generic-label">Conditions</label><input type="text" name="system.condition" value="{{data.condition}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Cout en PA</label><input type="text" name="system.pacost" value="{{data.pacost}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">XP</label><input type="text" name="system.xp" value="{{data.xp}}" data-dtype="Number"/></li>
<hr>
<h4 class="generic-label">Effets</h4>
{{editor effect target="system.effect" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Notes</h4>
{{editor notes target="system.notes" button=true owner=owner editable=editable}}
</div>
</section>

View File

@ -12,7 +12,7 @@
<div class="tab" data-group="primary">
<ul>
<li class="flexrow"><label class="generic-label">Type</label>
<select class="competence-base flexrow" type="text" name="data.type" value="{{data.type}}" data-dtype="String">
<select class="competence-base flexrow" type="text" name="system.type" value="{{data.type}}" data-dtype="String">
{{#select data.type}}
<option value="feuunemain">A feu à 1 main</option>
<option value="feudeuxmains">A feu à 2 mains</option>
@ -21,18 +21,19 @@
{{/select}}
</select>
</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 Critiques</label><input type="text" name="data.criticaldamage" value="{{data.criticaldamage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Munitions</label><input type="text" name="data.munition" value="{{data.munition}}" 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">Encombrement</label><input type="text" name="data.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Quantité</label><input type="text" name="data.quantite" value="{{data.quantite}}" 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>
<li class="flexrow"><label class="generic-label">Dégâts</label><input type="text" name="system.damage" value="{{data.damage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Dégâts Critiques</label><input type="text" name="system.criticaldamage" value="{{data.criticaldamage}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Munitions</label><input type="text" name="system.munition" value="{{data.munition}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Distance</label><input type="text" name="system.distance" value="{{data.distance}}" data-dtype="String"/></li>
<li class="flexrow"><label class="generic-label">Encombrement</label><input type="text" name="system.enc" value="{{data.enc}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Quantité</label><input type="text" name="system.quantite" value="{{data.quantite}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Coût</label><input type="text" name="system.cost" value="{{data.cost}}" data-dtype="Number"/></li>
<li class="flexrow"><label class="generic-label">Valeur de critique</label>
<input type="text" name="data.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
<input type="text" name="system.valuecritical" value="{{data.valuecritical}}" data-dtype="Number"/></li>
</ul>
<label class="generic-label">Description</label>
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
<hr>
<h4 class="generic-label">Description</h4>
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>
</section>