Initial import

This commit is contained in:
LeRatierBretonnien 2022-12-26 00:33:13 +01:00
commit 9686b6bd35
50 changed files with 14432 additions and 0 deletions

25
LICENCE.txt Normal file
View File

@ -0,0 +1,25 @@
MIT License
Copyright (c) 2022 Uberwald/LeRatierBretonnien
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
This license does not apply to the compendium content listed in this software's
"packs" directory. See the README for licensing information for the compendium
packs.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

29
README.md Normal file
View File

@ -0,0 +1,29 @@
# Système Foundry pour Hawkmoon (French RPG, Titam France/Sombres Projets)
## EN
Unofficial system for Hawkmoon (French version from Titam France).
This system has been approved by Département des Sombres Projets ( http://www.titam-france.fr/ ), thanks !
Books are mandatory to play and are available at : http://www.titam-france.fr
## FR
Système non-officiel pour le JDR Hawkmoon (Titam France/Sombres Projets).
Ce système a été autorisé par le Département des Sombres Projets ( http://www.titam-france.fr/ ), merci à eux !
Les livres du jeu sont nécessaires pour jouer, et sont disponibles ici : http://www.titam-france.fr
# Credits
Hawkmoon, le jeu de rôle du Troisième Millénaire, is a property of Titam France/Sombres Projets.
# Developmement
LeRatierBretonnien
# Tests, icones et saisie des données
Prêtre, Blondin, Zechrub/Chris, Kyllian, Lightbringer

BIN
assets/fonts/CentaurMT.otf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
assets/ui/pc_sheet_bg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

31
lang/fr.json Normal file
View File

@ -0,0 +1,31 @@
{
"ACTOR": {
"TypePersonnage": "Personnage",
"TypeCellule": "Cellule",
"TypeCreature": "Créature"
},
"ITEM": {
"TypeArtefact": "Artefact",
"TypeArme": "Arme",
"TypeTalent": "Talent",
"TypeHistorique": "Historique",
"TypeProfil": "Profil",
"TypeCompetence": "Compétence",
"TypeProtection": "Protection",
"TypeMonnaie": "Monnaie",
"TypeEquipement": "Equipement",
"TypeRessource": "Ressource",
"TypeContact": "Contact"
},
"HAWKMOON": {
"ui": {
"editContact": "Modifier le contact",
"deleteContact": "Supprimer le contact",
"editTrait": "Modifier le trait",
"deleteTrait": "Supprimer le trait"
}
}
}

View File

@ -0,0 +1,195 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersAutomation } from "./heritiers-automation.js";
/* -------------------------------------------- */
export class HeritiersActorSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-les-heritiers", "sheet", "actor"],
template: "systems/fvtt-les-heritiers/templates/actor-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
/* -------------------------------------------- */
async getData() {
const objectData = duplicate(this.object)
let formData = {
title: this.title,
id: objectData.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
system: objectData.system,
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
limited: this.object.limited,
skills: this.actor.getSkills(),
armes: duplicate(this.actor.getWeapons()),
monnaies: duplicate(this.actor.getMonnaies()),
protections: duplicate(this.actor.getArmors()),
historiques: duplicate(this.actor.getHistoriques() || []),
talents: duplicate(this.actor.getTalents() || []),
talentsCell: this.getCelluleTalents(),
profils: duplicate(this.actor.getProfils() || []),
combat: this.actor.getCombatValues(),
equipements: duplicate(this.actor.getEquipments()),
artefacts: duplicate(this.actor.getArtefacts()),
monnaies: duplicate(this.actor.getMonnaies()),
richesse: this.actor.computeRichesse(),
valeurEquipement: this.actor.computeValeurEquipement(),
initiative: this.actor.getFlag("world", "last-initiative") || -1,
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {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;
}
/* -------------------------------------------- */
getCelluleTalents( ) {
let talents = []
for(let cellule of game.actors) {
if (cellule.type == "cellule") {
let found = cellule.system.members.find( it => it.id == this.actor.id)
if (found) {
talents = talents.concat( cellule.getTalents() )
}
}
}
return talents
}
/* -------------------------------------------- */
/** @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")
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");
HeritiersUtility.confirmDelete(this, li);
})
html.find('.edit-item-data').change(ev => {
const li = $(ev.currentTarget).parents(".item")
let itemId = li.data("item-id")
let itemType = li.data("item-type")
let itemField = $(ev.currentTarget).data("item-field")
let dataType = $(ev.currentTarget).data("dtype")
let value = ev.currentTarget.value
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
})
html.find('.adversite-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
let adv = li.data("adversite")
let value = Number($(event.currentTarget).data("adversite-value"))
this.actor.incDecAdversite(adv, value)
})
html.find('.quantity-modify').click(event => {
const li = $(event.currentTarget).parents(".item")
const value = Number($(event.currentTarget).data("quantite-value"))
this.actor.incDecQuantity( li.data("item-id"), value );
})
html.find('.roll-initiative').click((event) => {
this.actor.rollAttribut("pre", true)
})
html.find('.roll-attribut').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = li.data("attr-key")
this.actor.rollAttribut(attrKey, false)
})
html.find('.roll-competence').click((event) => {
const li = $(event.currentTarget).parents(".item")
let attrKey = $(event.currentTarget).data("attr-key")
let compId = li.data("item-id")
this.actor.rollCompetence(attrKey, compId)
})
html.find('.roll-arme-offensif').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeOffensif(armeId)
})
html.find('.roll-arme-degats').click((event) => {
const li = $(event.currentTarget).parents(".item")
let armeId = li.data("item-id")
this.actor.rollArmeDegats(armeId)
})
html.find('.item-add').click((event) => {
const itemType = $(event.currentTarget).data("type")
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
})
html.find('.lock-unlock-sheet').click((event) => {
this.options.editScore = !this.options.editScore;
this.render(true);
});
html.find('.item-equip').click(ev => {
const li = $(ev.currentTarget).parents(".item");
this.actor.equipItem( li.data("item-id") );
this.render(true);
});
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {
const position = super.setPosition(options);
const sheetBody = this.element.find(".sheet-body");
const bodyHeight = position.height - 192;
sheetBody.css("height", bodyHeight);
return position;
}
/* -------------------------------------------- */
async _onDropItem(event, dragData) {
let data = event.dataTransfer.getData('text/plain')
let dataItem = JSON.parse( data)
let item = fromUuidSync(dataItem.uuid)
if (item.pack) {
item = await HeritiersUtility.searchItem(item)
}
let autoresult = HeritiersAutomation.processAutomations("on-drop", item, this.actor)
if ( autoresult.isValid ) {
super._onDropItem(event, dragData)
} else {
ui.notifications.warn( autoresult.warningMessage)
}
}
}

629
modules/heritiers-actor.js Normal file
View File

@ -0,0 +1,629 @@
/* -------------------------------------------- */
import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersRollDialog } from "./heritiers-roll-dialog.js";
/* -------------------------------------------- */
const __degatsBonus = [-2, -2, -1, -1, 0, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 8, 8, 9, 9, 10, 10]
const __vitesseBonus = [-2, -2, -1, -1, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8]
/* -------------------------------------------- */
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class HeritiersActor 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 == 'personnage') {
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.skills")
data.items = skills.map(i => i.toObject())
}
if (data.type == 'creature') {
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.skills-creatures")
data.items = skills.map(i => i.toObject())
data.items.push( { name: "Arme naturelle 1", type: 'arme', img: "systems/fvtt-les-heritiers/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0"} } )
data.items.push( { name: "Arme naturelle 2", type: 'arme', img: "systems/fvtt-les-heritiers/assets/icons/melee.webp", system: { typearme: "contact", bonusmaniementoff: 0, seuildefense: 0, degats: "0"} } )
}
return super.create(data, options);
}
/* -------------------------------------------- */
getBonusDefenseFromTalents() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "bonus-defensif") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
prepareArme(arme) {
arme = duplicate(arme)
let combat = this.getCombatValues()
if (arme.system.typearme == "contact" || arme.system.typearme == "contactjet") {
let bonusDefense = this.getBonusDefenseFromTalents()
arme.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "mêlée") )
arme.system.attrKey = "pui"
arme.system.totalDegats = arme.system.degats + "+" + combat.bonusDegatsTotal
arme.system.totalOffensif = this.system.attributs.pui.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense + bonusDefense
arme.system.isdefense = true
}
if (arme.system.typearme == "jet" || arme.system.typearme == "tir") {
arme.system.competence = duplicate(this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "armes à distance"))
arme.system.attrKey = "adr"
arme.system.totalOffensif = this.system.attributs.adr.value + arme.system.competence.system.niveau + arme.system.bonusmaniementoff
arme.system.totalDegats = arme.system.degats
if (arme.system.isdefense) {
arme.system.totalDefensif = combat.defenseTotal + arme.system.competence.system.niveau + arme.system.seuildefense
}
}
return arme
}
/* -------------------------------------------- */
getWeapons() {
let armes = []
for (let arme of this.items) {
if (arme.type == "arme") {
armes.push(this.prepareArme(arme))
}
}
return armes
}
/* -------------------------------------------- */
getMonnaies() {
return this.items.filter( it => it.type == "monnaie")
}
/* ----------------------- --------------------- */
addMember( actorId) {
let members = duplicate(this.system.members)
members.push( {id: actorId} )
this.update ({'system.members': members})
}
async removeMember(actorId) {
let members = this.system.members.filter(it => it.id != actorId )
this.update ({'system.members': members})
}
/* ----------------------- --------------------- */
getEquipments() {
return this.items.filter(item => item.type == "equipement")
}
/* ----------------------- --------------------- */
getArtefacts() {
return this.items.filter(item => item.type == "artefact")
}
/* ----------------------- --------------------- */
getMonnaies() {
return this.items.filter(item => item.type == "monnaie")
}
/* -------------------------------------------- */
getArmors() {
return this.items.filter(item => item.type == "protection")
}
getHistoriques() {
return this.items.filter(item => item.type == "historique")
}
getProfils() {
return this.items.filter(item => item.type == "profil")
}
getTalents() {
return this.items.filter(item => item.type == "talent")
}
getRessources() {
return this.items.filter(item => item.type == "ressource")
}
getContacts() {
return this.items.filter(item => item.type == "contact")
}
/* -------------------------------------------- */
getSkills() {
let comp = []
for (let item of this.items) {
item = duplicate(item)
if (item.type == "competence") {
item.system.attribut1total = item.system.niveau + (this.system.attributs[item.system.attribut1]?.value || 0)
item.system.attribut2total = item.system.niveau + (this.system.attributs[item.system.attribut2]?.value || 0)
item.system.attribut3total = item.system.niveau + (this.system.attributs[item.system.attribut3]?.value || 0)
if (item.system.niveau == 0) {
item.system.attribut1total -= 3
item.system.attribut2total -= 3
item.system.attribut3total -= 3
}
item.system.attribut1label = this.system.attributs[item.system.attribut1]?.label || ""
item.system.attribut2label = this.system.attributs[item.system.attribut2]?.label || ""
item.system.attribut3label = this.system.attributs[item.system.attribut3]?.label || ""
comp.push(item)
}
}
return comp.sort(function (a, b) {
let fa = a.name.toLowerCase(),
fb = b.name.toLowerCase();
if (fa < fb) {
return -1;
}
if (fa > fb) {
return 1;
}
return 0;
})
}
/* -------------------------------------------- */
getDefenseBase() {
return Math.max(this.system.attributs.tre.value, this.system.attributs.pui.value)
}
/* -------------------------------------------- */
getVitesseBase() {
return 5 + __vitesseBonus[this.system.attributs.adr.value]
}
/* -------------------------------------------- */
getProtection() {
let equipProtection = 0
for(let armor in this.items) {
if (armor.type == "protection" && armor.system.equipped) {
equipProtection += Number(armor.system.protection)
}
}
if (equipProtection < 4) {
return 4 + equipProtection // Cas des boucliers + sans armure
}
return equipProtection // Uniquement la protection des armures + boucliers
}
/* -------------------------------------------- */
getCombatValues() {
let combat = {
initBase: this.system.attributs.adr.value,
initTotal: this.system.attributs.adr.value + this.system.combat.initbonus,
bonusDegats: this.getBonusDegats(),
bonusDegatsTotal: this.getBonusDegats() + this.system.combat.bonusdegats,
vitesseBase: this.getVitesseBase(),
vitesseTotal: this.getVitesseBase() + this.system.combat.vitessebonus,
defenseBase: this.getDefenseBase(),
protection : this.getProtection(),
defenseTotal: this.getDefenseBase() + this.system.combat.defensebonus + this.getProtection() - this.getTotalAdversite()
}
return combat
}
/* -------------------------------------------- */
prepareBaseData() {
}
/* -------------------------------------------- */
async prepareData() {
super.prepareData();
}
/* -------------------------------------------- */
prepareDerivedData() {
if (this.type == 'personnage') {
let talentBonus = this.getVigueurBonus()
let vigueur = Math.floor((this.system.attributs.pui.value + this.system.attributs.tre.value) / 2) + talentBonus
if (vigueur != this.system.sante.vigueur) {
this.update({ 'system.sante.vigueur': vigueur })
}
}
super.prepareDerivedData()
}
/* -------------------------------------------- */
_preUpdate(changed, options, user) {
super._preUpdate(changed, options, user);
}
/* -------------------------------------------- */
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) {
let update = { _id: item.id, "system.equipped": !item.system.equipped }
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
editItemField(itemId, itemType, itemField, dataType, value) {
let item = this.items.find(item => item.id == itemId)
if (item) {
console.log("Item ", item, itemField, dataType, value)
if (dataType.toLowerCase() == "number") {
value = Number(value)
} else {
value = String(value)
}
let update = { _id: item.id, [`system.${itemField}`]: value };
this.updateEmbeddedDocuments("Item", [update])
}
}
/* -------------------------------------------- */
checkAttribut(attribut, minLevel) {
let attr = this.system.attributs.find(at => at.labelnorm == attribut.toLowerCase())
if (attr && attr.value >= minLevel) {
return { isValid: true, attr: duplicate(attr) }
}
return { isValid: false }
}
/* -------------------------------------------- */
checkAttributOrCompetenceLevel(compName, minLevel) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel)
if (comp) {
return { isValid: true, item: duplicate(comp) }
} else {
for (let attrKey in this.system.attributs) {
if (this.system.attributs[attrKey].label.toLowerCase() == compName.toLowerCase() && this.system.attributs[attrKey].value >= minLevel) {
return { isValid: true, item: duplicate(this.system.attributs[attrKey]) }
}
}
}
return { isValid: false, warningMessage: `Prérequis insuffisant : la compétence/attribut ${compName} doit être de niveau ${minLevel} au minimum` }
}
/* -------------------------------------------- */
addCompetenceBonus(compName, bonus, baCost) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
comp = duplicate(comp)
comp.system.bonus = bonus
comp.system.baCost = baCost
return { isValid: true, item: comp }
}
return { isValid: false, warningMessage: `Compétence ${compName} non trouvée` }
}
/* -------------------------------------------- */
checkIfCompetence(compName) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase())
if (comp) {
return { isValid: true, item: comp }
}
return { isValid: false }
}
/* -------------------------------------------- */
getVigueur() {
return this.system.sante.vigueur
}
/* -------------------------------------------- */
getVigueurBonus() {
let talents = this.items.filter(item => item.type == "talent" && item.system.isautomated)
let bonus = 0
for (let talent of talents) {
for (let auto of talent.system.automations) {
if (auto.eventtype == "bonus-permanent" && auto.bonusname == "vigueur") {
bonus += Number(auto.bonus || 0)
}
}
}
return bonus
}
/* -------------------------------------------- */
getBonneAventure() {
return this.system.bonneaventure.actuelle
}
/* -------------------------------------------- */
checkBonneAventure(cost) {
return (this.system.bonneaventure.actuelle >= cost)
}
/* -------------------------------------------- */
changeBonneAventure(value) {
let newBA = this.system.bonneaventure.actuelle
newBA += value
this.update({ 'system.bonneaventure.actuelle': newBA })
}
/* -------------------------------------------- */
getEclat() {
return this.system.eclat.value
}
/* -------------------------------------------- */
changeEclat(value) {
let newE = this.system.eclat.value
newE += value
this.update({ 'system.eclat.value': newE })
}
/* -------------------------------------------- */
compareName(a, b) {
if (a.name < b.name) {
return -1;
}
if (a.name > b.name) {
return 1;
}
return 0;
}
/* -------------------------------------------- */
getAttribute(attrKey) {
return this.system.attributes[attrKey]
}
/* -------------------------------------------- */
getBonusDegats() {
return 0;
}
/* -------------------------------------------- */
async equipGear(equipmentId) {
let item = this.items.find(item => item.id == equipmentId);
if (item && item.system.data) {
let update = { _id: item.id, "system.equipped": !item.system.equipped };
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
}
}
/* -------------------------------------------- */
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 });
}
/* -------------------------------------------- */
getTotalAdversite() {
return this.system.adversite.bleue + this.system.adversite.rouge + this.system.adversite.noire
}
/* -------------------------------------------- */
async incDecAdversite(adv, incDec = 0) {
let adversite = duplicate(this.system.adversite)
adversite[adv] += Number(incDec)
adversite[adv] = Math.max(adversite[adv], 0)
this.update({ 'system.adversite': adversite })
}
/* -------------------------------------------- */
async incDecQuantity(objetId, incDec = 0) {
let objetQ = this.items.get(objetId)
if (objetQ) {
let newQ = objetQ.system.quantite + incDec
newQ = Math.max(newQ, 0)
const updated = await this.updateEmbeddedDocuments('Item', [{ _id: objetQ.id, 'system.quantite': newQ }]); // pdates one EmbeddedEntity
}
}
/* -------------------------------------------- */
computeRichesse() {
let valueSC = 0
for(let monnaie of this.items) {
if (monnaie.type == "monnaie") {
valueSC += Number(monnaie.system.prixsc) * Number(monnaie.system.quantite)
}
}
return HeritiersUtility.computeMonnaieDetails( valueSC)
}
/* -------------------------------------------- */
computeValeurEquipement() {
let valueSC = 0
for(let equip of this.items) {
if (equip.type == "equipement" || equip.type == "arme" || equip.type == "protection") {
valueSC += Number(equip.system.prixsc) * Number(equip.system.quantite ?? 1)
valueSC += (Number(equip.system.prixca) * Number(equip.system.quantite ?? 1)) * 20
valueSC += (Number(equip.system.prixpo) * Number(equip.system.quantite ?? 1)) * 400
}
}
return HeritiersUtility.computeMonnaieDetails( valueSC)
}
/* -------------------------------------------- */
getCompetence(compId) {
return this.items.get(compId)
}
/* -------------------------------------------- */
async setPredilectionUsed(compId, predIdx) {
let comp = this.items.get(compId)
let pred = duplicate(comp.system.predilections)
pred[predIdx].used = true
await this.updateEmbeddedDocuments('Item', [{ _id: compId, 'system.predilections': pred }])
}
/* -------------------------------------------- */
getInitiativeScore() {
let init = this.getFlag("world", "last-initiative")
return init || -1
}
/* -------------------------------------------- */
getBestDefenseValue() {
let defenseList = this.items.filter(item => (item.type == "arme") && item.system.equipped)
let maxDef = 0
let bestArme
for (let arme of defenseList) {
if (arme.type == "arme" ) {
arme = this.prepareArme(arme)
}
if (arme.system.totalDefensif > maxDef) {
maxDef = arme.system.totalDefensif
bestArme = duplicate(arme)
}
}
return bestArme
}
/* -------------------------------------------- */
searchRelevantTalents(competence) {
let talents = []
for (let talent of this.items) {
if (talent.type == "talent" && talent.system.isautomated && talent.system.automations.length > 0) {
for (let auto of talent.system.automations) {
if (auto.eventtype === "prepare-roll") {
if (auto.competence.toLowerCase() == competence.name.toLowerCase()) {
talent = duplicate(talent)
talent.system.bonus = auto.bonus
talent.system.baCost = auto.baCost
talents.push(talent)
}
}
}
}
}
return talents
}
/* -------------------------------------------- */
buildListeAdversites() {
return []
}
/* -------------------------------------------- */
getCommonRollData(attrKey = undefined, compId = undefined, compName = undefined) {
let rollData = HeritiersUtility.getBasicRollData()
rollData.alias = this.name
rollData.actorImg = this.img
rollData.actorId = this.id
rollData.tokenId = this.token?.id
rollData.img = this.img
rollData.attributs = HeritiersUtility.getAttributs()
rollData.maitriseId = "none"
rollData.nbEclat = this.system.eclat.value
rollData.nbBA = this.system.bonneaventure.actuelle
rollData.nbAdversites = this.getTotalAdversite()
rollData.talents = []
if (attrKey) {
rollData.attrKey = attrKey
if (attrKey != "tochoose") {
rollData.actionImg = "systems/fvtt-les-heritiers/assets/icons/" + this.system.attributs[attrKey].labelnorm + ".webp"
rollData.attr = duplicate(this.system.attributs[attrKey])
}
}
if (compId) {
rollData.competence = duplicate(this.items.get(compId) || {})
rollData.maitrises = rollData.competence.system.predilections.filter(p => p.maitrise)
rollData.actionImg = rollData.competence?.img
rollData.talents = this.searchRelevantTalents(rollData.competence)
}
if (compName) {
rollData.competence = duplicate(this.items.find(item => item.name.toLowerCase() == compName.toLowerCase()) || {})
rollData.actionImg = rollData.competence?.img
}
return rollData
}
/* -------------------------------------------- */
async rollAttribut(attrKey, isInit = false) {
let rollData = this.getCommonRollData(attrKey)
rollData.multiplier = (isInit)? 1 : 2
rollData.isInit = isInit
let rollDialog = await HeritiersRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollCompetence(attrKey, compId) {
let rollData = this.getCommonRollData(attrKey, compId)
rollData.multiplier = 1 // Attr multiplier, always 1 in competence mode
console.log("RollDatra", rollData)
let rollDialog = await HeritiersRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeOffensif(armeId) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
let rollData = this.getCommonRollData(arme.system.attrKey, arme.system.competence._id)
rollData.arme = arme
HeritiersUtility.updateWithTarget(rollData)
console.log("ARME!", rollData)
let rollDialog = await HeritiersRollDialog.create(this, rollData)
rollDialog.render(true)
}
/* -------------------------------------------- */
async rollArmeDegats(armeId, targetVigueur = undefined) {
let arme = this.items.get(armeId)
if (arme.type == "arme") {
arme = this.prepareArme(arme)
}
console.log("DEGATS", arme)
let roll = new Roll( "1d10+"+arme.system.totalDegats).roll({ async: false })
await HeritiersUtility.showDiceSoNice(roll, game.settings.get("core", "rollMode"));
let nbEtatPerdus = 0
if (targetVigueur) {
nbEtatPerdus = Math.floor(roll.total / targetVigueur)
}
let rollData = {
arme: arme,
finalResult: roll.total,
alias: this.name,
actorImg: this.img,
actorId: this.id,
actionImg: arme.img,
targetVigueur: targetVigueur,
nbEtatPerdus: nbEtatPerdus
}
HeritiersUtility.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-degats-result.html`, rollData)
})
}
}

View File

@ -0,0 +1,25 @@
import { HeritiersUtility } from "./heritiers-utility.js";
/* -------------------------------------------- */
export class HeritiersCombat 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]);
//console.log("Init for combattant", c )
let id = c._id || c.id
let initValue = c.actor ? c.actor.getInitiativeScore() : 0
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initValue } ]);
}
return this;
}
/* -------------------------------------------- */
_onUpdate(changed, options, userId) {
}
}

View File

@ -0,0 +1,123 @@
/* -------------------------------------------- */
import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersRollDialog } from "./heritiers-roll-dialog.js";
/* -------------------------------------------- */
export class HeritiersCommands {
static init() {
if (!game.system.hawkmoon.commands) {
//const HeritiersCommands = new HeritiersCommands()
//HeritiersCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => HeritiersCommands.createChar(msg), descr: "Create a new character" });
//game.system.mournblade.commands = HeritiersCommands
}
}
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("HeritiersCommands._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) {
RdDCommands._chatAnswer(msg, command.descr);
}
return true;
}
return false;
}
/* -------------------------------------------- */
async createChar(msg) {
game.system.Heritiers.creator = new HeritiersActorCreate();
game.system.Heritiers.creator.start();
}
/* -------------------------------------------- */
static _chatAnswer(msg, content) {
msg.whisper = [game.user.id];
msg.content = content;
ChatMessage.create(msg);
}
/* -------------------------------------------- */
async poolRoll( msg) {
let rollData = HeritiersUtility.getBasicRollData()
rollData.alias = "Dice Pool Roll",
rollData.mode = "generic"
rollData.title = `Dice Pool Roll`;
let rollDialog = await HeritiersRollDialog.create( this, rollData);
rollDialog.render( true );
}
}

View File

@ -0,0 +1,13 @@
export const HERITIERS_CONFIG = {
competenceCategorie : {
"aventurier": "Aventurier",
"roublard": "Roublard",
"combattant": "Combattant",
"erudit": "Erudit",
"savant": "Savant",
"gentleman": "Gentleman"
}
}

View File

@ -0,0 +1,26 @@
/**
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
import { HeritiersActorSheet } from "./hawkmoon-actor-sheet.js";
import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersAutomation } from "./hawkmoon-automation.js";
/* -------------------------------------------- */
export class HeritiersCreatureSheet extends HeritiersActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-les-heritiers", "sheet", "actor"],
template: "systems/fvtt-les-heritiers/templates/creature-sheet.html",
width: 640,
height: 720,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }],
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
editScore: false
})
}
}

71
modules/heritiers-hud.js Normal file
View File

@ -0,0 +1,71 @@
/* -------------------------------------------- */
/* -------------------------------------------- */
export class HeritiersTokenHud {
static init() {
// Integration du TokenHUD
Hooks.on('renderTokenHUD', (app, html, data) => { HeritiersTokenHud.addTokenHudExtensions(app, html, data._id) });
}
/* -------------------------------------------- */
static async removeExtensionHud(app, html, tokenId) {
html.find('.control-icon.hawkmoon-adversite').remove()
}
/* -------------------------------------------- */
static async addExtensionHud(app, html, tokenId) {
let token = canvas.tokens.get(tokenId)
let actor = token.actor
app.hasExtension = true
const hudData = { actor: actor }
const controlIconActions = html.find('.control-icon[data-action=combat]');
// initiative
await HeritiersTokenHud._configureSubMenu(controlIconActions, 'systems/fvtt-les-heritiers/templates/hud-adversites.html', hudData,
(event) => {
let adversite = event.currentTarget.attributes['data-action-index'].value
let value = Number(event.currentTarget.attributes['data-action-value'].value)
hudData.actor.incDecAdversite( adversite, value)
} )
}
/* -------------------------------------------- */
static async addTokenHudExtensions(app, html, tokenId) {
const controlIconCombat = html.find('.control-icon[data-action=combat]')
if (controlIconCombat.length>0 ) {
HeritiersTokenHud.addExtensionHud(app, html, tokenId);
}
}
/* -------------------------------------------- */
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
const hud = $(await renderTemplate(template, hudData))
const list = hud.find('div.hawkmoon-hud-list')
HeritiersTokenHud._toggleHudListActive(hud, list);
hud.find('img.hawkmoon-hud-togglebutton').click(event => HeritiersTokenHud._toggleHudListActive(hud, list));
list.find('.hawkmoon-hud-adversite').click(onMenuItem);
insertionPoint.after(hud);
}
/* -------------------------------------------- */
static _showControlWhen(control, condition) {
if (condition) {
control.show()
}
else {
control.hide()
}
}
/* -------------------------------------------- */
static _toggleHudListActive(hud, list) {
hud.toggleClass('active')
HeritiersTokenHud._showControlWhen(list, hud.hasClass('active'))
}
}

View File

@ -0,0 +1,227 @@
import { HeritiersUtility } from "./heritiers-utility.js";
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class HeritiersItemSheet extends ItemSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-les-heritiers", "sheet", "item"],
template: "systems/fvtt-les-heritiers/templates/item-sheet.html",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
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() {
const objectData = duplicate(this.object)
let formData = {
title: this.title,
id: this.id,
type: objectData.type,
img: objectData.img,
name: objectData.name,
editable: this.isEditable,
cssClass: this.isEditable ? "editable" : "locked",
attributs: HeritiersUtility.getAttributs(),
system: objectData.system,
limited: this.object.limited,
options: this.options,
owner: this.document.isOwner,
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
mr: (this.object.type == 'specialisation'),
isGM: game.user.isGM
}
if ( objectData.type == "don") {
formData.sacrifice = await TextEditor.enrichHTML(this.object.system.sacrifice, {async: true})
}
//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(HeritiersUtility.data(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/fvtt-Heritiers-rpg/templates/post-item.html', chatData).then(html => {
let chatOptions = HeritiersUtility.chatDataSetup(html);
ChatMessage.create(chatOptions)
});
}
/* -------------------------------------------- */
/** @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);
})
html.find('.edit-predilection').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].name = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.edit-predilection-description').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].description = ev.currentTarget.value
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-acquise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].acquise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-maitrise').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].maitrise = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('.predilection-used').change(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred[index].used = ev.currentTarget.checked
pred[index].id = pred[index].id || randomID(16)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-predilection').click(ev => {
let pred = duplicate(this.object.system.predilections)
pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false })
this.object.update( { 'system.predilections': pred })
})
html.find('.delete-prediction').click(ev => {
const li = $(ev.currentTarget).parents(".prediction-item")
let index = li.data("prediction-index")
let pred = duplicate(this.object.system.predilections)
pred.splice(index,1)
this.object.update( { 'system.predilections': pred })
})
html.find('#add-automation').click(ev => {
let autom = duplicate(this.object.system.automations)
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: randomID(16) })
this.object.update( { 'system.automations': autom })
})
html.find('.delete-automation').click(ev => {
const li = $(ev.currentTarget).parents(".automation-item")
let index = li.data("automation-index")
let autom = duplicate(this.object.system.automations)
autom.splice(index,1)
this.object.update( { 'system.automations': autom })
})
html.find('.automation-edit-field').change(ev => {
let index = $(ev.currentTarget).data("automation-index")
let field = $(ev.currentTarget).data("automation-field")
let auto = duplicate(this.object.system.automations)
auto[index][field] = ev.currentTarget.value
auto[index].id = auto[index].id || randomID(16)
this.object.update( { 'system.automations': auto })
})
// 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-les-heritiers/templates/item-${type}-sheet.html`;
}
/* -------------------------------------------- */
/** @override */
_updateObject(event, formData) {
return this.object.update(formData);
}
}

