Initial import

This commit is contained in:
LeRatierBretonnien 2023-04-19 18:44:41 +02:00
commit 63f6d0271d
79 changed files with 4883 additions and 0 deletions

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Système Foundry pour Maléfices (French RPG, Arkhane Asylum Publishing)
[Vue du système](https://www.lahiette.com/leratierbretonnien/wp-content/uploads/2023/02/malefices_snapshot.webp)
## EN
Unofficial system for Maléfices v4 (French version from Arkhane Asylum Publishing).
This system has been approved by Arkhane Asylum Publishing ( https://arkhane-asylum.fr ), thanks !
The Tarot assets, as well as other graphical elements has been provide by Arkhane Asylum.
Books are mandatory to play and are available at : https://arkhane-asylum.fr/en/malefices
## FR
Système non-officiel pour le JDR Maléfices, version 4 (Arkhane Asylum Publishing).
Ce système a été autorisé par le Arkhane Asylum Publishing ( https://arkhane-asylum.fr ), merci à eux !
Les images du Tarot et autres éléments graphiques ont été fournis par Arkhane Asylum.
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : https://arkhane-asylum.fr/fr/malefices
# Credits
Maléfices, le jeu de rôle qui sent le souffre, is a property of Arkhane Asylum Publishing.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Dame du Lac, Malik

BIN
fonts/rivanna.regular.otf Normal file

Binary file not shown.

BIN
fonts/rivanna.ttf Normal file

Binary file not shown.

6
images/icons/.directory Normal file
View File

@ -0,0 +1,6 @@
[Dolphin]
SortRole=modificationtime
Timestamp=2023,2,26,15,32,34.892
Version=4
ViewMode=1
VisibleRoles=Details_text,Details_size,Details_modificationtime,Details_creationtime,CustomizedDetails

BIN
images/icons/Artiste.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
images/icons/Comedien.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
images/icons/Ecrivain.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
images/icons/Ingenieur.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
images/icons/Juriste.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
images/icons/Medecin.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
images/icons/Medium.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
images/icons/Militaire.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
images/icons/Rentier.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
images/icons/arbalete.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
images/icons/arc.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
images/icons/archetype.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
images/icons/epee.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
images/icons/fusil.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
images/icons/habilite.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
images/icons/mainsnues.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
images/icons/physique.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/icons/resume.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
images/icons/revolver.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/icons/sortilege.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
images/icons/tarot.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/icons/tirage.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/icons/tirer.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/icons/wisdom.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
images/ui/logo_pause.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
images/ui/separator_01.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

13
lang/fr.json Normal file
View File

@ -0,0 +1,13 @@
{
"ACTOR": {
"TypePersonnage": "Personnage"
},
"ITEM": {
"TypeArme": "Arme",
"TypeEquipement": "Equipement",
"TypeTarot": "Tarot",
"TypeElementbio": "Element Biographique",
"TypeArchetype": "Archetype",
"TypeSortilege": "Sortilège"
}
}

View File

@ -0,0 +1,168 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { EcrymeUtility } from "./common/ecryme-utility.js";
/* -------------------------------------------- */
export class EcrymeActorSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-ecryme", "sheet", "actor"],
template: "systems/fvtt-ecryme/templates/actors/actor-sheet.hbs",
width: 640,
height:680,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "skills" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
let formData = {
title: this.title,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: duplicate(this.object.system),
limited: this.object.limited,
armes: duplicate(this.actor.getArmes()),
tarots: duplicate(this.actor.getTarots()),
tarotsCache: duplicate(this.actor.getHiddenTarots()),
archetype: duplicate(this.actor.getArchetype()),
equipements: duplicate(this.actor.getEquipements()),
subActors: duplicate(this.actor.getSubActors()),
phyMalus: this.actor.getPhysiqueMalus(),
elementsbio: this.actor.getElementsBio(),
sorts: this.actor.getSorts(),
description: await TextEditor.enrichHTML(this.object.system.description, { async: true }),
notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }),
equipementlibre: await TextEditor.enrichHTML(this.object.system.equipementlibre, { async: true }),
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
EcrymeUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
})
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
actor.sheet.render(true);
});
html.find('.subactor-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
this.actor.delSubActor(actorId);
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.roll-attribut').click((event) => {
let attrKey = $(event.currentTarget).data("attr-key")
this.actor.rollAttribut(attrKey)
});
html.find('.roll-arme').click((event) => {
const armeId = $(event.currentTarget).data("arme-id")
this.actor.rollArme(armeId)
});
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.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
});
}
/* -------------------------------------------- */
/** @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

@ -0,0 +1,395 @@
/* -------------------------------------------- */
import { EcrymeUtility } from "./common/ecryme-utility.js";
import { EcrymeRollDialog } from "./dialogs/ecryme-roll-dialog.js";
/* -------------------------------------------- */
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class EcrymeActor extends Actor {
/* -------------------------------------------- */
/**
* Override the create() function to provide additional SoS functionality.
*
* This overrided create() function adds initial items
* Namely: Basic skills, money,
*
* @param {Object} data Barebones actor data which this function adds onto.
* @param {Object} options (Unused) Additional options which customize the creation workflow.
*
*/
static async create(data, options) {
// Case of compendium global import
if (data instanceof Array) {
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) {
let actor = super.create(data, options);
return actor;
}
if (data.type == 'character') {
}
if (data.type == 'npc') {
}
return super.create(data, options);
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData()
}
/* -------------------------------------------- */
computeHitPoints() {
if (this.type == "character") {
}
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'character' || game.user.isGM) {
}
super.prepareDerivedData();
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
super._preUpdate(changed, options, user);
}
/*_onUpdateEmbeddedDocuments( embeddedName, ...args ) {
this.rebuildSkills()
super._onUpdateEmbeddedDocuments(embeddedName, ...args)
}*/
/* -------------------------------------------- */
getMoneys() {
let comp = this.items.filter(item => item.type == 'money');
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
getSorts() {
let comp = this.items.filter(item => item.type == 'sortilege');
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
getArchetype() {
let comp = duplicate(this.items.find(item => item.type == 'archetype') || {name: "Pas d'archetype"})
if (comp && comp.system) {
comp.tarot = EcrymeUtility.getTarot(comp.system.lametutelaire)
}
return comp;
}
/* -------------------------------------------- */
getElementsBio() {
let comp = duplicate(this.items.filter(item => item.type == 'elementbio') || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getTarots() {
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && !item.system.isgm) || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getHiddenTarots() {
let comp = duplicate(this.items.filter(item => item.type == 'tarot' && item.system.isgm) || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getArmes() {
let comp = duplicate(this.items.filter(item => item.type == 'arme') || [])
EcrymeUtility.sortArrayObjectsByName(comp)
return comp;
}
/* -------------------------------------------- */
getItemById(id) {
let item = this.items.find(item => item.id == id);
if (item) {
item = duplicate(item)
}
return item;
}
/* -------------------------------------------- */
async equipItem(itemId) {
let item = this.items.find(item => item.id == itemId)
if (item && item.system) {
if (item.type == "armor") {
let armor = this.items.find(item => item.id != itemId && item.type == "armor" && item.system.equipped)
if (armor) {
ui.notifications.warn("You already have an armor equipped!")
return
}
}
if (item.type == "shield") {
let shield = this.items.find(item => item.id != itemId && item.type == "shield" && item.system.equipped)
if (shield) {
ui.notifications.warn("You already have a shield equipped!")
return
}
}
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* ------------------------------------------- */
getEquipements() {
return this.items.filter(item => item.type == 'equipement')
}
/* ------------------------------------------- */
async buildContainerTree() {
let equipments = duplicate(this.items.filter(item => item.type == "equipment") || [])
for (let equip1 of equipments) {
if (equip1.system.iscontainer) {
equip1.system.contents = []
equip1.system.contentsEnc = 0
for (let equip2 of equipments) {
if (equip1._id != equip2.id && equip2.system.containerid == equip1.id) {
equip1.system.contents.push(equip2)
let q = equip2.system.quantity ?? 1
equip1.system.contentsEnc += q * equip2.system.weight
}
}
}
}
// Compute whole enc
let enc = 0
for (let item of equipments) {
//item.data.idrDice = EcrymeUtility.getDiceFromLevel(Number(item.data.idr))
if (item.system.equipped) {
if (item.system.iscontainer) {
enc += item.system.contentsEnc
} else if (item.system.containerid == "") {
let q = item.system.quantity ?? 1
enc += q * item.system.weight
}
}
}
for (let item of this.items) { // Process items/shields/armors
if ((item.type == "weapon" || item.type == "shield" || item.type == "armor") && item.system.equipped) {
let q = item.system.quantity ?? 1
enc += q * item.system.weight
}
}
// Store local values
this.encCurrent = enc
this.containersTree = equipments.filter(item => item.system.containerid == "") // Returns the root of equipements without container
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item && item.system) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
clearInitiative(){
this.getFlag("world", "initiative", -1)
}
/* -------------------------------------------- */
getInitiativeScore(combatId, combatantId) {
let init = Math.floor( (this.system.attributs.physique.value+this.system.attributs.habilite.value) / 2)
let subvalue = new Roll("1d20").roll({async: false})
return init + (subvalue.total / 100)
}
/* -------------------------------------------- */
getSubActors() {
let subActors = [];
for (let id of this.system.subactors) {
subActors.push(duplicate(game.actors.get(id)))
}
return subActors;
}
/* -------------------------------------------- */
async addSubActor(subActorId) {
let subActors = duplicate(this.system.subactors);
subActors.push(subActorId);
await this.update({ 'system.subactors': subActors });
}
/* -------------------------------------------- */
async delSubActor(subActorId) {
let newArray = [];
for (let id of this.system.subactors) {
if (id != subActorId) {
newArray.push(id);
}
}
await this.update({ 'system.subactors': newArray });
}
/* -------------------------------------------- */
async deleteAllItemsByType(itemType) {
let items = this.items.filter(item => item.type == itemType);
await this.deleteEmbeddedDocuments('Item', items);
}
/* -------------------------------------------- */
async addItemWithoutDuplicate(newItem) {
let item = this.items.find(item => item.type == newItem.type && item.name.toLowerCase() == newItem.name.toLowerCase())
if (!item) {
await this.createEmbeddedDocuments('Item', [newItem]);
}
}
/* -------------------------------------------- */
incDecFluide(value) {
let fluide = this.system.fluide + value
this.update( {'system.fluide': fluide} )
}
incDecDestin(value) {
let destin = this.system.pointdestin + value
this.update( {'system.pointdestin': destin} )
}
incDecMPMB(value) {
let mpmb = this.system.mpmb + value
this.update( {'system.mpmb': mpmb} )
}
incDecMPMN(value) {
let mpmn = this.system.mpmn + value
this.update( {'system.mpmn': mpmn} )
}
/* -------------------------------------------- */
incDecAttr(attrKey, value) {
let attr = duplicate(this.system.attributs[attrKey])
attr.value += value
this.update( { [`system.attributs.${attrKey}`]: attr})
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantity + incDec
if (newQ >= 0) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantity': newQ }]) // pdates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
async incDecAmmo(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.ammocurrent + incDec;
if (newQ >= 0 && newQ <= objetQ.system.ammomax) {
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.ammocurrent': newQ }]); // pdates one EmbeddedEntity
}
}
}
/* -------------------------------------------- */
getAtttributImage( attrKey) {
return `systems/fvtt-ecryme/images/icons/${attrKey}.webp`
}
/* -------------------------------------------- */
incDecDestin( value) {
let newValue = Math.max( this.system.pointdestin + value, 0)
this.update( {'system.pointdestin': newValue})
}
/* -------------------------------------------- */
getCommonRollData() {
let rollData = EcrymeUtility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.img = this.img
rollData.phyMalus = this.getPhysiqueMalus()
rollData.elementsbio = this.getElementsBio()
rollData.destin = this.system.pointdestin
rollData.isReroll = false
rollData.confrontationDegre = 0
rollData.confrontationModif = 0
console.log("ROLLDATA", rollData)
return rollData
}
/* -------------------------------------------- */
getPhysiqueMalus() {
if ( this.system.attributs.constitution.value <= 8) {
return -(9 - this.system.attributs.constitution.value)
}
return 0
}
/* -------------------------------------------- */
rollAttribut(attrKey) {
let attr = this.system.attributs[attrKey]
let rollData = this.getCommonRollData()
rollData.attr = duplicate(attr)
rollData.mode = "attribut"
rollData.title = attr.label
rollData.img = this.getAtttributImage(attrKey)
this.startRoll(rollData)
}
/* -------------------------------------------- */
rollArme(weaponId) {
let arme = this.items.get(weaponId)
if (arme) {
arme = duplicate(arme)
let rollData = this.getCommonRollData()
if (arme.system.armetype == "mainsnues" || arme.system.armetype == "epee") {
rollData.attr = { label: "(Physique+Habilité)/2", value: Math.floor( (this.getPhysiqueMalus()+this.system.attributs.physique.value+this.system.attributs.habilite.value) / 2) }
} else {
rollData.attr = duplicate(this.system.attributs.habilite)
}
rollData.mode = "arme"
rollData.arme = arme
rollData.img = arme.img
rollData.title = arme.name
this.startRoll(rollData)
} else {
ui.notifications.warn("Impossible de trouver l'arme concernée ")
}
}
/* -------------------------------------------- */
async startRoll(rollData) {
let rollDialog = await EcrymeRollDialog.create(this, rollData)
rollDialog.render(true)
}
}

View File

@ -0,0 +1,207 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { EcrymeUtility } from "./common/ecryme-utility.js";
/* -------------------------------------------- */
export class EcrymeNPCSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["Ecryme", "sheet", "actor"],
template: "systems/fvtt-ecryme/templates/npc-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: true
});
}
/* -------------------------------------------- */
async getData() {
const objectData = this.object.system
let actorData = duplicate(objectData)
let formData = {
title: this.title,
id: this.actor.id,
type: this.actor.type,
img: this.actor.img,
name: this.actor.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
data: actorData,
limited: this.object.limited,
skills: this.actor.getSkills( ),
weapons: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getWeapons()) ),
armors: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getArmors())),
shields: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getShields())),
spells: this.actor.checkAndPrepareEquipments( duplicate(this.actor.getLore())),
equipments: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquipmentsOnly()) ),
equippedWeapons: this.actor.checkAndPrepareEquipments(duplicate(this.actor.getEquippedWeapons()) ),
equippedArmor: this.actor.getEquippedArmor(),
equippedShield: this.actor.getEquippedShield(),
subActors: duplicate(this.actor.getSubActors()),
moneys: duplicate(this.actor.getMoneys()),
encCapacity: this.actor.getEncumbranceCapacity(),
saveRolls: this.actor.getSaveRoll(),
conditions: this.actor.getConditions(),
containersTree: this.actor.containersTree,
encCurrent: this.actor.encCurrent,
options: this.options,
owner: this.document.isOwner,
editScore: this.options.editScore,
isGM: game.user.isGM
}
this.formData = formData;
console.log("PC : ", formData, this.object);
return formData;
}
/* -------------------------------------------- */
/** @override */
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
html.bind("keydown", function(e) { // Ignore Enter in actores sheet
if (e.keyCode === 13) return false;
});
// Update Inventory Item
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
const item = this.actor.items.get( itemId );
item.sheet.render(true);
});
// Delete Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item")
EcrymeUtility.confirmDelete(this, li)
})
html.find('.item-add').click(ev => {
let dataType = $(ev.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: "NewItem", type: dataType }], { renderSheet: true })
})
html.find('.equip-activate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipActivate( itemId)
});
html.find('.equip-deactivate').click(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
this.actor.equipDeactivate( itemId)
});
html.find('.subactor-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
let actor = game.actors.get( actorId );
actor.sheet.render(true);
});
html.find('.subactor-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let actorId = li.data("actor-id");
this.actor.delSubActor(actorId);
});
html.find('.quantity-minus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), -1 );
} );
html.find('.quantity-plus').click(event => {
const li = $(event.currentTarget).parents(".item");
this.actor.incDecQuantity( li.data("item-id"), +1 );
} );
html.find('.ammo-minus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), -1 );
} );
html.find('.ammo-plus').click(event => {
const li = $(event.currentTarget).parents(".item")
this.actor.incDecAmmo( li.data("item-id"), +1 )
} );
html.find('.roll-ability').click((event) => {
const abilityKey = $(event.currentTarget).data("ability-key");
this.actor.rollAbility(abilityKey);
});
html.find('.roll-skill').click((event) => {
const li = $(event.currentTarget).parents(".item")
const skillId = li.data("item-id")
this.actor.rollSkill(skillId)
});
html.find('.roll-weapon').click((event) => {
const li = $(event.currentTarget).parents(".item");
const skillId = li.data("item-id")
this.actor.rollWeapon(skillId)
});
html.find('.roll-armor-die').click((event) => {
this.actor.rollArmorDie()
});
html.find('.roll-shield-die').click((event) => {
this.actor.rollShieldDie()
});
html.find('.roll-target-die').click((event) => {
this.actor.rollDefenseRanged()
});
html.find('.roll-save').click((event) => {
const saveKey = $(event.currentTarget).data("save-key")
this.actor.rollSave(saveKey)
});
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.getOwnedItem(itemId);
item.sheet.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
html.find('.update-field').change(ev => {
const fieldName = $(ev.currentTarget).data("field-name");
let value = Number(ev.currentTarget.value);
this.actor.update( { [`${fieldName}`]: value } );
});
}
/* -------------------------------------------- */
/** @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

@ -0,0 +1,40 @@
import { EcrymeUtility } from "./common/ecryme-utility.js";
/* -------------------------------------------- */
export class EcrymeCombat extends Combat {
/* -------------------------------------------- */
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
ids = typeof ids === "string" ? [ids] : ids;
for (let cId = 0; cId < ids.length; cId++) {
const c = this.combatants.get(ids[cId]);
let id = c._id || c.id;
let initBonus = c.actor ? c.actor.getInitiativeScore( this.id, id ) : -1;
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initBonus } ]);
}
return this;
}
/* -------------------------------------------- */
_onUpdate(changed, options, userId) {
}
/* -------------------------------------------- */
static async checkTurnPosition() {
while (game.combat.turn > 0) {
await game.combat.previousTurn()
}
}
/* -------------------------------------------- */
_onDelete() {
let combatants = this.combatants.contents
for (let c of combatants) {
let actor = game.actors.get(c.actorId)
actor.clearInitiative()
}
super._onDelete()
}
}

