#4 : Gestion humanoide

This commit is contained in:
sladecraven 2020-11-04 16:29:10 +01:00
parent 34156295ea
commit ed16553ace
12 changed files with 423 additions and 10 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

View File

@ -0,0 +1,171 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
export class RdDActorHumanoideSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["rdd", "sheet", "actor"],
template: "systems/foundryvtt-reve-de-dragon/templates/actor-humanoide-sheet.html",
width: 640,
height: 720,
tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac"}],
dragDrop: [{dragSelector: ".item-list .item", dropSelector: null}]
});
}
/* -------------------------------------------- */
_checkNull(items) {
if (items && items.length) {
return items;
}
return [];
}
/* -------------------------------------------- */
getData() {
let data = super.getData();
data.itemsByType = {};
for (const item of data.items) {
let list = data.itemsByType[item.type];
if (!list) {
list = [];
data.itemsByType[item.type] = list;
}
list.push(item);
}
// Compute current carac sum
let sum = 0;
Object.values(data.data.carac).forEach(carac => { if (!carac.derivee) { sum += parseInt(carac.value) } } );
data.data.caracSum = sum;
data.data.carac.taille.isTaille = true; // To avoid button link;
data.data.nbLegeres = this.actor.GetNumberBlessures(data.data.blessures.legeres.liste );
data.data.nbGraves = this.actor.GetNumberBlessures(data.data.blessures.graves.liste );
data.data.nbCritiques = this.actor.GetNumberBlessures(data.data.blessures.critiques.liste );
data.data.competencecreature = data.itemsByType["competencecreature"];
console.log("DATA:", data);
return data;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("itemId"));
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.deleteOwnedItem(li.data("itemId"));
li.slideUp(200, () => this.render(false));
});
// Blessure control
html.find('.blessure-control').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let btype = li.data("blessure-type");
let index = li.data('blessure-index');
let active = $(ev.currentTarget).data('blessure-active');
//console.log(btype, index, active);
this.actor.manageBlessureFromSheet(btype, index, active).then( this.render(true) );
});
// Blessure data
html.find('.blessures-soins').change(ev => {
const li = $(ev.currentTarget).parents(".item");
let btype = li.data('blessure-type');
let index = li.data('blessure-index');
let psoins = li.find('input[name=premiers_soins]').val();
let pcomplets = li.find('input[name=soins_complets]').val();
let jours = li.find('input[name=jours]').val();
let loc = li.find('input[name=localisation]').val();
//console.log(btype, index, psoins, pcomplets, jours, loc);
this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc).then( this.render(true) );
});
// Roll Carac
html.find('.carac-label a').click((event) => {
let caracName = event.currentTarget.attributes.name.value;
this.actor.rollCarac( caracName.toLowerCase() );
});
// On competence change
html.find('.creature-carac').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCreatureCompetence( compName, "carac_value", parseInt(event.target.value) );
} );
html.find('.creature-niveau').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCreatureCompetence( compName, "niveau", parseInt(event.target.value) );
} );
html.find('.creature-dommages').change((event) => {
let compName = event.currentTarget.attributes.compname.value;
this.actor.updateCreatureCompetence( compName, "dommages", parseInt(event.target.value) );
} );
// Roll Skill
html.find('.competence-label a').click((event) => {
let compName = event.currentTarget.text;
this.actor.rollCreatureCompetence( compName );
});
html.find('#vie-plus').click((event) => {
this.actor.santeIncDec("vie", 1);
this.render(true);
});
html.find('#vie-moins').click((event) => {
this.actor.santeIncDec("vie", -1);
this.render(true);
});
html.find('#endurance-plus').click((event) => {
this.actor.santeIncDec("endurance", 1);
this.render(true);
});
html.find('#endurance-moins').click((event) => {
this.actor.santeIncDec("endurance", -1);
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options={}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
// Update the Actor
return this.object.update(formData);
}
}

View File

