forked from public/foundryvtt-reve-de-dragon
Compare commits
64 Commits
foundryvtt
...
foundryvtt
Author | SHA1 | Date | |
---|---|---|---|
ee42902b5c | |||
838d4381a4 | |||
2232224951 | |||
1251d04860 | |||
63c6d5ff0f | |||
c0d37e42ca | |||
c8c13d626c | |||
e1ca7ab738 | |||
8f1ee315ef | |||
5daf15901a | |||
bddaecbc74 | |||
87fdd655d4 | |||
9cbb12e900 | |||
509b7f97dc | |||
5cd9fb3a1c | |||
336767c19e | |||
5a32cf26dc | |||
67b0555b11 | |||
59613c3bf8 | |||
e257b6fbee | |||
ea990d7c4e | |||
6271c75508 | |||
cd7cc8eeef | |||
bb3bc0ea77 | |||
f348f3dc3f | |||
dbf9f5e908 | |||
e4da124579 | |||
6e361a5531 | |||
049b23c666 | |||
3ff59d1f07 | |||
cfe8bee1c2 | |||
d4f0cce62b | |||
8c0fbf15b6 | |||
d4fddf8600 | |||
4b1862fa48 | |||
82115ed8d7 | |||
59b4f62145 | |||
3359492f13 | |||
676e6739a6 | |||
872d3fff31 | |||
5f3361ecc6 | |||
9c71827baa | |||
fc9ef06e7b | |||
9e63706de6 | |||
3958b1bdc2 | |||
6d6843223b | |||
46f5cb67f6 | |||
d51243d74f | |||
34cc671f12 | |||
16ce6a58dd | |||
c80cde6d18 | |||
89910e234d | |||
f30df47d22 | |||
c3c42bdb21 | |||
14eb655382 | |||
52e4375972 | |||
15e4bfb713 | |||
8c2d49652c | |||
ed02972a34 | |||
7d32a70e00 | |||
8aece9cad1 | |||
ffd36a045e | |||
bafc52a151 | |||
940baad04c |
@ -30,8 +30,8 @@ export class RdDActorCreatureSheet extends RdDActorSheet {
|
||||
let formData = await super.getData()
|
||||
//console.log("Creature : ", formData, formData.system)
|
||||
formData.calc = {
|
||||
caracTotal: RdDCarac.computeTotal(formData.data.carac),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
|
||||
caracTotal: RdDCarac.computeTotal(formData.system.carac),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
}
|
||||
|
@ -25,23 +25,21 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = this.object;
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
// actor: this.object,
|
||||
id: this.actor.id,
|
||||
type: this.actor.type,
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
system: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
|
||||
// items: items,
|
||||
limited: this.object.limited,
|
||||
limited: this.actor.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
owner: this.actor.isOwner,
|
||||
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
|
||||
};
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
@ -141,6 +139,6 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
return this.actor.update(formData);
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ import { DialogSplitItem } from "./dialog-split-item.js";
|
||||
import { ReglesOptionelles } from "./regles-optionelles.js";
|
||||
import { DialogRepos } from "./dialog-repos.js";
|
||||
import { RdDSheetUtility } from "./rdd-sheet-utility.js";
|
||||
import { TMRUtility } from "./tmr-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDActorSheet extends ActorSheet {
|
||||
@ -36,23 +37,22 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = this.object.system
|
||||
this.timerRecherche = undefined;
|
||||
|
||||
console.log("New actor", objectData)
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: this.object.id,
|
||||
type: this.object.type,
|
||||
img: this.object.img,
|
||||
name: this.object.name,
|
||||
id: this.actor.id,
|
||||
type: this.actor.type,
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.object.limited,
|
||||
system: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.actor.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
owner: this.actor.isOwner,
|
||||
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
|
||||
}
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData)
|
||||
|
||||
@ -65,24 +65,23 @@ export class RdDActorSheet extends ActorSheet {
|
||||
formData.calc = {
|
||||
comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences),
|
||||
competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences),
|
||||
caracTotal: RdDCarac.computeTotal(formData.data.carac, formData.data.beaute),
|
||||
caracTotal: RdDCarac.computeTotal(formData.system.carac, formData.system.beaute),
|
||||
// Mise à jour de l'encombrement total et du prix de l'équipement
|
||||
encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(),
|
||||
prixTotalEquipement: this.actor.computePrixTotalEquipement(),
|
||||
surprise: RdDBonus.find(this.actor.getSurprise(false)).descr,
|
||||
fatigue: RdDUtility.calculFatigueHtml(formData.data.sante.fatigue.value, formData.data.sante.endurance.max),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.data.blessures),
|
||||
fatigue: RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max),
|
||||
resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures),
|
||||
surEncombrementMessage: this.actor.getMessageSurEncombrement()
|
||||
};
|
||||
|
||||
formData.competences.forEach(item => {
|
||||
item.system.visible = this.options.cherchercompetence
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.cherchercompetence)
|
||||
item.system.isVisible = this.options.recherche
|
||||
? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text)
|
||||
: (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item));
|
||||
RdDItemCompetence.levelUp(item, formData.data.compteurs.experience.value);
|
||||
RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value);
|
||||
});
|
||||
|
||||
Object.values(formData.data.carac).forEach(c => {
|
||||
Object.values(formData.system.carac).forEach(c => {
|
||||
RdDCarac.levelUp(c);
|
||||
});
|
||||
|
||||
@ -90,9 +89,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
// toujours avoir une liste d'armes (pour mettre esquive et corps à corps)
|
||||
formData.combat = duplicate(formData.armes ?? []);
|
||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.data.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive").map(i => foundry.utils.deepClone(i.system))
|
||||
formData.combat = RdDCombatManager.finalizeArmeList(formData.combat, formData.competences, formData.data.carac);
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive");
|
||||
formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac);
|
||||
|
||||
this.armesList = formData.combat;
|
||||
|
||||
// Common data
|
||||
@ -101,8 +101,8 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
formData.hautreve = {
|
||||
isDemiReve: this.actor.getEffectByLabel("Demi-rêve"),
|
||||
sortsReserve: formData.data.reve.reserve.list,
|
||||
rencontres: duplicate(formData.data.reve.rencontre.list),
|
||||
sortsReserve: formData.system.reve.reserve.list,
|
||||
rencontres: duplicate(formData.system.reve.rencontre.list),
|
||||
casesTmr: formData.itemsByType.casetmr,
|
||||
cacheTMR: this.actor.isTMRCache()
|
||||
}
|
||||
@ -128,8 +128,8 @@ export class RdDActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _onDropActor(event, dragData) {
|
||||
console.log("_onDropActor", this.actor.id, dragData);
|
||||
this.actor.addSubActeur(dragData.id || dragData.data._id);
|
||||
const dropActor = fromUuidSync(dragData.uuid);
|
||||
this.actor.addSubActeur(dropActor);
|
||||
super._onDropActor(event, dragData);
|
||||
}
|
||||
|
||||
@ -181,7 +181,21 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.item-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
const item = this.actor.getObjet(li.data("item-id"));
|
||||
RdDUtility.confirmerSuppressionItem(this, item, li);
|
||||
});
|
||||
html.find('.sort-reserve-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
const index = li.data('index');
|
||||
const sortReserve = this.actor.system.reve.reserve.list[index];
|
||||
RdDUtility.confirmerSuppression(this, li, {
|
||||
supprimer: `le sort en réserve ${sortReserve.sort.name} en ${TMRUtility.getTMR(sortReserve.coord).label}`,
|
||||
deleteLabel: "Supprimer le sort en réserve",
|
||||
onDelete: () => {
|
||||
console.log("Delete : ", sortReserve.name);
|
||||
this.actor.deleteSortReserveKey(index);
|
||||
}
|
||||
});
|
||||
});
|
||||
html.find('.item-vendre').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
@ -198,7 +212,11 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
html.find('.subacteur-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppressionSubacteur(this, li);
|
||||
const actorId = li.data("actor-id");
|
||||
if (actorId) {
|
||||
const subActor = game.actors.get(actorId);
|
||||
RdDUtility.confirmerSuppressionSubacteur(this, subActor, li);
|
||||
}
|
||||
});
|
||||
|
||||
html.find('.encaisser-direct').click(async event => {
|
||||
@ -330,10 +348,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
// Initiative pour l'arme
|
||||
html.find('.arme-initiative a').click(async event => {
|
||||
let combatant = game.combat.data.combatants.find(c => c.actor.data._id == this.actor.data._id);
|
||||
let combatant = game.combat.combatants.find(c => c.actor.id == this.actor.id);
|
||||
if (combatant) {
|
||||
let arme = this._getEventArmeCombat(event);
|
||||
RdDCombatManager.rollInitiativeCompetence(combatant._id, arme);
|
||||
let action = this._getEventArmeCombat(event);
|
||||
RdDCombatManager.rollInitiativeAction(combatant._id, action);
|
||||
} else {
|
||||
ui.notifications.info("Impossible de lancer l'initiative sans être dans un combat.");
|
||||
}
|
||||
@ -382,12 +400,10 @@ export class RdDActorSheet extends ActorSheet {
|
||||
// On carac change
|
||||
html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
html.find('.carac-xp').change(async event => {
|
||||
html.find('input.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence change
|
||||
@ -397,12 +413,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.actor.updateCompetence(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
html.find('.competence-xp').change(async event => {
|
||||
html.find('input.competence-xp').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXP(compName, parseInt(event.target.value));
|
||||
});
|
||||
// On competence xp change
|
||||
html.find('.competence-xp-sort').change(async event => {
|
||||
html.find('input.competence-xp-sort').change(async event => {
|
||||
let compName = event.currentTarget.attributes.compname.value;
|
||||
this.actor.updateCompetenceXPSort(compName, parseInt(event.target.value));
|
||||
});
|
||||
@ -421,12 +437,31 @@ export class RdDActorSheet extends ActorSheet {
|
||||
this.options.editCaracComp = !this.options.editCaracComp;
|
||||
this.render(true);
|
||||
});
|
||||
html.find('.cherchercompetence').change(async event => {
|
||||
this.options.cherchercompetence = event.currentTarget.value;
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
html.find('.recherche')
|
||||
.each((index, field) => {
|
||||
if (this.options.recherche) {
|
||||
field.focus();
|
||||
field.setSelectionRange(this.options.recherche.start, this.options.recherche.end);
|
||||
}
|
||||
})
|
||||
.keyup(async event => {
|
||||
const nouvelleRecherche = this._optionRecherche(event.currentTarget);
|
||||
if (this.options.recherche?.text != nouvelleRecherche?.text){
|
||||
this.options.recherche = nouvelleRecherche;
|
||||
if (this.timerRecherche) {
|
||||
clearTimeout(this.timerRecherche);
|
||||
}
|
||||
this.timerRecherche = setTimeout(() => {
|
||||
this.timerRecherche = undefined;
|
||||
this.render(true);
|
||||
}, 500);
|
||||
}
|
||||
})
|
||||
.change(async event =>
|
||||
this.options.recherche = this._optionRecherche(event.currentTarget)
|
||||
);
|
||||
html.find('.vue-detaillee').click(async event => {
|
||||
console.log("CONTROLS", this.options.vueDetaillee)
|
||||
this.options.vueDetaillee = !this.options.vueDetaillee;
|
||||
this.render(true);
|
||||
});
|
||||
@ -434,7 +469,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
// On pts de reve change
|
||||
html.find('.pointsreve-value').change(async event => {
|
||||
let reveValue = event.currentTarget.value;
|
||||
this.actor.update({ "data.reve.reve.value": reveValue });
|
||||
this.actor.update({ "system.reve.reve.value": reveValue });
|
||||
});
|
||||
|
||||
// On seuil de reve change
|
||||
@ -512,6 +547,17 @@ export class RdDActorSheet extends ActorSheet {
|
||||
});
|
||||
}
|
||||
|
||||
_optionRecherche(target) {
|
||||
if (!target.value?.length){
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
text: target.value,
|
||||
start: target.selectionStart,
|
||||
end: target.selectionEnd,
|
||||
};
|
||||
}
|
||||
|
||||
_getEventArmeCombat(event) {
|
||||
const li = $(event.currentTarget)?.parents(".item");
|
||||
let armeName = li.data("arme-name");
|
||||
@ -540,7 +586,7 @@ export class RdDActorSheet extends ActorSheet {
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
return this.actor.update(formData);
|
||||
}
|
||||
|
||||
async splitItem(item) {
|
||||
@ -549,11 +595,11 @@ export class RdDActorSheet extends ActorSheet {
|
||||
}
|
||||
|
||||
async _onSplitItem(item, split) {
|
||||
if (split >= 1 && split < Misc.data(item).data.quantite) {
|
||||
if (split >= 1 && split < item.system.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const itemData = duplicate(Misc.data(item));
|
||||
itemData.data.quantite = split;
|
||||
await this.actor.createEmbeddedDocuments('Item', [itemData])
|
||||
const splitItem = duplicate(item);
|
||||
splitItem.system.quantite = split;
|
||||
await this.actor.createEmbeddedDocuments('Item', [splitItem])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,21 +27,20 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = this.object
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
type: objectData.type,
|
||||
img: objectData.img,
|
||||
name: objectData.name,
|
||||
id: this.actor.id,
|
||||
type: this.actor.type,
|
||||
img: this.actor.img,
|
||||
name: this.actor.name,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.object.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.object.limited,
|
||||
system: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.actor.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.actor.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
owner: this.actor.isOwner,
|
||||
itemsByType: Misc.classify(this.actor.items.map(i => foundry.utils.deepClone(i))),
|
||||
};
|
||||
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData);
|
||||
@ -105,7 +104,8 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
const item = this.actor.getObjet(li.data("item-id"));
|
||||
RdDUtility.confirmerSuppressionItem(this, item, li);
|
||||
});
|
||||
html.find('.item-vendre').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
@ -160,6 +160,6 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
/** @override */
|
||||
_updateObject(event, formData) {
|
||||
// Update the Actor
|
||||
return this.object.update(formData);
|
||||
return this.actor.update(formData);
|
||||
}
|
||||
}
|
||||
|
403
module/actor.js
403
module/actor.js
@ -33,7 +33,16 @@ import { RollDataAjustements } from "./rolldata-ajustements.js";
|
||||
import { DialogItemAchat } from "./dialog-item-achat.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDPossession } from "./rdd-possession.js";
|
||||
import { SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
|
||||
const POSSESSION_SANS_DRACONIC = {
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
||||
name: 'Sans draconic',
|
||||
system: {
|
||||
niveau: 0,
|
||||
defaut_carac: "reve",
|
||||
}
|
||||
};
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/**
|
||||
@ -62,23 +71,23 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
static remoteActorCall(data, canExecuteLocally = () => Misc.isUniqueConnectedGM()) {
|
||||
static remoteActorCall(callData, canExecuteLocally = () => Misc.isUniqueConnectedGM()) {
|
||||
if (canExecuteLocally()) {
|
||||
RdDActor.onRemoteActorCall(data);
|
||||
RdDActor.onRemoteActorCall(callData);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_remote_actor_call", data: data });
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_remote_actor_call", data: callData });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static onRemoteActorCall(data) {
|
||||
const actor = game.actors.get(data?.actorId);
|
||||
static onRemoteActorCall(callData) {
|
||||
const actor = game.actors.get(callData?.actorId);
|
||||
if (Misc.isOwnerPlayerOrUniqueConnectedGM(actor)) { // Seul le joueur choisi effectue l'appel: le joueur courant si propriétaire de l'actor, ou le MJ sinon
|
||||
const args = data.args;
|
||||
console.info(`RdDActor.onRemoteActorCall: pour l'Actor ${data.actorId}, appel de RdDActor.${data.method}(`, ...args, ')');
|
||||
actor[data.method](...args);
|
||||
const args = callData.args;
|
||||
console.info(`RdDActor.onRemoteActorCall: pour l'Actor ${callData.actorId}, appel de RdDActor.${callData.method}(`, ...args, ')');
|
||||
actor[callData.method](...args);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,11 +103,10 @@ export class RdDActor extends Actor {
|
||||
* This overrided create() function adds initial items
|
||||
* Namely: Basic skills, money,
|
||||
*
|
||||
* @param {Object} actorData Barebones actor data which this function adds onto.
|
||||
* @param {Object} options (Unused) Additional options which customize the creation workflow.
|
||||
* @param {Object} actorData Barebones actor template data which this function adds onto.
|
||||
* @param {Object} options Additional options which customize the creation workflow.
|
||||
*
|
||||
*/
|
||||
|
||||
static async create(actorData, options) {
|
||||
// Case of compendium global import
|
||||
if (actorData instanceof Array) {
|
||||
@ -110,17 +118,20 @@ export class RdDActor extends Actor {
|
||||
if (actorData.items) {
|
||||
let actor = await super.create(actorData, options);
|
||||
if (isPersonnage) {
|
||||
await actor.checkMonnaiePresence(actorData.items);
|
||||
await actor.checkMonnaiePresence();
|
||||
}
|
||||
return actor;
|
||||
}
|
||||
|
||||
const competences = await RdDUtility.loadCompendium(RdDItemCompetence.actorCompendium(actorData.type))
|
||||
actorData.items = competences.map(i => i.toObject())
|
||||
if (isPersonnage) {
|
||||
const competences = await RdDUtility.loadCompendium(RdDItemCompetence.actorCompendium(actorData.type));
|
||||
actorData.items = competences.map(i => i.toObject());
|
||||
actorData.items = actorData.items.concat(Monnaie.monnaiesData());
|
||||
}
|
||||
return super.create(actorData, options)
|
||||
else {
|
||||
actorData.items = [];
|
||||
}
|
||||
return super.create(actorData, options);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -131,13 +142,6 @@ export class RdDActor extends Actor {
|
||||
this.encTotal = 0;
|
||||
this.prixTotalEquipement = 0;
|
||||
|
||||
/*
|
||||
// Auto-resize token
|
||||
if (this.isToken) {
|
||||
let tokenSize = actorData.data.carac.taille.value/10;
|
||||
this.token.update({height: tokenSize, width: tokenSize } );
|
||||
}*/
|
||||
|
||||
// Make separate methods for each Actor type (character, npc, etc.) to keep
|
||||
// things organized.
|
||||
if (this.type === 'personnage') this._prepareCharacterData(this)
|
||||
@ -179,24 +183,23 @@ export class RdDActor extends Actor {
|
||||
this.computePrixTotalEquipement();
|
||||
this.computeEtatGeneral();
|
||||
// Sanity check
|
||||
await this.checkMonnaiePresence(actorData.items);
|
||||
await this.checkMonnaiePresence();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async cleanupConteneurs() {
|
||||
let updates = this.listItemsData('conteneur')
|
||||
.filter(c => c.system.contenu.filter(id => this.getObjet(id) == undefined).length > 0)
|
||||
.map(c => { return { _id: c._id, 'data.contenu': c.system.contenu.filter(id => this.getObjet(id) != undefined) } });
|
||||
.map(c => { return { _id: c._id, 'system.contenu': c.system.contenu.filter(id => this.getObjet(id) != undefined) } });
|
||||
if (updates.length > 0) {
|
||||
await this.updateEmbeddedDocuments("Item", updates)
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async checkMonnaiePresence(items) { // Ajout opportuniste si les pièces n'existent pas.
|
||||
if (!items) return; // Sanity check during import
|
||||
let manquantes = Monnaie.monnaiesManquantes(items);
|
||||
//console.log("Manque : ", manquantes);
|
||||
async checkMonnaiePresence() { // Ajout opportuniste si les pièces n'existent pas.
|
||||
if (!this.items) return; // Sanity check during import
|
||||
let manquantes = Monnaie.monnaiesManquantes(this.itemTypes['monnaie']);
|
||||
if (manquantes.length > 0) {
|
||||
await this.createEmbeddedDocuments('Item', manquantes, { renderSheet: false });
|
||||
}
|
||||
@ -242,7 +245,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getForce() {
|
||||
if (this.isEntiteCauchemar()) {
|
||||
if (this.isEntite()) {
|
||||
return Misc.toInt(this.system.carac.reve?.value);
|
||||
}
|
||||
return Misc.toInt(this.system.carac.force?.value);
|
||||
@ -317,13 +320,11 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
listItemsData(type) {
|
||||
return this.filterItemsData(it => it.type == type);
|
||||
}
|
||||
filterItemsData(filter) {
|
||||
return this.items.map( it => it).filter(filter)
|
||||
return this.itemTypes[type];
|
||||
}
|
||||
|
||||
filterItems(filter) {
|
||||
return this.items.filter(it => filter(it))
|
||||
return this.items.filter(filter);
|
||||
}
|
||||
|
||||
getItemOfType(idOrName, type) {
|
||||
@ -362,35 +363,32 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
getDraconicList() {
|
||||
return this.items.filter(it => it.type == 'competence' && it.system.categorie == 'draconic')
|
||||
.sort(Misc.descending(it => it.system.niveau))
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getBestDraconic() {
|
||||
const list = this.getDraconicList()
|
||||
.sort(Misc.descending(it => it.system.niveau))
|
||||
return duplicate(list[0])
|
||||
}
|
||||
|
||||
getDraconicOuPossession() {
|
||||
const possessions = this.items.filter(it => it.type == 'competencecreature' && it.system.ispossession)
|
||||
.sort(Misc.descending(it => it.system.niveau));
|
||||
if (possessions.length>0) {
|
||||
if (possessions.length > 0) {
|
||||
return duplicate(possessions[0]);
|
||||
}
|
||||
const draconics = this.getDraconicList().filter(it => it.system.niveau >= 0);
|
||||
if (draconics.length> 0) {
|
||||
return duplicate(draconics[0]);
|
||||
}
|
||||
return {
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
||||
name: 'Sans draconic',
|
||||
data: {
|
||||
niveau: 0,
|
||||
defaut_carac: "reve",
|
||||
}
|
||||
};
|
||||
const draconics = [...this.getDraconicList().filter(it => it.system.niveau >= 0),
|
||||
POSSESSION_SANS_DRACONIC]
|
||||
.sort(Misc.descending(it => it.system.niveau));
|
||||
return duplicate(draconics[0]);
|
||||
}
|
||||
|
||||
getPossession(possessionId) {
|
||||
return this.items.find(it => it.type == 'possession' && it.system.possessionid == possessionId);
|
||||
}
|
||||
getPossessions() {
|
||||
return this.items.filter(it => it.type == 'possession');
|
||||
}
|
||||
|
||||
getDemiReve() {
|
||||
return this.system.reve.tmrpos.coord;
|
||||
@ -398,12 +396,12 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async verifierPotionsEnchantees() {
|
||||
let potionsEnchantees = this.filterItemsData(it => it.type == 'potion' && it.system.categorie.toLowerCase().includes('enchant'));
|
||||
let potionsEnchantees = this.filterItems(it => it.type == 'potion' && it.system.categorie.toLowerCase().includes('enchant'));
|
||||
for (let potion of potionsEnchantees) {
|
||||
if (!potion.system.prpermanent) {
|
||||
console.log(potion);
|
||||
let newPr = (potion.system.pr > 0) ? potion.system.pr - 1 : 0;
|
||||
let update = { _id: potion._id, 'data.pr': newPr };
|
||||
let update = { _id: potion._id, 'system.pr': newPr };
|
||||
const updated = await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
|
||||
let messageData = {
|
||||
@ -434,6 +432,14 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
async deleteSortReserveKey(index) {
|
||||
let reserve = duplicate(this.system.reve.reserve);
|
||||
if (index >= 0) {
|
||||
reserve.list.splice(index, 1);
|
||||
await this.update({ "system.reve.reserve": reserve }, { renderSheet: false });
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSurprise(isCombat = undefined) {
|
||||
let niveauSurprise = this.getActiveEffects()
|
||||
@ -610,7 +616,10 @@ export class RdDActor extends Actor {
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: "Remise à neuf de " + this.name
|
||||
};
|
||||
if (this.isEntiteCauchemar()) {
|
||||
if (this.isEntite([ENTITE_NONINCARNE])) {
|
||||
return;
|
||||
}
|
||||
if (this.isEntite([ENTITE_INCARNE, ENTITE_BLURETTE])) {
|
||||
await this.santeIncDec("endurance", this.system.sante.endurance.max - this.system.sante.endurance.value);
|
||||
}
|
||||
else {
|
||||
@ -825,7 +834,7 @@ export class RdDActor extends Actor {
|
||||
async resultCombatReveDeDragon(rollData) {
|
||||
rollData.queues = [];
|
||||
if (rollData.rolled.isEchec) {
|
||||
rollData.queues.push( await this.ajouterQueue());
|
||||
rollData.queues.push(await this.ajouterQueue());
|
||||
}
|
||||
if (rollData.rolled.isETotal) {
|
||||
rollData.queues.push(await this.ajouterQueue());
|
||||
@ -880,8 +889,6 @@ export class RdDActor extends Actor {
|
||||
if (caracName == 'Taille') {
|
||||
return;
|
||||
}
|
||||
// if ( isNaN(caracXP) || typeof(caracXP) != 'number') caracXP = 0;
|
||||
//await this.update({ [`data.carac.${caracName}.xp`]: caracXP });
|
||||
this.checkCaracXP(caracName);
|
||||
}
|
||||
|
||||
@ -929,26 +936,27 @@ export class RdDActor extends Actor {
|
||||
if (!competence) {
|
||||
return;
|
||||
}
|
||||
const stress = this.system.compteurs.experience.value;
|
||||
const niveau = Number(competence.system.niveau);
|
||||
const stressTransforme = this.system.compteurs.experience.value;
|
||||
const xpRequis = RdDItemCompetence.getCompetenceNextXp(niveau) - competence.system.xp;
|
||||
if (stressTransforme <= 0 || niveau >= competence.system.niveau_archetype || xpRequis <= 0) {
|
||||
const xpSuivant = RdDItemCompetence.getCompetenceNextXp(niveau);
|
||||
const xpRequis = xpSuivant - competence.system.xp;
|
||||
if (stress <= 0 || niveau >= competence.system.niveau_archetype) {
|
||||
ui.notifications.info(`La compétence ne peut pas augmenter!
|
||||
stress disponible: ${stressTransforme}
|
||||
stress disponible: ${stress}
|
||||
expérience requise: ${xpRequis}
|
||||
niveau : ${niveau}
|
||||
archétype : ${competence.system.niveau_archetype}`);
|
||||
return;
|
||||
}
|
||||
const xpUtilise = Math.min(stressTransforme, xpRequis);
|
||||
const gainNiveau = xpUtilise >= xpRequis ? 1 : 0;
|
||||
const xpUtilise = Math.max(0, Math.min(stress, xpRequis));
|
||||
const gainNiveau = (xpUtilise >= xpRequis || xpRequis <=0) ? 1 : 0;
|
||||
const nouveauNiveau = niveau + gainNiveau;
|
||||
const nouveauXp = gainNiveau > 0 ? Math.max(competence.system.xp - xpRequis, 0) : (competence.system.xp + xpUtilise);
|
||||
const nouveauXp = gainNiveau > 0 ? Math.max(competence.system.xp - xpSuivant, 0) : (competence.system.xp + xpUtilise);
|
||||
await competence.update({
|
||||
"system.xp": nouveauXp,
|
||||
"system.niveau": nouveauNiveau,
|
||||
});
|
||||
const stressTransformeRestant = Math.max(0, stressTransforme - xpUtilise);
|
||||
const stressTransformeRestant = Math.max(0, stress - xpUtilise);
|
||||
await this.update({ "system.compteurs.experience.value": stressTransformeRestant });
|
||||
this.updateExperienceLog('Dépense stress', xpUtilise, `Stress en ${competence.name} ${gainNiveau ? "pour passer à " + nouveauNiveau : ""}`);
|
||||
}
|
||||
@ -975,7 +983,7 @@ export class RdDActor extends Actor {
|
||||
let nouveauNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie);
|
||||
const tronc = RdDItemCompetence.getListTronc(competence.name).filter(it => {
|
||||
const comp = this.getCompetence(it);
|
||||
const niveauTr = competence? competence.system.niveau : 0;
|
||||
const niveauTr = competence ? competence.system.niveau : 0;
|
||||
return niveauTr < 0 && niveauTr < nouveauNiveau;
|
||||
});
|
||||
if (tronc.length > 0) {
|
||||
@ -1001,7 +1009,7 @@ export class RdDActor extends Actor {
|
||||
if (competence) {
|
||||
if (isNaN(newXp) || typeof (newXp) != 'number') newXp = 0;
|
||||
this.checkCompetenceXP(idOrName, newXp);
|
||||
const update = { _id: competence.id, 'data.xp': newXp };
|
||||
const update = { _id: competence.id, 'system.xp': newXp };
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
this.updateExperienceLog("XP", newXp, "XP modifié en " + competence.name);
|
||||
} else {
|
||||
@ -1038,7 +1046,6 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async updateExperienceLog(modeXP, valeurXP, raisonXP = 'Inconnue') {
|
||||
let d = new Date();
|
||||
console.log(modeXP, valeurXP, raisonXP);
|
||||
let expLog = duplicate(this.system.experiencelog);
|
||||
expLog.push({
|
||||
mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
|
||||
@ -1180,7 +1187,7 @@ export class RdDActor extends Actor {
|
||||
item.estContenu = undefined;
|
||||
}
|
||||
if (item.type == 'conteneur' && item.system.contenu.length > 0) {
|
||||
corrections.push({ _id: itemData._id, 'system.contenu': [] });
|
||||
corrections.push({ _id: item.id, 'system.contenu': [] });
|
||||
}
|
||||
}
|
||||
if (corrections.length > 0) {
|
||||
@ -1304,17 +1311,17 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
return Math.min(0, this.getEncombrementMax() - Math.ceil(Number(this.getEncTotal())));
|
||||
}
|
||||
getMessageSurEncombrement(){
|
||||
return this.computeMalusSurEncombrement() <0 ? "Sur-Encombrement!" : "";
|
||||
getMessageSurEncombrement() {
|
||||
return this.computeMalusSurEncombrement() < 0 ? "Sur-Encombrement!" : "";
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getEncombrementMax() {
|
||||
switch (this.type){
|
||||
case 'vehicule':
|
||||
switch (this.type) {
|
||||
case 'vehicule':
|
||||
return this.system.capacite_encombrement;
|
||||
case 'entite':
|
||||
return 0;
|
||||
return 0;
|
||||
default:
|
||||
return this.system.attributs.encombrement.value
|
||||
}
|
||||
@ -1336,7 +1343,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeEncombrementTotalEtMalusArmure() {
|
||||
if ( !this.pack ) {
|
||||
if (!this.pack) {
|
||||
await this.computeMalusArmure();
|
||||
return this.computeEncombrement();
|
||||
}
|
||||
@ -1351,7 +1358,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeMalusArmure() {
|
||||
const newMalusArmure = this.filterItemsData(it => it.type == 'armure' && it.system.equipe)
|
||||
const newMalusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe)
|
||||
.map(it => it.system.malus ?? 0)
|
||||
.reduce(Misc.sum(), 0);
|
||||
// Mise à jour éventuelle du malus armure
|
||||
@ -1363,7 +1370,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
computePrixTotalEquipement() {
|
||||
this.prixTotalEquipement = this.filterItemsData(it => it.system.prixTotal)
|
||||
this.prixTotalEquipement = this.filterItems(it => it.system.prixTotal)
|
||||
.map(it => it.system.prixTotal ?? 0)
|
||||
.reduce(Misc.sum(), 0);
|
||||
// Mise à jour valeur totale de l'équipement
|
||||
@ -1373,6 +1380,9 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
computeResumeBlessure(blessures = undefined) {
|
||||
blessures = blessures ?? this.system.blessures;
|
||||
if (!blessures) {
|
||||
return "Pas de blessures possibles";
|
||||
}
|
||||
let nbLegeres = this.countBlessures(blessures.legeres.liste);
|
||||
let nbGraves = this.countBlessures(blessures.graves.liste);
|
||||
let nbCritiques = this.countBlessures(blessures.critiques.liste);
|
||||
@ -1392,11 +1402,11 @@ export class RdDActor extends Actor {
|
||||
resume += ",";
|
||||
resume += " une CRITIQUE !";
|
||||
}
|
||||
return resume;
|
||||
}
|
||||
else {
|
||||
resume = "Aucune blessure";
|
||||
return "Aucune blessure";
|
||||
}
|
||||
return resume;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1422,6 +1432,15 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionRefoulement(item) {
|
||||
const refoulement = item?.system.refoulement ?? 0;
|
||||
if (refoulement>0){
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterRefoulement(value = 1) {
|
||||
let refoulement = this.system.reve.refoulement.value + value;
|
||||
@ -1514,7 +1533,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
buildTMRInnaccessible() {
|
||||
const tmrInnaccessibles = this.filterItemsData(it => Draconique.isCaseTMR(it) &&
|
||||
const tmrInnaccessibles = this.filterItems(it => Draconique.isCaseTMR(it) &&
|
||||
EffetsDraconiques.isInnaccessible(it));
|
||||
return tmrInnaccessibles.map(it => it.system.coord);
|
||||
}
|
||||
@ -1614,7 +1633,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setSonne(sonne = true) {
|
||||
if (this.isEntiteCauchemar()) {
|
||||
if (this.isEntite()) {
|
||||
return;
|
||||
}
|
||||
if (!game.combat && sonne) {
|
||||
@ -1626,7 +1645,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSConst() {
|
||||
if (this.isEntiteCauchemar()) {
|
||||
if (this.isEntite()) {
|
||||
return 0;
|
||||
}
|
||||
return RdDCarac.calculSConst(this.system.carac.constitution.value)
|
||||
@ -1647,8 +1666,11 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
countBlessuresNonSoigneeByName(name) {
|
||||
let blessures = this.system.blessures[name].liste;
|
||||
return blessures.filter(b => b.active && !b.psdone).length;
|
||||
if (this.system.blessures) {
|
||||
let blessures = this.system.blessures[name].liste;
|
||||
return blessures.filter(b => b.active && !b.psdone).length;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1741,7 +1763,7 @@ export class RdDActor extends Actor {
|
||||
result.newValue = Math.max(minValue, Math.min(compteur.value + inc, compteur.max));
|
||||
//console.log("New value ", inc, minValue, result.newValue);
|
||||
let fatigue = 0;
|
||||
if (name == "endurance" && !this.isEntiteCauchemar()) {
|
||||
if (name == "endurance" && !this.isEntite()) {
|
||||
if (result.newValue == 0 && inc < 0 && !isCritique) { // perte endurance et endurance devient 0 (sauf critique) -> -1 vie
|
||||
sante.vie.value--;
|
||||
result.perteVie = true;
|
||||
@ -1765,7 +1787,6 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
compteur.value = result.newValue;
|
||||
//console.log(name, inc, data.value, result.newValue, minValue, data.max);
|
||||
// If endurance lost, then the same amount of fatigue cannot be recovered
|
||||
if (ReglesOptionelles.isUsing("appliquer-fatigue") && sante.fatigue && fatigue > 0) {
|
||||
sante.fatigue.value = Math.max(sante.fatigue.value + fatigue, this._computeFatigueMin());
|
||||
@ -1778,7 +1799,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
isDead() {
|
||||
return !this.isEntiteCauchemar() && this.system.sante.vie.value < -this.getSConst()
|
||||
return !this.isEntite() && this.system.sante.vie.value < -this.getSConst()
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1907,7 +1928,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async actionItem(item, onActionItem = async ()=>{}) {
|
||||
async actionItem(item, onActionItem = async () => { }) {
|
||||
if (!item.getActionPrincipale()) return;
|
||||
switch (item.type) {
|
||||
case 'nourritureboisson': return await this.actionNourritureboisson(item, onActionItem);
|
||||
@ -1915,11 +1936,12 @@ export class RdDActor extends Actor {
|
||||
case 'livre': return await this.actionLire(item);
|
||||
case 'conteneur': return await item.sheet.render(true);
|
||||
case 'herbe': {
|
||||
if (item.isHerbeAPotion()){
|
||||
if (item.isHerbeAPotion()) {
|
||||
return this.dialogFabriquerPotion(item);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 'queue': case 'ombre': return await this.actionRefoulement(item);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1947,15 +1969,16 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerNourritureboisson(item, choix = { doses: 1, seForcer: false, supprimerSiZero: false }) {
|
||||
if (itemData.type != 'nourritureboisson') {
|
||||
|
||||
if (item.type != 'nourritureboisson') {
|
||||
return;
|
||||
}
|
||||
if (choix.doses > itemData.system.quantite) {
|
||||
ui.notifications.warn(`Il n'y a pas assez de ${itemData.name} pour manger ${choix.doses}`)
|
||||
if (choix.doses > item.system.quantite) {
|
||||
ui.notifications.warn(`Il n'y a pas assez de ${item.name} pour manger ${choix.doses}`)
|
||||
return;
|
||||
}
|
||||
if (!this._apprecierCuisine(itemData, choix.seForcer)) {
|
||||
ui.notifications.info(`${this.name} ne n'arrive pas à manger de ${itemData.name}`)
|
||||
if (!this._apprecierCuisine(item, choix.seForcer)) {
|
||||
ui.notifications.info(`${this.name} ne n'arrive pas à manger de ${item.name}`)
|
||||
return;
|
||||
}
|
||||
await this.manger(item, choix.doses, { diminuerQuantite: false });
|
||||
@ -1963,10 +1986,10 @@ export class RdDActor extends Actor {
|
||||
await item.diminuerQuantite(choix.doses, choix);
|
||||
}
|
||||
|
||||
async _apprecierCuisine(itemData, seForcer) {
|
||||
const surmonteExotisme = await this._surmonterExotisme(itemData, seForcer);
|
||||
async _apprecierCuisine(item, seForcer) {
|
||||
const surmonteExotisme = await this._surmonterExotisme(item, seForcer);
|
||||
if (surmonteExotisme) {
|
||||
await this.apprecier('gout', 'cuisine', itemData.system.qualite, itemData.system.boisson ? "apprécie la boisson" : "apprécie le plat");
|
||||
await this.apprecier('gout', 'cuisine', item.system.qualite, item.system.boisson ? "apprécie la boisson" : "apprécie le plat");
|
||||
}
|
||||
else if (seForcer) {
|
||||
await this.jetDeMoral('malheureux');
|
||||
@ -1978,10 +2001,10 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async _surmonterExotisme(itemData) {
|
||||
const exotisme = Math.min(itemData.system.exotisme, itemData.system.qualite, 0);
|
||||
async _surmonterExotisme(item) {
|
||||
const exotisme = Math.min(item.system.exotisme, item.system.qualite, 0);
|
||||
if (exotisme < 0) {
|
||||
const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${itemData.name}` });
|
||||
const rolled = await this.rollCaracCompetence('volonte', 'cuisine', exotisme, { title: `tente de surmonter l'exotisme de ${item.name}` });
|
||||
return rolled.isSuccess;
|
||||
}
|
||||
return true;
|
||||
@ -2006,14 +2029,13 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async boire(item, doses, options = { diminuerQuantite: true }) {
|
||||
const itemData = item;
|
||||
const desaltere = itemData.system.desaltere;
|
||||
const desaltere = item.system.desaltere;
|
||||
if (desaltere > 0) {
|
||||
await this.updateCompteurValue('eau', Misc.keepDecimals(this.system.compteurs.eau.value + desaltere * doses, 1));
|
||||
}
|
||||
if (item.isAlcool()) {
|
||||
for (let i = 0; i < doses; i++) {
|
||||
await this.saouler(itemData.system.force, item);
|
||||
await this.saouler(item.system.force, item);
|
||||
}
|
||||
}
|
||||
await item.diminuerQuantite(doses, options);
|
||||
@ -2167,7 +2189,7 @@ export class RdDActor extends Actor {
|
||||
createCallbackExperience() {
|
||||
return {
|
||||
condition: r => r.rolled.isPart && r.finalLevel < 0 && game.settings.get("core", "rollMode") != 'selfroll',
|
||||
action: r => this.appliquerAjoutExperience(r, (game.settings.get("core", "rollMode") != 'blindroll' && !game.user.isGM))
|
||||
action: r => this.appliquerAjoutExperience(r)
|
||||
};
|
||||
}
|
||||
|
||||
@ -2239,10 +2261,11 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async appliquerAjoutExperience(rollData, display) {
|
||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||
if (!this.isPersonnage()) return;
|
||||
hideChatMessage = hideChatMessage == 'hide' || (game.settings.get("core", "rollMode") != 'blindroll' && !game.user.isGM)
|
||||
let xpData = await this._appliquerExperience(rollData.rolled, rollData.selectedCarac.label, rollData.competence);
|
||||
if (xpData && display) {
|
||||
if (xpData && !hideChatMessage) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-gain-xp.html`, xpData)
|
||||
@ -2266,7 +2289,6 @@ export class RdDActor extends Actor {
|
||||
let tmr = TMRUtility.getTMR(coord);
|
||||
let letfilteredList = []
|
||||
for (let sort of sortList) {
|
||||
//console.log(sort.name, sort.data.caseTMR.toLowerCase(), sort.data.caseTMRspeciale.toLowerCase(), coord.toLowerCase() );
|
||||
if (sort.system.caseTMR.toLowerCase().includes('variable')) {
|
||||
letfilteredList.push(sort);
|
||||
} else if (sort.system.caseTMRspeciale.toLowerCase().includes('variable')) {
|
||||
@ -2536,7 +2558,7 @@ export class RdDActor extends Actor {
|
||||
if (rollData.competence.system.ispossession) {
|
||||
RdDPossession.onAttaquePossession(this, rollData.competence)
|
||||
} else {
|
||||
const arme = RdDItemCompetenceCreature.toArme(rollData.competence)
|
||||
const arme = RdDItemCompetenceCreature.toActionArme(rollData.competence)
|
||||
RdDCombat.createUsingTarget(this)?.attaque(competence, arme)
|
||||
}
|
||||
return
|
||||
@ -2573,8 +2595,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async creerTacheDepuisLivre(item, options = { renderSheet: true }) {
|
||||
const itemData = item
|
||||
const nomTache = "Lire " + itemData.name;
|
||||
const nomTache = "Lire " + item.name;
|
||||
const filterTacheLecture = it => it.type == 'tache' && it.name == nomTache;
|
||||
let tachesExistantes = this.filterItems(filterTacheLecture);
|
||||
if (tachesExistantes.length == 0) {
|
||||
@ -2583,12 +2604,12 @@ export class RdDActor extends Actor {
|
||||
system: {
|
||||
carac: 'intellect',
|
||||
competence: 'Ecriture',
|
||||
difficulte: itemData.system.difficulte,
|
||||
difficulte: item.system.difficulte,
|
||||
periodicite: "60 minutes",
|
||||
fatigue: 2,
|
||||
points_de_tache: itemData.system.points_de_tache,
|
||||
points_de_tache: item.system.points_de_tache,
|
||||
points_de_tache_courant: 0,
|
||||
description: "Lecture du livre " + item.name + " - XP : " + itemData.system.xp + " - Compétences : " + itemData.system.competence
|
||||
description: "Lecture du livre " + item.name + " - XP : " + item.system.xp + " - Compétences : " + item.system.competence
|
||||
}
|
||||
}
|
||||
await this.createEmbeddedDocuments('Item', [tache], options);
|
||||
@ -2662,7 +2683,7 @@ export class RdDActor extends Actor {
|
||||
selectedCarac: duplicate(this.system.carac[selected])
|
||||
},
|
||||
{ overwrite: false });
|
||||
artData.competence.system.defaut_carac = selected;
|
||||
artData.competence.system.defaut_carac = selected;
|
||||
if (!artData.forceCarac) {
|
||||
artData.forceCarac = {};
|
||||
artData.forceCarac[selected] = duplicate(this.system.carac[selected]);
|
||||
@ -2839,7 +2860,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_meditationEPart(meditationRoll) {
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'data.malus': meditationRoll.meditation.system.malus - 1 }]);
|
||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'system.malus': meditationRoll.meditation.system.malus - 1 }]);
|
||||
}
|
||||
|
||||
|
||||
@ -2868,8 +2889,11 @@ export class RdDActor extends Actor {
|
||||
if (this.currentTMR) this.currentTMR.minimize(); // Hide
|
||||
|
||||
let draconicList = this.getDraconicList()
|
||||
.map(draconic => duplicate(draconic))
|
||||
.map(draconic => { draconic.system.defaut_carac = "intellect"; return draconic; });
|
||||
.map(draconic => {
|
||||
let draconicLecture = duplicate(draconic);
|
||||
draconicLecture.system.defaut_carac = "intellect";
|
||||
return draconicLecture;
|
||||
});
|
||||
|
||||
const intellect = this.system.carac.intellect;
|
||||
let rollData = {
|
||||
@ -2987,7 +3011,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
checkDesirLancinant() {
|
||||
let queue = this.filterItemsData(it => it.type == 'queue' || it.type == 'ombre')
|
||||
let queue = this.filterItems(it => it.type == 'queue' || it.type == 'ombre')
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(it.name).includes('desir lancinant'));
|
||||
return (queue.length > 0);
|
||||
}
|
||||
@ -3033,7 +3057,7 @@ export class RdDActor extends Actor {
|
||||
let update = { _id: xpData.competence._id, 'system.xp': newXp };
|
||||
await this.updateEmbeddedDocuments('Item', [update]);
|
||||
xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false);
|
||||
this.updateExperienceLog("XP", xpData.xp, "XP gagné en " + xpData.competence.name);
|
||||
this.updateExperienceLog("XP", xpData.xpCompetence, "XP gagné en " + xpData.competence.name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3054,23 +3078,23 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async resetNombreAstral(data) {
|
||||
async resetNombreAstral() {
|
||||
let toDelete = this.listItemsData('nombreastral');
|
||||
const deletions = toDelete.map(it => it._id);
|
||||
await this.deleteEmbeddedDocuments("Item", deletions);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouteNombreAstral(data) {
|
||||
async ajouteNombreAstral(callData) {
|
||||
// Gestion expérience (si existante)
|
||||
data.competence = this.getCompetence("astrologie")
|
||||
data.selectedCarac = this.system.carac["vue"];
|
||||
this.appliquerAjoutExperience(data, false);
|
||||
callData.competence = this.getCompetence("astrologie")
|
||||
callData.selectedCarac = this.system.carac["vue"];
|
||||
this.appliquerAjoutExperience(callData, 'hide');
|
||||
|
||||
// Ajout du nombre astral
|
||||
const item = {
|
||||
name: "Nombre Astral", type: "nombreastral", data:
|
||||
{ value: data.nbAstral, istrue: data.isvalid, jourindex: Number(data.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex(Number(data.date)) }
|
||||
name: "Nombre Astral", type: "nombreastral", system:
|
||||
{ value: callData.nbAstral, istrue: callData.isvalid, jourindex: Number(callData.date), jourlabel: game.system.rdd.calendrier.getDateFromIndex(Number(callData.date)) }
|
||||
};
|
||||
await this.createEmbeddedDocuments("Item", [item]);
|
||||
|
||||
@ -3119,7 +3143,7 @@ export class RdDActor extends Actor {
|
||||
return carac.chance;
|
||||
}
|
||||
let entry = Misc.findFirstLike(name, Object.entries(carac), { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
return entry.length > 0 ? carac[entry[0]] : undefined;
|
||||
return entry && entry.length > 0 ? carac[entry[0]] : undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3216,15 +3240,15 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
getArmeParade(armeParadeId) {
|
||||
const item = armeParadeId ? this.getEmbeddedDocument('Item', armeParadeId) : undefined;
|
||||
return RdDItemArme.getArmeData(item);
|
||||
return RdDItemArme.getArme(item);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
verifierForceMin(itemData) {
|
||||
if (itemData.type == 'arme' && itemData.system.force > this.system.carac.force.value) {
|
||||
verifierForceMin(item) {
|
||||
if (item.type == 'arme' && item.system.force > this.system.carac.force.value) {
|
||||
ChatMessage.create({
|
||||
content: `<strong>${this.name} s'est équipé(e) de l'arme ${itemData.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
|
||||
(${itemData.system.force} nécessaire pour une Force de ${this.system.carac.force.value})`
|
||||
content: `<strong>${this.name} s'est équipé(e) de l'arme ${item.name}, mais n'a pas une force suffisante pour l'utiliser normalement </strong>
|
||||
(${item.system.force} nécessaire pour une Force de ${this.system.carac.force.value})`
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -3249,10 +3273,10 @@ export class RdDActor extends Actor {
|
||||
let armeData = attackerRoll.arme;
|
||||
let protection = 0;
|
||||
const armures = this.items.filter(it => it.type == "armure" && it.system.equipe);
|
||||
for (const itemData of armures) {
|
||||
protection += await RdDDice.rollTotal(itemData.system.protection.toString());
|
||||
for (const armure of armures) {
|
||||
protection += await RdDDice.rollTotal(armure.system.protection.toString());
|
||||
if (dmg > 0) {
|
||||
this._deteriorerArmure(itemData, dmg);
|
||||
this._deteriorerArmure(armure, dmg);
|
||||
dmg = 0;
|
||||
}
|
||||
}
|
||||
@ -3271,39 +3295,39 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_deteriorerArmure(item, dmg) {
|
||||
let itemData = duplicate(item);
|
||||
if (!ReglesOptionelles.isUsing('deteriorationArmure') || itemData.system.protection == '0') {
|
||||
_deteriorerArmure(armure, dmg) {
|
||||
armure = duplicate(armure);
|
||||
if (!ReglesOptionelles.isUsing('deteriorationArmure') || armure.system.protection == '0') {
|
||||
return;
|
||||
}
|
||||
itemData.system.deterioration = (itemData.system.deterioration ?? 0) + dmg;
|
||||
if (itemData.system.deterioration >= 10) {
|
||||
itemData.system.deterioration -= 10;
|
||||
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(itemData.system.protection);
|
||||
armure.system.deterioration = (armure.system.deterioration ?? 0) + dmg;
|
||||
if (armure.system.deterioration >= 10) {
|
||||
armure.system.deterioration -= 10;
|
||||
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(armure.system.protection);
|
||||
if (res) {
|
||||
let malus = Misc.toInt(res[3]) - 1;
|
||||
let armure = Misc.toInt(res[2]);
|
||||
if (armure+malus <= 0){
|
||||
itemData.system.protection = 0;
|
||||
if (armure + malus <= 0) {
|
||||
armure.system.protection = 0;
|
||||
} else {
|
||||
itemData.system.protection = '' + (res[1]??'1') + 'd' + armure + malus;
|
||||
armure.system.protection = '' + (res[1] ?? '1') + 'd' + armure + malus;
|
||||
}
|
||||
}
|
||||
else if (/\d+/.exec(itemData.system.protection)) {
|
||||
itemData.system.protection = "1d" + itemData.system.protection;
|
||||
else if (/\d+/.exec(armure.system.protection)) {
|
||||
armure.system.protection = "1d" + armure.system.protection;
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn(`La valeur d'armure de votre ${item.name} est incorrecte`);
|
||||
ui.notifications.warn(`La valeur d'armure de votre ${armure.name} est incorrecte`);
|
||||
}
|
||||
ChatMessage.create({ content: "Votre armure s'est détériorée, elle protège maintenant de " + itemData.system.protection });
|
||||
ChatMessage.create({ content: "Votre armure s'est détériorée, elle protège maintenant de " + armure.system.protection });
|
||||
}
|
||||
this.updateEmbeddedDocuments('Item', [itemData]);
|
||||
this.updateEmbeddedDocuments('Item', [armure]);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async encaisser() {
|
||||
let data = { ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() };
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', data);
|
||||
let dialogData = { ajustementsEncaissement: RdDUtility.getAjustementsEncaissement() };
|
||||
let html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-roll-encaisser.html', dialogData);
|
||||
new RdDEncaisser(html, this).render(true);
|
||||
}
|
||||
|
||||
@ -3319,7 +3343,7 @@ export class RdDActor extends Actor {
|
||||
let encaissement = await this.jetEncaissement(rollData);
|
||||
|
||||
this.ajouterBlessure(encaissement); // Will upate the result table
|
||||
const perteVie = this.isEntiteCauchemar()
|
||||
const perteVie = this.isEntite()
|
||||
? { newValue: 0 }
|
||||
: await this.santeIncDec("vie", - encaissement.vie);
|
||||
const perteEndurance = await this.santeIncDec("endurance", -encaissement.endurance, encaissement.critiques > 0);
|
||||
@ -3333,7 +3357,7 @@ export class RdDActor extends Actor {
|
||||
sonne: perteEndurance.sonne,
|
||||
jetEndurance: perteEndurance.jetEndurance,
|
||||
endurance: santeOrig.endurance.value - perteEndurance.newValue,
|
||||
vie: this.isEntiteCauchemar() ? 0 : (santeOrig.vie.value - perteVie.newValue),
|
||||
vie: this.isEntite() ? 0 : (santeOrig.vie.value - perteVie.newValue),
|
||||
show: defenderRoll?.show ?? {}
|
||||
});
|
||||
|
||||
@ -3484,8 +3508,8 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
getRollData() {
|
||||
const data = super.getRollData();
|
||||
return data;
|
||||
const rollData = super.getRollData();
|
||||
return rollData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3522,8 +3546,8 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async accorder(entite, when = 'avant-encaissement') {
|
||||
if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar")
|
||||
|| !entite.isEntiteCauchemar()
|
||||
|| entite.isEntiteCauchemarAccordee(this)) {
|
||||
|| !entite.isEntite([ENTITE_INCARNE])
|
||||
|| entite.isEntiteAccordee(this)) {
|
||||
return true;
|
||||
}
|
||||
const tplData = this.system;
|
||||
@ -3547,56 +3571,55 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isEntiteCauchemar() {
|
||||
return this.type == 'entite';
|
||||
isEntite(typeentite = []) {
|
||||
return this.type == 'entite' && (typeentite.length == 0 || typeentite.includes(this.system.definition.typeentite));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
isEntiteCauchemarAccordee(attaquant) {
|
||||
if (!this.isEntiteCauchemar()) { return true; }
|
||||
isEntiteAccordee(attaquant) {
|
||||
if (!this.isEntite([ENTITE_INCARNE])) { return true; }
|
||||
let resonnance = this.system.sante.resonnance;
|
||||
return (resonnance.actors.find(it => it == attaquant._id));
|
||||
return (resonnance.actors.find(it => it == attaquant.id));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setEntiteReveAccordee(attaquant) {
|
||||
if (!this.isEntiteCauchemar()) {
|
||||
if (!this.isEntite([ENTITE_INCARNE])) {
|
||||
ui.notifications.error("Impossible de s'accorder à " + this.name + ": ce n'est pas une entite de cauchemer/rêve");
|
||||
return;
|
||||
}
|
||||
let resonnance = duplicate(this.system.sante.resonnance);
|
||||
if (resonnance.actors.find(it => it == attaquant._id)) {
|
||||
if (resonnance.actors.find(it => it == attaquant.id)) {
|
||||
// déjà accordé
|
||||
return;
|
||||
}
|
||||
resonnance.actors.push(attaquant._id);
|
||||
resonnance.actors.push(attaquant.id);
|
||||
await this.update({ "system.sante.resonnance": resonnance });
|
||||
return;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getFortune() {
|
||||
let monnaies = Monnaie.filtrerMonnaies(this.items);
|
||||
let monnaies = this.itemTypes['monnaie'];
|
||||
if (monnaies.length < 4) {
|
||||
ui.notifications.error("Problème de monnaies manquantes, impossible de payer correctement!")
|
||||
throw "Problème de monnaies manquantes, impossible de payer correctement!";
|
||||
}
|
||||
return monnaies.map(m => this.system)
|
||||
.map(tpl => tpl.valeur_deniers * Number(tpl.quantite))
|
||||
return monnaies.map(m => Number(m.system.valeur_deniers) * Number(m.system.quantite))
|
||||
.reduce(Misc.sum(), 0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async optimizeArgent(fortuneTotale) {
|
||||
let monnaies = Monnaie.filtrerMonnaies(this.items);
|
||||
let parValeur = Misc.classifyFirst(monnaies, it => this.system.valeur_deniers);
|
||||
let monnaies = this.itemTypes['monnaie'];
|
||||
let parValeur = Misc.classifyFirst(monnaies, it => it.system.valeur_deniers);
|
||||
let nouvelleFortune = {
|
||||
1000: Math.floor(fortuneTotale / 1000), // or
|
||||
100: Math.floor(fortuneTotale / 100) % 10, // argent
|
||||
10: Math.floor(fortuneTotale / 10) % 10, // bronze
|
||||
1: fortuneTotale % 10 // étain
|
||||
}
|
||||
console.log('RdDActor.optimizeArgent', fortuneTotale, 'nouvelleFortune', nouvelleFortune, 'monnaie_par_valeur',parValeur);
|
||||
console.log('RdDActor.optimizeArgent', fortuneTotale, 'nouvelleFortune', nouvelleFortune, 'monnaie_par_valeur', parValeur);
|
||||
let updates = [];
|
||||
for (const [valeur, nombre] of Object.entries(nouvelleFortune)) {
|
||||
updates.push({ _id: parValeur[valeur].id, 'system.quantite': nombre });
|
||||
@ -3665,7 +3688,8 @@ export class RdDActor extends Actor {
|
||||
RdDActor.remoteActorCall({
|
||||
userId: Misc.connectedGMOrUser(),
|
||||
actorId: this.id,
|
||||
method: 'ajouterDeniers', args: [gain, fromActorId] });
|
||||
method: 'ajouterDeniers', args: [gain, fromActorId]
|
||||
});
|
||||
}
|
||||
else {
|
||||
const fromActor = game.actors.get(fromActorId)
|
||||
@ -3700,8 +3724,9 @@ export class RdDActor extends Actor {
|
||||
RdDActor.remoteActorCall({
|
||||
actorId: achat.vendeurId ?? achat.acheteurId,
|
||||
method: 'achatVente',
|
||||
args: [achat] },
|
||||
);
|
||||
args: [achat]
|
||||
},
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3712,7 +3737,7 @@ export class RdDActor extends Actor {
|
||||
const buttonAcheter = html.find(".button-acheter")[0];
|
||||
const vente = DialogItemAchat.prepareVenteData(buttonAcheter, achat.vendeurId, vendeur, acheteur);
|
||||
const itemId = vente.item._id;
|
||||
const isItemEmpilable = "quantite" in vente.item.data;
|
||||
const isItemEmpilable = "quantite" in vente.item.system;
|
||||
|
||||
const coutDeniers = Math.floor((achat.prixTotal ?? 0) * 100);
|
||||
achat.quantiteTotal = (achat.choix.nombreLots ?? 1) * (vente.tailleLot);
|
||||
@ -3744,7 +3769,7 @@ export class RdDActor extends Actor {
|
||||
type: vente.item.type,
|
||||
img: vente.item.img,
|
||||
name: vente.item.name,
|
||||
data: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
system: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
}
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)
|
||||
@ -3886,19 +3911,21 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
addSubActeur(subActorId) {
|
||||
let subActor = game.actors.get(subActorId);
|
||||
//console.log("Ajout acteur : ", actor, this);
|
||||
if (subActor && !subActor.owner) {
|
||||
if (subActortype == 'vehicule') {
|
||||
addSubActeur(subActor) {
|
||||
if(subActor?.id == this.id){
|
||||
ui.notifications.warn("Vous ne pouvez pas attacher un acteur à lui même")
|
||||
}
|
||||
else if (!subActor?.isOwner) {
|
||||
ui.notifications.warn("Vous n'avez pas les droits sur l'acteur que vous attachez.")
|
||||
}
|
||||
else {
|
||||
if (subActor.type == 'vehicule') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'system.subacteurs.vehicules', 'Ce Véhicule');
|
||||
} else if (subActor.type == 'creature') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'system.subacteurs.montures', 'Cette Monture');
|
||||
} else if (subActor.type == 'personnage') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'system.subacteurs.suivants', 'Ce Suivant');
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Vous n'avez pas les droits sur l'acteur que vous attachez.")
|
||||
}
|
||||
}
|
||||
|
||||
@ -3907,9 +3934,9 @@ export class RdDActor extends Actor {
|
||||
let newVehicules = this.system.subacteurs.vehicules.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
let newSuivants = this.system.subacteurs.suivants.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
let newMontures = this.system.subacteurs.montures.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
await this.update({ 'system.subacteurs.vehicules': newVehicules });
|
||||
await this.update({ 'system.subacteurs.suivants': newSuivants });
|
||||
await this.update({ 'system.subacteurs.montures': newMontures });
|
||||
await this.update({ 'system.subacteurs.vehicules': newVehicules }, { renderSheet: false });
|
||||
await this.update({ 'system.subacteurs.suivants': newSuivants }, { renderSheet: false });
|
||||
await this.update({ 'system.subacteurs.montures': newMontures }, { renderSheet: false });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -4072,7 +4099,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async consommerPotion(potion, onActionItem = async () => {}) {
|
||||
async consommerPotion(potion, onActionItem = async () => { }) {
|
||||
const potionData = potion
|
||||
|
||||
if (potionData.system.categorie.includes('Soin')) {
|
||||
@ -4108,7 +4135,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getEffectByLabel(label) {
|
||||
getEffectByLabel(label) {
|
||||
return this.getActiveEffects().find(it => it.system?.label == label);
|
||||
}
|
||||
|
||||
@ -4119,7 +4146,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async setStatusEffect(label, status, updates = {}) {
|
||||
if (this.isEntiteCauchemar() || this.type == 'vehicule') {
|
||||
if (this.isEntite() || this.type == 'vehicule') {
|
||||
return;
|
||||
}
|
||||
console.log("setStatusEffect", label, status, updates)
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { Misc } from "./misc.js";
|
||||
import { SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
|
||||
export const MESSAGE_DATA = 'message-data';
|
||||
|
||||
/**
|
||||
* Class providing helper methods to get the list of users, and
|
||||
@ -19,61 +18,50 @@ export class ChatUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static notifyUser(userId, level = 'info', message) {
|
||||
const data = {
|
||||
const socketData = {
|
||||
userId: userId, level: level, message: message
|
||||
};
|
||||
if (game.user.id == userId) {
|
||||
ChatUtility.onNotifyUser(data);
|
||||
ChatUtility.onNotifyUser(socketData);
|
||||
}
|
||||
else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_user_ui_notifications", data: data
|
||||
msg: "msg_user_ui_notifications", data: socketData
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static onNotifyUser(data) {
|
||||
if (game.user.id == data.userId) {
|
||||
switch (data.level) {
|
||||
case 'warn': ui.notifications.warn(data.message); break;
|
||||
case 'error': ui.notifications.error(data.message); break;
|
||||
default: ui.notifications.info(data.message); break;
|
||||
static onNotifyUser(socketData) {
|
||||
if (game.user.id == socketData.userId) {
|
||||
switch (socketData.level) {
|
||||
case 'warn': ui.notifications.warn(socketData.message); break;
|
||||
case 'error': ui.notifications.error(socketData.message); break;
|
||||
default: ui.notifications.info(socketData.message); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onRemoveMessages(data) {
|
||||
static onRemoveMessages(socketData) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
if (data.part) {
|
||||
const toDelete = game.messages.filter(it => it.data.content.includes(data.part));
|
||||
if (socketData.part) {
|
||||
const toDelete = game.messages.filter(it => it.content.includes(socketData.part));
|
||||
toDelete.forEach(it => it.delete());
|
||||
}
|
||||
if (data.messageId) {
|
||||
game.messages.get(data.messageId)?.delete();
|
||||
if (socketData.messageId) {
|
||||
game.messages.get(socketData.messageId)?.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static onRemoveMessages(data) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
if (data.part) {
|
||||
const toDelete = game.messages.filter(it => it.content.includes(data.part));
|
||||
toDelete.forEach(it => it.delete());
|
||||
}
|
||||
if (data.messageId) {
|
||||
game.messages.get(data.messageId)?.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
|
||||
static removeMessages(data) {
|
||||
static removeMessages(socketData) {
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
ChatUtility.onRemoveMessages(data);
|
||||
ChatUtility.onRemoveMessages(socketData);
|
||||
}
|
||||
else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_delete_chat_message", data: data });
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, { msg: "msg_delete_chat_message", data: socketData });
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,7 +129,7 @@ export class ChatUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return Misc.getUsers().filter(filter).map(user => user.data._id);
|
||||
return Misc.getUsers().filter(filter).map(user => user.id);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -154,17 +142,17 @@ export class ChatUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static handleGMChatMessage(data) {
|
||||
console.log("blindMessageToGM", data);
|
||||
static handleGMChatMessage(socketData) {
|
||||
console.log("blindMessageToGM", socketData);
|
||||
if (game.user.isGM) { // message privé pour GM only
|
||||
data.user = game.user.id;
|
||||
ChatMessage.create(data);
|
||||
socketData.user = game.user.id;
|
||||
ChatMessage.create(socketData);
|
||||
}
|
||||
}
|
||||
|
||||
static async setMessageData(chatMessage, key, data) {
|
||||
if (data) {
|
||||
await chatMessage.setFlag(SYSTEM_RDD, key, JSON.stringify(data));
|
||||
static async setMessageData(chatMessage, key, flag) {
|
||||
if (flag) {
|
||||
await chatMessage.setFlag(SYSTEM_RDD, key, JSON.stringify(flag));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,3 +3,7 @@ export const SYSTEM_SOCKET_ID = 'system.foundryvtt-reve-de-dragon';
|
||||
|
||||
export const HIDE_DICE = 'hide';
|
||||
export const SHOW_DICE = 'show';
|
||||
|
||||
export const ENTITE_INCARNE = 'incarne';
|
||||
export const ENTITE_NONINCARNE = 'nonincarne';
|
||||
export const ENTITE_BLURETTE = 'blurette';
|
||||
|
@ -10,7 +10,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
const signe = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
|
||||
let dialogData = {
|
||||
signe: signe,
|
||||
tmrs: TMRUtility.listSelectedTMR(signe.data.typesTMR ?? []),
|
||||
tmrs: TMRUtility.listSelectedTMR(signe.system.typesTMR ?? []),
|
||||
actors: game.actors.filter(actor => actor.isHautRevant()).map(actor => {
|
||||
let actorData = duplicate(actor);
|
||||
actorData.selected = actor.hasPlayerOwner;
|
||||
@ -38,7 +38,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
}
|
||||
|
||||
async _onCreerSigneActeurs() {
|
||||
await $("[name='signe.data.ephemere']").change();
|
||||
await $("[name='signe.system.ephemere']").change();
|
||||
await $(".signe-xp-sort").change();
|
||||
this.validerSigne();
|
||||
this.dialogData.actors.filter(it => it.selected).map(it => game.actors.get(it._id))
|
||||
@ -58,21 +58,21 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
|
||||
validerSigne() {
|
||||
this.dialogData.signe.name = $("[name='signe.name']").val();
|
||||
this.dialogData.signe.data.valeur.norm = $("[name='signe.data.valeur.norm']").val();
|
||||
this.dialogData.signe.data.valeur.sign = $("[name='signe.data.valeur.sign']").val();
|
||||
this.dialogData.signe.data.valeur.part = $("[name='signe.data.valeur.part']").val();
|
||||
this.dialogData.signe.data.difficulte = $("[name='signe.data.difficulte']").val();
|
||||
this.dialogData.signe.data.ephemere = $("[name='signe.data.ephemere']").prop("checked");
|
||||
this.dialogData.signe.data.duree = $("[name='signe.data.duree']").val();
|
||||
this.dialogData.signe.data.typesTMR = $(".select-tmr").val();
|
||||
this.dialogData.signe.system.valeur.norm = $("[name='signe.system.valeur.norm']").val();
|
||||
this.dialogData.signe.system.valeur.sign = $("[name='signe.system.valeur.sign']").val();
|
||||
this.dialogData.signe.system.valeur.part = $("[name='signe.system.valeur.part']").val();
|
||||
this.dialogData.signe.system.difficulte = $("[name='signe.system.difficulte']").val();
|
||||
this.dialogData.signe.system.ephemere = $("[name='signe.system.ephemere']").prop("checked");
|
||||
this.dialogData.signe.system.duree = $("[name='signe.system.duree']").val();
|
||||
this.dialogData.signe.system.typesTMR = $(".select-tmr").val();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
this.setEphemere(this.dialogData.signe.data.ephemere);
|
||||
this.setEphemere(this.dialogData.signe.system.ephemere);
|
||||
html.find(".signe-aleatoire").click(event => this.setSigneAleatoire());
|
||||
html.find("[name='signe.data.ephemere']").change((event) => this.setEphemere(event.currentTarget.checked));
|
||||
html.find("[name='signe.system.ephemere']").change((event) => this.setEphemere(event.currentTarget.checked));
|
||||
html.find(".select-actor").change((event) => this.onSelectActor(event));
|
||||
html.find(".signe-xp-sort").change((event) => this.onValeurXpSort(event));
|
||||
}
|
||||
@ -81,19 +81,19 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique({ephemere: true});
|
||||
|
||||
$("[name='signe.name']").val(newSigne.name);
|
||||
$("[name='signe.data.valeur.norm']").val(newSigne.data.valeur.norm);
|
||||
$("[name='signe.data.valeur.sign']").val(newSigne.data.valeur.sign);
|
||||
$("[name='signe.data.valeur.part']").val(newSigne.data.valeur.part);
|
||||
$("[name='signe.data.difficulte']").val(newSigne.data.difficulte);
|
||||
$("[name='signe.data.duree']").val(newSigne.data.duree);
|
||||
$("[name='signe.data.ephemere']").prop("checked", newSigne.data.ephemere);
|
||||
$(".select-tmr").val(newSigne.data.typesTMR);
|
||||
this.setEphemere(newSigne.data.ephemere);
|
||||
$("[name='signe.system.valeur.norm']").val(newSigne.system.valeur.norm);
|
||||
$("[name='signe.system.valeur.sign']").val(newSigne.system.valeur.sign);
|
||||
$("[name='signe.system.valeur.part']").val(newSigne.system.valeur.part);
|
||||
$("[name='signe.system.difficulte']").val(newSigne.system.difficulte);
|
||||
$("[name='signe.system.duree']").val(newSigne.system.duree);
|
||||
$("[name='signe.system.ephemere']").prop("checked", newSigne.system.ephemere);
|
||||
$(".select-tmr").val(newSigne.system.typesTMR);
|
||||
this.setEphemere(newSigne.system.ephemere);
|
||||
}
|
||||
|
||||
async setEphemere(ephemere) {
|
||||
this.dialogData.signe.data.ephemere = ephemere;
|
||||
HtmlUtility._showControlWhen($(".signe-data-duree"), ephemere);
|
||||
this.dialogData.signe.system.ephemere = ephemere;
|
||||
HtmlUtility._showControlWhen($(".signe-system-duree"), ephemere);
|
||||
}
|
||||
|
||||
async onSelectActor(event) {
|
||||
@ -111,8 +111,8 @@ export class DialogCreateSigneDraconique extends Dialog {
|
||||
onValeurXpSort(event) {
|
||||
const codeReussite = event.currentTarget.attributes['data-typereussite']?.value ?? 0;
|
||||
const xp = Number(event.currentTarget.value);
|
||||
const oldValeur = this.dialogData.signe.data.valeur;
|
||||
this.dialogData.signe.data.valeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
|
||||
const oldValeur = this.dialogData.signe.system.valeur;
|
||||
this.dialogData.signe.system.valeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
|
||||
}
|
||||
|
||||
}
|
@ -9,7 +9,7 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
let potionData = DialogFabriquerPotion.prepareData(actor, item);
|
||||
|
||||
let conf = {
|
||||
title: `Fabriquer une potion de ${potionData.data.categorie}`,
|
||||
title: `Fabriquer une potion de ${potionData.system.categorie}`,
|
||||
content: await renderTemplate(dialogConfig.html, potionData),
|
||||
default: potionData.buttonName,
|
||||
};
|
||||
@ -25,8 +25,8 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
static prepareData(actor, item) {
|
||||
let potionData = duplicate(item)
|
||||
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.data.quantite);
|
||||
potionData.nbBrins = Math.min(potionData.data.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
|
||||
potionData.nbBrinsSelect = RdDUtility.buildListOptions(1, potionData.system.quantite);
|
||||
potionData.nbBrins = Math.min(potionData.system.quantite, DialogFabriquerPotion.getNombreBrinOptimal(potionData));
|
||||
potionData.buttonName = "Fabriquer";
|
||||
return potionData;
|
||||
}
|
||||
@ -46,9 +46,9 @@ export class DialogFabriquerPotion extends Dialog {
|
||||
}
|
||||
|
||||
static getNombreBrinOptimal(herbeData) {
|
||||
switch (herbeData.data.categorie ?? '') {
|
||||
case "Soin": return 12 - herbeData.data.niveau;
|
||||
case "Repos": return 7 - herbeData.data.niveau;
|
||||
switch (herbeData.system.categorie ?? '') {
|
||||
case "Soin": return 12 - herbeData.system.niveau;
|
||||
case "Repos": return 7 - herbeData.system.niveau;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ export class DialogItemAchat extends Dialog {
|
||||
const actionAchat = venteData.prixLot > 0 ? "Acheter" : "Prendre";
|
||||
const buttons = {};
|
||||
if (isConsommable) {
|
||||
buttons["consommer"] = { label: venteData.item.data.boisson ? "Boire" : "Manger", callback: it => { this.onAchatConsommer(); } }
|
||||
buttons["consommer"] = { label: venteData.item.system.boisson ? "Boire" : "Manger", callback: it => { this.onAchatConsommer(); } }
|
||||
}
|
||||
buttons[actionAchat] = { label: actionAchat, callback: it => { this.onAchat(); } };
|
||||
buttons["decliner"] = { label: "Décliner", callback: it => { } };
|
||||
@ -55,7 +55,7 @@ export class DialogItemAchat extends Dialog {
|
||||
|
||||
static prepareVenteData(buttonAcheter, vendeurId, vendeur, acheteur) {
|
||||
const jsondata = buttonAcheter.attributes['data-jsondata']?.value;
|
||||
const prixLot = buttonAcheter.attributes['data-prixLot']?.value ?? 0;
|
||||
const prixLot = parseInt(buttonAcheter.attributes['data-prixLot']?.value ?? 0);
|
||||
let venteData = {
|
||||
item: JSON.parse(jsondata),
|
||||
vendeurId: vendeurId,
|
||||
|
@ -38,22 +38,22 @@ export class DialogConsommer extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static prepareData(actor, item) {
|
||||
const itemData = duplicate(item);
|
||||
item = duplicate(item);
|
||||
let consommerData = {
|
||||
item: itemData,
|
||||
item: item,
|
||||
cuisine: actor.getCompetence('cuisine'),
|
||||
choix: {
|
||||
doses: 1,
|
||||
seForcer: false,
|
||||
}
|
||||
}
|
||||
switch (itemData.type) {
|
||||
switch (item.type) {
|
||||
case 'nourritureboisson':
|
||||
consommerData.title = itemData.data.boisson ? `${itemData.name}: boire une dose` : `${itemData.name}: manger une portion`;
|
||||
consommerData.buttonName = itemData.data.boisson ? "Boire" : "Manger";
|
||||
consommerData.title = item.system.boisson ? `${item.name}: boire une dose` : `${item.name}: manger une portion`;
|
||||
consommerData.buttonName = item.system.boisson ? "Boire" : "Manger";
|
||||
break;
|
||||
case 'potion':
|
||||
consommerData.title = `${itemData.name}: boire la potion`;
|
||||
consommerData.title = `${item.name}: boire la potion`;
|
||||
consommerData.buttonName = "Boire";
|
||||
break;
|
||||
}
|
||||
@ -61,11 +61,11 @@ export class DialogConsommer extends Dialog {
|
||||
return consommerData;
|
||||
}
|
||||
|
||||
static calculDoses(consommerData) {
|
||||
const doses = consommerData.choix.doses;
|
||||
consommerData.totalSust = Misc.keepDecimals(doses * (consommerData.item.data.sust ?? 0), 2);
|
||||
consommerData.totalDesaltere = consommerData.item.data.boisson
|
||||
? Misc.keepDecimals(doses * (consommerData.item.data.desaltere ?? 0), 2)
|
||||
static calculDoses(consommer) {
|
||||
const doses = consommer.choix.doses;
|
||||
consommer.totalSust = Misc.keepDecimals(doses * (consommer.item.system.sust ?? 0), 2);
|
||||
consommer.totalDesaltere = consommer.item.system.boisson
|
||||
? Misc.keepDecimals(doses * (consommer.item.system.desaltere ?? 0), 2)
|
||||
: 0;
|
||||
}
|
||||
|
||||
|
@ -4,15 +4,14 @@ import { Misc } from "./misc.js";
|
||||
export class DialogItemVente extends Dialog {
|
||||
|
||||
static async create(item, callback) {
|
||||
const itemData = item
|
||||
const quantite = item.isConteneur() ? 1 : itemData.system.quantite;
|
||||
const quantite = item.isConteneur() ? 1 : item.system.quantite;
|
||||
const venteData = {
|
||||
item: itemData,
|
||||
item: item,
|
||||
alias: item.actor?.name ?? game.user.name,
|
||||
vendeurId: item.actor?.id,
|
||||
prixOrigine: itemData.system.cout,
|
||||
prixUnitaire: itemData.system.cout,
|
||||
prixLot: itemData.system.cout,
|
||||
prixOrigine: item.system.cout,
|
||||
prixUnitaire: item.system.cout,
|
||||
prixLot: item.system.cout,
|
||||
tailleLot: 1,
|
||||
quantiteNbLots: quantite,
|
||||
quantiteMaxLots: quantite,
|
||||
|
@ -3,10 +3,9 @@ import { Misc } from "./misc.js";
|
||||
export class DialogSplitItem extends Dialog {
|
||||
|
||||
static async create(item, callback) {
|
||||
const itemData = item
|
||||
const splitData = {
|
||||
item: itemData,
|
||||
choix: { quantite: 1, max: itemData.data.quantite - 1 }
|
||||
item: item,
|
||||
choix: { quantite: 1, max: item.system.quantite - 1 }
|
||||
};
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/dialog-item-split.html`, splitData);
|
||||
return new DialogSplitItem(item, splitData, html, callback)
|
||||
|
@ -1,9 +0,0 @@
|
||||
/* -------------------------------------------- */
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Activate chat listeners defined
|
||||
// Hooks.on('renderChatLog', (log, html, data) => {
|
||||
// RdDUtility.chatListeners(html);
|
||||
// });
|
||||
|
@ -19,18 +19,16 @@ const nomCategorieParade = {
|
||||
/* -------------------------------------------- */
|
||||
export class RdDItemArme extends Item {
|
||||
|
||||
static isArme(itemData) {
|
||||
itemData = itemData
|
||||
return (itemData.type == 'competencecreature' && itemData.system.iscombat) || itemData.type == 'arme';
|
||||
static isArme(item) {
|
||||
return (item.type == 'competencecreature' && item.system.iscombat) || item.type == 'arme';
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getArmeData(armeData) {
|
||||
armeData = armeData
|
||||
switch (armeData ? armeData.type : '') {
|
||||
case 'arme': return armeData;
|
||||
static getArme(arme) {
|
||||
switch (arme ? arme.type : '') {
|
||||
case 'arme': return arme;
|
||||
case 'competencecreature':
|
||||
return RdDItemCompetenceCreature.toArme(armeData);
|
||||
return RdDItemCompetenceCreature.toActionArme(arme);
|
||||
}
|
||||
return RdDItemArme.mainsNues();
|
||||
}
|
||||
@ -160,18 +158,18 @@ export class RdDItemArme extends Item {
|
||||
return armeData;
|
||||
}
|
||||
|
||||
static isArmeUtilisable(itemData) {
|
||||
return itemData.type == 'arme' && itemData.system.equipe && (itemData.system.resistance > 0 || itemData.system.portee_courte > 0);
|
||||
static isArmeUtilisable(arme) {
|
||||
return arme.type == 'arme' && arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0);
|
||||
}
|
||||
|
||||
static ajoutCorpsACorps(armes, competences, carac) {
|
||||
let corpsACorps = competences.find(it => it.name == 'Corps à corps') ?? { system: { niveau: -6 } };
|
||||
let init = RdDCombatManager.calculInitiative(corpsACorps.system.niveau, carac['melee'].value);
|
||||
armes.push(RdDItemArme.mainsNues({ niveau: corpsACorps.system.niveau, initiative: init }));
|
||||
//armes.push(RdDItemArme.empoignade({ niveau: corpsACorps.data.niveau, initiative: init }));
|
||||
//armes.push(RdDItemArme.empoignade({ niveau: corpsACorps.system.niveau, initiative: init }));
|
||||
}
|
||||
|
||||
static corpsACorps(actorData) {
|
||||
static corpsACorps(mainsNuesActor) {
|
||||
const corpsACorps = {
|
||||
name: 'Corps à corps',
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/competence_corps_a_corps.webp',
|
||||
@ -186,20 +184,20 @@ export class RdDItemArme extends Item {
|
||||
categorie_parade: 'sans-armes'
|
||||
}
|
||||
};
|
||||
mergeObject(corpsACorps.system, actorData ??{}, { overwrite: false });
|
||||
mergeObject(corpsACorps.system, mainsNuesActor ?? {}, { overwrite: false });
|
||||
return corpsACorps;
|
||||
}
|
||||
|
||||
static mainsNues(actorData) {
|
||||
const mainsNues = RdDItemArme.corpsACorps(actorData)
|
||||
static mainsNues(mainsNuesActor) {
|
||||
const mainsNues = RdDItemArme.corpsACorps(mainsNuesActor)
|
||||
mainsNues.name = 'Mains nues'
|
||||
mainsNues.system.cac = 'pugilat'
|
||||
mainsNues.system.baseInit = 4
|
||||
return mainsNues;
|
||||
}
|
||||
|
||||
static empoignade(actorData) {
|
||||
const empoignade = RdDItemArme.corpsACorps(actorData)
|
||||
static empoignade(mainsNuesActor) {
|
||||
const empoignade = RdDItemArme.corpsACorps(mainsNuesActor)
|
||||
empoignade.name = 'Empoignade'
|
||||
empoignade.system.cac = 'empoignade'
|
||||
empoignade.system.baseInit = 3
|
||||
|
@ -183,35 +183,38 @@ export class RdDItemCompetence extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static levelUp(itemData, stressTransforme) {
|
||||
itemData.system.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.system.niveau);
|
||||
const xpManquant = itemData.system.xpNext - itemData.system.xp;
|
||||
itemData.system.isLevelUp = xpManquant <= 0;
|
||||
itemData.system.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && itemData.system.niveau < itemData.system.niveau_archetype);
|
||||
itemData.system.stressXpMax = 0;
|
||||
if (xpManquant > 0 && stressTransforme > 0 && itemData.system.niveau < itemData.system.niveau_archetype) {
|
||||
itemData.system.stressXpMax = Math.min(xpManquant , stressTransforme);
|
||||
static levelUp(item, stressTransforme) {
|
||||
item.system.xpNext = RdDItemCompetence.getCompetenceNextXp(item.system.niveau);
|
||||
const xpManquant = item.system.xpNext - item.system.xp;
|
||||
item.system.isLevelUp = xpManquant <= 0;
|
||||
item.system.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && item.system.niveau < item.system.niveau_archetype);
|
||||
item.system.stressXpMax = 0;
|
||||
if (xpManquant > 0 && stressTransforme > 0 && item.system.niveau < item.system.niveau_archetype) {
|
||||
item.system.stressXpMax = Math.min(xpManquant , stressTransforme);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isVisible(itemData) {
|
||||
return Number(itemData.data.niveau) != RdDItemCompetence.getNiveauBase(itemData.data.categorie);
|
||||
static isVisible(item) {
|
||||
return Number(item.system.niveau) != RdDItemCompetence.getNiveauBase(item.system.categorie);
|
||||
}
|
||||
|
||||
static nomContientTexte(itemData, texte) {
|
||||
return Grammar.toLowerCaseNoAccent(itemData.name).includes(Grammar.toLowerCaseNoAccent(texte))
|
||||
static nomContientTexte(item, texte) {
|
||||
return Grammar.toLowerCaseNoAccent(item.name).includes(Grammar.toLowerCaseNoAccent(texte))
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isNiveauBase(itemData) {
|
||||
return Number(itemData.system.niveau) == RdDItemCompetence.getNiveauBase(itemData.system.categorie);
|
||||
static isNiveauBase(item) {
|
||||
return Number(item.system.niveau) == RdDItemCompetence.getNiveauBase(item.system.categorie);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static findCompetence(list, idOrName, options = {}) {
|
||||
if (idOrName == undefined) {
|
||||
return undefined;
|
||||
}
|
||||
options = mergeObject(options, {
|
||||
filter: it => RdDItemCompetence.isCompetence(it),
|
||||
preFilter: it => RdDItemCompetence.isCompetence(it),
|
||||
description: 'compétence',
|
||||
});
|
||||
return list.find(it => it.id == idOrName && RdDItemCompetence.isCompetence(it))
|
||||
|
@ -11,12 +11,12 @@ export class RdDItemCompetenceCreature extends Item {
|
||||
rollData.competence.system.categorie = "creature"
|
||||
rollData.selectedCarac = rollData.carac.carac_creature
|
||||
if (rollData.competence.system.iscombat) {
|
||||
rollData.arme = RdDItemCompetenceCreature.toArme(rollData.competence);
|
||||
rollData.arme = RdDItemCompetenceCreature.toActionArme(rollData.competence);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static toArme(item) {
|
||||
static toActionArme(item) {
|
||||
if (RdDItemCompetenceCreature.isCompetenceAttaque(item)) {
|
||||
// si c'est un Item compétence: cloner pour ne pas modifier lma compétence
|
||||
let arme = (item instanceof Item) ? item.clone(): item;
|
||||
@ -28,23 +28,22 @@ export class RdDItemCompetenceCreature extends Item {
|
||||
dommagesReels: arme.system.dommages,
|
||||
penetration: 0,
|
||||
force: 0,
|
||||
rapide: true
|
||||
rapide: true,
|
||||
action: 'attaque'
|
||||
});
|
||||
return arme;
|
||||
}
|
||||
console.error("RdDItemCompetenceCreature.toArme(", item, ") : impossible de transformer l'Item en arme");
|
||||
console.error("RdDItemCompetenceCreature.toActionArme(", item, ") : impossible de transformer l'Item en arme");
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isCompetenceAttaque(itemData) {
|
||||
itemData = itemData
|
||||
return itemData.type == 'competencecreature' && itemData.system.iscombat;
|
||||
static isCompetenceAttaque(item) {
|
||||
return item.type == 'competencecreature' && item.system.iscombat;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isCompetenceParade(itemData) {
|
||||
itemData = itemData
|
||||
return itemData.type == 'competencecreature' && itemData.system.isparade;
|
||||
static isCompetenceParade(item) {
|
||||
return item.type == 'competencecreature' && item.system.isparade;
|
||||
}
|
||||
}
|
||||
|
@ -1,52 +1,60 @@
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
const monnaiesData = [
|
||||
const MONNAIES_STANDARD = [
|
||||
{
|
||||
name: "Etain (1 denier)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_etain_poisson.webp",
|
||||
data: { quantite: 0, valeur_deniers: 1, encombrement: 0.001, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 1, encombrement: 0.001, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Bronze (10 deniers)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_bronze_epees.webp",
|
||||
data: { quantite: 0, valeur_deniers: 10, encombrement: 0.002, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 10, encombrement: 0.002, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Argent (1 sol)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_argent_sol.webp",
|
||||
data: { quantite: 0, valeur_deniers: 100, encombrement: 0.003, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 100, encombrement: 0.003, description: "" }
|
||||
},
|
||||
{
|
||||
name: "Or (10 sols)", type: 'monnaie',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/piece_or_sol.webp",
|
||||
data: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" }
|
||||
system: { quantite: 0, valeur_deniers: 1000, encombrement: 0.004, description: "" }
|
||||
}
|
||||
]
|
||||
const VALEURS_STANDARDS = MONNAIES_STANDARD.map(it =>it.system.valeur_deniers);
|
||||
|
||||
export class Monnaie {
|
||||
|
||||
static isSystemMonnaie(item) {
|
||||
let present = monnaiesData.find(monnaie => monnaie.system.valeur_deniers == item?.system?.valeur_deniers);
|
||||
return present;
|
||||
static isSystemMonnaie(item, items) {
|
||||
if (item.type == 'monnaie') {
|
||||
const valeur = item.system.valeur_deniers;
|
||||
if (VALEURS_STANDARDS.includes(valeur)) {
|
||||
const monnaiesDeValeur = items.filter(it => it.type == 'monnaie' && it.system.valeur_deniers == valeur)
|
||||
return monnaiesDeValeur.length<=1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static monnaiesData() {
|
||||
return monnaiesData;
|
||||
return MONNAIES_STANDARD;
|
||||
}
|
||||
|
||||
static filtrerMonnaies(items) {
|
||||
return items.filter(it => it.type == 'monnaie');
|
||||
}
|
||||
|
||||
static monnaiesManquantes(items) {
|
||||
const valeurs = Monnaie.filtrerMonnaies(items)
|
||||
.map(it => it.system.valeur_deniers);
|
||||
const manquantes = monnaiesData.filter(monnaie => !valeurs.find(v => v != monnaie.system?.valeur_deniers))
|
||||
return []; //manquantes;
|
||||
static monnaiesManquantes(disponibles) {
|
||||
const manquantes = MONNAIES_STANDARD.filter(standard => !disponibles.find(disponible => Monnaie.deValeur(disponible, standard.system?.valeur_deniers)));
|
||||
if (manquantes.length > 0) {
|
||||
console.error('monnaiesManquantes', manquantes, ' avec monnaies', disponibles, MONNAIES_STANDARD);
|
||||
}
|
||||
return manquantes;
|
||||
}
|
||||
|
||||
static deValeur(monnaie, v) {
|
||||
return v != monnaie.system.valeur_deniers
|
||||
static deValeur(monnaie, valeur) {
|
||||
return valeur == monnaie.system.valeur_deniers
|
||||
}
|
||||
|
||||
static arrondiDeniers(sols) {
|
||||
|
@ -32,7 +32,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
let buttons = super._getHeaderButtons();
|
||||
// Add "Post to chat" button
|
||||
// We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry!
|
||||
if ("cout" in this.object.system && this.object.isVideOuNonConteneur()) {
|
||||
if ("cout" in this.item.system && this.item.isVideOuNonConteneur()) {
|
||||
buttons.unshift({
|
||||
class: "vendre",
|
||||
icon: "fas fa-comments-dollar",
|
||||
@ -61,22 +61,24 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
let formData = {
|
||||
id: this.object.id,
|
||||
title: this.object.name,
|
||||
type: this.object.type,
|
||||
img: this.object.img,
|
||||
name: this.object.name,
|
||||
data: this.object.system,
|
||||
id: this.item.id,
|
||||
title: this.item.name,
|
||||
type: this.item.type,
|
||||
img: this.item.img,
|
||||
name: this.item.name,
|
||||
system: this.item.system,
|
||||
// TODO: v10 remove
|
||||
data: this.item.system,
|
||||
isGM: game.user.isGM,
|
||||
actorId: this.actor?.id,
|
||||
owner: this.document.isOwner,
|
||||
owner: this.item.isOwner,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
isSoins: false
|
||||
}
|
||||
if (this.actor) {
|
||||
formData.isOwned = true;
|
||||
if (this.object.type == 'conteneur') {
|
||||
if (this.item.type == 'conteneur') {
|
||||
this.prepareConteneurData(formData);
|
||||
}
|
||||
}
|
||||
@ -92,20 +94,20 @@ export class RdDItemSheet extends ItemSheet {
|
||||
console.log(formData.competences)
|
||||
}
|
||||
if (formData.type == 'recettealchimique') {
|
||||
RdDAlchimie.processManipulation(objectData, this.actor && this.actor.id);
|
||||
RdDAlchimie.processManipulation(this.item, this.actor && this.actor.id);
|
||||
}
|
||||
if (formData.type == 'gemme') {
|
||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||
RdDGemme.calculDataDerivees(formData.data);
|
||||
RdDGemme.calculDataDerivees(this.item);
|
||||
}
|
||||
if (formData.type == 'potion') {
|
||||
if (this.dateUpdated) {
|
||||
formData.data.prdate = this.dateUpdated;
|
||||
formData.system.prdate = this.dateUpdated;
|
||||
this.dateUpdated = undefined;
|
||||
}
|
||||
RdDHerbes.updatePotionData(formData);
|
||||
}
|
||||
if (formData.isOwned && formData.type == 'herbe' && (formData.data.categorie == 'Soin' || formData.data.categorie == 'Repos')) {
|
||||
if (formData.isOwned && formData.type == 'herbe' && (formData.system.categorie == 'Soin' || formData.system.categorie == 'Repos')) {
|
||||
formData.isIngredientPotionBase = true;
|
||||
}
|
||||
formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
|
||||
@ -119,7 +121,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
RdDUtility.filterEquipementParType(formData)
|
||||
|
||||
this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets);
|
||||
formData.subItems = formData.conteneurs.find(it => it._id == this.object.id)?.subItems;
|
||||
formData.subItems = formData.conteneurs.find(it => it._id == this.item.id)?.subItems;
|
||||
|
||||
}
|
||||
|
||||
@ -128,15 +130,15 @@ export class RdDItemSheet extends ItemSheet {
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
if (this.object.type == 'conteneur') {
|
||||
if (this.item.type == 'conteneur') {
|
||||
this.form.ondragstart = (event) => this._onDragStart(event);
|
||||
this.form.ondrop = (event) => this._onDrop(event);
|
||||
}
|
||||
|
||||
let itemSheetDialog = this;
|
||||
|
||||
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.object.isOwned);
|
||||
HtmlUtility._showControlWhen($(".item-magique"), this.object.isMagique());
|
||||
HtmlUtility._showControlWhen($(".item-cout"), ReglesOptionelles.isUsing('afficher-prix-joueurs') || game.user.isGM || !this.item.isOwned);
|
||||
HtmlUtility._showControlWhen($(".item-magique"), this.item.isMagique());
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
@ -145,8 +147,8 @@ export class RdDItemSheet extends ItemSheet {
|
||||
html.find(".categorie").change(event => this._onSelectCategorie(event));
|
||||
|
||||
html.find('.sheet-competence-xp').change((event) => {
|
||||
if (this.object.data.type == 'competence') {
|
||||
RdDUtility.checkThanatosXP(this.object.data.name);
|
||||
if (this.item.type == 'competence') {
|
||||
RdDUtility.checkThanatosXP(this.item.name);
|
||||
}
|
||||
});
|
||||
|
||||
@ -195,7 +197,8 @@ export class RdDItemSheet extends ItemSheet {
|
||||
});
|
||||
html.find('.item-delete').click(async event => {
|
||||
const li = RdDSheetUtility.getEventElement(event);
|
||||
RdDUtility.confirmerSuppression(this, li);
|
||||
const item = this.actor.getObjet(li.data("item-id"));
|
||||
RdDUtility.confirmerSuppressionItem(this, item, li);
|
||||
});
|
||||
html.find('.item-vendre').click(async event => {
|
||||
const item = RdDSheetUtility.getItem(event, this.actor);
|
||||
@ -219,16 +222,16 @@ export class RdDItemSheet extends ItemSheet {
|
||||
async _onSelectCategorie(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (this.object.isCompetence()) {
|
||||
if (this.item.isCompetence()) {
|
||||
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
|
||||
this.object.system.base = level;
|
||||
this.item.system.base = level;
|
||||
$("#base").val(level);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
get template() {
|
||||
let type = this.object.type
|
||||
let type = this.item.type
|
||||
return `systems/foundryvtt-reve-de-dragon/templates/item-${type}-sheet.html`;
|
||||
}
|
||||
|
||||
@ -239,7 +242,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
// Données de bonus de cases ?
|
||||
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
|
||||
|
||||
return this.object.update(formData);
|
||||
return this.item.update(formData);
|
||||
}
|
||||
|
||||
async _onDragStart(event) {
|
||||
@ -252,28 +255,28 @@ export class RdDItemSheet extends ItemSheet {
|
||||
const dragData = {
|
||||
actorId: this.actor.id,
|
||||
type: "Item",
|
||||
data: item.data
|
||||
data: item.system
|
||||
};
|
||||
|
||||
event.dataTransfer.setData("text/plain", JSON.stringify(dragData));
|
||||
}
|
||||
|
||||
async _onDrop(event) {
|
||||
// Try to extract the data
|
||||
let data;
|
||||
// Try to extract the dragData
|
||||
let dragData;
|
||||
try {
|
||||
data = JSON.parse(event.dataTransfer.getData('text/plain'));
|
||||
dragData = JSON.parse(event.dataTransfer.getData('text/plain'));
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const allowed = Hooks.call("dropActorSheetData", this.actor, this, data);
|
||||
const allowed = Hooks.call("dropActorSheetData", this.actor, this, dragData);
|
||||
if (allowed === false) return;
|
||||
|
||||
// Handle different data types
|
||||
switch (data.type) {
|
||||
// Handle different dragData types
|
||||
switch (dragData.type) {
|
||||
case "Item":
|
||||
return this._onDropItem(event, data);
|
||||
return this._onDropItem(event, dragData);
|
||||
}
|
||||
return super._onDrop(event);
|
||||
}
|
||||
@ -281,7 +284,7 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
async _onDropItem(event, dragData) {
|
||||
if (this.actor) {
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(this.object.id, this.actor.id, dragData, this.objetVersConteneur);
|
||||
const dropParams = RdDSheetUtility.prepareItemDropParameters(this.item.id, this.actor.id, dragData, this.objetVersConteneur);
|
||||
await this.actor.processDropItem(dropParams);
|
||||
await this.render(true);
|
||||
}
|
||||
|
@ -40,17 +40,17 @@ export class RdDSigneDraconiqueItemSheet extends ItemSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const formData = duplicate(this.object);
|
||||
const formData = duplicate(this.item);
|
||||
mergeObject(formData, {
|
||||
title: formData.name,
|
||||
isGM: game.user.isGM,
|
||||
owner: this.document.isOwner,
|
||||
owner: this.actor.isOwner,
|
||||
isOwned: this.actor ? true : false,
|
||||
actorId: this.actor?.id,
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
});
|
||||
formData.tmrs = TMRUtility.listSelectedTMR(formData.data.typesTMR ?? []);
|
||||
formData.tmrs = TMRUtility.listSelectedTMR(formData.system.typesTMR ?? []);
|
||||
return formData;
|
||||
}
|
||||
|
||||
@ -68,21 +68,21 @@ export class RdDSigneDraconiqueItemSheet extends ItemSheet {
|
||||
|
||||
async setSigneAleatoire() {
|
||||
const newSigne = await RdDItemSigneDraconique.randomSigneDraconique();
|
||||
this.object.update(newSigne);
|
||||
this.item.update(newSigne);
|
||||
}
|
||||
|
||||
async onSelectTmr(event) {
|
||||
event.preventDefault();
|
||||
const selectedTMR = $(".select-tmr").val();
|
||||
this.object.update({ 'data.typesTMR': selectedTMR });
|
||||
this.item.update({ 'system.typesTMR': selectedTMR });
|
||||
}
|
||||
|
||||
async onValeurXpSort(event) {
|
||||
const codeReussite = event.currentTarget.attributes['data-typereussite']?.value ?? 0;
|
||||
const xp = Number(event.currentTarget.value);
|
||||
const oldValeur = this.object.system.valeur;
|
||||
const oldValeur = this.item.system.valeur;
|
||||
const newValeur = RdDItemSigneDraconique.calculValeursXpSort(codeReussite, xp, oldValeur);
|
||||
await this.object.update({ 'data.valeur': newValeur });
|
||||
await this.item.update({ 'system.valeur': newValeur });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -18,13 +18,12 @@ const DIFFICULTE_LECTURE_SIGNE_MANQUE = +11;
|
||||
export class RdDItemSigneDraconique {
|
||||
|
||||
static prepareSigneDraconiqueMeditation(meditation, rolled) {
|
||||
meditation = meditation
|
||||
return {
|
||||
name: "de la " + meditation.name,
|
||||
type: "signedraconique",
|
||||
img: meditation.img,
|
||||
data: {
|
||||
typesTMR: [TMRUtility.typeTmrName(meditation.data.tmr)],
|
||||
system: {
|
||||
typesTMR: [TMRUtility.typeTmrName(meditation.system.tmr)],
|
||||
difficulte: rolled.isSuccess ? RdDItemSigneDraconique.getDiffSigneMeditation(rolled.code) : DIFFICULTE_LECTURE_SIGNE_MANQUE,
|
||||
ephemere: true,
|
||||
duree: "1 round",
|
||||
@ -75,7 +74,7 @@ export class RdDItemSigneDraconique {
|
||||
name: await RdDItemSigneDraconique.randomSigneDescription(),
|
||||
type: "signedraconique",
|
||||
img: defaultItemImg.signedraconique,
|
||||
data: {
|
||||
system: {
|
||||
typesTMR: await RdDItemSigneDraconique.randomTmrs(modele.nbCases),
|
||||
ephemere: options?.ephemere == undefined ? RdDDice.rollTotal("1d2") == 2 : options.ephemere,
|
||||
duree: "1 round",
|
||||
|
@ -7,12 +7,12 @@ export class RdDItemSort extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isDifficulteVariable(sort) {
|
||||
return sort && (sort.data.difficulte.toLowerCase() == "variable");
|
||||
return sort && (sort.system.difficulte.toLowerCase() == "variable");
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static isCoutVariable(sort) {
|
||||
return sort && (sort.data.ptreve.toLowerCase() == "variable" || sort.data.ptreve.indexOf("+") >= 0);
|
||||
return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -25,7 +25,7 @@ export class RdDItemSort extends Item {
|
||||
/* -------------------------------------------- */
|
||||
static getDifficulte(sort, variable) {
|
||||
if (sort && !RdDItemSort.isDifficulteVariable(sort)) {
|
||||
return Misc.toInt(sort.data.difficulte);
|
||||
return Misc.toInt(sort.system.difficulte);
|
||||
}
|
||||
return variable;
|
||||
}
|
||||
@ -54,40 +54,40 @@ export class RdDItemSort extends Item {
|
||||
static getBonusCaseList( item, newCase = false ) {
|
||||
// Gestion spéciale case bonus
|
||||
if ( item.type == 'sort') {
|
||||
return this.buildBonusCaseList(item.data.bonuscase, newCase );
|
||||
return this.buildBonusCaseList(item.system.bonuscase, newCase );
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** Met à jour les données de formulaire
|
||||
* si static des bonus de cases sont présents
|
||||
* */
|
||||
static buildBonusCaseStringFromFormData( formData ) {
|
||||
if ( formData.bonusValue ) {
|
||||
let list = [];
|
||||
let caseCheck = {};
|
||||
for(let i=0; i<formData.bonusValue.length; i++) {
|
||||
let coord = formData.caseValue[i] || 'A1';
|
||||
coord = coord.toUpperCase();
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
|
||||
let bonus = formData.bonusValue[i] || 0;
|
||||
if ( bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
/** Met à jour les données de formulaire
|
||||
* si static des bonus de cases sont présents
|
||||
* */
|
||||
static buildBonusCaseStringFromFormData( formData ) {
|
||||
if ( formData.bonusValue ) {
|
||||
let list = [];
|
||||
let caseCheck = {};
|
||||
for(let i=0; i<formData.bonusValue.length; i++) {
|
||||
let coord = formData.caseValue[i] || 'A1';
|
||||
coord = coord.toUpperCase();
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
|
||||
let bonus = formData.bonusValue[i] || 0;
|
||||
if ( bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
}
|
||||
formData.bonusValue = undefined;
|
||||
formData.caseValue = undefined;
|
||||
formData['data.bonuscase'] = list.toString(); // Reset
|
||||
}
|
||||
return formData;
|
||||
formData.bonusValue = undefined;
|
||||
formData.caseValue = undefined;
|
||||
formData.system.bonuscase = list.toString(); // Reset
|
||||
}
|
||||
return formData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static incrementBonusCase( actor, sort, coord ) {
|
||||
let bonusCaseList = this.buildBonusCaseList(sort.data.bonuscase, false);
|
||||
let bonusCaseList = this.buildBonusCaseList(sort.system.bonuscase, false);
|
||||
//console.log("ITEMSORT", sort, bonusCaseList);
|
||||
|
||||
let found = false;
|
||||
@ -106,12 +106,12 @@ export class RdDItemSort extends Item {
|
||||
// Sauvegarde/update
|
||||
let bonuscase = StringList.toString();
|
||||
//console.log("Bonus cae :", bonuscase);
|
||||
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'data.bonuscase': bonuscase }] );
|
||||
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': bonuscase }] );
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getCaseBonus( sort, coord) {
|
||||
let bonusCaseList = this.buildBonusCaseList(sort.data.bonuscase, false);
|
||||
let bonusCaseList = this.buildBonusCaseList(sort.system.bonuscase, false);
|
||||
for( let bc of bonusCaseList) {
|
||||
if (bc.case == coord) { // Case existante
|
||||
return Number(bc.bonus);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { DialogItemVente } from "./dialog-item-vente.js";
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDHerbes } from "./rdd-herbes.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
const typesObjetsEquipement = ["objet", "arme", "armure", "gemme", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"]
|
||||
@ -41,11 +42,11 @@ export const defaultItemImg = {
|
||||
/* -------------------------------------------- */
|
||||
export class RdDItem extends Item {
|
||||
|
||||
constructor(data, context) {
|
||||
if (!data.img) {
|
||||
data.img = defaultItemImg[data.type];
|
||||
constructor(itemData, context) {
|
||||
if (!itemData.img) {
|
||||
itemData.img = defaultItemImg[itemData.type];
|
||||
}
|
||||
super(data, context);
|
||||
super(itemData, context);
|
||||
}
|
||||
|
||||
static getTypeObjetsEquipement() {
|
||||
@ -117,7 +118,7 @@ export class RdDItem extends Item {
|
||||
if (this.isPotion()) {
|
||||
this.prepareDataPotion()
|
||||
}
|
||||
this.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
this.system.actionPrincipale = this.getActionPrincipale({ warnIfNot: false });
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +127,8 @@ export class RdDItem extends Item {
|
||||
this.system.magique = categorie.includes('enchante');
|
||||
if (this.system.magique) {
|
||||
if (categorie.includes('soin') || categorie.includes('repos')) {
|
||||
this.system.puissance = this.system.herbebonus * this.system.pr;
|
||||
// TODO: utiliser calculePointsRepos / calculePointsGuerison
|
||||
this.system.puissance = RdDHerbes.calculePuissancePotion(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -143,24 +145,28 @@ export class RdDItem extends Item {
|
||||
}
|
||||
|
||||
getActionPrincipale(options = { warnIfNot: true }) {
|
||||
if (!this.isConteneur() && (this.system.quantite ?? 0) <= 0) {
|
||||
if (options.warnIfNot) {
|
||||
const warn = options.warnIfNot;
|
||||
switch (this.type) {
|
||||
case 'nourritureboisson': return this._actionOrWarnQuantiteZero(this.boisson ? 'Boire' : 'Manger', warn);
|
||||
case 'potion': return this._actionOrWarnQuantiteZero('Boire', warn);
|
||||
case 'livre': return this._actionOrWarnQuantiteZero('Lire', warn);
|
||||
case 'conteneur': return this._actionOrWarnQuantiteZero('Ouvrir', warn);
|
||||
case 'herbe': return this.isHerbeAPotion() ? this._actionOrWarnQuantiteZero('Décoction', warn) : undefined;
|
||||
case 'queue': case 'ombre': return this.system.refoulement>0 ? 'Refouler' : undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
_actionOrWarnQuantiteZero(actionName, warn){
|
||||
if ((this.system.quantite ?? 0) <= 0) {
|
||||
if (warn) {
|
||||
ui.notifications.warn(`Vous n'avez plus de ${this.name}.`);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
switch (this.type) {
|
||||
case 'nourritureboisson': return this.boisson ? 'Boire' : 'Manger';
|
||||
case 'potion': return 'Boire';
|
||||
case 'livre': return 'Lire';
|
||||
case 'conteneur': return 'Ouvrir';
|
||||
else {
|
||||
return actionName;
|
||||
}
|
||||
if (this.isHerbeAPotion()) { return 'Décoction'; }
|
||||
if (options.warnIfNot) {
|
||||
ui.notifications.warn(`Impossible d'utiliser un ${this.name}, aucune action associée définie.`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
async diminuerQuantite(nombre, options = { diminuerQuantite: true, supprimerSiZero: false }) {
|
||||
@ -180,11 +186,11 @@ export class RdDItem extends Item {
|
||||
}
|
||||
else {
|
||||
ui.notifications.notify(`Il ne vous reste plus de ${this.name}, vous pouvez le supprimer de votre équipement, ou trouver un moyen de vous en procurer.`);
|
||||
await this.update({ "data.quantite": 0 });
|
||||
await this.update({ "system.quantite": 0 });
|
||||
}
|
||||
}
|
||||
else {
|
||||
await this.update({ "data.quantite": reste });
|
||||
await this.update({ "system.quantite": reste });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,22 +198,28 @@ export class RdDItem extends Item {
|
||||
/* -------------------------------------------- */
|
||||
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
|
||||
isEquipementSimilaire(other) {
|
||||
const itemData = this
|
||||
const otherData = other
|
||||
const tplData = this
|
||||
const otherTplData = other
|
||||
if (!this.isEquipement()) return false;
|
||||
if (itemData.type != otherData.type) return false;
|
||||
if (itemData.name != otherData.name) return false;
|
||||
if (tplData.quantite == undefined) return false;
|
||||
|
||||
const differences = Object.entries(tplData).filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key))
|
||||
.filter(([key, value]) => value != otherTplData[key]);
|
||||
if (differences.length > 0) {
|
||||
let message = `Impossible de regrouper les ${itemData.type} ${itemData.name}: `;
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${otherTplData[key]}`;
|
||||
let message = undefined;
|
||||
if (this.type != other.type) {
|
||||
message = `Impossible de regrouper ${this.type} avec ${other.type}`;
|
||||
}
|
||||
else if (this.name != other.name) {
|
||||
message = `Impossible de regrouper ${this.name} avec ${other.name}`;
|
||||
}
|
||||
else if (this.system.quantite == undefined) {
|
||||
message = `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`;
|
||||
}
|
||||
else {
|
||||
const differences = Object.entries(this.system)
|
||||
.filter(([key, value]) => !['quantite', 'encTotal', 'prixTotal', 'cout'].includes(key) && value != other.system[key]);
|
||||
if (differences.length > 0) {
|
||||
message = `Impossible de regrouper les ${this.type} ${this.name}: `;
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${other.system[key]}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (message){
|
||||
ui.notifications.info(message)
|
||||
return false;
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ export class Misc {
|
||||
if (!single) {
|
||||
single = subset[0];
|
||||
const choices = Misc.join(subset.map(it => options.mapper(it)), '<br>');
|
||||
options.info(`Plusieurs choix de ${options.description}s possibles:<br>${choices}<br>Le premier sera choisi: ${mapToValue(single)}`);
|
||||
options.onMessage(`Plusieurs choix de ${options.description}s possibles:<br>${choices}<br>Le premier sera choisi: ${options.mapper(single)}`);
|
||||
}
|
||||
return single;
|
||||
}
|
||||
@ -200,7 +200,7 @@ export class Misc {
|
||||
}
|
||||
value = Grammar.toLowerCaseNoAccent(value);
|
||||
const subset = elements.filter(options.preFilter)
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it)).includes(value));
|
||||
.filter(it => Grammar.toLowerCaseNoAccent(options.mapper(it))?.includes(value));
|
||||
if (subset.length == 0) {
|
||||
options.onMessage(`Pas de ${options.description} correspondant à ${value}`);
|
||||
}
|
||||
|
@ -7,9 +7,9 @@ const matchOperationTerms = new RegExp(/@(\w*){([\w\-]+)}/i);
|
||||
export class RdDAlchimie {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static processManipulation(recetteData, actorId = undefined) {
|
||||
static processManipulation(recette, actorId = undefined) {
|
||||
//console.log("CALLED", recette, recette.isOwned, actorId );
|
||||
let manip = recetteData.data.manipulation;
|
||||
let manip = recette.system.manipulation;
|
||||
let matchArray = manip.match(matchOperations);
|
||||
if (matchArray) {
|
||||
for (let matchStr of matchArray) {
|
||||
@ -17,12 +17,12 @@ export class RdDAlchimie {
|
||||
//console.log("RESULT ", result);
|
||||
if (result[1] && result[2]) {
|
||||
let commande = Misc.upperFirst(result[1]);
|
||||
let replacement = this[`_alchimie${commande}`](recetteData, result[2], actorId);
|
||||
let replacement = this[`_alchimie${commande}`](recette, result[2], actorId);
|
||||
manip = manip.replace(result[0], replacement);
|
||||
}
|
||||
}
|
||||
}
|
||||
recetteData.data.manipulation_update = manip;
|
||||
recette.system.manipulation_update = manip;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
@ -12,23 +12,23 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
static async create(actor, dialogConfig) {
|
||||
|
||||
let data = {
|
||||
let dialogData = {
|
||||
nombres: this.organizeNombres(actor),
|
||||
dates: game.system.rdd.calendrier.getJoursSuivants(10),
|
||||
etat: actor.getEtatGeneral(),
|
||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||
astrologie: RdDItemCompetence.findCompetence(actor.items, 'Astrologie')
|
||||
}
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
|
||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', dialogData);
|
||||
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
||||
if (dialogConfig.options) {
|
||||
mergeObject(options, dialogConfig.options, { overwrite: true });
|
||||
}
|
||||
return new RdDAstrologieJoueur(html, actor, data);
|
||||
return new RdDAstrologieJoueur(html, actor, dialogData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor, data) {
|
||||
constructor(html, actor, dialogData) {
|
||||
|
||||
let myButtons = {
|
||||
saveButton: { label: "Fermer", callback: html => this.quitDialog() }
|
||||
@ -41,7 +41,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
super(dialogConf, dialogOptions);
|
||||
|
||||
this.actor = actor;
|
||||
this.dataNombreAstral = duplicate(data);
|
||||
this.dataNombreAstral = duplicate(dialogData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -63,7 +63,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
requestJetAstrologie() {
|
||||
let data = {
|
||||
let socketData = {
|
||||
id: this.actor.id,
|
||||
carac_vue: this.actor.system.carac['vue'].value,
|
||||
etat: this.dataNombreAstral.etat,
|
||||
@ -73,11 +73,11 @@ export class RdDAstrologieJoueur extends Dialog {
|
||||
userId: game.user.id
|
||||
}
|
||||
if (Misc.isUniqueConnectedGM()) {
|
||||
game.system.rdd.calendrier.requestNombreAstral(data);
|
||||
game.system.rdd.calendrier.requestNombreAstral(socketData);
|
||||
} else {
|
||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||
msg: "msg_request_nombre_astral",
|
||||
data: data
|
||||
data: socketData
|
||||
});
|
||||
}
|
||||
this.close();
|
||||
|
@ -223,9 +223,9 @@ export class RdDCalendrier extends Application {
|
||||
checkMaladie( periode) {
|
||||
for (let actor of game.actors) {
|
||||
if (actor.type == 'personnage') {
|
||||
let maladies = actor.filterItems( item => (item.type == 'maladie' || (item.type == 'poison' && item.data.active) ) && item.data.periodicite.toLowerCase().includes(periode) );
|
||||
let maladies = actor.items.find( item => (item.type == 'maladie' || (item.type == 'poison' && item.system.active) ) && item.system.periodicite.toLowerCase().includes(periode) );
|
||||
for (let maladie of maladies) {
|
||||
if ( maladie.data.identifie) {
|
||||
if ( maladie.system.identifie) {
|
||||
ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
||||
} else {
|
||||
ChatMessage.create({ content: `${actor.name} souffre d'un mal inconnu (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
||||
@ -444,9 +444,9 @@ export class RdDCalendrier extends Application {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
updateDisplay() {
|
||||
let data = this.fillCalendrierData();
|
||||
// Rebuild data
|
||||
let dateHTML = `Jour ${data.jourMois} de ${data.nomMois} (${data.nomSaison})`
|
||||
let calendrier = this.fillCalendrierData();
|
||||
// Rebuild text du calendrier
|
||||
let dateHTML = `Jour ${calendrier.jourMois} de ${calendrier.nomMois} (${calendrier.nomSaison})`
|
||||
if (game.user.isGM) {
|
||||
dateHTML = dateHTML + " - NA: " + (this.getCurrentNombreAstral() ?? "indéterminé");
|
||||
}
|
||||
@ -454,13 +454,13 @@ export class RdDCalendrier extends Application {
|
||||
handle.innerHTML = dateHTML;
|
||||
}
|
||||
for (let heure of document.getElementsByClassName("calendar-heure-texte")) {
|
||||
heure.innerHTML = data.nomHeure;
|
||||
heure.innerHTML = calendrier.nomHeure;
|
||||
}
|
||||
for (const minute of document.getElementsByClassName("calendar-time-disp")) {
|
||||
minute.innerHTML = `${data.minutesRelative} minutes`;
|
||||
minute.innerHTML = `${calendrier.minutesRelative} minutes`;
|
||||
}
|
||||
for (const heureImg of document.getElementsByClassName("calendar-heure-img")) {
|
||||
heureImg.src = data.iconHeure;
|
||||
heureImg.src = calendrier.iconHeure;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -101,35 +101,35 @@ export class RdDCarac {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeCarac(data) {
|
||||
data.carac.force.value = Math.min(data.carac.force.value, parseInt(data.carac.taille.value) + 4);
|
||||
static computeCarac(system) {
|
||||
system.carac.force.value = Math.min(system.carac.force.value, parseInt(system.carac.taille.value) + 4);
|
||||
|
||||
data.carac.derobee.value = Math.floor(parseInt(((21 - data.carac.taille.value)) + parseInt(data.carac.agilite.value)) / 2);
|
||||
let bonusDomKey = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2);
|
||||
system.carac.derobee.value = Math.floor(parseInt(((21 - system.carac.taille.value)) + parseInt(system.carac.agilite.value)) / 2);
|
||||
let bonusDomKey = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2);
|
||||
bonusDomKey = Math.min(Math.max(bonusDomKey, 0), 32); // Clamp de securite
|
||||
|
||||
let tailleData = tableCaracDerivee[bonusDomKey];
|
||||
data.attributs.plusdom.value = tailleData.plusdom;
|
||||
system.attributs.plusdom.value = tailleData.plusdom;
|
||||
|
||||
data.attributs.sconst.value = RdDCarac.calculSConst(data.carac.constitution.value);
|
||||
data.attributs.sust.value = tableCaracDerivee[Number(data.carac.taille.value)].sust;
|
||||
system.attributs.sconst.value = RdDCarac.calculSConst(system.carac.constitution.value);
|
||||
system.attributs.sust.value = tableCaracDerivee[Number(system.carac.taille.value)].sust;
|
||||
|
||||
data.attributs.encombrement.value = (parseInt(data.carac.force.value) + parseInt(data.carac.taille.value)) / 2;
|
||||
data.carac.melee.value = Math.floor((parseInt(data.carac.force.value) + parseInt(data.carac.agilite.value)) / 2);
|
||||
data.carac.tir.value = Math.floor((parseInt(data.carac.vue.value) + parseInt(data.carac.dexterite.value)) / 2);
|
||||
data.carac.lancer.value = Math.floor((parseInt(data.carac.tir.value) + parseInt(data.carac.force.value)) / 2);
|
||||
system.attributs.encombrement.value = (parseInt(system.carac.force.value) + parseInt(system.carac.taille.value)) / 2;
|
||||
system.carac.melee.value = Math.floor((parseInt(system.carac.force.value) + parseInt(system.carac.agilite.value)) / 2);
|
||||
system.carac.tir.value = Math.floor((parseInt(system.carac.vue.value) + parseInt(system.carac.dexterite.value)) / 2);
|
||||
system.carac.lancer.value = Math.floor((parseInt(system.carac.tir.value) + parseInt(system.carac.force.value)) / 2);
|
||||
|
||||
data.sante.vie.max = Math.ceil((parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value)) / 2);
|
||||
system.sante.vie.max = Math.ceil((parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value)) / 2);
|
||||
|
||||
data.sante.vie.value = Math.min(data.sante.vie.value, data.sante.vie.max)
|
||||
data.sante.endurance.max = Math.max(parseInt(data.carac.taille.value) + parseInt(data.carac.constitution.value), parseInt(data.sante.vie.max) + parseInt(data.carac.volonte.value));
|
||||
data.sante.endurance.value = Math.min(data.sante.endurance.value, data.sante.endurance.max);
|
||||
data.sante.fatigue.max = data.sante.endurance.max * 2;
|
||||
data.sante.fatigue.value = Math.min(data.sante.fatigue.value, data.sante.fatigue.max);
|
||||
system.sante.vie.value = Math.min(system.sante.vie.value, system.sante.vie.max)
|
||||
system.sante.endurance.max = Math.max(parseInt(system.carac.taille.value) + parseInt(system.carac.constitution.value), parseInt(system.sante.vie.max) + parseInt(system.carac.volonte.value));
|
||||
system.sante.endurance.value = Math.min(system.sante.endurance.value, system.sante.endurance.max);
|
||||
system.sante.fatigue.max = system.sante.endurance.max * 2;
|
||||
system.sante.fatigue.value = Math.min(system.sante.fatigue.value, system.sante.fatigue.max);
|
||||
|
||||
//Compteurs
|
||||
data.reve.reve.max = data.carac.reve.value;
|
||||
data.compteurs.chance.max = data.carac.chance.value;
|
||||
system.reve.reve.max = system.carac.reve.value;
|
||||
system.compteurs.chance.max = system.carac.chance.value;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { ChatUtility } from "./chat-utility.js";
|
||||
import { HIDE_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { ENTITE_INCARNE, ENTITE_NONINCARNE, HIDE_DICE, SYSTEM_RDD, SYSTEM_SOCKET_ID } from "./constants.js";
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { RdDItemArme } from "./item-arme.js";
|
||||
import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||
@ -26,7 +27,7 @@ const premierRoundInit = [
|
||||
{ pattern: 'epeegnome', init: 5.35 },
|
||||
{ pattern: 'masse', init: 5.30 },
|
||||
{ pattern: 'gourdin', init: 5.25 },
|
||||
{ pattern: 'fléau', init: 5.20 },
|
||||
{ pattern: 'fleau', init: 5.20 },
|
||||
{ pattern: 'dague', init: 5.15 },
|
||||
{ pattern: 'autre', init: 5.10 },
|
||||
];
|
||||
@ -65,7 +66,7 @@ export class RdDCombatManager extends Combat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async finDeRound(options = { terminer: false }) {
|
||||
for (let combatant of this.data.combatants) {
|
||||
for (let combatant of this.combatants) {
|
||||
if (combatant.actor) {
|
||||
await combatant.actor.finDeRound(options);
|
||||
}
|
||||
@ -77,35 +78,30 @@ export class RdDCombatManager extends Combat {
|
||||
|
||||
/************************************************************************************/
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
|
||||
console.log(`${game.data.system.data.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
// Structure input data
|
||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
|
||||
ids = typeof ids === "string" ? [ids] : ids;
|
||||
const currentId = this.combatant._id;
|
||||
// calculate initiative
|
||||
for (let cId = 0; cId < ids.length; cId++) {
|
||||
const combatant = this.combatants.get(ids[cId]);
|
||||
//if (!c) return results;
|
||||
|
||||
let rollFormula = formula; // Init per default
|
||||
if (!rollFormula) {
|
||||
let armeCombat, competence;
|
||||
if (combatant.actor.system.type == 'creature' || combatant.actor.system.type == 'entite') {
|
||||
for (const competenceItemData of combatant.actor.items) {
|
||||
if (competenceItemData.system.iscombat) {
|
||||
competence = duplicate(competenceItemData);
|
||||
}
|
||||
let rollFormula = formula ?? RdDCombatManager.formuleInitiative(2, 10, 0, 0);
|
||||
if (!formula) {
|
||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
||||
const competence = combatant.actor.items.find(it => it.system.iscombat)
|
||||
if (competence) {
|
||||
rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, 0);
|
||||
}
|
||||
rollFormula = "2+( (" + RdDCombatManager.calculInitiative(competence.system.niveau, competence.system.carac_value) + ")/100)";
|
||||
} else {
|
||||
for (const itemData of combatant.actor.items) {
|
||||
if (itemData.type == "arme" && itemData.data.equipe) {
|
||||
armeCombat = duplicate(itemData);
|
||||
}
|
||||
const armeCombat = combatant.actor.itemTypes['arme'].find(it => it.system.equipe)
|
||||
const compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.system.competence;
|
||||
const competence = RdDItemCompetence.findCompetence(combatant.actor.items, compName);
|
||||
if (competence) {
|
||||
const carac = combatant.actor.system.carac[competence.system.defaut_carac].value;
|
||||
const niveau = competence.system.niveau;
|
||||
const bonusEcaille = (armeCombat?.system.magique) ? armeCombat.system.ecaille_efficacite : 0;
|
||||
rollFormula = RdDCombatManager.formuleInitiative(2, carac, niveau, bonusEcaille);
|
||||
}
|
||||
let compName = (armeCombat == undefined) ? "Corps à corps" : armeCombat.system.competence;
|
||||
competence = RdDItemCompetence.findCompetence(combatant.actor.items, compName);
|
||||
let bonusEcaille = (armeCombat && armeCombat.data.magique) ? armeCombat.system.ecaille_efficacite : 0;
|
||||
rollFormula = "2+( (" + RdDCombatManager.calculInitiative(competence.system.niveau, combatant.actor.system.carac[competence.system.defaut_carac].value, bonusEcaille) + ")/100)";
|
||||
}
|
||||
}
|
||||
//console.log("Combatat", c);
|
||||
@ -142,6 +138,10 @@ export class RdDCombatManager extends Combat {
|
||||
return this;
|
||||
};
|
||||
|
||||
static formuleInitiative(rang, carac, niveau, bonusMalus) {
|
||||
return `${rang} +( (${RdDCombatManager.calculInitiative(niveau, carac, bonusMalus)} )/100)`;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculInitiative(niveau, caracValue, bonusEcaille = 0) {
|
||||
let base = niveau + Math.floor(caracValue / 2);
|
||||
@ -150,78 +150,95 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */
|
||||
static finalizeArmeList(armes, competences, carac) {
|
||||
/** Retourne une liste triée d'actions d'armes avec le split arme1 main / arme 2 main */
|
||||
static listActionsArmes(armes, competences, carac) {
|
||||
// Gestion des armes 1/2 mains
|
||||
let armesEquipe = [];
|
||||
let actionsArme = [];
|
||||
for (const arme of armes) {
|
||||
let armeData = duplicate(arme)
|
||||
if (armeData.system.equipe) {
|
||||
let compData = competences.find(c => c.name.toLowerCase() == armeData.system.competence.toLowerCase())
|
||||
let action = duplicate(arme)
|
||||
if (action.system.equipe) {
|
||||
let compData = competences.find(c => c.name == action.system.competence)
|
||||
|
||||
armesEquipe.push(armeData)
|
||||
armeData.system.dommagesReels = Number(armeData.system.dommages)
|
||||
armeData.system.niveau = compData.system.niveau
|
||||
armeData.system.initiative = RdDCombatManager.calculInitiative(compData.system.niveau, carac[compData.system.defaut_carac].value);
|
||||
actionsArme.push(action);
|
||||
action.action = 'attaque';
|
||||
action.system.dommagesReels = Number(action.system.dommages);
|
||||
action.system.niveau = compData.system.niveau;
|
||||
action.system.initiative = RdDCombatManager.calculInitiative(compData.system.niveau, carac[compData.system.defaut_carac].value);
|
||||
// Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence
|
||||
if (armeData.system.unemain && !armeData.system.deuxmains) {
|
||||
armeData.system.mainInfo = "(1m)";
|
||||
} else if (!armeData.system.unemain && armeData.system.deuxmains) {
|
||||
armeData.system.mainInfo = "(2m)";
|
||||
} else if (armeData.system.unemain && armeData.system.deuxmains) {
|
||||
armeData.system.mainInfo = "(1m)";
|
||||
if (action.system.unemain && !action.system.deuxmains) {
|
||||
action.system.mainInfo = "(1m)";
|
||||
} else if (!action.system.unemain && action.system.deuxmains) {
|
||||
action.system.mainInfo = "(2m)";
|
||||
} else if (action.system.unemain && action.system.deuxmains) {
|
||||
action.system.mainInfo = "(1m)";
|
||||
|
||||
const comp2m = armeData.system.competence.replace(" 1 main", " 2 mains"); // Replace !
|
||||
const comp2m = action.system.competence.replace(" 1 main", " 2 mains"); // Replace !
|
||||
const comp = competences.find(c => c.name == comp2m)
|
||||
|
||||
const arme2main = duplicate(armeData)
|
||||
const arme2main = duplicate(action);
|
||||
arme2main.system.mainInfo = "(2m)";
|
||||
arme2main.system.niveau = comp.system.niveau;
|
||||
arme2main.system.competence = comp2m;
|
||||
arme2main.system.initiative = RdDCombatManager.calculInitiative(arme2main.niveau, carac[comp.system.defaut_carac].value)
|
||||
armesEquipe.push(arme2main);
|
||||
const containsSlash = armeData.system.dommages.includes("/");
|
||||
arme2main.system.initiative = RdDCombatManager.calculInitiative(arme2main.system.niveau, carac[comp.system.defaut_carac].value);
|
||||
actionsArme.push(arme2main);
|
||||
const containsSlash = action.system.dommages.includes("/");
|
||||
if (containsSlash) {
|
||||
const tableauDegats = armeData.system.dommages.split("/");
|
||||
armeData.system.dommagesReels = Number(tableauDegats[0]);
|
||||
const tableauDegats = action.system.dommages.split("/");
|
||||
action.system.dommagesReels = Number(tableauDegats[0]);
|
||||
arme2main.system.dommagesReels = Number(tableauDegats[1]);
|
||||
}
|
||||
else{
|
||||
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + armeData.name + " ne sont pas corrects (ie sous la forme X/Y)");
|
||||
ui.notifications.info("Les dommages de l'arme à 1/2 mains " + action.name + " ne sont pas corrects (ie sous la forme X/Y)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return armesEquipe.sort(Misc.ascending(armeData => armeData.name + (armeData.system.mainInfo ?? '')))
|
||||
return actionsArme.sort(Misc.ascending(armeData => armeData.name + (armeData.system.mainInfo ?? '')));
|
||||
}
|
||||
|
||||
static listActionsPossessions(actor) {
|
||||
return RdDCombatManager._indexActions(actor.getPossessions().map(p =>
|
||||
{
|
||||
return {
|
||||
name: p.name,
|
||||
action: 'conjurer',
|
||||
system: {
|
||||
competence: p.name,
|
||||
possessionid: p.system.possessionid,
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildListeActionsCombat(combatant) {
|
||||
if (combatant.actor == undefined) {
|
||||
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
||||
return [];
|
||||
static listActionsCombat(combatant) {
|
||||
const actor = combatant.actor;
|
||||
let actions = RdDCombatManager.listActionsPossessions(actor);
|
||||
if (actions.length>0) {
|
||||
return actions;
|
||||
}
|
||||
const actorData = combatant.actor
|
||||
let items = combatant.actor.items
|
||||
let actions = []
|
||||
if (combatant.actor.isCreature()) {
|
||||
let items = actor.items;
|
||||
if (actor.isCreature()) {
|
||||
actions = actions.concat(items.filter(it => RdDItemCompetenceCreature.isCompetenceAttaque(it))
|
||||
.map(competence => RdDItemCompetenceCreature.toArme(competence)));
|
||||
.map(competence => RdDItemCompetenceCreature.toActionArme(competence)));
|
||||
} else {
|
||||
// Recupération des items 'arme'
|
||||
let armes = items.filter(it => RdDItemArme.isArmeUtilisable(it))
|
||||
//.concat(RdDItemArme.empoignade())
|
||||
.concat(RdDItemArme.mainsNues());
|
||||
|
||||
let competences = items.filter(it => it.type == 'competence')
|
||||
actions = actions.concat(RdDCombatManager.finalizeArmeList(armes, competences, actorData.data.carac));
|
||||
let competences = items.filter(it => it.type == 'competence');
|
||||
actions = actions.concat(RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac));
|
||||
|
||||
if (actorData.data.attributs.hautrevant.value) {
|
||||
actions.push({ name: "Draconic", data: { initOnly: true, competence: "Draconic" } });
|
||||
if (actor.system.attributs.hautrevant.value) {
|
||||
actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } });
|
||||
}
|
||||
}
|
||||
|
||||
actions.push({ name: "Autre action", data: { initOnly: true, competence: "Autre action" } });
|
||||
return RdDCombatManager._indexActions(actions);
|
||||
}
|
||||
|
||||
static _indexActions(actions) {
|
||||
for (let index = 0; index < actions.length; index++) {
|
||||
actions[index].index = index;
|
||||
}
|
||||
@ -232,18 +249,18 @@ export class RdDCombatManager extends Combat {
|
||||
static processPremierRoundInit() {
|
||||
// Check if we have the whole init !
|
||||
if (Misc.isUniqueConnectedGM() && game.combat.current.round == 1) {
|
||||
let initMissing = game.combat.data.combatants.find(it => !it.initiative);
|
||||
let initMissing = game.combat.combatants.find(it => !it.initiative);
|
||||
if (!initMissing) { // Premier round !
|
||||
for (let combatant of game.combat.data.combatants) {
|
||||
let arme = combatant.initiativeData?.arme;
|
||||
for (let combatant of game.combat.combatants) {
|
||||
let action = combatant.initiativeData?.arme;
|
||||
//console.log("Parsed !!!", combatant, initDone, game.combat.current, arme);
|
||||
if (arme && arme.type == "arme") {
|
||||
if (action && action.type == "arme") {
|
||||
for (let initData of premierRoundInit) {
|
||||
if (arme.data.initpremierround.toLowerCase().includes(initData.pattern)) {
|
||||
if (Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround).includes(initData.pattern)) {
|
||||
let msg = `<h4>L'initiative de ${combatant.actor.name} a été modifiée !</h4>
|
||||
<hr>
|
||||
<div>
|
||||
Etant donné son ${arme.name}, son initative pour ce premier round est désormais de ${initData.init}.
|
||||
Etant donné son ${action.name}, son initative pour ce premier round est désormais de ${initData.init}.
|
||||
</div>`
|
||||
ChatMessage.create({ content: msg });
|
||||
game.combat.setInitiative(combatant._id, initData.init);
|
||||
@ -281,7 +298,7 @@ export class RdDCombatManager extends Combat {
|
||||
].concat(options);
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static rollInitiativeCompetence(combatantId, arme) {
|
||||
static rollInitiativeAction(combatantId, action) {
|
||||
const combatant = game.combat.combatants.get(combatantId);
|
||||
if (combatant.actor == undefined) {
|
||||
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
||||
@ -299,34 +316,40 @@ export class RdDCombatManager extends Combat {
|
||||
} else if (combatant.actor.getSurprise() == "demi") {
|
||||
initOffset = 0;
|
||||
initInfo = "Demi Surprise"
|
||||
} else if (arme.name == "Autre action") {
|
||||
} else if (action.action == 'conjurer') {
|
||||
initOffset = 10;
|
||||
caracForInit = combatant.actor.getReveActuel();
|
||||
initInfo = "Possession"
|
||||
} else if (action.action == 'autre') {
|
||||
initOffset = 2;
|
||||
initInfo = "Autre Action"
|
||||
} else if (arme.name == "Draconic") {
|
||||
} else if (action.action == 'haut-reve') {
|
||||
initOffset = 9;
|
||||
initInfo = "Draconic"
|
||||
} else {
|
||||
compData = RdDItemCompetence.findCompetence(combatant.actor.items, arme.system.competence);
|
||||
compNiveau = compData.system.niveau;
|
||||
initInfo = arme.name + " / " + arme.data.competence;
|
||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
||||
caracForInit = compData.system.carac_value;
|
||||
if (compData.system.categorie == "lancer") {
|
||||
initOffset = 7;
|
||||
}
|
||||
else {
|
||||
initOffset = 5;
|
||||
}
|
||||
} else {
|
||||
caracForInit = combatant.actor.system.carac[compData.system.defaut_carac].value;
|
||||
initOffset = RdDCombatManager._baseInitOffset(compData.system.categorie, arme);
|
||||
initInfo = action.name + " / " + action.system.competence;
|
||||
|
||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
||||
caracForInit = compData.system.carac_value;
|
||||
if (compData.system.categorie == "lancer") {
|
||||
initOffset = 7;
|
||||
}
|
||||
else {
|
||||
initOffset = 5;
|
||||
}
|
||||
} else {
|
||||
caracForInit = combatant.actor.system.carac[compData.system.defaut_carac].value;
|
||||
initOffset = RdDCombatManager._baseInitOffset(compData.system.categorie, action);
|
||||
}
|
||||
}
|
||||
|
||||
let malus = combatant.actor.getEtatGeneral(); // Prise en compte état général
|
||||
// Cas des créatures et entités vs personnages
|
||||
let rollFormula = initOffset + "+ ( (" + RdDCombatManager.calculInitiative(compNiveau, caracForInit) + " + " + malus + ") /100)";
|
||||
let rollFormula = RdDCombatManager.formuleInitiative(initOffset, caracForInit, compNiveau, malus);
|
||||
// Garder la trace de l'arme/compétence utilisée pour l'iniative
|
||||
combatant.initiativeData = { arme: arme } // pour reclasser l'init au round 0
|
||||
combatant.initiativeData = { arme: action } // pour reclasser l'init au round 0
|
||||
game.combat.rollInitiative(combatantId, rollFormula, { initInfo: initInfo });
|
||||
}
|
||||
|
||||
@ -338,7 +361,7 @@ export class RdDCombatManager extends Combat {
|
||||
return 7;
|
||||
}
|
||||
// Offset de principe pour les armes de jet
|
||||
switch (arme.data.cac) {
|
||||
switch (arme.system.cac) {
|
||||
case "empoignade": return 3;
|
||||
case "pugilat": return 4;
|
||||
}
|
||||
@ -349,16 +372,21 @@ export class RdDCombatManager extends Combat {
|
||||
static displayInitiativeMenu(html, combatantId) {
|
||||
console.log("Combatant ; ", combatantId);
|
||||
const combatant = game.combat.combatants.get(combatantId);
|
||||
let armesList = RdDCombatManager.buildListeActionsCombat(combatant);
|
||||
if (! (combatant?.actor) ) {
|
||||
ui.notifications.warn(`Le combatant ${combatant.name ?? combatantId} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
||||
return;
|
||||
}
|
||||
|
||||
let actions = RdDCombatManager.listActionsCombat(combatant);
|
||||
|
||||
// Build the relevant submenu
|
||||
if (armesList) {
|
||||
if (actions) {
|
||||
let menuItems = [];
|
||||
for (let arme of armesList) {
|
||||
for (let action of actions) {
|
||||
menuItems.push({
|
||||
name: arme.data.competence,
|
||||
name: action.system.competence,
|
||||
icon: "<i class='fas fa-dice-d6'></i>",
|
||||
callback: target => { RdDCombatManager.rollInitiativeCompetence(combatantId, arme) }
|
||||
callback: target => { RdDCombatManager.rollInitiativeAction(combatantId, action) }
|
||||
});
|
||||
}
|
||||
new ContextMenu(html, ".directory-list", menuItems).render();
|
||||
@ -387,7 +415,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static onUpdateCombat(combat, change, options, userId) {
|
||||
if (combat.data.round != 0 && combat.turns && combat.data.active) {
|
||||
if (combat.round != 0 && combat.turns && combat.active) {
|
||||
RdDCombat.combatNouveauTour(combat);
|
||||
}
|
||||
}
|
||||
@ -427,9 +455,9 @@ export class RdDCombat {
|
||||
: "Vous devez choisir une cible à attaquer!");
|
||||
}
|
||||
else {
|
||||
const defender = target?.actor
|
||||
const defenderTokenId = target?.id
|
||||
if ( defender.type == 'entite' && defender.system.definition.typeentite == 'nonincarne') {
|
||||
const defender = target?.actor;
|
||||
const defenderTokenId = target?.id;
|
||||
if ( defender.type == 'entite' && defender.system.definition.typeentite == ENTITE_NONINCARNE) {
|
||||
ui.notifications.warn("Vous ne pouvez pas cibler une entité non incarnée !!!!");
|
||||
} else {
|
||||
return this.create(attacker, defender, defenderTokenId, target)
|
||||
@ -771,7 +799,7 @@ export class RdDCombat {
|
||||
async _onAttaqueNormale(attackerRoll) {
|
||||
console.log("RdDCombat.onAttaqueNormale >>>", attackerRoll);
|
||||
|
||||
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker.getBonusDegat(), this.defender.isEntiteCauchemar());
|
||||
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker.getBonusDegat(), this.defender.isEntite());
|
||||
let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} }
|
||||
attackerRoll.show = {
|
||||
cible: this.target ? this.defender.system.name : 'la cible',
|
||||
@ -864,8 +892,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_filterArmesParade(defender, competence) {
|
||||
let items = defender.items;
|
||||
items = items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
||||
let items = defender.items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
||||
for (let item of items) {
|
||||
item.system.nbUsage = defender.getItemUse(item.id); // Ajout du # d'utilisation ce round
|
||||
}
|
||||
@ -932,10 +959,10 @@ export class RdDCombat {
|
||||
async parade(attackerRoll, armeParadeId) {
|
||||
const arme = this.defender.getArmeParade(armeParadeId);
|
||||
console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme);
|
||||
const competence = this.system?.competence;
|
||||
const competence = arme?.system?.competence;
|
||||
if (competence == undefined)
|
||||
{
|
||||
console.error("Pas de compétence de parade associée à ", arme) ;
|
||||
console.error("Pas de compétence de parade associée à ", arme?.name, armeParadeId) ;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1116,7 +1143,7 @@ export class RdDCombat {
|
||||
resistance -= perteResistance;
|
||||
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
|
||||
defenderRoll.show.perteResistance = perteResistance;
|
||||
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'data.resistance': resistance }]);
|
||||
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'system.resistance': resistance }]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -1132,7 +1159,7 @@ export class RdDCombat {
|
||||
resistance -= dmg;
|
||||
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
|
||||
defenderRoll.show.perteResistance = dmg;
|
||||
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'data.resistance': resistance }]);
|
||||
this.defender.updateEmbeddedDocuments('Item', [{ _id: defenderRoll.arme._id, 'system.resistance': resistance }]);
|
||||
}
|
||||
}
|
||||
// Si l'arme de parade n'est pas un bouclier, jet de désarmement (p.132)
|
||||
@ -1220,8 +1247,8 @@ export class RdDCombat {
|
||||
async accorderEntite(when = 'avant-encaissement') {
|
||||
if (when != game.settings.get(SYSTEM_RDD, "accorder-entite-cauchemar")
|
||||
|| this.defender == undefined
|
||||
|| !this.defender.isEntiteCauchemar()
|
||||
|| this.defender.isEntiteCauchemarAccordee(this.attacker)) {
|
||||
|| !this.defender.isEntite([ENTITE_INCARNE])
|
||||
|| this.defender.isEntiteAccordee(this.attacker)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1246,7 +1273,7 @@ export class RdDCombat {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async displayActorCombatStatus(combat, actor) {
|
||||
let data = {
|
||||
let formData = {
|
||||
combatId: combat._id,
|
||||
alias: actor.name,
|
||||
etatGeneral: actor.getEtatGeneral(),
|
||||
@ -1258,13 +1285,13 @@ export class RdDCombat {
|
||||
isCritique: false
|
||||
}
|
||||
if (actor.countBlessuresNonSoigneeByName("critiques") > 0) { // Pour éviter le cumul grave + critique
|
||||
data.isCritique = true;
|
||||
formData.isCritique = true;
|
||||
} else if (actor.countBlessuresNonSoigneeByName("graves") > 0) {
|
||||
data.isGrave = true;
|
||||
formData.isGrave = true;
|
||||
}
|
||||
|
||||
ChatUtility.createChatWithRollMode(actor.name, {
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html`, data)
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-summary.html`, formData)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -276,9 +276,11 @@ export class RdDCommands {
|
||||
diff = 0;
|
||||
}
|
||||
const caracName = params[0];
|
||||
const compName = length > 1 ? Misc.join(params.slice(1, length), ' ') : undefined;
|
||||
for (let actor of actors) {
|
||||
await actor.rollCaracCompetence(caracName, compName, diff);
|
||||
let competence = length > 1 ? actors[0].getCompetence(Misc.join(params.slice(1, length), ' ')) : undefined;
|
||||
if (competence) {
|
||||
for (let actor of actors) {
|
||||
await actor.rollCaracCompetence(caracName, competence.name, diff);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -356,7 +358,7 @@ export class RdDCommands {
|
||||
|
||||
async supprimerSignesDraconiquesEphemeres() {
|
||||
game.actors.forEach(actor => {
|
||||
const ephemeres = actor.filterItems(item => item.type = 'signedraconique' && item.system.ephemere)
|
||||
const ephemeres = actor.items.find(item => item.type = 'signedraconique' && item.system.ephemere)
|
||||
.map(item => item.id);
|
||||
if (ephemeres.length > 0) {
|
||||
actor.deleteEmbeddedDocuments("Item", ephemeres);
|
||||
|
@ -3,11 +3,11 @@ import { Misc } from "./misc.js";
|
||||
|
||||
export class RddCompendiumOrganiser {
|
||||
static init() {
|
||||
Hooks.on('renderCompendium', async (pack, html, data) => RddCompendiumOrganiser.onRenderCompendium(pack, html, data))
|
||||
Hooks.on('renderCompendium', async (pack, html, compendiumData) => RddCompendiumOrganiser.onRenderCompendium(pack, html, compendiumData))
|
||||
}
|
||||
|
||||
static async onRenderCompendium(compendium, html, data) {
|
||||
console.log('onRenderCompendium', compendium, html, data);
|
||||
static async onRenderCompendium(compendium, html, compendiumData) {
|
||||
console.log('onRenderCompendium', compendium, html, compendiumData);
|
||||
const pack = compendium.collection
|
||||
if (pack.metadata.system === SYSTEM_RDD) {
|
||||
html.find('.directory-item').each((i, element) => {
|
||||
|
@ -18,18 +18,19 @@ const tableGemmes = {
|
||||
export class RdDGemme extends Item {
|
||||
|
||||
static getGemmeTypeOptionList() {
|
||||
// TODO: look how to map object key-value pairs
|
||||
let options = ""
|
||||
for (let gemmeKey in tableGemmes) {
|
||||
let gemmeData = tableGemmes[gemmeKey];
|
||||
options += `<option value="${gemmeKey}">${gemmeData.label}</option>`
|
||||
options += `<option value="${gemmeKey}">${tableGemmes[gemmeKey].label}</option>`
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
static calculDataDerivees(data) {
|
||||
data.cout = (data.taille * data.purete) + data.qualite;
|
||||
data.inertie = 7 - data.purete;
|
||||
data.enchantabilite = data.taille - data.inertie;
|
||||
|
||||
static calculDataDerivees(gemme) {
|
||||
gemme.system.cout = (gemme.system.taille * gemme.system.purete) + gemme.system.qualite;
|
||||
gemme.system.inertie = 7 - gemme.system.purete;
|
||||
gemme.system.enchantabilite = gemme.system.taille - gemme.system.inertie;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,4 @@
|
||||
/* -------------------------------------------- */
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDCalendrier } from "./rdd-calendrier.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -22,12 +20,11 @@ export class RdDHerbes extends Item {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildHerbesList(listHerbes, max) {
|
||||
static buildHerbesList(listeHerbes, max) {
|
||||
let list = {}
|
||||
for ( let herbe of listHerbes) {
|
||||
let herbeData = herbe.system
|
||||
let brins = max - herbeData.niveau;
|
||||
list[herbe.data.name] = `${herbe.data.name} (Bonus: ${herbeData.niveau}, Brins: ${brins})`;
|
||||
for ( let herbe of listeHerbes) {
|
||||
let brins = max - herbe.system.niveau;
|
||||
list[herbe.system.name] = `${herbe.system.name} (Bonus: ${herbe.system.niveau}, Brins: ${brins})`;
|
||||
}
|
||||
list['Autre'] = 'Autre (Bonus: variable, Brins: variable)'
|
||||
return list;
|
||||
@ -39,36 +36,39 @@ export class RdDHerbes extends Item {
|
||||
formData.herbesRepos = this.buildHerbesList(this.herbesRepos, 7);
|
||||
formData.jourMoisOptions = RdDCalendrier.buildJoursMois();
|
||||
formData.dateActuelle = game.system.rdd.calendrier.getDateFromIndex();
|
||||
formData.splitDate = game.system.rdd.calendrier.getNumericDateFromIndex(formData.data.prdate);
|
||||
formData.splitDate = game.system.rdd.calendrier.getNumericDateFromIndex(formData.system.prdate);
|
||||
|
||||
if (formData.data.categorie.includes('Soin') ) {
|
||||
if (formData.system.categorie.includes('Soin') ) {
|
||||
formData.isHerbe = true;
|
||||
this.computeHerbeBonus(formData, this.herbesSoins, 12);
|
||||
} else if (formData.data.categorie.includes('Repos')) {
|
||||
} else if (formData.system.categorie.includes('Repos')) {
|
||||
formData.isRepos = true;
|
||||
this.computeHerbeBonus(formData, this.herbesRepos, 7);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculePointsRepos( data ) {
|
||||
return data.herbebonus * data.pr;
|
||||
static calculePuissancePotion( potion ) {
|
||||
return potion.system.herbebonus * potion.system.pr;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculePointsGuerison( data ){
|
||||
return data.herbebonus * data.pr;
|
||||
static calculePointsRepos( potion ) {
|
||||
return potion.system.herbebonus * potion.system.pr;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculePointsGuerison( potion ){
|
||||
return potion.system.herbebonus * potion.system.pr;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static computeHerbeBonus( formData, herbesList, max) {
|
||||
if ( Number(formData.data.herbebrins) ) {
|
||||
let herbe = herbesList.find(item => item.name.toLowerCase() == formData.data.herbe.toLowerCase() );
|
||||
if ( Number(formData.system.herbebrins) ) {
|
||||
let herbe = herbesList.find(item => item.name.toLowerCase() == formData.system.herbe.toLowerCase() );
|
||||
if( herbe ) {
|
||||
let herbeData = herbe.system;
|
||||
let brinsBase = max - herbeData.niveau;
|
||||
//console.log(herbeData, brinsBase, formData.data.herbebrins);
|
||||
formData.data.herbebonus = Math.max(herbeData.niveau - Math.max(brinsBase - formData.data.herbebrins, 0), 0);
|
||||
let brinsBase = max - herbe.system.niveau;
|
||||
formData.system.herbebonus = Math.max(herbe.system.niveau - Math.max(brinsBase - formData.system.herbebrins, 0), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,83 +2,99 @@ import { Misc } from "./misc.js";
|
||||
|
||||
export class RdDHotbar {
|
||||
|
||||
static async createMacro(item, command) {
|
||||
let macro = await Macro.create({
|
||||
name: item.name,
|
||||
type: "script",
|
||||
img: item.img,
|
||||
command: command
|
||||
}, { displaySheet: false })
|
||||
return macro
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a macro when dropping an entity on the hotbar
|
||||
* Item - open roll dialog for item
|
||||
* Actor - open actor sheet
|
||||
* Journal - open journal sheet
|
||||
*/
|
||||
static initDropbar( ) {
|
||||
static initDropbar() {
|
||||
|
||||
Hooks.on("hotbarDrop", async (bar, documentData, slot) => {
|
||||
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
|
||||
if (documentData.type == "Item") {
|
||||
if (documentData.data.type != "arme" && documentData.data.type != "competence" )
|
||||
return
|
||||
let item = documentData.data
|
||||
let command = `game.system.rdd.RdDHotbar.rollMacro("${item.name}", "${item.type}");`;
|
||||
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command));
|
||||
if (!macro) {
|
||||
macro = await Macro.create({
|
||||
name: item.name,
|
||||
type: "script",
|
||||
img: item.img,
|
||||
command: command
|
||||
}, { displaySheet: false })
|
||||
Hooks.on("hotbarDrop", (bar, documentData, slot) => {
|
||||
|
||||
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
|
||||
if (documentData.type == "Item") {
|
||||
let item = fromUuidSync(documentData.uuid)
|
||||
if (item == undefined) {
|
||||
item = this.actor.items.get(documentData.uuid)
|
||||
}
|
||||
console.log("DROP", documentData, item)
|
||||
if (!item || (item.type != "arme" && item.type != "competence")) {
|
||||
return true
|
||||
}
|
||||
let command = `game.system.rdd.RdDHotbar.rollMacro("${item.name}", "${item.type}");`;
|
||||
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command));
|
||||
if (!macro) {
|
||||
macro = this.createMacro(item, command)
|
||||
}
|
||||
game.user.assignHotbarMacro(macro, slot);
|
||||
return false
|
||||
}
|
||||
game.user.assignHotbarMacro(macro, slot);
|
||||
}
|
||||
// Create a macro to open the actor sheet of the actor dropped on the hotbar
|
||||
else if (documentData.type == "Actor") {
|
||||
|
||||
// Create a macro to open the actor sheet of the actor dropped on the hotbar
|
||||
/*else if (documentData.type == "Actor") {
|
||||
let actor = game.actors.get(documentData.id);
|
||||
let command = `game.actors.get("${documentData.id}").sheet.render(true)`
|
||||
let macro = game.macros.contents.find(m => (m.name === actor.name) && (m.command === command));
|
||||
if (!macro) {
|
||||
macro = await Macro.create({
|
||||
name: actor.data.name,
|
||||
name: actor.name,
|
||||
type: "script",
|
||||
img: actor.data.img,
|
||||
img: actor.img,
|
||||
command: command
|
||||
}, { displaySheet: false })
|
||||
game.user.assignHotbarMacro(macro, slot);
|
||||
}
|
||||
}
|
||||
|
||||
// Create a macro to open the journal sheet of the journal dropped on the hotbar
|
||||
else if (documentData.type == "JournalEntry") {
|
||||
let journal = game.journal.get(documentData.id);
|
||||
let journal = fromUuidSync(documentData.uuid)
|
||||
let command = `game.journal.get("${documentData.id}").sheet.render(true)`
|
||||
let macro = game.macros.contents.find(m => (m.name === journal.name) && (m.command === command));
|
||||
if (!macro) {
|
||||
macro = await Macro.create({
|
||||
name: journal.data.name,
|
||||
name: journal.name,
|
||||
type: "script",
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/templates/icone_parchement_vierge.webp",
|
||||
command: command
|
||||
}, { displaySheet: false })
|
||||
game.user.assignHotbarMacro(macro, slot);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** Roll macro */
|
||||
static rollMacro(itemName, itemType, bypassData) {
|
||||
const speaker = ChatMessage.getSpeaker();
|
||||
let actor;
|
||||
if (speaker.token) actor = game.actors.tokens[speaker.token];
|
||||
if (!actor) actor = game.actors.get(speaker.actor);
|
||||
const speaker = ChatMessage.getSpeaker();
|
||||
let actor;
|
||||
if (speaker.token) actor = game.actors.tokens[speaker.token];
|
||||
if (!actor) actor = game.actors.get(speaker.actor);
|
||||
|
||||
let item = Misc.data(actor?.items.find(it => it.name === itemName && it.type == itemType));
|
||||
if (!item) return ui.notifications.warn(`Impossible de trouver l'objet de cette macro`);
|
||||
|
||||
// Trigger the item roll
|
||||
switch (item.type) {
|
||||
case "arme":
|
||||
return actor.rollArme(item);
|
||||
case "competence":
|
||||
return actor.rollCompetence( itemName );
|
||||
}
|
||||
let item = actor?.items.find(it => it.name === itemName && it.type == itemType) ?? undefined;
|
||||
if (!item) {
|
||||
return ui.notifications.warn(`Impossible de trouver l'objet de cette macro`);
|
||||
}
|
||||
|
||||
// Trigger the item roll
|
||||
switch (item.type) {
|
||||
case "arme":
|
||||
return actor.rollArme(item);
|
||||
case "competence":
|
||||
return actor.rollCompetence(itemName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -292,8 +292,8 @@ async function migrationPngWebp_1_5_34() {
|
||||
await Item.updateDocuments(itemsUpdates);
|
||||
await Actor.updateDocuments(actorsUpdates);
|
||||
game.actors.forEach(actor => {
|
||||
if (actor.data.token?.img && actor.data.token.img.match(regexOldPngJpg)) {
|
||||
actor.update({ "token.img": convertImgToWebp(actor.data.token.img) });
|
||||
if (actor.token?.img && actor.token.img.match(regexOldPngJpg)) {
|
||||
actor.update({ "token.img": convertImgToWebp(actor.token.img) });
|
||||
}
|
||||
const actorItemsToUpdate = prepareDocumentsImgUpdate(actor.items);
|
||||
actor.updateEmbeddedDocuments('Item', actorItemsToUpdate);
|
||||
|
@ -1,19 +1,29 @@
|
||||
import { RdDActor } from "./actor.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { RdDDice } from "./rdd-dice.js";
|
||||
|
||||
const words = [ 'pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i', 'onse', 'iane', 'ane', 'zach', 'arri', 'ba', 'bo', 'bi',
|
||||
'alta', 'par', 'pir', 'zor', 'zir', 'de', 'pol', 'tran', 'no', 'la', 'al' , 'pul', 'one', 'ner', 'nur', 'mac', 'mery',
|
||||
'cat', 'do', 'di', 'der', 'er', 'el', 'far', 'fer', 'go', 'guer', 'hot', 'jor', 'jar', 'ji', 'kri', 'ket', 'lor', 'hur',
|
||||
'lar', 'lir', 'lu', 'pot', 'pro', 'pra', 'pit', 'qua', 'qui', 're', 'ral', 'sal', 'sen', 'ted', 'to', 'ta', 'lars', 'ver',
|
||||
'vin', 'ov', 'wal', 'ry', 'ly', '' ];
|
||||
const words = ['pore', 'pre', 'flor', 'lane', 'turlu', 'pin', 'a', 'alph', 'i', 'onse', 'iane', 'ane', 'zach', 'arri', 'ba', 'bo', 'bi',
|
||||
'alta', 'par', 'pir', 'zor', 'zir', 'de', 'pol', 'tran', 'no', 'la', 'al', 'pul', 'one', 'ner', 'nur', 'mac', 'mery',
|
||||
'cat', 'do', 'di', 'der', 'er', 'el', 'far', 'fer', 'go', 'guer', 'hot', 'jor', 'jar', 'ji', 'kri', 'ket', 'lor', 'hur',
|
||||
'lar', 'lir', 'lu', 'pot', 'pro', 'pra', 'pit', 'qua', 'qui', 're', 'ral', 'sal', 'sen', 'ted', 'to', 'ta', 'lars', 'ver',
|
||||
'vin', 'ov', 'wal', 'ry', 'ly', ''];
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDNameGen {
|
||||
|
||||
static async getName( msg, params ) {
|
||||
let name = Misc.upperFirst( await RdDDice.rollOneOf(words) + await RdDDice.rollOneOf(words) )
|
||||
//console.log(name);
|
||||
ChatMessage.create( { content: `Nom : ${name}`, whisper: ChatMessage.getWhisperRecipients("GM") } );
|
||||
static async getName(msg, params) {
|
||||
const html = await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-command-nom.html`, {
|
||||
nom: Misc.upperFirst(await RdDDice.rollOneOf(words) + await RdDDice.rollOneOf(words))
|
||||
});
|
||||
ChatMessage.create({ content: html, whisper: ChatMessage.getWhisperRecipients("GM") });
|
||||
}
|
||||
|
||||
static async onCreerActeur(event) {
|
||||
const button = event.currentTarget;
|
||||
await RdDActor.create({
|
||||
name: button.attributes['data-nom'].value,
|
||||
type: button.attributes['data-type'].value
|
||||
},
|
||||
{renderSheet: true});
|
||||
}
|
||||
}
|
@ -85,15 +85,10 @@ export class RdDPossession {
|
||||
defender: defender,
|
||||
competence: defender.getDraconicOuPossession(),
|
||||
selectedCarac: defender.system.carac.reve,
|
||||
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: defender.getReveActuel() } }
|
||||
}
|
||||
rollData.competence.system.defaut_carac = 'reve-actuel'
|
||||
|
||||
if (rollData.isECNIDefender) {
|
||||
rollData.competence.system.defaut_carac = "reve"
|
||||
rollData.forceCarac = { 'reve': { label: "Rêve", value: defender.system.carac.reve.value } }
|
||||
} else {
|
||||
rollData.competence.system.defaut_carac = 'reve-actuel'
|
||||
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: defender.getReveActuel() } }
|
||||
}
|
||||
|
||||
const dialog = await RdDRoll.create(defender, rollData,
|
||||
{
|
||||
@ -164,7 +159,7 @@ export class RdDPossession {
|
||||
let possessionData = {
|
||||
name: "Possession en cours de " + attacker.name, type: 'possession',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
||||
data: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.id, possedeid: defender.id, date: 0, compteur: 0 }
|
||||
system: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.id, possedeid: defender.id, date: 0, compteur: 0 }
|
||||
}
|
||||
// Creates only the possession on the personnage side
|
||||
let poss = await defender.createEmbeddedDocuments('Item', [possessionData])
|
||||
|
@ -166,7 +166,7 @@ export class RdDResolutionTable {
|
||||
if (rollData.selectedCarac?.label.toLowerCase().includes('chance')) {
|
||||
return true;
|
||||
}
|
||||
if (rollData.selectedSort?.data.isrituel) {
|
||||
if (rollData.selectedSort?.system.isrituel) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE } from "./constants.js";
|
||||
|
||||
/**
|
||||
* Extend the base Dialog entity by defining a custom window to perform roll.
|
||||
* @extends {Dialog}
|
||||
@ -7,15 +9,19 @@ export class RdDEncaisser extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
constructor(html, actor) {
|
||||
// Common conf
|
||||
const buttonsCreatures = {
|
||||
"mortel": { label: "Mortel", callback: html => this.performEncaisser("mortel") },
|
||||
"non-mortel": { label: "Non-mortel", callback: html => this.performEncaisser("non-mortel") },
|
||||
"sonne": { label: "Sonné", callback: html => this.actor.setSonne() },
|
||||
};
|
||||
const buttonsEntitesCauchemar = {
|
||||
"cauchemar": { label: "cauchemar", callback: html => this.performEncaisser("cauchemar") }
|
||||
};
|
||||
const buttons = actor.isEntiteCauchemar() ? buttonsEntitesCauchemar : buttonsCreatures;
|
||||
let buttons = {};
|
||||
if (!actor.isEntite()){
|
||||
buttons = {
|
||||
"mortel": { label: "Mortel", callback: html => this.performEncaisser("mortel") },
|
||||
"non-mortel": { label: "Non-mortel", callback: html => this.performEncaisser("non-mortel") },
|
||||
"sonne": { label: "Sonné", callback: html => this.actor.setSonne() },
|
||||
};
|
||||
}
|
||||
else if (actor.isEntite([ENTITE_BLURETTE, ENTITE_INCARNE])){
|
||||
buttons = {
|
||||
"cauchemar": { label: "cauchemar", callback: html => this.performEncaisser("cauchemar") }
|
||||
}
|
||||
}
|
||||
|
||||
let dialogConf = {
|
||||
title: "Jet d'Encaissement",
|
||||
@ -24,7 +30,6 @@ export class RdDEncaisser extends Dialog {
|
||||
default: "mortel"
|
||||
}
|
||||
|
||||
|
||||
let dialogOptions = {
|
||||
classes: ["rdddialog"],
|
||||
width: 320,
|
||||
|
@ -165,8 +165,8 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
function onLoad() {
|
||||
let rollData = dialog.rollData;
|
||||
console.log(rollData);
|
||||
// Update html, according to data
|
||||
console.log('Ouverture RdDRoll', rollData);
|
||||
// Update html, according to rollData
|
||||
if (rollData.competence) {
|
||||
const defaut_carac = rollData.competence.system.defaut_carac
|
||||
// Set the default carac from the competence item
|
||||
@ -221,7 +221,7 @@ export class RdDRoll extends Dialog {
|
||||
});
|
||||
html.find('#ptreve-variable').change((event) => {
|
||||
let ptreve = Misc.toInt(event.currentTarget.value);
|
||||
this.rollData.selectedSort.data.ptreve_reel = ptreve;
|
||||
this.rollData.selectedSort.system.ptreve_reel = ptreve;
|
||||
console.log("RdDRollSelectDialog - Cout reve", ptreve);
|
||||
this.updateRollResult();
|
||||
});
|
||||
@ -294,7 +294,7 @@ export class RdDRoll extends Dialog {
|
||||
|
||||
async setSelectedSigneDraconique(signe){
|
||||
this.rollData.signe = signe;
|
||||
this.rollData.diffLibre = Misc.data(signe).data.difficulte,
|
||||
this.rollData.diffLibre = signe.system.difficulte,
|
||||
$(".signe-difficulte").text(Misc.toSignedString(this.rollData.diffLibre));
|
||||
}
|
||||
|
||||
@ -348,10 +348,10 @@ export class RdDRoll extends Dialog {
|
||||
/* -------------------------------------------- */
|
||||
_computeDiffCompetence(rollData) {
|
||||
if (rollData.competence) {
|
||||
return Misc.toInt(rollData.competence.data.niveau);
|
||||
return Misc.toInt(rollData.competence.system.niveau);
|
||||
}
|
||||
if (rollData.draconicList) {
|
||||
return Misc.toInt(rollData.competence.data.niveau);
|
||||
return Misc.toInt(rollData.competence.system.niveau);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -21,17 +21,14 @@ export class RdDSheetUtility {
|
||||
}
|
||||
|
||||
static prepareItemDropParameters(destItemId, actorId, dragData, objetVersConteneur) {
|
||||
console.log("ID", dragData)
|
||||
const item = fromUuidSync(dragData.uuid)
|
||||
let itemId = item.id
|
||||
//const itemId = dragData.id || dragData.data._id
|
||||
return {
|
||||
destId: destItemId,
|
||||
targetActorId: actorId,
|
||||
itemId: itemId,
|
||||
sourceActorId: dragData.actorId,
|
||||
srcId: objetVersConteneur[itemId],
|
||||
onEnleverConteneur: () => { delete objetVersConteneur[itemId]; },
|
||||
itemId: item.id,
|
||||
sourceActorId: item.actor?.id,
|
||||
srcId: objetVersConteneur[item.id],
|
||||
onEnleverConteneur: () => { delete objetVersConteneur[item.id]; },
|
||||
onAjouterDansConteneur: (itemId, conteneurId) => { objetVersConteneur[itemId] = conteneurId; }
|
||||
}
|
||||
}
|
||||
@ -47,10 +44,10 @@ export class RdDSheetUtility {
|
||||
static async _onSplitItem(item, split, actor) {
|
||||
if (split >= 1 && split < item.system.quantite) {
|
||||
await item.diminuerQuantite(split);
|
||||
const itemData = duplicate(item);
|
||||
const splitItem = duplicate(item);
|
||||
// todo: ajouter dans le même conteneur?
|
||||
itemData.system.quantite = split;
|
||||
await actor.createEmbeddedDocuments('Item', [itemData])
|
||||
splitItem.system.quantite = split;
|
||||
await actor.createEmbeddedDocuments('Item', [splitItem])
|
||||
}
|
||||
}
|
||||
}
|
@ -267,7 +267,6 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
if (ReglesOptionelles.isUsing("appliquer-fatigue")) {
|
||||
let fatigueItem = document.getElementById("tmr-fatigue-table");
|
||||
//console.log("Refresh : ", actorData.data.sante.fatigue.value);
|
||||
fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(this.actor.system.sante.fatigue.value, this.actor.system.sante.endurance.max).html() + "</table>";
|
||||
}
|
||||
}
|
||||
@ -819,7 +818,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
//this.updateSortReserve();
|
||||
console.log("declencheSortEnReserve", sortReserve)
|
||||
this._tellToUserAndGM(`Vous avez déclenché le sort en réserve <strong> ${sortReserve.sort.name}</strong>
|
||||
avec ${sortReserve.sort.system.ptreve_reel} points de Rêve
|
||||
avec ${sortReserve.sort.data.ptreve_reel} points de Rêve
|
||||
en ${sortReserve.coord} (${TMRUtility.getTMRLabel(sortReserve.coord)})
|
||||
`);
|
||||
this.close();
|
||||
@ -873,7 +872,6 @@ export class RdDTMRDialog extends Dialog {
|
||||
if (this.viewOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
let clickOddq = RdDTMRDialog._computeEventOddq(event.data.originalEvent);
|
||||
await this._onClickTMRPos(clickOddq); // Vérifier l'état des compteurs reve/fatigue/vie
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export class RdDTokenHud {
|
||||
|
||||
static init() {
|
||||
// Integration du TokenHUD
|
||||
Hooks.on('renderTokenHUD', (app, html, data) => { RdDTokenHud.addTokenHudExtensions(app, html, data._id) });
|
||||
Hooks.on('renderTokenHUD', (app, html, token) => { RdDTokenHud.addTokenHudExtensions(app, html, token._id) });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -23,40 +23,63 @@ export class RdDTokenHud {
|
||||
let token = canvas.tokens.get(tokenId);
|
||||
let actor = token.actor;
|
||||
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!`)
|
||||
return;
|
||||
}
|
||||
app.hasExtension = true;
|
||||
|
||||
let armesList = RdDCombatManager.buildListeActionsCombat(combatant);
|
||||
let actionsCombat = RdDCombatManager.listActionsCombat(combatant);
|
||||
const hudData = {
|
||||
combatant: combatant, armes: armesList,
|
||||
commandes: [{ name: 'Initiative +1', command: 'inc', value: 0.01 }, { name: 'Initiative -1', command: 'dec', value: -0.01 }]
|
||||
combatant: combatant,
|
||||
actions: actionsCombat,
|
||||
commandes: [
|
||||
{ name: "Autre action", command: 'autre' },
|
||||
{ name: 'Initiative +1', command: 'inc', value: 0.01 },
|
||||
{ name: 'Initiative -1', command: 'dec', value: -0.01 }]
|
||||
};
|
||||
|
||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||
// initiative
|
||||
await RdDTokenHud._configureSubMenu(controlIconCombat, 'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html', hudData,
|
||||
await RdDTokenHud._configureSubMenu(controlIconCombat,
|
||||
'systems/foundryvtt-reve-de-dragon/templates/hud-actor-init.html',
|
||||
hudData,
|
||||
(event) => {
|
||||
let initCommand = event.currentTarget.attributes['data-command'].value;
|
||||
let combatantId = event.currentTarget.attributes['data-combatant-id'].value;
|
||||
if (!initCommand) {
|
||||
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
|
||||
let arme = armesList[armeIndex];
|
||||
RdDCombatManager.rollInitiativeCompetence(combatantId, arme);
|
||||
} else if (initCommand == 'inc') {
|
||||
RdDCombatManager.incDecInit(combatantId, 0.01);
|
||||
} else if (initCommand == 'dec') {
|
||||
RdDCombatManager.incDecInit(combatantId, -0.01);
|
||||
}
|
||||
let initCommand = event.currentTarget.attributes['data-command']?.value;
|
||||
let combatantId = event.currentTarget.attributes['data-combatant-id']?.value;
|
||||
if (initCommand) {
|
||||
RdDTokenHud._initiativeCommand(initCommand, combatantId);
|
||||
} else {
|
||||
let index = event.currentTarget.attributes['data-action-index'].value;
|
||||
let action = actionsCombat[index];
|
||||
RdDCombatManager.rollInitiativeAction(combatantId, action);
|
||||
}
|
||||
});
|
||||
|
||||
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,
|
||||
(event) => {
|
||||
let armeIndex = event.currentTarget.attributes['data-arme-id'].value;
|
||||
actor.rollArme(armesList[armeIndex]);
|
||||
const actionIndex = event.currentTarget.attributes['data-action-index']?.value;
|
||||
const action = actionsCombat[actionIndex];
|
||||
if (action.action == 'conjurer') {
|
||||
actor.conjurerPossession(actor.getPossession(action.system.possessionid));
|
||||
}
|
||||
else {
|
||||
actor.rollArme(action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static _initiativeCommand(initCommand, combatantId) {
|
||||
switch (initCommand) {
|
||||
case 'inc': return RdDCombatManager.incDecInit(combatantId, 0.01);
|
||||
case 'dec': return RdDCombatManager.incDecInit(combatantId, -0.01);
|
||||
case 'autre': return RdDCombatManager.rollInitiativeAction(combatantId,
|
||||
{ name: "Autre action", action: 'autre', system: { initOnly: true, competence: "Autre action" } });
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async addTokenHudExtensions(app, html, tokenId) {
|
||||
const controlIconCombat = html.find('.control-icon[data-action=combat]');
|
||||
|
@ -11,6 +11,7 @@ import { RdDDice } from "./rdd-dice.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { Monnaie } from "./item-monnaie.js";
|
||||
import { RdDPossession } from "./rdd-possession.js";
|
||||
import { RdDNameGen } from "./rdd-namegen.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// This table starts at 0 -> niveau -10
|
||||
@ -103,7 +104,7 @@ export class RdDUtility {
|
||||
/* -------------------------------------------- */
|
||||
static async init() {
|
||||
Hooks.on("renderChatMessage", async (app, html, msg) => RdDUtility.onRenderChatMessage(app, html, msg));
|
||||
Hooks.on('renderChatLog', (log, html, data) => RdDUtility.chatListeners(html));
|
||||
Hooks.on('renderChatLog', (log, html, chatLog) => RdDUtility.chatListeners(html));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -120,11 +121,18 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-oeuvre-partial.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-liste-blessures-partial.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-queues.html',
|
||||
// Conteneur/item in Actor sheet
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-item-queue.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html',
|
||||
"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html",
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-animaux.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-suivants.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-vehicules.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html',
|
||||
//Items
|
||||
'systems/foundryvtt-reve-de-dragon/templates/header-item.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competence-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-competencecreature-sheet.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/item-arme-sheet.html',
|
||||
@ -234,36 +242,38 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
|
||||
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
|
||||
|
||||
Handlebars.registerHelper('sortCompetence', competences => competences.sort((a, b) => {
|
||||
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {
|
||||
if (a.name.includes("Cité")) return -1;
|
||||
if (b.name.includes("Cité")) return 1;
|
||||
if (a.name.includes("Extérieur")) return -1;
|
||||
if (b.name.includes("Extérieur")) return 1;
|
||||
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.system.isVisible)
|
||||
.sort((a, b) => {
|
||||
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {
|
||||
if (a.name.includes("Cité")) return -1;
|
||||
if (b.name.includes("Cité")) return 1;
|
||||
if (a.name.includes("Extérieur")) return -1;
|
||||
if (b.name.includes("Extérieur")) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
if (a.system.categorie.startsWith("melee") && b.system.categorie.startsWith("melee")) {
|
||||
if (a.name.includes("Corps")) return -1;
|
||||
if (b.name.includes("Corps")) return 1;
|
||||
if (a.name.includes("Dague")) return -1;
|
||||
if (b.name.includes("Dague")) return 1;
|
||||
if (a.name.includes("Esquive")) return -1;
|
||||
if (b.name.includes("Esquive")) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
if (a.name.startsWith("Voie") && b.name.startsWith("Voie")) {
|
||||
if (a.name.includes("Oniros")) return -1;
|
||||
if (b.name.includes("Oniros")) return 1;
|
||||
if (a.name.includes("Hypnos")) return -1;
|
||||
if (b.name.includes("Hypnos")) return 1;
|
||||
if (a.name.includes("Narcos")) return -1;
|
||||
if (b.name.includes("Narcos")) return 1;
|
||||
if (a.name.includes("Thanatos")) return -1;
|
||||
if (b.name.includes("Thanatos")) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
if (a.system.categorie.startsWith("melee") && b.system.categorie.startsWith("melee")) {
|
||||
if (a.name.includes("Corps")) return -1;
|
||||
if (b.name.includes("Corps")) return 1;
|
||||
if (a.name.includes("Dague")) return -1;
|
||||
if (b.name.includes("Dague")) return 1;
|
||||
if (a.name.includes("Esquive")) return -1;
|
||||
if (b.name.includes("Esquive")) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
if (a.name.startsWith("Voie") && b.name.startsWith("Voie")) {
|
||||
if (a.name.includes("Oniros")) return -1;
|
||||
if (b.name.includes("Oniros")) return 1;
|
||||
if (a.name.includes("Hypnos")) return -1;
|
||||
if (b.name.includes("Hypnos")) return 1;
|
||||
if (a.name.includes("Narcos")) return -1;
|
||||
if (b.name.includes("Narcos")) return 1;
|
||||
if (a.name.includes("Thanatos")) return -1;
|
||||
if (b.name.includes("Thanatos")) return 1;
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
return a.name.localeCompare(b.name);
|
||||
}));
|
||||
})
|
||||
);
|
||||
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
@ -438,16 +448,16 @@ export class RdDUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static calculEncContenu(conteneur, objets) {
|
||||
const contenuDatas = (conteneur.system.contenu ?? []).filter(id => id != undefined)
|
||||
.map(id => objets.find(it => (id == it._id)))
|
||||
const contenus = (conteneur.system.contenu ?? []).filter(id => id != undefined)
|
||||
.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 itemData of contenuDatas) {
|
||||
if (itemData.type == 'conteneur') {
|
||||
enc += RdDUtility.calculEncContenu(itemData, objets);
|
||||
for (let contenu of contenus) {
|
||||
if (contenu.type == 'conteneur') {
|
||||
enc += RdDUtility.calculEncContenu(contenu, objets);
|
||||
}
|
||||
else {
|
||||
enc += Number(itemData.system.encombrement ?? 0) * Number(itemData.system.quantite ?? 1)
|
||||
enc += Number(contenu.system.encombrement ?? 0) * Number(contenu.system.quantite ?? 1)
|
||||
}
|
||||
}
|
||||
return enc
|
||||
@ -463,34 +473,32 @@ export class RdDUtility {
|
||||
/** Construit la structure récursive des conteneurs, avec imbrication potentielle
|
||||
*
|
||||
*/
|
||||
static buildConteneur(objet, niveau) {
|
||||
if (!niveau) niveau = 1;
|
||||
objet.niveau = niveau;
|
||||
//console.log("OBJ:", objet);
|
||||
let str = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html']({ item: objet });
|
||||
if (objet.type == 'conteneur') {
|
||||
const afficherContenu = this.getAfficheContenu(objet._id);
|
||||
str = str + RdDUtility.buildContenu(objet, niveau, afficherContenu);
|
||||
}
|
||||
return str;
|
||||
static buildConteneur(objet, profondeur) {
|
||||
if (!profondeur) profondeur = 1;
|
||||
objet.niveau = profondeur;
|
||||
const isConteneur = objet.type == 'conteneur';
|
||||
const isOuvert = isConteneur && this.getAfficheContenu(objet._id);
|
||||
const isVide = isConteneur && objet.system.contenu.length == 0;
|
||||
const conteneur = Handlebars.partials['systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html']({
|
||||
item: objet,
|
||||
vide: isVide,
|
||||
ouvert: isOuvert
|
||||
});
|
||||
const contenu = isConteneur ? RdDUtility.buildContenu(objet, profondeur, isOuvert) : '';
|
||||
return conteneur + contenu;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static buildContenu(objet, niveau, afficherContenu) {
|
||||
if (!niveau) niveau = 1;
|
||||
objet.niveau = niveau;
|
||||
let strContenu = "";
|
||||
static buildContenu(objet, profondeur, afficherContenu) {
|
||||
if (!profondeur) profondeur = 1;
|
||||
objet.niveau = profondeur;
|
||||
const display = afficherContenu ? 'item-display-show' : 'item-display-hide';
|
||||
//console.log("ITEM DISPLAYED", objet );
|
||||
if (afficherContenu) {
|
||||
strContenu = "<ul class='item-list alterne-list item-display-show list-item-margin" + niveau + "'>";
|
||||
} else {
|
||||
strContenu = "<ul class='item-list alterne-list item-display-hide list-item-margin" + niveau + "'>";
|
||||
}
|
||||
let strContenu = `<ul class='item-list alterne-list ${display} list-item-margin${profondeur}'>`;
|
||||
for (let subItem of objet.subItems) {
|
||||
strContenu = strContenu + this.buildConteneur(subItem, niveau + 1);
|
||||
strContenu += this.buildConteneur(subItem, profondeur + 1);
|
||||
}
|
||||
strContenu = strContenu + "</ul>";
|
||||
return strContenu;
|
||||
return strContenu + "</ul>";
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -648,9 +656,9 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async responseNombreAstral(data) {
|
||||
let actor = game.actors.get(data.id);
|
||||
actor.ajouteNombreAstral(data);
|
||||
static async responseNombreAstral(callData) {
|
||||
let actor = game.actors.get(callData.id);
|
||||
actor.ajouteNombreAstral(callData);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -703,6 +711,7 @@ export class RdDUtility {
|
||||
|
||||
// gestion bouton tchat Acheter
|
||||
html.on("click", '.button-acheter', event => DialogItemAchat.onButtonAcheter(event));
|
||||
html.on("click", '.button-creer-acteur', event => RdDNameGen.onCreerActeur(event));
|
||||
|
||||
// Gestion du bouton payer
|
||||
html.on("click", '.payer-button', event => {
|
||||
@ -747,7 +756,7 @@ export class RdDUtility {
|
||||
static getSelectedActor(msgPlayer = undefined) {
|
||||
if (canvas.tokens.controlled.length == 1) {
|
||||
let token = canvas.tokens.controlled[0];
|
||||
if (token.actor && token.data.actorLink) {
|
||||
if (token.actor) {
|
||||
return token.actor;
|
||||
}
|
||||
if (msgPlayer != undefined) {
|
||||
@ -770,7 +779,7 @@ export class RdDUtility {
|
||||
static createMonnaie(name, valeur_deniers, img = "", enc = 0.01) {
|
||||
let piece = {
|
||||
name: name, type: 'monnaie', img: img, _id: randomID(16),
|
||||
data: {
|
||||
dasystemta: {
|
||||
quantite: 0,
|
||||
valeur_deniers: valeur_deniers,
|
||||
encombrement: enc,
|
||||
@ -822,21 +831,17 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static confirmerSuppressionSubacteur(actorSheet, li) {
|
||||
let actorId = li.data("actor-id");
|
||||
let actor = game.actors.get(actorId);
|
||||
let msgTxt = "<p>Etes vous certain de vouloir supprimer le lien vers ce véhicule/monture/suivant : " + actor.data.name + " ?</p>";
|
||||
let d = new Dialog({
|
||||
title: "Confirmer la suppression du lien",
|
||||
content: msgTxt,
|
||||
static confirmerSuppression(sheet, htmlToDelete, options) {
|
||||
const d = new Dialog({
|
||||
title: options.title ?? 'Confirmer la suppression',
|
||||
content: `<p>Etes vous certain de vouloir supprimer ${options.supprimer ?? 'cet objet'} ?</p>`,
|
||||
buttons: {
|
||||
delete: {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le lien",
|
||||
label: options.deleteLabel ?? 'Supprimer',
|
||||
callback: () => {
|
||||
console.log("Delete : ", actorId);
|
||||
actorSheet.actor.removeSubacteur(actorId);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
options.onDelete();
|
||||
RdDUtility.slideOnDelete(sheet, htmlToDelete);
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
@ -850,11 +855,21 @@ export class RdDUtility {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async confirmerSuppression(actorSheet, li) {
|
||||
let itemId = li.data("item-id");
|
||||
let objet = actorSheet.actor.getObjet(itemId);
|
||||
static confirmerSuppressionSubacteur(sheet, subActor, htmlToDelete) {
|
||||
RdDUtility.confirmerSuppression(sheet, htmlToDelete,{
|
||||
supprimer: "le lien vers le véhicule/monture/suivant : " + subActor.name,
|
||||
deleteLabel: "Supprimer le lien",
|
||||
onDelete: () => {
|
||||
console.log("Delete : ", subActor.id);
|
||||
sheet.actor.removeSubacteur(subActor.id);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (objet.type == 'monnaie' && Monnaie.isSystemMonnaie(objet)) {
|
||||
/* -------------------------------------------- */
|
||||
static async confirmerSuppressionItem(sheet, item, htmlToDelete) {
|
||||
const itemId = item.id;
|
||||
if (Monnaie.isSystemMonnaie(item, sheet.actor.items)) {
|
||||
ui.notifications.warn("Suppression des monnaies de base impossible");
|
||||
return;
|
||||
}
|
||||
@ -866,8 +881,8 @@ export class RdDUtility {
|
||||
label: "Supprimer l'objet",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteEmbeddedDocuments('Item', [itemId]);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
sheet.actor.deleteEmbeddedDocuments('Item', [itemId]);
|
||||
RdDUtility.slideOnDelete(sheet, htmlToDelete);
|
||||
}
|
||||
},
|
||||
cancel: {
|
||||
@ -875,16 +890,15 @@ export class RdDUtility {
|
||||
label: "Annuler"
|
||||
}
|
||||
}
|
||||
const docData = objet
|
||||
if (docData.type == 'conteneur' && docData.data.contenu.length > 0) {
|
||||
if (item.type == 'conteneur' && item.system.contenu.length > 0) {
|
||||
msgTxt += "<br>Ce conteneur n'est pas vide. Choisissez l'option de suppression";
|
||||
buttons['deleteall'] = {
|
||||
icon: '<i class="fas fa-check"></i>',
|
||||
label: "Supprimer le conteneur et tout son contenu",
|
||||
callback: () => {
|
||||
console.log("Delete : ", itemId);
|
||||
actorSheet.actor.deleteAllConteneur(itemId);
|
||||
li.slideUp(200, () => actorSheet.render(false));
|
||||
sheet.actor.deleteAllConteneur(itemId);
|
||||
RdDUtility.slideOnDelete(sheet, htmlToDelete);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -898,6 +912,10 @@ export class RdDUtility {
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
static slideOnDelete(sheet, htmlToDelete) {
|
||||
return htmlToDelete.slideUp(200, () => sheet.render(false));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static afficherHeuresChanceMalchance(heureNaissance) {
|
||||
if (game.user.isGM) {
|
||||
|
@ -33,7 +33,7 @@ export const referenceAjustements = {
|
||||
getLabel: (rollData, actor) => rollData.selectedSort?.name ?? rollData.attackerRoll ? 'Imposée' : 'Libre',
|
||||
getValue: (rollData, actor) => rollData.selectedSort
|
||||
? RdDItemSort.getDifficulte(rollData.selectedSort, rollData.diffLibre)
|
||||
: rollData.diffLibre ?? rollData.competence?.data.default_diffLibre ?? 0
|
||||
: rollData.diffLibre ?? rollData.competence?.system.default_diffLibre ?? 0
|
||||
},
|
||||
diffConditions: {
|
||||
isUsed: (rollData, actor) => rollData.diffConditions != undefined,
|
||||
|
@ -468,10 +468,10 @@ export class TMRRencontres {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async onPostEchecTourbillonRouge(tmrDialog, data) {
|
||||
await data.actor.reveActuelIncDec(-2); // -2 pts de Reve a chaque itération
|
||||
TMRRencontres._toubillonner(tmrDialog, data.actor, 4);
|
||||
await data.actor.santeIncDec("vie", -1); // Et -1 PV
|
||||
static async onPostEchecTourbillonRouge(tmrDialog, rencontre) {
|
||||
await rencontre.actor.reveActuelIncDec(-2); // -2 pts de Reve a chaque itération
|
||||
TMRRencontres._toubillonner(tmrDialog, rencontre.actor, 4);
|
||||
await rencontre.actor.santeIncDec("vie", -1); // Et -1 PV
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -486,7 +486,7 @@ export class TMRRencontres {
|
||||
/* -------------------------------------------- */
|
||||
static async onPostSuccessReveDeDragon(tmrDialog, tmrData) {
|
||||
if (tmrData.rolled.isPart) {
|
||||
await tmrData.actor.appliquerAjoutExperience(tmrData, true);
|
||||
await tmrData.actor.appliquerAjoutExperience(tmrData);
|
||||
}
|
||||
await tmrData.actor.resultCombatReveDeDragon(tmrData);
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ const registeredEffects = [
|
||||
* Définition des informations d'une "draconique" (queue, ombre, tête, souffle) qui influence les TMR
|
||||
*/
|
||||
export class Draconique {
|
||||
static isCaseTMR(itemData) { return itemData.type == 'casetmr'; }
|
||||
static isQueueDragon(itemData) { return itemData.type == 'queue' || itemData.type == 'ombre'; }
|
||||
static isSouffleDragon(itemData) { return itemData.type == 'souffle'; }
|
||||
static isTeteDragon(itemData) { return itemData.type == 'tete'; }
|
||||
static isQueueSouffle(itemData) { return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData); }
|
||||
static isCaseTMR(item) { return item.type == 'casetmr'; }
|
||||
static isQueueDragon(item) { return item.type == 'queue' || item.type == 'ombre'; }
|
||||
static isSouffleDragon(item) { return item.type == 'souffle'; }
|
||||
static isTeteDragon(item) { return item.type == 'tete'; }
|
||||
static isQueueSouffle(item) { return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item); }
|
||||
|
||||
tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.system.coord); }
|
||||
|
||||
@ -38,8 +38,7 @@ export class Draconique {
|
||||
* @returns true si l'item correspond
|
||||
*/
|
||||
match(item) {
|
||||
const itemData = item;
|
||||
return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData) || Draconique.isTeteDragon(itemData);
|
||||
return Draconique.isQueueDragon(item) || Draconique.isSouffleDragon(item) || Draconique.isTeteDragon(item);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -112,7 +112,7 @@ export class EffetsDraconiques {
|
||||
}
|
||||
|
||||
static filterItems(actor, filter, name) {
|
||||
return actor.filter(filter)
|
||||
return actor.filterItems(filter)
|
||||
.filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ export class PixiTMR {
|
||||
for (const [name, img] of Object.entries(PixiTMR.textures)) {
|
||||
loader = loader.add(name, img);
|
||||
}
|
||||
loader.onLoad.add((error, reason) => { console.log("ERROR", error, reason) });
|
||||
loader.onError.add((error, reason) => { console.log("ERROR", error, reason) });
|
||||
loader.load( (loader, resources) => {
|
||||
onLoad(loader, resources);
|
||||
for (let onAnimate of this.callbacksOnAnimate) {
|
||||
|
@ -37,7 +37,7 @@ export class UrgenceDraconique extends Draconique {
|
||||
}
|
||||
|
||||
async onActorDeleteCaseTmr(actor, casetmr) {
|
||||
await actor.deleteEmbeddedDocuments('Item', [casetmr.data.sourceid]);
|
||||
await actor.deleteEmbeddedDocuments('Item', [casetmr.system.sourceid]);
|
||||
}
|
||||
|
||||
code() { return 'urgence' }
|
||||
|
File diff suppressed because one or more lines are too long
@ -65,7 +65,11 @@
|
||||
--debug-box-shadow-blue: inset 0 0 2px blue;
|
||||
--debug-box-shadow-green: inset 0 0 2px green;
|
||||
|
||||
/* =================== 3. some constants ============ */
|
||||
/* =================== 3. some constants ============ */
|
||||
--color-controls:rgba(0, 0, 0, 0.9);
|
||||
--color-controls-hover:rgba(255, 255, 128, 0.7);
|
||||
--color-control-border-hover:rgba(255, 128, 0, 0.8);
|
||||
--color-gold: rgba(191, 149, 63, 0.8);
|
||||
--gradient-gold: linear-gradient(30deg, rgba(191, 149, 63, 0.3), rgba(252, 246, 186, 0.3), rgba(179, 135, 40, 0.3), rgba(251, 245, 183, 0.3), rgba(170, 119, 28, 0.3));
|
||||
--gradient-silver: linear-gradient(30deg, rgba(61, 55, 93, 0.3), rgba(178, 179, 196, 0.3), rgba(59, 62, 63, 0.6), rgba(206, 204, 199, 0.3), rgba(61, 46, 49, 0.3));
|
||||
--gradient-green: linear-gradient(30deg, rgba(7, 76, 0, 0.3), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.1), rgba(66, 163, 65, 0.2), rgba(184, 226, 163, 0.3));
|
||||
@ -104,6 +108,9 @@
|
||||
.strong-text{
|
||||
font-weight: bold;
|
||||
}
|
||||
i:is(.fas, .far) {
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
.tabs .item.active, .blessures-list li ul li:first-child:hover, a:hover {
|
||||
text-shadow: 1px 0px 0px #ff6600;
|
||||
@ -225,6 +232,26 @@ table {border: 1px solid #7a7971;}
|
||||
flex-grow : 3;
|
||||
}
|
||||
/* Styles limited to foundryvtt-reve-de-dragon sheets */
|
||||
.equipement-nom {
|
||||
flex-grow : 4;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
text-align: left;
|
||||
}
|
||||
.equipement-detail {
|
||||
margin: 0;
|
||||
flex: 'flex-shrink' ;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
.equipement-actions {
|
||||
margin: 0;
|
||||
flex-grow: 2;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.foundryvtt-reve-de-dragon .sheet-header {
|
||||
-webkit-box-flex: 0;
|
||||
@ -266,14 +293,8 @@ table {border: 1px solid #7a7971;}
|
||||
height: 8%;
|
||||
max-height: 48px;
|
||||
border-width: 0;
|
||||
border: 1px solid rgba(0, 0, 0, 0);
|
||||
border: 1px solid rgba(0, 0, 0, 0);
|
||||
}
|
||||
.button-img:hover {
|
||||
color: rgba(255, 255, 128, 0.7);
|
||||
border: 1px solid rgba(255, 128, 0, 0.8);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button-effect-img {
|
||||
vertical-align: baseline;
|
||||
width: 16px;
|
||||
@ -281,9 +302,16 @@ table {border: 1px solid #7a7971;}
|
||||
height: 16;
|
||||
border-width: 0;
|
||||
}
|
||||
.button-effect-img:hover {
|
||||
color: rgba(255, 255, 128, 0.7);
|
||||
border: 1px solid rgba(255, 128, 0, 0.8);
|
||||
.small-button-direction {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
border: 0;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
:is(.button-img,.button-effect-img:hover,.small-button-direction):hover {
|
||||
color: var(--color-controls-hover);
|
||||
border: 1px solid var(--color-control-border-hover);
|
||||
text-shadow: 1px 0px 0px #ff6600;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -294,18 +322,6 @@ table {border: 1px solid #7a7971;}
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.small-button-direction {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
border: 0;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.small-button-direction:hover {
|
||||
color: rgba(255, 255, 128, 0.7);
|
||||
border: 1px solid rgba(255, 128, 0, 0.8);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.foundryvtt-reve-de-dragon .sheet-header .header-fields {
|
||||
-webkit-box-flex: 1;
|
||||
-ms-flex: 1;
|
||||
@ -346,25 +362,25 @@ table {border: 1px solid #7a7971;}
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique {
|
||||
flex-wrap: nowrap;
|
||||
justify-content: stretch;
|
||||
}
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence > .carac-label {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .carac-label {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence > .attribut-label {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .attribut-label {
|
||||
flex-basis: 50%;
|
||||
}
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence > .competence-value.total {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .competence-value.total {
|
||||
flex-grow: 1;
|
||||
text-align: right;
|
||||
}
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence > .utiliser-attribut {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .utiliser-attribut {
|
||||
flex-basis: available;
|
||||
flex-grow: 1;
|
||||
}
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .competence > * {
|
||||
.rdd.sheet .window-content .sheet-body .carac-list .caracteristique > * {
|
||||
flex-basis: 13%;
|
||||
flex-grow: 0;
|
||||
}
|
||||
@ -469,13 +485,18 @@ table {border: 1px solid #7a7971;}
|
||||
flex: 0 0 86px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.competence-list .item-controls {
|
||||
display: contents !important;
|
||||
}
|
||||
.competence-list .item-controls.hidden-controls {
|
||||
display: none !important;
|
||||
}
|
||||
.item-controls i:is(.fas,.far) {
|
||||
color: var(--color-controls);
|
||||
}
|
||||
.item-controls i:is(.fas,.far):hover {
|
||||
opacity: 0.7 ;
|
||||
}
|
||||
|
||||
.rdddialog .dialog-roll-sort s{
|
||||
width: 600px;
|
||||
@ -567,7 +588,7 @@ table {border: 1px solid #7a7971;}
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 0 none;
|
||||
margin-bottom: 0.25rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
.window-app .window-content, .window-app.sheet .window-content .sheet-body{
|
||||
@ -601,7 +622,7 @@ section.sheet-body{padding: 0.25rem 0.5rem;}
|
||||
|
||||
nav.sheet-tabs .item {
|
||||
position: relative;
|
||||
padding: 0 0.25rem;
|
||||
padding: 0 0.2rem;
|
||||
}
|
||||
|
||||
nav.sheet-tabs .item:after {
|
||||
@ -627,11 +648,15 @@ section.sheet-body:after {
|
||||
.sheet header.sheet-header .flex-compteurs {text-align: right;}
|
||||
.sheet header.sheet-header .resource-content {width: 2rem;}
|
||||
|
||||
.ctn-vie span, .ctn-endu span, .ctn-fatigue span, .ctn-reve span {
|
||||
.compteur span {
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
width: 2rem;
|
||||
}
|
||||
.compteur a i:is(.fas,.far):hover {
|
||||
opacity: 0.7 ;
|
||||
}
|
||||
|
||||
.select-diff {
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
@ -644,17 +669,6 @@ section.sheet-body:after {
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
.plus-moins {
|
||||
display: inline-block;
|
||||
width: 1.25rem;
|
||||
background: rgba(30, 25, 20, 1);
|
||||
text-align: center;
|
||||
border: 1px solid rgba(72, 46, 28, 1);
|
||||
border-radius: 0.25rem;
|
||||
line-height: 1.25rem;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.alchimie-tache {
|
||||
font-weight: bold;
|
||||
background: rgb(182, 180, 179);
|
||||
@ -711,10 +725,13 @@ ul, ol {
|
||||
ul, li {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.sheet .caracteristique li {
|
||||
margin: 0.1rem;
|
||||
padding: 0.2rem;
|
||||
}
|
||||
.sheet li {
|
||||
margin: 0.125rem;
|
||||
padding: 0.25rem;
|
||||
margin: 0.1rem;
|
||||
padding: 0.1rem;
|
||||
}
|
||||
.header-fields li {
|
||||
margin: 0;
|
||||
@ -731,23 +748,19 @@ ul, li {
|
||||
background: rgb(160, 130, 100, 0.05);
|
||||
}
|
||||
.xp-level-up {
|
||||
margin: 0.125rem;
|
||||
margin: 0.1rem;
|
||||
box-shadow: inset 0px 0px 1px #00000096;
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.125rem;
|
||||
padding: 0.1rem;
|
||||
flex: 1 1 5rem;
|
||||
background: var(--gradient-gold) !important;
|
||||
}
|
||||
.niveau-archetype {
|
||||
background: var(--gradient-silver-light) !important;
|
||||
}
|
||||
.fa-arrow-alt-circle-up.allouer-stress {
|
||||
color: rgba(83, 60, 14, 0.8);
|
||||
.item-controls i.fas.allouer-stress.level-up {
|
||||
color: var(--color-gold);
|
||||
}
|
||||
.fa-arrow-alt-circle-up.allouer-stress-level-up {
|
||||
color: rgba(191, 149, 63, 0.8);
|
||||
}
|
||||
|
||||
.blessures-list ul {
|
||||
display: flex;
|
||||
}
|
||||
@ -766,18 +779,18 @@ ul, li {
|
||||
font-weight: bold;
|
||||
}
|
||||
.list-item {
|
||||
margin: 0.125rem;
|
||||
margin: 0.1rem;
|
||||
box-shadow: inset 0px 0px 1px #00000096;
|
||||
border-radius: 0.25rem;
|
||||
padding: 0.125rem;
|
||||
padding: 0.1rem;
|
||||
flex: 1 1 5rem;
|
||||
display: flex !important;
|
||||
align-items: baseline !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.table-row {
|
||||
margin: 0.125rem;
|
||||
padding: 0.125rem;
|
||||
margin: 0.1rem;
|
||||
padding: 0.1rem;
|
||||
flex: 1 1 5rem;
|
||||
}
|
||||
|
||||
@ -801,28 +814,37 @@ ul, li {
|
||||
background: rgb(200, 10, 100, 0.25);
|
||||
}
|
||||
|
||||
.item-quantite {
|
||||
margin-left: 0.5rem;
|
||||
.item-column {
|
||||
margin-left: 0.2rem;
|
||||
margin-right: 0.2rem;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.list-item-margin1 {
|
||||
margin-left: 1rem;
|
||||
margin-left: 0.5rem;
|
||||
}
|
||||
.list-item-margin2 {
|
||||
margin-left: 2rem;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
.list-item-margin3 {
|
||||
margin-left: 3rem;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
.list-item-margin4 {
|
||||
margin-left: 4rem;
|
||||
margin-left: 2rem;
|
||||
}
|
||||
.list-item-margin5 {
|
||||
margin-left: 2.5rem;
|
||||
}
|
||||
.list-item-margin6 {
|
||||
margin-left: 3rem;
|
||||
}
|
||||
|
||||
.sheet-competence-img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
flex-grow: 0;
|
||||
margin-right: 0.25rem;
|
||||
margin-right: 0.2rem;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.competence-column {
|
||||
@ -866,20 +888,20 @@ ul, li {
|
||||
.competence-value {
|
||||
flex-grow: 0;
|
||||
flex-basis: 2rem;
|
||||
margin-right: 0.25rem;
|
||||
margin-left: 0.25rem;
|
||||
margin-right: 0.2rem;
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
.description-value {
|
||||
flex-grow: 0;
|
||||
flex-basis: 4rem;
|
||||
margin-right: 0.25rem;
|
||||
margin-left: 0.25rem;
|
||||
margin-right: 0.2rem;
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
.competence-xp {
|
||||
flex-grow: 0;
|
||||
flex-basis: 2rem;
|
||||
margin-right: 0.25rem;
|
||||
margin-left: 0.25rem;
|
||||
margin-right: 0.2rem;
|
||||
margin-left: 0.2rem;
|
||||
}
|
||||
.blessures-title {
|
||||
font-weight: bold;
|
||||
@ -957,7 +979,7 @@ ul, li {
|
||||
flex-basis: auto;
|
||||
padding: 0;
|
||||
line-height: 1rem;
|
||||
margin: 0.25rem;
|
||||
margin: 0.2rem;
|
||||
}
|
||||
.control-icon.tokenhudicon.right {
|
||||
margin-left: 8px;
|
||||
@ -975,7 +997,7 @@ ul, li {
|
||||
border-left: none;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
color: black;
|
||||
color: var(--color-controls);
|
||||
padding-top: 5px;
|
||||
margin-right: 0px;
|
||||
width: 45px;
|
||||
@ -1075,7 +1097,7 @@ ul, li {
|
||||
.sidebar-tab .directory-list .entity {
|
||||
border-top: 1px dashed rgba(0,0,0,0.25);
|
||||
border-bottom: 0 none;
|
||||
padding: 0.25rem 0;
|
||||
padding: 0.2rem 0;
|
||||
}
|
||||
|
||||
.sidebar-tab .directory-list .entity:hover {
|
||||
@ -1153,11 +1175,11 @@ ul, li {
|
||||
border-image-width: 4px;
|
||||
border-image-outset: 0px;
|
||||
}
|
||||
#controls .control-tools {
|
||||
max-height: calc(100vh - 156px);
|
||||
height: auto;
|
||||
#controls .control-tools {
|
||||
max-height: calc(100vh - 156px);
|
||||
height: auto;
|
||||
}
|
||||
#controls .scene-control.active, #controls .control-tool.active, #controls .scene-control:hover, #controls .control-tool:hover {
|
||||
#controls :is(.scene-control.active,.control-tool.active, .scene-control:hover, .control-tool:hover) {
|
||||
background: rgba(72, 46, 28, 1);
|
||||
background-origin: padding-box;
|
||||
border-image: url(img/ui/footer-button.webp) 10 repeat;
|
||||
@ -1343,8 +1365,8 @@ ul, li {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
.calendar-btn:hover {
|
||||
color: rgba(255, 255, 128, 0.7);
|
||||
border: 1px solid rgba(255, 128, 0, 0.8);
|
||||
color: var(--color-controls-hover);
|
||||
border: 1px solid var(--color-control-border-hover);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
397
system.json
397
system.json
@ -1,38 +1,43 @@
|
||||
{
|
||||
"name": "foundryvtt-reve-de-dragon",
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"author": "LeRatierBretonnien",
|
||||
"authors": [
|
||||
{
|
||||
"name": "LeRatierBretonnien"
|
||||
"name": "LeRatierBretonnien",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "VincentVK"
|
||||
"name": "VincentVK",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "Grendel"
|
||||
"name": "Grendel",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "Michael Nonne"
|
||||
"name": "Michael Nonne",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "Mandar"
|
||||
"name": "Mandar",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "Fred"
|
||||
"name": "Fred",
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "Fab"
|
||||
"name": "Fab",
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"url": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/",
|
||||
"license": "LICENSE.txt",
|
||||
"flags": {},
|
||||
"version": "10.0.1",
|
||||
"minimumCoreVersion": "10",
|
||||
"compatibleCoreVersion": "10",
|
||||
"scripts": [],
|
||||
"version": "10.0.15",
|
||||
"compatibility": {
|
||||
"minimum": "10"
|
||||
},
|
||||
"esmodules": [
|
||||
"module/rdd-main.js"
|
||||
],
|
||||
@ -44,12 +49,13 @@
|
||||
"lang": "en",
|
||||
"name": "English",
|
||||
"path": "lang/fr.json",
|
||||
"unreal": "this is a trick"
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"lang": "fr",
|
||||
"name": "Français",
|
||||
"path": "lang/fr.json"
|
||||
"path": "lang/fr.json",
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"packs": [
|
||||
@ -57,453 +63,278 @@
|
||||
"name": "competences",
|
||||
"label": "Compétences",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/competences.db",
|
||||
"path": "packs/competences.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"compétences"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "arts-et-divertissements",
|
||||
"label": "Arts et Divertissements",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/arts-et-divertissements.db",
|
||||
"path": "packs/arts-et-divertissements.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"recette",
|
||||
"cuisine",
|
||||
"danse",
|
||||
"musique",
|
||||
"chant",
|
||||
"jeux"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "competences-creatures",
|
||||
"label": "Compétences de Créatures",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/competences-creatures.db",
|
||||
"path": "packs/competences-creatures.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"compétences",
|
||||
"créatures"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "competences-entites",
|
||||
"label": "Compétences des Entités",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/competences-entites.db",
|
||||
"path": "packs/competences-entites.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"compétences",
|
||||
"entités"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "sorts-oniros",
|
||||
"label": "Sorts d'Oniros",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/sorts-oniros.db",
|
||||
"path": "packs/sorts-oniros.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"sorts"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "sorts-hypnos",
|
||||
"label": "Sorts d'Hypnos",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/sorts-hypnos.db",
|
||||
"path": "packs/sorts-hypnos.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"sorts"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "sorts-narcos",
|
||||
"label": "Sorts de Narcos",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/sorts-narcos.db",
|
||||
"path": "packs/sorts-narcos.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"sorts"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "sorts-thanatos",
|
||||
"label": "Sorts de Thanatos",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/sorts-thanatos.db",
|
||||
"path": "packs/sorts-thanatos.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"sorts"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "equipement",
|
||||
"label": "Equipement",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/equipement.db",
|
||||
"path": "packs/equipement.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"équipement",
|
||||
"objet"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "maladies-et-poisons",
|
||||
"label": "Maladies & Poisons",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/maladies-et-poisons.db",
|
||||
"path": "packs/maladies-et-poisons.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"maladie",
|
||||
"poison"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "rappel-des-regles",
|
||||
"label": "Rappels des Règles",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/rappel-des-regles.db",
|
||||
"path": "packs/rappel-des-regles.db",
|
||||
"type": "JournalEntry",
|
||||
"tags": [
|
||||
"journal",
|
||||
"règles"
|
||||
],
|
||||
"entity": "JournalEntry",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "queues-de-dragon",
|
||||
"label": "Queues de Dragon",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/queues-de-dragon.db",
|
||||
"path": "packs/queues-de-dragon.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"queue"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "ombres-de-thanatos",
|
||||
"label": "Ombres de Thanatos",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/ombres-de-thanatos.db",
|
||||
"path": "packs/ombres-de-thanatos.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"ombre"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "souffles-de-dragon",
|
||||
"label": "Souffles de Dragon",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/souffles-de-dragon.db",
|
||||
"path": "packs/souffles-de-dragon.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"souffle"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "tarot-draconique",
|
||||
"label": "Tarot Draconique",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/tarot-draconique.db",
|
||||
"path": "packs/tarot-draconique.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"tarot"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "tetes-de-dragon-pour-haut-revants",
|
||||
"label": "Têtes de Dragon (Hauts-Rêvants)",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/tetes-de-dragon-pour-haut-revants.db",
|
||||
"path": "packs/tetes-de-dragon-pour-haut-revants.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"tête"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "tetes-de-dragon-pour-tous-personnages",
|
||||
"label": "Têtes de Dragon (Tous Personnages)",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/tetes-de-dragon-pour-tous-personnages.db",
|
||||
"path": "packs/tetes-de-dragon-pour-tous-personnages.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"item",
|
||||
"tête"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "tables-diverses",
|
||||
"label": "Tables Diverses",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/tables-diverses.db",
|
||||
"path": "packs/tables-diverses.db",
|
||||
"type": "RollTable",
|
||||
"tags": [
|
||||
"table",
|
||||
"tables"
|
||||
],
|
||||
"entity": "RollTable",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "animaux",
|
||||
"label": "Animaux",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/animaux.db",
|
||||
"path": "packs/animaux.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"animaux",
|
||||
"creature"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "voyageurs",
|
||||
"label": "Voyageurs",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/voyageurs.db",
|
||||
"path": "packs/voyageurs.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"voyageur",
|
||||
"profils"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "vehicules",
|
||||
"label": "Véhicules",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/vehicules.db",
|
||||
"path": "packs/vehicules.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"vehicule",
|
||||
"bateau",
|
||||
"charett",
|
||||
"chariot",
|
||||
"carriole",
|
||||
"barque"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "archetypes",
|
||||
"label": "Archetypes PNJs",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/archetypes.db",
|
||||
"path": "packs/archetypes.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"archetype",
|
||||
"pnj"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "humanoides",
|
||||
"label": "Humanoïdes",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/humanoides.db",
|
||||
"path": "packs/humanoides.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"humanoides",
|
||||
"pnj"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "entites",
|
||||
"label": "Entités de Cauchemar",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/entites-de-cauchemar.db",
|
||||
"path": "packs/entites-de-cauchemar.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"entités",
|
||||
"entite",
|
||||
"cauchemar",
|
||||
"ecni",
|
||||
"eni"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "invocations",
|
||||
"label": "Invocation d'Hypnos",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/invocations.db",
|
||||
"path": "packs/invocations.db",
|
||||
"type": "Actor",
|
||||
"tags": [
|
||||
"hypnos",
|
||||
"invocation"
|
||||
],
|
||||
"entity": "Actor",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "botanique",
|
||||
"label": "Botanique",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/botanique.db",
|
||||
"path": "packs/botanique.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"plantes",
|
||||
"champignons",
|
||||
"herbes"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "taches-courantes",
|
||||
"label": "Tâches courantes",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/taches-courantes.db",
|
||||
"path": "packs/taches-courantes.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"taches"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "meditations-et-ecrits",
|
||||
"label": "Méditations et Ecrits",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/meditations-et-ecrits.db",
|
||||
"path": "packs/meditations-et-ecrits.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"meditations",
|
||||
"méditations",
|
||||
"livres",
|
||||
"livre",
|
||||
"méditation",
|
||||
"écrits",
|
||||
"écrit"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "recettes-alchimiques",
|
||||
"label": "Recettes Alchimiques",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/recettes-alchimiques.db",
|
||||
"path": "packs/recettes-alchimiques.db",
|
||||
"type": "Item",
|
||||
"tags": [
|
||||
"recettes",
|
||||
"recette",
|
||||
"alchimie",
|
||||
"alchimique",
|
||||
"potion"
|
||||
],
|
||||
"entity": "Item",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
},
|
||||
{
|
||||
"name": "scenes-rdd",
|
||||
"label": "Scenes Reve de Dragon",
|
||||
"system": "foundryvtt-reve-de-dragon",
|
||||
"module": "foundryvtt-reve-de-dragon",
|
||||
"path": "./packs/scenes-rdd.db",
|
||||
"path": "packs/scenes-rdd.db",
|
||||
"type": "Scene",
|
||||
"tags": [
|
||||
"ecran",
|
||||
"scene"
|
||||
],
|
||||
"entity": "Scene",
|
||||
"private": false
|
||||
"private": false,
|
||||
"flags": {}
|
||||
}
|
||||
],
|
||||
"system": [],
|
||||
"dependencies": [],
|
||||
"socket": true,
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.1.zip",
|
||||
"protected": false,
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.15.zip",
|
||||
"gridDistance": 1,
|
||||
"gridUnits": "m",
|
||||
"primaryTokenAttribute": "sante.vie",
|
||||
"secondaryTokenAttribute": "sante.endurance"
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<tr class="table-row alterne-row item" data-blessure-type="{{gravite}}" data-attribute={{key}} data-blessure-index="{{key}}" >
|
||||
<td class="item-control blessure-control" title="Blessure {{title}}" data-blessure-active="{{bless.active}}">
|
||||
<td class="blessure-control" title="Blessure {{title}}" data-blessure-active="{{bless.active}}">
|
||||
{{#if bless.active}}
|
||||
<i class="fas fa-skull-crossbones blessure-active-{{gravite}}" name="blessure-{{gravite}}-{{key}}-active"></i>
|
||||
{{else}}
|
||||
|
@ -41,7 +41,7 @@
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left flexcol">
|
||||
<ol class="carac-list alterne-list">
|
||||
{{#each data.carac as |carac key|}}
|
||||
{{#each system.carac as |carac key|}}
|
||||
<li class="flexrow list-item" data-attribute="{{key}}">
|
||||
{{#if (eq key 'taille')}}
|
||||
<span class="carac-label flexrow" name="system.carac.{{key}}.label">{{carac.label}}</span>
|
||||
@ -61,29 +61,29 @@
|
||||
</div>
|
||||
<div class="flex-group-left flexcol">
|
||||
<ol class="carac-list alterne-list">
|
||||
{{#each data.attributs as |attr key|}}
|
||||
{{#each system.attributs as |attr key|}}
|
||||
<li class="flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}</span>
|
||||
<input type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" />
|
||||
</li>
|
||||
{{/each}}
|
||||
<li class="flexrow list-item" data-attribute="vie">
|
||||
<span class="competence-label" name="data.sante.vie.label">Vie</span>
|
||||
<span class="competence-label" name="system.sante.vie.label">Vie</span>
|
||||
<span class="flexrow" >
|
||||
<input type="text" name="system.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number" /> /
|
||||
<input type="text" name="system.sante.vie.max" value="{{data.sante.vie.max}}" data-dtype="Number" />
|
||||
<input type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number" /> /
|
||||
<input type="text" name="system.sante.vie.max" value="{{system.sante.vie.max}}" data-dtype="Number" />
|
||||
</span>
|
||||
</li>
|
||||
<li class="flexrow list-item" data-attribute="endurance">
|
||||
<span class="competence-label" name="system.sante.endurance.label">Endurance</span>
|
||||
<span class="flexrow" >
|
||||
<input type="text" name="system.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number" /> /
|
||||
<input type="text" name="system.sante.endurance.max" value="{{data.sante.endurance.max}}" data-dtype="Number" />
|
||||
<input type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number" /> /
|
||||
<input type="text" name="system.sante.endurance.max" value="{{system.sante.endurance.max}}" data-dtype="Number" />
|
||||
</span>
|
||||
</li>
|
||||
<li class="flexrow list-item" data-attribute="etat">
|
||||
<span class="competence-label" name="system.compteurs.etat.label">Etat Général</span>
|
||||
<input type="text" value="{{data.compteurs.etat.value}}" disabled />
|
||||
<input type="text" value="{{system.compteurs.etat.value}}" disabled />
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
@ -108,8 +108,8 @@
|
||||
<input class="competence-value creature-dommages" type="text" compname="{{comp.name}}"
|
||||
value="{{numberFormat comp.system.dommages decimals=0 sign=true}}" data-dtype="number" />
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -126,35 +126,7 @@
|
||||
|
||||
{{!-- Equipment Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
|
||||
|
||||
<span class="item-name"><h4>Equipement porté</h4></span>
|
||||
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
|
||||
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
|
||||
{{#if options.isGM}}
|
||||
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
|
||||
{{/if}}
|
||||
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title flex-grow">Nom</span>
|
||||
<span class="competence-title">Q.</span>
|
||||
<span class="competence-title">Enc.</span>
|
||||
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
|
||||
</div>
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
@ -162,12 +134,12 @@
|
||||
|
||||
<div class="form-group">
|
||||
<span class="item-name"><h4>Race</h4></span>
|
||||
<input type="text" name="system.race" value="{{data.race}}" data-dtype="String" />
|
||||
<input type="text" name="system.race" value="{{system.race}}" data-dtype="String" />
|
||||
</div>
|
||||
|
||||
<div class="form-group editor">
|
||||
<span class="item-name"><h4>Description</h4>
|
||||
{{editor data.description target="system.description" button=true owner=owner editable=true}}
|
||||
{{editor system.description target="system.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
|
||||
|
@ -28,19 +28,19 @@
|
||||
|
||||
{{!-- Carac Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="carac">
|
||||
|
||||
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left flexcol">
|
||||
<ol class="carac-list alterne-list">
|
||||
{{#each data.carac as |carac key|}}
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
{{#each system.carac as |carac key|}}
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
{{#if (eq key 'taille')}}
|
||||
<span class="carac-label flexrow" name="data.carac.{{key}}.label">{{carac.label}}</span>
|
||||
<span class="carac-label flexrow" name="system.carac.{{key}}.label">{{carac.label}}</span>
|
||||
{{else}}
|
||||
<span class="carac-label flexrow" name="data.carac.{{key}}.label"><a
|
||||
<span class="carac-label flexrow" name="system.carac.{{key}}.label"><a
|
||||
name={{key}}>{{carac.label}}</a></span>
|
||||
{{/if}}
|
||||
<input class="competence-value flexrow" type="text" name="data.carac.{{key}}.value"
|
||||
<input class="competence-value flexrow" type="text" name="system.carac.{{key}}.value"
|
||||
value="{{carac.value}}" data-dtype="{{carac.type}}" />
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -50,37 +50,38 @@
|
||||
<div class="flex-group-left flexcol">
|
||||
|
||||
<ol class="carac-list alterne-list">
|
||||
<li class="competence flexrow list-item">
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<span class="carac-label flexrow" name="catEntite">Catégorie : </span>
|
||||
<select name="data.definition.categorieentite" value="{{data.definition.categorieentite}}" data-dtype="String">
|
||||
{{#select data.definition.categorieentite}}
|
||||
<select name="system.definition.categorieentite" value="{{system.definition.categorieentite}}" data-dtype="String">
|
||||
{{#select system.definition.categorieentite}}
|
||||
<option value="cauchemar">Cauchemar</option>
|
||||
<option value="reve">Rêve</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<li class="competence flexrow list-item">
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<span class="carac-label flexrow" name="typeEntite">Type d'entité : </span>
|
||||
<select name="data.definition.typeentite" value="{{data.definition.typeentite}}" data-dtype="String">
|
||||
{{#select data.definition.typeentite}}
|
||||
<select name="system.definition.typeentite" value="{{system.definition.typeentite}}" data-dtype="String">
|
||||
{{#select system.definition.typeentite}}
|
||||
<option value="incarne">Incarnée</option>
|
||||
<option value="nonincarne">Non Incarnée</option>
|
||||
<option value="blurette">Blurette</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
{{#each data.attributs as |attr key|}}
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="data.attributs.{{key}}.label">{{attr.label}} : </span>
|
||||
<span><input class="attribut-value flexrow" type="text" name="data.attributs.{{key}}.value"
|
||||
{{#each system.attributs as |attr key|}}
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="system.attributs.{{key}}.label">{{attr.label}} : </span>
|
||||
<span><input class="attribut-value flexrow" type="text" name="system.attributs.{{key}}.value"
|
||||
value="{{attr.value}}" data-dtype="{{attr.type}}" /></span>
|
||||
</li>
|
||||
{{/each}}
|
||||
<li class="competence flexrow list-item" data-attribute="endurance">
|
||||
<span class="competence-label flexrow" name="data.sante.endurance.label">Endurance : </span>
|
||||
<span><input class="sante-value flexrow" type="text" name="data.sante.endurance.value"
|
||||
value="{{data.sante.endurance.value}}" data-dtype="Number" /></span><span>/ </span>
|
||||
<span><input class="sante-value flexrow" type="text" name="data.sante.endurance.max"
|
||||
value="{{data.sante.endurance.max}}" data-dtype="Number" /></span>
|
||||
<li class="caracteristique flexrow list-item" data-attribute="endurance">
|
||||
<span class="competence-label flexrow" name="system.sante.endurance.label">Endurance : </span>
|
||||
<span><input class="sante-value flexrow" type="text" name="system.sante.endurance.value"
|
||||
value="{{system.sante.endurance.value}}" data-dtype="Number" /></span><span>/ </span>
|
||||
<span><input class="sante-value flexrow" type="text" name="system.sante.endurance.max"
|
||||
value="{{system.sante.endurance.max}}" data-dtype="Number" /></span>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
@ -89,9 +90,7 @@
|
||||
|
||||
{{!-- Compétences Tab --}}
|
||||
<div class="tab competences" data-group="primary" data-tab="competences">
|
||||
|
||||
<div class="flexcol">
|
||||
|
||||
<div class="flex-group-left flexcol competence-column">
|
||||
<ol class="item-list alterne-list">
|
||||
{{#each competences as |comp key|}}
|
||||
@ -99,46 +98,43 @@
|
||||
<img class="sheet-competence-img" src="{{comp.img}}" />
|
||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||
<input class="competence-value creature-carac" type="text" compname="{{comp.name}}"
|
||||
value="{{comp.data.carac_value}}" data-dtype="number" />
|
||||
value="{{comp.system.carac_value}}" data-dtype="number" />
|
||||
<input class="competence-value creature-niveau" type="text" compname="{{comp.name}}"
|
||||
value="{{numberFormat comp.data.niveau decimals=0 sign=true}}" data-dtype="number" />
|
||||
value="{{numberFormat comp.system.niveau decimals=0 sign=true}}" data-dtype="number" />
|
||||
<input class="competence-value creature-dommages" type="text" compname="{{comp.name}}"
|
||||
value="{{numberFormat comp.data.dommages decimals=0 sign=true}}" data-dtype="number" />
|
||||
value="{{numberFormat comp.system.dommages decimals=0 sign=true}}" data-dtype="number" />
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
</div>
|
||||
<div class="flex-group-left flexcol competence-column">
|
||||
<ol class="item-list alterne-list">
|
||||
{{#each possessions as |possession key|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{possession._id}}">
|
||||
<img class="sheet-competence-img" src="{{possession.img}}" />
|
||||
<span class="competence-label">{{possession.name}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
|
||||
<div class="flex-group-left flexcol competence-column">
|
||||
<ol class="item-list alterne-list">
|
||||
{{#each possessions as |possession key|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{possession._id}}">
|
||||
<img class="sheet-competence-img" src="{{possession.img}}" />
|
||||
<span class="competence-label">{{possession.name}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab description" data-group="primary" data-tab="description">
|
||||
<div class="form-group editor">
|
||||
{{editor data.description target="system.description" button=true owner=owner editable=true}}
|
||||
{{editor system.description target="system.description" button=true owner=owner editable=true}}
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</form>
|
@ -13,15 +13,15 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="table-row alterne-row" ><td/><td colspan="4">Légères</td></tr>
|
||||
{{#each data.blessures.legeres.liste as |bless key|}}
|
||||
{{#each system.blessures.legeres.liste as |bless key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="legere" title="Légère"}}
|
||||
{{/each}}
|
||||
<tr class="table-row alterne-row"><td/><td colspan="4">Graves</td></tr>
|
||||
{{#each data.blessures.graves.liste as |bless key|}}
|
||||
{{#each system.blessures.graves.liste as |bless key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="grave" title="Grave"}}
|
||||
{{/each}}
|
||||
<tr class="table-row alterne-row"><td/><td colspan="4">Critiques</td></tr>
|
||||
{{#each data.blessures.critiques.liste as |bless key|}}
|
||||
{{#each system.blessures.critiques.liste as |bless key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-blessure-partial.html" bless=bless key=key gravite="critique" title="Critique"}}
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
@ -1,27 +1,31 @@
|
||||
<header class="competence-header flexrow">
|
||||
<span class="competence-title">{{categorie}}</span>
|
||||
</header>
|
||||
<ul class="item-list alterne-list competence-list">
|
||||
{{#if @root.options.vueDetaillee}}
|
||||
<li class="item flexrow list-item ">
|
||||
|
||||
<span class="competence-label"></span>
|
||||
<span class="competence-value" >Niv.</span>
|
||||
<span class="competence-xp">xp</span>
|
||||
{{#if (eq categorie 'Draconic')}}
|
||||
<span class="competence-xp-sort">sort</span>
|
||||
{{/if}}
|
||||
<div class="item-controls">
|
||||
<i class="far fa-arrow-alt-circle-up"></i>
|
||||
<span class="competence-archetype">Arch</span>
|
||||
<i class="far fa-edit"></i>
|
||||
{{#if @root.options.isGM}}
|
||||
<i class="far fa-trash"></i>
|
||||
{{#if competences}}
|
||||
<div class="flex-shrink">
|
||||
<header class="competence-header flexrow">
|
||||
<span class="competence-title">{{categorie}}</span>
|
||||
</header>
|
||||
<ul class="item-list alterne-list competence-list">
|
||||
{{#if @root.options.vueDetaillee}}
|
||||
<li class="item flexrow list-item ">
|
||||
|
||||
<span class="competence-label"></span>
|
||||
<span class="competence-value" >Niv.</span>
|
||||
<span class="competence-xp">xp</span>
|
||||
{{#if (eq categorie 'Draconic')}}
|
||||
<span class="competence-xp-sort">sort</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#each competences as |comp key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
<div class="item-controls">
|
||||
<i class="far fa-arrow-alt-circle-up"></i>
|
||||
<span class="competence-archetype">Arch</span>
|
||||
<i class="far fa-edit"></i>
|
||||
{{#if @root.options.isGM}}
|
||||
<i class="far fa-trash"></i>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{#each competences as |comp key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-competence-partial.html" comp}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{#if visible}}
|
||||
{{#if system.isVisible}}
|
||||
<li class="item flexrow list-item {{#if system.isLevelUp}}xp-level-up tooltip{{/if}}" data-item-id="{{_id}}">
|
||||
<a class="competence-label" name="{{name}}">
|
||||
<img class="sheet-competence-img" src="{{img}}"/>
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
{{#if system.isLevelUp}}
|
||||
<span class="tooltiptext ttt-xp">Vous pouvez dépenser {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
|
||||
<a class="item-control competence-xp-augmenter" compname="{{name}}" title="Augmenter">
|
||||
<a class="competence-xp-augmenter" compname="{{name}}" title="Augmenter">
|
||||
<i class="fas fa-arrow-alt-circle-up"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
@ -31,7 +31,7 @@
|
||||
{{#if @root.options.vueDetaillee}}
|
||||
<div class="item-controls">
|
||||
{{#if system.stressXpMax}}
|
||||
<a class="item-control competence-stress-augmenter" compname="{{name}}"
|
||||
<a class="competence-stress-augmenter" compname="{{name}}"
|
||||
title="Dépenser {{system.stressXpMax}} points de stress {{#if system.isStressLevelUp}} pour augmenter d'un niveau {{/if}}">
|
||||
<i class="fas fa-arrow-alt-circle-up allouer-stress{{#if system.isStressLevelUp}}-level-up{{/if}}"></i>
|
||||
</a>
|
||||
@ -41,9 +41,9 @@
|
||||
<input class="competence-archetype niveau-archetype" type="text" compname="{{name}}" name="comp-archetype-{{name}}"
|
||||
value="{{numberFormat system.niveau_archetype decimals=0 sign=true}}" data-dtype="number"
|
||||
{{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
{{#if @root.options.isGM}}
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -1,9 +1,28 @@
|
||||
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
|
||||
{{#if (eq item.type 'conteneur')}}
|
||||
<span class="item-name conteneur-name flex-grow"><a data-item-id="{{item._id}}">+{{item.name}}</a></span>
|
||||
<span class="sheet-competence-img conteneur-name">
|
||||
{{#if vide}}
|
||||
<i class="far fa-square"></i>
|
||||
{{else}}
|
||||
<a data-item-id="{{item._id}}">
|
||||
{{#if ouvert}}
|
||||
<i class="far fa-minus-square"></i>
|
||||
<!-- <i class="far fa-caret-square-down"></i> -->
|
||||
{{else}}
|
||||
<i class="far fa-plus-square"></i>
|
||||
<!-- <i class="fas fa-caret-square-right"></i> -->
|
||||
{{/if}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="item-name conteneur-name flex-grow">
|
||||
<a data-item-id="{{item._id}}">
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
{{item.name}}
|
||||
</a>
|
||||
</span>
|
||||
{{else}}
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
<span class="item-name flex-grow">{{item.name}}</span>
|
||||
{{/if}}
|
||||
<span class="item-quantite">{{item.system.quantite}}
|
||||
@ -30,3 +49,4 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
48
templates/actor-sheet-inventaire-item.html
Normal file
48
templates/actor-sheet-inventaire-item.html
Normal file
@ -0,0 +1,48 @@
|
||||
<li class="item flexrow list-item" data-item-id="{{item._id}}" draggable="true">
|
||||
<span class="equipement-nom {{#if (eq item.type 'conteneur')}}conteneur-name{{/if}} ">
|
||||
{{#if (eq item.type 'conteneur')}}
|
||||
{{#if vide}}
|
||||
<i class="far fa-square"></i>
|
||||
{{else}}
|
||||
<a data-item-id="{{item._id}}">
|
||||
{{#if ouvert}}
|
||||
<i class="far fa-minus-square"></i>
|
||||
{{else}}
|
||||
<i class="far fa-plus-square"></i>
|
||||
{{/if}}
|
||||
</a>
|
||||
{{/if}}
|
||||
<a data-item-id="{{item._id}}">
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
<span>{{item.name}}</span>
|
||||
</a>
|
||||
{{else}}
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
<span>{{item.name}}</span>
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="equipement-detail">{{item.system.quantite}}
|
||||
{{#if (gt item.system.quantite 1)}}
|
||||
<a class="item-split" title="Séparer"><i class="fas fa-unlink"></i></a>
|
||||
{{/if}}
|
||||
</span>
|
||||
<span class="equipement-detail">{{numberFormat item.system.encTotal decimals=2}}</span>
|
||||
<span class="equipement-actions item-controls">
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
<a class="item-equip" title="Equiper">{{#if item.system.equipe}}<i class="fas fa-hand-rock"></i>{{else}}<i class="far fa-hand-paper"></i>{{/if}}</a>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
<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>
|
||||
|
||||
{{#if (or (eq item.type 'arme') (eq item.type 'conteneur') item.system.quantite)}}
|
||||
<a class="item-vendre" title="Vendre ou donner"><i class="fas fa-comments-dollar"></i></a>
|
||||
{{/if}}
|
||||
<a class="item-montrer" title="Montrer"><i class="fas fa-comment"></i></a>
|
||||
{{#if item.actionPrincipale}}
|
||||
<a class="item-action">{{item.actionPrincipale}}</a>
|
||||
{{/if}}
|
||||
</span>
|
||||
</li>
|
||||
|
@ -3,16 +3,26 @@
|
||||
{{#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="competence-title competence-label">{{piece.name}}</span>
|
||||
<span class="competence-title competence-label">{{piece.system.quantite}}</span>
|
||||
<span class="competence-title">
|
||||
<a class="monnaie-plus plus-moins">+</a>
|
||||
<a class="monnaie-moins plus-moins">-</a>
|
||||
<span class="equipement-nom">{{piece.name}}</span>
|
||||
<span class="equipement-detail item-controls">
|
||||
<a class="monnaie-moins"><i class="fas fa-minus-square"></i></a>
|
||||
</span>
|
||||
<span class="equipement-detail">
|
||||
<span>{{piece.system.quantite}}</span>
|
||||
</span>
|
||||
<span class="equipement-detail item-controls">
|
||||
<a class="monnaie-plus"><i class="fas fa-plus-square"></i></a>
|
||||
</span>
|
||||
|
||||
<!-- <span class="equipement-detail">
|
||||
<span class="flex-shrink"><a class="monnaie-moins"><i class="fas fa-minus-square"></i></a></span>
|
||||
<span>{{piece.system.quantite}}</span>
|
||||
<span class="flex-shrink"><a class="monnaie-plus"><i class="fas fa-plus-square"></i></a></span>
|
||||
</span> -->
|
||||
<span class="equipement-actions 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>
|
||||
</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
26
templates/actor-sheet-inventaire.html
Normal file
26
templates/actor-sheet-inventaire.html
Normal file
@ -0,0 +1,26 @@
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
|
||||
|
||||
<span class="item-name"><h4>Equipement</h4></span>
|
||||
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{system.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
|
||||
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
|
||||
{{#if options.isGM}}
|
||||
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
|
||||
{{/if}}
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<span class="equipement-nom">Nom</span>
|
||||
<span class="equipement-detail">Q.</span>
|
||||
<span class="equipement-detail">Enc.</span>
|
||||
<span class="equipement-actions">Actions</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-item.html" item=item vide=true ouvert=true }}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</ul>
|
9
templates/actor-sheet-item-queue.html
Normal file
9
templates/actor-sheet-item-queue.html
Normal file
@ -0,0 +1,9 @@
|
||||
<li class="item flexrow" data-attribute={{key}} data-item-id="{{queue._id}}">
|
||||
<span class="display-label flex-grow"><a>{{queue.name}}</a></span>
|
||||
<div class="item-controls">
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
{{#if queue.system.refoulement}}
|
||||
<a class="item-action">Refouler</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</li>
|
12
templates/actor-sheet-liens-animaux.html
Normal file
12
templates/actor-sheet-liens-animaux.html
Normal file
@ -0,0 +1,12 @@
|
||||
<span class="item-name"><h4>Compagnons animaux</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.montures as |monture id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{monture.id}}">
|
||||
<img class="sheet-competence-img" src="{{monture.img}}" title="{{monture.name}}"/>
|
||||
<span class="subacteur-label"><a>{{monture.name}}</a></span>
|
||||
<div class="flex-shrink">
|
||||
<a class="subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
12
templates/actor-sheet-liens-suivants.html
Normal file
12
templates/actor-sheet-liens-suivants.html
Normal file
@ -0,0 +1,12 @@
|
||||
<span class="item-name"><h4>Suivants</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.suivants as |suivant id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{suivant.id}}">
|
||||
<img class="sheet-competence-img" src="{{suivant.img}}" title="{{suivant.name}}"/>
|
||||
<span class="competence-title subacteur-label"><a>{{suivant.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
15
templates/actor-sheet-liens-vehicules.html
Normal file
15
templates/actor-sheet-liens-vehicules.html
Normal file
@ -0,0 +1,15 @@
|
||||
<span class="item-name"><h4>Véhicules</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.vehicules as |vehicule id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{vehicule.id}}">
|
||||
<img class="sheet-competence-img" src="{{vehicule.img}}" title="{{vehicule.name}}"/>
|
||||
<span class="flex-grow subacteur-label"><a>{{vehicule.name}}</a></span>
|
||||
<span>{{vehicule.categorie}}</span>
|
||||
<span>{{vehicule.structure}}</span>
|
||||
<div class="flex-shrink">
|
||||
<a class="subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
@ -4,8 +4,8 @@
|
||||
<a>{{oeuvre.name}} (niveau {{oeuvre.system.niveau}})</a>
|
||||
</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
15
templates/actor-sheet-queues.html
Normal file
15
templates/actor-sheet-queues.html
Normal file
@ -0,0 +1,15 @@
|
||||
{{#if (or queues.length ombres.length)}}
|
||||
<h3>
|
||||
{{#if queues.length}}Queues de Dragon{{/if}}
|
||||
{{#if (and queues.length ombres.length)}} et {{/if}}
|
||||
{{#if ombres.length}}Ombres de Thanatos{{/if}}
|
||||
:</h3>
|
||||
<ul class="flex-group-left">
|
||||
{{#each queues as |queue key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-item-queue.html" queue=queue key=key}}
|
||||
{{/each}}
|
||||
{{#each ombres as |ombre key|}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-item-queue.html" queue=ombre key=key}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
@ -10,40 +10,40 @@
|
||||
<div class="flexrow">
|
||||
<ul class="flex-group-center flex-compteurs">
|
||||
<li>
|
||||
<label class="ctn-vie">
|
||||
<label class="compteur">
|
||||
<a class="jet-vie">Vie</a>
|
||||
<a class="vie-moins plus-moins">-</a>
|
||||
<input class="resource-content" type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number"/>
|
||||
<span>/ {{data.sante.vie.max}}</span>
|
||||
<a class="vie-plus plus-moins">+</a>
|
||||
<a class="vie-moins"><i class="fas fa-minus-square"></i></a>
|
||||
<input class="resource-content" type="text" name="system.sante.vie.value" value="{{system.sante.vie.value}}" data-dtype="Number"/>
|
||||
<span>/ {{system.sante.vie.max}}</span>
|
||||
<a class="vie-plus"><i class="fas fa-plus-square"></i></a>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="ctn-endu">
|
||||
<a class="jet-endurance">Endurance</a>
|
||||
<a class="endurance-moins plus-moins">-</a>
|
||||
<input class="resource-content" type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number"/>
|
||||
<span>/ {{data.sante.endurance.max}}</span>
|
||||
<a class="endurance-plus plus-moins">+</a>
|
||||
<label class="compteur">
|
||||
<a class="jet-endurance">Endurance</a>
|
||||
<a class="endurance-moins"><i class="fas fa-minus-square"></i></a>
|
||||
<input class="resource-content" type="text" name="system.sante.endurance.value" value="{{system.sante.endurance.value}}" data-dtype="Number"/>
|
||||
<span>/ {{system.sante.endurance.max}}</span>
|
||||
<a class="endurance-plus"><i class="fas fa-plus-square"></i></a>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="appliquerFatigue ctn-fatigue tooltip">
|
||||
<label class="appliquerFatigue compteur tooltip">
|
||||
<span class="tooltiptext ttt-fatigue">{{{calc.fatigue.html}}}</span>
|
||||
Fatigue
|
||||
<a class="fatigue-moins plus-moins">-</a>
|
||||
<input class="resource-content" id="fatigue-value" type="text" name="data.sante.fatigue.value" value="{{data.sante.fatigue.value}}" data-dtype="Number" />
|
||||
<span>/ {{data.sante.fatigue.max}}</span>
|
||||
<a class="fatigue-plus plus-moins">+</a>
|
||||
<a class="fatigue-moins"><i class="fas fa-minus-square"></i></a>
|
||||
<input class="resource-content" id="fatigue-value" type="text" name="system.sante.fatigue.value" value="{{system.sante.fatigue.value}}" data-dtype="Number" />
|
||||
<span>/ {{system.sante.fatigue.max}}</span>
|
||||
<a class="fatigue-plus"><i class="fas fa-plus-square"></i></a>
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<label class="ctn-reve">
|
||||
<label class="compteur">
|
||||
<span class="ptreve-actuel"><a>Rêve</a></span>
|
||||
<a class="ptreve-actuel-moins plus-moins">-</a>
|
||||
<input class="resource-content" id="pointsreve-value" type="text" name="data.reve.reve.value" value="{{data.reve.reve.value}}" data-dtype="Number" />
|
||||
<span>/ {{data.reve.seuil.value}}</span>
|
||||
<a class="ptreve-actuel-plus plus-moins">+</a>
|
||||
<a class="ptreve-actuel-moins"><i class="fas fa-minus-square"></i></a>
|
||||
<input class="resource-content" id="pointsreve-value" type="text" name="system.reve.reve.value" value="{{system.reve.reve.value}}" data-dtype="Number" />
|
||||
<span>/ {{system.reve.seuil.value}}</span>
|
||||
<a class="ptreve-actuel-plus"><i class="fas fa-plus-square"></i></a>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
@ -52,7 +52,7 @@
|
||||
<span class="encaisser-direct"><a title="Encaisser des dommages"><img class="button-img" src="icons/svg/bones.svg" alt="Encaisser des dommages"/></a></span>
|
||||
<span class="gm-only remise-a-neuf"><a title="Remise à neuf"><img class="button-img" src="icons/svg/regen.svg" alt="Remise à neuf"/></a></span>
|
||||
<span class="repos"><a title="Repos"><img class="button-img" src="icons/svg/sleep.svg" alt="Se reposer"/></a></span>
|
||||
{{#if data.attributs.hautrevant.value}}
|
||||
{{#if system.attributs.hautrevant.value}}
|
||||
<span class="monte-tmr"><a title="Montée dans les Terres Médianes !" {{#if hautreve.isDemiReve}}disabled{{/if}}><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-normal.svg" alt="Montée dans les Terres Médianes !"/></a></span>
|
||||
<span class="monte-tmr-rapide"><a title="Montée accélérée dans les Terres Médianes !"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-rapide.svg" alt="Montée accélérée dans les Terres Médianes !"/></a></span>
|
||||
<span class="visu-tmr"><a title="Regarder les Terres Médianes"><img class="button-img" src="systems/foundryvtt-reve-de-dragon/styles/img/ui/icon-tmr-view.svg" alt="Regarder les Terres Médianes"/></a></span>
|
||||
@ -65,8 +65,8 @@
|
||||
<span>{{calc.resumeBlessures}}</span>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<span>{{data.compteurs.etat.label}}: {{data.compteurs.etat.value}}</span>
|
||||
<span>{{data.compteurs.surenc.label}}: {{data.compteurs.surenc.value}}</span>
|
||||
<span>{{system.compteurs.etat.label}}: {{system.compteurs.etat.value}}</span>
|
||||
<span>{{system.compteurs.surenc.label}}: {{system.compteurs.surenc.value}}</span>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-effects-partial.html"}}
|
||||
@ -100,38 +100,38 @@
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left flexcol">
|
||||
<ul class="carac-list alterne-list">
|
||||
{{#each data.carac as |carac key|}}
|
||||
{{#each system.carac as |carac key|}}
|
||||
{{#if carac.isLevelUp}}
|
||||
<li class="competence flexrow item-list xp-level-up" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow item-list xp-level-up" data-attribute="{{key}}">
|
||||
{{else}}
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
{{/if}}
|
||||
{{#if (eq key 'taille')}}
|
||||
<span class="carac-label" name="data.carac.{{key}}.label">{{carac.label}}</span>
|
||||
<input class="carac-value" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<span class="carac-label" name="system.carac.{{key}}.label">{{carac.label}}</span>
|
||||
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<label class="carac-xp"/>
|
||||
{{else}}
|
||||
{{#if carac.derivee}}
|
||||
<span class="carac-label" name="data.carac.{{key}}.label"> <a name={{key}}>{{carac.label}}</a></span>
|
||||
<span class="carac-label" name="system.carac.{{key}}.label"> <a name={{key}}>{{carac.label}}</a></span>
|
||||
<label class="competence-value">{{carac.value}}</label>
|
||||
<label class="carac-xp"/>
|
||||
{{else}}
|
||||
{{#if carac.isLevelUp}}
|
||||
<span class="carac-label tooltip" name="data.carac.{{key}}.label">
|
||||
<span class="carac-label tooltip" name="system.carac.{{key}}.label">
|
||||
<span class="tooltiptext ttt-xp">
|
||||
Vous pouvez dépenser {{carac.xpNext}} points d'Experience pour augmenter de 1 votre caractéristique {{carac.label}}
|
||||
</span>
|
||||
<a name={{key}}>{{carac.label}}</a></span>
|
||||
{{else}}
|
||||
<span class="carac-label tooltip" name="data.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span>
|
||||
<span class="carac-label tooltip" name="system.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span>
|
||||
{{/if}}
|
||||
<input class="carac-value" type="text" name="data.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<span class="carac-xp tooltip">
|
||||
<input class="carac-xp" type="text" name="data.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.editCaracComp}}disabled{{/unless}} />
|
||||
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
|
||||
</span>
|
||||
{{#if carac.isLevelUp}}
|
||||
<a class="item-control carac-xp-augmenter" name="augmenter.{{key}}" title="Augmenter">
|
||||
<a class="carac-xp-augmenter" name="augmenter.{{key}}" title="Augmenter">
|
||||
<i class="fas fa-arrow-alt-circle-up"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
@ -139,27 +139,27 @@
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/each}}
|
||||
<li class="competence flexrow">
|
||||
<li class="caracteristique flexrow">
|
||||
<span class="carac-label" name="carac-total">Total Caractéristiques </span>
|
||||
<span class="competence-value total" name="carac-total-value">{{calc.caracTotal}} </span>
|
||||
</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="flex-group-left flexcol" >
|
||||
<ul class="carac-list">
|
||||
<li class="competence flexrow list-item">
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<span class="carac-label" name="beaute">Beauté :</span>
|
||||
<input class="description-value" type="text" name="data.beaute" value="{{data.beaute}}" data-dtype="String" {{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
|
||||
<input class="description-value" type="text" name="system.beaute" value="{{system.beaute}}" data-dtype="String" {{#unless @root.options.editCaracComp}}disabled{{/unless}}/>
|
||||
<label class="carac-xp"/>
|
||||
</li>
|
||||
{{#each data.attributs as |attr key|}}
|
||||
{{#each system.attributs as |attr key|}}
|
||||
{{#unless (eq key 'hautrevant')}}
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label" name="data.attributs.{{key}}.label">{{attr.label}} :</span>
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}} :</span>
|
||||
{{#if (eq key 'protection')}}
|
||||
<input class="description-value" id="attribut-protection-edit" type="text" name="{{key}}" value="{{attr.value}}" data-dtype="number"/>
|
||||
{{else}}
|
||||
<input class="description-value" type="text" disabled name="data.attributs.{{key}}." value="{{attr.value}}" data-dtype="number"/>
|
||||
<input class="description-value" type="text" disabled name="system.attributs.{{key}}." value="{{attr.value}}" data-dtype="number"/>
|
||||
{{/if}}
|
||||
<label class="carac-xp"/>
|
||||
</li>
|
||||
@ -167,19 +167,19 @@
|
||||
{{/each}}
|
||||
</ul>
|
||||
<ul class="carac-list alterne-list">
|
||||
<li class="competence flexrow list-item">
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<span class="attribut-label chance-actuelle"><a>Chance actuelle</a></span>
|
||||
<input class="description-value compteur-edit" type="text" name="chance" value="{{data.compteurs.chance.value}}" data-dtype="number"/>
|
||||
<span class="utiliser-attribut" style="padding-left: 5px"><a class="item-control chance-appel">Utiliser</a></span>
|
||||
<input class="description-value compteur-edit" type="text" name="chance" value="{{system.compteurs.chance.value}}" data-dtype="number"/>
|
||||
<span class="utiliser-attribut" style="padding-left: 5px"><a class="chance-appel">Utiliser</a></span>
|
||||
</li>
|
||||
{{#each data.compteurs as |compteur key|}}
|
||||
{{#each system.compteurs as |compteur key|}}
|
||||
{{#if (eq compteur.label 'Chance')}}
|
||||
{{else if (eq compteur.label 'Experience')}}
|
||||
{{else if compteur.isInput}}
|
||||
<li class="competence flexrow list-item">
|
||||
<li class="caracteristique flexrow list-item">
|
||||
<span class="attribut-label">{{compteur.label}}</span>
|
||||
{{#if (eq compteur.label 'Ethylisme')}}
|
||||
<select class="description-value" name="data.compteurs.ethylisme.value" id="ethylisme" data-dtype="Number">
|
||||
<select class="description-value" name="system.compteurs.ethylisme.value" id="ethylisme" data-dtype="Number">
|
||||
{{#select compteur.value}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/niveau-ethylisme.html"}}
|
||||
{{/select}}
|
||||
@ -189,9 +189,9 @@
|
||||
{{/if}}
|
||||
<span class="utiliser-attribut" style="padding-left: 5px">
|
||||
{{#if compteur.isStress}}
|
||||
<a class="item-control stress-test" title="Transformer">Transformer</a>
|
||||
<a class="stress-test" title="Transformer">Transformer</a>
|
||||
{{else if (eq compteur.label 'Ethylisme')}}
|
||||
<a class="item-control ethylisme-test" id="ethylisme-test" title="Jet d'Ethylisme">Boire</a>
|
||||
<a class="ethylisme-test" id="ethylisme-test" title="Jet d'Ethylisme">Boire</a>
|
||||
{{else if (eq compteur.label 'Moral')}}
|
||||
<a class="moral-malheureux" title="Jet de moral situation malheureuse"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/moral-malheureux.svg" alt="Jet de moral situation malheureuse"/></a>
|
||||
<a class="moral-neutre" title="Jet de moral situation neutre"><img class="small-button-container" src="systems/foundryvtt-reve-de-dragon/icons/moral-neutre.svg" alt="Jet de moral situation neutre"/></a>
|
||||
@ -215,11 +215,9 @@
|
||||
<span><a class="lock-unlock-sheet"><img class="small-button-container"
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer">
|
||||
{{#if options.editCaracComp}}Verrouiller{{else}}Déverrouiller{{/if}}</a></span>
|
||||
<span class="flexrow">
|
||||
<i class="fas fa-search"></i>
|
||||
<input class="cherchercompetence" type="text" value="{{options.cherchercompetence}}" name="cherchercompetence"
|
||||
size="8" data-dtype="String" placeholder="chercher"/>
|
||||
<span></span>
|
||||
<span>
|
||||
<input class="recherche flex-grow" type="text" value="{{options.recherche.text}}" name="recherche"
|
||||
size="8" data-dtype="String" placeholder="chercher"/>
|
||||
</span>
|
||||
<span><a class="show-hide-competences"><img class="small-button-container"
|
||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if options.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout">
|
||||
@ -232,25 +230,25 @@
|
||||
</div>
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left flexcol competence-column">
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.generale) categorie="Compétences générales"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.particuliere) categorie="Compétences Particulières"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.specialisee) categorie="Compétences Spécialisées"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.generale) categorie="Compétences générales"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.particuliere) categorie="Compétences Particulières"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.specialisee) categorie="Compétences Spécialisées"}}
|
||||
</div>
|
||||
|
||||
<div class="flex-group-left flexcol competence-column">
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.melee) categorie="Compétences de Mêlée"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.tir) categorie="Compétences de Tir"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.lancer) categorie="Compétences de Lancer"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.connaissance) categorie="Connaissances"}}
|
||||
{{#if (or data.attributs.hautrevant.value options.vueDetaillee)}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(sortCompetence competenceByCategory.draconic) categorie="Draconic"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.melee) categorie="Compétences de Mêlée"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.tir) categorie="Compétences de Tir"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.lancer) categorie="Compétences de Lancer"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.connaissance) categorie="Connaissances"}}
|
||||
{{#if (or system.attributs.hautrevant.value options.vueDetaillee)}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-categorie-competences-partial.html" competences=(filtreTriCompetences competenceByCategory.draconic) categorie="Draconic"}}
|
||||
{{/if}}
|
||||
|
||||
<div>
|
||||
<ul class="item-list">
|
||||
<li class="item flexrow">
|
||||
<span class="generic-label">Stress transformé</span>
|
||||
<input class="compteur-edit" type="text" name="experience" value="{{data.compteurs.experience.value}}" data-dtype="number" size="3"/>
|
||||
<input class="compteur-edit" type="text" name="experience" value="{{system.compteurs.experience.value}}" data-dtype="number" size="3"/>
|
||||
</li>
|
||||
|
||||
<li class="item flexrow">
|
||||
@ -302,7 +300,7 @@
|
||||
</li>
|
||||
{{/each}}
|
||||
{{#each esquives as |esq key|}}
|
||||
<li class="item flexrow list-item">
|
||||
<li class="item flexrow list-item" data-item-id="{{esq._id}}">
|
||||
<span class="competence-label">
|
||||
<a class="competence-label" name="{{esq.name}}">
|
||||
<img class="sheet-competence-img" src="{{esq.img}}"/>
|
||||
@ -311,7 +309,7 @@
|
||||
</span>
|
||||
<span class="arme-initiative"></span>
|
||||
<span class="competence-label"></span>
|
||||
<span class="competence-value">{{numberFormat esq.data.niveau decimals=0 sign=true}}</span>
|
||||
<span class="competence-value">{{numberFormat esq.system.niveau decimals=0 sign=true}}</span>
|
||||
<span class="competence-value"></span>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -334,7 +332,7 @@
|
||||
{{#each maladiesPoisons as |maladie key|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{maladie._id}}">
|
||||
<span class="competence-label">
|
||||
{{#if (or @root.options.isGM maladie.data.identifie)}}
|
||||
{{#if (or @root.options.isGM maladie.system.identifie)}}
|
||||
{{maladie.name}}
|
||||
{{else}}
|
||||
Inconnue
|
||||
@ -342,15 +340,15 @@
|
||||
</span>
|
||||
<span class="competence-label">{{maladie.type}}</span>
|
||||
<span class="competence-label">
|
||||
{{#if (or @root.options.isGM maladie.data.remedesconnus)}}
|
||||
{{maladie.data.remedes}}
|
||||
{{#if (or @root.options.isGM maladie.system.remedesconnus)}}
|
||||
{{maladie.system.remedes}}
|
||||
{{else}}
|
||||
Remèdes Inconnus
|
||||
{{/if}}
|
||||
</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -372,8 +370,8 @@
|
||||
</span>
|
||||
<span class="competence-label">{{possession.system.type}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Modifier"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -391,8 +389,8 @@
|
||||
(or @root.options.isGM (not tache.system.cacher_points_de_tache))
|
||||
}}/{{tache.system.points_de_tache}}{{/if}})</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -421,8 +419,8 @@
|
||||
{{#each jeux as |jeu id|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{jeu._id}}"><span class="competence-title jeu-label"><a>{{jeu.name}} (base {{jeu.system.base}})</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -432,8 +430,8 @@
|
||||
{{#each recettesAlchimiques as |recette id|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{recette._id}}"><span class="competence-title recette-label item-edit"><a>{{recette.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -446,13 +444,13 @@
|
||||
{{!-- hautreve Tab --}}
|
||||
<div class="tab hautreve " data-group="primary" data-tab="hautreve" style="height:200px">
|
||||
<div>
|
||||
{{#if data.attributs.hautrevant.value}}
|
||||
{{#if system.attributs.hautrevant.value}}
|
||||
<h3>Haut rêvant</h3>
|
||||
{{else}}
|
||||
<h3>Vous n'avez pas le don de haut-rêve! Il faut attribuer la Tête de Dragon 'Don de Haut Rêve' si votre personnage est ou devient Haut-Rêvant.</h3>
|
||||
{{/if}}
|
||||
<ul class="item-list">
|
||||
{{#if data.attributs.hautrevant.value}}
|
||||
{{#if system.attributs.hautrevant.value}}
|
||||
{{#if options.isGM}}
|
||||
<li class="item flexrow">
|
||||
<span>
|
||||
@ -466,23 +464,23 @@
|
||||
<li class="item flexrow">
|
||||
{{#if options.isGM}}
|
||||
<span class="competence-label flex-shrink">Demi rêve :
|
||||
<span>{{caseTmr-label data.reve.tmrpos.coord}}</span>
|
||||
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
|
||||
</span>
|
||||
<span>
|
||||
<input class="competence-value" type="text" name="data.reve.tmrpos.coord" value="{{data.reve.tmrpos.coord}}" data-dtype="String"/>
|
||||
<input class="competence-value" type="text" name="system.reve.tmrpos.coord" value="{{system.reve.tmrpos.coord}}" data-dtype="String"/>
|
||||
</span>
|
||||
|
||||
{{else}}
|
||||
<span class="competence-label flex-shrink">Demi rêve :
|
||||
{{#unless hautreve.cacheTMR}}
|
||||
<span>{{caseTmr-label data.reve.tmrpos.coord}}</span>
|
||||
<span>{{caseTmr-label system.reve.tmrpos.coord}}</span>
|
||||
{{/unless}}
|
||||
</span>
|
||||
<span>
|
||||
{{#if hautreve.cacheTMR}}
|
||||
??
|
||||
{{else}}
|
||||
{{data.reve.tmrpos.coord}}
|
||||
{{system.reve.tmrpos.coord}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
@ -492,9 +490,9 @@
|
||||
<span class="competence-label">Seuil de Rêve :</span>
|
||||
<span>
|
||||
{{#if options.isGM}}
|
||||
<input class="seuil-reve-value" type="text" name="data.reve.seuil.value" value="{{data.reve.seuil.value}}" data-dtype="Number"/>
|
||||
<input class="seuil-reve-value" type="text" name="system.reve.seuil.value" value="{{system.reve.seuil.value}}" data-dtype="Number"/>
|
||||
{{else}}
|
||||
{{data.reve.seuil.value}}
|
||||
{{system.reve.seuil.value}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</li>
|
||||
@ -502,9 +500,9 @@
|
||||
<span class="competence-label">Refoulement : </span>
|
||||
<span>
|
||||
{{#if options.isGM}}
|
||||
<input class="competence-value" type="text" name="data.reve.refoulement.value" value="{{data.reve.refoulement.value}}" data-dtype="Number"/>
|
||||
<input class="competence-value" type="text" name="system.reve.refoulement.value" value="{{system.reve.refoulement.value}}" data-dtype="Number"/>
|
||||
{{else}}
|
||||
{{data.reve.refoulement.value}}
|
||||
{{system.reve.refoulement.value}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</li>
|
||||
@ -512,32 +510,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
{{!-- Queues, Souffles, Tetes, Ombre --}}
|
||||
{{#if queues.length}}
|
||||
<h3>Queues:</h3>
|
||||
<ul class="flex-group-left">
|
||||
{{#each queues as |queue key|}}
|
||||
<li class="item flexrow" data-attribute={{key}} data-item-id="{{queue._id}}">
|
||||
<span class="display-label flex-grow"><a data-item-id="{{queue._id}}">{{queue.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{#if ombres.length}}
|
||||
<h3>Ombres de Thanatos:</h3>
|
||||
<ul class="item-list">
|
||||
{{#each ombres as |ombre key|}}
|
||||
<li class="item flexrow" data-attribute={{key}} data-item-id="{{ombre._id}}">
|
||||
<span class="display-label flex-grow"><a data-item-id="{{ombre._id}}">{{ombre.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-queues.html"}}
|
||||
{{#if souffles.length}}
|
||||
<h3>Souffles:</h3>
|
||||
<ul class="item-list">
|
||||
@ -545,7 +518,7 @@
|
||||
<li class="item flexrow" data-attribute={{key}} data-item-id="{{souffle._id}}">
|
||||
<span class="display-label flex-grow"><a data-item-id="{{souffle._id}}">{{souffle.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -558,22 +531,22 @@
|
||||
<li class="item flexrow" data-attribute={{key}} data-item-id="{{tete._id}}">
|
||||
<span class="display-label flex-grow"><a data-item-id="{{tete._id}}">{{tete.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
{{#if data.attributs.hautrevant.value}}
|
||||
{{#if system.attributs.hautrevant.value}}
|
||||
{{#if (and options.isGM signesdraconiques.length)}}
|
||||
<h3>Signes draconiques</h3>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each signesdraconiques as |signe key|}}
|
||||
<li class="item list-item flexrow" data-item-id="{{signe._id}}" data-attribute="{{key}}">
|
||||
<span class="display-label flex-grow"> <a data-item-id="{{signe._id}}">{{signe.name}}</a></span>
|
||||
<span class="flex-shrink">{{signe.data.difficulte}}</span>
|
||||
<span class="flex-shrink">{{signe.system.difficulte}}</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -591,7 +564,7 @@
|
||||
<span>{{upperFirst rencontre.heure}}, le {{rencontre.date}}</span>
|
||||
{{/if}}
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control rencontre-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="rencontre-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -601,12 +574,12 @@
|
||||
<h3>Sorts en Réserve:</h3>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each hautreve.sortsReserve as |reserve key|}}
|
||||
<li class="item list-item flexrow" data-item-id="{{reserve._id}}" data-attribute="{{key}}">
|
||||
<li class="item list-item flexrow" data-index="{{key}}">
|
||||
<img class="sheet-competence-img" src="{{reserve.sort.img}}" />
|
||||
<span class="display-label">{{reserve.sort.name}} r{{reserve.sort.system.ptreve_reel}}</span>
|
||||
<span>{{reserve.coord}} - {{caseTmr-label reserve.coord}}</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete flex-shrink" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="sort-reserve-delete flex-shrink" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -626,7 +599,7 @@
|
||||
</span>
|
||||
<span>{{sort.system.draconic}} / {{sort.system.difficulte}}</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -638,8 +611,8 @@
|
||||
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
|
||||
<span class="meditation-label flex-grow"><a data-item-id="{{meditation._id}}">{{meditation.name}} - {{meditation.system.competence}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<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>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -653,7 +626,7 @@
|
||||
<span class="display-label"><a data-item-id="{{casetmr._id}}">{{casetmr.name}}</a></span>
|
||||
<span>{{casetmr.system.coord}} - {{caseTmr-label casetmr.system.coord}}</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
<a class="item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
@ -666,79 +639,10 @@
|
||||
{{!-- Equipment Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
|
||||
|
||||
<span class="item-name"><h4>Equipement porté</h4></span>
|
||||
<div>
|
||||
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.attributs.encombrement.value}} <b>{{calc.surEncombrementMessage}}</b></span> -
|
||||
<span class="item-name">Estimation de l'équipement : {{numberFormat calc.prixTotalEquipement decimals=2}} Sols</span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
|
||||
{{#if options.isGM}}
|
||||
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title flex-grow">Nom</span>
|
||||
<span class="competence-title">Q.</span>
|
||||
<span class="competence-title">Enc.</span>
|
||||
<span class="competence-title flex-grow">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-conteneur.html" item=item }}
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<span class="item-name"><h4>Compagnons animaux</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.montures as |monture id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{monture.id}}">
|
||||
<img class="sheet-competence-img" src="{{monture.img}}" title="{{monture.name}}"/>
|
||||
<span class="competence-title subacteur-label"><a>{{monture.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<span class="item-name"><h4>Véhicules</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.vehicules as |vehicule id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{vehicule.id}}">
|
||||
<img class="sheet-competence-img" src="{{vehicule.img}}" title="{{vehicule.name}}"/>
|
||||
<span class="competence-title subacteur-label"><a>{{vehicule.name}}</a></span>
|
||||
<span class="competence-title">{{vehicule.categorie}}</span>
|
||||
<span class="competence-title">{{vehicule.structure}}</span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
||||
<span class="item-name"><h4>Suivants</h4></span>
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each subacteurs.suivants as |suivant id|}}
|
||||
<li class="item flexrow list-item" data-actor-id="{{suivant.id}}">
|
||||
<img class="sheet-competence-img" src="{{suivant.img}}" title="{{suivant.name}}"/>
|
||||
<span class="competence-title subacteur-label"><a>{{suivant.name}}</a></span>
|
||||
<div class="item-controls flex-shrink">
|
||||
<a class="item-control subacteur-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-animaux.html"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-suivants.html"}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-liens-vehicules.html"}}
|
||||
|
||||
</div>
|
||||
|
||||
@ -747,50 +651,50 @@
|
||||
<article class="flexrow">
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.race">Race :</label>
|
||||
<input class="flex-grow" type="text" name="data.race" value="{{data.race}}" data-dtype="String"/>
|
||||
<label for="system.race">Race :</label>
|
||||
<input class="flex-grow" type="text" name="system.race" value="{{system.race}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.sexe">Sexe :</label>
|
||||
<input class="flex-grow" type="text" name="data.sexe" value="{{data.sexe}}" data-dtype="String"/>
|
||||
<label for="system.sexe">Sexe :</label>
|
||||
<input class="flex-grow" type="text" name="system.sexe" value="{{system.sexe}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.age">Age :</label>
|
||||
<input class="flex-grow" type="text" name="data.age" value="{{data.age}}" data-dtype="String"/>
|
||||
<label for="system.age">Age :</label>
|
||||
<input class="flex-grow" type="text" name="system.age" value="{{system.age}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.poids">Poids :</label>
|
||||
<input class="flex-grow" type="text" name="data.poids" value="{{data.poids}}" data-dtype="String"/>
|
||||
<label for="system.poids">Poids :</label>
|
||||
<input class="flex-grow" type="text" name="system.poids" value="{{system.poids}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.taille">Taille :</label>
|
||||
<input class="flex-grow" type="text" name="data.taille" value="{{data.taille}}" data-dtype="String"/>
|
||||
<label for="system.taille">Taille :</label>
|
||||
<input class="flex-grow" type="text" name="system.taille" value="{{system.taille}}" data-dtype="String"/>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.main">Main directrice :</label>
|
||||
<input type="text" name="data.main" value="{{data.main}}" data-dtype="String"/>
|
||||
<label for="system.main">Main directrice :</label>
|
||||
<input type="text" name="system.main" value="{{system.main}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.heure">Heure de naissance :</label>
|
||||
<select type="text" name="data.heure" value="{{data.heure}}" data-dtype="String">
|
||||
{{#select data.heure}}
|
||||
<label for="system.heure">Heure de naissance :</label>
|
||||
<select type="text" name="system.heure" value="{{system.heure}}" data-dtype="String">
|
||||
{{#select system.heure}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/heures-select-option.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label>Beauté :</label>
|
||||
<input type="text" value="{{data.beaute}}" data-dtype="String" disabled/>
|
||||
<input type="text" value="{{system.beaute}}" data-dtype="String" disabled/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.cheveux">Cheveux :</label>
|
||||
<input class="flex-grow" type="text" name="data.cheveux" value="{{data.cheveux}}" data-dtype="String"/>
|
||||
<label for="system.cheveux">Cheveux :</label>
|
||||
<input class="flex-grow" type="text" name="system.cheveux" value="{{system.cheveux}}" data-dtype="String"/>
|
||||
</li>
|
||||
<li class="item flexrow list-item">
|
||||
<label for="data.yeux">Yeux :</label>
|
||||
<input class="flex-grow" type="text" name="data.yeux" value="{{data.yeux}}" data-dtype="String"/>
|
||||
<label for="system.yeux">Yeux :</label>
|
||||
<input class="flex-grow" type="text" name="system.yeux" value="{{system.yeux}}" data-dtype="String"/>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
@ -798,16 +702,16 @@
|
||||
<article class="flexcol">
|
||||
<h3>Biographie : </h3>
|
||||
<div class="form-group editor">
|
||||
{{editor data.biographie target="system.biographie" button=true owner=owner editable=editable}}
|
||||
{{editor system.biographie target="system.biographie" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
<h3>Notes : </h3>
|
||||
<div class="form-group editor">
|
||||
{{editor data.notes target="system.notes" button=true owner=owner editable=editable}}
|
||||
{{editor system.notes target="system.notes" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
<h3>Journal d'Experience</h3>
|
||||
<div class="form-group editor">
|
||||
<ul class="item-list alterne-list">
|
||||
{{#each data.experiencelog as |xp key|}}
|
||||
{{#each system.experiencelog as |xp key|}}
|
||||
<li class="item flexrow list-item">
|
||||
<label class="flex-shrink">{{xp.mode}} </label>
|
||||
<label class="flex-grow">{{xp.valeur}} {{xp.raison}} </label>
|
||||
|
@ -25,41 +25,41 @@
|
||||
<div class="grid grid-2col">
|
||||
<div class="flex-group-left flexcol">
|
||||
<ol class="carac-list alterne-list">
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Catégorie</span>
|
||||
<select name="data.categorie" class="categorie" data-dtype="String">
|
||||
{{#select data.categorie}}
|
||||
<select name="system.categorie" class="categorie" data-dtype="String">
|
||||
{{#select system.categorie}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html"}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Résistance</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.resistance" value="{{data.resistance}}" data-dtype="Number" />
|
||||
<input class="competence-value flexrow" type="text" name="system.resistance" value="{{system.resistance}}" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Structure</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.structure" value="{{data.structure}}" data-dtype="Number" />
|
||||
<input class="competence-value flexrow" type="text" name="system.structure" value="{{system.structure}}" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Vitesse</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.vitesse" value="{{data.vitesse}}" data-dtype="String" />
|
||||
<input class="competence-value flexrow" type="text" name="system.vitesse" value="{{system.vitesse}}" data-dtype="String" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Bonus</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.bonus" value="{{data.bonus}}" data-dtype="String" />
|
||||
<input class="competence-value flexrow" type="text" name="system.bonus" value="{{system.bonus}}" data-dtype="String" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Manoeuvrabilité</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.manoeuvrabilite" value="{{data.manoeuvrabilite}}" data-dtype="String" />
|
||||
<input class="competence-value flexrow" type="text" name="system.manoeuvrabilite" value="{{system.manoeuvrabilite}}" data-dtype="String" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Equipage</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.equipage" value="{{data.equipage}}" data-dtype="Number" />
|
||||
<input class="competence-value flexrow" type="text" name="system.equipage" value="{{system.equipage}}" data-dtype="Number" />
|
||||
</li>
|
||||
<li class="competence flexrow list-item" data-attribute="{{key}}">
|
||||
<li class="caracteristique flexrow list-item" data-attribute="{{key}}">
|
||||
<span class="carac-label flexrow" name="categorie">Capacité d'Encombrement</span>
|
||||
<input class="competence-value flexrow" type="text" name="data.capacite_encombrement" value="{{data.capacite_encombrement}}" data-dtype="Number" />
|
||||
<input class="competence-value flexrow" type="text" name="system.capacite_encombrement" value="{{system.capacite_encombrement}}" data-dtype="Number" />
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
@ -69,51 +69,13 @@
|
||||
{{!-- Equipment Tab --}}
|
||||
<div class="tab items" data-group="primary" data-tab="items">
|
||||
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire-monnaie.html" monnaie=monnaie}}
|
||||
|
||||
<span class="item-name"><h4>Equipement chargé</h4></span>
|
||||
|
||||
<span class="item-name">Encombrement total/max : {{numberFormat calc.encTotal decimals=2}} / {{data.capacite_encombrement}} <b>{{calc.surEncombrementMessage}}</b></span> -
|
||||
<span class="item-name"><a class="creer-un-objet">Créer un objet</a></span>
|
||||
{{#if options.isGM}}
|
||||
<span class="item-name"> - <a id="nettoyer-conteneurs">Vider tout les conteneurs</a></span>
|
||||
{{/if}}
|
||||
<ul class="item-list alterne-list">
|
||||
<li class="competence-header flexrow">
|
||||
<img class="sheet-competence-img" src="{{img}}" title="Equipement"/>
|
||||
<span class="competence-title competence-label flex-grow">Nom</span>
|
||||
<span class="competence-title competence-label">Q.</span>
|
||||
<span class="competence-title competence-value">Enc.</span>
|
||||
<span class="competence-title competence-value">Equiper/Editer/Suppr.</span>
|
||||
</li>
|
||||
{{#each objets as |item id|}}
|
||||
{{#unless item.estContenu}}
|
||||
{{#if (ne item.type 'conteneur')}}
|
||||
<li class="item flexrow list-item" data-item-id="{{item._id}}">
|
||||
<img class="sheet-competence-img" src="{{item.img}}" title="{{item.name}}"/>
|
||||
<span class="item-name flex-grow">{{item.name}}</span>
|
||||
<span class="item-quantite">{{item.data.quantite}}</span>
|
||||
<span class="item-quantite">{{numberFormat item.data.encTotal decimals=2}}</span>
|
||||
<div class="item-controls">
|
||||
<a class="item-control item-equip" title="Equiper">{{#if item.data.equipe}}<i class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
|
||||
<a class="item-control item-edit" title="Editer"><i class="fas fa-edit"></i></a>
|
||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
{{#each conteneurs as |conteneur id|}}
|
||||
{{buildConteneur this}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/actor-sheet-inventaire.html"}}
|
||||
|
||||
|
||||
{{!-- Biography Tab --}}
|
||||
<div class="tab description" data-group="primary" data-tab="description">
|
||||
<div class="form-group editor">
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
{{editor content=system.description target="system.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/actor-sheet-editor-notes-mj.html"}}
|
||||
</div>
|
||||
|
@ -6,4 +6,4 @@
|
||||
{{#if vendeur}}à {{vendeur.name}}{{/if}}:
|
||||
{{quantiteTotal}} {{item.name}} pour {{prixTotal}} sols.
|
||||
</p>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" item.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" item.system}}
|
||||
|
16
templates/chat-command-nom.html
Normal file
16
templates/chat-command-nom.html
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
<h4>Proposition de nom: {{nom}}</h4>
|
||||
<span class="chat-card-button-area">
|
||||
<a class="button-creer-acteur chat-card-button"
|
||||
data-nom='{{nom}}'
|
||||
data-type='personnage'
|
||||
>
|
||||
Créer un Personnage</a>
|
||||
</span>
|
||||
<span class="chat-card-button-area">
|
||||
<a class="button-creer-acteur chat-card-button"
|
||||
data-nom='{{nom}}'
|
||||
data-type='creature'>
|
||||
Créer une créature</a>
|
||||
</span>
|
||||
|
@ -1,16 +1,16 @@
|
||||
<img class="chat-icon" src="{{img}}" alt="potion de repos" />
|
||||
<h4>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
|
||||
</h4>
|
||||
<hr>
|
||||
<div>
|
||||
{{#if data.magique}}
|
||||
{{#if system.magique}}
|
||||
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
{{/if}}
|
||||
<br>Les effets de la potions sont à gérer manuellement, en fonction de sa nature
|
||||
{{#if data.magique}}
|
||||
{{#if rolled.isEchec}}et de son enchantement ({{data.pr}} Points de Rêve)
|
||||
{{#if system.magique}}
|
||||
{{#if rolled.isEchec}}et de son enchantement ({{system.pr}} Points de Rêve)
|
||||
{{else}}son enchantement n'a pas d'effet
|
||||
{{/if}}
|
||||
{{/if}}.
|
||||
|
@ -1,27 +1,27 @@
|
||||
<img class="chat-icon" src="{{img}}" alt="potion de repos" />
|
||||
<h4>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
|
||||
</h4>
|
||||
<hr>
|
||||
<div>
|
||||
{{#if data.magique}}
|
||||
{{#if system.magique}}
|
||||
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
{{#if rolled.isEchec}}
|
||||
<br>La potion fait effet !
|
||||
{{alias}} a perdu 1 point de rêve et s'endort pour {{guerisonDureeValue}} {{guerisonDureeUnite}} et
|
||||
se récupère {{caseFatigueReel}} cases de fatigue.<br>
|
||||
{{#if data.reposalchimique}}
|
||||
{{#if system.reposalchimique}}
|
||||
De plus, la potion étant alchimique, {{alias}} est en aphasie pendant cette durée.
|
||||
{{#if aphasiePermanente}}
|
||||
Malheureusement, l'aphasie est permanente tant que {{alias}} ne réussit pas un jet de VOLONTE à 0 à Chateau Dormant (le moral compte).
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<br>La potion ne fait pas effet ! Elle vous octroie tout de même un bonus de {{data.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
|
||||
<br>La potion ne fait pas effet ! Elle vous octroie tout de même un bonus de {{system.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
|
||||
{{/if}}
|
||||
{{else}}
|
||||
Une fois consommée (vers fin Lyre), elle vous octroie un bonus de {{data.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
|
||||
Une fois consommée (vers fin Lyre), elle vous octroie un bonus de {{system.herbebonus}} segments de fatigue récupérés en plus à la fin de Chateau Dormant (à gérer manuellement).
|
||||
{{/if}}
|
||||
<br>La potion a été supprimée de l'équipement.
|
||||
</div>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<img class="chat-icon" src="{{img}}" alt="potion de soin" />
|
||||
<h4>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if data.magique}} enchantée{{/if}}</strong>
|
||||
{{alias}} a bu une <strong>{{name}}{{#if system.magique}} enchantée{{/if}}</strong>
|
||||
</h4>
|
||||
<hr>
|
||||
<div>
|
||||
{{#if data.magique}}
|
||||
{{#if system.magique}}
|
||||
Le Jet de Résistance est {{#if rolled.isSuccess}}réussi{{else}}échoué{{/if}}.
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
{{#if rolled.isEchec}}
|
||||
@ -16,10 +16,10 @@
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{else}}
|
||||
<br>La potion ne fait pas effet ! Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{data.herbebonus}} (appliqué automatiquement).
|
||||
<br>La potion ne fait pas effet ! Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{system.herbebonus}} (appliqué automatiquement).
|
||||
{{/if}}
|
||||
{{else}}
|
||||
Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{data.herbebonus}} (appliqué automatiquement).
|
||||
Lors de votre prochain jet de récupération à Chateau Dormant, vous bénéficierez d'un bonus de {{system.herbebonus}} (appliqué automatiquement).
|
||||
{{/if}}
|
||||
<br>La potion a été supprimée de l'équipement.
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
</a>
|
||||
<br>
|
||||
{{/unless}}
|
||||
{{#if (gt attacker.data.compteurs.destinee.value 0)}}
|
||||
{{#if (gt attacker.system.compteurs.destinee.value 0)}}
|
||||
<a class='chat-card-button' id='appel-destinee-attaque' data-attackerId='{{attackerId}}'
|
||||
data-defenderTokenId='{{defenderTokenId}}'>Utiliser la destinée</a>
|
||||
</a>
|
||||
|
@ -26,7 +26,7 @@
|
||||
<br>
|
||||
{{/if}}
|
||||
{{#if (eq defender.type 'personnage')}}
|
||||
{{#if (gt defender.data.compteurs.destinee.value 0)}}
|
||||
{{#if (gt defender.system.compteurs.destinee.value 0)}}
|
||||
<a class='chat-card-button' id='appel-destinee-defense' data-attackerId='{{attackerId}}'
|
||||
data-defenderTokenId='{{defenderTokenId}}'>Utiliser la destinée</a>
|
||||
</a>
|
||||
@ -38,14 +38,14 @@
|
||||
{{#each armes as |arme key|}}
|
||||
<a class='chat-card-button' id='parer-button' data-attackerId='{{../attackerId}}' data-defenderTokenId='{{../defenderTokenId}}'
|
||||
data-armeid='{{arme._id}}'>
|
||||
Parer avec {{arme.name}} à {{../diffLibre }}{{#if arme.data.nbUsage}} (Utilisations : {{arme.data.nbUsage}}){{/if}}
|
||||
Parer avec {{arme.name}} à {{../diffLibre }}{{#if arme.system.nbUsage}} (Utilisations : {{arme.system.nbUsage}}){{/if}}
|
||||
</a>
|
||||
<br>
|
||||
{{/each}}
|
||||
{{#if mainsNues}}
|
||||
<a class='chat-card-button' id='parer-button' data-attackerId='{{attackerId}}' data-defenderTokenId='{{defenderTokenId}}'
|
||||
data-armeid='{{arme._id}}' data-competence='{{arme.data.competence}}'>
|
||||
Parer à mains nues à {{diffLibre}}{{#if arme.data.nbUsage}} (Utilisations : {{arme.data.nbUsage}}){{/if}}
|
||||
data-armeid='{{arme._id}}' data-competence='{{arme.system.competence}}'>
|
||||
Parer à mains nues à {{diffLibre}}{{#if arme.system.nbUsage}} (Utilisations : {{arme.system.nbUsage}}){{/if}}
|
||||
</a>
|
||||
<br>
|
||||
{{/if}}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
{{alias}} tente d'interpréter {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||
</h4>
|
||||
<br>{{upperFirst oeuvre.data.default_carac}} / {{oeuvre.data.competence}}
|
||||
<br>{{upperFirst oeuvre.system.default_carac}} / {{oeuvre.system.competence}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||
<hr>
|
||||
<div>
|
||||
|
@ -17,16 +17,22 @@
|
||||
<a class='defense-possession chat-card-button'
|
||||
data-attackerId='{{attacker.id}}'
|
||||
data-defenderId='{{defender.id}}'
|
||||
data-possessionId='{{possession.system.possessionid}}'>Résister à la possession</a>
|
||||
data-possessionId='{{possession.system.possessionid}}'>
|
||||
{{#if isECNIDefender}}
|
||||
Résister à la conjuration
|
||||
{{else}}
|
||||
Résister à la possession
|
||||
{{/if}}
|
||||
</a>
|
||||
{{else}}
|
||||
La Tentative de Possession a échouée !
|
||||
La Tentative de {{#if isECNIDefender}}conjuration{{else}}possession{{/if}} a échoué !
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if rolled.isSuccess}}
|
||||
La Tentative de Possession a été conjurée ! {{defender.name}} résiste à la tentative de possession.
|
||||
{{else}}
|
||||
La Tentative de Possession n'a pas pu être conjurée !
|
||||
La tentative de {{#if isECNIDefender}}conjuration a été repoussée{{else}}possession a été conjurée{{/if}}!
|
||||
{{defender.name}} a résisté.
|
||||
{{else}}
|
||||
La tentative de {{#if isECNIDefender}}conjuration a réussi{{else}}possession n'a pas pu être conjurée{{/if}}!
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<br>Points de Possession: {{possession.ptsPossession}}
|
||||
|
@ -6,7 +6,7 @@
|
||||
<hr>
|
||||
<span>
|
||||
<img class="chat-icon" src="{{platCuisine.img}}" alt="{{platCuisine.name}}" />
|
||||
<br>{{alias}} a préparé {{platCuisine.data.quantite}} portions de {{platCuisine.name}}
|
||||
<br>{{alias}} a préparé {{platCuisine.system.quantite}} portions de {{platCuisine.name}}
|
||||
{{~#if ajouterEquipement}}, qui ont été ajoutées à son équipement{{/if}}.
|
||||
{{#if rolled.isSuccess}}
|
||||
Il a réussi la recette, pour un plat de qualité {{qualiteFinale}}
|
||||
|
@ -15,7 +15,7 @@
|
||||
{{alias}} ne parvient pas à vaincre le Rêve de Dragon, et prend un violent coup de queue.
|
||||
Il subit {{#if rolled.isETotal}}deux queues{{else}}une queue{{/if}} de dragon!
|
||||
{{#each queues as | queue key|}}
|
||||
<br>{{queue.name}}: {{{queue.data.description}}}
|
||||
<br>{{queue.name}}: {{{queue.system.description}}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</span>
|
||||
|
@ -1,10 +1,10 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<h4>
|
||||
{{alias}} {{#if isSortReserve}}met en réserve{{else}}lance{{/if}}
|
||||
le {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}}
|
||||
le {{#if selectedSort.system.isrituel}}rituel{{else}}sort{{/if}}
|
||||
{{selectedSort.name}}
|
||||
</h4>
|
||||
<div>Pour {{selectedSort.data.ptreve_reel}} point{{~#if (gt selectedSort.data.ptreve_reel 1)}}s{{/if}} de rêve en {{tmr.label}} ({{tmr.coord}}).
|
||||
<div>Pour {{selectedSort.system.ptreve_reel}} point{{~#if (gt selectedSort.system.ptreve_reel 1)}}s{{/if}} de rêve en {{tmr.label}} ({{tmr.coord}}).
|
||||
{{#if show.reveInsuffisant}}
|
||||
<span>Pas assez de rêve!</span>
|
||||
{{/if}}
|
||||
|
@ -3,5 +3,5 @@
|
||||
</h4>
|
||||
<p>Pour le lire ce signe draconique, {{alias}} doit se rendre dans les
|
||||
Terres Médianes du Rêve et trouvez une case de résonnance.
|
||||
{{#if signe.data.ephemere}}C'est un signe éphémère, qui ne restera présent que pour {{signe.data.duree}}{{/if}}
|
||||
{{#if signe.system.ephemere}}C'est un signe éphémère, qui ne restera présent que pour {{signe.system.duree}}{{/if}}
|
||||
</p>
|
||||
|
@ -8,27 +8,27 @@
|
||||
</h4>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signe.data.difficulte">Difficulte</label>
|
||||
<input type="number" name="signe.data.difficulte" value="{{signe.data.difficulte}}" data-dtype="Number" />
|
||||
<label for="signe.system.difficulte">Difficulte</label>
|
||||
<input type="number" name="signe.system.difficulte" value="{{signe.system.difficulte}}" data-dtype="Number" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="signe.data.valeur.norm">Expérience en sorts</label>
|
||||
<label for="signe.system.valeur.norm">Expérience en sorts</label>
|
||||
<div class="flexrow">
|
||||
<input class="signe-xp-sort" type="number" name="signe.data.valeur.norm" data-typereussite="norm"
|
||||
value="{{signe.data.valeur.norm}}" min="1" max="100" data-dtype="Number" />
|
||||
<input class="signe-xp-sort" type="number" name="signe.system.valeur.norm" data-typereussite="norm"
|
||||
value="{{signe.system.valeur.norm}}" min="1" max="100" data-dtype="Number" />
|
||||
<span>Sign.</span>
|
||||
<input class="signe-xp-sort" type="number" name="signe.data.valeur.sign" data-typereussite="sign"
|
||||
value="{{signe.data.valeur.sign}}" min="1" max="100" data-dtype="Number" />
|
||||
<input class="signe-xp-sort" type="number" name="signe.system.valeur.sign" data-typereussite="sign"
|
||||
value="{{signe.system.valeur.sign}}" min="1" max="100" data-dtype="Number" />
|
||||
<span>Part.</span>
|
||||
<input class="signe-xp-sort" type="number" name="signe.data.valeur.part" data-typereussite="part"
|
||||
value="{{signe.data.valeur.part}}" min="1" max="100" data-dtype="Number" />
|
||||
<input class="signe-xp-sort" type="number" name="signe.system.valeur.part" data-typereussite="part"
|
||||
value="{{signe.system.valeur.part}}" min="1" max="100" data-dtype="Number" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group flexrow">
|
||||
<label for="signe.data.ephemere">Ephémère</label>
|
||||
<input class="flex-shrink" type="checkbox" name="signe.data.ephemere" {{#if signe.data.ephemere}}checked{{/if}} />
|
||||
<label for="signe.system.ephemere">Ephémère</label>
|
||||
<input class="flex-shrink" type="checkbox" name="signe.system.ephemere" {{#if signe.system.ephemere}}checked{{/if}} />
|
||||
<span>
|
||||
<input type="text" name="signe.data.duree" value="{{signe.data.duree}}" data-dtype="String" />
|
||||
<input type="text" name="signe.system.duree" value="{{signe.system.duree}}" data-dtype="String" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -1,6 +1,6 @@
|
||||
<form class="skill-roll-dialog">
|
||||
<div class="form-group">
|
||||
<label>Fabriquer une potion de {{data.categorie}} de {{name}}</label>
|
||||
<label>Fabriquer une potion de {{system.categorie}} de {{name}}</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -47,30 +47,30 @@
|
||||
|
||||
{{#if (eq item.type 'nourritureboisson')}}
|
||||
<p>
|
||||
Si vous souhaitez {{#if item.data.boisson}}boire{{else}}manger{{/if}}:
|
||||
Si vous souhaitez {{#if item.system.boisson}}boire{{else}}manger{{/if}}:
|
||||
</p>
|
||||
|
||||
{{#if item.data.sust}}
|
||||
<p>Cette {{#if item.data.boisson}}boisson{{else}}nourriture{{/if}} vous apportera <span
|
||||
{{#if item.system.sust}}
|
||||
<p>Cette {{#if item.system.boisson}}boisson{{else}}nourriture{{/if}} vous apportera <span
|
||||
class="total-sust">{{totalSust}}</span> de sustantation.</p>
|
||||
{{/if}}
|
||||
{{#if item.data.boisson}}
|
||||
<p>{{#if item.data.alcoolise}}
|
||||
C'est une boisson alcoolisée de force {{item.data.force}}, vous effectuerez un jet d'éthylisme.
|
||||
{{#if item.system.boisson}}
|
||||
<p>{{#if item.system.alcoolise}}
|
||||
C'est une boisson alcoolisée de force {{item.system.force}}, vous effectuerez un jet d'éthylisme.
|
||||
{{/if}}
|
||||
Cette boisson vous apportera <span class="total-desaltere">{{totalDesaltere}}</span> unités d'eau.
|
||||
</p>
|
||||
{{/if}}
|
||||
{{#if (gt item.data.qualite 0)}}
|
||||
{{#if (gt item.data.qualite cuisine.data.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.data.qualite decimals=0 sign=true}}
|
||||
{{#if (gt item.system.qualite 0)}}
|
||||
{{#if (gt item.system.qualite cuisine.system.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.system.qualite decimals=0 sign=true}}
|
||||
vous permettra un jet de moral heureux.</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (or (lt item.data.qualite 0) (lt item.data.exotisme 0))}}
|
||||
{{#if (or (lt item.system.qualite 0) (lt item.system.exotisme 0))}}
|
||||
<p>
|
||||
Pour surmonter {{#if (lt item.data.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.data.exotisme item.data.qualite) decimals=0 sign=true}}.
|
||||
Pour surmonter {{#if (lt item.system.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.system.exotisme item.system.qualite) decimals=0 sign=true}}.
|
||||
<br/>
|
||||
<input class="attribute-value se-forcer" type="checkbox" name="se-forcer" {{#if choix.seForcer}}checked{{/if}}>
|
||||
<label for="se-forcer">En cas d'échec, voulez-vous vous forcer à manger (et subir un jet de moral en situation malheureuse)?</label>
|
||||
|
@ -2,31 +2,31 @@
|
||||
<img class="chat-icon" src="{{item.img}}" title="{{item.name}}" alt="{{item.name}}" />
|
||||
<h4>{{item.name}}</h4>
|
||||
<div class="flexrow">
|
||||
<label class="flex-grow">Quantité à {{#if item.data.boisson}}boire{{else}}manger{{/if}}</label>
|
||||
<label class="flex-grow">Quantité à {{#if item.system.boisson}}boire{{else}}manger{{/if}}</label>
|
||||
<input class="attribute-value consommer-doses flex-shrink" type="number" name="doses" value="{{choix.doses}}"
|
||||
min="0" max="{{item.data.quantite}}" data-dtype="Number" />
|
||||
min="0" max="{{item.system.quantite}}" data-dtype="Number" />
|
||||
</div>
|
||||
{{#if item.data.sust}}
|
||||
<p>Cette {{#if item.data.boisson}}boisson{{else}}nourriture{{/if}} vous apportera <span
|
||||
{{#if item.system.sust}}
|
||||
<p>Cette {{#if item.system.boisson}}boisson{{else}}nourriture{{/if}} vous apportera <span
|
||||
class="total-sust">{{totalSust}}</span> de sustantation.</p>
|
||||
{{/if}}
|
||||
{{#if item.data.boisson}}
|
||||
<p>{{#if item.data.alcoolise}}
|
||||
C'est une boisson alcoolisée de force {{item.data.force}}, vous effectuerez un jet d'éthylisme.
|
||||
{{#if item.system.boisson}}
|
||||
<p>{{#if item.system.alcoolise}}
|
||||
C'est une boisson alcoolisée de force {{item.system.force}}, vous effectuerez un jet d'éthylisme.
|
||||
{{/if}}
|
||||
Cette boisson vous apportera <span class="total-desaltere">{{totalDesaltere}}</span> unités d'eau.
|
||||
</p>
|
||||
{{/if}}
|
||||
{{#if (gt item.data.qualite 0)}}
|
||||
{{#if (gt item.data.qualite cuisine.data.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.data.qualite decimals=0 sign=true}}
|
||||
{{#if (gt item.system.qualite 0)}}
|
||||
{{#if (gt item.system.qualite cuisine.system.niveau)}}
|
||||
<p>La qualité du plat est telle qu'un jet de Goût/Cuisine à {{numberFormat item.system.qualite decimals=0 sign=true}}
|
||||
vous permettra un jet de moral heureux.</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (or (lt item.data.qualite 0) (lt item.data.exotisme 0))}}
|
||||
{{#if (or (lt item.system.qualite 0) (lt item.system.exotisme 0))}}
|
||||
<p>
|
||||
Pour surmonter {{#if (lt item.data.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.data.exotisme item.data.qualite) decimals=0 sign=true}}.
|
||||
Pour surmonter {{#if (lt item.system.qualite 0)}}le mauvais goût{{else}}l'exotisme{{/if}}, vous devez effectuer un jet de Volonté/Cuisine à {{numberFormat (min item.system.exotisme item.system.qualite) decimals=0 sign=true}}.
|
||||
<br/>
|
||||
<input class="attribute-value se-forcer" type="checkbox" name="se-forcer" {{#if choix.seForcer}}checked{{/if}}>
|
||||
<label for="se-forcer">En cas d'échec, voulez-vous vous forcer à manger (et subir un jet de moral en situation malheureuse)?</label>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<form class="rdddialog">
|
||||
<img class="chat-icon" src="{{item.img}}" title="{{item.name}}" alt="{{item.name}}" />
|
||||
<h4>{{item.name}}</h4>
|
||||
<label>Quantité totale : {{item.data.quantite}}</label>
|
||||
<label>Quantité totale : {{item.system.quantite}}</label>
|
||||
<div class="flexrow">
|
||||
<label class="flex-grow">Quantité à séparer</label>
|
||||
<input class="attribute-value choix-quantite flex-shrink" type="number" name="choix.quantite" value="{{choix.quantite}}"
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="grid grid-2col">
|
||||
<label>{{alchimie.tache}}:</label><label class="flex-grow">{{alchimie.texte}}</label>
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -6,9 +6,9 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<div class="grid grid-2col">
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}}
|
||||
|
@ -43,9 +43,9 @@
|
||||
{{#if arme}}
|
||||
{{#unless attackerRoll}}
|
||||
<div class="flexrow">
|
||||
{{#if (eq arme.data.mortalite 'non-mortel')}}
|
||||
{{#if (eq arme.system.mortalite 'non-mortel')}}
|
||||
<label>Dégats:</label><label class="dmg-arme-actor"></label>
|
||||
{{else if (eq arme.data.mortalite 'empoignade')}}
|
||||
{{else if (eq arme.system.mortalite 'empoignade')}}
|
||||
<label>Dégats:</label><label>Empoignade</label>
|
||||
{{else}}
|
||||
<label>Dégats:</label>
|
||||
|
@ -6,9 +6,9 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}" />
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}}
|
||||
|
@ -19,7 +19,7 @@
|
||||
<div id="tableAjustements" class="flexrow"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
|
||||
<div id="tableResolution"></div>
|
||||
<div id="tableProbaReussite"></div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="draconic">{{competence.name}}:</label><label class="flex-grow" name="draconic">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label>
|
||||
<label for="draconic">{{competence.name}}:</label><label class="flex-grow" name="draconic">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -8,7 +8,7 @@
|
||||
<label>Caractéristique: </label><label class="flex-grow">{{selectedCarac.label}}</label>
|
||||
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffFixe.html"}}
|
||||
|
@ -9,10 +9,10 @@
|
||||
<label>Caractéristique: </label><label>{{selectedCarac.label}}</label>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<label>{{competence.name}}: </label><label>{{numberFormat competence.data.niveau decimals=0 sign=true}}</label></label>
|
||||
<label>{{competence.name}}: </label><label>{{numberFormat competence.system.niveau decimals=0 sign=true}}</label></label>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<label>Exotisme: </label><label>{{oeuvre.data.exotisme}}</label>
|
||||
<label>Exotisme: </label><label>{{oeuvre.system.exotisme}}</label>
|
||||
</div>
|
||||
<div class="flexrow">
|
||||
<label for="proportions">Proportions: </label>
|
||||
@ -32,7 +32,7 @@
|
||||
<div id="tableAjustements" class="flexrow"></div>
|
||||
</div>
|
||||
</div>
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.data}}
|
||||
{{> "systems/foundryvtt-reve-de-dragon/templates/partial-description-overflow.html" oeuvre.system}}
|
||||
<div id="tableResolution"></div>
|
||||
<div id="tableProbaReussite"></div>
|
||||
</form>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||
<div class="grid grid-2col">
|
||||
<label for="carac">Rêve actuel:</label><label class="flex-grow" name="carac">{{selectedCarac.value}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.data.niveau decimals=0 sign=true}}</label>
|
||||
<label for="competence">{{competence.name}}:</label><label class="flex-grow" name="competence">{{numberFormat competence.system.niveau decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-group-left">
|
||||
|
@ -24,7 +24,7 @@
|
||||
<select name="competence" class="roll-draconic" data-dtype="String">
|
||||
{{#select draconic}}
|
||||
{{#each draconicList as |draconic key|}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.data.niveau decimals=0 sign=true}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.system.niveau decimals=0 sign=true}}
|
||||
</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
@ -1,10 +1,10 @@
|
||||
<form class="dialog-roll-sort">
|
||||
<h2>Lancer le <span class="sort-ou-rituel">{{#if sort.data.isrituel}}rituel{{else}}sort{{/if}}</span>:
|
||||
<h2>Lancer le <span class="sort-ou-rituel">{{#if sort.system.isrituel}}rituel{{else}}sort{{/if}}</span>:
|
||||
<select name="sort" class="roll-sort flex-grow" data-dtype="String">
|
||||
{{#select sort}}
|
||||
{{#each sortList as |sort key|}}
|
||||
<option value={{key}}>{{this.name}} - {{#if this.data.caseTMRspeciale}} {{this.data.caseTMRspeciale}}
|
||||
{{else}}{{this.data.caseTMR}}{{/if}} / R{{this.data.difficulte}} r {{sort.data.ptreve}} ({{sort.data.draconic}})
|
||||
<option value={{key}}>{{this.name}} - {{#if this.system.caseTMRspeciale}} {{this.system.caseTMRspeciale}}
|
||||
{{else}}{{this.system.caseTMR}}{{/if}} / R{{this.system.difficulte}} r {{sort.system.ptreve}} ({{sort.system.draconic}})
|
||||
</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
@ -28,7 +28,7 @@
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label class="div-sort-ptreve-fixe">{{selectedSort.data.ptreve}}</select>
|
||||
<label class="div-sort-ptreve-fixe">{{selectedSort.system.ptreve}}</select>
|
||||
</div>
|
||||
<div class="flexrow div-sort-non-rituel">
|
||||
<label>Mettre en réserve</label>
|
||||
@ -41,7 +41,7 @@
|
||||
<select name="competence" class="roll-draconic" data-dtype="String">
|
||||
{{#select draconic}}
|
||||
{{#each draconicList as |draconic key|}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.data.niveau decimals=0 sign=true}}
|
||||
<option value={{key}}>{{draconic.name}} : {{numberFormat draconic.system.niveau decimals=0 sign=true}}
|
||||
</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
@ -56,7 +56,7 @@
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
<label class="div-sort-difficulte-fixe">{{numberFormat selectedSort.data.difficulte decimals=0 sign=true}}</label>
|
||||
<label class="div-sort-difficulte-fixe">{{numberFormat selectedSort.system.difficulte decimals=0 sign=true}}</label>
|
||||
</div>
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-diffCondition.html"}}
|
||||
{{>"systems/foundryvtt-reve-de-dragon/templates/partial-roll-forcer.html"}}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user