View File

@ -0,0 +1,145 @@
/* -------------------------------------------- */
import { EcrymeUtility } from "./common/ecryme-utility.js";
import { EcrymeCharacterSummary } from "./app/ecryme-summary-app.js"
/* -------------------------------------------- */
export class EcrymeCommands {
static init() {
if (!game.system.ecryme.commands) {
const commands = new EcrymeCommands();
commands.registerCommand({ path: ["/tirage"], func: (content, msg, params) => EcrymeCommands.createTirage(msg), descr: "Tirage des tarots" });
commands.registerCommand({ path: ["/carte"], func: (content, msg, params) => EcrymeCommands.tirerCarte(msg), descr: "Tirer une carte" });
commands.registerCommand({ path: ["/resume"], func: (content, msg, params) => EcrymeCharacterSummary.displayPCSummary(), descr: "Affiche la liste des PJs!" });
game.system.ecryme.commands = commands;
}
}
constructor() {
this.commandsTable = {}
}
/* -------------------------------------------- */
registerCommand(command) {
this._addCommand(this.commandsTable, command.path, '', command);
}
/* -------------------------------------------- */
_addCommand(targetTable, path, fullPath, command) {
if (!this._validateCommand(targetTable, path, command)) {
return;
}
const term = path[0];
fullPath = fullPath + term + ' '
if (path.length == 1) {
command.descr = `<strong>${fullPath}</strong>: ${command.descr}`;
targetTable[term] = command;
}
else {
if (!targetTable[term]) {
targetTable[term] = { subTable: {} };
}
this._addCommand(targetTable[term].subTable, path.slice(1), fullPath, command)
}
}
/* -------------------------------------------- */
_validateCommand(targetTable, path, command) {
if (path.length > 0 && path[0] && command.descr && (path.length != 1 || targetTable[path[0]] == undefined)) {
return true;
}
console.warn("crucibleCommands._validateCommand failed ", targetTable, path, command);
return false;
}
/* -------------------------------------------- */
/* Manage chat commands */
processChatCommand(commandLine, content = '', msg = {}) {
// Setup new message's visibility
let rollMode = game.settings.get("core", "rollMode");
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let command = commandLine[0].toLowerCase();
let params = commandLine.slice(1);
return this.process(command, params, content, msg);
}
/* -------------------------------------------- */
process(command, params, content, msg) {
return this._processCommand(this.commandsTable, command, params, content, msg);
}
/* -------------------------------------------- */
_processCommand(commandsTable, name, params, content = '', msg = {}, path = "") {
console.log("===> Processing command")
let command = commandsTable[name];
path = path + name + " ";
if (command && command.subTable) {
if (params[0]) {
return this._processCommand(command.subTable, params[0], params.slice(1), content, msg, path)
}
else {
this.help(msg, command.subTable);
return true;
}
}
if (command && command.func) {
const result = command.func(content, msg, params);
if (result == false) {
CrucibleCommands._chatAnswer(msg, command.descr);
}
return true;
}
return false;
}
/* -------------------------------------------- */
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
}
/* --------------------------------------------- */
static async createTirage(msg) {
if (game.user.isGM) {
let tirageData = {
state: 'select-player',
nbCard: 0,
maxPlayerCard: 4,
maxSecretCard: 1,
cards: [],
players: duplicate(game.users),
secretCards: [],
deck: EcrymeUtility.getTarots()
}
for (let i = 0; i < 4; i++) {
tirageData.cards.push({ name: "???", img: "systems/fvtt-ecryme/images/tarots/background.webp" })
}
tirageData.secretCards.push({ name: "???", img: "systems/fvtt-ecryme/images/tarots/background.webp" })
let tirageDialog = await EcrymeTirageTarotDialog.create(this, tirageData)
tirageDialog.render(true)
}
}
/* --------------------------------------------- */
static async tirerCarte(msg) {
let deck = EcrymeUtility.getTarots()
let index = Math.round(Math.random() * (deck.length-1))
let selectedCard = deck[index]
selectedCard.system.ispositif = true
if ( selectedCard.system.isdualside) { // Cas des cartes pouvant avoir 2 sens
selectedCard.system.ispositif = (Math.random() > 0.5)
}
selectedCard.system.isgm = false
selectedCard.value = (selectedCard.system.ispositif)? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
EcrymeUtility.createChatMessage(game.user.name, "", {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/display-tarot-card.hbs`, selectedCard)
})
}
}

View File

@ -0,0 +1,86 @@
export class EcrymeHotbar {
/**
* Create a macro when dropping an entity on the hotbar
* Item - open roll dialog for item
* Actor - open actor sheet
* Journal - open journal sheet
*/
static init( ) {
Hooks.on("hotbarDrop", async (bar, documentData, slot) => {
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
if (documentData.type == "Item") {
console.log("Drop done !!!", bar, documentData, slot)
let item = documentData.data
let command = `game.system.Ecryme.EcrymeHotbar.rollMacro("${item.name}", "${item.type}");`
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command))
if (!macro) {
macro = await Macro.create({
name: item.name,
type: "script",
img: item.img,
command: command
}, { displaySheet: false })
}
game.user.assignHotbarMacro(macro, slot);
}
// Create a macro to open the actor sheet of the actor dropped on the hotbar
else if (documentData.type == "Actor") {
let actor = game.actors.get(documentData.id);
let command = `game.actors.get("${documentData.id}").sheet.render(true)`
let macro = game.macros.contents.find(m => (m.name === actor.name) && (m.command === command));
if (!macro) {
macro = await Macro.create({
name: actor.data.name,
type: "script",
img: actor.data.img,
command: command
}, { displaySheet: false })
game.user.assignHotbarMacro(macro, slot);
}
}
// Create a macro to open the journal sheet of the journal dropped on the hotbar
else if (documentData.type == "JournalEntry") {
let journal = game.journal.get(documentData.id);
let command = `game.journal.get("${documentData.id}").sheet.render(true)`
let macro = game.macros.contents.find(m => (m.name === journal.name) && (m.command === command));
if (!macro) {
macro = await Macro.create({
name: journal.data.name,
type: "script",
img: "",
command: command
}, { displaySheet: false })
game.user.assignHotbarMacro(macro, slot);
}
}
return false;
});
}
/** Roll macro */
static rollMacro(itemName, itemType, bypassData) {
const speaker = ChatMessage.getSpeaker()
let actor
if (speaker.token) actor = game.actors.tokens[speaker.token]
if (!actor) actor = game.actors.get(speaker.actor)
if (!actor) {
return ui.notifications.warn(`Select your actor to run the macro`)
}
let item = actor.items.find(it => it.name === itemName && it.type == itemType)
if (!item ) {
return ui.notifications.warn(`Unable to find the item of the macro in the current actor`)
}
// Trigger the item roll
if (item.type === "weapon") {
return actor.rollWeapon( item.id)
}
if (item.type === "skill") {
return actor.rollSkill( item.id)
}
}
}

View File

@ -0,0 +1,134 @@
/* -------------------------------------------- */
import { EcrymeUtility } from "./common/ecryme-utility.js";
/* -------------------------------------------- */
export class EcrymeCharacterSummary extends Application {
/* -------------------------------------------- */
static displayPCSummary() {
if (game.user.isGM) {
game.system.ecryme.charSummary.render(true)
} else {
ui.notifications.info("Commande /tirage réservée au MJ !")
}
}
/* -------------------------------------------- */
updatePCSummary() {
if (this.rendered) {
this.render(true)
}
}
/* -------------------------------------------- */
static createSummaryPos() {
return { top: 200, left: 200 };
}
/* -------------------------------------------- */
static ready() {
if (!game.user.isGM) { // Uniquement si GM
return
}
let charSummary = new EcrymeCharacterSummary()
game.system.ecryme.charSummary = charSummary
}
/* -------------------------------------------- */
constructor() {
super();
//game.settings.set("world", "character-summary-data", {npcList: [], x:0, y:0})
this.settings = game.settings.get("world", "character-summary-data")
}
/* -------------------------------------------- */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
template: "systems/fvtt-ecryme/templates/dialogs/character-summary.hbs",
popOut: true,
resizable: true,
dragDrop: [{ dragSelector: ".items-list .item", dropSelector: null }],
classes: ["bol", "dialog"], width: 920, height: 'fit-content'
})
}
/* -------------------------------------------- */
getData() {
let formData = super.getData();
formData.pcs = game.actors.filter(ac => ac.type == "personnage" && ac.hasPlayerOwner)
formData.npcs = []
let newList = []
let toUpdate = false
for (let actorId of this.settings.npcList) {
let actor = game.actors.get(actorId)
if (actor) {
formData.npcs.push(actor)
newList.push(actorId)
} else {
toUpdate = true
}
}
formData.config = game.system.ecryme.config
if (toUpdate) {
this.settings.npcList = newList
//console.log("Going to update ...", this.settings)
game.settings.set("world", "character-summary-data", this.settings)
}
return formData
}
/* -------------------------------------------- */
updateNPC() {
game.settings.set("world", "character-summary-data", game.system.ecryme.charSummary.settings)
game.system.ecryme.charSummary.close()
setTimeout(function () { game.system.ecryme.charSummary.render(true) }, 500)
}
/* -------------------------------------------- */
async _onDrop(event) {
//console.log("Dragged data are : ", dragData)
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse(data)
let actor = fromUuidSync(dataItem.uuid)
if (actor) {
game.system.ecryme.charSummary.settings.npcList.push(actor.id)
game.system.ecryme.charSummary.updateNPC()
} else {
ui.notifications.warn("Pas d'acteur trouvé")
}
}
/* -------------------------------------------- */
/** @override */
async activateListeners(html) {
super.activateListeners(html);
html.find('.actor-open').click((event) => {
const li = $(event.currentTarget).parents(".item")
const actor = game.actors.get(li.data("actor-id"))
actor.sheet.render(true)
})
html.find('.summary-roll').click((event) => {
const li = $(event.currentTarget).parents(".item")
const actor = game.actors.get(li.data("actor-id"))
let type = $(event.currentTarget).data("type")
let key = $(event.currentTarget).data("key")
actor.rollAttribut(key)
})
html.find('.actor-delete').click(event => {
const li = $(event.currentTarget).parents(".item");
let actorId = li.data("actor-id")
let newList = game.system.ecryme.charSummary.settings.npcList.filter(id => id != actorId)
game.system.ecryme.charSummary.settings.npcList = newList
game.system.ecryme.charSummary.updateNPC()
})
}
}

View File

@ -0,0 +1,3 @@
export const ECRYME_CONFIG = {
}

View File

@ -0,0 +1,567 @@
/* -------------------------------------------- */
import { EcrymeCommands } from "./ecryme-commands.js";
/* -------------------------------------------- */
export class EcrymeUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => EcrymeUtility.chatListeners(html));
this.rollDataStore = {}
this.defenderStore = {}
EcrymeCommands.init();
}
/* -------------------------------------------- */
static async ready() {
Handlebars.registerHelper('count', function (list) {
return list.length;
})
Handlebars.registerHelper('includes', function (array, val) {
return array.includes(val);
})
Handlebars.registerHelper('upper', function (text) {
return text.toUpperCase();
})
Handlebars.registerHelper('lower', function (text) {
return text.toLowerCase()
})
Handlebars.registerHelper('upperFirst', function (text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
})
Handlebars.registerHelper('notEmpty', function (list) {
return list.length > 0;
})
Handlebars.registerHelper('mul', function (a, b) {
return parseInt(a) * parseInt(b);
})
Handlebars.registerHelper('add', function (a, b) {
return parseInt(a) + parseInt(b);
})
game.settings.register("world", "character-summary-data", {
name: "character-summary-data",
scope: "world",
config: false,
default: { npcList: [], x: 200, y: 200 },
type: Object
})
const tarots = await EcrymeUtility.loadCompendium("fvtt-ecryme.ecryme-tarots")
this.tarots = tarots.map(i => i.toObject())
}
/*-------------------------------------------- */
static upperFirst(text) {
if (typeof text !== 'string') return text
return text.charAt(0).toUpperCase() + text.slice(1)
}
/*-------------------------------------------- */
static getTarots() {
return duplicate(this.tarots)
}
static getTarot(tId) {
return this.tarots.find(t => t._id == tId)
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium)
return await pack?.getDocuments() ?? []
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await EcrymeUtility.loadCompendiumData(compendium)
return compendiumData.filter(filter)
}
/* -------------------------------------------- */
static getActorFromRollData(rollData) {
let actor = game.actors.get(rollData.actorId)
if (rollData.tokenId) {
let token = canvas.tokens.placeables.find(t => t.id == rollData.tokenId)
if (token) {
actor = token.actor
}
}
return actor
}
/* -------------------------------------------- */
static drawDeckCard(msgId) {
if (game.user.isGM) {
game.system.ecryme.currentTirage.addCard(msgId)
} else {
game.socket.emit( "system.fvtt-ecryme", {name: "msg-draw-card", data: {msgId: msgId}})
}
}
/* -------------------------------------------- */
static async chatListeners(html) {
html.on("click", '.roll-destin', event => {
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
let message = game.messages.get(messageId)
let rollData = message.getFlag("world", "rolldata")
let actor = this.getActorFromRollData(rollData)
actor.incDecDestin(-1)
rollData.isReroll = true
this.rollEcryme(rollData)
})
html.on("click", '.draw-tarot-card', event => {
let messageId = EcrymeUtility.findChatMessageId(event.currentTarget)
this.drawDeckCard(messageId)
})
}
/* -------------------------------------------- */
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-ecryme/templates/actors/editor-notes-gm.hbs',
'systems/fvtt-ecryme/templates/items/partial-item-nav.hbs',
'systems/fvtt-ecryme/templates/items/partial-item-description.hbs'
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static removeChatMessageId(messageId) {
if (messageId) {
game.messages.get(messageId)?.delete();
}
}
static findChatMessageId(current) {
return EcrymeUtility.getChatMessageId(EcrymeUtility.findChatMessage(current));
}
static getChatMessageId(node) {
return node?.attributes.getNamedItem('data-message-id')?.value;
}
static findChatMessage(current) {
return EcrymeUtility.findNodeMatching(current, it => it.classList.contains('chat-message') && it.attributes.getNamedItem('data-message-id'));
}
static findNodeMatching(current, predicate) {
if (current) {
if (predicate(current)) {
return current;
}
return EcrymeUtility.findNodeMatching(current.parentElement, predicate);
}
return undefined;
}
/* -------------------------------------------- */
static createDirectOptionList(min, max) {
let options = {};
for (let i = min; i <= max; i++) {
options[`${i}`] = `${i}`;
}
return options;
}
/* -------------------------------------------- */
static buildListOptions(min, max) {
let options = ""
for (let i = min; i <= max; i++) {
options += `<option value="${i}">${i}</option>`
}
return options;
}
/* -------------------------------------------- */
static getTarget() {
if (game.user.targets) {
for (let target of game.user.targets) {
return target
}
}
return undefined
}
/* -------------------------------------------- */
static updateRollData(rollData) {
let id = rollData.rollId
let oldRollData = this.rollDataStore[id] || {}
let newRollData = mergeObject(oldRollData, rollData)
this.rollDataStore[id] = newRollData
}
/* -------------------------------------------- */
static async onSocketMesssage(msg) {
console.log("SOCKET MESSAGE", msg.name)
if (msg.name == "msg-draw-card") {
if ( game.user.isGM && game.system.ecryme.currentTirage) {
game.system.ecryme.currentTirage.addCard(msg.data.msgId)
}
}
}
/* -------------------------------------------- */
static async searchItem(dataItem) {
let item
if (dataItem.pack) {
let id = dataItem.id || dataItem._id
let items = await this.loadCompendium(dataItem.pack, item => item.id == id)
item = items[0] || undefined
} else {
item = game.items.get(dataItem.id)
}
return item
}
/* -------------------------------------------- */
static chatDataSetup(content, modeOverride, isRoll = false, forceWhisper) {
let chatData = {
user: game.user.id,
rollMode: modeOverride || game.settings.get("core", "rollMode"),
content: content
};
if (["gmroll", "blindroll"].includes(chatData.rollMode)) chatData["whisper"] = ChatMessage.getWhisperRecipients("GM").map(u => u.id);
if (chatData.rollMode === "blindroll") chatData["blind"] = true;
else if (chatData.rollMode === "selfroll") chatData["whisper"] = [game.user];
if (forceWhisper) { // Final force !
chatData["speaker"] = ChatMessage.getSpeaker();
chatData["whisper"] = ChatMessage.getWhisperRecipients(forceWhisper);
}
return chatData;
}
/* -------------------------------------------- */
static async showDiceSoNice(roll, rollMode) {
if (game.modules.get("dice-so-nice")?.active) {
if (game.dice3d) {
let whisper = null;
let blind = false;
rollMode = rollMode ?? game.settings.get("core", "rollMode");
switch (rollMode) {
case "blindroll": //GM only
blind = true;
case "gmroll": //GM + rolling player
whisper = this.getUsers(user => user.isGM);
break;
case "roll": //everybody
whisper = this.getUsers(user => user.active);
break;
case "selfroll":
whisper = [game.user.id];
break;
}
await game.dice3d.showForRoll(roll, game.user, true, whisper, blind);
}
}
}
/* -------------------------------------------- */
static processSpecialCard(actor, rollData) {
if (rollData.selectedCard.name.toLowerCase().includes("archange")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("archange"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: `Conséquence supplémentaire ! <br>L'Archange : ${actor.name} gagne 1 point de Spiritualité.` })
actor.incDecAttr("spiritualite", 1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("vicaire")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("vicaire"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Blanche (MPMB, secret).` })
actor.incDecMPMB(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("chance")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("chance"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: `Conséquence supplémentaire ! <br>La Chance : ${actor.name} a gagné 1 point de Destin.` })
actor.incDecDestin(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("mort")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("mort"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: `Conséquence supplémentaire ! <br>La Mort : ${actor.name} est pétrifié par la peur.` })
actor.incDecDestin(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("diable")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("diable"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: `Conséquence supplémentaire ! <br>Le Diable : ${actor.name} gagne 1 point de Rationnalité.` })
actor.incDecAttr("rationnalite", 1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("lune noire")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("lune noire"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).` })
actor.incDecFluide(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("grand livre")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("grand livre"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
content: `Conséquence supplémentaire ! <br>La Lune Noire : ${actor.name} vient de gagner 1 point de Fluide (secret).` })
actor.incDecFluide(1)
}
}
if (rollData.selectedCard.name.toLowerCase().includes("sorcier")) {
let actorCard = actor.items.find( c => c.type =="tarot" && c.name.toLowerCase().includes("sorcier"))
if (actorCard) {
EcrymeUtility.createChatMessage(actor.name, "blindroll", {
content: `Conséquence supplémentaire ! <br>Le Vicaire : ${actor.name} vient de gagner 1 point en Pratique de la Magie Noire (MPMN, secret).` })
actor.incDecMPMN(1)
}
}
}
/* -------------------------------------------- */
static computeResults(rollData) {
rollData.isSuccess = false
if (rollData.total <= rollData.target) {
rollData.isSuccess = true
}
if (rollData.total == 1) {
rollData.isSuccess = true
rollData.isCritical = true
}
if (rollData.total == 20) {
rollData.isSuccess = false
rollData.isFumble = true
}
if (rollData.total <= Math.floor(rollData.target / 3)) {
rollData.isPart = true
}
}
/* -------------------------------------------- */
static async tirageConfrontationEcryme(rollData) {
let actor = game.actors.get(rollData.actorId)
rollData.target = rollData.attr.value - rollData.confrontationDegre + rollData.confrontationModif
let deck = this.getTarots()
let index = Math.round(Math.random() * (deck.length-1))
let selectedCard = deck[index]
selectedCard.system.ispositif = (Math.random() > 0.5)
selectedCard.value = (selectedCard.system.ispositif)? selectedCard.system.numericvalueup : selectedCard.system.numericvaluedown
rollData.total = selectedCard.value
rollData.selectedCard = selectedCard
await EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/display-tarot-card.hbs`, selectedCard)
})
this.computeResults(rollData)
if (rollData.isSuccess) {
rollData.gainAttr = Math.ceil(rollData.confrontationDegre/2) + ((rollData.isCritical ) ? 1 : 0)
actor.incDecAttr(rollData.attr.abbrev, rollData.gainAttr )
} else {
rollData.gainAttr = rollData.confrontationDegre
actor.incDecAttr(rollData.attr.abbrev, -rollData.gainAttr )
}
await EcrymeUtility.createChatMessage(actor.name, "gmroll", {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-confrontation-result.hbs`, rollData)
})
this.processSpecialCard(actor, rollData)
}
/* -------------------------------------------- */
static async rollEcryme(rollData) {
let actor = game.actors.get(rollData.actorId)
// Build the dice formula
let diceFormula = "1d20"
rollData.target = rollData.attr.value + rollData.bonusMalusPerso + rollData.bonusMalusSituation + rollData.bonusMalusDef + rollData.bonusMalusPortee
if (rollData.attr.abbrev == "physique") {
rollData.target += rollData.phyMalus
}
rollData.diceFormula = diceFormula
// Performs roll
console.log("Roll formula", diceFormula)
let myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
rollData.total = myRoll.total
this.computeResults(rollData)
let msg = await this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-ecryme/templates/chat/chat-generic-result.hbs`, rollData)
})
msg.setFlag("world", "rolldata", rollData)
if (rollData.mode == "initiative") {
actor.setFlag("world", "initiative", myRoll.total)
}
console.log("Rolldata result", rollData)
}
/* -------------------------------------------- */
static sortArrayObjectsByName(myArray) {
myArray.sort((a, b) => {
let fa = a.name.toLowerCase();
let fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
/* -------------------------------------------- */
static getUsers(filter) {
return game.users.filter(filter).map(user => user.id);
}
/* -------------------------------------------- */
static getWhisperRecipients(rollMode, name) {
switch (rollMode) {
case "blindroll": return this.getUsers(user => user.isGM);
case "gmroll": return this.getWhisperRecipientsAndGMs(name);
case "useronly": return this.getWhisperRecipientsOnly(name);
case "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
static getWhisperRecipientsOnly(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1
}
/* -------------------------------------------- */
static getWhisperRecipientsAndGMs(name) {
let recep1 = ChatMessage.getWhisperRecipients(name) || [];
return recep1.concat(ChatMessage.getWhisperRecipients('GM'));
}
/* -------------------------------------------- */
static blindMessageToGM(chatOptions) {
let chatGM = duplicate(chatOptions);
chatGM.whisper = this.getUsers(user => user.isGM);
chatGM.content = "Blinde message of " + game.user.name + "<br>" + chatOptions.content;
console.log("blindMessageToGM", chatGM);
game.socket.emit("system.fvtt-ecryme", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */
static split3Columns(data) {
let array = [[], [], []];
if (data == undefined) return array;
let col = 0;
for (let key in data) {
let keyword = data[key];
keyword.key = key; // Self-reference
array[col].push(keyword);
col++;
if (col == 3) col = 0;
}
return array;
}
/* -------------------------------------------- */
static async createChatMessage(name, rollMode, chatOptions) {
switch (rollMode) {
case "blindroll": // GM only
if (!game.user.isGM) {
this.blindMessageToGM(chatOptions);
chatOptions.whisper = [game.user.id];
chatOptions.content = "Message only to the GM";
}
else {
chatOptions.whisper = this.getUsers(user => user.isGM);
}
break;
default:
chatOptions.whisper = this.getWhisperRecipients(rollMode, name);
break;
}
chatOptions.alias = chatOptions.alias || name;
return await ChatMessage.create(chatOptions);
}
/* -------------------------------------------- */
static getBasicRollData() {
let rollData = {
rollId: randomID(16),
bonusMalusPerso: 0,
bonusMalusSituation: 0,
bonusMalusDef: 0,
bonusMalusPortee: 0,
rollMode: game.settings.get("core", "rollMode")
}
EcrymeUtility.updateWithTarget(rollData)
return rollData
}
/* -------------------------------------------- */
static updateWithTarget(rollData) {
let target = EcrymeUtility.getTarget()
if (target) {
rollData.defenderTokenId = target.id
}
}
/* -------------------------------------------- */
static async createChatWithRollMode(name, chatOptions) {
return await this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions)
}
/* -------------------------------------------- */
static async confirmDelete(actorSheet, li) {
let itemId = li.data("item-id");
let msgTxt = "<p>Are you sure to remove this Item ?";
let buttons = {
delete: {
icon: '<i class="fas fa-check"></i>',
label: "Yes, remove it",
callback: () => {
actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]);
li.slideUp(200, () => actorSheet.render(false));
}
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Cancel"
}
}
msgTxt += "</p>";
let d = new Dialog({
title: "Confirm removal",
content: msgTxt,
buttons: buttons,
default: "cancel"
});
d.render(true);
}
}

View File

@ -0,0 +1,92 @@
import { EcrymeUtility } from "./ecryme-utility.js";
export class EcrymeRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData) {
let options = { classes: ["EcrymeDialog"], width: 540, height: 'fit-content', 'z-index': 99999 }
let html
if (rollData.attr && rollData.attr.iscard) {
html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/confrontation-dialog.hbs', rollData);
} else {
html = await renderTemplate('systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs', rollData);
}
return new EcrymeRollDialog(actor, rollData, html, options);
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let isCard = rollData.attr && rollData.attr.iscard
let conf = {
title: (isCard) ? "Jet" : "Tirage",
content: html,
buttons: {
roll: {
icon: '<i class="fas fa-check"></i>',
label: (isCard) ? "Tirer une carte" : "Lancer le dé",
callback: () => { this.roll() }
},
cancel: {
icon: '<i class="fas fa-times"></i>',
label: "Annuler",
callback: () => { this.close() }
}
},
close: close
}
super(conf, options);
this.actor = actor;
this.rollData = rollData;
}
/* -------------------------------------------- */
roll() {
let isCard = this.rollData.attr && this.rollData.attr.iscard
if (isCard) {
EcrymeUtility.tirageConfrontationEcryme(this.rollData)
} else {
EcrymeUtility.rollEcryme(this.rollData)
}
}
/* -------------------------------------------- */
async refreshDialog() {
const content = await renderTemplate("systems/fvtt-ecryme/templates/dialogs/roll-dialog-generic.hbs", this.rollData)
this.data.content = content
this.render(true)
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#bonusMalusSituation').change((event) => {
this.rollData.bonusMalusSituation = Number(event.currentTarget.value)
})
html.find('#bonusMalusPerso').change((event) => {
this.rollData.bonusMalusPerso = Number(event.currentTarget.value)
})
html.find('#bonusMalusDef').change((event) => {
this.rollData.bonusMalusDef = Number(event.currentTarget.value)
})
html.find('#bonusMalusPortee').change((event) => {
this.rollData.bonusMalusPortee = Number(event.currentTarget.value)
})
html.find('#confrontationDegre').change((event) => {
this.rollData.confrontationDegre = Number(event.currentTarget.value)
})
html.find('#confrontationModif').change((event) => {
this.rollData.confrontationModif = Number(event.currentTarget.value)
})
}
}

146
modules/ecryme-main.js Normal file
View File

@ -0,0 +1,146 @@
/**
* Ecryme system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { EcrymeActor } from "./actors/ecryme-actor.js";
import { EcrymeItemSheet } from "./items/ecryme-item-sheet.js";
import { EcrymeActorSheet } from "./actors/ecryme-actor-sheet.js";
import { EcrymeNPCSheet } from "./actors/ecryme-npc-sheet.js";
import { EcrymeUtility } from "./common/ecryme-utility.js";
import { EcrymeCombat } from "./app/ecryme-combat.js";
import { EcrymeItem } from "./items/ecryme-item.js";
import { EcrymeHotbar } from "./app/ecryme-hotbar.js"
import { EcrymeCharacterSummary } from "./app/ecryme-summary-app.js"
import { MALEFICES_CONFIG } from "./common/ecryme-config.js"
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing Ecryme RPG`);
game.system.ecryme = {
config: ECRYME_CONFIG,
EcrymeHotbar
}
/* -------------------------------------------- */
// preload handlebars templates
EcrymeUtility.preloadHandlebarsTemplates();
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d6",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-ecryme", data => {
EcrymeUtility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = EcrymeCombat
CONFIG.Actor.documentClass = EcrymeActor
CONFIG.Item.documentClass = EcrymeItem
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-ecryme", EcrymeActorSheet, { types: ["personnage"], makeDefault: true });
Actors.registerSheet("fvtt-ecryme", EcrymeNPCSheet, { types: ["pnj"], makeDefault: false });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-ecryme", EcrymeItemSheet, { makeDefault: true });
EcrymeUtility.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
if (game.user.isGM) {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-ecryme"><span class="rdd-roll-part">
<strong>Bienvenu dans Ecryme, le JDR qui sent le souffre !</strong>
<p>Le Livre de Base de Maléfices v4 est nécessaire pour jouer : https://arkhane-asylum.fr/en/ecryme/</p>
<p>Maléfices et un jeu de rôle publié par Arkhane Asylum Publishing, tout les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien avec l'aide de la Dame du Lac et Malik, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
<p>Commandes : /tirage pour le tirage des tarots, /carte pour tirer une simple carte et /resume pour le résumé des PJs (MJ seulement)` });
}
}
/* -------------------------------------------- */
// Register world usage statistics
function registerUsageCount(registerKey) {
if (game.user.isGM) {
game.settings.register(registerKey, "world-key", {
name: "Unique world key",
scope: "world",
config: false,
default: "",
type: String
});
let worldKey = game.settings.get(registerKey, "world-key")
if (worldKey == undefined || worldKey == "") {
worldKey = randomID(32)
game.settings.set(registerKey, "world-key", worldKey)
}
// Simple API counter
let regURL = `https://www.uberwald.me/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.version}"`
//$.ajaxSetup({
//headers: { 'Access-Control-Allow-Origin': '*' }
//})
$.ajax(regURL)
}
}
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.once("ready", function () {
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage relié au joueur !");
ChatMessage.create({
content: "<b>WARNING</b> Le joueur " + game.user.name + " n'est pas relié à un personnage !",
user: game.user._id
});
}
registerUsageCount('fvtt-ecryme')
welcomeMessage();
EcrymeUtility.ready()
EcrymeCharacterSummary.ready()
})
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.ecryme.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});