@ -36,7 +36,7 @@ export class RdDActor extends Actor {
} }
if (data.type == "humanoide") if (data.type == "humanoide")
{ {
compendiumName = "foundryvtt-reve-de-dragon.competences-humanoide"; compendiumName = "foundryvtt-reve-de-dragon.competences-humanoides";
} }
if (data.type == "creature") if (data.type == "creature")
{ {
@ -70,6 +70,7 @@ export class RdDActor extends Actor {
// things organized. // things organized.
if (actorData.type === 'personnage') this._prepareCharacterData(actorData); if (actorData.type === 'personnage') this._prepareCharacterData(actorData);
if (actorData.type === 'creature') this.computeEtatGeneral(actorData); if (actorData.type === 'creature') this.computeEtatGeneral(actorData);
if (actorData.type === 'humanoide') this.computeEtatGeneral(actorData);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */

View File

@ -12,6 +12,7 @@ import { RdDActor } from "./actor.js";
import { RdDItemSheet } from "./item-sheet.js"; import { RdDItemSheet } from "./item-sheet.js";
import { RdDActorSheet } from "./actor-sheet.js"; import { RdDActorSheet } from "./actor-sheet.js";
import { RdDActorCreatureSheet } from "./actor-creature-sheet.js"; import { RdDActorCreatureSheet } from "./actor-creature-sheet.js";
import { RdDActorHumanoideSheet } from "./actor-humanoide-sheet.js";
import { RdDUtility } from "./rdd-utility.js"; import { RdDUtility } from "./rdd-utility.js";
import { RdDCalendrier } from "./rdd-calendrier.js"; import { RdDCalendrier } from "./rdd-calendrier.js";
@ -128,6 +129,10 @@ Hooks.once("init", async function() {
types: ["creature"], types: ["creature"],
makeDefault: true makeDefault: true
}); });
Actors.registerSheet("wfrp4e", RdDActorHumanoideSheet, {
types: ["humanoide"],
makeDefault: true
});
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, {makeDefault: true}); Items.registerSheet("foundryvtt-reve-de-dragon", RdDItemSheet, {makeDefault: true});

View File

