Gestion des créatures

This commit is contained in:
sladecraven 2020-09-20 17:38:21 +02:00
parent 97cda9012c
commit 046e2e97ba
9 changed files with 586 additions and 35 deletions

View File

@ -0,0 +1,180 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { RdDUtility } from "./rdd-utility.js";
const creatureCarac = [ "taille", "constitution", "force", "perception", "volonte", "reve" ]
export class RdDActorCreatureSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["rdd", "sheet", "actor"],
template: "systems/foundryvtt-reve-de-dragon/templates/actor-creature-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 );
// low is normal, this the base used to compute the grid.
data.data.fatigueHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix( data.data.sante.fatigue.value, data.data.sante.endurance.max ).html() + "</table>";
data.data.competencecreature = data.itemsByType["competencecreature"];
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);
});
html.find('#fatigue-plus').click((event) => {
this.actor.santeIncDec("fatigue", 1);
this.render(true);
});
html.find('#fatigue-moins').click((event) => {
this.actor.santeIncDec("fatigue", -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

@ -27,25 +27,21 @@ export class RdDActor extends Actor {
if (data.items) { if (data.items) {
return super.create(data, options); return super.create(data, options);
} }
data.items = []; data.items = [];
let compendiumName = "";
if (data.type == "personnage") if (data.type == "personnage")
{ {
this.push_competence( data, "foundryvtt-reve-de-dragon.competences" ); compendiumName = "foundryvtt-reve-de-dragon.competences";
} }
if (data.type == "humanoide") if (data.type == "humanoide")
{ {
this.push_competence( data, "foundryvtt-reve-de-dragon.competences-humanoide" ); compendiumName = "foundryvtt-reve-de-dragon.competences-humanoide";
} }
if (data.type == "creature") if (data.type == "creature")
{ {
this.push_competence( data, "foundryvtt-reve-de-dragon.competences-creature" ); compendiumName = "foundryvtt-reve-de-dragon.competences-creatures";
} }
super.create(data, options);
}
/* -------------------------------------------- */
async push_competence( data, compendiumName ) {
let competences = []; let competences = [];
const pack = game.packs.get(compendiumName); const pack = game.packs.get(compendiumName);
await pack.getIndex().then(index => competences = index); await pack.getIndex().then(index => competences = index);
@ -55,7 +51,12 @@ export class RdDActor extends Actor {
await pack.getEntity(comp._id).then(skill => compItem = skill); await pack.getEntity(comp._id).then(skill => compItem = skill);
data.items.push(compItem); data.items.push(compItem);
} }
super.create(data, options);
} }
/* -------------------------------------------- */
/* -------------------------------------------- */ /* -------------------------------------------- */
prepareData() { prepareData() {
@ -302,6 +303,22 @@ export class RdDActor extends Actor {
this.update( { caracpath: caracValue } ); this.update( { caracpath: caracValue } );
} }
/* -------------------------------------------- */
async updateCreatureCompetence( compName, fieldName, compValue )
{
let comp = RdDUtility.findCompetence( this.data.items, compName);
if ( comp ) {
const update = {_id: comp._id }
if (fieldName == "niveau")
update['data.niveau']= compValue;
else if (fieldName == "dommages")
update['data.dommages']= compValue;
else
update['data.cacac-value']= compValue;
const updated = await this.updateEmbeddedEntity("OwnedItem", update); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCompetence( compName, compValue ) async updateCompetence( compName, compValue )
{ {
@ -701,6 +718,13 @@ export class RdDActor extends Actor {
this.rollCompetence( armeName ); //Bypass mode! this.rollCompetence( armeName ); //Bypass mode!
} }
/* -------------------------------------------- */
rollCreatureCompetence( compName )
{
let compItem = RdDUtility.findCompetence( this.data.items, compName);
//TODO !!!!
}
/* -------------------------------------------- */ /* -------------------------------------------- */
async rollCompetence( compName, armeItem=undefined, attackerRoll=undefined ) async rollCompetence( compName, armeItem=undefined, attackerRoll=undefined )
{ {

View File

@ -11,8 +11,8 @@
import { RdDActor } from "./actor.js"; 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 { RdDUtility } from "./rdd-utility.js"; import { RdDUtility } from "./rdd-utility.js";
import { TMRUtility } from "./tmr-utility.js";
import { RdDCalendrier } from "./rdd-calendrier.js"; import { RdDCalendrier } from "./rdd-calendrier.js";
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -120,7 +120,14 @@ Hooks.once("init", async function() {
// Register sheet application classes // Register sheet application classes
Actors.unregisterSheet("core", ActorSheet); Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorSheet, { makeDefault: true }); Actors.registerSheet("foundryvtt-reve-de-dragon", RdDActorSheet, {
types: ["personnage"],
makeDefault: true }
);
Actors.registerSheet("wfrp4e", RdDActorCreatureSheet, {
types: ["creature"],
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

@ -1,21 +1,20 @@
{"name":"Escalade","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_escalade.png","_id":"4GmpkphbsmQjvVVK"} {"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","_id":"4GmpkphbsmQjvVVK"}
{"name":"Morsure","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-morsure.png","_id":"6DK46pyO0hzEuuUg"} {"name":"Morsure","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-morsure.png","_id":"6DK46pyO0hzEuuUg"}
{"name":"Griffes et Crocs","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-griffes.png","_id":"BjqRrGtHtTzuNpZB"} {"name":"Griffes et Crocs","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-griffes.png","_id":"BjqRrGtHtTzuNpZB"}
{"name":"Esquive","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_esquive.png","_id":"CYpxxf1uTa78NWR9"} {"name":"Esquive","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"iscombat":false,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_esquive.png","_id":"CYpxxf1uTa78NWR9"}
{"name":"Crête","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-crete.png","_id":"JTuBQCPdumw3DfxH"} {"name":"Crête","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"iscombat":true,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-crete.png","_id":"JTuBQCPdumw3DfxH"}
{"name":"Vol","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-vol.png","_id":"Kt7WlB5Ui97X211z"} {"name":"Vol","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"iscombat":false,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-vol.png","_id":"Kt7WlB5Ui97X211z"}
{"name":"Cornes","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-corne.png","_id":"LWQHz5ymNBzh6ZEr"} {"name":"Cornes","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-corne.png","_id":"LWQHz5ymNBzh6ZEr"}
{"name":"Bras-bouches","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-brasbouche.png","_id":"NctG7suzvGE7ZZzj"} {"name":"Bras-bouches","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-brasbouche.png","_id":"NctG7suzvGE7ZZzj"}
{"name":"Pierre Tenue","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-pierretenue.png","_id":"OzHBowOMADRwcVXR"} {"name":"Pierre Tenue","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-pierretenue.png","_id":"OzHBowOMADRwcVXR"}
{"name":"Contre","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-contre.png","_id":"QME3qvTducY1uqpw"} {"name":"Pinces","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-pinces.png","_id":"RAnasKnoA3OQgwfv"}
{"name":"Pinces","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-pinces.png","_id":"RAnasKnoA3OQgwfv"} {"name":"Mandibules","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-mandibules.png","_id":"XgfRxSj8Ty1d3JFM"}
{"name":"Mandibules","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-mandibules.png","_id":"XgfRxSj8Ty1d3JFM"} {"name":"Pierre Lancée","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-pierrelancee.png","_id":"efl1HdDSKpBfImQ1"}
{"name":"Pierre Lancée","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-pierrelancee.png","_id":"efl1HdDSKpBfImQ1"} {"name":"Tronçonneuse","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-tronconneuse.png","_id":"h9ASt4vrvEgxfj7j"}
{"name":"Tronçonneuse","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-tronconneuse.png","_id":"h9ASt4vrvEgxfj7j"} {"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","_id":"lzEdMrKXbOYrWG5S"}
{"name":"Vigilance","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_vigilance.png","_id":"lzEdMrKXbOYrWG5S"} {"name":"Serres","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-serres.png","_id":"ndNshntOYb1JFNqi"}
{"name":"Serres","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-serres.png","_id":"ndNshntOYb1JFNqi"} {"name":"Bec","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-beak.png","_id":"os88Rsp7mBkahqmh"}
{"name":"Bec","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/compcreature-beak.png","_id":"os88Rsp7mBkahqmh"} {"name":"Dague","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_dague.png","_id":"qilRzXpVaGceNmQp"}
{"name":"Dague","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_dague.png","_id":"qilRzXpVaGceNmQp"} {"name":"Pickpocket","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_pickpocket.png","_id":"sUdXhpuVVOAlcVpo"}
{"name":"Pickpocket","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_pickpocket.png","_id":"sUdXhpuVVOAlcVpo"} {"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","_id":"shsUV8UpU18c0RJK"}
{"name":"Course","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_course.png","_id":"shsUV8UpU18c0RJK"} {"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","_id":"yDHZfK4RmwQW4YaW"}
{"name":"Discrétion","permission":{"default":0,"Q4cUvqxCxMoTJXDL":3},"type":"competencecreature","data":{"niveau":0,"carac-value":0,"dommages":0,"description":"<p>Morsure de la créature</p>"},"flags":{},"img":"systems/foundryvtt-reve-de-dragon/icons/competence_discretion.png","_id":"yDHZfK4RmwQW4YaW"}

View File

@ -2,10 +2,10 @@
"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.5", "version": "0.9.7",
"minimumCoreVersion": "0.6.0", "minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "0.6.6", "compatibleCoreVersion": "0.6.6",
"templateVersion": 31, "templateVersion": 33,
"author": "LeRatierBretonnien", "author": "LeRatierBretonnien",
"esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ], "esmodules": [ "module/rdd-main.js", "module/hook-renderChatLog.js" ],
"styles": ["styles/simple.css"], "styles": ["styles/simple.css"],

View File

@ -16,6 +16,133 @@
"beaute": 10, "beaute": 10,
"main": "droitier" "main": "droitier"
}, },
"creature": {
"carac": {
"taille": {
"type": "number",
"value": 10,
"label": "Taille",
"xp": 0,
"derivee": false
},
"constitution": {
"type": "number",
"value": 10,
"label": "Constitution",
"xp": 0,
"derivee": false
},
"force": {
"type": "number",
"value": 10,
"label": "Force",
"xp": 0,
"derivee": false
},
"perception": {
"type": "number",
"value": 10,
"label": "Perception",
"xp": 0,
"derivee": false
},
"volonte": {
"type": "number",
"value": 10,
"label": "Volonté",
"xp": 0,
"derivee": false
},
"reve": {
"type": "number",
"value": 10,
"label": "Rêve",
"xp": 0,
"derivee": false
}
},
"sante": {
"vie": {
"type": "number",
"max": 10,
"value": 10,
"label": "Vie",
"derivee": true
},
"endurance": {
"type": "number",
"max": 10,
"value": 10,
"label": "Endurance",
"derivee": true
},
"fatigue": {
"type": "number",
"max": 0,
"value": 0,
"label": "Fatigue",
"derivee": true
},
"sonne": {
"value": false,
"label": "Sonné"
}
},
"blessures": {
"legeres": {
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
},
"graves": {
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
},
"critiques": {
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
}
},
"attributs": {
"sconst": {
"type": "number",
"value": 0,
"label": "S. Const",
"derivee": true
},
"sust": {
"type": "number",
"value": 0,
"label": "Sustentation",
"derivee": true
},
"plusdom": {
"type": "number",
"value": 0,
"label": "+dom",
"derivee": true
},
"encombrement": {
"type": "number",
"value": 0,
"label": "Encombrement",
"derivee": true
},
"malusarmure": {
"type": "number",
"value": 0,
"label": "Malus Armure",
"derivee": true
}
},
"compteurs": {
"etat": {
"value": 0,
"label": "Etat général"
}
}
},
"common": { "common": {
"carac": { "carac": {
"taille": { "taille": {
@ -332,7 +459,7 @@
"templates": [ "common", "description" ] "templates": [ "common", "description" ]
}, },
"creature": { "creature": {
"templates": [ "common", "description" ] "templates": [ "creature", "description" ]
} }
}, },
"Item": { "Item": {
@ -398,6 +525,7 @@
"competencecreature": { "competencecreature": {
"niveau": 0, "niveau": 0,
"carac-value": 0, "carac-value": 0,
"iscombat": false,
"dommages": 0, "dommages": 0,
"description": "Compétence : ..." "description": "Compétence : ..."
}, },

View File

@ -0,0 +1,205 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" height="100" width="100"/>
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1>
<div class="flexrow">
<div class="flex-group-center">
<div>
<span>Vie <a id="vie-plus">+</a> / <a id="vie-moins">-</a></span>
<input class="resource-content" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>/{{data.sante.vie.max}}
</div>
<div>
<span>Endurance <a id="endurance-plus">+</a> / <a id="endurance-moins">-</a></span>
<input class="resource-content" type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>/{{data.sante.endurance.max}}
</div>
<div>
<span>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}} />
</div>
</div>
<div class="flex-group-center flex-fatigue">
Fatigue <a id="fatigue-plus">+</a> / <a id="fatigue-moins">-</a>
<span>{{{data.fatigueHTML}}}</span>
</div>
</div>
<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}}
{{#if carac.derivee}}
<label class="competence-value flexrow">{{carac.value}}</label>
{{else}}
<input class="competence-value flexrow" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}"/>
<input class="competence-xp flexrow" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number"/>
{{/if}}
</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="competence-label flexrow" name="data.attributs.{{key}}.label">{{attr.label}} : {{attr.value}}</span>
</li>
{{/each}}
{{#each data.sante as |point key|}}
<li class="competence flexrow" data-attribute="{{key}}">
<span class="competence-label flexrow" name="data.attributs.{{key}}.label">{{point.label}} : {{point.value}} / {{point.max}}</span>
</li>
{{/each}}
</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.cacac-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>
{{!-- Combat Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
<header class="competence-header flexrow">
<span class="competence-title">Armes</span>
<span class="competence-title">Niveau</span>
<span class="competence-title">XP</span>
</header>
<ol class="item-list">
{{#each data.armes as |arme key|}}
<li class="item flexrow" data-item-id="{{arme._id}}">
<span class="arme-label" name="data.armes[{{key}}].name"><a>{{arme.name}}</a></span>
<span class="competence-label" name="data.armes[{{key}}].data.competence">{{arme.data.competence}}</span>
<span class="competence-label" name="data.armes[{{key}}].data.niveau">{{numberFormat arme.data.niveau decimals=0 sign=true}}</span>
<span class="competence-label" name="data.armes[{{key}}].data.dommages">{{numberFormat arme.data.dommages decimals=0 sign=true}}</span>
</li>
{{/each}}
</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>
<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 biography" data-group="primary" data-tab="description" style="height:200px">
<div class="grid grid-2col">
<div class="flex-group-left flexcol competence-column">
<ol class="item-list">
<li class="item flexrow" ><span class="description-label">Sexe : </span><input class="description-value flexrow" type="text" name="data.sexe" value="{{data.sexe}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Poids : </span><input class="description-value flexrow" type="text" name="data.poids" value="{{data.poids}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Taille : </span><input class="description-value flexrow" type="text" name="data.taille" value="{{data.taille}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Cheveux : </span><input class="description-value flexrow" type="text" name="data.cheveux" value="{{data.cheveux}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Yeux : </span><input class="description-value flexrow" type="text" name="data.yeux" value="{{data.yeux}}" data-dtype="String"/></li>
</ol>
</div>
<div>
<ol class="item-list">
<li class="item flexrow" ><span class="description-label">Age : </span><input class="description-value flexrow" type="text" name="data.age" value="{{data.age}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Heure de naissance : </span><input class="description-value flexrow" type="text" name="data.heure" value="{{data.heure}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Beauté : </span><input class="description-value flexrow" type="text" name="data.beaute" value="{{data.beaute}}" data-dtype="String"/></li>
<li class="item flexrow" ><span class="description-label">Main directrice : </span><input class="description-value flexrow" type="text" name="data.main" value="{{data.main}}" data-dtype="String"/></li>
</ol>
</div>
</div>
<div class="form-group" style="height:200px">
{{editor content="data.biographie" target="data.biographie" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -16,6 +16,10 @@
<label for="niveau">Valeur de Caractéristique </label> <label for="niveau">Valeur de Caractéristique </label>
<input class="attribute-value" type="text" name="data.carac-value" value="{{data.carac-value}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.carac-value" value="{{data.carac-value}}" data-dtype="Number"/>
</div> </div>
<div class="form-group">
<label for="xp">Arme ? </label>
<input class="attribute-value" type="checkbox" name="data.iscombat" {{#if data.iscombat}}checked{{/if}}/>
</div>
<div class="form-group"> <div class="form-group">
<label for="niveau">Dommages (+dom), si applicable </label> <label for="niveau">Dommages (+dom), si applicable </label>
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="Number"/>

View File

@ -16,6 +16,10 @@
<label for="niveau">Valeur de Caractéristique </label> <label for="niveau">Valeur de Caractéristique </label>
<input class="attribute-value" type="text" name="data.carac-value" value="{{data.carac-value}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.carac-value" value="{{data.carac-value}}" data-dtype="Number"/>
</div> </div>
<div class="form-group">
<label for="xp">Arme ? </label>
<input class="attribute-value" type="checkbox" name="data.iscombat" {{#if data.iscombat}}checked{{/if}}/>
</div>
<div class="form-group"> <div class="form-group">
<label for="niveau">Dommages (+dom), si applicable </label> <label for="niveau">Dommages (+dom), si applicable </label>
<input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="Number"/> <input class="attribute-value" type="text" name="data.dommages" value="{{data.dommages}}" data-dtype="Number"/>