View File

@ -0,0 +1,186 @@
import { EcrymeUtility } from "./common/ecryme-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class EcrymeItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-ecryme", "sheet", "item"],
template: "systems/fvtt-ecryme/templates/item-sheet.hbs",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 580,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }]
});
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
// Add "Post to chat" button
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
buttons.unshift(
{
class: "post",
icon: "fas fa-comment",
onclick: ev => { }
})
return buttons
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
if (this.item.type.includes('weapon')) {
position.width = 640;
}
return position;
}
/* -------------------------------------------- */
async getData() {
let formData = {
title: this.title,
id: this.id,
type: this.object.type,
img: this.object.img,
name: this.object.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: duplicate(this.object.system),
config: duplicate(game.system.ecryme.config),
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, { async: true }),
notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }),
isGM: game.user.isGM
}
if ( this.object.type == "archetype") {
formData.tarots = EcrymeUtility.getTarots()
}
this.options.editable = !(this.object.origin == "embeddedItem");
console.log("ITEM DATA", formData, this);
return formData;
}
/* -------------------------------------------- */
_getHeaderButtons() {
let buttons = super._getHeaderButtons();
buttons.unshift({
class: "post",
icon: "fas fa-comment",
onclick: ev => this.postItem()
});
return buttons
}
/* -------------------------------------------- */
postItem() {
let chatData = duplicate(this.item)
if (this.actor) {
chatData.actor = { id: this.actor.id };
}
// Don't post any image for the item (which would leave a large gap) if the default image is used
if (chatData.img.includes("/blank.png")) {
chatData.img = null;
}
// JSON object for easy creation
chatData.jsondata = JSON.stringify(
{
compendium: "postedItem",
payload: chatData,
});
renderTemplate('systems/Ecryme/templates/post-item.html', chatData).then(html => {
let chatOptions = EcrymeUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
async viewSubitem(ev) {
let levelIndex = Number($(ev.currentTarget).parents(".item").data("level-index"))
let choiceIndex = Number($(ev.currentTarget).parents(".item").data("choice-index"))
let featureId = $(ev.currentTarget).parents(".item").data("feature-id")
let itemData = this.object.system.levels[levelIndex].choices[choiceIndex].features[featureId]
if (itemData.name != 'None') {
let item = await Item.create(itemData, { temporary: true });
item.system.origin = "embeddedItem";
new EcrymeItemSheet(item).render(true);
}
}
/* -------------------------------------------- */
async deleteSubitem(ev) {
let field = $(ev.currentTarget).data('type');
let idx = Number($(ev.currentTarget).data('index'));
let oldArray = this.object.system[field];
let itemData = this.object.system[field][idx];
if (itemData.name != 'None') {
let newArray = [];
for (var i = 0; i < oldArray.length; i++) {
if (i != idx) {
newArray.push(oldArray[i]);
}
}
this.object.update({ [`system.${field}`]: newArray });
}
}
/* -------------------------------------------- */
/** @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.object.options.actor.getOwnedItem(li.data("item-id"));
item.sheet.render(true);
});
html.find('.delete-subitem').click(ev => {
this.deleteSubitem(ev);
});
// Update Inventory Item
html.find('.item-delete').click(ev => {
const li = $(ev.currentTarget).parents(".item");
let itemId = li.data("item-id");
let itemType = li.data("item-type");
});
}
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/fvtt-ecryme/templates/items/item-${type}-sheet.hbs`
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData)
}
}

View File

@ -0,0 +1,25 @@
import { MaleficesUtility } from "./malefices-utility.js";
export const defaultItemImg = {
arme: "systems/fvtt-malefices/images/icons/arme.webp",
equipement: "systems/fvtt-malefices/images/icons/equipement.webp",
elementbio: "systems/fvtt-malefices/images/icons/wisdom.webp",
archetype: "systems/fvtt-malefices/images/icons/archetype.webp",
tarot: "systems/fvtt-malefices/images/icons/tarot.webp",
sortilege: "systems/fvtt-malefices/images/icons/sortilege.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class MaleficesItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}

1327
styles/ecryme.css Normal file

File diff suppressed because it is too large Load Diff

48
system.json Normal file
View File

@ -0,0 +1,48 @@
{
"description": "Ecryme",
"esmodules": [
"modules/ecryme-main.js"
],
"gridDistance": 1,
"gridUnits": "u",
"languages": [
{
"lang": "fr",
"name": "French",
"path": "lang/fr.json",
"flags": {}
},
{
"lang": "en",
"name": "English",
"path": "lang/en.json",
"flags": {}
}
],
"authors": [
{
"name": "Uberwald",
"flags": {}
}
],
"packs": [
],
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme/raw/branch/master/system.json",
"compatibility": {
"minimum": "10",
"verified": "10"
},
"id": "fvtt-ecryme",
"primaryTokenAttribute": "secondary.health",
"secondaryTokenAttribute": "secondary.delirium",
"socket": true,
"styles": [
"styles/ecryme.css"
],
"title": "Ecryme, le Jeu de Rôles",
"url": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme",
"version": "10.0.0",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-ecryme/archive/fvtt-ecryme-v10.0.0.zip",
"background": "systems/fvtt-ecryme/images/ui/accueil_01.webp"
}

146
template.json Normal file
View File

@ -0,0 +1,146 @@
{
"Actor": {
"types": [
"personnage"
],
"templates": {
"biodata": {
"biodata": {
"age": 0,
"size": "",
"lieunaissance": "",
"nationalite": "",
"profession": "",
"residence": "",
"milieusocial": "",
"poids": "",
"cheveux": "",
"sexe": "",
"yeux": "",
"enfance": "",
"adulte": "",
"loisirs": "",
"singularite": "",
"politique": "",
"religion": "",
"fantastique": "",
"description": "",
"gmnotes": ""
}
},
"core": {
"subactors": [],
"lamesdestin": [],
"pointdestin": 1,
"fluide": 5,
"mpmb": 0,
"mpmn": 0,
"attributs": {
"constitution": {
"label": "Constitution",
"abbrev": "constitution",
"value": 0,
"hasmax": true,
"max": 0
},
"physique": {
"label": "Aptitudes Physiques",
"abbrev": "physique",
"value": 0,
"max": 0
},
"culturegenerale": {
"label": "Culture Générale",
"abbrev": "culturegenerale",
"value": 0,
"max": 0
},
"habilite": {
"label": "Habilité",
"abbrev": "habilite",
"value": 0,
"max": 0
},
"perception": {
"label": "Perception",
"abbrev": "perception",
"value": 0,
"max": 0
},
"spiritualite": {
"label": "Spiritualite",
"abbrev": "spiritualite",
"hasmax": false,
"iscard": true,
"value": 0,
"max": 0
},
"rationnalite": {
"label": "Rationnalite",
"abbrev": "rationnalite",
"hasmax": false,
"iscard": true,
"value": 0,
"max": 0
}
},
"equipementlibre": ""
},
"npccore": {
"npctype": "",
"description": ""
}
},
"personnage": {
"templates": [
"biodata",
"core"
]
}
},
"Item": {
"types": [
"arme",
"equipement",
"archetype",
"tarot",
"sortilege",
"elementbio"
],
"templates": {},
"elementbio": {
"description": ""
},
"equipement": {
"description": ""
},
"tarot": {
"tarottype": "",
"numericvalueup": 0,
"numericvaluedown": 0,
"isdualside": false,
"ispositif": true,
"isgm": false,
"description": ""
},
"archetype": {
"lametutelaire": "",
"description": ""
},
"sortilege": {
"seuil": 0,
"description": ""
},
"arme": {
"armetype": "",
"porteecourte": "",
"porteemoyenne": "",
"dommagenormale": 0,
"dommagepart": 0,
"dommagecritique": 0,
"dommagecritiqueKO": false,
"dommagecritiquemort": false,
"description": ""
}
}
}

View File

@ -0,0 +1,415 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields">
<div class="flexrow">
<div class="profile-img-container">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
</div>
<div class="flexcol">
<h1 class="charname margin-right"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<ul>
<li class="flexrow item">
<label class="item-name-label-long">Milieu social</label>
<input type="text" class="item-field-label-long" name="system.biodata.milieusocial" value="{{system.biodata.milieusocial}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-long">Profession</label>
<input type="text" class="item-field-label-long" name="system.biodata.profession" value="{{system.biodata.profession}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="main">Principal</a>
<a class="item" data-tab="equipements">Equipement</a>
<a class="item" data-tab="biodata">Biographie</a>
<a class="item" data-tab="notes">Notes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Skills Tab --}}
<div class="tab main" data-group="primary" data-tab="main">
<div class="grid grid-2col">
<div>
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Attributs</label></h3>
</span>
</li>
{{#each system.attributs as |attr key|}}
<li class="item flexrow list-item">
<span class="item-name-label-long">
<a class="roll-attribut" data-attr-key="{{key}}">{{attr.label}}
{{#if attr.iscard}}
<i class="fa-solid fa-cards-blank"></i>
{{else}}
<i class="fa-solid fa-dice-d20"></i>
{{/if}}
</a></span>
<input type="text" class="item-field-label-short" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number"/>
{{#if attr.hasmax}}
<input type="text" class="item-field-label-short" name="system.attributs.{{key}}.max" value="{{attr.max}}" data-dtype="Number"/>
{{/if}}
{{#if (eq key "physique")}}
{{#if @root.phyMalus}}
({{@root.phyMalus}})
{{/if}}
{{/if}}
</li>
{{/each}}
<li class="item flexrow list-item">
<span class="item-field-label-long">Points de Destin</span>
<input type="text" class="item-field-label-short" name="system.pointdestin" value="{{system.pointdestin}}" data-dtype="Number"/>
</li>
{{#if isGM}}
<li class="item flexrow list-item">
<span class="item-field-label-long">Fluide (MJ)</span>
<input type="text" class="item-field-label-short" name="system.fluide" value="{{system.fluide}}" data-dtype="Number"/>
</li>
<li class="item flexrow list-item">
<span class="item-field-label-long">MPMB (MJ)</span>
<input type="text" class="item-field-label-short" name="system.mpmb" value="{{system.mpmb}}" data-dtype="Number"/>
</li>
<li class="item flexrow list-item">
<span class="item-field-label-long">MPMN (MJ)</span>
<input type="text" class="item-field-label-short" name="system.mpmn" value="{{system.mpmn}}" data-dtype="Number"/>
</li>
{{/if}}
</ul>
</div>
<div>
<ul class="stat-list alternate-list item-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armes</label></h3>
</span>
</li>
{{#each armes as |arme key|}}
<li class="item flexrow list-item">
<span class="item-field-label-long"><a class="roll-arme" data-arme-id="{{arme._id}}">{{arme.name}}<i class="fa-solid fa-dice-d20"></i></a></span>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Elements biographiques</label></h3>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="elementbio" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each elementsbio as |elem key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{elem._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{elem.img}}" /></a>
<span class="item-name-label">{{elem.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab equipements" data-group="primary" data-tab="equipements">
<span class="item-name-label-header items-title-bg">
<h3><label class="items-title-text">Equipements (saisie libre)</label></h3>
</span>
<div class="form-group small-editor">
{{editor equipementlibre target="system.equipementlibre" button=true owner=owner editable=editable}}
</div>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Armes</label></h3>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Normaux</label>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Particulier</label>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Critique</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each armes as |arme key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{arme._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{arme.img}}" /></a>
<span class="item-name-label">{{arme.name}}</span>
<span class="item-field-label-medium"><label>{{arme.system.dommagenormale}}</label></span>
<span class="item-field-label-medium"><label>{{arme.system.dommagepart}}</label></span>
<span class="item-field-label-medium"><label>{{arme.system.dommagecritique}}</label></span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Equipements (Items)</label></h3>
</span>
<span class="item-field-label-long">
<label class="short-label">Q.</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each equipements as |equip key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{equip._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{equip.img}}" /></a>
<span class="item-name-label">{{equip.name}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Sortilèges</label></h3>
</span>
<span class="item-field-label-medium">
<label class="short-label">Seuil</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipment" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each sorts as |sort key|}}
<li class="item list-item flexrow list-item-shadow" data-item-id="{{sort._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{sort.img}}" /></a>
<span class="item-name-label">{{sort.name}}</span>
<span class="item-field-label-medium">
<label class="short-label">{{sort.system.seuil}}</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
<hr>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div class="grid grid-2col">
<div>
<ul class="item-list alternate-list">
<li class="item flexrow" data-item-id="{{archetype._id}}">
<label class="item-name-label-medium">Archetype</label>
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{archetype.img}}" /></a>
<span class="item-name-label-medium">{{archetype.name}}</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Lieu de naissance</label>
<input type="text" class="" name="system.biodata.lieunaissance" value="{{system.biodata.lieunaissance}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{system.biodata.age}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Nationalité</label>
<input type="text" class="" name="system.biodata.nationalite" value="{{system.biodata.nationalite}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Enfance</label>
<input type="text" class="" name="system.biodata.enfance" value="{{system.biodata.enfance}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Vie d'adulte</label>
<input type="text" class="" name="system.biodata.adulte" value="{{system.biodata.adulte}}" data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="item flexrow">
<label class="item-name-label-medium">Lame tutélaire</label>
<span class="item-name-label-medium">{{archetype.tarot.name}}</span>
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Résidence</label>
<input type="text" class="" name="system.biodata.residence" value="{{system.biodata.residence}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Singularité</label>
<input type="text" class="" name="system.biodata.singularite" value="{{system.biodata.singularite}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Loisirs</label>
<input type="text" class="" name="system.biodata.loisirs" value="{{system.biodata.loisirs}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Orientation politique</label>
<input type="text" class="" name="system.biodata.politique" value="{{system.biodata.politique}}" data-dtype="String" />
</li>
<li class="item flexrow">
<label class="item-name-label-medium">Orientation religieuse</label>
<input type="text" class="" name="system.biodata.religion" value="{{system.biodata.religion}}" data-dtype="String" />
</li>
</ul>
</div>
</div>
<ul>
<li class="item flexrow">
<label class="generic-label">Position vis-à-vis du fantastique</label>
</li>
<li class="item flexrow">
<input type="text" class="" name="system.biodata.fantastique" value="{{system.biodata.fantastique}}" data-dtype="String" />
</li>
</ul>
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Tarots</label></h3>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Sens</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each tarots as |tarot key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{tarot._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{tarot.img}}" /></a>
<span class="item-name-label">{{tarot.name}}</span>
<span class="item-field-label-medium"><label>{{#if tarot.system.ispositif}}Positif{{else}}Négatif{{/if}}</label></span>
<div class="item-filler">&nbsp;</div>
{{#if @root.isGM}}
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
{{/if}}
</li>
{{/each}}
</ul>
{{#if isGM}}
<ul class="item-list alternate-list">
<li class="item flexrow list-item items-title-bg">
<span class="item-name-label-header">
<h3><label class="items-title-text">Tarot secret(MJ)</label></h3>
</span>
<span class="item-field-label-medium">
<label class="item-field-label-medium">Sens</label>
</span>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="weapon" title="Create Item"><i class="fas fa-plus"></i></a>
</div>
</li>
{{#each tarotsCache as |tarot key|}}
<li class="item flexrow list-item list-item-shadow" data-item-id="{{tarot._id}}">
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
src="{{tarot.img}}" /></a>
<span class="item-name-label">{{tarot.name}}</span>
<span class="item-field-label-medium"><label>{{#if tarot.system.ispositif}}Positif{{else}}Négatif{{/if}}</label></span>
<div class="item-filler">&nbsp;</div>
{{#if @root.isGM}}
<div class="item-controls item-controls-fixed">
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
{{/if}}
</li>
{{/each}}
</ul>
{{/if}}
</div>
<div class="tab notes" data-group="primary" data-tab="notes">
<hr>
<span class="item-name-label-header items-title-bg">
<h3><label class="items-title-text">Background</label></h3>
</span>
<div class="form-group editor">
{{editor description target="system.biodata.description" button=true owner=owner
editable=editable}}
</div>
<hr>
<span class="item-name-label-header items-title-bg">
<h3><label class="items-title-text">Notes</label></h3>
</span>
<div class="form-group editor">
{{editor notes target="system.biodata.notes" button=true owner=owner editable=editable}}
</div>
<hr>
</article>
</div>
</div>
</section>
</form>

View File

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

View File

@ -0,0 +1,37 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class="chat-actor-name">{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li>Confrontation de {{attr.label}} : {{attr.value}}
</li>
<li>Degré de la confrontation: {{confrontationDegre}} </li>
<li>Ajustement spécial : {{confrontationModif}} </li>
<li>Seuil final : {{target}} </li>
<li>Valeur de la carte : {{total}} </li>
{{#if isSuccess}}
<li><label class="chat-result-text chat-result-success ">Réussite !</label> Votre {{attr.label}} augmente de {{gainAttr}} points.</li>
{{else}}
<li><label class="chat-result-text chat-result-success ">Echec !</label> Votre {{attr.label}} diminue de {{gainAttr}} points.</li>
{{/if}}
</ul>
</div>
</div>

View File

@ -0,0 +1,76 @@
<div class="chat-message-header">
{{#if actorImg}}
<img class="actor-icon" src="{{actorImg}}" alt="{{alias}}" />
{{/if}}
<h4 class="chat-actor-name">{{alias}}</h4>
</div>
<hr>
{{#if img}}
<div >
<img class="chat-icon" src="{{img}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
{{#if attr}}
<li>{{attr.label}} : {{attr.value}}
</li>
{{/if}}
<li>Bonus/Malus perso: {{bonusMalusPerso}} </li>
<li>Bonus/Malus situation: {{bonusMalusSituation}} </li>
<li>Seuil final: {{target}} </li>
<li>Resultat {{roll.total}} </li>
{{#if isSuccess}}
{{#if isCritical}}
<li><label class="chat-result-text chat-result-success ">Réussite Critique !</label></li>
{{#if arme}}
{{#if arme.system.dommagecritiquemort}}
<li><label class="chat-result-success">La victime est morte !</label></li>
{{else}}
{{#if arme.system.dommagecritiqueko}}
<li><label class="chat-result-text chat-result-success ">La victime est KO !</label></li>
{{/if}}
<li><label class="chat-result-success ">La victime subit {{arme.system.dommagecritique}} dommages</label></li>
{{/if}}
{{/if}}
{{else}}
{{#if isPart}}
<li><label class="chat-result-text chat-result-success ">Réussite Particulière !</label></li>
{{#if arme}}
<li><label class="chat-result-success ">La victime subit {{arme.system.dommagepart}} dommages</label></li>
{{/if}}
{{else}}
<li><label class="chat-result-text chat-result-success ">Succés !</label></li>
{{#if arme}}
<li><label class="chat-result-success ">La victime subit {{arme.system.dommagenormale}} dommages</label></li>
{{/if}}
{{/if}}
{{/if}}
{{else}}
{{#if isFumble}}
<li><label class="chat-result-text chat-result-failure ">Echec Critique !</label></li>
{{else}}
<li><label class="chat-result-text chat-result-failure">Echec !</label></li>
{{/if}}
{{/if}}
{{#if isReroll}}
{{else}}
{{#if (gt destin 0)}}
<button class="chat-card-button roll-destin">Relancer (1 Destin)</button>
{{/if}}
{{/if}}
</ul>
</div>
</div>

View File

@ -0,0 +1,12 @@
</div>
<div class="flexcol">
<img class="{{#if system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{img}}">
<span class="tarot-title">{{name}}</span>
{{#if system.isdualside}}
<span class="tarot-title">{{#if system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
{{#if value}}
<span class="tarot-title">Valeur : {{value}}</span>
{{/if}}
</div>
</div>

View File

@ -0,0 +1,4 @@
<div>
<button class="chat-card-button draw-tarot-card">Tirer une carte de Tarot</button>
</div>

View File

@ -0,0 +1,86 @@
<form class="{{cssClass}} flexcol character-summary-container" autocomplete="off">
<ol class="items-list">
<li class="item flexrow item-header">
<div class="item-field item-name item-name-label-long">Nom</div>
{{#each config.attributs as |attr key|}}
<div class="item-field item-name-label-short">{{attr}}</div>
{{/each}}
<div class="item-field item-name-label-short">Destin</div>
<div class="item-field item-name-label-short">Fluide</div>
<div class="item-field item-name-label-short">MPMB</div>
<div class="item-field item-name-label-short">MPMN</div>
</div>
</li>
{{#each pcs as |pc key|}}
<li class="item flexrow" data-actor-id="{{pc.id}}">
<div class="item-field item-name item-name-label-long">
<a class="actor-open character-summary-rollable">{{pc.name}}</a>
</div>
{{#each pc.system.attributs as |attr key|}}
<div class="item-field flex2 item-name-label-short">
<a class="summary-roll character-summary-rollable" data-type="attribut" data-key="{{key}}">{{attr.value}}</a>
</div>
{{/each}}
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="destin" data-key="pointdestin">{{pc.system.pointdestin}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="fluide" data-key="fluide">{{pc.system.fluide}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="mpmb" data-key="mpmb">{{pc.system.mpmb}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="mpmn" data-key="mpmn">{{pc.system.mpmn}}</a>
</div>
</div>
</li>
{{/each}}
<li class="item flexrow item-header">
<div class="item-field item-name item-name-label-long">PNJs</div>
{{#each config.attributs as |attr key|}}
<div class="item-field flex2 item-name-label-short">attr</div>
{{/each}}
<div class="item-field flex2 item-name-label-short">Destin</div>
<div class="item-field flex2 item-name-label-short">Fluide</div>
<div class="item-field flex2 item-name-label-short">MPMB</div>
<div class="item-field flex2 item-name-label-short">MPMN</div>
</div>
</li>
{{#each npcs as |pc key|}}
<li class="item flexrow" data-actor-id="{{pc.id}}">
<div class="item-field item-name item-name-label-long">
<a class="actor-open character-summary-rollable">{{pc.name}}</a>
</div>
{{#each pc.system.attributs as |attr key|}}
<div class="item-field flex2 item-name-label-short">
<a class="summary-roll character-summary-rollable" data-type="attribute" data-key="{{key}}">{{attr.value}}</a>
</div>
{{/each}}
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="destin" data-key="pointdestin">{{pc.system.pointdestin}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="fluide" data-key="fluide">{{pc.system.fluide}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="mpmb" data-key="mpmb">{{pc.system.mpmb}}</a>
</div>
<div class="item-field flex item-name-label-short">
<a class="summary-roll" data-type="mpmn" data-key="mpmn">{{pc.system.mpmn}}</a>
</div>
</div>
<div class="item-field flex1 right">
<a class="item-control actor-delete" title="{{localize "BOL.ui.delete"}}"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
</form>

View File

@ -0,0 +1,45 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
{{#if img}}
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
{{/if}}
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="flexcol">
<div class="flexrow">
<span class="roll-dialog-label">{{attr.label}} : </span>
<span class="roll-dialog-label">
{{attr.value}}
</span>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Degré de la confrontation : </span>
<select id="confrontationDegre" name="confrontationDegre">
{{#select confrontationDegre}}
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Modificateur de confrontation : </span>
<select id="confrontationModif" name="confrontationModif">
{{#select confrontationModif}}
<option value="-1">-1</option>
<option value="0">0</option>
<option value="1">+1</option>
{{/select}}
</select>
</div>
</div>
</form>

View File

@ -0,0 +1,93 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
{{#if img}}
<img class="actor-icon" src="{{img}}" data-edit="img" title="{{name}}" />
{{/if}}
<h1 class="dialog-roll-title roll-dialog-header">{{title}}</h1>
</header>
<div class="flexcol">
{{#if attr}}
<div class="flexrow">
<span class="roll-dialog-label">{{attr.label}} : </span>
<span class="roll-dialog-label">
{{attr.value}}
{{#if (eq attr.abbrev "physique")}}
{{#if phyMalus}}
({{phyMalus}})
{{/if}}
{{/if}}
</span>
</div>
{{/if}}
<div class="flexcol">
<span class="roll-dialog-label">Rappel des élements biographiques : </span>
<ul class="ul-level1 item-list alternate-list">
{{#each elementsbio as |elem key|}}
<li class="item flexrow">
<span class="roll-dialog-label">{{elem.name}}</span>
</li>
{{/each}}
</ul>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Bonus/Malus biographique : </span>
<select id="bonusMalusPerso" name="bonusMalusPerso">
{{#select bonusMalusPerso}}
<option value="-3">-3</option>
<option value="-2">-2</option>
<option value="-1">-1</option>
<option value="0">0</option>
<option value="1">+1</option>
<option value="2">+2</option>
<option value="3">+3</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Bonus/Malus de situation : </span>
<select id="bonusMalusSituation" name="bonusMalusSituation">
{{#select bonusMalusSituation}}
<option value="-3">-3</option>
<option value="-2">-2</option>
<option value="-1">-1</option>
<option value="0">0</option>
<option value="1">+1</option>
<option value="2">+2</option>
<option value="3">+3</option>
{{/select}}
</select>
</div>
{{#if arme}}
<div class="flexrow">
<span class="roll-dialog-label">Défense : </span>
<select id="bonusMalusDef" name="bonusMalusDef">
{{#select bonusMalusDef}}
<option value="-3">-6 (réussite critique)</option>
<option value="-3">-3 (réussite)</option>
<option value="0">0 (echec ou pas d'esquive)</option>
<option value="3">+3 (echec critique)</option>
{{/select}}
</select>
</div>
<div class="flexrow">
<span class="roll-dialog-label">Portée : </span>
<select id="bonusMalusPortee" name="bonusMalusPortee">
{{#select bonusMalusPortee}}
<option value="1">+1 (Portée courte)</option>
<option value="0">0 (Portée moyenne)</option>
<option value="-1">-1 (Portée longue)</option>
{{/select}}
</select>
</div>
{{/if}}
</div>
</form>

View File

@ -0,0 +1,72 @@
<form class="skill-roll-dialog">
<header class="roll-dialog-header">
<h1 class="dialog-roll-title roll-dialog-header">Joueur : {{user.name}}</h1>
</header>
<div class="flexcol">
{{#if (eq state "select-player")}}
<div class="flexrow">
<span>Sélectionnez le joueur pour faire le tirage</span>
<select id="playerId" name="playerId">
{{#select playerId}}
<option value="none"></option>
{{#each players as |player id|}}
<option value="{{player._id}}">{{player.name}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
{{#if (eq state "attribute-to-actor")}}
<div class="flexrow">
<span>Sélectionnez l'acteur pour lui attribuer les tarots</span>
<select id="actorId" name="actorId">
{{#select actorId}}
<option value="none"></option>
{{#each actors as |actor id|}}
<option value="{{actor._id}}">{{actor.name}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
<div class="flexcol">
<span><h2>Main du joueur : </h2></span>
<div class="flexrow">
{{#each cards as |card index|}}
<div class="flexcol">
<div class="tarot-fixed-width flexcol">
<img class="tarot-fixed-width {{#if card.system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{card.img}}">
<span class="tarot-title">{{card.name}}</span>
{{#if card.system.isdualside}}
<span class="tarot-title">{{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
</div>
</div>
{{/each}}
</div>
<hr>
<span><h2>Main secrête : </h2></span>
<div class="flexrow">
{{#each secretCards as |card index|}}
<div class="flexcol">
<div class="tarot-fixed-width flexcol">
<img class="tarot-fixed-width {{#if card.system.ispositif}} {{else}}flip-tarot{{/if}}" src="{{card.img}}">
<span class="tarot-title">{{card.name}}</span>
{{#if card.system.isdualside}}
<span class="tarot-title">{{#if card.system.ispositif}}Positif{{else}}Négatif{{/if}}</span>
{{/if}}
</div>
</div>
{{/each}}
</div>
</div>
</div>
</form>

View File

@ -0,0 +1,37 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-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>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow">
<label class="item-field-label-long">Lame tutélaire</label>
<select class="item-field-label-long" type="text" name="system.lametutelaire" value="{{system.lametutelaire}}" data-dtype="String">
{{#select system.lametutelaire}}
{{#each tarots as |carte key| }}
<option value="{{carte._id}}">{{carte.name}}</option>
{{/each}}
{{/select}}
</select>
</li>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,73 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-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>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow">
<label class="item-field-label-long">Type d'arme</label>
<select class="item-field-label-long" type="text" name="system.armetype" value="{{system.armetype}}" data-dtype="String">
{{#select system.armetype}}
{{#each config.armeTypes as |type key| }}
<option value="{{key}}">{{type}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow">
<label class="item-field-label-long">Portee courte (max)</label>
<input type="text" class="item-field-label-short" name="system.porteecourte" value="{{system.porteecourte}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="item-field-label-long">Portee moyenne (max)</label>
<input type="text" class="item-field-label-short" name="system.porteemoyenne" value="{{system.porteemoyenne}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="item-field-label-long">Dommages normaux</label>
<input type="text" class="item-field-label-short" name="system.dommagenormale" value="{{system.dommagenormale}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="item-field-label-long">Dommages particuliers</label>
<input type="text" class="item-field-label-short" name="system.dommagepart" value="{{system.dommagepart}}" data-dtype="Number"/>
</li>
<li class="flexrow">
<label class="item-field-label-long">Critiques Mortels ?</label>
<input type="checkbox" class="item-field-label-short" name="system.dommagecritiquemort" {{checked system.dommagecritiquemort}} />
<label class="item-field-label-short">&nbsp;</label>
<label class="item-field-label-long">Critiques KO ?</label>
<input type="checkbox" class="item-field-label-short" name="system.dommagecritiqueKO" {{checked system.dommagecritiqueKO}} />
</li>
<li class="flexrow">
<label class="item-field-label-long">Dommages critiques</label>
<input type="text" class="item-field-label-short" name="system.dommagecritique" value="{{system.dommagecritique}}" data-dtype="Number"/>
</li>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,27 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-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>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,27 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-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>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,30 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<img class="item-sheet-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>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow">
<label class="item-field-label-long">Seuil de Fluide</label>
<input type="input" class="item-field-label-short" name="system.seuil" value="{{system.seuil}}" data-dtype="Number" />
</li>
</ul>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,68 @@
<form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header">
<div class="header-fields">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name"/></h1>
</div>
</header>
{{> systems/fvtt-ecryme/templates/items/partial-item-nav.hbs}}
{{!-- Sheet Body --}}
<section class="sheet-body">
<div class="flexrow">
<div>
<img class="item-tarot-img" src="{{img}}" data-edit="img" title="{{name}}"/>
</div>
<div>
{{> systems/fvtt-ecryme/templates/items/partial-item-description.hbs}}
<div class="tab details" data-group="primary" data-tab="details">
<div class="tab" data-group="primary">
<ul>
<li class="flexrow">
<label class="item-field-label-long">Type </label>
<select class="item-field-label-long" type="text" name="system.tarottype" value="{{system.tarottype}}" data-dtype="String">
{{#select system.tarottype}}
{{#each config.tarotType as |type key| }}
<option value="{{key}}">{{type}}</option>
{{/each}}
{{/select}}
</select>
</li>
{{#if isGM}}
<li class="flexrow">
<label class="item-field-label-long">Valeur endroit (ie positif) ?</label>
<input type="input" class="item-field-label-short" name="system.numericvalueup" value="{{system.numericvalueup}}" data-dtype="Number" />
</li>
<li class="flexrow">
<label class="item-field-label-long">Valeur envers (ie négatif) ?</label>
<input type="input" class="item-field-label-short" name="system.numericvaluedown" value="{{system.numericvaluedown}}" data-dtype="Number" />
</li>
<li class="flexrow">
<label class="item-field-label-long">A un sens (ie positif/négatif)?</label>
<input type="checkbox" class="item-field-label-short" name="system.isdualside" {{checked system.isdualside}} />
</li>
{{#if system.isdualside}}
<li class="flexrow">
<label class="item-field-label-long">En positif ?</label>
<input type="checkbox" class="item-field-label-short" name="system.ispositif" {{checked system.ispositif}} />
</li>
{{/if}}
<li class="flexrow">
<label class="item-field-label-long">Carte cachée (ie MJ seulement) ?</label>
<input type="checkbox" class="item-field-label-short" name="system.isgm" {{checked system.isgm}} />
</li>
{{/if}}
</ul>
</div>
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,3 @@
<div class="tab description" data-group="primary" data-tab="description">
{{editor description target="system.description" button=true owner=owner editable=editable}}
</div>

View File

@ -0,0 +1,5 @@
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">Description</a>
<a class="item" data-tab="details">Details</a>
</nav>