@ -92,6 +92,8 @@ export class RdDUtility {
const templatePaths = [ const templatePaths = [
//Character Sheets //Character Sheets
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/actor-humanoide-sheet.html',
//Items //Items
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',

View File

@ -0,0 +1,42 @@
{"name":"Esquive","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_esquive.png","effects":[],"_id":"0Ms9iKxqigNNpZEx"}
{"name":"Cuisine","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_cuisine.png","effects":[],"_id":"18wcei5hlEInsBFO"}
{"name":"Danse","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_danse.png","effects":[],"_id":"3Crwg8cx2JOb697T"}
{"name":"Survie en Montagne","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_montagne.png","effects":[],"_id":"5c0hWcQJxb4Q21Mk"}
{"name":"Charpenterie","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_charpenterie.png","effects":[],"_id":"8wsg6Tea9uq4LIRR"}
{"name":"Natation","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_natation.png","effects":[],"_id":"9lapnIQBcoM2UbYx"}
{"name":"Equitation","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_equitation.png","effects":[],"_id":"Aea8wM5efy5gxjDj"}
{"name":"Survie en Extérieur","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_exterieur.png","effects":[],"_id":"EAxj4uUREHbqwC9L"}
{"name":"Discrétion","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_discretion.png","effects":[],"_id":"HXUreQ9H5s3scKck"}
{"name":"Sagouine","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_grouine.png","effects":[],"_id":"I36ZBkdWbs46iMDy"}
{"name":"Fronde","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_fronde.png","effects":[],"_id":"K9AS7zs5uGkfiz2L"}
{"name":"Survie en Forêt","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_foret.png","effects":[],"_id":"KAsU7UwtWjJ1pBYU"}
{"name":"Survie en Cité","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_cite.png","effects":[],"_id":"MIo5O1rO0Rcougfs"}
{"name":"Javelot","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_lance.png","effects":[],"_id":"MSeP6k2QB3rGCJfd"}
{"name":"Bricolage","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_bricolage.png","effects":[],"_id":"MfIb6SBRQFytI7HC"}
{"name":"Petite Lance","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_lance.png","effects":[],"_id":"MmRwM7caZRkKKWpP"}
{"name":"Bouclier Moyen","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_bouclier.png","effects":[],"_id":"QGULMUoC9JXFze0r"}
{"name":"Chant","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_chant.png","effects":[],"_id":"TSYUgkeNySPebL6y"}
{"name":"Bouclier Léger","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_bouclier.png","effects":[],"_id":"UBMG769xfkd9wb6t"}
{"name":"Grouine","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_grouine.png","effects":[],"_id":"Uivn4w7d4JNdSIRb"}
{"name":"Légendes","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_legendes.png","effects":[],"_id":"UqZivWKal2hvRdcO"}
{"name":"Course","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_course.png","effects":[],"_id":"WsYnwR8GcOxfuCI0"}
{"name":"Epée Sorde","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_epee_1_main.png","effects":[],"_id":"YTKld5ggDsHqwYoR"}
{"name":"Masse Lourde","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_masse_1_main.png","effects":[],"_id":"bgzOT9PYCOsrm8FS"}
{"name":"Lance Courte","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_lance.png","effects":[],"_id":"btSxLWYSisFvbcRd"}
{"name":"Corps à Corps","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.png","effects":[],"_id":"c0I93Q53i4ZmxpyT"}
{"name":"Lance Courte (Lancer)","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_lance.png","effects":[],"_id":"dO72mix9tGUHiqmG"}
{"name":"Comédie","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_comedie.png","effects":[],"_id":"e74yfvlcv41oM1Td"}
{"name":"Petit Arc","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_arc.png","effects":[],"_id":"ezKaZNCSQMtr4LeB"}
{"name":"Empoignade","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature_empoignade.png","effects":[],"_id":"gAfrxCyNGA37mtLk"}
{"name":"Maroquinerie","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_maroquinerie.png","effects":[],"_id":"gXv03Rn71K3qXpGf"}
{"name":"Epée Gnome","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_epee_1_main.png","effects":[],"_id":"gfDCgPJjeVg8tSul"}
{"name":"Morsure","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-morsure.png","effects":[],"_id":"j1xHCzfIeYKgXxoH"}
{"name":"Arc","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_arc.png","effects":[],"_id":"lLJGyPzbDIAHuWs1"}
{"name":"Vigilance","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_vigilance.png","effects":[],"_id":"o3wwhOPjdGxRR19r"}
{"name":"Hache de Bataille","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_hache_a_1_main.png","effects":[],"_id":"oSSUSL9EHCrTkIVw"}
{"name":"Survie en Marais","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_marais.png","effects":[],"_id":"pIi0hHqJvQ36h6JI"}
{"name":"Epée Cyane","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":true,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_epee_1_main.png","effects":[],"_id":"qT4pYktoaiWO0VFO"}
{"name":"Commerce","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/comptence-commerce.png","effects":[],"_id":"qcVZMYfF7w0mIFs5"}
{"name":"Survie en Sous-Sol","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_survie_sous_sol.png","effects":[],"_id":"rZIg94PO3TgoCwgh"}
{"name":"Ecriture","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_ecriture.png","effects":[],"_id":"w7w6YsXVjFh9BnvU"}
{"name":"Escalade","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac_value":0,"iscombat":false,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_escalade.png","effects":[],"_id":"wnrc1X4pAVHOEjt4"}

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"version": "0.9.16", "version": "0.9.17",
"minimumCoreVersion": "0.6.0", "minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.6", "compatibleCoreVersion": "0.6.6",
"templateVersion": 37, "templateVersion": 37,
@ -27,6 +27,15 @@
"path": "./packs/competences-creatures.db", "path": "./packs/competences-creatures.db",
"entity": "Item", "entity": "Item",
"tag" : "item" "tag" : "item"
},
{
"name": "competences-humanoides",
"label": "Compétences Humanoïdes",
"system": "foundryvtt-reve-de-dragon",
"module": "foundryvtt-reve-de-dragon",
"path": "./packs/competences-humanoides.db",
"entity": "Item",
"tag" : "item"
}, },
{ {
"name": "sorts", "name": "sorts",

View File

@ -0,0 +1,188 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" />
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name" /></h1>
<div class="flexrow">
<div class="flexrow">
<div class="flex-group-center">Blessures légères : {{data.nbLegeres}}</div>
<div class="flex-group-center">Blessures graves : {{data.nbGraves}}</div>
<div class="flex-group-center">Blessure critique : {{data.nbCritiques}}</div>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="carac">Caractéristiques</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="blessures">Blessures</a>
<a class="item" data-tab="description">Description</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Carac Tab --}}
<div class="tab items" data-group="primary" data-tab="carac">
<div class="grid grid-2col">
<div class="flex-group-left flexcol">
<ol class="carac-list">
{{#each data.carac as |carac key|}}
<li class="competence flexrow" data-attribute="{{key}}">
{{#if carac.isTaille}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
{{else}}
<span class="carac-label flexrow" name="data.carac.{{key}}.label"><a
name={{key}}>{{carac.label}}</a></span>
{{/if}}
<input class="competence-value flexrow" type="text" name="data.carac.{{key}}.value"
value="{{carac.value}}" data-dtype="{{carac.type}}" />
</li>
{{/each}}
<li class="competence flexrow">
<span class="carac-label flexrow" name="carac-total">Total Caractéristiques</span>
<span class="competence-value flexrow" name="carac-total-value">{{data.caracSum}}</span>
</li>
</ol>
</div>
<div class="flex-group-left flexcol">
<ol class="carac-list">
{{#each data.attributs as |attr key|}}
<li class="competence flexrow" data-attribute="{{key}}">
<span class="carac-label flexrow" name="data.attributs.{{key}}.label">{{attr.label}} : </span>
<span><input class="attribut-value flexrow" type="text" name="data.attributs.{{key}}.value"
value="{{attr.value}}" data-dtype="{{attr.type}}" /></span>
</li>
{{/each}}
<li class="competence flexrow" data-attribute="vie">
<span class="competence-label flexrow" name="data.sante.vie.label">Vie : </span>
<span><input class="sante-value flexrow" type="text" name="data.sante.vie.value"
value="{{data.sante.vie.value}}" data-dtype="Number" /></span><span>/ </span>
<span><input class="sante-value flexrow" type="text" name="data.sante.vie.max"
value="{{data.sante.vie.max}}" data-dtype="Number" /></span>
</li>
<li class="competence flexrow" data-attribute="endurance">
<span class="competence-label flexrow" name="data.sante.endurance.label">Endurance : </span>
<span><input class="sante-value flexrow" type="text" name="data.sante.endurance.value"
value="{{data.sante.endurance.value}}" data-dtype="Number" /></span><span>/ </span>
<span><input class="sante-value flexrow" type="text" name="data.sante.endurance.max"
value="{{data.sante.endurance.max}}" data-dtype="Number" /></span>
</li>
<li class="competence flexrow" data-attribute="sonne">
<span class="competence-label flexrow" name="data.sante.sonne.label">Sonné : </span>
<input class="resource-content" type="checkbox" name="data.sante.sonne.value"
value="{{data.sante.sonne.value}}" {{#if data.sante.sonne.value}}checked{{/if}} />
</li>
<li class="competence flexrow" data-attribute="etat">
<span class="competence-label flexrow" name="data.compteurs.etat.label">Etat Général : </span>
<span>{{data.compteurs.etat.value}}</span>
</li>
</ol>
</div>
</div>
</div>
{{!-- Compétences Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexcol">
<div class="flex-group-left flexcol competence-column">
<ol class="item-list">
{{#each data.competencecreature as |comp key|}}
<li class="item flexrow" data-item-id="{{comp._id}}">
<img class="sheet-competence-img" src="{{comp.img}}" />
<span class="competence-label" name="data.competencecreature[{{key}}].name"><a>{{comp.name}}</a></span>
<input class="competence-value creature-carac" type="text"
name="data.competencecreature[{{key}}].data.carac_value" compname="{{comp.name}}"
value="{{comp.data.carac_value}}" data-dtype="number" />
<input class="competence-value creature-niveau" type="text"
name="data.competencecreature[{{key}}].data.niveau" compname="{{comp.name}}"
value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" />
<input class="competence-value creature-dommages" type="text"
name="data.competencecreature[{{key}}]].data.dommages" compname="{{comp.name}}"
value="{{numberFormat comp.data.dommages decimals=0 sign=true}}" data-dtype="number" />
<div class="item-controls">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
</div>
</div>
</div>
{{!-- blessures Tab --}}
<div class="tab blessures" data-group="primary" data-tab="blessures" style="height:200px">
<span class="blessures-title">Blessures Légeres :</span>
<div class="blessure-data">
{{#each data.blessures.legeres.liste as |bless key|}}
<li class="item flexrow blessure-data" data-blessure-type="legere" data-attribute={{key}}
data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Légère"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name='premiers_soins' data-dtype="number"
value="{{this.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name='soins_complets' data-dtype="number"
value="{{this.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name='jours' data-dtype="number" value="{{this.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name='localisation' data-dtype="String"
value="{{this.localisation}}" />
</li>
{{/each}}
</div>
<span class="blessures-title">Blessures Graves :</span>
<div>
{{#each data.blessures.graves.liste as |bless key|}}
<li class="item flexrow" data-blessure-type="grave" data-attribute={{key}} data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Grave"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name="premiers_soins" data-dtype="number"
value="{{bless.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name="soins_complets" data-dtype="number"
value="{{bless.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name="jours" data-dtype="number" value="{{bless.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name="localisation" data-dtype="String"
value="{{bless.localisation}}" />
</li>
{{/each}}
</div>
<span class="blessures-title">Blessure Critique :</span>
<div>
{{#each data.blessures.critiques.liste as |bless key|}}
<li class="item flexrow" data-blessure-type="critique" data-attribute={{key}} data-blessure-index="{{key}}">
<a class="item-control blessure-control" title="Blessure Critique"
data-blessure-active="{{bless.active}}">{{#if bless.active}}<i class="fas fa-circle"></i>{{else}}<i
class="fas fa-genderless"></i>{{/if}}</a>
Premiers soins <input class="blessures-soins" type="text" name="premiers_soins" data-dtype="number"
value="{{bless.premiers_soins}}" /> -
Soins complets <input class="blessures-soins" type="text" name="soins_complets" data-dtype="number"
value="{{bless.soins_complets}}" /> -
Jours <input class="blessures-soins" type="text" name="jours" data-dtype="number" value="{{bless.jours}}" />
-
Loc. <input class="blessures-soins" type="text" name="localisation" data-dtype="String"
value="{{bless.localisation}}" />
</li>
</li>
{{/each}}
</div>
</div>
{{!-- Biography Tab --}}
<div class="tab description" data-group="primary" data-tab="description" style="height:400px !important; min-height: 400px !important;">
<div class="form-group editor" style="height:400px !important; min-height: 400px !important;">
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
</div>
</div>
</div>
</section>
</form>

View File

@ -40,8 +40,7 @@
<a class="item" data-tab="carac">Caractéristiques</a> <a class="item" data-tab="carac">Caractéristiques</a>
<a class="item" data-tab="competences">Compétences</a> <a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="combat">Combat</a> <a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="compteur">Compteurs</a> <a class="item" data-tab="blessurescompteurs">Blessures/Compteurs</a>
<a class="item" data-tab="blessures">Blessures</a>
<a class="item" data-tab="hautreve">Haut-Rêve</a> <a class="item" data-tab="hautreve">Haut-Rêve</a>
<a class="item" data-tab="items">Equipement</a> <a class="item" data-tab="items">Equipement</a>
<a class="item" data-tab="queuesouffle">Queues, Souffles et Têtes</a> <a class="item" data-tab="queuesouffle">Queues, Souffles et Têtes</a>
@ -274,8 +273,8 @@
</ol> </ol>
</div> </div>
{{!-- Compteurs Tab --}} {{!-- Compteurs/Blessures Tab --}}
<div class="tab compteur" data-group="primary" data-tab="compteur"> <div class="tab blessurescompteurs" data-group="primary" data-tab="blessurescompteurs">
<ol class="item-list"> <ol class="item-list">
{{#each data.compteurs as |compteur key|}} {{#each data.compteurs as |compteur key|}}
<li class="item flexrow""> <li class="item flexrow"">
@ -294,10 +293,6 @@
</li> </li>
{{/each}} {{/each}}
</ol> </ol>
</div>
{{!-- blessures Tab --}}
<div class="tab blessures" data-group="primary" data-tab="blessures" style="height:200px">
<span class="blessures-title">Blessures Légeres :</span> <span class="blessures-title">Blessures Légeres :</span>
<div class="blessure-data"> <div class="blessure-data">
{{#each data.blessures.legeres.liste as |bless key|}} {{#each data.blessures.legeres.liste as |bless key|}}