31
modules/heritiers-item.js Normal file
View File

@ -0,0 +1,31 @@
import { HeritiersUtility } from "./heritiers-utility.js";
export const defaultItemImg = {
competence: "systems/fvtt-les-heritiers/assets/icons/competence.webp",
arme: "systems/fvtt-les-heritiers/assets/icons/melee.webp",
equipement: "systems/fvtt-les-heritiers/assets/icons/equipement.webp",
monnaie: "systems/fvtt-les-heritiers/assets/icons/monnaie.webp",
predilection: "systems/fvtt-les-heritiers/assets/icons/predilection.webp",
protection: "systems/fvtt-les-heritiers/assets/icons/protection.webp",
talent: "systems/fvtt-les-heritiers/assets/icons/talent.webp",
historique: "systems/fvtt-les-heritiers/assets/icons/historique.webp",
profil: "systems/fvtt-les-heritiers/assets/icons/profil.webp",
artefact: "systems/fvtt-les-heritiers/assets/icons/artefact.webp",
contact: "systems/fvtt-les-heritiers/assets/icons/contacts.webp",
ressource: "systems/fvtt-les-heritiers/assets/icons/ressources.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class HeritiersItem extends Item {
constructor(data, context) {
if (!data.img) {
data.img = defaultItemImg[data.type];
}
super(data, context);
}
}

