Compare commits
8 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
49fc2c9b0a | |||
9013376096 | |||
972459a08d | |||
1607629365 | |||
8f7efdad87 | |||
2dbe0dea4a | |||
5fc455fbad | |||
8a7e4d3a9e |
4
.gitignore
vendored
4
.gitignore
vendored
@ -8,7 +8,3 @@ todo.md
|
||||
/jsconfig.json
|
||||
/package.json
|
||||
/package-lock.json
|
||||
/packs/*/
|
||||
/packs/*/CURRENT
|
||||
/packs/*/LOG
|
||||
/packs/*/LOCK
|
||||
|
@ -1,7 +1,4 @@
|
||||
---
|
||||
|
||||
# v11.0
|
||||
|
||||
# v10.7 - L'os de Semolosse
|
||||
|
||||
## v10.7.14 - l'expérience de Semolosse
|
||||
|
102
lang/fr.json
102
lang/fr.json
@ -1,56 +1,54 @@
|
||||
{
|
||||
"TYPES": {
|
||||
"Actor": {
|
||||
"Personnage": "Personnage",
|
||||
"Creature": "Créature",
|
||||
"Entite": "Entité de cauchemar",
|
||||
"Commerce": "Commerce",
|
||||
"Vehicule": "Véhicule"
|
||||
},
|
||||
"Item": {
|
||||
"Arme": "Arme",
|
||||
"Armure": "Armure",
|
||||
"Blessure": "Blessure",
|
||||
"Casetmr": "TMR spéciale",
|
||||
"Chant": "Chant",
|
||||
"Competence": "Compétence",
|
||||
"Competencecreature": "Compétence de créature",
|
||||
"Conteneur": "Conteneur",
|
||||
"Danse": "Danse",
|
||||
"Extraitpoetique": "Extrait poetique",
|
||||
"Faune": "Faune",
|
||||
"Gemme": "Gemme",
|
||||
"Herbe": "Herbe",
|
||||
"Ingredient": "Ingrédient",
|
||||
"Jeu": "Jeu",
|
||||
"Livre": "Livre",
|
||||
"Maladie": "Maladie",
|
||||
"Meditation": "Méditation",
|
||||
"Monnaie": "Monnaie",
|
||||
"Munition": "Munition",
|
||||
"Musique": "Musique",
|
||||
"Nombreastral": "Nombre astral",
|
||||
"Nourritureboisson": "Nourriture & boisson",
|
||||
"Objet": "Objet",
|
||||
"Oeuvre": "Oeuvre",
|
||||
"Ombre": "Ombre de Thanatos",
|
||||
"Plante": "Plante",
|
||||
"Poison": "Poison",
|
||||
"Possession": "Possession",
|
||||
"Potion": "Potion",
|
||||
"Queue": "Queue de Dragon",
|
||||
"Recettealchimique": "Recette alchimique",
|
||||
"Recettecuisine": "Recette de cuisine",
|
||||
"Rencontre": "Rencontre TMR",
|
||||
"Service": "Service",
|
||||
"Signedraconique": "Signe draconique",
|
||||
"Sort": "Sort",
|
||||
"Sortreserve": "Sort en réserve",
|
||||
"Souffle": "Souffle de Dragon",
|
||||
"Tache": "Tâche",
|
||||
"Tarot": "Carte de tarot",
|
||||
"Tete": "Tête de Dragon"
|
||||
}
|
||||
"ACTOR": {
|
||||
"TypePersonnage": "Personnage",
|
||||
"TypeCreature": "Créature",
|
||||
"TypeEntite": "Entité de cauchemar",
|
||||
"TypeCommerce": "Commerce",
|
||||
"TypeVehicule": "Véhicule"
|
||||
},
|
||||
"ITEM": {
|
||||
"TypeArme": "Arme",
|
||||
"TypeArmure": "Armure",
|
||||
"TypeBlessure": "Blessure",
|
||||
"TypeCasetmr": "TMR spéciale",
|
||||
"TypeChant": "Chant",
|
||||
"TypeCompetence": "Compétence",
|
||||
"TypeCompetencecreature": "Compétence de créature",
|
||||
"TypeConteneur": "Conteneur",
|
||||
"TypeDanse": "Danse",
|
||||
"TypeExtraitpoetique": "Extrait poetique",
|
||||
"TypeFaune": "Faune",
|
||||
"TypeGemme": "Gemme",
|
||||
"TypeHerbe": "Herbe",
|
||||
"TypeIngredient": "Ingrédient",
|
||||
"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",
|
||||
"TypeRecettecuisine": "Recette de cuisine",
|
||||
"TypeRencontre": "Rencontre TMR",
|
||||
"TypeService": "Service",
|
||||
"TypeSignedraconique": "Signe draconique",
|
||||
"TypeSort": "Sort",
|
||||
"TypeSortreserve": "Sort en réserve",
|
||||
"TypeSouffle": "Souffle de Dragon",
|
||||
"TypeTache": "Tâche",
|
||||
"TypeTarot": "Carte de tarot",
|
||||
"TypeTete": "Tête de Dragon"
|
||||
},
|
||||
"EFFECT": {
|
||||
"StatusStunned": "Sonné",
|
||||
|
@ -456,9 +456,9 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async selectTypeOeuvreToCreate() {
|
||||
let types = RdDItem.getTypesOeuvres();
|
||||
let typeObjets = RdDItem.getTypesOeuvres();
|
||||
let content = `<span class="competence-label">Selectionnez le type d'oeuvre</span><select class="item-type">`;
|
||||
for (let typeName of types) {
|
||||
for (let typeName of typeObjets) {
|
||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||
}
|
||||
content += '</select>';
|
||||
|
@ -3204,31 +3204,25 @@ export class RdDActor extends RdDBaseActor {
|
||||
if (attacker && !await attacker.accorder(this, 'avant-encaissement')) {
|
||||
return;
|
||||
}
|
||||
const attackerId = attacker?.id;
|
||||
if (ReglesOptionelles.isUsing('validation-encaissement-gr') && !game.user.isGM) {
|
||||
RdDBaseActor.remoteActorCall({
|
||||
actorId: this.id,
|
||||
method: 'appliquerEncaissement',
|
||||
args: [rollData, show, attackerId]
|
||||
method: 'validerEncaissement',
|
||||
args: [rollData, show]
|
||||
});
|
||||
return;
|
||||
}
|
||||
await this.appliquerEncaissement(rollData, show, attackerId);
|
||||
}
|
||||
|
||||
async appliquerEncaissement(rollData, show, attackerId) {
|
||||
const armure = await this.computeArmure(rollData);
|
||||
if (ReglesOptionelles.isUsing('validation-encaissement-gr')) {
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, attackerId, (encaissement, show, attackerId) => this._appliquerEncaissement(encaissement, show, attackerId));
|
||||
DialogValidationEncaissement.validerEncaissement(this, rollData, armure, show, (encaissement, show) => this._appliquerEncaissement(encaissement, show, attacker));
|
||||
}
|
||||
else {
|
||||
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: SHOW_DICE });
|
||||
await this._appliquerEncaissement(encaissement, show, attackerId);
|
||||
await this._appliquerEncaissement(encaissement, show, attacker)
|
||||
}
|
||||
}
|
||||
|
||||
async _appliquerEncaissement(encaissement, show, attackedId) {
|
||||
const attacker = attackedId ? game.actors.get(attackedId) : undefined
|
||||
async _appliquerEncaissement(encaissement, show, attacker) {
|
||||
let santeOrig = duplicate(this.system.sante);
|
||||
|
||||
const blessure = await this.ajouterBlessure(encaissement, attacker); // Will update the result table
|
||||
|
@ -50,16 +50,16 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
encTotal: await this.actor.computeEncTotal(),
|
||||
}
|
||||
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
||||
this._appliquerRechercheObjets(formData.conteneurs, formData.inventaires);
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
this._appliquerRechercheObjets(formData.objets, formData.conteneurs);
|
||||
formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs);
|
||||
return formData;
|
||||
}
|
||||
|
||||
_appliquerRechercheObjets(conteneurs, inventaires) {
|
||||
_appliquerRechercheObjets(objets, conteneurs) {
|
||||
if (this.options.recherche?.text) {
|
||||
const recherche = this.options.recherche;
|
||||
const allVisible = inventaires.filter(it => it.isNomTypeLike(recherche.text)).map(it => it.id);
|
||||
const allVisible = objets.filter(it => it.isNomTypeLike(recherche.text)).map(it => it.id);
|
||||
let addVisible = conteneurs.filter(it => it.isNomTypeLike(recherche.text)).map(it => it.id)
|
||||
do {
|
||||
allVisible.push(...addVisible)
|
||||
@ -67,11 +67,11 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
addVisible = parentsIds.filter(id => !allVisible.includes(id))
|
||||
}
|
||||
while (addVisible.length > 0)
|
||||
inventaires.forEach(it => it.system.isHidden = !allVisible.includes(it.id))
|
||||
objets.forEach(it => it.system.isHidden = !allVisible.includes(it.id))
|
||||
conteneurs.forEach(it => it.system.isHidden = !allVisible.includes(it.id))
|
||||
}
|
||||
else {
|
||||
inventaires.forEach(it => it.system.isHidden = false)
|
||||
objets.forEach(it => it.system.isHidden = false)
|
||||
conteneurs.forEach(it => it.system.isHidden = false)
|
||||
}
|
||||
}
|
||||
@ -118,10 +118,9 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
formData.herbes = Misc.arrayOrEmpty(itemTypes['herbe']);
|
||||
formData.nourritureboissons = Misc.arrayOrEmpty(itemTypes['nourritureboisson']);
|
||||
formData.gemmes = Misc.arrayOrEmpty(itemTypes['gemme']);
|
||||
formData.monnaies = Misc.arrayOrEmpty(itemTypes['monnaie']).sort(Monnaie.triValeurEntiere());
|
||||
formData.objets = Misc.arrayOrEmpty(itemTypes['objet'])
|
||||
formData.monnaie = Misc.arrayOrEmpty(itemTypes['monnaie']).sort(Monnaie.triValeurEntiere());
|
||||
|
||||
formData.inventaires = RdDItem.getItemTypesInventaire('all')
|
||||
formData.objets = RdDItem.getItemTypesInventaire('all')
|
||||
.map(t => Misc.arrayOrEmpty(itemTypes[t]))
|
||||
.reduce((a, b) => a.concat(b), [])
|
||||
.sort(Misc.ascending(it => it.name));
|
||||
@ -231,9 +230,9 @@ export class RdDBaseActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async selectObjetTypeToCreate() {
|
||||
let types = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type)));
|
||||
let typeObjets = this.getTypesInventaire().sort(Misc.ascending(type => Misc.typeName('Item', type)));
|
||||
let content = `<span class="competence-label">Selectionnez le type d'équipement</span><select class="item-type">`;
|
||||
for (let typeName of types) {
|
||||
for (let typeName of typeObjets) {
|
||||
content += `<option value="${typeName}">${Misc.typeName('Item', typeName)}</option>`
|
||||
}
|
||||
content += '</select>';
|
||||
|
@ -3,7 +3,6 @@ import { SYSTEM_SOCKET_ID } from "../constants.js";
|
||||
import { Monnaie } from "../item-monnaie.js";
|
||||
import { Misc } from "../misc.js";
|
||||
import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||
import { APP_ASTROLOGIE_REFRESH } from "../sommeil/app-astrologie.js";
|
||||
|
@ -7,7 +7,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
*/
|
||||
export class DialogValidationEncaissement extends Dialog {
|
||||
|
||||
static async validerEncaissement(actor, rollData, armure, show, attackerId, onEncaisser) {
|
||||
static async validerEncaissement(actor, rollData, armure, show, onEncaisser) {
|
||||
let encaissement = await RdDUtility.jetEncaissement(rollData, armure, { showDice: HIDE_DICE });
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-validation-encaissement.html', {
|
||||
actor: actor,
|
||||
@ -15,12 +15,12 @@ export class DialogValidationEncaissement extends Dialog {
|
||||
encaissement: encaissement,
|
||||
show: show
|
||||
});
|
||||
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser);
|
||||
const dialog = new DialogValidationEncaissement(html, actor, rollData, armure, encaissement, show, onEncaisser);
|
||||
dialog.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor, rollData, armure, encaissement, show, attackerId, onEncaisser) {
|
||||
constructor(html, actor, rollData, armure, encaissement, show, onEncaisser) {
|
||||
// Common conf
|
||||
let buttons = {
|
||||
"valider": { label: "Valider", callback: html => this.onValider() },
|
||||
@ -48,7 +48,6 @@ export class DialogValidationEncaissement extends Dialog {
|
||||
this.armure = armure;
|
||||
this.encaissement = encaissement;
|
||||
this.show = show;
|
||||
this.attackerId = attackerId;
|
||||
this.onEncaisser = onEncaisser;
|
||||
this.forceDiceResult = {total: encaissement.roll.result };
|
||||
}
|
||||
@ -67,6 +66,6 @@ export class DialogValidationEncaissement extends Dialog {
|
||||
|
||||
async onValider() {
|
||||
this.encaissement = await RdDUtility.jetEncaissement(this.rollData, this.armure, { showDice: SHOW_DICE, forceDiceResult: this.forceDiceResult});
|
||||
this.onEncaisser(this.encaissement, this.show, this.attackerId)
|
||||
this.onEncaisser(this.encaissement, this.show)
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ export const TYPES = {
|
||||
conteneur: 'conteneur',
|
||||
sort: 'sort',
|
||||
herbe: 'herbe',
|
||||
plante: 'plante',
|
||||
faune: 'faune',
|
||||
ingredient: 'ingredient',
|
||||
livre: 'livre',
|
||||
@ -35,8 +34,6 @@ export const TYPES = {
|
||||
maladie: 'maladie',
|
||||
poison: 'poison',
|
||||
oeuvre: 'oeuvre',
|
||||
monnaie: 'monnaie',
|
||||
munition: 'munition',
|
||||
nourritureboisson: 'nourritureboisson',
|
||||
service: 'service',
|
||||
signedraconique: 'signedraconique',
|
||||
@ -45,8 +42,7 @@ export const TYPES = {
|
||||
sortreserve: 'sortreserve',
|
||||
extraitpoetique: 'extraitpoetique',
|
||||
tarot: 'tarot',
|
||||
empoignade: 'empoignade',
|
||||
objet: 'objet'
|
||||
empoignade: 'empoignade'
|
||||
}
|
||||
const typesInventaireMateriel = [
|
||||
TYPES.arme,
|
||||
|
@ -29,7 +29,7 @@ export class RdDConteneurItemSheet extends RdDItemInventaireSheet {
|
||||
/* -------------------------------------------- */
|
||||
prepareConteneurData(formData) {
|
||||
RdDBaseActorSheet.filterItemsPerTypeForSheet(formData, this.actor.itemTypes);
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires);
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,15 @@ export class RdDCarac {
|
||||
selectedCarac?.label.match(/(Apparence|Force|Agilité|Dextérité|Vue|Ouïe|Odorat-Goût|Empathie|Dérobée|Mêlée|Tir|Lancer)/);
|
||||
}
|
||||
|
||||
static isIgnoreEtatGeneral(rollData) {
|
||||
const selectedCarac = rollData.selectedCarac;
|
||||
return !selectedCarac ||
|
||||
rollData.ethylisme ||
|
||||
RdDCarac.isChance(selectedCarac) ||
|
||||
(RdDCarac.isReve(selectedCarac) && !rollData.competence);
|
||||
}
|
||||
|
||||
|
||||
static computeTotal(carac, beaute = undefined) {
|
||||
const total = Object.values(carac ?? {}).filter(c => !c.derivee)
|
||||
.map(it => parseInt(it.value))
|
||||
|
@ -314,8 +314,8 @@ export class RdDRoll extends Dialog {
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-encTotal"), rollData.ajustements.encTotal.visible && RdDCarac.isAgiliteOuDerobee(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".use-surenc"), rollData.ajustements.surenc.visible && RdDCarac.isActionPhysique(rollData.selectedCarac));
|
||||
HtmlUtility.showControlWhen(this.html.find(".utilisation-moral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
HtmlUtility.showControlWhen(this.html.find(".diffMoral"), rollData.ajustements.moralTotal.used);
|
||||
HtmlUtility.showControlWhen(this.html.find(".divAppelAuMoral"), rollData.use.appelAuMoral);
|
||||
|
||||
// Mise à jour valeurs
|
||||
this.html.find(".dialog-roll-title").text(this._getTitle(rollData));
|
||||
|
@ -1052,7 +1052,6 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static _computeEventOddq(origEvent) {
|
||||
console.log("EVENT", origEvent)
|
||||
let canvasRect = origEvent.target.getBoundingClientRect();
|
||||
let x = origEvent.clientX - canvasRect.left;
|
||||
let y = origEvent.clientY - canvasRect.top;
|
||||
|
@ -339,13 +339,13 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildArbreDeConteneurs(conteneurs, inventaires) {
|
||||
static buildArbreDeConteneurs(conteneurs, objets) {
|
||||
let objetVersConteneur = {};
|
||||
// Attribution des objets aux conteneurs
|
||||
for (let conteneur of conteneurs) {
|
||||
conteneur.subItems = [];
|
||||
for (let id of conteneur.system.contenu ?? []) {
|
||||
let objet = inventaires.find(objet => (id == objet._id));
|
||||
let objet = objets.find(objet => (id == objet._id));
|
||||
if (objet) {
|
||||
objet.estContenu = true; // Permet de filtrer ce qui est porté dans le template
|
||||
objetVersConteneur[id] = conteneur._id;
|
||||
@ -354,20 +354,20 @@ export class RdDUtility {
|
||||
}
|
||||
}
|
||||
for (let conteneur of conteneurs) {
|
||||
conteneur.system.encTotal = RdDUtility.calculEncContenu(conteneur, inventaires);
|
||||
conteneur.system.encTotal = RdDUtility.calculEncContenu(conteneur, objets);
|
||||
}
|
||||
return objetVersConteneur;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculEncContenu(conteneur, inventaires) {
|
||||
static calculEncContenu(conteneur, objets) {
|
||||
const contenus = (conteneur.system.contenu ?? []).filter(id => id != undefined)
|
||||
.map(id => inventaires.find(it => (id == it.id)))
|
||||
.map(id => objets.find(it => (id == it.id)))
|
||||
.filter(it => it);
|
||||
let enc = Number(conteneur.system.encombrement ?? 0) * Number(conteneur.system.quantite ?? 1);
|
||||
for (let contenu of contenus) {
|
||||
if (contenu.type == 'conteneur') {
|
||||
enc += RdDUtility.calculEncContenu(contenu, inventaires);
|
||||
enc += RdDUtility.calculEncContenu(contenu, objets);
|
||||
}
|
||||
else {
|
||||
enc += Number(contenu.system.encombrement ?? 0) * Number(contenu.system.quantite ?? 1)
|
||||
|
@ -51,7 +51,7 @@ export const referenceAjustements = {
|
||||
getValue: (rollData, actor) => RdDBonus.find(rollData.surpriseDefenseur).attaque,
|
||||
},
|
||||
etat: {
|
||||
isUsed: (rollData, actor) => !RollDataAjustements.isIgnoreEtatGeneral(rollData),
|
||||
isUsed: (rollData, actor) => !RdDCarac.isIgnoreEtatGeneral(rollData),
|
||||
getLabel: (rollData, actor) => 'Etat général',
|
||||
getValue: (rollData, actor) => actor.getEtatGeneral({ ethylisme: rollData.forceAlcool != undefined })
|
||||
},
|
||||
@ -177,11 +177,4 @@ export class RollDataAjustements {
|
||||
return sum;
|
||||
}
|
||||
|
||||
static isIgnoreEtatGeneral(rollData) {
|
||||
const selectedCarac = rollData.selectedCarac;
|
||||
return !selectedCarac ||
|
||||
rollData.ethylisme ||
|
||||
RdDCarac.isChance(selectedCarac) ||
|
||||
(RdDCarac.isReve(selectedCarac) && !rollData.competence);
|
||||
}
|
||||
}
|
||||
|
@ -105,11 +105,10 @@ export class RdDCalendrier extends Application {
|
||||
}
|
||||
return buttons
|
||||
}
|
||||
|
||||
/*async maximize() {
|
||||
async maximize() {
|
||||
await super.maximize()
|
||||
this.render(true)
|
||||
}*/
|
||||
}
|
||||
|
||||
async close() { }
|
||||
|
||||
@ -274,7 +273,6 @@ export class RdDCalendrier extends Application {
|
||||
/* -------------------------------------------- */
|
||||
async rebuildNombresAstraux(showDice = HIDE_DICE) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
console.log("Astral rebuild")
|
||||
let newList = [];
|
||||
for (let i = 0; i < MAX_NOMBRE_ASTRAL; i++) {
|
||||
let dayIndex = this.timestamp.indexDate + i;
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { Draconique } from "./draconique.js";
|
||||
import { PixiTMR } from "./pixi-tmr.js";
|
||||
|
||||
export class CarteTmr extends Draconique {
|
||||
|
||||
constructor() {
|
||||
console.log("Sprite create 1!!!!")
|
||||
super();
|
||||
}
|
||||
|
||||
|
@ -91,8 +91,6 @@ export class Draconique {
|
||||
coordTMR: coordTMR
|
||||
};
|
||||
token[type ?? this.code()] = linkData;
|
||||
console.log("SPRITE: ", token.sprite)
|
||||
//PixiTMR.getImgFromCode()
|
||||
pixiTMR.addTooltip(token.sprite, this.tooltip(linkData));
|
||||
return token;
|
||||
}
|
||||
|
@ -20,20 +20,18 @@ export class PixiTMR {
|
||||
this.callbacksOnAnimate = [];
|
||||
}
|
||||
|
||||
async load( onLoad = (loader, resources) => {} ) {
|
||||
// WIP - Deprecated since v7 : let loader = new PIXI.Loader();
|
||||
load( onLoad = (loader, resources) => {} ) {
|
||||
let loader = this.pixiApp.loader;
|
||||
for (const [name, img] of Object.entries(PixiTMR.textures)) {
|
||||
const texture = await PIXI.Assets.load(img);
|
||||
let image = PIXI.Sprite.from(texture);
|
||||
loader = loader.add(name, img);
|
||||
}
|
||||
onLoad();
|
||||
for (let onAnimate of this.callbacksOnAnimate) {
|
||||
onAnimate();
|
||||
}
|
||||
}
|
||||
|
||||
static getImgFromCode(code) {
|
||||
return PixiTMR.textures[code]
|
||||
loader.onError.add((error, reason) => { console.log("ERROR", error, reason) });
|
||||
loader.load( (loader, resources) => {
|
||||
onLoad(loader, resources);
|
||||
for (let onAnimate of this.callbacksOnAnimate) {
|
||||
onAnimate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static register(name, img) {
|
||||
@ -46,9 +44,7 @@ export class PixiTMR {
|
||||
}
|
||||
|
||||
carteTmr(code) {
|
||||
let img = PixiTMR.getImgFromCode(code)
|
||||
const carteTmr = new PIXI.Sprite(PIXI.utils.TextureCache[img]);
|
||||
console.log(code, carteTmr)
|
||||
const carteTmr = new PIXI.Sprite(PIXI.utils.TextureCache[code]);
|
||||
// Setup the position of the TMR
|
||||
carteTmr.x = 0;
|
||||
carteTmr.y = 0;
|
||||
@ -56,8 +52,7 @@ export class PixiTMR {
|
||||
carteTmr.height = 860;
|
||||
// Rotate around the center
|
||||
carteTmr.anchor.set(0);
|
||||
carteTmr.eventMode = 'dynamic'; // PIXI 7 : Not sure ..
|
||||
// This one is deprecated ; carteTmr.interactive = true;
|
||||
carteTmr.interactive = true;
|
||||
carteTmr.buttonMode = true;
|
||||
carteTmr.tmrObject = this;
|
||||
if (!this.tmrObject.viewOnly) {
|
||||
@ -68,10 +63,9 @@ export class PixiTMR {
|
||||
}
|
||||
|
||||
sprite(code, options = {}) {
|
||||
let img = PixiTMR.getImgFromCode(code)
|
||||
const texture = PIXI.utils.TextureCache[img];
|
||||
const texture = PIXI.utils.TextureCache[code];
|
||||
if (!texture) {
|
||||
console.error("Texture manquante", code, PIXI.utils.TextureCache)
|
||||
console.error("Texture manquante", code)
|
||||
return;
|
||||
}
|
||||
let sprite = new PIXI.Sprite(texture);
|
||||
@ -103,8 +97,7 @@ export class PixiTMR {
|
||||
sprite.tooltip = new PIXI.Text(text, tooltipStyle);
|
||||
sprite.tooltip.zIndex = tmrTokenZIndex.tooltip;
|
||||
sprite.isOver = false;
|
||||
// Deprecated : sprite.interactive = true;
|
||||
sprite.eventMode = 'dynamic'; // PIXI 7 To be checked
|
||||
sprite.interactive = true;
|
||||
sprite.on('pointerdown', event => this.onClickBackground(event))
|
||||
.on('pointerover', () => this.onShowTooltip(sprite))
|
||||
.on('pointerout', () => this.onHideTooltip(sprite));
|
||||
|
File diff suppressed because one or more lines are too long
162
system.json
162
system.json
@ -1,13 +1,13 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "11.0.5",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-11.0.5.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
|
||||
"version": "10.7.15",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.15.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "11",
|
||||
"verified": "11",
|
||||
"maximum": "11"
|
||||
"minimum": "10",
|
||||
"verified": "10",
|
||||
"maximum": "10"
|
||||
},
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"authors": [
|
||||
@ -69,10 +69,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/competences.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -81,9 +78,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/arts-et-divertissements.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -92,10 +87,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/competences-creatures.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -104,10 +96,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/competences-entites.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -116,9 +105,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/sorts-oniros.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -127,9 +114,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/sorts-hypnos.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -138,9 +123,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/sorts-narcos.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -149,9 +132,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/sorts-thanatos.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -160,9 +141,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/equipement.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -171,10 +150,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/maladies-et-poisons.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -183,9 +159,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/rappel-des-regles.db",
|
||||
"type": "JournalEntry",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -194,9 +168,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/macros.db",
|
||||
"type": "Macro",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -205,10 +177,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/queues-de-dragon.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -217,10 +186,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/ombres-de-thanatos.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -229,10 +195,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/souffles-de-dragon.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -241,9 +204,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/tarot-draconique.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -252,9 +213,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/extrait-poetique.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "OBSERVER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -263,10 +222,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/tetes-de-dragon-pour-haut-revants.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -275,10 +231,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/tetes-de-dragon-pour-tous-personnages.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -287,10 +240,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/rencontres.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -299,10 +249,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/tables-diverses.db",
|
||||
"type": "RollTable",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -311,10 +258,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/animaux.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -323,10 +267,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/voyageurs.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -335,10 +276,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/vehicules.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -347,10 +285,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/archetypes.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -359,10 +294,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/humanoides.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -371,10 +303,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/entites-de-cauchemar.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -383,10 +312,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/invocations.db",
|
||||
"type": "Actor",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -395,10 +321,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/faune-flore-mineraux.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -407,10 +330,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/meditations-et-ecrits.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -419,10 +339,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/recettes-alchimiques.db",
|
||||
"type": "Item",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
@ -431,10 +348,7 @@
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"path": "packs/scenes-rdd.db",
|
||||
"type": "Scene",
|
||||
"ownership": {
|
||||
"PLAYER": "NONE",
|
||||
"ASSISTANT": "OWNER"
|
||||
},
|
||||
"private": true,
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
|
@ -25,7 +25,7 @@
|
||||
<span class="equipement-detail">Prix (sols)</span>
|
||||
<span class="equipement-actions">Actions</span>
|
||||
</li>
|
||||
{{#each (trier inventaires) as |item id|}}
|
||||
{{#each (trier objets) as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{buildLigneInventaire item ../options}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
{{#if @root.options.isObserver}}
|
||||
<span class="item-name"><h4>Argent et Monnaies (fortune: {{calc.fortune.sols}} sols {{calc.fortune.deniers}} deniers)</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each monnaies as |piece id|}}
|
||||
{{#each monnaie as |piece id|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{piece._id}}">
|
||||
<img class="sheet-competence-img" src="{{piece.img}}" title="{{piece.name}}"/>
|
||||
<span class="equipement-nom">{{piece.name}}</span>
|
||||
|
@ -22,7 +22,7 @@
|
||||
<span class="equipement-detail">Enc.</span>
|
||||
<span class="equipement-actions">Actions</span>
|
||||
</li>
|
||||
{{#each inventaires as |item id|}}
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{buildLigneInventaire item @root.options}}
|
||||
|
Reference in New Issue
Block a user