Merge pull request 'v10.7.0 - l'os de Sémolosse' (#635) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: #635
This commit is contained in:
commit
30bb803da2
BIN
icons/sante/blessure-mort.webp
Normal file
BIN
icons/sante/blessure-mort.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
BIN
icons/sante/blessure-soins.webp
Normal file
BIN
icons/sante/blessure-soins.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.5 KiB |
BIN
icons/sante/blessure.webp
Normal file
BIN
icons/sante/blessure.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
BIN
icons/sante/eraflure.webp
Normal file
BIN
icons/sante/eraflure.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
BIN
icons/sante/mort.webp
Normal file
BIN
icons/sante/mort.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
65
lang/fr.json
65
lang/fr.json
@ -7,47 +7,48 @@
|
|||||||
"TypeVehicule": "Véhicule"
|
"TypeVehicule": "Véhicule"
|
||||||
},
|
},
|
||||||
"ITEM": {
|
"ITEM": {
|
||||||
"TypeObjet": "Objet",
|
|
||||||
"TypeGemme": "Gemme",
|
|
||||||
"TypeCompetence": "Compétence",
|
|
||||||
"TypeCompetencecreature": "Compétence de créature",
|
|
||||||
"TypeMaladie": "Maladie",
|
|
||||||
"TypePoison": "Poison",
|
|
||||||
"TypeNombreastral": "Nombre astral",
|
|
||||||
"TypeTarot": "Carte de tarot",
|
|
||||||
"TypeCasetmr": "TMR spéciale",
|
|
||||||
"TypeRencontre": "Rencontre TMR",
|
|
||||||
"TypeMunition": "Munition",
|
|
||||||
"TypeMonnaie": "Monnaie",
|
|
||||||
"TypeHerbe": "Herbe",
|
|
||||||
"TypePlante": "Plante",
|
|
||||||
"TypeIngredient": "Ingrédient",
|
|
||||||
"TypeFaune": "Faune",
|
|
||||||
"TypeLivre": "Livre",
|
|
||||||
"TypePotion": "Potion",
|
|
||||||
"TypeArme": "Arme",
|
"TypeArme": "Arme",
|
||||||
"TypeArmure": "Armure",
|
"TypeArmure": "Armure",
|
||||||
"TypeConteneur": "Conteneur",
|
"TypeBlessure": "Blessure",
|
||||||
"TypeNourritureboisson": "Nourriture & boisson",
|
"TypeCasetmr": "TMR spéciale",
|
||||||
"TypeService": "Service",
|
|
||||||
"TypeChant": "Chant",
|
"TypeChant": "Chant",
|
||||||
|
"TypeCompetence": "Compétence",
|
||||||
|
"TypeCompetencecreature": "Compétence de créature",
|
||||||
|
"TypeConteneur": "Conteneur",
|
||||||
"TypeDanse": "Danse",
|
"TypeDanse": "Danse",
|
||||||
"TypeMusique": "Musique",
|
"TypeExtraitpoetique": "Extrait poetique",
|
||||||
"TypeOeuvre": "Oeuvre",
|
"TypeFaune": "Faune",
|
||||||
"TypeTache": "Tâche",
|
"TypeGemme": "Gemme",
|
||||||
|
"TypeHerbe": "Herbe",
|
||||||
|
"TypeIngredient": "Ingrédient",
|
||||||
"TypeJeu": "Jeu",
|
"TypeJeu": "Jeu",
|
||||||
|
"TypeLivre": "Livre",
|
||||||
|
"TypeMaladie": "Maladie",
|
||||||
|
"TypeMeditation": "Méditation",
|
||||||
|
"TypeMonnaie": "Monnaie",
|
||||||
|
"TypeMunition": "Munition",
|
||||||
|
"TypeMusique": "Musique",
|
||||||
|
"TypeNombreastral": "Nombre astral",
|
||||||
|
"TypeNourritureboisson": "Nourriture & boisson",
|
||||||
|
"TypeObjet": "Objet",
|
||||||
|
"TypeOeuvre": "Oeuvre",
|
||||||
|
"TypeOmbre": "Ombre de Thanatos",
|
||||||
|
"TypePlante": "Plante",
|
||||||
|
"TypePoison": "Poison",
|
||||||
|
"TypePossession": "Possession",
|
||||||
|
"TypePotion": "Potion",
|
||||||
|
"TypeQueue": "Queue de Dragon",
|
||||||
"TypeRecettealchimique": "Recette alchimique",
|
"TypeRecettealchimique": "Recette alchimique",
|
||||||
"TypeRecettecuisine": "Recette de cuisine",
|
"TypeRecettecuisine": "Recette de cuisine",
|
||||||
"TypeSort": "Sort",
|
"TypeRencontre": "Rencontre TMR",
|
||||||
"TypeMeditation": "Méditation",
|
"TypeService": "Service",
|
||||||
"TypeSignedraconique": "Signe draconique",
|
"TypeSignedraconique": "Signe draconique",
|
||||||
"TypeQueue": "Queue de Dragon",
|
"TypeSort": "Sort",
|
||||||
"TypeOmbre": "Ombre de Thanatos",
|
|
||||||
"TypeSouffle": "Souffle de Dragon",
|
|
||||||
"TypeTete": "Tête de Dragon",
|
|
||||||
"TypePossession": "Possession",
|
|
||||||
"TypeSortreserve": "Sort en réserve",
|
"TypeSortreserve": "Sort en réserve",
|
||||||
"TypeExtraitpoetique": "Extrait poetique"
|
"TypeSouffle": "Souffle de Dragon",
|
||||||
|
"TypeTache": "Tâche",
|
||||||
|
"TypeTarot": "Carte de tarot",
|
||||||
|
"TypeTete": "Tête de Dragon"
|
||||||
},
|
},
|
||||||
"EFFECT": {
|
"EFFECT": {
|
||||||
"StatusStunned": "Sonné",
|
"StatusStunned": "Sonné",
|
||||||
|
@ -13,6 +13,7 @@ import { STATUSES } from "./settings/status-effects.js";
|
|||||||
import { MAINS_DIRECTRICES } from "./actor.js";
|
import { MAINS_DIRECTRICES } from "./actor.js";
|
||||||
import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js";
|
import { RdDBaseActorSheet } from "./actor/base-actor-sheet.js";
|
||||||
import { RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
|
import { RdDItemBlessure } from "./item/blessure.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/**
|
/**
|
||||||
@ -151,42 +152,31 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
|||||||
this.html.find('.creer-tache').click(async event => {
|
this.html.find('.creer-tache').click(async event => {
|
||||||
this.createEmptyTache();
|
this.createEmptyTache();
|
||||||
});
|
});
|
||||||
this.html.find('.creer-tache-blessure-legere').click(async event => {
|
this.html.find('.creer-tache-blessure-legere').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 2));
|
||||||
this.actor.createTacheBlessure('legere');
|
this.html.find('.creer-tache-blessure-grave').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 4));
|
||||||
});
|
this.html.find('.creer-tache-blessure-critique').click(async event => RdDItemBlessure.createTacheSoinBlessure(this.actor, 6));
|
||||||
this.html.find('.creer-tache-blessure-grave').click(async event => {
|
this.html.find('.creer-blessure-legere').click(async event => RdDItemBlessure.createBlessure(this.actor, 2));
|
||||||
this.actor.createTacheBlessure('grave');
|
this.html.find('.creer-blessure-grave').click(async event => RdDItemBlessure.createBlessure(this.actor, 4));
|
||||||
});
|
this.html.find('.creer-blessure-critique').click(async event => RdDItemBlessure.createBlessure(this.actor, 6));
|
||||||
this.html.find('.creer-tache-blessure-critique').click(async event => {
|
|
||||||
this.actor.createTacheBlessure('critique');
|
|
||||||
});
|
|
||||||
this.html.find('.creer-une-oeuvre').click(async event => {
|
this.html.find('.creer-une-oeuvre').click(async event => {
|
||||||
this.selectTypeOeuvreToCreate();
|
this.selectTypeOeuvreToCreate();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Blessure control
|
this.html.find('.blessure-premierssoins-done').change(async event => {
|
||||||
this.html.find('.blessure-control').click(async event => {
|
const blessure = this.getBlessure(event);
|
||||||
const tr = this.html.find(event.currentTarget).parents(".item");
|
await blessure?.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||||
let btype = tr.data("blessure-type");
|
|
||||||
let index = tr.data('blessure-index');
|
|
||||||
let active = this.html.find(event.currentTarget).data('blessure-active');
|
|
||||||
//console.log(btype, index, active);
|
|
||||||
await this.actor.manageBlessureFromSheet(btype, index, active);
|
|
||||||
});
|
});
|
||||||
|
this.html.find('.blessure-soinscomplets-done').change(async event => {
|
||||||
// Blessure data
|
const blessure = this.getBlessure(event);
|
||||||
this.html.find('.blessure-soins').change(async event => {
|
await blessure?.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||||
const tr = this.html.find(event.currentTarget).parents(".item");
|
});
|
||||||
let btype = tr.data('blessure-type');
|
this.html.find('.blessure-premierssoins-bonus').change(async event => {
|
||||||
let index = tr.data('blessure-index');
|
const blessure = this.getBlessure(event);
|
||||||
let psoins = tr.find('.blessure-premiers_soins').val();
|
await blessure?.setSoinsBlessure({ premierssoins: { bonus: Number(event.currentTarget.value) } })
|
||||||
let pcomplets = tr.find('.blessure-soins_complets').val();
|
});
|
||||||
let jours = tr.find('.blessure-jours').val();
|
this.html.find('.blessure-soinscomplets-bonus').change(async event => {
|
||||||
let loc = tr.find('.blessure-localisation').val();
|
const blessure = this.getBlessure(event);
|
||||||
let psdone = tr.find('.blessure-psdone:checked').val();
|
await blessure?.setSoinsBlessure({ soinscomplets: { bonus: Number(event.currentTarget.value) } })
|
||||||
let scdone = tr.find('.blessure-scdone:checked').val();
|
|
||||||
console.log(btype, index, psoins, pcomplets, jours, loc, psdone, scdone);
|
|
||||||
await this.actor.setDataBlessureFromSheet(btype, index, psoins, pcomplets, jours, loc, psdone, scdone);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Equip Inventory Item
|
// Equip Inventory Item
|
||||||
@ -426,6 +416,12 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getBlessure(event) {
|
||||||
|
const itemId = this.html.find(event.currentTarget).parents(".item-blessure").data('item-id');
|
||||||
|
const blessure = this.actor.getItem(itemId, 'blessure');
|
||||||
|
return blessure;
|
||||||
|
}
|
||||||
|
|
||||||
isCompetenceAffichable(competence) {
|
isCompetenceAffichable(competence) {
|
||||||
return !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(competence);
|
return !this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(competence);
|
||||||
}
|
}
|
||||||
|
743
module/actor.js
743
module/actor.js
File diff suppressed because it is too large
Load Diff
@ -78,6 +78,7 @@ export class RdDBaseActorSheet extends ActorSheet {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
static filterItemsPerTypeForSheet(formData, itemTypes) {
|
||||||
|
formData.blessures = Misc.arrayOrEmpty(itemTypes['blessure']);
|
||||||
formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
|
formData.recettescuisine = Misc.arrayOrEmpty(itemTypes['recettecuisine']);
|
||||||
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
|
formData.recettesAlchimiques = Misc.arrayOrEmpty(itemTypes['recettealchimique']);
|
||||||
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);
|
formData.maladies = Misc.arrayOrEmpty(itemTypes['maladie']);
|
||||||
|
@ -21,7 +21,6 @@ export class RdDBaseActor extends Actor {
|
|||||||
Hooks.on("updateActor", (actor, change, options, actorId) => actor.onUpdateActor(change, options, actorId));
|
Hooks.on("updateActor", (actor, change, options, actorId) => actor.onUpdateActor(change, options, actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static onSocketMessage(sockmsg) {
|
static onSocketMessage(sockmsg) {
|
||||||
switch (sockmsg.msg) {
|
switch (sockmsg.msg) {
|
||||||
case "msg_remote_actor_call":
|
case "msg_remote_actor_call":
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
const BASE_TACHE_SOIN_BLESSURE = { type: "tache", img: 'systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp', system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, } }
|
|
||||||
const TACHES_SOIN_BLESSURE = {
|
|
||||||
'critique': { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } },
|
|
||||||
'grave': { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } },
|
|
||||||
'legere': { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } },
|
|
||||||
}
|
|
||||||
|
|
||||||
export class RdDItemTache extends Item {
|
|
||||||
|
|
||||||
static prepareTacheSoin(gravite) {
|
|
||||||
const blessure = TACHES_SOIN_BLESSURE[gravite]
|
|
||||||
if (blessure) {
|
|
||||||
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), blessure)
|
|
||||||
}
|
|
||||||
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
@ -31,9 +31,9 @@ const typesInventaire = {
|
|||||||
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]
|
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"]
|
||||||
const typesObjetsDraconiques = ["queue", "ombre", "souffle", "tete", "signedraconique", "sortreserve", "rencontre"]
|
const typesObjetsDraconiques = ["queue", "ombre", "souffle", "tete", "signedraconique", "sortreserve", "rencontre"]
|
||||||
const typesObjetsConnaissance = ["meditation", "recettealchimique", "sort"]
|
const typesObjetsConnaissance = ["meditation", "recettealchimique", "sort"]
|
||||||
const typesObjetsEffet = ["possession", "poison", "maladie"]
|
const typesObjetsEffet = ["possession", "poison", "maladie", "blessure"]
|
||||||
const typesObjetsCompetence = ["competence", "competencecreature"]
|
const typesObjetsCompetence = ["competence", "competencecreature"]
|
||||||
const typesObjetsTemporels = ["poison", "maladie", "queue", "ombre", "souffle", "signedraconique", "rencontre"]
|
const typesObjetsTemporels = ["blessure", "poison", "maladie", "queue", "ombre", "souffle", "signedraconique", "rencontre"]
|
||||||
const typesEnvironnement = typesInventaireMateriel;
|
const typesEnvironnement = typesInventaireMateriel;
|
||||||
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
const encBrin = 0.00005; // un brin = 1 décigramme = 1/10g = 1/10000kg = 1/20000 enc
|
||||||
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
const encPepin = 0.0007; /* un pépin de gemme = 1/10 cm3 = 1/1000 l = 3.5/1000 kg = 7/2000 kg = 7/1000 enc
|
||||||
@ -176,6 +176,7 @@ export class RdDItem extends Item {
|
|||||||
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
|
isBoisson() { return this.isNourritureBoisson() && this.system.boisson; }
|
||||||
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
|
isAlcool() { return this.isNourritureBoisson() && this.system.boisson && this.system.alcoolise; }
|
||||||
isHerbeAPotion() { return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
|
isHerbeAPotion() { return this.type == 'herbe' && (this.system.categorie == 'Soin' || this.system.categorie == 'Repos'); }
|
||||||
|
isBlessure() { return this.type == 'blessure' }
|
||||||
|
|
||||||
isPresentDansMilieux(milieux) {
|
isPresentDansMilieux(milieux) {
|
||||||
return this.getEnvironnements(milieux).length > 0
|
return this.getEnvironnements(milieux).length > 0
|
||||||
|
177
module/item/blessure.js
Normal file
177
module/item/blessure.js
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
import { RdDItem } from "../item.js";
|
||||||
|
import { Misc } from "../misc.js";
|
||||||
|
import { RdDTimestamp } from "../rdd-timestamp.js";
|
||||||
|
|
||||||
|
const BASE_TACHE_SOIN_BLESSURE = {
|
||||||
|
type: "tache",
|
||||||
|
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp',
|
||||||
|
system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, }
|
||||||
|
}
|
||||||
|
const TACHES_SOIN_BLESSURE = {
|
||||||
|
6: { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } },
|
||||||
|
4: { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } },
|
||||||
|
2: { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } },
|
||||||
|
}
|
||||||
|
|
||||||
|
const definitionsBlessures = [
|
||||||
|
{ type: "contusion", gravite: 0, labelGravite: 'Contusion/éraflure', max: 100, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/eraflure.webp" },
|
||||||
|
{ type: "legere", gravite: 2, labelGravite: 'Légère', max: 5, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||||
|
{ type: "grave", gravite: 4, labelGravite: 'Grave', max: 2, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||||
|
{ type: "critique", gravite: 6, labelGravite: 'Critique', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp" },
|
||||||
|
{ type: "mort", gravite: 8, labelGravite: 'Mort', max: 1, icon: "systems/foundryvtt-reve-de-dragon/icons/sante/mort.webp" }
|
||||||
|
]
|
||||||
|
|
||||||
|
export class RdDItemBlessure extends RdDItem {
|
||||||
|
|
||||||
|
static get defaultIcon() {
|
||||||
|
return "systems/foundryvtt-reve-de-dragon/icons/sante/blessure.webp";
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareDerivedData() {
|
||||||
|
super.prepareDerivedData();
|
||||||
|
this.system.labelGravite = this.getLabelGravite()
|
||||||
|
}
|
||||||
|
|
||||||
|
static prepareTacheSoin(gravite) {
|
||||||
|
const tache = TACHES_SOIN_BLESSURE[gravite]
|
||||||
|
if (!tache) {
|
||||||
|
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), tache)
|
||||||
|
}
|
||||||
|
static async createBlessure(actor, gravite, localisation = '') {
|
||||||
|
const definition = RdDItemBlessure.getDefinition(gravite)
|
||||||
|
const blessure = {
|
||||||
|
name: definition.labelGravite,
|
||||||
|
type: 'blessure',
|
||||||
|
img: definition.icon,
|
||||||
|
system: {
|
||||||
|
gravite: gravite,
|
||||||
|
difficulte: - gravite,
|
||||||
|
localisation: localisation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const blessures = await actor.createEmbeddedDocuments('Item', [blessure])
|
||||||
|
return blessures[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
static async createTacheSoinBlessure(actor, gravite) {
|
||||||
|
const tache = RdDItemBlessure.prepareTacheSoin(gravite)
|
||||||
|
if (tache) {
|
||||||
|
const taches = await actor.createEmbeddedDocuments('Item', [tache], { renderSheet: false });
|
||||||
|
return taches[0];
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
async updateTacheSoinBlessure(tache) {
|
||||||
|
if (tache) {
|
||||||
|
await tache.update({
|
||||||
|
system: {
|
||||||
|
itemId: this.id,
|
||||||
|
difficulte: Math.min(this.system.difficulte, tache.system.difficulte),
|
||||||
|
points_de_tache_courant: Math.max(0, this.system.premierssoins.tache)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async setSoinsBlessure(systemUpdate = {}) {
|
||||||
|
systemUpdate = mergeObject(systemUpdate, this.system, { overwrite: false }),
|
||||||
|
systemUpdate.soinscomplets.done = systemUpdate.premierssoins.done && systemUpdate.soinscomplets.done
|
||||||
|
await this.update({
|
||||||
|
img: this.getImgSoins(systemUpdate.gravite, systemUpdate.soinscomplets.done),
|
||||||
|
system: systemUpdate
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async recuperationBlessure({ actor, timestamp, message, isMaladeEmpoisonne, blessures }) {
|
||||||
|
if (this.parent != actor || actor == undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (new RdDTimestamp(this.system.fin).isAfterIndexDate(timestamp)) {
|
||||||
|
// attente periode
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.system.gravite > 0) {
|
||||||
|
const update = { premierssoins: { bonus: 0 }, soinscomplets: { bonus: 0 } }
|
||||||
|
const gravite = this.system.gravite;
|
||||||
|
const graviteMoindre = gravite - 2;
|
||||||
|
const moindres = blessures.filter(it => it.system.gravite == graviteMoindre, 'blessures').length
|
||||||
|
const labelGravite = RdDItemBlessure.getLabelGravite(gravite);
|
||||||
|
|
||||||
|
let rolled = await actor.jetRecuperationConstitution(Misc.toInt(this.system.soinscomplets.bonus) + actor.system.sante.bonusPotion, message);
|
||||||
|
|
||||||
|
if (rolled.isETotal) {
|
||||||
|
message.content += ` -- une blessure ${labelGravite} s'infecte (temps de guérison augmenté de ${definition.facteur} jours, perte de vie)`;
|
||||||
|
mergeObject(update, { fin: { indexDate: timestamp.addJours(gravite).indexDate } });
|
||||||
|
await actor.santeIncDec("vie", -1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!isMaladeEmpoisonne && rolled.isSuccess && this.peutRetrograder(graviteMoindre, moindres)) {
|
||||||
|
message.content += ` -- une blessure ${labelGravite} cicatrise`;
|
||||||
|
mergeObject(update, { gravite: graviteMoindre, fin: { indexDate: timestamp.addJours(graviteMoindre).indexDate } });
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message.content += ` -- une blessure ${labelGravite} reste stable`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await this.update(update);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
peutRetrograder(graviteMoindre, moindres) {
|
||||||
|
return moindres < RdDItemBlessure.getDefinition(graviteMoindre).max
|
||||||
|
}
|
||||||
|
|
||||||
|
async calculerFinPeriodeTemporel(debut) {
|
||||||
|
return await debut.nouveauJour().addJours(this.system.gravite);
|
||||||
|
}
|
||||||
|
|
||||||
|
async onFinPeriode(oldTimestamp, newTimestamp) {
|
||||||
|
if (this.system.gravite <= 0) {
|
||||||
|
await super.onFinPeriode(oldTimestamp, newTimestamp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getImgSoins(gravite, soins) {
|
||||||
|
let img = 'blessure'
|
||||||
|
if (gravite > 6) {
|
||||||
|
img = 'mort'
|
||||||
|
}
|
||||||
|
if (gravite <= 0) {
|
||||||
|
img = 'eraflure'
|
||||||
|
}
|
||||||
|
return `systems/foundryvtt-reve-de-dragon/icons/sante/${soins ? 'blessure-soins' : img}.webp`
|
||||||
|
}
|
||||||
|
|
||||||
|
getLabelGravite() {
|
||||||
|
return RdDItemBlessure.getDefinition(this.system.gravite).labelGravite
|
||||||
|
}
|
||||||
|
|
||||||
|
static getDefinition(gravite) {
|
||||||
|
return definitionsBlessures.sort(Misc.ascending(it => it.gravite))
|
||||||
|
.find(it => it.gravite >= gravite);
|
||||||
|
}
|
||||||
|
static maxBlessures(gravite) {
|
||||||
|
return RdDItemBlessure.getDefinition(gravite).max
|
||||||
|
}
|
||||||
|
|
||||||
|
isContusion() {
|
||||||
|
return this.system.gravite <= 0
|
||||||
|
}
|
||||||
|
isLegere() {
|
||||||
|
return this.system.gravite > 0 && this.system.gravite <= 2
|
||||||
|
}
|
||||||
|
isGrave() {
|
||||||
|
return this.system.gravite > 2 && this.system.gravite <= 4
|
||||||
|
}
|
||||||
|
isCritique() {
|
||||||
|
return this.system.gravite > 4 && this.system.gravite <= 6
|
||||||
|
}
|
||||||
|
isMort() {
|
||||||
|
return this.system.gravite > 6
|
||||||
|
}
|
||||||
|
}
|
29
module/item/sheet-blessure.js
Normal file
29
module/item/sheet-blessure.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import { RdDItemSheet } from "../item-sheet.js";
|
||||||
|
|
||||||
|
export class RdDBlessureItemSheet extends RdDItemSheet {
|
||||||
|
|
||||||
|
static get ITEM_TYPE() { return "blessure" };
|
||||||
|
|
||||||
|
async getData() {
|
||||||
|
const formData = await super.getData();
|
||||||
|
formData.disabled = formData.options.isGM || formData.options.isOwned ? '' : 'disabled';
|
||||||
|
return formData;
|
||||||
|
}
|
||||||
|
|
||||||
|
activateListeners(html) {
|
||||||
|
super.activateListeners(html);
|
||||||
|
|
||||||
|
if (!this.options.editable) return;
|
||||||
|
|
||||||
|
this.html.find('[name="premierssoins-done"]').change(async event => {
|
||||||
|
await this.item.setSoinsBlessure({ premierssoins: { done: event.currentTarget.checked } });
|
||||||
|
});
|
||||||
|
this.html.find('[name="soinscomplets-done"]').change(async event => {
|
||||||
|
await this.item.setSoinsBlessure({ soinscomplets: { done: event.currentTarget.checked } })
|
||||||
|
});
|
||||||
|
this.html.find('[name="system-gravite"]').change(async event => {
|
||||||
|
const gravite = Number(event.currentTarget.value)
|
||||||
|
await this.item.setSoinsBlessure({ gravite: gravite, difficulte: - gravite })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -416,6 +416,49 @@ class _10_5_0_UpdatePeriodicite extends Migration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _10_7_0_MigrationBlessures extends Migration {
|
||||||
|
get code() { return "migration-blessures"; }
|
||||||
|
get version() { return "10.7.0"; }
|
||||||
|
|
||||||
|
async migrate() {
|
||||||
|
const timestamp = game.system.rdd.calendrier.getTimestamp()
|
||||||
|
await Promise.all(game.actors.filter(it => it.isPersonnage() || it.isCreature())
|
||||||
|
.map(async (actor) => {
|
||||||
|
const legeres = actor.system.blessures?.legeres.liste.filter(it => it.active).map(it => this.creerBlessure(2, 'légère', it, timestamp)) ?? [];
|
||||||
|
const graves = actor.system.blessures?.graves.liste.filter(it => it.active).map(it => this.creerBlessure(4, 'grave', it, timestamp)) ?? [];
|
||||||
|
const critiques = actor.system.blessures?.critiques.liste.filter(it => it.active).map(it => this.creerBlessure(6, 'critique', it, timestamp));
|
||||||
|
const blessures = legeres.concat(graves).concat(critiques);
|
||||||
|
if (blessures.length > 0) {
|
||||||
|
await actor.createEmbeddedDocuments("Item", blessures);
|
||||||
|
}
|
||||||
|
await actor.update({
|
||||||
|
'system.blessures.legeres.liste': [],
|
||||||
|
'system.blessures.graves.liste': [],
|
||||||
|
'system.blessures.critiques.liste': []
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
creerBlessure(gravite, graviteTexte, blessure, timestamp) {
|
||||||
|
const dateBlessure = timestamp.addJours(-blessure.jours);
|
||||||
|
const datePremiereRecup = dateBlessure.addJours(gravite);
|
||||||
|
return {
|
||||||
|
name: `Blessure ${graviteTexte}`,
|
||||||
|
type: 'blessure',
|
||||||
|
img: `systems/foundryvtt-reve-de-dragon/icons/sante/blessure${blessure.psdone ? '-soins' : ''}.webp`,
|
||||||
|
system: {
|
||||||
|
gravite: gravite,
|
||||||
|
difficulte: -gravite,
|
||||||
|
debut: { indexDate: dateBlessure.indexDate, indexMinute: 0 },
|
||||||
|
fin: { indexDate: datePremiereRecup.indexDate, indexMinute: 0 },
|
||||||
|
premierssoins: { done: blessure.psdone, bonus: blessure.premiers_soins },
|
||||||
|
soinscomplets: { done: blessure.scdone, bonus: blessure.soins_complets },
|
||||||
|
localisation: blessure.localisation,
|
||||||
|
jours: blessure.jours
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Migrations {
|
export class Migrations {
|
||||||
static getMigrations() {
|
static getMigrations() {
|
||||||
return [
|
return [
|
||||||
@ -431,6 +474,7 @@ export class Migrations {
|
|||||||
new _10_3_17_Monnaies(),
|
new _10_3_17_Monnaies(),
|
||||||
new _10_4_6_ServicesEnCommerces(),
|
new _10_4_6_ServicesEnCommerces(),
|
||||||
new _10_5_0_UpdatePeriodicite(),
|
new _10_5_0_UpdatePeriodicite(),
|
||||||
|
new _10_7_0_MigrationBlessures(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +491,7 @@ export class Migrations {
|
|||||||
migrate() {
|
migrate() {
|
||||||
const currentVersion = game.settings.get(SYSTEM_RDD, "systemMigrationVersion");
|
const currentVersion = game.settings.get(SYSTEM_RDD, "systemMigrationVersion");
|
||||||
if (isNewerVersion(game.system.version, currentVersion)) {
|
if (isNewerVersion(game.system.version, currentVersion)) {
|
||||||
//if (true) { /* comment previous and uncomment here to test before upgrade */
|
//if (true) { /* comment previous and uncomment here to test before upgrade */
|
||||||
const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion));
|
const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion));
|
||||||
if (migrations.length > 0) {
|
if (migrations.length > 0) {
|
||||||
migrations.sort((a, b) => this.compareVersions(a, b));
|
migrations.sort((a, b) => this.compareVersions(a, b));
|
||||||
|
@ -28,7 +28,7 @@ export class RdDBonus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static dmg(rollData, dmgActor, isCauchemar = false) {
|
static dmg(rollData, dmgActor, isEntiteIncarnee = false) {
|
||||||
let dmg = { total: 0 };
|
let dmg = { total: 0 };
|
||||||
if (rollData.arme && rollData.arme.name.toLowerCase() == "esquive") {
|
if (rollData.arme && rollData.arme.name.toLowerCase() == "esquive") {
|
||||||
// Specific case management
|
// Specific case management
|
||||||
@ -41,7 +41,7 @@ export class RdDBonus {
|
|||||||
dmg.dmgSurprise = RdDBonus.dmgBonus(rollData.ajustements?.attaqueDefenseurSurpris.used);
|
dmg.dmgSurprise = RdDBonus.dmgBonus(rollData.ajustements?.attaqueDefenseurSurpris.used);
|
||||||
dmg.dmgActor = rollData.selectedCarac ? RdDBonus._dmgPerso(dmgActor, rollData.selectedCarac.label, dmg.dmgArme) : 0;
|
dmg.dmgActor = rollData.selectedCarac ? RdDBonus._dmgPerso(dmgActor, rollData.selectedCarac.label, dmg.dmgArme) : 0;
|
||||||
dmg.total = dmg.dmgSurprise + dmg.dmgTactique + dmg.dmgArme + dmg.dmgActor + dmg.dmgParticuliere;
|
dmg.total = dmg.dmgSurprise + dmg.dmgTactique + dmg.dmgArme + dmg.dmgActor + dmg.dmgParticuliere;
|
||||||
dmg.mortalite = RdDBonus._calculMortalite(rollData, isCauchemar)
|
dmg.mortalite = RdDBonus._calculMortalite(rollData, isEntiteIncarnee)
|
||||||
}
|
}
|
||||||
return dmg;
|
return dmg;
|
||||||
}
|
}
|
||||||
@ -62,11 +62,8 @@ export class RdDBonus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _calculMortalite(rollData, isCauchemar) {
|
static _calculMortalite(rollData, isEntiteIncarnee) {
|
||||||
if (isCauchemar) {
|
return isEntiteIncarnee ? "entiteincarnee"
|
||||||
return "cauchemar";
|
|
||||||
}
|
|
||||||
return isCauchemar ? "cauchemar"
|
|
||||||
: rollData.dmg?.mortalite
|
: rollData.dmg?.mortalite
|
||||||
?? rollData.arme?.system.mortalite
|
?? rollData.arme?.system.mortalite
|
||||||
?? "mortel";
|
?? "mortel";
|
||||||
|
@ -45,6 +45,14 @@ export class RdDCalendrier extends Application {
|
|||||||
Hooks.on('updateSetting', async (setting, update, options, id) => this.onUpdateSetting(setting, update, options, id));
|
Hooks.on('updateSetting', async (setting, update, options, id) => this.onUpdateSetting(setting, update, options, id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
display() {
|
||||||
|
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||||
|
renderTemplate(templatePath, {}).then(html => {
|
||||||
|
this.render(true);
|
||||||
|
});
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
async onUpdateSetting(setting, update, options, id) {
|
async onUpdateSetting(setting, update, options, id) {
|
||||||
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
|
if (setting.key == SYSTEM_RDD + '.' + WORLD_TIMESTAMP_SETTING) {
|
||||||
this.timestamp = RdDTimestamp.getWorldTime();
|
this.timestamp = RdDTimestamp.getWorldTime();
|
||||||
|
@ -1295,13 +1295,8 @@ export class RdDCombat {
|
|||||||
blessuresStatus: actor.computeResumeBlessure(),
|
blessuresStatus: actor.computeResumeBlessure(),
|
||||||
SConst: actor.getSConst(),
|
SConst: actor.getSConst(),
|
||||||
actorId: actor.id,
|
actorId: actor.id,
|
||||||
isGrave: false,
|
isGrave: actor.countBlessures(it => it.isGraves()) > 0,
|
||||||
isCritique: false
|
isCritique: actor.countBlessures(it => it.isCritique()) > 0
|
||||||
}
|
|
||||||
if (actor.countBlessuresNonSoigneeByName("critiques") > 0) { // Pour éviter le cumul grave + critique
|
|
||||||
formData.isCritique = true;
|
|
||||||
} else if (actor.countBlessuresNonSoigneeByName("graves") > 0) {
|
|
||||||
formData.isGrave = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatUtility.createChatWithRollMode(actor.name, {
|
ChatUtility.createChatWithRollMode(actor.name, {
|
||||||
|
@ -332,7 +332,7 @@ export class RdDCommands {
|
|||||||
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined };
|
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : { name: undefined };
|
||||||
if (competence) {
|
if (competence) {
|
||||||
for (let actor of actors) {
|
for (let actor of actors) {
|
||||||
await actor.rollCaracCompetence(caracName, competence.name, diff);
|
await actor.doRollCaracCompetence(caracName, competence.name, diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -36,6 +36,7 @@ import { RdDActorVehiculeSheet } from "./actor-vehicule-sheet.js";
|
|||||||
import { RdDActorEntiteSheet } from "./actor-entite-sheet.js";
|
import { RdDActorEntiteSheet } from "./actor-entite-sheet.js";
|
||||||
|
|
||||||
import { RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
|
import { RdDItemBlessure } from "./item/blessure.js";
|
||||||
import { RdDItemService } from "./item/service.js";
|
import { RdDItemService } from "./item/service.js";
|
||||||
import { RdDItemMaladie } from "./item/maladie.js";
|
import { RdDItemMaladie } from "./item/maladie.js";
|
||||||
import { RdDItemPoison } from "./item/poison.js";
|
import { RdDItemPoison } from "./item/poison.js";
|
||||||
@ -46,6 +47,7 @@ import { RdDItemSouffle } from "./item/souffle.js";
|
|||||||
import { RdDRencontre } from "./item/rencontre.js";
|
import { RdDRencontre } from "./item/rencontre.js";
|
||||||
|
|
||||||
import { RdDItemSheet } from "./item-sheet.js";
|
import { RdDItemSheet } from "./item-sheet.js";
|
||||||
|
import { RdDBlessureItemSheet } from "./item/sheet-blessure.js";
|
||||||
import { RdDServiceItemSheet } from "./item/sheet-service.js";
|
import { RdDServiceItemSheet } from "./item/sheet-service.js";
|
||||||
import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js";
|
import { RdDRencontreItemSheet } from "./item/sheet-rencontre.js";
|
||||||
import { RdDHerbeItemSheet } from "./item/sheet-herbe.js";
|
import { RdDHerbeItemSheet } from "./item/sheet-herbe.js";
|
||||||
@ -74,21 +76,22 @@ export class SystemReveDeDragon {
|
|||||||
this.RdDUtility = RdDUtility;
|
this.RdDUtility = RdDUtility;
|
||||||
this.RdDHotbar = RdDHotbar;
|
this.RdDHotbar = RdDHotbar;
|
||||||
this.itemClasses = {
|
this.itemClasses = {
|
||||||
service: RdDItemService,
|
blessure: RdDItemBlessure,
|
||||||
maladie: RdDItemMaladie,
|
maladie: RdDItemMaladie,
|
||||||
|
ombre: RdDItemOmbre,
|
||||||
poison: RdDItemPoison,
|
poison: RdDItemPoison,
|
||||||
queue: RdDItemQueue,
|
queue: RdDItemQueue,
|
||||||
ombre: RdDItemOmbre,
|
rencontre: RdDRencontre,
|
||||||
souffle: RdDItemSouffle,
|
service: RdDItemService,
|
||||||
signedraconique: RdDItemSigneDraconique,
|
signedraconique: RdDItemSigneDraconique,
|
||||||
rencontre: RdDRencontre
|
souffle: RdDItemSouffle,
|
||||||
}
|
}
|
||||||
this.actorClasses = {
|
this.actorClasses = {
|
||||||
|
commerce: RdDCommerce,
|
||||||
creature: RdDActor,
|
creature: RdDActor,
|
||||||
entite: RdDActor,
|
entite: RdDActor,
|
||||||
personnage: RdDActor,
|
personnage: RdDActor,
|
||||||
vehicule: RdDActor,
|
vehicule: RdDActor,
|
||||||
commerce: RdDCommerce,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,6 +160,7 @@ export class SystemReveDeDragon {
|
|||||||
RdDItemSheet.register(RdDPlanteItemSheet);
|
RdDItemSheet.register(RdDPlanteItemSheet);
|
||||||
RdDItemSheet.register(RdDIngredientItemSheet);
|
RdDItemSheet.register(RdDIngredientItemSheet);
|
||||||
RdDItemSheet.register(RdDServiceItemSheet);
|
RdDItemSheet.register(RdDServiceItemSheet);
|
||||||
|
RdDItemSheet.register(RdDBlessureItemSheet);
|
||||||
|
|
||||||
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
Items.registerSheet(SYSTEM_RDD, RdDItemInventaireSheet, {
|
||||||
types: [
|
types: [
|
||||||
@ -276,8 +280,8 @@ export class SystemReveDeDragon {
|
|||||||
let sidebar = document.getElementById("sidebar");
|
let sidebar = document.getElementById("sidebar");
|
||||||
sidebar.style.width = "min-content";
|
sidebar.style.width = "min-content";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Misc.isUniqueConnectedGM()) {
|
if (Misc.isUniqueConnectedGM()) {
|
||||||
|
game.system.rdd.calendrier = new RdDCalendrier();
|
||||||
new Migrations().migrate();
|
new Migrations().migrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,13 +290,7 @@ export class SystemReveDeDragon {
|
|||||||
RdDDice.onReady();
|
RdDDice.onReady();
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Affiche/Init le calendrier */
|
/* Affiche/Init le calendrier */
|
||||||
let calendrier = new RdDCalendrier();
|
game.system.rdd.calendrier = new RdDCalendrier().display();
|
||||||
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
|
||||||
let templateData = {};
|
|
||||||
renderTemplate(templatePath, templateData).then(html => {
|
|
||||||
calendrier.render(true);
|
|
||||||
});
|
|
||||||
game.system.rdd.calendrier = calendrier; // Reference;
|
|
||||||
|
|
||||||
// Avertissement si joueur sans personnage
|
// Avertissement si joueur sans personnage
|
||||||
if (!game.user.isGM && game.user.character == undefined) {
|
if (!game.user.isGM && game.user.character == undefined) {
|
||||||
|
@ -30,9 +30,9 @@ export class RdDEncaisser extends Dialog {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])) {
|
else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])) {
|
||||||
dialogConf.default = "cauchemar"
|
dialogConf.default = "entiteincarnee"
|
||||||
dialogConf.buttons = {
|
dialogConf.buttons = {
|
||||||
"cauchemar": { label: "Cauchemar", callback: html => this.performEncaisser("cauchemar") }
|
"entiteincarnee": { label: "Entité incarnée", callback: html => this.performEncaisser("entiteincarnee") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,6 @@ export class RdDEncaisser extends Dialog {
|
|||||||
total: Number(this.modifier),
|
total: Number(this.modifier),
|
||||||
ajustement: Number(this.modifier),
|
ajustement: Number(this.modifier),
|
||||||
encaisserSpecial: this.encaisserSpecial,
|
encaisserSpecial: this.encaisserSpecial,
|
||||||
loc: { result: 0, label: "" },
|
|
||||||
mortalite: mortalite
|
mortalite: mortalite
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@ export class RdDSheetUtility {
|
|||||||
: document.getUserLevel(game.user);
|
: document.getUserLevel(game.user);
|
||||||
mergeObject(options, {
|
mergeObject(options, {
|
||||||
isGM: game.user.isGM,
|
isGM: game.user.isGM,
|
||||||
isOwned: document.parent,
|
isOwned: document.parent ? true : false,
|
||||||
editable: editable,
|
editable: editable,
|
||||||
cssClass: editable ? "editable" : "locked",
|
cssClass: editable ? "editable" : "locked",
|
||||||
isLimited: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED,
|
isLimited: userRightLevel >= CONST.DOCUMENT_OWNERSHIP_LEVELS.LIMITED,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
import { HtmlUtility } from "./html-utility.js";
|
import { HtmlUtility } from "./html-utility.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
import { Targets } from "./targets.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDTokenHud {
|
export class RdDTokenHud {
|
||||||
@ -18,29 +19,39 @@ export class RdDTokenHud {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async addExtensionHud(app, html, tokenId) {
|
static async addExtensionHud(app, html, tokenId, isCombat) {
|
||||||
|
|
||||||
let token = canvas.tokens.get(tokenId);
|
let token = canvas.tokens.get(tokenId);
|
||||||
let actor = token.actor;
|
let actor = token.actor;
|
||||||
let combatant = game.combat.combatants.find(c => c.tokenId == tokenId);
|
app.hasExtension = true;
|
||||||
if (! (combatant?.actor) ) {
|
// soins
|
||||||
|
await RdDTokenHud.addExtensionHudSoins(html, actor);
|
||||||
|
|
||||||
|
if (isCombat) {
|
||||||
|
let combatant = game.combat.combatants.find(c => c.tokenId == tokenId);
|
||||||
|
if (!(combatant?.actor)) {
|
||||||
ui.notifications.warn(`Le combatant ${token.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
ui.notifications.warn(`Le combatant ${token.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
let actions = RdDCombatManager.listActionsCombat(combatant);
|
||||||
|
// initiative
|
||||||
|
await RdDTokenHud.addExtensionHudInit(html, combatant, actions);
|
||||||
|
// combat
|
||||||
|
await RdDTokenHud.addExtensionHudCombat(html, combatant, actions);
|
||||||
}
|
}
|
||||||
app.hasExtension = true;
|
|
||||||
|
|
||||||
let actionsCombat = RdDCombatManager.listActionsCombat(combatant);
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static async addExtensionHudInit(html, combatant, actions) {
|
||||||
const hudData = {
|
const hudData = {
|
||||||
combatant: combatant,
|
combatant, actions,
|
||||||
actions: actionsCombat,
|
|
||||||
commandes: [
|
commandes: [
|
||||||
{ name: "Autre action", command: 'autre' },
|
{ name: "Autre action", command: 'autre' },
|
||||||
{ name: 'Initiative +1', command: 'inc', value: 0.01 },
|
{ name: 'Initiative +1', command: 'inc', value: 0.01 },
|
||||||
{ name: 'Initiative -1', command: 'dec', value: -0.01 }]
|
{ name: 'Initiative -1', command: 'dec', value: -0.01 }]
|
||||||
};
|
};
|
||||||
|
|
||||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||||
// initiative
|
|
||||||
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
||||||
hudData,
|
hudData,
|
||||||
@ -51,48 +62,70 @@ export class RdDTokenHud {
|
|||||||
RdDTokenHud._initiativeCommand(initCommand, combatantId);
|
RdDTokenHud._initiativeCommand(initCommand, combatantId);
|
||||||
} else {
|
} else {
|
||||||
let index = event.currentTarget.attributes['data-action-index'].value;
|
let index = event.currentTarget.attributes['data-action-index'].value;
|
||||||
let action = actionsCombat[index];
|
let action = hudData.actions[index];
|
||||||
RdDCombatManager.rollInitiativeAction(combatantId, action);
|
RdDCombatManager.rollInitiativeAction(combatantId, action);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static async addExtensionHudCombat(html, combatant, actions) {
|
||||||
|
const hudData = { combatant, actions, commandes: [] };
|
||||||
const controlIconTarget = html.find('.control-icon[data-action=target]');
|
const controlIconTarget = html.find('.control-icon[data-action=target]');
|
||||||
// combat
|
|
||||||
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
|
await RdDTokenHud._configureSubMenu(controlIconTarget, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-attaque.html', hudData,
|
||||||
(event) => {
|
(event) => {
|
||||||
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
||||||
const action = actionsCombat[actionIndex];
|
const action = hudData.actions[actionIndex];
|
||||||
if (action.action == 'conjurer') {
|
if (action.action == 'conjurer') {
|
||||||
actor.conjurerPossession(actor.getPossession(action.system.possessionid));
|
const possession = combatant.actor.getPossession(action.system.possessionid);
|
||||||
|
combatant.actor.conjurerPossession(possession);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
actor.rollArme(action);
|
combatant.actor.rollArme(action);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async addExtensionHudSoins(html, sourceActor) {
|
||||||
|
const target = Targets.getTarget({ warn: false });
|
||||||
|
if (target?.actor) {
|
||||||
|
const hudSoins = { blessures: target.actor.blessuresASoigner() ?? [] };
|
||||||
|
if (hudSoins.blessures.length > 0) {
|
||||||
|
// soins
|
||||||
|
const controlIconTarget = html.find('.control-icon[data-action=combat]');
|
||||||
|
await RdDTokenHud._configureSubMenu(controlIconTarget,
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-soins.hbs',
|
||||||
|
hudSoins,
|
||||||
|
(event) => {
|
||||||
|
const blessureId = event.currentTarget.attributes['data-blessure-id']?.value;
|
||||||
|
sourceActor.rollSoins(target.actor, blessureId)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static _initiativeCommand(initCommand, combatantId) {
|
static _initiativeCommand(initCommand, combatantId) {
|
||||||
switch (initCommand) {
|
switch (initCommand) {
|
||||||
case 'inc': return RdDCombatManager.incDecInit(combatantId, 0.01);
|
case 'inc': return RdDCombatManager.incDecInit(combatantId, 0.01);
|
||||||
case 'dec': return RdDCombatManager.incDecInit(combatantId, -0.01);
|
case 'dec': return RdDCombatManager.incDecInit(combatantId, -0.01);
|
||||||
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
|
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
|
||||||
{ name: "Autre action", action: 'autre', system: { initOnly: true, competence: "Autre action" } });
|
{ name: "Autre action", action: 'autre', system: { initOnly: true, competence: "Autre action" } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async addTokenHudExtensions(app, html, tokenId) {
|
static async addTokenHudExtensions(app, html, tokenId) {
|
||||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||||
controlIconCombat.click(event => {
|
if (controlIconCombat.length > 0) {
|
||||||
if (event.currentTarget.className.includes('active')) {
|
controlIconCombat.click(event => {
|
||||||
RdDTokenHud.removeExtensionHud(app, html, tokenId);
|
if (event.currentTarget.className.includes('active')) {
|
||||||
} else {
|
RdDTokenHud.removeExtensionHud(app, html, tokenId);
|
||||||
setTimeout(function () { RdDTokenHud.addExtensionHud(app, html, tokenId) }, 200);
|
} else {
|
||||||
}
|
setTimeout(() => RdDTokenHud.addExtensionHud(app, html, tokenId), 200);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (controlIconCombat.length>0 && controlIconCombat[0].className.includes('active')) {
|
const isCombat = controlIconCombat[0].className.includes('active');
|
||||||
RdDTokenHud.addExtensionHud(app, html, tokenId);
|
RdDTokenHud.addExtensionHud(app, html, tokenId, isCombat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,9 +133,9 @@ export class RdDTokenHud {
|
|||||||
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
|
static async _configureSubMenu(insertionPoint, template, hudData, onMenuItem) {
|
||||||
const hud = $(await renderTemplate(template, hudData));
|
const hud = $(await renderTemplate(template, hudData));
|
||||||
const list = hud.find('div.rdd-hud-list');
|
const list = hud.find('div.rdd-hud-list');
|
||||||
|
|
||||||
RdDTokenHud._toggleHudListActive(hud, list);
|
RdDTokenHud._toggleHudListActive(hud, list);
|
||||||
|
|
||||||
hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list));
|
hud.find('img.rdd-hud-togglebutton').click(event => RdDTokenHud._toggleHudListActive(hud, list));
|
||||||
list.find('.rdd-hud-menu').click(onMenuItem);
|
list.find('.rdd-hud-menu').click(onMenuItem);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import { RdDRaretes } from "./item/raretes.js";
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// This table starts at 0 -> niveau -10
|
// This table starts at 0 -> niveau -10
|
||||||
const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
|
const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
|
||||||
const difficultesLibres = Misc.intArray(0, -11);
|
const difficultesLibres = Misc.intArray(0, -11);
|
||||||
const ajustementsConditions = Misc.intArray(-10, 11);
|
const ajustementsConditions = Misc.intArray(-10, 11);
|
||||||
const ajustementsEncaissement = Misc.intArray(-10, 26);
|
const ajustementsEncaissement = Misc.intArray(-10, 26);
|
||||||
|
|
||||||
@ -66,38 +66,31 @@ const fatigueMarche = {
|
|||||||
"tresdifficile": { "4": 4, "6": 6 }
|
"tresdifficile": { "4": 4, "6": 6 }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
const definitionsBlessures = [
|
|
||||||
{ type: "legere", facteur: 2 },
|
|
||||||
{ type: "grave", facteur: 4 },
|
|
||||||
{ type: "critique", facteur: 6 }
|
|
||||||
]
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const nomEthylisme = ["Emeché", "Gris", "Pinté", "Pas frais", "Ivre", "Bu", "Complètement fait", "Ivre mort"];
|
const nomEthylisme = ["Emeché", "Gris", "Pinté", "Pas frais", "Ivre", "Bu", "Complètement fait", "Ivre mort"];
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const definitionsEncaissement = {
|
const definitionsEncaissement = {
|
||||||
"mortel": [
|
"mortel": [
|
||||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0},
|
||||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 2},
|
||||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "2", eraflures: 0, legeres: 0, graves: 1, critiques: 0 },
|
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "2", gravite: 4},
|
||||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", eraflures: 0, legeres: 0, graves: 0, critiques: 1 },
|
{ minimum: 20, maximum: undefined, endurance: "100", vie: "4 + @over20", gravite: 6},
|
||||||
],
|
],
|
||||||
"non-mortel": [
|
"non-mortel": [
|
||||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0 },
|
||||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 },
|
||||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 2 },
|
||||||
{ minimum: 20, maximum: undefined, endurance: "100", vie: "0", eraflures: 0, legeres: 1, graves: 0, critiques: 0 },
|
{ minimum: 20, maximum: undefined, endurance: "100", vie: "0", gravite: 2 },
|
||||||
],
|
],
|
||||||
"cauchemar": [
|
"entiteincarnee": [
|
||||||
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", eraflures: 0, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: undefined, maximum: 0, endurance: "0", vie: "0", gravite: -1},
|
||||||
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 1, maximum: 10, endurance: "1d4", vie: "0", gravite: 0},
|
||||||
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 11, maximum: 15, endurance: "1d6", vie: "0", gravite: 0 },
|
||||||
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 16, maximum: 19, endurance: "2d6", vie: "0", gravite: 0 },
|
||||||
{ minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", eraflures: 1, legeres: 0, graves: 0, critiques: 0 },
|
{ minimum: 20, maximum: undefined, endurance: "3d6 + @over20", vie: "0", gravite: 0 },
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -139,7 +132,7 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/maladies-poisons.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/possessions.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
|
'systems/foundryvtt-reve-de-dragon/templates/actor/taches.html',
|
||||||
@ -276,7 +269,8 @@ export class RdDUtility {
|
|||||||
Handlebars.registerHelper('computeResolutionChances', (row, col) => RdDResolutionTable.computeChances(row, col));
|
Handlebars.registerHelper('computeResolutionChances', (row, col) => RdDResolutionTable.computeChances(row, col));
|
||||||
Handlebars.registerHelper('upperFirst', str => Misc.upperFirst(str ?? 'Null'));
|
Handlebars.registerHelper('upperFirst', str => Misc.upperFirst(str ?? 'Null'));
|
||||||
Handlebars.registerHelper('lowerFirst', str => Misc.lowerFirst(str ?? 'Null'));
|
Handlebars.registerHelper('lowerFirst', str => Misc.lowerFirst(str ?? 'Null'));
|
||||||
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? 'NULL');
|
Handlebars.registerHelper('upper', str => str?.toUpperCase() ?? '');
|
||||||
|
Handlebars.registerHelper('lowercase', str => str?.toLowerCase() ?? '');
|
||||||
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str));
|
Handlebars.registerHelper('le', str => Grammar.articleDetermine(str));
|
||||||
Handlebars.registerHelper('apostrophe', (article, str) => Grammar.apostrophe(article, str));
|
Handlebars.registerHelper('apostrophe', (article, str) => Grammar.apostrophe(article, str));
|
||||||
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
Handlebars.registerHelper('un', str => Grammar.articleIndetermine(str));
|
||||||
@ -472,10 +466,6 @@ export class RdDUtility {
|
|||||||
return ajustementsEncaissement;
|
return ajustementsEncaissement;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getDefinitionsBlessures() {
|
|
||||||
return definitionsBlessures;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getSegmentsFatigue(maxEnd) {
|
static getSegmentsFatigue(maxEnd) {
|
||||||
maxEnd = Math.max(maxEnd, 1);
|
maxEnd = Math.max(maxEnd, 1);
|
||||||
@ -616,17 +606,10 @@ export class RdDUtility {
|
|||||||
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;';
|
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;';
|
||||||
encaissement.roll = roll;
|
encaissement.roll = roll;
|
||||||
encaissement.armure = armure;
|
encaissement.armure = armure;
|
||||||
|
encaissement.penetration = rollData.arme?.system.penetration ?? 0;
|
||||||
encaissement.total = jetTotal;
|
encaissement.total = jetTotal;
|
||||||
encaissement.vie = await RdDUtility._evaluatePerte(encaissement.vie, over20);
|
encaissement.vie = await RdDUtility._evaluatePerte(encaissement.vie, over20);
|
||||||
encaissement.endurance = await RdDUtility._evaluatePerte(encaissement.endurance, over20);
|
encaissement.endurance = await RdDUtility._evaluatePerte(encaissement.endurance, over20);
|
||||||
encaissement.penetration = rollData.arme?.system.penetration ?? 0;
|
|
||||||
encaissement.blessures = (
|
|
||||||
encaissement.critiques > 0 ? "Critique" :
|
|
||||||
encaissement.graves > 0 ? "Grave" :
|
|
||||||
encaissement.legeres > 0 ? "Légère" :
|
|
||||||
encaissement.eraflures > 0 ? "Contusions/Eraflures" :
|
|
||||||
'Aucune'
|
|
||||||
);
|
|
||||||
return encaissement;
|
return encaissement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,18 +39,18 @@ export class Targets {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getTarget() {
|
static getTarget(options = { warn: true }) {
|
||||||
const targets = Targets.listTargets();
|
const targets = Targets.listTargets();
|
||||||
switch (targets.length) {
|
switch (targets.length) {
|
||||||
case 1:
|
case 1:
|
||||||
return targets[0];
|
return targets[0];
|
||||||
case 0:
|
case 0:
|
||||||
ui.notifications.warn("Vous devez choisir une cible à attaquer!");
|
if (options.warn) ui.notifications.warn("Vous devez choisir une cible à attaquer!");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ui.notifications.warn("Vous devez choisir une cible (et <strong>une seule</strong>) à attaquer!");
|
if (options.warn) ui.notifications.warn("Vous devez choisir une cible (et <strong>une seule</strong>) à attaquer!");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -186,7 +186,7 @@ i:is(.fas, .far) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.system-foundryvtt-reve-de-dragon .sheet-header :is(.header-compteurs,.header-etats,.profile-img, .profile-img-token){
|
.system-foundryvtt-reve-de-dragon .sheet-header :is(.header-compteurs,.header-etats,.profile-img, .profile-img-token){
|
||||||
padding: 0 3%;
|
padding: 0 0.4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.system-foundryvtt-reve-de-dragon .sheet-header :is(.profile-img, .profile-img-token) {
|
.system-foundryvtt-reve-de-dragon .sheet-header :is(.profile-img, .profile-img-token) {
|
||||||
@ -213,11 +213,13 @@ i:is(.fas, .far) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs {
|
.system-foundryvtt-reve-de-dragon .sheet-header .header-compteurs {
|
||||||
|
width: calc(60% - 110px - 1rem);
|
||||||
text-align: right;
|
text-align: right;
|
||||||
max-width: fit-content;
|
max-width: fit-content;
|
||||||
}
|
}
|
||||||
|
|
||||||
.system-foundryvtt-reve-de-dragon .sheet-header div.header-etats {
|
.system-foundryvtt-reve-de-dragon .sheet-header div.header-etats {
|
||||||
|
width: calc(40% - 32px - 1rem);
|
||||||
height: 48px;
|
height: 48px;
|
||||||
max-width: fit-content;
|
max-width: fit-content;
|
||||||
flex: initial;
|
flex: initial;
|
||||||
@ -426,6 +428,7 @@ span.equipement-detail-buttons {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blessure-control {
|
.blessure-control {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -457,14 +460,17 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) {
|
|||||||
.blessure-inactive {
|
.blessure-inactive {
|
||||||
color:rgba(150, 150, 150, 0.4);
|
color:rgba(150, 150, 150, 0.4);
|
||||||
}
|
}
|
||||||
|
.blessure-active-2,
|
||||||
.blessure-active-legere {
|
.blessure-active-legere {
|
||||||
color:rgba(60, 60, 60, 0.9);
|
color:rgba(60, 60, 60, 0.9);
|
||||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||||
}
|
}
|
||||||
|
.blessure-active-4,
|
||||||
.blessure-active-grave {
|
.blessure-active-grave {
|
||||||
color: rgba(218, 126, 21, 0.9);
|
color: rgba(218, 126, 21, 0.9);
|
||||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||||
}
|
}
|
||||||
|
.blessure-active-6,
|
||||||
.blessure-active-critique {
|
.blessure-active-critique {
|
||||||
color: rgba(173, 36, 26, 0.9);
|
color: rgba(173, 36, 26, 0.9);
|
||||||
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
text-shadow: 1px 1px 4px rgba(60, 60, 60, 1);
|
||||||
@ -1386,27 +1392,36 @@ table.table-nombres-astraux tr:hover {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ======================================== */
|
/* ======================================== */
|
||||||
.tokenhudext {
|
.token-hud-ext {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 0 !important;
|
flex: 0 !important;
|
||||||
font-family: CaslonPro;
|
font-family: CaslonPro;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.tokenhudext.left {
|
.token-hud-ext.left {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2.75rem;
|
top: 2.75rem;
|
||||||
right: 4rem;
|
right: 4rem;
|
||||||
}
|
}
|
||||||
.tokenhudext.right {
|
.token-hud-ext.soins {
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: column;
|
||||||
|
position: absolute;
|
||||||
|
top: 13.2rem;
|
||||||
|
left: -5rem;
|
||||||
|
max-width: 8.5rem
|
||||||
|
}
|
||||||
|
|
||||||
|
.token-hud-ext.right {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 2.75rem;
|
top: 2.75rem;
|
||||||
left: 4rem;
|
left: 4rem;
|
||||||
}
|
}
|
||||||
.control-icon.tokenhudicon {
|
.control-icon.token-hud-icon {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
height: fit-content;
|
height: fit-content;
|
||||||
min-width: 6rem;
|
min-width: 6rem;
|
||||||
@ -1415,7 +1430,7 @@ table.table-nombres-astraux tr:hover {
|
|||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
margin: 0.2rem;
|
margin: 0.2rem;
|
||||||
}
|
}
|
||||||
.control-icon.tokenhudicon.right {
|
.control-icon.token-hud-icon.right {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
.rdd-hud-menu label {
|
.rdd-hud-menu label {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"id": "foundryvtt-reve-de-dragon",
|
"id": "foundryvtt-reve-de-dragon",
|
||||||
"title": "Rêve de Dragon",
|
"title": "Rêve de Dragon",
|
||||||
"version": "10.6.25",
|
"version": "10.7.0",
|
||||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.6.25.zip",
|
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.0.zip",
|
||||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "10",
|
"minimum": "10",
|
||||||
|
@ -179,23 +179,8 @@
|
|||||||
"value": 10,
|
"value": 10,
|
||||||
"label": "Endurance",
|
"label": "Endurance",
|
||||||
"derivee": false
|
"derivee": false
|
||||||
}
|
|
||||||
},
|
|
||||||
"blessures": {
|
|
||||||
"legeres": {
|
|
||||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
|
||||||
},
|
},
|
||||||
"graves": {
|
"bonusPotion": 0
|
||||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
|
||||||
},
|
|
||||||
"critiques": {
|
|
||||||
"liste": [ { "active": false, "psdone": false, "premiers_soins": -1, "scdone": false, "soins_complets": -1, "jours": 0, "localisation": "" } ]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"attributs": {
|
"attributs": {
|
||||||
"plusdom": {
|
"plusdom": {
|
||||||
@ -380,23 +365,8 @@
|
|||||||
"value": 0,
|
"value": 0,
|
||||||
"label": "Fatigue",
|
"label": "Fatigue",
|
||||||
"derivee": true
|
"derivee": true
|
||||||
}
|
|
||||||
},
|
|
||||||
"blessures": {
|
|
||||||
"legeres": {
|
|
||||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
|
||||||
},
|
},
|
||||||
"graves": {
|
"bonusPotion": 0
|
||||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" },
|
|
||||||
{ "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
|
||||||
},
|
|
||||||
"critiques": {
|
|
||||||
"liste": [ { "active": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "localisation": "" } ]
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"attributs": {
|
"attributs": {
|
||||||
"sconst": {
|
"sconst": {
|
||||||
@ -567,7 +537,7 @@
|
|||||||
"monnaie", "nourritureboisson", "gemme",
|
"monnaie", "nourritureboisson", "gemme",
|
||||||
"service",
|
"service",
|
||||||
"meditation", "rencontre", "queue", "ombre", "souffle", "tete", "casetmr", "signedraconique", "sort", "sortreserve",
|
"meditation", "rencontre", "queue", "ombre", "souffle", "tete", "casetmr", "signedraconique", "sort", "sortreserve",
|
||||||
"nombreastral", "tache", "maladie", "poison", "possession",
|
"nombreastral", "tache", "blessure", "maladie", "poison", "possession",
|
||||||
"tarot", "extraitpoetique"
|
"tarot", "extraitpoetique"
|
||||||
],
|
],
|
||||||
"templates": {
|
"templates": {
|
||||||
@ -636,6 +606,22 @@
|
|||||||
"compteur": 0,
|
"compteur": 0,
|
||||||
"date": 0
|
"date": 0
|
||||||
},
|
},
|
||||||
|
"blessure": {
|
||||||
|
"templates": ["temporel"],
|
||||||
|
"gravite": 0,
|
||||||
|
"difficulte": 0,
|
||||||
|
"premierssoins": {
|
||||||
|
"tache": 0,
|
||||||
|
"done": false,
|
||||||
|
"bonus": 0
|
||||||
|
},
|
||||||
|
"soinscomplets": {
|
||||||
|
"done": false,
|
||||||
|
"bonus": 0
|
||||||
|
},
|
||||||
|
"localisation": "",
|
||||||
|
"jours": 0
|
||||||
|
},
|
||||||
"maladie": {
|
"maladie": {
|
||||||
"templates": ["description", "temporel"],
|
"templates": ["description", "temporel"],
|
||||||
"identifie": false,
|
"identifie": false,
|
||||||
@ -833,7 +819,8 @@
|
|||||||
"points_de_tache_courant": 0,
|
"points_de_tache_courant": 0,
|
||||||
"nb_jet_echec": 0,
|
"nb_jet_echec": 0,
|
||||||
"nb_jet_succes": 0,
|
"nb_jet_succes": 0,
|
||||||
"cacher_points_de_tache": false
|
"cacher_points_de_tache": false,
|
||||||
|
"itemId": ""
|
||||||
},
|
},
|
||||||
"sort": {
|
"sort": {
|
||||||
"templates": ["description"],
|
"templates": ["description"],
|
||||||
|
38
templates/actor/blessure.hbs
Normal file
38
templates/actor/blessure.hbs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<li class="item item-blessure flexrow list-item blessure-active-{{lowercase system.labelGravite}}" data-item-id="{{id}}">
|
||||||
|
<span class="blessure-control">
|
||||||
|
<img class="sheet-competence-img" src="{{img}}" />
|
||||||
|
<i class="fas fa-skull-crossbones"></i>
|
||||||
|
{{system.labelGravite}}
|
||||||
|
</span>
|
||||||
|
{{#if (gt system.gravite 6)}}
|
||||||
|
<span class="flexrow"></span>
|
||||||
|
<span class="flexrow"></span>
|
||||||
|
{{else}}
|
||||||
|
<span class="flexrow">
|
||||||
|
<input type="checkbox" class="blessure-premierssoins-done" name="blessure.{{id}}.premierssoins.done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||||
|
{{#if system.premierssoins.done}}
|
||||||
|
<input type="text" class="blessure-premierssoins-bonus number-x2" name="blessure.{{id}}.premierssoins.bonus" data-dtype="number" value="{{system.premierssoins.bonus}}"/>
|
||||||
|
{{else}}
|
||||||
|
<label>{{system.premierssoins.tache}} / {{system.gravite}}</label>
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
<span class="flexrow">
|
||||||
|
{{#if system.premierssoins.done}}
|
||||||
|
<input type="checkbox" class="blessure-soinscomplets-done" name="blessure.{{id}}.system.soinscomplets.done" {{#if system.soinscomplets.done}}checked{{/if}}/>
|
||||||
|
{{#if system.soinscomplets.done}}
|
||||||
|
<input type="text" class="blessure-soinscomplets-bonus number-x2" name="blessure.{{id}}.system.soinscomplets.bonus" data-dtype="number" value="{{system.soinscomplets.bonus}}"/>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<label>Difficulté {{system.difficulte}}</label>
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
|
<span>
|
||||||
|
{{system.localisation}}
|
||||||
|
</span>
|
||||||
|
<span class="item-controls">
|
||||||
|
<a class="item-edit" title="Editer"><i class="fas fa-edit"></i></a>
|
||||||
|
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||||
|
<a class="item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
|
||||||
|
</span>
|
||||||
|
</li>
|
@ -1,27 +0,0 @@
|
|||||||
<li class="item flexrow list-item {{#if blessure.active}}blessure-active-{{gravite}}{{else}}blessure-inactive{{/if}}"
|
|
||||||
data-blessure-type="{{gravite}}"
|
|
||||||
data-attribute={{key}}
|
|
||||||
data-blessure-index="{{key}}"
|
|
||||||
data-blessure-active="{{blessure.active}}">
|
|
||||||
<span class="blessure-control" title="Blessure {{title}}">
|
|
||||||
<i class="fas fa-skull-crossbones" name="blessure-{{gravite}}-{{key}}-active"></i>
|
|
||||||
{{title}}
|
|
||||||
</span>
|
|
||||||
{{#if blessure.active}}
|
|
||||||
<span class="blessure-soins flexrow">
|
|
||||||
<input class="blessure-psdone" name="blessure-{{gravite}}-{{key}}-psdone" type="checkbox" name="blessure.psdone" {{#if blessure.psdone}}checked{{/if}}/>
|
|
||||||
<input class="blessure-premiers_soins" type="text" name="blessure-{{gravite}}-{{key}}-premiers_soins" data-dtype="number" value="{{blessure.premiers_soins}}"/>
|
|
||||||
</span>
|
|
||||||
<span class="blessure-soins flexrow">
|
|
||||||
<input class="blessure-scdone" name="blessure-{{gravite}}-{{key}}-scdone" type="checkbox" name="blessure.scdone" {{#if blessure.scdone}}checked{{/if}}/>
|
|
||||||
<input class="blessure-soins_complets" type="text" name="blessure-{{gravite}}-{{key}}-soins_complets" data-dtype="number" value="{{blessure.soins_complets}}"/>
|
|
||||||
</span>
|
|
||||||
<input class="blessure-jours" type="text" name="blessure-{{gravite}}-{{key}}-jours" name="jours" data-dtype="number" value="{{blessure.jours}}"/>
|
|
||||||
<input class="blessure-localisation" type="text" name="blessure-{{gravite}}-{{key}}-localisation" data-dtype="String" value="{{blessure.loc}}"/>
|
|
||||||
{{else}}
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
<span></span>
|
|
||||||
{{/if}}
|
|
||||||
</li>
|
|
@ -1,18 +1,20 @@
|
|||||||
|
<h4>blessures</h4>
|
||||||
|
<div>
|
||||||
|
<a class="chat-card-button creer-blessure-legere"><i class="fas fa-plus-circle"></i> légère</a>
|
||||||
|
<a class="chat-card-button creer-blessure-grave"><i class="fas fa-plus-circle"></i> grave</a>
|
||||||
|
<a class="chat-card-button creer-blessure-critique"><i class="fas fa-plus-circle"></i> critique</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
<li class="competence-header flexrow" >
|
<li class="competence-header flexrow" >
|
||||||
<span>Blessures</span>
|
<span></span>
|
||||||
<span>Premiers soins</span>
|
<span>Premiers soins</span>
|
||||||
<span>Soins complets</span>
|
<span>Soins complets</span>
|
||||||
<span>Age (jours)</span>
|
<span>Loc.</span>
|
||||||
<span>Localisation</span>
|
<span>Actions</span>
|
||||||
</li>
|
</li>
|
||||||
{{#each system.blessures.legeres.liste as |blessure key|}}
|
{{#each blessures as |blessure|}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="legere" title="Légère"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.hbs" blessure}}
|
||||||
{{/each}}
|
|
||||||
{{#each system.blessures.graves.liste as |blessure key|}}
|
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="grave" title="Grave"}}
|
|
||||||
{{/each}}
|
|
||||||
{{#each system.blessures.critiques.liste as |blessure key|}}
|
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessure.html" blessure=blessure key=key gravite="critique" title="Critique"}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
<h4>Soins</h4>
|
<h4>Soins</h4>
|
||||||
<a class="chat-card-button creer-tache-blessure-legere">Blessure légère</a>
|
<div>
|
||||||
<a class="chat-card-button creer-tache-blessure-grave">Blessure grave</a>
|
<a class="chat-card-button creer-tache-blessure-legere"><i class="fas fa-first-aid"></i> légère</a>
|
||||||
<a class="chat-card-button creer-tache-blessure-critique">Blessure critique</a>
|
<a class="chat-card-button creer-tache-blessure-grave"><i class="fas fa-first-aid"></i> grave</a>
|
||||||
|
<a class="chat-card-button creer-tache-blessure-critique"><i class="fas fa-first-aid"></i> critique</a>
|
||||||
|
</div>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each taches as |tache id|}}
|
{{#each taches as |tache id|}}
|
||||||
{{#if (eq tache.system.competence 'Chirurgie')}}
|
{{#if (eq tache.system.competence 'Chirurgie')}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<span>
|
<div>
|
||||||
{{#if effects}}
|
{{#if effects}}
|
||||||
{{#each effects as |effect key|}}
|
{{#each effects as |effect key|}}
|
||||||
<span class="active-effect" data-effect="{{effect.flags.core.statusId}}">
|
<span class="active-effect" data-effect="{{effect.flags.core.statusId}}">
|
||||||
@ -9,4 +9,4 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
Aucun effet actif
|
Aucun effet actif
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
</div>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<div class="flex-group-left header-etats">
|
<div class="flex-group-left header-etats">
|
||||||
<div class="flexcol">
|
<div class="flexcol">
|
||||||
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
|
<div>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</div>
|
||||||
<span>Sur-encombrement: {{calc.surenc}}</span>
|
<div>Sur-encombrement: {{calc.surenc}}</div>
|
||||||
<span>{{calc.resumeBlessures}}</span>
|
<div>{{calc.resumeBlessures}}</div>
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
{{#if isGM}}
|
{{#if isGM}}
|
||||||
|
{{log this}}
|
||||||
<span>
|
<span>
|
||||||
{{#if (gt endurance 0)}}
|
{{#if (gt endurance 0)}}
|
||||||
De plus, {{alias}} a perdu {{endurance}} points d'endurance
|
De plus, {{alias}} a perdu {{endurance}} points d'endurance
|
||||||
{{#if (ne vie 0)}}et <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
{{#if (ne vie 0)}}et <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (gt endurance 1)}}Jet d'endurance : {{jetEndurance}} / {{resteEndurance}} {{/if}}
|
{{#if (and jetEndurance (gt endurance 1))}}Jet d'endurance : {{jetEndurance}} / {{resteEndurance}} {{/if}}
|
||||||
</span>
|
</span>
|
||||||
{{else}}
|
{{else}}
|
||||||
<h4>{{alias}} encaisse à
|
<h4>{{alias}} encaisse à
|
||||||
<span>
|
<span>
|
||||||
{{numberFormat dmg.total decimals=0 sign=true}}
|
{{numberFormat dmg.total decimals=0 sign=true}}
|
||||||
{{#if (eq dmg.mortalite 'non-mortel')~}}(coups non mortels)
|
{{#if (eq dmg.mortalite 'non-mortel')~}}(coups non mortels)
|
||||||
{{~else if (eq dmg.mortalite 'cauchemar')}}(entité de cauchemar)
|
{{~else if (eq dmg.mortalite 'entiteincarnee')}}(entité incarnée)
|
||||||
{{~/if}}
|
{{~/if}}
|
||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
@ -22,15 +23,16 @@
|
|||||||
{{~/unless}}, total: <span class="rdd-roll-echec">{{total}}</span>
|
{{~/unless}}, total: <span class="rdd-roll-echec">{{total}}</span>
|
||||||
<br>
|
<br>
|
||||||
{{alias}}
|
{{alias}}
|
||||||
{{#if (eq dmg.mortalite 'cauchemar')}}subit le coup
|
{{#if (eq dmg.mortalite 'entiteincarnee')}}subit le coup
|
||||||
{{else if eraflures}}subit une contusion
|
|
||||||
{{else if legeres}}subit une blessure légère
|
|
||||||
{{else if graves}}subit une blessure grave
|
|
||||||
{{else if critiques}}subit une blessure critique
|
|
||||||
{{else if mort}}vient de mourir
|
{{else if mort}}vient de mourir
|
||||||
|
{{else if blessure}}
|
||||||
|
{{#if (gt blessure.system.gravite 0)}}subit une blessure {{blessure.system.labelGravite}}
|
||||||
|
{{else}}subit une contusion
|
||||||
|
{{~/if~}}
|
||||||
{{else}}s'en sort sans une égratignure
|
{{else}}s'en sort sans une égratignure
|
||||||
{{~/if~}}
|
{{~/if~}}
|
||||||
{{~#unless (eq dmg.mortalite 'cauchemar')}}
|
|
||||||
|
{{~#unless (eq dmg.mortalite 'entiteincarnee')}}
|
||||||
{{#if dmg.loc.label}}
|
{{#if dmg.loc.label}}
|
||||||
{{#if (gt roll.total 0)}}({{dmg.loc.label}}){{/if}}
|
{{#if (gt roll.total 0)}}({{dmg.loc.label}}){{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -39,7 +41,7 @@
|
|||||||
{{~#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance
|
{{~#if hasPlayerOwner}}, a perdu {{endurance}} points d'endurance
|
||||||
{{#if (ne vie 0)}}, <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
{{#if (ne vie 0)}}, <span class="rdd-roll-echec">{{vie}} points de vie</span>{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if (ne dmg.mortalite 'cauchemar')}}
|
{{#if (ne dmg.mortalite 'entiteincarnee')}}
|
||||||
{{#if (gt endurance 1)}}et
|
{{#if (gt endurance 1)}}et
|
||||||
{{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}!
|
{{#if sonne}}est <strong>sonné</strong><img class="chat-icon" src="icons/svg/stoned.svg" alt="charge" height="16" width="16" /> jusqu'à la fin du prochain round{{else}}n'est pas sonné{{/if}}!
|
||||||
{{#if hasPlayerOwner}}Jet d'endurance : Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}}
|
{{#if hasPlayerOwner}}Jet d'endurance : Jet d'endurance : {{jetEndurance}} / {{resteEndurance}}{{/if}}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<div class="control-icon rdd-combat ">
|
<div class="control-icon rdd-combat ">
|
||||||
<img class="rdd-hud-togglebutton" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" width="36" height="36" title="Attaque"/>
|
<img class="rdd-hud-togglebutton" src="systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg" width="36" height="36" title="Attaque"/>
|
||||||
<div class="rdd-hud-list tokenhudext left">
|
<div class="rdd-hud-list token-hud-ext left">
|
||||||
{{#each actions as |action key|}}
|
{{#each actions as |action key|}}
|
||||||
{{#unless action.system.initOnly}}
|
{{#unless action.system.initOnly}}
|
||||||
<div class="control-icon tokenhudicon rdd-hud-menu rdd-attaque"
|
<div class="control-icon token-hud-icon rdd-hud-menu rdd-attaque"
|
||||||
data-combatant-id="{{../combatant.id}}"
|
data-combatant-id="{{../combatant.id}}"
|
||||||
data-action-index="{{action.index}}"
|
data-action-index="{{action.index}}"
|
||||||
title="{{action.name}}">
|
title="{{action.name}}">
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<div class="control-icon rdd-initiative ">
|
<div class="control-icon rdd-initiative ">
|
||||||
<img class="rdd-hud-togglebutton" src="icons/svg/sword.svg" width="36" height="36" title="Initiative" />
|
<img class="rdd-hud-togglebutton" src="icons/svg/sword.svg" width="36" height="36" title="Initiative" />
|
||||||
<div class="rdd-hud-list tokenhudext right">
|
<div class="rdd-hud-list token-hud-ext right">
|
||||||
{{#each actions as |action key|}}
|
{{#each actions as |action key|}}
|
||||||
<div class="control-icon tokenhudicon rdd-hud-menu"
|
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||||
data-combatant-id="{{../combatant.id}}"
|
data-combatant-id="{{../combatant.id}}"
|
||||||
data-action-index="{{action.index}}"
|
data-action-index="{{action.index}}"
|
||||||
title="{{action.name}}">
|
title="{{action.name}}">
|
||||||
@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#each commandes as |commande key|}}
|
{{#each commandes as |commande key|}}
|
||||||
<div class="control-icon tokenhudicon rdd-hud-menu"
|
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||||
data-command="{{commande.command}}"
|
data-command="{{commande.command}}"
|
||||||
data-combatant-id="{{../combatant.id}}"
|
data-combatant-id="{{../combatant.id}}"
|
||||||
data-action-index="{{commande.index}}"
|
data-action-index="{{commande.index}}"
|
||||||
|
12
templates/hud-actor-soins.hbs
Normal file
12
templates/hud-actor-soins.hbs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<div class="control-icon rdd-soins ">
|
||||||
|
<img class="rdd-hud-togglebutton" src="icons/svg/regen.svg" width="36" height="36" title="Soins" />
|
||||||
|
<div class="rdd-hud-list token-hud-ext soins">
|
||||||
|
{{#each blessures as |blessure|}}
|
||||||
|
<div class="control-icon token-hud-icon rdd-hud-menu"
|
||||||
|
data-blessure-id="{{blessure.id}}"
|
||||||
|
title="{{blessure.name}}">
|
||||||
|
<label>Soigner: {{blessure.name}}</label>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</div>
|
55
templates/item-blessure-sheet.html
Normal file
55
templates/item-blessure-sheet.html
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<form class="{{cssClass}}" autocomplete="off">
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/header-item.html"}}
|
||||||
|
<section class="sheet-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="system-gravite">Gravité</label>
|
||||||
|
<select name="system-gravite" class="gravite" data-dtype="Number">
|
||||||
|
{{#select system.gravite}}
|
||||||
|
<option value="0">Contusion / Eraflure</option>
|
||||||
|
<option value="2">Légère</option>
|
||||||
|
<option value="4">Grave</option>
|
||||||
|
<option value="6">Critique</option>
|
||||||
|
<option value="8">Mort</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="system.localisation">Localisation</label>
|
||||||
|
<input class="attribute-value" type="text" name="system.localisation" value="{{system.localisation}}" data-dtype="String"/>
|
||||||
|
</div>
|
||||||
|
{{#if (lt system.gravite 7)}}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="system.difficulte">Difficulté des soins</label>
|
||||||
|
<input class="attribute-value number-x" type="text" name="system.difficulte" value="{{system.difficulte}}" data-dtype="Number"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="premierssoins-done">Premiers soins
|
||||||
|
<input class="attribute-value" type="checkbox" name="premierssoins-done" {{#if system.premierssoins.done}}checked{{/if}}/>
|
||||||
|
</label>
|
||||||
|
{{#if system.premierssoins.done}}
|
||||||
|
<input class="attribute-value number-x" type="text" name="system.premierssoins.bonus" value="{{system.premierssoins.bonus}}" data-dtype="Number"/>
|
||||||
|
{{else}}
|
||||||
|
<label for="system.premierssoins.tache">Points de tâches</label>
|
||||||
|
<input class="attribute-value number-x" type="text" name="system.premierssoins.tache" value="{{system.premierssoins.tache}}" data-dtype="Number"/>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if system.premierssoins.done}}
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="soinscomplets-done">Soins complets
|
||||||
|
<input class="attribute-value" type="checkbox" name="soinscomplets-done" {{#if system.soinscomplets.done}}checked{{/if}}/>
|
||||||
|
</label>
|
||||||
|
{{#if system.soinscomplets.done}}
|
||||||
|
<input class="attribute-value number-x" type="text" name="system.soinscomplets.bonus" value="{{system.soinscomplets.bonus}}" data-dtype="Number"/>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if options.isOwned}}
|
||||||
|
{{>"systems/foundryvtt-reve-de-dragon/templates/item/temporel.hbs" this labeldebut="Obtenue" labelfin="Prochain jet"}}
|
||||||
|
{{/if}}
|
||||||
|
</section>
|
||||||
|
</form>
|
Loading…
Reference in New Issue
Block a user