150
modules/heritiers-main.js Normal file
View File

@ -0,0 +1,150 @@
/**
* Heritiers system
* Author: Uberwald
* Software License: Prop
*/
/* -------------------------------------------- */
/* -------------------------------------------- */
// Import Modules
import { HeritiersActor } from "./hawkmoon-actor.js";
import { HeritiersItemSheet } from "./hawkmoon-item-sheet.js";
import { HeritiersActorSheet } from "./hawkmoon-actor-sheet.js";
import { HeritiersCreatureSheet } from "./hawkmoon-creature-sheet.js";
import { HeritiersCelluleSheet } from "./hawkmoon-cellule-sheet.js";
import { HeritiersUtility } from "./heritiers-utility.js";
import { HeritiersCombat } from "./hawkmoon-combat.js";
import { HeritiersItem } from "./hawkmoon-item.js";
import { HeritiersAutomation } from "./hawkmoon-automation.js";
import { HeritiersTokenHud } from "./hawkmoon-hud.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
/************************************************************************************/
Hooks.once("init", async function () {
console.log(`Initializing Heritiers RPG`);
/* -------------------------------------------- */
// preload handlebars templates
HeritiersUtility.preloadHandlebarsTemplates()
/* -------------------------------------------- */
// Set an initiative formula for the system
CONFIG.Combat.initiative = {
formula: "1d10",
decimals: 1
};
/* -------------------------------------------- */
game.socket.on("system.fvtt-les-heritiers", data => {
HeritiersUtility.onSocketMesssage(data)
});
/* -------------------------------------------- */
// Define custom Entity classes
CONFIG.Combat.documentClass = HeritiersCombat
CONFIG.Actor.documentClass = HeritiersActor
CONFIG.Item.documentClass = HeritiersItem
game.system.hawkmoon = {
HeritiersUtility,
HeritiersAutomation
}
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("fvtt-les-heritiers", HeritiersActorSheet, { types: ["personnage"], makeDefault: true })
Actors.registerSheet("fvtt-les-heritiers", HeritiersCreatureSheet, { types: ["creature"], makeDefault: true })
Actors.registerSheet("fvtt-les-heritiers", HeritiersCelluleSheet, { types: ["cellule"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("fvtt-les-heritiers", HeritiersItemSheet, { makeDefault: true })
HeritiersUtility.init()
HeritiersAutomation.init()
HeritiersTokenHud.init()
});
/* -------------------------------------------- */
function welcomeMessage() {
ChatMessage.create({
user: game.user.id,
whisper: [game.user.id],
content: `<div id="welcome-message-Heritiers"><span class="rdd-roll-part">
<strong>Bienvenue dans Heritiers et le troisième Millénaire !</strong>
<p>Les livres de Heritiers sont nécessaires pour jouer : https://www.titam-france.fr</p>
<p>Heritiers est jeu de rôle publié par Titam France/Sombres projets, tout les droits leur appartiennent.</p>
<p>Système développé par LeRatierBretonnien, support sur le <a href="https://discord.gg/pPSDNJk">Discord FR de Foundry</a>.</p>
` });
}
/* -------------------------------------------- */
// 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 () {
HeritiersUtility.ready()
// User warning
if (!game.user.isGM && game.user.character == undefined) {
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
ChatMessage.create({
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
user: game.user._id
});
}
registerUsageCount('fvtt-les-heritiers')
welcomeMessage()
// CSS patch for v9
if (game.version) {
let sidebar = document.getElementById("sidebar");
sidebar.style.width = "min-content";
}
});
/* -------------------------------------------- */
/* Foundry VTT Initialization */
/* -------------------------------------------- */
Hooks.on("chatMessage", (html, content, msg) => {
if (content[0] == '/') {
let regExp = /(\S+)/g;
let commands = content.match(regExp);
if (game.system.mournblade.commands.processChatCommand(commands, content, msg)) {
return false;
}
}
return true;
});

View File

@ -0,0 +1,80 @@
import { HeritiersUtility } from "./heritiers-utility.js";
export class HeritiersRollDialog extends Dialog {
/* -------------------------------------------- */
static async create(actor, rollData ) {
let options = { classes: ["HeritiersDialog"], width: 320, height: 'fit-content', 'z-index': 99999 };
let html = await renderTemplate('systems/fvtt-les-heritiers/templates/roll-dialog-generic.html', rollData);
return new HeritiersRollDialog(actor, rollData, html, options );
}
/* -------------------------------------------- */
constructor(actor, rollData, html, options, close = undefined) {
let conf = {
title: "Test de Capacité",
content: html,
buttons: {
rolld10: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d10",
callback: () => { this.roll("d10") }
},
rolld20: {
icon: '<i class="fas fa-check"></i>',
label: "Lancer 1d20",
callback: () => { this.roll("d20") }
},
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 ( dice) {
this.rollData.mainDice = dice
HeritiersUtility.rollHeritiers( this.rollData )
}
/* -------------------------------------------- */
activateListeners(html) {
super.activateListeners(html);
var dialog = this;
function onLoad() {
}
$(function () { onLoad(); });
html.find('#modificateur').change(async (event) => {
this.rollData.modificateur = Number(event.currentTarget.value)
})
html.find('#difficulte').change(async (event) => {
this.rollData.difficulte = Number(event.currentTarget.value)
})
html.find('#attrKey').change(async (event) => {
this.rollData.attrKey = String(event.currentTarget.value)
})
html.find('#select-maitrise').change(async (event) => {
this.rollData.maitriseId = String(event.currentTarget.value)
})
html.find('#competence-talents').change((event) => {
this.rollData.selectedTalents = $('#competence-talents').val()
})
html.find('#bonus-malus-context').change((event) => {
this.rollData.bonusMalusContext = Number(event.currentTarget.value)
})
}
}

View File

@ -0,0 +1,674 @@
/* -------------------------------------------- */
import { HeritiersCombat } from "./heritiers-combat.js";
import { HeritiersCommands } from "./heritiers-commands.js";
/* -------------------------------------------- */
export class HeritiersUtility {
/* -------------------------------------------- */
static async init() {
Hooks.on('renderChatLog', (log, html, data) => HeritiersUtility.chatListeners(html))
Hooks.on("getChatLogEntryContext", (html, options) => HeritiersUtility.chatRollMenu(html, options))
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
HeritiersUtility.pushInitiativeOptions(html, options);
})
this.rollDataStore = {}
this.defenderStore = {}
HeritiersCommands.init()
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);
})
game.settings.register("fvtt-les-heritiers", "hawkmoon-pause-logo", {
name: "Logo de pause",
scope: "world",
config: true,
requiresReload: true,
default: "logo_pause_resistance",
type: String,
choices: { // If choices are defined, the resulting setting will be a select menu
"hawkmoon_logo": "Hawmoon (Texte)",
"logo_pause_resistance": "Résistance",
"logo_pause_hawkmoon_stone": "Heritiers (Pierre)",
"logo_pause_hawkmoon_violet": "Heritiers (Violet)",
"logo_pause_hawkmoon_beige": "Heritiers (Beige)",
"logo_pause_hawkmoon_rouge": "Heritiers (Rouge)"
},
})
}
/* -------------------------------------------- */
static getModificateurOptions() {
let opt = []
for (let i = -15; i <= 15; i++) {
opt.push(`<option value="${i}">${i}</option>`)
}
return opt.concat("\n")
}
/* -------------------------------------------- */
static getPointAmeOptions() {
let opt = []
for (let i = 1; i <= 20; i++) {
opt.push(`<option value="${i}">${i}</option>`)
}
return opt.concat("\n")
}
/* -------------------------------------------- */
static getAttributs() {
return { adr: "Adresse", pui: "Puissance", cla: "Clairvoyance", pre: "Présence", tre: "Trempe" }
}
/* -------------------------------------------- */
static pushInitiativeOptions(html, options) {
}
/* -------------------------------------------- */
static getSkills() {
return this.skills
}
/* -------------------------------------------- */
static async ready() {
const skills = await HeritiersUtility.loadCompendium("fvtt-les-heritiers.skills")
this.skills = skills.map(i => i.toObject())
// Setup pause logo
let logoPause = "systems/fvtt-les-heritiers/assets/logos/" + game.settings.get("fvtt-les-heritiers", "hawkmoon-pause-logo") + ".webp"
let logoImg = document.querySelector('#pause').children[0]
logoImg.setAttribute('style', `content: url(${logoPause})`)
}
/* -------------------------------------------- */
static async loadCompendiumData(compendium) {
const pack = game.packs.get(compendium);
return await pack?.getDocuments() ?? [];
}
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await HeritiersUtility.loadCompendiumData(compendium);
return compendiumData.filter(filter);
}
/* -------------------------------------------- */
static getOptionsStatusList() {
return this.optionsStatusList;
}
/* -------------------------------------------- */
static async chatListeners(html) {
html.on("click", '.predilection-reroll', async event => {
let predIdx = $(event.currentTarget).data("predilection-index")
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
let message = game.messages.get(messageId)
let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
await actor.setPredilectionUsed(rollData.competence._id, predIdx)
rollData.competence = duplicate(actor.getCompetence(rollData.competence._id))
HeritiersUtility.rollHeritiers(rollData)
})
html.on("click", '.roll-chat-degat', async event => {
let messageId = HeritiersUtility.findChatMessageId(event.currentTarget)
let message = game.messages.get(messageId)
let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
actor.rollArmeDegats(rollData.arme._id, rollData.targetVigueur)
})
}
/* -------------------------------------------- */
static async preloadHandlebarsTemplates() {
const templatePaths = [
'systems/fvtt-les-heritiers/templates/editor-notes-gm.html',
'systems/fvtt-les-heritiers/templates/partial-item-header.html',
'systems/fvtt-les-heritiers/templates/partial-item-description.html',
'systems/fvtt-les-heritiers/templates/partial-item-nav.html',
'systems/fvtt-les-heritiers/templates/partial-list-niveau.html',
'systems/fvtt-les-heritiers/templates/partial-item-prix.html',
'systems/fvtt-les-heritiers/templates/partial-sante-etat.html',
'systems/fvtt-les-heritiers/templates/partial-automation.html',
'systems/fvtt-les-heritiers/templates/hud-adversites.html',
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static removeChatMessageId(messageId) {
if (messageId) {
game.messages.get(messageId)?.delete();
}
}
static findChatMessageId(current) {
return HeritiersUtility.getChatMessageId(HeritiersUtility.findChatMessage(current));
}
static getChatMessageId(node) {
return node?.attributes.getNamedItem('data-message-id')?.value;
}
static findChatMessage(current) {
return HeritiersUtility.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 HeritiersUtility.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 && game.user.targets.size == 1) {
for (let target of game.user.targets) {
return target;
}
}
return undefined;
}
/* -------------------------------------------- */
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 updateRollData(rollData) {
let id = rollData.rollId;
let oldRollData = this.rollDataStore[id] || {};
let newRollData = mergeObject(oldRollData, rollData);
this.rollDataStore[id] = newRollData;
}
/* -------------------------------------------- */
static saveRollData(rollData) {
game.socket.emit("system.fvtt-les-heritiers", {
name: "msg_update_roll", data: rollData
}); // Notify all other clients of the roll
this.updateRollData(rollData);
}
/* -------------------------------------------- */
static getRollData(id) {
return this.rollDataStore[id];
}
/* -------------------------------------------- */
static onSocketMesssage(msg) {
//console.log("SOCKET MESSAGE", msg.name, game.user.character.id, msg.data.defenderId);
if (msg.name == "msg_update_defense_state") {
this.updateDefenseState(msg.data.defenderId, msg.data.rollId);
}
if (msg.name == "msg_update_roll") {
this.updateRollData(msg.data);
}
}
/* -------------------------------------------- */
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 computeMonnaieDetails(valueSC) {
let po = Math.floor(valueSC / 400)
let pa = Math.floor((valueSC - (po*400)) / 20)
let sc = valueSC - (po*400) - (pa*20)
return {
po: po, pa: pa, sc: sc, valueSC: valueSC
}
}
/* -------------------------------------------- */
static computeResult(rollData) {
rollData.diceResult = rollData.roll.terms[0].results[0].result
if (rollData.mainDice.includes("d20")) {
let diceValue = rollData.roll.terms[0].results[0].result
if (diceValue % 2 == 1) {
//console.log("PAIR/IMP2", diceValue)
rollData.finalResult -= rollData.roll.terms[0].results[0].result // Substract value
if (diceValue == 1 || diceValue == 11) {
rollData.isDramatique = true
rollData.isSuccess = false
}
}
}
//console.log("Result : ", rollData)
if (rollData.difficulte > 0 && !rollData.isDramatique) {
rollData.isSuccess = (rollData.finalResult >= rollData.difficulte)
rollData.isHeroique = ((rollData.finalResult - rollData.difficulte) >= 10)
rollData.isDramatique = ((rollData.finalResult - rollData.difficulte) <= -10)
}
}
/* -------------------------------------------- */
static async rollHeritiers(rollData) {
let actor = this.getActorFromRollData(rollData)
if (rollData.attrKey == "tochoose") { // No attr selected, force address
rollData.attrKey = "adr"
}
if (!rollData.attr) {
rollData.actionImg = "systems/fvtt-les-heritiers/assets/icons/" + actor.system.attributs[rollData.attrKey].labelnorm + ".webp"
rollData.attr = duplicate(actor.system.attributs[rollData.attrKey])
}
if (rollData.maitriseId != "none") {
rollData.selectedMaitrise = rollData.maitrises.find(p => p.id == rollData.maitriseId)
rollData.diceFormula = "2" + rollData.mainDice + "kh"
} else {
rollData.diceFormula = "1" + rollData.mainDice
}
//console.log("BEFORE COMP", rollData)
if (rollData.competence) {
rollData.predilections = duplicate(rollData.competence.system.predilections.filter(pred => pred.acquise && !pred.maitrise && !pred.used) || [])
let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0
rollData.diceFormula += `+${rollData.attr.value}+${rollData.competence.system.niveau}+${rollData.modificateur}+${compmod}`
if (rollData.selectedTalents && rollData.selectedTalents.length > 0) {
for (let id of rollData.selectedTalents) {
let talent = rollData.talents.find(t => t._id == id)
let bonusOK = true
if (talent.system.baCost) {
bonusOK = actor.checkBonneAventure(talent.system.baCost)
if (bonusOK) {
actor.changeBonneAventure(-talent.system.baCost)
} else {
ui.notifications.warn("Vous n'avez pas assez de points de Bonne Aventure !")
}
}
if (bonusOK) {
rollData.diceFormula += `+${talent.system.bonus}`
}
}
}
rollData.diceFormula += `+${rollData.bonusMalusContext}`
} else {
rollData.diceFormula += `+${rollData.attr.value}*${rollData.multiplier}+${rollData.modificateur}+${rollData.bonusMalusContext}`
}
// Ajout adversités
rollData.diceFormula += `-${rollData.nbAdversites}`
if (rollData.arme && rollData.arme.type == "arme") {
rollData.diceFormula += `+${rollData.arme.system.bonusmaniementoff}`
}
let myRoll = new Roll(rollData.diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
console.log(">>>> ", myRoll)
rollData.finalResult = myRoll.total
this.computeResult(rollData)
if (rollData.isInit) {
actor.setFlag("world", "last-initiative", rollData.finalResult)
}
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
}, rollData)
}
/* -------------------------------------------- */
static async bonusRollHeritiers(rollData) {
rollData.bonusFormula = rollData.addedBonus
let bonusRoll = new Roll(rollData.bonusFormula).roll({ async: false })
await this.showDiceSoNice(bonusRoll, game.settings.get("core", "rollMode"));
rollData.bonusRoll = bonusRoll
rollData.finalResult += rollData.bonusRoll.total
this.computeResult(rollData)
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-les-heritiers/templates/chat-generic-result.html`, rollData)
}, rollData)
}
/* -------------------------------------------- */
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 "selfroll": return [game.user.id];
}
return undefined;
}
/* -------------------------------------------- */
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-les-heritiers", { msg: "msg_gm_chat_message", data: chatGM });
}
/* -------------------------------------------- */
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 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, rollData = undefined) {
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
let msg = await ChatMessage.create(chatOptions)
console.log("=======>", rollData)
msg.setFlag("world", "hawkmoon-roll", rollData)
}
/* -------------------------------------------- */
static getBasicRollData() {
let rollData = {
rollId: randomID(16),
rollMode: game.settings.get("core", "rollMode"),
modificateursOptions: this.getModificateurOptions(),
pointAmeOptions: this.getPointAmeOptions(),
difficulte: 0,
modificateur: 0,
bonusMalusContext: 0
}
return rollData
}
/* -------------------------------------------- */
static updateWithTarget(rollData) {
let target = HeritiersUtility.getTarget()
if (target) {
rollData.defenderTokenId = target.id
let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor
rollData.armeDefense = defender.getBestDefenseValue()
rollData.targetVigueur = defender.getVigueur()
if (rollData.armeDefense) {
rollData.difficulte = rollData.armeDefense.system.totalDefensif
} else {
ui.notifications.warn("Aucune arme de défense équipée, difficulté manuelle à positionner.")
}
}
}
/* -------------------------------------------- */
static createChatWithRollMode(name, chatOptions, rollData = undefined) {
this.createChatMessage(name, game.settings.get("core", "rollMode"), chatOptions, rollData)
}
/* -------------------------------------------- */
static applyBonneAventureRoll(li, changed, addedBonus) {
let msgId = li.data("message-id")
let msg = game.messages.get(msgId)
if (msg) {
let rollData = msg.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
actor.changeBonneAventure(changed)
rollData.isReroll = true
rollData.textBonus = "Bonus de Points d'Aventure"
if (addedBonus == "reroll") {
HeritiersUtility.rollHeritiers(rollData)
} else {
rollData.addedBonus = addedBonus
HeritiersUtility.bonusRollHeritiers(rollData)
}
}
}
/* -------------------------------------------- */
static applyEclatRoll(li, changed, addedBonus) {
let msgId = li.data("message-id")
let msg = game.messages.get(msgId)
if (msg) {
let rollData = msg.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
actor.changeEclat(changed)
rollData.isReroll = true
rollData.textBonus = "Bonus d'Eclat"
if (addedBonus == "reroll") {
HeritiersUtility.rollHeritiers(rollData)
} else {
rollData.addedBonus = addedBonus
HeritiersUtility.bonusRollHeritiers(rollData)
}
}
}
/* -------------------------------------------- */
static chatRollMenu(html, options) {
let canApply = li => canvas.tokens.controlled.length && li.find(".hawkmoon-roll").length
let canApplyBA = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
return (!rollData.isReroll && actor.getBonneAventure() > 0)
}
let canApplyPE = function (li) {
let message = game.messages.get(li.attr("data-message-id"))
let rollData = message.getFlag("world", "hawkmoon-roll")
let actor = this.getActorFromRollData(rollData)
return (!rollData.isReroll && actor.getEclat() > 0)
}
options.push(
{
name: "Ajouer +3 (1 point de Bonne Aventure)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyBA,
callback: li => HeritiersUtility.applyBonneAventureRoll(li, -1, "+3")
}
)
options.push(
{
name: "Ajouter +10 (1 Point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPE,
callback: li => HeritiersUtility.applyEclatRoll(li, -1, "+10")
}
)
options.push(
{
name: "Relancer le dé (1 point d'Eclat)",
icon: "<i class='fas fa-user-plus'></i>",
condition: canApply && canApplyPE,
callback: li => HeritiersUtility.applyEclatRoll(li, -3, "reroll")
}
)
return options
}
/* -------------------------------------------- */
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);
}
/************************************************************************************/
static async __create_talents_table() {
let compName = "fvtt-les-heritiers.talents-cellule"
const compData = await HeritiersUtility.loadCompendium(compName)
let talents = compData.map(i => i.toObject())
let htmlTab = "<table border='1'><tbody>";
for (let entryData of talents) {
console.log(entryData)
htmlTab += `<tr><td>@UUID[Compendium.${compName}.${entryData._id}]{${entryData.name}}</td>`
htmlTab += `<td>${entryData.system.description}</td>`;
//htmlTab += `<td>${entryData.system.resumebonus}</td>`;
htmlTab += "</tr>\n";
}
htmlTab += "</table>";
await JournalEntry.create({ name: 'Liste des Talents de Cellule', content: htmlTab });
}
}

8225
modules/xregexp-all.js Normal file

File diff suppressed because it is too large Load Diff

1452
styles/simple.css Normal file

File diff suppressed because it is too large Load Diff

56
system.json Normal file
View File

@ -0,0 +1,56 @@
{
"id": "fvtt-les-heritiers",
"description": "Les Héritiers pour FoundryVTT",
"version": "10.0.0",
"authors": [
{
"name": "Uberwald/LeRatierBretonnien",
"flags": {}
},
{
"name": "Prêtre",
"flags": {}
}
],
"esmodules": [
"modules/heritiers-main.js"
],
"gridDistance": 5,
"gridUnits": "m",
"license": "LICENSE.txt",
"manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json",
"download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-hawkmoon-cyd-10.0.0.zip",
"languages": [
{
"lang": "fr",
"name": "French",
"path": "lang/fr.json",
"flags": {}
}
],
"packs": [
{
"type": "Item",
"label": "Compétences",
"name": "skills",
"path": "packs/competences.db",
"system": "fvtt-les-heritiers",
"private": false,
"flags": {}
}
],
"primaryTokenAttribute": "sante.vigueur",
"secondaryTokenAttribute": "bonneaventure.actuelle",
"socket": true,
"styles": [
"styles/simple.css"
],
"title": "Les Héritiers",
"url": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers",
"background": "systems/fvtt-les-heritiers/assets/ui/fond_hawkmoon.webp",
"compatibility": {
"minimum": "10",
"verified": "10",
"maximum": "10"
}
}

330
template.json Normal file
View File

@ -0,0 +1,330 @@
{
"Actor": {
"types": [
"personnage",
"creature"
],
"templates": {
"biodata": {
"biodata": {
"name": "",
"activite":"",
"profilmajeur": "",
"profilmineur": "",
"fortune": 0,
"traitscaracteres": "",
"taillemasquee": "",
"poidsmasquee": "",
"apparencemasquee": "",
"age": 0,
"poids": "",
"taille": "",
"cheveux": "",
"sexe": "",
"yeux": "",
"description": "",
"habitat": "",
"notes": "",
"statut": "",
"gmnotes": ""
}
},
"core": {
"subactors": [],
"caracteristiques": {
"agi": {
"label": "Agilité",
"labelnorm": "agilite",
"abbrev": "agi",
"value": 1,
"rang": 0,
"max": 1
},
"con": {
"label": "Constitution",
"labelnorm": "constitution",
"abbrev": "con",
"value": 1,
"rang": 0,
"max": 1
},
"for": {
"label": "Force",
"labelnorm": "force",
"abbrev": "for",
"value": 1,
"rang": 0,
"max": 1
},
"prec": {
"label": "Précision",
"labelnorm": "precision",
"abbrev": "prec",
"value": 1,
"rang": 0,
"max": 1
},
"esp": {
"label": "Esprit",
"labelnorm": "esprit",
"abbrev": "esp",
"value": 1,
"rang": 0,
"max": 1
},
"per": {
"label": "Perception",
"labelnorm": "perception",
"abbrev": "per",
"value": 1,
"rang": 0,
"max": 1
},
"pres": {
"label": "Présence",
"labelnorm": "presence",
"abbrev": "pre",
"value": 1,
"rang": 0,
"max": 1
},
"san": {
"label": "Sang-Froid",
"labelnorm": "sangfroid",
"abbrev": "san",
"value": 1,
"rang": 0,
"max": 1
}
},
"rang": {
"tricherie": {
"value": 0,
"max": 0
},
"feerie": {
"value": 0,
"max": 0
},
"masque": {
"value": 0,
"max": 0
},
"heritage": {
"value": 0,
"scenarios": 0
}
},
"pv": {
"value": 0,
"max": 0
},
"competences": {
"aventurier": {
"label": "Aventurier",
"rang": 0,
"pp": 0
},
"combattant": {
"label": "Aventurier",
"rang": 0,
"pp": 0
},
"erudit": {
"label": "Erudit",
"rang": 0,
"pp": 0
},
"gentleman": {
"label": "Gentleman",
"rang": 0,
"pp": 0
},
"roublard": {
"label": "Roublard",
"rang": 0,
"pp": 0
},
"savant": {
"label": "Savant",
"rang": 0,
"pp": 0
}
},
"experience": {
"value": 0,
"pourtricher": 0
},
"combat": {
"esquive": {
"masquee": 0,
"demasquee": 0
},
"parade": {
"value": 0
},
"resistancephysique": {
"value": 0
},
"resistancepsychique": {
"value": 0
},
"protection": {
"value": 0
},
"effetssecondaires": "",
"dissimulation": {
"value": 0
},
"initiative": {
"masquee": 0,
"demasquee": 0
},
"corpsacorps": {
"masquee": 0,
"demasquee": 0
},
"tir": {
"masquee": 0,
"demasquee": 0
}
}
},
"npccore": {
"npctype": "",
"description": ""
}
},
"personnage": {
"templates": [
"biodata",
"core"
]
}
},
"Item": {
"templates": {
"base": {
"description": ""
},
"basequip": {
"rarete": 0,
"quantite": 0,
"equipped": false
}
},
"types": [
"talenfeet",
"capacitenaturelle",
"pouvoir",
"atoutfeerique",
"competence",
"protection",
"monnaie",
"equipement",
"artefact",
"ressource",
"contact"
],
"fee": {
"feetype": 0,
"description": ""
},
"capacitenaturelle": {
"description": ""
},
"pouvoir": {
"description": ""
},
"atoutfeerique": {
"description": ""
},
"competence": {
"categorie": "",
"profil": "",
"niveau": 0,
"predilection": false,
"specialites": "",
"description": ""
},
"historique": {
"bonusmalus": "",
"templates": [
"base"
]
},
"profil": {
"exemples": "",
"attribut1": "",
"attribut2": "",
"attribut3": "",
"competences": "",
"talentsinitie": "",
"prerequisaguerri": "",
"talentsaguerri": "",
"prerequismaitre": "",
"talentsmaitre": "",
"celluleinfo": "",
"equipement": "",
"templates": [
"base"
]
},
"equipement": {
"templates": [
"base",
"basequip"
]
},
"arme": {
"typearme": "",
"bonusmaniementoff": 0,
"seuildefense": 0,
"onlevelonly": false,
"degats": "",
"deuxmains": false,
"percearmure": false,
"percearmurevalue": 0,
"courte": 0,
"moyenne": 0,
"longue": 0,
"tr": 0,
"templates": [
"base",
"basequip"
]
},
"protection": {
"protection": 0,
"adversitepoids" :0,
"templates": [
"base",
"basequip"
]
},
"monnaie": {
"templates": [
"base",
"basequip"
]
},
"artefact": {
"complexite": 0,
"branche": "",
"branche2": "none",
"dureerealisation": "",
"tempsroute": "",
"effetdejeu": "",
"defautcourant": "",
"autrescarac": "",
"avantagespossibles": "",
"avantages": "",
"competences": "",
"templates": [
"base",
"basequip"
]
}
}
}

561
templates/actor-sheet.html Normal file
View File

@ -0,0 +1,561 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields background-sheet-header">
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<ul class="item-list alternate-list">
<li class="item flexrow ">
<h4 class="item-name-label competence-name">Bonne Aventure</h4>
<label class="item-name-label competence-name item-field-label-short">Base</label>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.bonneaventure.base" value="{{system.bonneaventure.base}}" data-dtype="Number" />
<label class="item-name-label competence-name item-field-label-short">Actuelle</label>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.bonneaventure.actuelle" value="{{system.bonneaventure.actuelle}}" data-dtype="Number" />
</li>
<li class="item flexrow ">
<h4 class="item-name-label competence-name item-field-label-medium">Expérience</h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.experience.value" value="{{system.experience.value}}" data-dtype="Number" />
<h4 class="item-name-label competence-name item-field-label-medium">Eclat</h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.eclat.value" value="{{system.eclat.value}}" data-dtype="Number" />
</li>
<li class="item flexrow">
<h4 class="item-name-label competence-name item-field-label-medium">Vigueur</h4>
<label class="status-small-label color-class-common item-field-label-short">{{system.sante.vigueur}}</label>
<h4 class="item-name-label competence-name item-field-label-medium">Etat</h4>
<select class="status-small-label color-class-common item-field-label-medium" type="text" name="system.sante.etat"
value="{{system.sante.etat}}" data-dtype="Number">
{{#select system.sante.etat}}
{{> systems/fvtt-les-heritiers/templates/partial-sante-etat.html}}
{{/select}}
</select>
</li>
</ul>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="principal">Attributs</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="combat">Combat</a>
<a class="item" data-tab="equipement">Equipement</a>
<a class="item" data-tab="biodata">Bio&Notes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Main Tab --}}
<div class="tab principal" data-group="primary" data-tab="principal">
<div class="flexcol">
<div class="grid grid-2col">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
{{#each system.attributs as |attr key|}}
<li class="item flexrow " data-attr-key="{{key}}">
<img class="item-name-img" src="systems/fvtt-les-heritiers/assets/icons/{{attr.labelnorm}}.webp">
<span class="item-name-label competence-name item-field-label-medium"><a
class="roll-attribut">{{attr.label}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number">
{{#select attr.value}}
{{> systems/fvtt-les-heritiers/templates/partial-list-niveau.html}}
{{/select}}
</select>
</li>
{{/each}}
<li class="item flexrow">
<img class="item-name-img" src="systems/fvtt-les-heritiers/assets/icons/vitesse.webp">
<span class="item-name-label competence-name item-field-label-medium">Vitesse</span>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.vitesse.value"
value="{{system.vitesse.value}}" data-dtype="Number" />
</li>
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<h4 class="item-name-label competence-name">Adversités</h4>
<ul class="item-list alternate-list">
{{#each system.adversite as |adv key|}}
<li class="item flexrow" data-adversite="{{key}}">
<a class="adversite-modify plus-minus-button" data-adversite-value="-1">-</a>
<div class="icon-adversite-container">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_{{key}}.webp">
<div class="adversite-text">{{adv}}</div>
</div>
<a class="adversite-modify plus-minus-button" data-adversite-value="1">+</a>
<div class="">&nbsp;</div>
<div class="">&nbsp;</div>
<div class="">&nbsp;</div>
</li>
{{/each}}
</ul>
</div>
</div>
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Talents</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Résumé</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each talents as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
<img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Talents de Cellule</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Résumé</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each talentsCell as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
<img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
</div>
{{!-- Competence Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Compétences</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Niveau</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each skills as |skill key|}}
<li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence">
<img class="item-name-img" src="{{skill.img}}" />
<span class="item-name-label competence-name"><a class="roll-competence item-field-label-short"
data-attr-key="tochoose">{{skill.name}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
data-item-field="niveau" value="{{skill.system.niveau}}" data-dtype="Number">
{{#select skill.system.niveau}}
{{> systems/fvtt-les-heritiers/templates/partial-list-niveau.html}}
{{/select}}
</select>
{{#if (ne skill.system.attribut1 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut1}}">{{upper
skill.system.attribut1}} : {{skill.system.attribut1total}}</button>
{{/if}}
{{#if (ne skill.system.attribut2 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut2}}">{{upper
skill.system.attribut2}} : {{skill.system.attribut2total}}</button>
{{/if}}
{{#if (ne skill.system.attribut3 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut3}}">{{upper
skill.system.attribut3}} : {{skill.system.attribut3total}}</button>
{{/if}}
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab combat" data-group="primary" data-tab="combat">
<ul class="item-list alternate-list">
<li class="item flexrow">
<button class="chat-card-button roll-initiative">Initiative (actuelle : {{initiative}} )</button>
</li>
</ul>
<div class="flexcol">
<div class="sheet-box color-bg-archetype">
<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-short">
<label class="short-label">Attaque</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Défense</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dégats</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each armes as |arme key|}}
<li class="item flexrow " data-item-id="{{arme._id}}" data-item-type="arme">
<img class="item-name-img" src="{{arme.img}}" />
<span class="item-name-label competence-name">{{arme.name}}</span>
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{else}}
<button disabled class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{/if}}
</span>
{{#if arme.system.isdefense}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">{{arme.system.totalDefensif}}</label></span>
{{else}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">N/A</label></span>
{{/if}}
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{else}}
<button disabled class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if arme.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<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">Protections</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Protection</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each protections as |protection key|}}
<li class="item flexrow " data-item-id="{{protection._id}}" data-item-type="protection">
<img class="item-name-img" src="{{protection.img}}" />
<span class="item-name-label competence-name">{{protection.name}}</span>
<span class="item-field-label-short arme-defensif"><label
class="arme-defensif">{{protection.system.protection}}</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab equipement" data-group="primary" data-tab="equipement">
<div class="flexcol">
<hr>
<div class="sheet-box color-bg-archetype">
<h4>
<label class="argent-total-text">
Argent Total : {{richesse.po}} PO - {{richesse.pa}} PA - {{richesse.sc}} SC (total {{richesse.valueSC}} SC)
</label>
</h4>
</div>
<div class="sheet-box color-bg-archetype">
<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">Richesses et Argent</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Quantité</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="monnaie" title="Ajouter une monnaie"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each monnaies as |monnaie key|}}
<li class="item flexrow " data-item-id="{{monnaie._id}}" data-item-type="monnaie">
<img class="item-name-img" src="{{monnaie.img}}" />
<span class="item-name-label competence-name">{{monnaie.name}}</span>
<span class="item-name-label competence-name item-field-label-medium">{{monnaie.system.quantite}}
<a class="quantity-modify plus-minus-button" data-quantite-value="-1">-</a>
<a class="quantity-modify plus-minus-button" data-quantite-value="+1">+</a>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<hr>
<div class="sheet-box color-bg-archetype">
<h4>
<label class="argent-total-text">
Valeur Total Equipement : {{valeurEquipement.po}} PO - {{valeurEquipement.pa}} PA - {{valeurEquipement.sc}} SC (total {{valeurEquipement.valueSC}} SC)
</label>
</h4>
</div>
<div class="sheet-box color-bg-archetype">
<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</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Quantité</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="equipement" title="Ajouter un équipement"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each equipements as |equipement key|}}
<li class="item flexrow " data-item-id="{{equipement._id}}" data-item-type="equipement">
<img class="item-name-img" src="{{equipement.img}}" />
<span class="item-name-label competence-name">{{equipement.name}}</span>
<span class="item-name-label competence-name item-field-label-medium">{{equipement.system.quantite}}
<a class="quantity-modify plus-minus-button" data-quantite-value="-1">-</a>
<a class="quantity-modify plus-minus-button" data-quantite-value="+1">+</a>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<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">Artefacts</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Quantité</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="artefact" title="Ajouter un artefact"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each artefacts as |artefact key|}}
<li class="item flexrow " data-item-id="{{artefact._id}}" data-item-type="artefact">
<img class="item-name-img" src="{{artefact.img}}" />
<span class="item-name-label competence-name">{{artefact.name}}</span>
<span class="item-name-label competence-name item-field-label-medium">{{artefact.system.quantite}}
<a class="quantity-modify plus-minus-button" data-quantite-value="-1">-</a>
<a class="quantity-modify plus-minus-button" data-quantite-value="+1">+</a>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<div>
<ul class="item-list alternate-list">
{{#each historiques as |historique key|}}
<li class="item flexrow" data-item-id="{{historique._id}}">
<label class="generic-label">Historique : </label>
<label class="generic-label">{{historique.name}}</label>
<label></label>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
{{#each profils as |profil key|}}
<li class="item flexrow" data-item-id="{{profil._id}}">
<label class="generic-label">Profil : </label>
<label class="generic-label">{{profil.name}}</label>
<label></label>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="grid grid-3col">
<div>
<ul>
<li class="flexrow item">
<label class="generic-label">Sexe</label>
<input type="text" class="" name="system.biodata.sex" value="{{system.biodata.sex}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Age</label>
<input type="text" class="" name="system.biodata.age" value="{{system.biodata.age}}"
data-dtype="String" />
</li>
</ul>
</div>
<div>
<ul>
<li class="item flexrow">
<label class="generic-label">Taille</label>
<input type="text" class="" name="system.biodata.size" value="{{system.biodata.size}}"
data-dtype="String" />
</li>
<li class="item flexrow">
<label class="generic-label">Cheveux</label>
<input type="text" class="" name="system.biodata.hair" value="{{system.biodata.hair}}"
data-dtype="String" />
</li>
</ul>
</div>
<div>
<li class="item flexrow">
<label class="generic-label">Yeux</label>
<input type="text" class="" name="system.biodata.eyes" value="{{system.biodata.eyes}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Main préférée</label>
<input type="text" class="" name="system.biodata.preferredhand" value="{{system.biodata.preferredhand}}"
data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Poids</label>
<input type="text" class="" name="system.biodata.weight" value="{{system.biodata.weight}}"
data-dtype="String" />
</li>
</div>
</div>
<span>
<h3>Description</h3>
</span>
<div class="medium-editor item-text-long-line">
{{editor description target="system.biodata.description" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

@ -0,0 +1,28 @@
<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 actionImg}}
<div>
<img class="chat-icon" src="{{actionImg}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li>Arme : {{arme.name}} (+{{arme.system.totalDegats}})</li>
<li>Dégats : {{finalResult}}</li>
{{#if targetVigueur}}
<li>Vigueur de la cible : {{targetVigueur}}</li>
<li>Etats Combativité supplémentaires perdus (manuel): {{nbEtatPerdus}} </li>
{{/if}}
</ul>
</div>

View File

@ -0,0 +1,84 @@
<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 actionImg}}
<div>
<img class="chat-icon" src="{{actionImg}}" alt="{{name}}" />
</div>
{{/if}}
<div class="flexcol">
</div>
<div>
<ul>
<li class="hawkmoon-roll">Attribut : {{attr.label}} ({{attr.value}})</li>
{{#if competence}}
<li>Compétence : {{competence.name}} ({{competence.system.niveau}})</li>
{{/if}}
{{#if selectedMaitrise}}
<li>Maitrise : {{selectedMaitrise.name}}</li>
{{/if}}
{{#if arme}}
<li>Arme : {{arme.name}} (+{{arme.system.bonusmaniementoff}})</li>
{{/if}}
<li>Formule : {{diceFormula}}</li>
<li>Résultat du dé : {{diceResult}}</li>
{{#if bonusRoll}}
<li>{{textBonus}} : +{{bonusRoll.total}}</li>
{{/if}}
<li>Total : {{finalResult}}</li>
{{#if difficulte}}
{{#if isSuccess}}
<li class="chat-success">Succés...
</li>
{{else}}
<li class="chat-failure">Echec...</li>
{{/if}}
{{/if}}
{{#if isHeroique}}
<li class="chat-success">Héroïque !!!</li>
{{/if}}
{{#if isDramatique}}
<li class="chat-failure">Dramatique !!!</li>
{{/if}}
{{#if isInit}}
<li>Initiative stockée ! </li>
{{/if}}
{{#if isSuccess}}
{{#if arme}}
<li>Votre adversaire perd 1 Etat de Combativité (manuel) </li>
{{#if (not arme.system.onlevelonly)}}
<button class="chat-card-button roll-chat-degat">Dégats de l'arme</button>
{{/if}}
{{/if}}
{{/if}}
{{#each predilections as |pred key|}}
<li>
<button class="chat-card-button predilection-reroll" data-predilection-index="{{key}}">Predilection :
{{pred.name}}</button>
</li>
{{/each}}
</ul>
</div>

View File

@ -0,0 +1,356 @@
<form class="{{cssClass}}" autocomplete="off">
{{!-- Sheet Header --}}
<header class="sheet-header">
<div class="header-fields background-sheet-header">
<div class="flexrow">
<img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
<div class="flexcol">
<h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
<div class="flexrow">
<ul class="item-list alternate-list">
<li class="item flexrow ">
<h4 class="item-name-label competence-name">Ressources</h4>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.ressources.value" value="{{system.ressources.value}}" data-dtype="Number" />
</li>
</ul>
</div>
</div>
</div>
</header>
{{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="principal">Technique</a>
<a class="item" data-tab="competences">Compétences</a>
<a class="item" data-tab="talents">Talents</a>
<a class="item" data-tab="armes">Armes</a>
<a class="item" data-tab="biodata">Bio&Notes</a>
</nav>
{{!-- Sheet Body --}}
<section class="sheet-body">
{{!-- Main Tab --}}
<div class="tab principal" data-group="primary" data-tab="principal">
<div class="grid grid-2col">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
{{#each system.attributs as |attr key|}}
<li class="item flexrow " data-attr-key="{{key}}">
<img class="item-name-img" src="systems/fvtt-les-heritiers/assets/icons/{{attr.labelnorm}}.webp">
<span class="item-name-label competence-name item-field-label-medium"><a
class="roll-attribut">{{attr.label}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="Number">
{{#select attr.value}}
{{> systems/fvtt-les-heritiers/templates/partial-list-niveau.html}}
{{/select}}
</select>
</li>
{{/each}}
<li class="item flexrow">
<img class="item-name-img" src="systems/fvtt-les-heritiers/assets/icons/vitesse.webp">
<span class="item-name-label competence-name item-field-label-medium">Vitesse</span>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.vitesse.value"
value="{{system.vitesse.value}}" data-dtype="Number" />
</li>
</ul>
<h4 class="item-name-label competence-name">Santé</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<label class="label-name item-field-label-short">Vigueur</label>
<label class="label-name item-field-label-short">{{system.sante.vigueur}}</label>
</li>
<li class="item flexrow">
<label class="label-name item-field-label-short">Etat</label>
<select class="label-name item-field-label-medium" type="text" name="system.sante.etat" value="{{system.sante.etat}}" data-dtype="Number">
{{#select system.sante.etat}}
{{> systems/fvtt-les-heritiers/templates/partial-sante-etat.html}}
{{/select}}
</select>
</li>
</ul>
<h4 class="item-name-label competence-name">Combat</h4>
<ul class="item-list alternate-list">
<li class="item flexrow">
<button class="chat-card-button roll-initiative">Initiative</button>
</li>
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<h4 class="item-name-label competence-name">Adversité</h4>
<ul class="item-list alternate-list">
{{#each system.adversite as |adv key|}}
<li class="item flexrow" data-adversite="{{key}}">
<a class="adversite-modify plus-minus-button" data-adversite-value="-1">-</a>
<div class="icon-adversite-container">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_{{key}}.webp">
<div class="adversite-text">{{adv}}</div>
</div>
<a class="adversite-modify plus-minus-button" data-adversite-value="1">+</a>
<div class="">&nbsp;</div>
<div class="">&nbsp;</div>
<div class="">&nbsp;</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Competence Tab --}}
<div class="tab competences" data-group="primary" data-tab="competences">
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Compétences</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Niveau</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each skills as |skill key|}}
<li class="item flexrow " data-item-id="{{skill._id}}" data-item-type="competence">
<img class="item-name-img" src="{{skill.img}}" />
<span class="item-name-label competence-name"><a class="roll-competence item-field-label-short"
data-attr-key="tochoose">{{skill.name}}</a></span>
<select class="status-small-label color-class-common edit-item-data competence-niveau" type="text"
data-item-field="niveau" value="{{skill.system.niveau}}" data-dtype="Number">
{{#select skill.system.niveau}}
{{> systems/fvtt-les-heritiers/templates/partial-list-niveau.html}}
{{/select}}
</select>
{{#if (ne skill.system.attribut1 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut1}}">{{upper
skill.system.attribut1}} : {{skill.system.attribut1total}}</button>
{{/if}}
{{#if (ne skill.system.attribut2 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut2}}">{{upper
skill.system.attribut2}} : {{skill.system.attribut2total}}</button>
{{/if}}
{{#if (ne skill.system.attribut3 "none")}}
<button class="roll-competence button-sheet-roll" data-attr-key="{{skill.system.attribut3}}">{{upper
skill.system.attribut3}} : {{skill.system.attribut3total}}</button>
{{/if}}
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Talents Tab --}}
<div class="tab talents" data-group="primary" data-tab="talents">
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Talents</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Résumé</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each talents as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
<img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
<div class="flexrow">
<div class="sheet-box color-bg-archetype">
<ul class="item-list alternate-list">
<li class="item flexrow">
<span class="item-name-label-header">
<h3><label class="items-title-text">Talents de Cellule</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Résumé</label>
</span>
<div class="item-filler">&nbsp;</div>
</li>
{{#each talentsCell as |talent key|}}
<li class="item flexrow " data-item-id="{{talent._id}}" data-item-type="competence">
<img class="item-name-img" src="{{talent.img}}" />
<span class="item-name-label competence-name">{{talent.name}}</span>
<span class="item-name-label item-field-label-long2">{{talent.system.resumebonus}}</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Equipement Tab --}}
<div class="tab armes" data-group="primary" data-tab="armes">
<div class="flexcol">
<div class="sheet-box color-bg-archetype">
<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-short">
<label class="short-label">Attaque</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Défense</label>
</span>
<span class="item-field-label-short">
<label class="short-label">Dégats</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each armes as |arme key|}}
<li class="item flexrow " data-item-id="{{arme._id}}" data-item-type="arme">
<img class="item-name-img" src="{{arme.img}}" />
<span class="item-name-label competence-name">{{arme.name}}</span>
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{else}}
<button disabled class="roll-arme-offensif button-sheet-roll">{{arme.system.totalOffensif}}</button>
{{/if}}
</span>
{{#if arme.system.isdefense}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">{{arme.system.totalDefensif}}</label></span>
{{else}}
<span class="item-field-label-short arme-defensif item-field-label-short"><label
class="arme-defensif item-field-label-short defense-sheet">N/A</label></span>
{{/if}}
<span class="item-field-label-short">
{{#if arme.system.equipped}}
<button class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{else}}
<button disabled class="roll-arme-degats button-sheet-roll">{{arme.system.totalDegats}}</button>
{{/if}}
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-equip" title="Worn">{{#if arme.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
<div class="sheet-box color-bg-archetype">
<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">Protections</label></h3>
</span>
<span class="item-field-label-short">
<label class="short-label">Protection</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-add" data-type="arme" title="Ajouter une arme"><i
class="fas fa-plus"></i></a>
</div>
</li>
{{#each protections as |protection key|}}
<li class="item flexrow " data-item-id="{{protection._id}}" data-item-type="protection">
<img class="item-name-img" src="{{protection.img}}" />
<span class="item-name-label competence-name">{{protection.name}}</span>
<span class="item-field-label-short arme-defensif"><label
class="arme-defensif">{{protection.system.protection}}</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</div>
</div>
</div>
{{!-- Biography Tab --}}
<div class="tab biodata" data-group="primary" data-tab="biodata">
<span>
<h3>Description</h3>
</span>
<div class="medium-editor item-text-long-line">
{{editor description target="system.biodata.description" button=true owner=owner editable=editable}}
</div>
<span>
<h3>Habitat</h3>
</span>
<div class="medium-editor item-text-long-line">
{{editor habitat target="system.biodata.habitat" button=true owner=owner editable=editable}}
</div>
</div>
</section>
</form>

View File

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

View File

@ -0,0 +1,48 @@
<div class="control-icon hawkmoon-adversite ">
<img class="hawkmoon-hud-togglebutton" src="icons/svg/sword.svg" width="36" height="36" title="Action" />
<div class="hawkmoon-hud-list tokenhudext right">
<div class="flexrow tokenhudicon">
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="-1"
data-action-index="bleue" title="Adversite Bleue">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_bleue.webp">
<div class="hud-adversite-text">&nbsp;-1</div>
</div>
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="+1"
data-action-index="bleue" title="Adversite Bleue">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_bleue.webp">
<div class="hud-adversite-text">&nbsp;+1</div>
</div>
</div>
<div class="flexrow tokenhudicon">
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="-1"
data-action-index="rouge" title="Adversite Rouge">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_rouge.webp">
<div class="hud-adversite-text">&nbsp;-1</div>
</div>
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="+1"
data-action-index="rouge" title="Adversite Rouge">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_rouge.webp">
<div class="hud-adversite-text">&nbsp;+1</div>
</div>
</div>
<div class="flexrow tokenhudicon">
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="-1"
data-action-index="noire" title="Adversite Noire">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_noire.webp">
<div class="hud-adversite-text">&nbsp;-1</div>
</div>
<div class="hawkmoon-hud-adversite hud-adversite-container" data-action-value="+1"
data-action-index="noire" title="Adversite Noire">
<img class="icon-adversite" src="systems/fvtt-les-heritiers/assets/icons/gemme_noire.webp">
<div class="hud-adversite-text">&nbsp;+1</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,89 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Type d'arme : </label>
<select class="item-field-label-long" type="text" name="system.typearme"
value="{{system.typearme}}" data-dtype="string">
{{#select system.typearme}}
<option value="contact">Arme de contact</option>
<option value="contactjet">Arme de contact et de Jet</option>
<option value="jet">Arme de Jet</option>
<option value="tir">Arme de Tir</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Bonus offensif : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.bonusmaniementoff"
value="{{system.bonusmaniementoff}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Seuil de Défense : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.seuildefense"
value="{{system.seuildefense}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long2">1 niveau de Combativité au maximum ? </label>
<input type="checkbox" name="system.onlevelonly" {{checked system.onlevelonly}} />
</li>
{{#if system.onlevelonly}}
{{else}}
<li class="flexrow item">
<label class="generic-label item-field-label-long">Dégâts : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.degats"
value="{{system.degats}}" data-dtype="String" />
</li>
{{/if}}
<li class="flexrow item">
<label class="generic-label item-field-label-long">A deux mains ? </label>
<input type="checkbox" name="system.deuxmains" {{checked system.deuxmains}} />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Perce Armure ? </label>
<input type="checkbox" name="system.percearmure" {{checked system.percearmure}} />
</li>
{{#if system.percearmure}}
<li class="flexrow item">
<label class="generic-label item-field-label-long2">Valeur de Perce Armure : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.percearmurevalue"
value="{{system.percearmurevalue}}" data-dtype="Number" />
</li>
{{/if}}
<li class="flexrow item">
<label class="generic-label item-field-label-long">Portée courte </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.courte"
value="{{system.courte}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Portée moyenne </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.moyenne"
value="{{system.moyenne}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Portée longue </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.longue"
value="{{system.longue}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long2">Temps de rechargement </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.tr" value="{{system.tr}}"
data-dtype="Number" />
</li>
{{> systems/fvtt-les-heritiers/templates/partial-item-prix.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,117 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Complexité : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.complexite"
value="{{system.complexite}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Branche : </label>
<select class="item-field-label-long" type="text" name="system.branche" value="{{system.branche}}"
data-dtype="string">
{{#select system.branche}}
<option value="alchimie">Alchimie</option>
<option value="biologie">Biologie</option>
<option value="electricite">Electricité</option>
<option value="mecanique">Mécanique</option>
<option value="scienceesprit">Science de l'Esprit</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Branche secondaire : </label>
<select class="item-field-label-long" type="text" name="system.branche2" value="{{system.branche2}}"
data-dtype="string">
<option value="none">Aucune</option>
{{#select system.branche2}}
<option value="alchimie">Alchimie</option>
<option value="biologie">Biologie</option>
<option value="electricite">Electricité</option>
<option value="mecanique">Mécanique</option>
<option value="scienceesprit">Science de l'Esprit</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Durée de réalisation : </label>
<input type="text" class="padd-right item-field-label-long" name="system.dureerealisation"
value="{{system.dureerealisation}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Temps de mise en route : </label>
<input type="text" class="padd-right item-field-label-long" name="system.tempsroute"
value="{{system.tempsroute}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Effet de jeu : </label>
</li>
<li class="flexrow item">
<textarea row="8" type="text" class="padd-right color-class-common" name="system.effetdejeu"
data-dtype="String">{{system.effetdejeu}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Défaut courant : </label>
</li>
<li class="flexrow item">
<textarea row="4" type="text" class="padd-right color-class-common" name="system.defautcourant"
data-dtype="String">{{system.defautcourant}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Autres caractéristiques : </label>
</li>
<li class="flexrow item">
<textarea row="4" type="text" class="padd-right color-class-common" name="system.autrescarac"
data-dtype="String">{{system.autrescarac}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Avantages possibles : </label>
</li>
<li class="flexrow item">
<textarea row="4" type="text" class="padd-right color-class-common" name="system.avantagespossibles"
data-dtype="String">{{system.avantagespossibles}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Avantages disponibles : </label>
</li>
<li class="flexrow item">
<textarea row="4" type="text" class="padd-right color-class-common" name="system.avantages"
data-dtype="String">{{system.avantages}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Compétence associée : </label>
<input type="text" class="padd-right item-field-label-long" name="system.competences"
value="{{system.competences}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Equipé ? </label>
<input type="checkbox" name="system.equipped" {{checked system.equipped}} />
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,91 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Niveau </label>
<input type="text" class="padd-right status-small-label color-class-common item-field-label-short"
name="system.niveau" value="{{system.niveau}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 1 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text"
name="system.attribut1" value="{{system.attribut1}}" data-dtype="string">
{{#select system.attribut1}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 2 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text"
name="system.attribut2" value="{{system.attribut2}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select system.attribut2}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Attribut 3 </label>
<select class="status-small-label color-class-common item-field-label-long" type="text"
name="system.attribut3" value="{{system.attribut3}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select system.attribut3}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item">
<h3>Prédilections</h3>
</li>
<li class="flexrow item">
<ul>
{{#each system.predilections as |predilection key|}}
<li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<input type="text" class="padd-right color-class-common edit-predilection" value="{{predilection.name}}"
data-dtype="String" />
</li>
<li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<textarea row="4" type="text" class="padd-right color-class-common edit-predilection-description"
data-dtype="String">{{predilection.description}}</textarea>
</li>
<li class="prediction-item item flexrow" data-prediction-index="{{key}}">
<label class="generic-label">Acquise ? <input class="predilection-acquise" type="checkbox" {{checked
predilection.acquise}} /></label>
<label class="generic-label">Maitrise ? <input class="predilection-maitrise" type="checkbox" {{checked
predilection.maitrise}} /></label>
<label class="generic-label">Utilisée ? <input class="predilection-used" type="checkbox" {{checked
predilection.used}} /></label>
<a class="item-control delete-prediction" title="Supprimer une predilection"><i
class="fas fa-trash"></i></a>
</li>
<hr>
{{/each}}
</ul>
<li class="flexrow item">
<button id="add-predilection" class="chat-card-button">Ajouter une prédilection</button>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,45 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Type : </label>
<select class="item-field-label-long" type="text" name="system.contacttype" value="{{system.contacttype}}" data-dtype="String">
{{#select system.contacttype}}
<option value="contact">Contact</option>
<option value="allie">Allié</option>
{{/select}}
</select>
<label class="generic-label item-field-label-long">Niveau : </label>
<select class="item-field-label-long" type="text" name="system.niveau" value="{{system.niveau}}" data-dtype="Number">
{{#select system.niveau}}
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Développement : </label>
<input type="text" class="padd-right item-field-label-long" name="system.pointdev"
value="{{system.pointdev}}" data-dtype="Number" />
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,22 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
{{> systems/fvtt-les-heritiers/templates/partial-item-prix.html}}
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,24 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label">Bonus/Malus </label>
</li>
<li class="flexrow item">
<input type="text" class="padd-right status-small-label color-class-common" name="system.bonusmalus"
value="{{system.bonusmalus}}" data-dtype="String" />
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,34 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Quantite </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.quantite"
value="{{system.quantite}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Valeur en Sous de Cuivre (SC)</label>
<input type="text" class="numeric-input item-field-label-short" name="system.prixsc" value="{{system.prixsc}}"
data-dtype="Number" />
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,119 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label">Exemples : </label>
</li>
<li class="flexrow item">
<input type="text" class="padd-right status-small-label color-class-common" name="system.exemples"
value="{{system.exemples}}" data-dtype="String" />
</li>
<li class="flexrow items">
<label class="generic-label item-field-label-long">Attribut principal 1 </label>
<select class="status-small-label color-class-common item-field-label-long"" type=" text"
name="system.attribut1" value="{{system.attribut1}}" data-dtype="string">
{{#select system.attribut1}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item ">
<label class="generic-label item-field-label-long">Attribut principal 2 </label>
<select class="status-small-label color-class-common item-field-label-long"" type=" text"
name="system.attribut2" value="{{system.attribut2}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select system.attribut2}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item ">
<label class="generic-label item-field-label-long">Attribut principal 3 </label>
<select class="status-small-label color-class-common item-field-label-long"" type=" text"
name="system.attribut3" value="{{system.attribut3}}" data-dtype="string">
<option value="none">Aucun</option>
{{#select system.attribut3}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label">Compétences exercées : </label>
</li>
<li class="flexrow item">
<textarea type="text" rows="3" class="padd-right status-small-label color-class-common"
name="system.compétences" data-dtype="String">{{system.compétences}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Talents Initié : </label>
</li>
<li class="flexrow item">
<textarea type="text" rows="3" class="padd-right status-small-label color-class-common"
name="system.talentsinitie" data-dtype="String">{{system.talentsinitie}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Prérequis Aguerri : </label>
</li>
<li class="flexrow item">
<textarea type="text" rows="3" class="padd-right status-small-label color-class-common"
name="system.prerequisaguerri" data-dtype="String">{{system.prerequisaguerri}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Talents Aguerri : </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.talentsaguerri" data-dtype="String">{{system.talentsaguerri}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Prérequis Maître : </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.prerequismaitre" data-dtype="String">{{system.prerequismaitre}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Talents Maître : </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.talentsmaitre" data-dtype="String">{{system.talentsmaitre}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label">Equipement : </label>
</li>
<li class="flexrow item">
<input type="text" class="padd-right status-small-label color-class-common" name="system.equipement"
value="{{system.equipement}}" data-dtype="String" />
</li>
<li class="flexrow item">
<label class="generic-label">Contribution à la création de la cellule : </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.celluleinfo" data-dtype="String">{{system.celluleinfo}}</textarea>
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,30 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Protection : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.protection"
value="{{system.protection}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long2">Adversités dues au poids : </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.adversitepoids"
value="{{system.adversitepoids}}" data-dtype="Number" />
</li>
{{> systems/fvtt-les-heritiers/templates/partial-item-prix.html}}
</div>
</section>
</form>

View File

@ -0,0 +1,26 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-long">Développement : </label>
<input type="text" class="padd-right item-field-label-long" name="system.pointdev"
value="{{system.pointdev}}" data-dtype="Number" />
</li>
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,68 @@
<form class="{{cssClass}}" autocomplete="off">
{{> systems/fvtt-les-heritiers/templates/partial-item-header.html}}
{{> systems/fvtt-les-heritiers/templates/partial-item-nav.html}}
{{!-- Sheet Body --}}
<section class="sheet-body">
{{> systems/fvtt-les-heritiers/templates/partial-item-description.html}}
<div class="tab details" data-group="primary" data-tab="details">
<ul class="item-list alternate-list">
<li class="flexrow item">
<label class="generic-label item-field-label-medium">Type </label>
<select class="status-small-label color-class-common item-field-label-long" type="text"
name="system.talenttype" value="{{system.talenttype}}" data-dtype="String">
{{#select system.talenttype}}
<option value="personnage">Personnage</option>
<option value="cellule">Cellule</option>
<option value="traitespece">Trait d'espèce</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-medium">Utilisation </label>
<select class="status-small-label color-class-common item-field-label-long" type="text"
name="system.utilisation" value="{{system.utilisation}}" data-dtype="String">
{{#select system.utilisation}}
<option value="permanent">Permanent</option>
<option value="sceance">Une fois par scéance</option>
<option value="scenario">Une fois par scénario</option>
<option value="jour">Une fois par jour</option>
<option value="unique">Unique</option>
{{/select}}
</select>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Pré-requis </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.prerequis" data-dtype="String">{{system.prerequis}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Résumé (si bonus) </label>
</li>
<li class="flexrow item">
<textarea rows="3" type="text" class="padd-right status-small-label color-class-common"
name="system.resumebonus" data-dtype="String">{{system.resumebonus}}</textarea>
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-medium">Déja utilisé ? </label>
<input class="predilection-maitrise" type="checkbox" name="system.used" {{checked system.used}} />
</li>
{{> systems/fvtt-les-heritiers/templates/partial-automation.html}}
</ul>
</div>
</section>
</form>

View File

@ -0,0 +1,23 @@
<li class="item flexrow list-item 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>
{{#if (eq level 1)}}
<span class="item-name-label">{{equip.name}}</span>
{{else}}
<span class="item-name-label-level2">{{equip.name}}</span>
{{/if}}
<span class="item-field-label-long"><label>
{{equip.system.quantity}}
(<a class="quantity-minus plus-minus-button"> -</a>/<a class="quantity-plus plus-minus-button">+</a>)
</label>
</span>
<div class="item-filler">&nbsp;</div>
<div class="item-controls item-controls-fixed">
{{#if (eq level 1)}}
<a class="item-control item-equip" title="Worn">{{#if equip.system.equipped}}<i
class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
{{/if}}
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>

View File

@ -0,0 +1,81 @@
<li class="flexrow item">
<label class="generic-label item-field-label-long">Automatisation ? </label>
<input type="checkbox" name="system.isautomated" {{checked system.isautomated}} />
</li>
{{#if system.isautomated}}
<li class="flexrow item">
<ul>
{{#each system.automations as |automation key|}}
<li class="automation-item item flexrow">
<hr>
</li>
<li class="automation-item item flexrow" data-automation-field="eventtype" data-automation-index="{{key}}">
<label class="generic-label item-field-label-medium">Evènement</label>
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="eventtype"
value="{{automation.eventtype}}" data-dtype="String">
{{#select automation.eventtype}}
<option value="on-drop">Drop sur l'acteur</option>
<option value="prepare-roll">Préparation d'un jet</option>
<option value="bonus-permanent">Bonus permanent</option>
{{/select}}
</select>
<label class="generic-label item-field-label-medium">&nbsp;</label>
<a class="item-control item-field-label-medium delete-automation" title="Supprimer" data-automation-index="{{key}}"><i
class="fas fa-trash"></i></a>
</li>
{{#if (eq automation.eventtype "on-drop")}}
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" value="{{automation.competence}}" data-dtype="String" />
</li>
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Valeur minimum</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="minLevel" value="{{automation.minLevel}}" data-dtype="Number" />
</li>
{{/if}}
{{#if (eq automation.eventtype "bonus-permanent")}}
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Désignation</label>
<select class="item-field-label-long automation-edit-field" type="text" data-automation-index="{{key}}" data-automation-field="bonusname"
value="{{automation.bonusname}}" data-dtype="String">
{{#select automation.bonusname}}
<option value="vigueur">Vigueur</option>
<option value="bonus-defensif">Bonus au Seuil de Défense</option>
{{/select}}
</select>
</li>
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Bonus</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" value="{{automation.bonus}}" data-dtype="Number" />
</li>
{{/if}}
{{#if (eq automation.eventtype "prepare-roll")}}
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Compétence/Attribut</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="competence" value="{{automation.competence}}" data-dtype="String" />
</li>
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Bonus</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="bonus" value="{{automation.bonus}}" data-dtype="Number" />
</li>
<li class="automation-item item flexrow">
<label class="generic-label item-field-label-long">Coût en BA</label>
<input type="text" class="item-field-label-medium automation-edit-field" data-automation-index="{{key}}" data-automation-field="baCost" value="{{automation.baCost}}" data-dtype="Number" />
</li>
{{/if}}
{{/each}}
</ul>
<li class="flexrow item">
<button id="add-automation" class="chat-card-button">Ajouter une automatisation</button>
</li>
{{/if}}

View File

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

View File

@ -0,0 +1,8 @@
<header class="sheet-header">
<div class="flexrow background-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>
</div>
</header>

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>

View File

@ -0,0 +1,33 @@
<li class="flexrow item">
<label class="generic-label item-field-label-long">Rareté </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.rarete"
value="{{system.rarete}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Equipé ? </label>
<input type="checkbox" name="system.equipped" {{checked system.equipped}} />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Quantite </label>
<input type="text" class="padd-right numeric-input item-field-label-short" name="system.quantite"
value="{{system.quantite}}" data-dtype="Number" />
</li>
<li class="flexrow item">
<label class="generic-label item-field-label-long">Prix (PA) </label>
<input type="text" class="numeric-input item-field-label-short" name="system.prixpo" value="{{system.prixpo}}"
data-dtype="Number" />
<label class="generic-label item-field-label-short">PO </label>
<input type="text" class="numeric-input item-field-label-short" name="system.prixca" value="{{system.prixca}}"
data-dtype="Number" />
<label class="generic-label item-field-label-short">PA </label>
<input type="text" class="numeric-input item-field-label-short" name="system.prixsc" value="{{system.prixsc}}"
data-dtype="Number" />
<label class="generic-label item-field-label-short">SC </label>
</li>

View File

@ -0,0 +1,11 @@
<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>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>

View File

@ -0,0 +1,6 @@
<option value="0">Combatif</option>
<option value="1">Eprouvé 1</option>
<option value="2">Eprouvé 2</option>
<option value="3">Affaibli</option>
<option value="4">Très affaibli</option>
<option value="5">Vaincu</option>

8
templates/post-item.html Normal file
View File

@ -0,0 +1,8 @@
<div class="post-item" data-transfer="{{transfer}}">
<h3><b>{{name}}</b></h3>
{{#if img}}
<img class="chat-img" src="{{img}}" title="{{name}}" />
{{/if}}
<h4><b>Description : </b></h4>
<p class="card-content">{{{system.description}}}</p>
</div>

View File

@ -0,0 +1,112 @@
<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">
{{#if (eq attrKey "tochoose")}}
<span class="roll-dialog-label">Attribut</span>
<select class="status-small-label color-class-common" id ="attrKey" type="text" name="attrKey" value="attrKey" data-dtype="string" >
{{#select attrKey}}
{{#each attributs as |attrLabel attrKey|}}
<option value="{{attrKey}}">{{attrLabel}}</option>
{{/each}}
{{/select}}
</select>
{{else}}
<span class="roll-dialog-label">{{attr.label}}</span>
<span class="small-label roll-dialog-label">{{attr.value}}</span>
{{/if}}
</div>
{{#if nbAdversites}}
<div class="flexrow">
<span class="roll-dialog-label">Malus d'adversités </span>
<span class="small-label roll-dialog-label">- {{nbAdversites}}</span>
</div>
{{/if}}
{{#if competence}}
<div class="flexrow">
<span class="roll-dialog-label">{{competence.name}}</span>
<span class="small-label roll-dialog-label">{{competence.system.niveau}}</span>
</div>
{{#if maitrises}}
<div class="flexrow">
<span class="roll-dialog-label">Utiliser une maîtrise</span>
<select class="status-small-label color-class-common" id ="select-maitrise" type="text" name="select-maitrise" value="maitriseId" data-dtype="string" >
{{#select maitriseId}}
<option value="none">Aucune</option>
{{#each maitrises as |maitrise mKey|}}
<option value="{{maitrise.id}}">{{maitrise.name}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{/if}}
{{/if}}
{{#if (count talents)}}
<div class="flexrow">
<span class="roll-dialog-label">Talents </span>
<select class="flex1" name="competence-talents" id="competence-talents" data-type="String" multiple>
{{#each talents as |talent key|}}
<option value="{{talent._id}}">{{talent.name}}</option>
{{/each}}
</select>
</div>
{{/if}}
<div class="flexrow">
<span class="roll-dialog-label">Bonus/Malus </span>
<select class="roll-dialog-label" id="bonus-malus-context" type="text" value="{{bonusMalusContext}}"
data-dtype="Number">
{{#select bonusMalusContext}}
<option value="-4">-4</option>
<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>
<option value="4">+4</option>
{{/select}}
</select>
</div>
{{#if armeDefense}}
<div class="flexrow">
<span class="roll-dialog-label">Défense adversaire : </span>
<span class="roll-dialog-label"><strong>{{difficulte}}</strong> </span>
</div>
{{else}}
{{#if isInit}}
{{else}}
<div class="flexrow">
<span class="roll-dialog-label">Difficulté : </span>
<select class="roll-dialog-label" id="difficulte" type="text" name="difficulte" value="{{difficulte}}"
data-dtype="Number">
{{#select difficulte}}
<option value="0">Aucune/Inconnue</option>
<option value="5">Facile (5)</option>
<option value="10">Moyenne (10)</option>
<option value="15">Ardue (15)</option>
<option value="20">Hasardeuse (20)</option>
<option value="25">Insensée (25)</option>
<option value="30">Pure Folie (30)</option>
{{/select}}
</select>
{{/if}}
</div>
{{/if}}
</div>
</form>