Big WIP...
This commit is contained in:
parent
0228d5bc56
commit
1f3fd0bb46
@ -48,7 +48,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
editable: this.isEditable,
|
editable: this.isEditable,
|
||||||
cssClass: this.isEditable ? "editable" : "locked",
|
cssClass: this.isEditable ? "editable" : "locked",
|
||||||
data: foundry.utils.deepClone(this.actor.system),
|
data: foundry.utils.deepClone(this.actor.system),
|
||||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||||
limited: this.object.limited,
|
limited: this.object.limited,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
owner: this.document.isOwner,
|
owner: this.document.isOwner,
|
||||||
|
121
module/actor.js
121
module/actor.js
@ -212,7 +212,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
isHautRevant() {
|
isHautRevant() {
|
||||||
return this.isPersonnage() && this.attributs.hautrevant.value != ""
|
return this.isPersonnage() && this.system.attributs.hautrevant.value != ""
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getFatigueActuelle() {
|
getFatigueActuelle() {
|
||||||
@ -249,7 +249,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getAgilite() {
|
getAgilite() {
|
||||||
switch (this.data.type) {
|
switch (this.type) {
|
||||||
case 'personnage': return Misc.toInt(this.system.carac.agilite?.value);
|
case 'personnage': return Misc.toInt(this.system.carac.agilite?.value);
|
||||||
case 'creature': return Misc.toInt(this.system.carac.force?.value);
|
case 'creature': return Misc.toInt(this.system.carac.force?.value);
|
||||||
case 'entite': return Misc.toInt(this.system.carac.reve?.value);
|
case 'entite': return Misc.toInt(this.system.carac.reve?.value);
|
||||||
@ -422,7 +422,7 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSurprise(isCombat = undefined) {
|
getSurprise(isCombat = undefined) {
|
||||||
let niveauSurprise = this.getActiveEffects()
|
let niveauSurprise = this.getActiveEffects()
|
||||||
.map(effect => StatusEffects.valeurSurprise(effect.data, isCombat))
|
.map(effect => StatusEffects.valeurSurprise(effect, isCombat))
|
||||||
.reduce(Misc.sum(), 0);
|
.reduce(Misc.sum(), 0);
|
||||||
if (niveauSurprise > 1) {
|
if (niveauSurprise > 1) {
|
||||||
return 'totale';
|
return 'totale';
|
||||||
@ -787,7 +787,7 @@ export class RdDActor extends Actor {
|
|||||||
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.getReveActuel() } }
|
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.getReveActuel() } }
|
||||||
}
|
}
|
||||||
rollData.rencontre.force = force;
|
rollData.rencontre.force = force;
|
||||||
rollData.competence.data.defaut_carac = 'reve-actuel';
|
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||||
|
|
||||||
const dialog = await RdDRoll.create(this, rollData,
|
const dialog = await RdDRoll.create(this, rollData,
|
||||||
{
|
{
|
||||||
@ -1150,8 +1150,8 @@ export class RdDActor extends Actor {
|
|||||||
async ajouterDansConteneur(item, conteneur, onAjouterDansConteneur) {
|
async ajouterDansConteneur(item, conteneur, onAjouterDansConteneur) {
|
||||||
if (conteneur?.isConteneur()) {
|
if (conteneur?.isConteneur()) {
|
||||||
let data2use = duplicate(conteneur);
|
let data2use = duplicate(conteneur);
|
||||||
data2use.data.contenu.push(item.id);
|
data2use.system.contenu.push(item.id);
|
||||||
item.data.estContenu = true;
|
item.system.estContenu = true;
|
||||||
await this.updateEmbeddedDocuments('Item', [data2use]);
|
await this.updateEmbeddedDocuments('Item', [data2use]);
|
||||||
onAjouterDansConteneur(item.id, conteneur.id);
|
onAjouterDansConteneur(item.id, conteneur.id);
|
||||||
}
|
}
|
||||||
@ -1422,8 +1422,8 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async ajouterSouffle(options = { chat: false }) {
|
async ajouterSouffle(options = { chat: false }) {
|
||||||
let souffle = await RdDRollTables.getSouffle();
|
let souffle = await RdDRollTables.getSouffle()
|
||||||
souffle._id = undefined; //TBC
|
//souffle.id = undefined; //TBC
|
||||||
await this.createEmbeddedDocuments('Item', [souffle]);
|
await this.createEmbeddedDocuments('Item', [souffle]);
|
||||||
if (options.chat) {
|
if (options.chat) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
@ -1471,7 +1471,7 @@ export class RdDActor extends Actor {
|
|||||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||||
msg: "msg_tmr_move", data: {
|
msg: "msg_tmr_move", data: {
|
||||||
actorId: this._id,
|
actorId: this._id,
|
||||||
tmrPos: this.system.data.reve.tmrpos
|
tmrPos: this.system.reve.tmrpos
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1504,7 +1504,7 @@ export class RdDActor extends Actor {
|
|||||||
buildTMRInnaccessible() {
|
buildTMRInnaccessible() {
|
||||||
const tmrInnaccessibles = this.filterItemsData(it => Draconique.isCaseTMR(it) &&
|
const tmrInnaccessibles = this.filterItemsData(it => Draconique.isCaseTMR(it) &&
|
||||||
EffetsDraconiques.isInnaccessible(it));
|
EffetsDraconiques.isInnaccessible(it));
|
||||||
return tmrInnaccessibles.map(it => it.data.coord);
|
return tmrInnaccessibles.map(it => it.system.coord);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -1582,13 +1582,13 @@ export class RdDActor extends Actor {
|
|||||||
async finDeRound(options = { terminer: false }) {
|
async finDeRound(options = { terminer: false }) {
|
||||||
for (let effect of this.getActiveEffects()) {
|
for (let effect of this.getActiveEffects()) {
|
||||||
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
||||||
if (effect.data.origin) {
|
if (effect.system.origin) {
|
||||||
await effect.update({ 'disabled': true });
|
await effect.update({ 'disabled': true });
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await effect.delete();
|
await effect.delete();
|
||||||
}
|
}
|
||||||
ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.data.label))} !` });
|
ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.type == 'personnage') {
|
if (this.type == 'personnage') {
|
||||||
@ -2255,13 +2255,13 @@ export class RdDActor extends Actor {
|
|||||||
let letfilteredList = []
|
let letfilteredList = []
|
||||||
for (let sort of sortList) {
|
for (let sort of sortList) {
|
||||||
//console.log(sort.name, sort.data.caseTMR.toLowerCase(), sort.data.caseTMRspeciale.toLowerCase(), coord.toLowerCase() );
|
//console.log(sort.name, sort.data.caseTMR.toLowerCase(), sort.data.caseTMRspeciale.toLowerCase(), coord.toLowerCase() );
|
||||||
if (sort.data.caseTMR.toLowerCase().includes('variable')) {
|
if (sort.system.caseTMR.toLowerCase().includes('variable')) {
|
||||||
letfilteredList.push(sort);
|
letfilteredList.push(sort);
|
||||||
} else if (sort.data.caseTMRspeciale.toLowerCase().includes('variable')) {
|
} else if (sort.system.caseTMRspeciale.toLowerCase().includes('variable')) {
|
||||||
letfilteredList.push(sort);
|
letfilteredList.push(sort);
|
||||||
} else if (sort.data.caseTMR.toLowerCase() == tmr.type) {
|
} else if (sort.system.caseTMR.toLowerCase() == tmr.type) {
|
||||||
letfilteredList.push(sort);
|
letfilteredList.push(sort);
|
||||||
} else if (sort.data.caseTMR.toLowerCase().includes('special') && sort.data.caseTMRspeciale.toLowerCase().includes(coord.toLowerCase())) {
|
} else if (sort.system.caseTMR.toLowerCase().includes('special') && sort.system.caseTMRspeciale.toLowerCase().includes(coord.toLowerCase())) {
|
||||||
letfilteredList.push(sort);
|
letfilteredList.push(sort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2274,7 +2274,7 @@ export class RdDActor extends Actor {
|
|||||||
let draconicList = this.getDraconicList()
|
let draconicList = this.getDraconicList()
|
||||||
.map(it => {
|
.map(it => {
|
||||||
it = duplicate(it)
|
it = duplicate(it)
|
||||||
it.data.defaut_carac = "reve";
|
it.system.defaut_carac = "reve";
|
||||||
return it;
|
return it;
|
||||||
});
|
});
|
||||||
for (let sort of sortList) {
|
for (let sort of sortList) {
|
||||||
@ -2298,7 +2298,7 @@ export class RdDActor extends Actor {
|
|||||||
case "annulation de magie":
|
case "annulation de magie":
|
||||||
return draconicList.filter(it => !Grammar.toLowerCaseNoAccent(it.name).includes('thanatos'));
|
return draconicList.filter(it => !Grammar.toLowerCaseNoAccent(it.name).includes('thanatos'));
|
||||||
}
|
}
|
||||||
return [RdDItemCompetence.getVoieDraconic(draconicList, sort.data.draconic)];
|
return [RdDItemCompetence.getVoieDraconic(draconicList, sort.system.draconic)];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -2385,7 +2385,7 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkSoufflePeage(tmr) {
|
async checkSoufflePeage(tmr) {
|
||||||
if ((tmr.type == 'pont' || tmr.type == 'cite') && EffetsDraconiques.isPeage(actor)) {
|
if ((tmr.type == 'pont' || tmr.type == 'cite') && EffetsDraconiques.isPeage(this)) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: "Vous êtes sous le coup d'un Péage : l'entrée sur cette case vous a coûté 1 Point de Rêve (déduit automatiquement).",
|
content: "Vous êtes sous le coup d'un Péage : l'entrée sur cette case vous a coûté 1 Point de Rêve (déduit automatiquement).",
|
||||||
@ -2399,9 +2399,9 @@ export class RdDActor extends Actor {
|
|||||||
let rolled = rollData.rolled;
|
let rolled = rollData.rolled;
|
||||||
let selectedSort = rollData.selectedSort;
|
let selectedSort = rollData.selectedSort;
|
||||||
|
|
||||||
rollData.isSortReserve = rollData.mettreEnReserve && !selectedSort.data.isrituel;
|
rollData.isSortReserve = rollData.mettreEnReserve && !selectedSort.system.isrituel;
|
||||||
rollData.show = {}
|
rollData.show = {}
|
||||||
rollData.depenseReve = Number(selectedSort.data.ptreve_reel);
|
rollData.depenseReve = Number(selectedSort.system.ptreve_reel);
|
||||||
|
|
||||||
if (rollData.competence.name.includes('Thanatos')) { // Si Thanatos
|
if (rollData.competence.name.includes('Thanatos')) { // Si Thanatos
|
||||||
await this.update({ "data.reve.reve.thanatosused": true });
|
await this.update({ "data.reve.reve.thanatosused": true });
|
||||||
@ -2707,7 +2707,7 @@ export class RdDActor extends Actor {
|
|||||||
_getCaracDanse(oeuvre) {
|
_getCaracDanse(oeuvre) {
|
||||||
if (oeuvre.system.agilite) { return "agilite"; }
|
if (oeuvre.system.agilite) { return "agilite"; }
|
||||||
else if (oeuvre.system.apparence) { return "apparence"; }
|
else if (oeuvre.system.apparence) { return "apparence"; }
|
||||||
const compData = this.getCompetence(oeuvre.data.competence);
|
const compData = this.getCompetence(oeuvre.system.competence);
|
||||||
return compData.system.defaut_carac;
|
return compData.system.defaut_carac;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2827,14 +2827,14 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_meditationEPart(meditationRoll) {
|
_meditationEPart(meditationRoll) {
|
||||||
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'data.malus': meditationRoll.meditation.data.malus - 1 }]);
|
this.updateEmbeddedDocuments('Item', [{ _id: meditationRoll.meditation._id, 'data.malus': meditationRoll.meditation.system.malus - 1 }]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_getSignesDraconiques(coord) {
|
_getSignesDraconiques(coord) {
|
||||||
const type = TMRUtility.getTMRType(coord);
|
const type = TMRUtility.getTMRType(coord);
|
||||||
return this.listItemsData("signedraconique").filter(it => it.data.typesTMR.includes(type));
|
return this.listItemsData("signedraconique").filter(it => it.system.typesTMR.includes(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -3063,7 +3063,7 @@ export class RdDActor extends Actor {
|
|||||||
await this.createEmbeddedDocuments("Item", [item]);
|
await this.createEmbeddedDocuments("Item", [item]);
|
||||||
|
|
||||||
// Suppression des anciens nombres astraux
|
// Suppression des anciens nombres astraux
|
||||||
let toDelete = this.listItemsData('nombreastral').filter(it => it.data.jourindex < game.system.rdd.calendrier.getCurrentDayIndex());
|
let toDelete = this.listItemsData('nombreastral').filter(it => it.system.jourindex < game.system.rdd.calendrier.getCurrentDayIndex());
|
||||||
const deletions = toDelete.map(it => it._id);
|
const deletions = toDelete.map(it => it._id);
|
||||||
await this.deleteEmbeddedDocuments("Item", deletions);
|
await this.deleteEmbeddedDocuments("Item", deletions);
|
||||||
|
|
||||||
@ -3140,7 +3140,7 @@ export class RdDActor extends Actor {
|
|||||||
ui.notifications.warn("Vous êtes déja dans les TMR....");
|
ui.notifications.warn("Vous êtes déja dans les TMR....");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let demiReve = this.getActiveEffects(it => it.data.label == "Demi-rêve");
|
let demiReve = this.getActiveEffects(it => it.label == "Demi-rêve");
|
||||||
if (mode != 'visu' && demiReve.length > 0) {
|
if (mode != 'visu' && demiReve.length > 0) {
|
||||||
ui.notifications.warn("Le joueur ou le MJ est déja dans les Terres Médianes avec ce personnage ! Visualisation uniquement");
|
ui.notifications.warn("Le joueur ou le MJ est déja dans les Terres Médianes avec ce personnage ! Visualisation uniquement");
|
||||||
mode = "visu"; // bascule le mode en visu automatiquement
|
mode = "visu"; // bascule le mode en visu automatiquement
|
||||||
@ -3264,7 +3264,7 @@ export class RdDActor extends Actor {
|
|||||||
if (!ReglesOptionelles.isUsing('deteriorationArmure') || itemData.system.protection == '0') {
|
if (!ReglesOptionelles.isUsing('deteriorationArmure') || itemData.system.protection == '0') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
itemData.data.deterioration = (itemData.system.deterioration ?? 0) + dmg;
|
itemData.system.deterioration = (itemData.system.deterioration ?? 0) + dmg;
|
||||||
if (itemData.system.deterioration >= 10) {
|
if (itemData.system.deterioration >= 10) {
|
||||||
itemData.system.deterioration -= 10;
|
itemData.system.deterioration -= 10;
|
||||||
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(itemData.system.protection);
|
let res = /(\d+)?d(\d+)(\-\d+)?/.exec(itemData.system.protection);
|
||||||
@ -3380,14 +3380,14 @@ export class RdDActor extends Actor {
|
|||||||
let encaissement = RdDUtility.selectEncaissement(jetTotal, rollData.dmg.mortalite)
|
let encaissement = RdDUtility.selectEncaissement(jetTotal, rollData.dmg.mortalite)
|
||||||
let over20 = Math.max(jetTotal - 20, 0);
|
let over20 = Math.max(jetTotal - 20, 0);
|
||||||
encaissement.dmg = rollData.dmg;
|
encaissement.dmg = rollData.dmg;
|
||||||
encaissement.dmg.loc = rollData.dmg.loc ?? await RdDUtility.getLocalisation(this.data.type);
|
encaissement.dmg.loc = rollData.dmg.loc ?? await RdDUtility.getLocalisation(this.type);
|
||||||
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;'
|
encaissement.dmg.loc.label = encaissement.dmg.loc.label ?? 'Corps;'
|
||||||
encaissement.roll = roll;
|
encaissement.roll = roll;
|
||||||
encaissement.armure = armure;
|
encaissement.armure = armure;
|
||||||
encaissement.total = jetTotal;
|
encaissement.total = jetTotal;
|
||||||
encaissement.vie = await RdDActor._evaluatePerte(encaissement.vie, over20);
|
encaissement.vie = await RdDActor._evaluatePerte(encaissement.vie, over20);
|
||||||
encaissement.endurance = await RdDActor._evaluatePerte(encaissement.endurance, over20);
|
encaissement.endurance = await RdDActor._evaluatePerte(encaissement.endurance, over20);
|
||||||
encaissement.penetration = rollData.arme?.data.penetration ?? 0;
|
encaissement.penetration = rollData.arme?.system.penetration ?? 0;
|
||||||
|
|
||||||
return encaissement;
|
return encaissement;
|
||||||
}
|
}
|
||||||
@ -3558,13 +3558,13 @@ export class RdDActor extends Actor {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
resonnance.actors.push(attaquant._id);
|
resonnance.actors.push(attaquant._id);
|
||||||
await this.update({ "data.sante.resonnance": resonnance });
|
await this.update({ "system.sante.resonnance": resonnance });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getFortune() {
|
getFortune() {
|
||||||
let monnaies = Monnaie.filtrerMonnaies(this.data.items);
|
let monnaies = Monnaie.filtrerMonnaies(this.items);
|
||||||
if (monnaies.length < 4) {
|
if (monnaies.length < 4) {
|
||||||
ui.notifications.error("Problème de monnaies manquantes, impossible de payer correctement!")
|
ui.notifications.error("Problème de monnaies manquantes, impossible de payer correctement!")
|
||||||
throw "Problème de monnaies manquantes, impossible de payer correctement!";
|
throw "Problème de monnaies manquantes, impossible de payer correctement!";
|
||||||
@ -3576,7 +3576,7 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async optimizeArgent(fortuneTotale) {
|
async optimizeArgent(fortuneTotale) {
|
||||||
let monnaies = Monnaie.filtrerMonnaies(this.data.items);
|
let monnaies = Monnaie.filtrerMonnaies(this.items);
|
||||||
let parValeur = Misc.classifyFirst(monnaies, it => this.system.valeur_deniers);
|
let parValeur = Misc.classifyFirst(monnaies, it => this.system.valeur_deniers);
|
||||||
let nouvelleFortune = {
|
let nouvelleFortune = {
|
||||||
1000: Math.floor(fortuneTotale / 1000), // or
|
1000: Math.floor(fortuneTotale / 1000), // or
|
||||||
@ -3600,8 +3600,8 @@ export class RdDActor extends Actor {
|
|||||||
let msg = "";
|
let msg = "";
|
||||||
if (depense == 0) {
|
if (depense == 0) {
|
||||||
if (dataObj) {
|
if (dataObj) {
|
||||||
dataObj.payload.data.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
dataObj.payload.system.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
||||||
dataObj.payload.data.quantite = quantite;
|
dataObj.payload.system.quantite = quantite;
|
||||||
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
||||||
msg += `<br>L'objet <strong>${dataObj.payload.name}</strong> a été ajouté gratuitement à votre inventaire.`;
|
msg += `<br>L'objet <strong>${dataObj.payload.name}</strong> a été ajouté gratuitement à votre inventaire.`;
|
||||||
}
|
}
|
||||||
@ -3616,8 +3616,8 @@ export class RdDActor extends Actor {
|
|||||||
RdDAudio.PlayContextAudio("argent"); // Petit son
|
RdDAudio.PlayContextAudio("argent"); // Petit son
|
||||||
|
|
||||||
if (dataObj) {
|
if (dataObj) {
|
||||||
dataObj.payload.data.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
dataObj.payload.system.cout = depense / 100; // Mise à jour du prix en sols , avec le prix acheté
|
||||||
dataObj.payload.data.quantite = quantite;
|
dataObj.payload.system.quantite = quantite;
|
||||||
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
await this.createEmbeddedDocuments('Item', [dataObj.payload]);
|
||||||
msg += `<br>Et l'objet <strong>${dataObj.payload.name}</strong> a été ajouté à votre inventaire.`;
|
msg += `<br>Et l'objet <strong>${dataObj.payload.name}</strong> a été ajouté à votre inventaire.`;
|
||||||
}
|
}
|
||||||
@ -3814,7 +3814,7 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isCristalAlchimique(it) {
|
isCristalAlchimique(it) {
|
||||||
return it.type == 'objet' && Grammar.toLowerCaseNoAccent(it.name) == 'cristal alchimique' && it.data.quantite > 0;
|
return it.type == 'objet' && Grammar.toLowerCaseNoAccent(it.name) == 'cristal alchimique' && it.system.quantite > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -3878,11 +3878,11 @@ export class RdDActor extends Actor {
|
|||||||
let subActor = game.actors.get(subActorId);
|
let subActor = game.actors.get(subActorId);
|
||||||
//console.log("Ajout acteur : ", actor, this);
|
//console.log("Ajout acteur : ", actor, this);
|
||||||
if (subActor && !subActor.owner) {
|
if (subActor && !subActor.owner) {
|
||||||
if (subActor.data.type == 'vehicule') {
|
if (subActortype == 'vehicule') {
|
||||||
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'data.subacteurs.vehicules', 'Ce Véhicule');
|
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'data.subacteurs.vehicules', 'Ce Véhicule');
|
||||||
} else if (subActor.data.type == 'creature') {
|
} else if (subActor.type == 'creature') {
|
||||||
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'data.subacteurs.montures', 'Cette Monture');
|
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'data.subacteurs.montures', 'Cette Monture');
|
||||||
} else if (subActor.data.type == 'personnage') {
|
} else if (subActor.type == 'personnage') {
|
||||||
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'data.subacteurs.suivants', 'Ce Suivant');
|
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'data.subacteurs.suivants', 'Ce Suivant');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -3946,17 +3946,17 @@ export class RdDActor extends Actor {
|
|||||||
potionData.alias = this.name;
|
potionData.alias = this.name;
|
||||||
potionData.supprimer = true;
|
potionData.supprimer = true;
|
||||||
|
|
||||||
if (potionData.data.magique) {
|
if (potionData.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potionData.rolled.isEchec) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
potionData.guerisonData = await this.buildPotionGuerisonList(potionData.data.puissance);
|
potionData.guerisonData = await this.buildPotionGuerisonList(potionData.system.puissance);
|
||||||
potionData.guerisonMinutes = potionData.guerisonData.pointsConsommes * 5;
|
potionData.guerisonMinutes = potionData.guerisonData.pointsConsommes * 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!potionData.data.magique || potionData.rolled.isSuccess) {
|
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
||||||
this.bonusRecuperationPotion = potionData.data.herbeBonus;
|
this.bonusRecuperationPotion = potionData.system.herbeBonus;
|
||||||
}
|
}
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||||
@ -3969,27 +3969,27 @@ export class RdDActor extends Actor {
|
|||||||
potionData.alias = this.name;
|
potionData.alias = this.name;
|
||||||
potionData.supprimer = true;
|
potionData.supprimer = true;
|
||||||
|
|
||||||
if (potionData.data.magique) {
|
if (potionData.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potionData.rolled.isEchec) {
|
||||||
await this.reveActuelIncDec(-1);
|
await this.reveActuelIncDec(-1);
|
||||||
let fatigueActuelle = this.getFatigueActuelle();
|
let fatigueActuelle = this.getFatigueActuelle();
|
||||||
potionData.caseFatigueReel = Math.min(fatigueActuelle, potionData.data.puissance);
|
potionData.caseFatigueReel = Math.min(fatigueActuelle, potionData.system.puissance);
|
||||||
potionData.guerisonDureeUnite = (potionData.data.reposalchimique) ? "rounds" : "minutes";
|
potionData.guerisonDureeUnite = (potionData.system.reposalchimique) ? "rounds" : "minutes";
|
||||||
potionData.guerisonDureeValue = (potionData.data.reposalchimique) ? potionData.caseFatigueReel : potionData.caseFatigueReel * 5;
|
potionData.guerisonDureeValue = (potionData.system.reposalchimique) ? potionData.caseFatigueReel : potionData.caseFatigueReel * 5;
|
||||||
potionData.aphasiePermanente = false;
|
potionData.aphasiePermanente = false;
|
||||||
if (potionData.data.reposalchimique) {
|
if (potionData.system.reposalchimique) {
|
||||||
let chanceAphasie = await RdDDice.rollTotal("1d100");
|
let chanceAphasie = await RdDDice.rollTotal("1d100");
|
||||||
if (chanceAphasie <= potionData.data.pr) {
|
if (chanceAphasie <= potionData.system.pr) {
|
||||||
potionData.aphasiePermanente = true;
|
potionData.aphasiePermanente = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.santeIncDec("fatigue", -potionData.caseFatigueReel);
|
await this.santeIncDec("fatigue", -potionData.caseFatigueReel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!potionData.data.magique || potionData.rolled.isSuccess) {
|
if (!potionData.system.magique || potionData.rolled.isSuccess) {
|
||||||
this.bonusRepos = potionData.data.herbeBonus;
|
this.bonusRepos = potionData.system.herbeBonus;
|
||||||
}
|
}
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||||
@ -4006,20 +4006,20 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async fabriquerPotion(herbeData) {
|
async fabriquerPotion(herbeData) {
|
||||||
let newPotion = {
|
let newPotion = {
|
||||||
name: `Potion de ${herbeData.data.categorie} (${herbeData.name})`, type: 'potion',
|
name: `Potion de ${herbeData.system.categorie} (${herbeData.name})`, type: 'potion',
|
||||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/fiole_verre.webp",
|
img: "systems/foundryvtt-reve-de-dragon/icons/objets/fiole_verre.webp",
|
||||||
data: {
|
data: {
|
||||||
quantite: 1, valeur_deniers: 1, encombrement: 0.01,
|
quantite: 1, valeur_deniers: 1, encombrement: 0.01,
|
||||||
categorie: herbeData.data.categorie,
|
categorie: herbeData.system.categorie,
|
||||||
herbe: herbeData.name,
|
herbe: herbeData.name,
|
||||||
rarete: herbeData.data.rarete,
|
rarete: herbeData.system.rarete,
|
||||||
herbebrins: herbeData.nbBrins,
|
herbebrins: herbeData.nbBrins,
|
||||||
description: ""
|
description: ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await this.createEmbeddedDocuments('Item', [newPotion], { renderSheet: true });
|
await this.createEmbeddedDocuments('Item', [newPotion], { renderSheet: true });
|
||||||
|
|
||||||
let newQuantite = herbeData.data.quantite - herbeData.nbBrins;
|
let newQuantite = herbeData.system.quantite - herbeData.nbBrins;
|
||||||
let messageData = {
|
let messageData = {
|
||||||
alias: this.name,
|
alias: this.name,
|
||||||
nbBrinsReste: newQuantite,
|
nbBrinsReste: newQuantite,
|
||||||
@ -4046,7 +4046,7 @@ export class RdDActor extends Actor {
|
|||||||
async consommerPotionGenerique(potionData) {
|
async consommerPotionGenerique(potionData) {
|
||||||
potionData.alias = this.name;
|
potionData.alias = this.name;
|
||||||
|
|
||||||
if (potionData.data.magique) {
|
if (potionData.system.magique) {
|
||||||
// Gestion de la résistance:
|
// Gestion de la résistance:
|
||||||
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
potionData.rolled = await RdDResolutionTable.roll(this.getReveActuel(), -8);
|
||||||
if (potionData.rolled.isEchec) {
|
if (potionData.rolled.isEchec) {
|
||||||
@ -4063,7 +4063,7 @@ export class RdDActor extends Actor {
|
|||||||
async consommerPotion(potion, onActionItem = async () => {}) {
|
async consommerPotion(potion, onActionItem = async () => {}) {
|
||||||
const potionData = potion
|
const potionData = potion
|
||||||
|
|
||||||
if (potionData.data.categorie.includes('Soin')) {
|
if (potionData.system.categorie.includes('Soin')) {
|
||||||
this.consommerPotionSoin(potionData);
|
this.consommerPotionSoin(potionData);
|
||||||
} else if (potionData.system.categorie.includes('Repos')) {
|
} else if (potionData.system.categorie.includes('Repos')) {
|
||||||
this.consommerPotionRepos(potionData);
|
this.consommerPotionRepos(potionData);
|
||||||
@ -4096,8 +4096,9 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getEffectByLabel(label) {
|
getEffectByLabel(label) {
|
||||||
return this.getActiveEffects().find(it => it.data.label == label);
|
console.log("Effects", this.getActiveEffects())
|
||||||
|
return this.getActiveEffects().find(it => it.system?.label == label);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -5,14 +5,14 @@ export class DialogItemVente extends Dialog {
|
|||||||
|
|
||||||
static async create(item, callback) {
|
static async create(item, callback) {
|
||||||
const itemData = item
|
const itemData = item
|
||||||
const quantite = item.isConteneur() ? 1 : itemData.data.quantite;
|
const quantite = item.isConteneur() ? 1 : itemData.system.quantite;
|
||||||
const venteData = {
|
const venteData = {
|
||||||
item: itemData,
|
item: itemData,
|
||||||
alias: item.actor?.name ?? game.user.name,
|
alias: item.actor?.name ?? game.user.name,
|
||||||
vendeurId: item.actor?.id,
|
vendeurId: item.actor?.id,
|
||||||
prixOrigine: itemData.data.cout,
|
prixOrigine: itemData.system.cout,
|
||||||
prixUnitaire: itemData.data.cout,
|
prixUnitaire: itemData.system.cout,
|
||||||
prixLot: itemData.data.cout,
|
prixLot: itemData.system.cout,
|
||||||
tailleLot: 1,
|
tailleLot: 1,
|
||||||
quantiteNbLots: quantite,
|
quantiteNbLots: quantite,
|
||||||
quantiteMaxLots: quantite,
|
quantiteMaxLots: quantite,
|
||||||
|
@ -109,7 +109,7 @@ export class RdDItemCompetence extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isMalusEncombrementTotal(competence) {
|
static isMalusEncombrementTotal(competence) {
|
||||||
return competence.name.toLowerCase().match(/(natation|acrobatie)/);
|
return competence?.name.toLowerCase().match(/(natation|acrobatie)/) || 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -6,11 +6,11 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static setRollDataCreature(rollData) {
|
static setRollDataCreature(rollData) {
|
||||||
rollData.competence = rollData.competence
|
rollData.competence = rollData.competence
|
||||||
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
|
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.system.carac_value } }
|
||||||
rollData.competence.data.defaut_carac = "carac_creature"
|
rollData.competence.system.defaut_carac = "carac_creature"
|
||||||
rollData.competence.data.categorie = "creature"
|
rollData.competence.system.categorie = "creature"
|
||||||
rollData.selectedCarac = rollData.carac.carac_creature
|
rollData.selectedCarac = rollData.carac.carac_creature
|
||||||
if (rollData.competence.data.iscombat) {
|
if (rollData.competence.system.iscombat) {
|
||||||
rollData.arme = RdDItemCompetenceCreature.toArme(rollData.competence);
|
rollData.arme = RdDItemCompetenceCreature.toArme(rollData.competence);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,12 +39,12 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCompetenceAttaque(itemData) {
|
static isCompetenceAttaque(itemData) {
|
||||||
itemData = itemData
|
itemData = itemData
|
||||||
return itemData.type == 'competencecreature' && itemData.data.iscombat;
|
return itemData.type == 'competencecreature' && itemData.system.iscombat;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCompetenceParade(itemData) {
|
static isCompetenceParade(itemData) {
|
||||||
itemData = itemData
|
itemData = itemData
|
||||||
return itemData.type == 'competencecreature' && itemData.data.isparade;
|
return itemData.type == 'competencecreature' && itemData.system.isparade;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
|||||||
dates: game.system.rdd.calendrier.getJoursSuivants(10),
|
dates: game.system.rdd.calendrier.getJoursSuivants(10),
|
||||||
etat: actor.getEtatGeneral(),
|
etat: actor.getEtatGeneral(),
|
||||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||||
astrologie: RdDItemCompetence.findCompetence(actor.data.items, 'Astrologie')
|
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', data);
|
||||||
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
||||||
@ -49,12 +49,12 @@ export class RdDAstrologieJoueur extends Dialog {
|
|||||||
let itemNombres = actor.listItemsData('nombreastral');
|
let itemNombres = actor.listItemsData('nombreastral');
|
||||||
let itemFiltered = {};
|
let itemFiltered = {};
|
||||||
for (let item of itemNombres) {
|
for (let item of itemNombres) {
|
||||||
if (itemFiltered[item.data.jourindex]) {
|
if (itemFiltered[item.system.jourindex]) {
|
||||||
itemFiltered[item.data.jourindex].listValues.push(item.data.value);
|
itemFiltered[item.system.jourindex].listValues.push(item.system.value);
|
||||||
} else {
|
} else {
|
||||||
itemFiltered[item.data.jourindex] = {
|
itemFiltered[item.system.jourindex] = {
|
||||||
listValues: [item.data.value],
|
listValues: [item.system.value],
|
||||||
jourlabel: item.data.jourlabel
|
jourlabel: item.system.jourlabel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,8 +64,8 @@ export class RdDAstrologieJoueur extends Dialog {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
requestJetAstrologie() {
|
requestJetAstrologie() {
|
||||||
let data = {
|
let data = {
|
||||||
id: this.actor.data._id,
|
id: this.actor.id,
|
||||||
carac_vue: Misc.data(this.actor).data.carac['vue'].value,
|
carac_vue: this.actor.system.carac['vue'].value,
|
||||||
etat: this.dataNombreAstral.etat,
|
etat: this.dataNombreAstral.etat,
|
||||||
astrologie: this.dataNombreAstral.astrologie,
|
astrologie: this.dataNombreAstral.astrologie,
|
||||||
conditions: $("#diffConditions").val(),
|
conditions: $("#diffConditions").val(),
|
||||||
|
@ -20,7 +20,7 @@ export class RdDBonus {
|
|||||||
|
|
||||||
static isAjustementAstrologique(rollData) {
|
static isAjustementAstrologique(rollData) {
|
||||||
return RdDCarac.isChance(rollData.selectedCarac) ||
|
return RdDCarac.isChance(rollData.selectedCarac) ||
|
||||||
rollData.selectedSort?.data.isrituel;
|
rollData.selectedSort?.system.isrituel;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isDefenseAttaqueFinesse(rollData) {
|
static isDefenseAttaqueFinesse(rollData) {
|
||||||
@ -68,23 +68,23 @@ export class RdDBonus {
|
|||||||
}
|
}
|
||||||
return isCauchemar ? "cauchemar"
|
return isCauchemar ? "cauchemar"
|
||||||
: rollData.dmg?.mortalite
|
: rollData.dmg?.mortalite
|
||||||
?? rollData.arme?.data.mortalite
|
?? rollData.arme?.system.mortalite
|
||||||
?? "mortel";
|
?? "mortel";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _dmgArme(rollData) {
|
static _dmgArme(rollData) {
|
||||||
if ( rollData.arme) {
|
if ( rollData.arme) {
|
||||||
let dmgBase = rollData.arme.data.dommagesReels ?? Number(rollData.arme.data.dommages ?? 0);
|
let dmgBase = rollData.arme.system.dommagesReels ?? Number(rollData.arme.system.dommages ?? 0);
|
||||||
//Le bonus dégats magiques ne peut pas faire dépasser le bonus de l'arme (cf p.278)
|
//Le bonus dégats magiques ne peut pas faire dépasser le bonus de l'arme (cf p.278)
|
||||||
return dmgBase + Math.min(dmgBase, rollData.arme.data.magique ? rollData.arme.data.ecaille_efficacite : 0);
|
return dmgBase + Math.min(dmgBase, rollData.arme.system.magique ? rollData.arme.system.ecaille_efficacite : 0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _peneration(rollData) {
|
static _peneration(rollData) {
|
||||||
return parseInt(rollData.arme?.data.penetration ?? 0);
|
return parseInt(rollData.arme?.system.penetration ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -320,7 +320,7 @@ export class RdDCalendrier extends Application {
|
|||||||
if (Misc.isUniqueConnectedGM()) { // Only once
|
if (Misc.isUniqueConnectedGM()) { // Only once
|
||||||
console.log(request);
|
console.log(request);
|
||||||
let jourDiff = this.getLectureAstrologieDifficulte(request.date);
|
let jourDiff = this.getLectureAstrologieDifficulte(request.date);
|
||||||
let niveau = Number(request.astrologie.data.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat);
|
let niveau = Number(request.astrologie.system.niveau) + Number(request.conditions) + Number(jourDiff) + Number(request.etat);
|
||||||
let rollData = {
|
let rollData = {
|
||||||
caracValue: request.carac_vue,
|
caracValue: request.carac_vue,
|
||||||
finalLevel: niveau,
|
finalLevel: niveau,
|
||||||
|
@ -97,7 +97,7 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
rollFormula = "2+( (" + RdDCombatManager.calculInitiative(competence.system.niveau, competence.system.carac_value) + ")/100)";
|
rollFormula = "2+( (" + RdDCombatManager.calculInitiative(competence.system.niveau, competence.system.carac_value) + ")/100)";
|
||||||
} else {
|
} else {
|
||||||
for (const itemData of combatant.actor.data.items) {
|
for (const itemData of combatant.actor.items) {
|
||||||
if (itemData.type == "arme" && itemData.data.equipe) {
|
if (itemData.type == "arme" && itemData.data.equipe) {
|
||||||
armeCombat = duplicate(itemData);
|
armeCombat = duplicate(itemData);
|
||||||
}
|
}
|
||||||
@ -428,9 +428,9 @@ export class RdDCombat {
|
|||||||
: "Vous devez choisir une cible à attaquer!");
|
: "Vous devez choisir une cible à attaquer!");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const defender = target?.actor;
|
const defender = target?.actor
|
||||||
const defenderTokenId = target?.data._id;
|
const defenderTokenId = target?.id
|
||||||
if ( defender.type == 'entite' && defender.data.data.definition.typeentite == 'nonincarne') {
|
if ( defender.type == 'entite' && defender.system.definition.typeentite == 'nonincarne') {
|
||||||
ui.notifications.warn("Vous ne pouvez pas cibler une entité non incarnée !!!!");
|
ui.notifications.warn("Vous ne pouvez pas cibler une entité non incarnée !!!!");
|
||||||
} else {
|
} else {
|
||||||
return this.create(attacker, defender, defenderTokenId, target)
|
return this.create(attacker, defender, defenderTokenId, target)
|
||||||
@ -531,8 +531,8 @@ export class RdDCombat {
|
|||||||
this.attacker = attacker;
|
this.attacker = attacker;
|
||||||
this.defender = defender;
|
this.defender = defender;
|
||||||
this.target = target;
|
this.target = target;
|
||||||
this.attackerId = this.attacker.data._id;
|
this.attackerId = this.attacker.id;
|
||||||
this.defenderId = this.defender.data._id;
|
this.defenderId = this.defender.id;
|
||||||
this.defenderTokenId = defenderTokenId;
|
this.defenderTokenId = defenderTokenId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ export class RdDCombat {
|
|||||||
if (!await this.accorderEntite('avant-attaque')) {
|
if (!await this.accorderEntite('avant-attaque')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (arme.data.cac == 'empoignade' && this.attacker.isCombatTouche()) {
|
if (arme.system.cac == 'empoignade' && this.attacker.isCombatTouche()) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
alias: this.attacker.name,
|
alias: this.attacker.name,
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.attacker.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.attacker.name),
|
||||||
@ -707,7 +707,7 @@ export class RdDCombat {
|
|||||||
_prepareAttaque(competence, arme) {
|
_prepareAttaque(competence, arme) {
|
||||||
let rollData = {
|
let rollData = {
|
||||||
passeArme: randomID(16),
|
passeArme: randomID(16),
|
||||||
mortalite: arme?.data.mortalite,
|
mortalite: arme?.system.mortalite,
|
||||||
coupsNonMortels: false,
|
coupsNonMortels: false,
|
||||||
competence: competence,
|
competence: competence,
|
||||||
surprise: this.attacker.getSurprise(true),
|
surprise: this.attacker.getSurprise(true),
|
||||||
@ -724,7 +724,7 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// sans armes: à mains nues
|
// sans armes: à mains nues
|
||||||
const niveau = competence.data.niveau;
|
const niveau = competence.system.niveau;
|
||||||
const init = RdDCombatManager.calculInitiative(niveau, this.attacker.system.carac['melee'].value);
|
const init = RdDCombatManager.calculInitiative(niveau, this.attacker.system.carac['melee'].value);
|
||||||
rollData.arme = RdDItemArme.mainsNues({ niveau: niveau, initiative: init });
|
rollData.arme = RdDItemArme.mainsNues({ niveau: niveau, initiative: init });
|
||||||
}
|
}
|
||||||
@ -738,9 +738,9 @@ export class RdDCombat {
|
|||||||
// force toujours, sauf empoignade
|
// force toujours, sauf empoignade
|
||||||
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
// finesse seulement en mélée, pour l'empoignade, ou si la difficulté libre est de -1 minimum
|
||||||
// rapidité seulement en mêlée, si l'arme le permet, et si la difficulté libre est de -1 minimum
|
// rapidité seulement en mêlée, si l'arme le permet, et si la difficulté libre est de -1 minimum
|
||||||
const isForce = !rollData.arme.data.empoignade;
|
const isForce = !rollData.arme.system.empoignade;
|
||||||
const isFinesse = rollData.arme.data.empoignade || isMeleeDiffNegative;
|
const isFinesse = rollData.arme.system.empoignade || isMeleeDiffNegative;
|
||||||
const isRapide = !rollData.arme.data.empoignade && isMeleeDiffNegative && rollData.arme.data.rapide;
|
const isRapide = !rollData.arme.system.empoignade && isMeleeDiffNegative && rollData.arme.system.rapide;
|
||||||
// si un seul choix possible, le prendre
|
// si un seul choix possible, le prendre
|
||||||
if (isForce && !isFinesse && !isRapide) {
|
if (isForce && !isFinesse && !isRapide) {
|
||||||
return await this.choixParticuliere(rollData, "force");
|
return await this.choixParticuliere(rollData, "force");
|
||||||
@ -775,7 +775,7 @@ export class RdDCombat {
|
|||||||
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker.getBonusDegat(), this.defender.isEntiteCauchemar());
|
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker.getBonusDegat(), this.defender.isEntiteCauchemar());
|
||||||
let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} }
|
let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} }
|
||||||
attackerRoll.show = {
|
attackerRoll.show = {
|
||||||
cible: this.target ? this.defender.data.name : 'la cible',
|
cible: this.target ? this.defender.system.name : 'la cible',
|
||||||
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
||||||
}
|
}
|
||||||
await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html');
|
await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html');
|
||||||
@ -796,7 +796,7 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _sendMessageDefense(attackerRoll, defenderRoll, essaisPrecedents = undefined) {
|
async _sendMessageDefense(attackerRoll, defenderRoll, essaisPrecedents = undefined) {
|
||||||
console.log("RdDCombat._sendMessageDefense", attackerRoll, defenderRoll, essaisPrecedents, " / ", this.attacker, this.target, this.attackerId, attackerRoll.competence.data.categorie);
|
console.log("RdDCombat._sendMessageDefense", attackerRoll, defenderRoll, essaisPrecedents, " / ", this.attacker, this.target, this.attackerId, attackerRoll.competence.system.categorie);
|
||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(attackerRoll.passeArme);
|
this.removeChatMessageActionsPasseArme(attackerRoll.passeArme);
|
||||||
if (essaisPrecedents) {
|
if (essaisPrecedents) {
|
||||||
@ -821,7 +821,7 @@ export class RdDCombat {
|
|||||||
armes: this._filterArmesParade(this.defender, attackerRoll.competence, attackerRoll.arme),
|
armes: this._filterArmesParade(this.defender, attackerRoll.competence, attackerRoll.arme),
|
||||||
diffLibre: attackerRoll.ajustements?.diffLibre?.value ?? 0,
|
diffLibre: attackerRoll.ajustements?.diffLibre?.value ?? 0,
|
||||||
attaqueParticuliere: attackerRoll.particuliere,
|
attaqueParticuliere: attackerRoll.particuliere,
|
||||||
attaqueCategorie: attackerRoll.competence.data.categorie,
|
attaqueCategorie: attackerRoll.competence.system.categorie,
|
||||||
attaqueArme: attackerRoll.arme,
|
attaqueArme: attackerRoll.arme,
|
||||||
surprise: this.defender.getSurprise(true),
|
surprise: this.defender.getSurprise(true),
|
||||||
dmg: attackerRoll.dmg,
|
dmg: attackerRoll.dmg,
|
||||||
@ -853,8 +853,8 @@ export class RdDCombat {
|
|||||||
// envoyer le message au destinataire
|
// envoyer le message au destinataire
|
||||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||||
msg: "msg_defense", data: {
|
msg: "msg_defense", data: {
|
||||||
attackerId: this.attacker?.data._id,
|
attackerId: this.attacker?.id,
|
||||||
defenderId: this.defender?.data._id,
|
defenderId: this.defender?.id,
|
||||||
defenderTokenId: this.defenderTokenId,
|
defenderTokenId: this.defenderTokenId,
|
||||||
defenderRoll: defenderRoll,
|
defenderRoll: defenderRoll,
|
||||||
paramChatDefense: paramChatDefense,
|
paramChatDefense: paramChatDefense,
|
||||||
@ -865,12 +865,12 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_filterArmesParade(defender, competence) {
|
_filterArmesParade(defender, competence) {
|
||||||
let items = defender.data.items;
|
let items = defender.items;
|
||||||
items = items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
items = items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
item.data.nbUsage = defender.getItemUse(item._id); // Ajout du # d'utilisation ce round
|
item.system.nbUsage = defender.getItemUse(item.id); // Ajout du # d'utilisation ce round
|
||||||
}
|
}
|
||||||
switch (competence.data.categorie) {
|
switch (competence.system.categorie) {
|
||||||
case 'tir':
|
case 'tir':
|
||||||
case 'lancer':
|
case 'lancer':
|
||||||
return items.filter(item => RdDItemArme.getCategorieParade(item) == 'boucliers')
|
return items.filter(item => RdDItemArme.getCategorieParade(item) == 'boucliers')
|
||||||
@ -902,7 +902,7 @@ export class RdDCombat {
|
|||||||
console.log("RdDCombat._onEchecTotal >>>", rollData);
|
console.log("RdDCombat._onEchecTotal >>>", rollData);
|
||||||
|
|
||||||
const arme = rollData.arme;
|
const arme = rollData.arme;
|
||||||
const avecArme = !['', 'sans-armes', 'armes-naturelles'].includes(arme?.data.categorie_parade ?? '');
|
const avecArme = !['', 'sans-armes', 'armes-naturelles'].includes(arme?.system.categorie_parade ?? '');
|
||||||
const action = (rollData.attackerRoll ? (arme ? "la parade" : "l'esquive") : "l'attaque");
|
const action = (rollData.attackerRoll ? (arme ? "la parade" : "l'esquive") : "l'attaque");
|
||||||
ChatUtility.createChatWithRollMode(this.defender.name, {
|
ChatUtility.createChatWithRollMode(this.defender.name, {
|
||||||
content: `<strong>Maladresse à ${action}!</strong> ` + await RdDRollTables.getMaladresse({ arme: avecArme })
|
content: `<strong>Maladresse à ${action}!</strong> ` + await RdDRollTables.getMaladresse({ arme: avecArme })
|
||||||
@ -921,7 +921,7 @@ export class RdDCombat {
|
|||||||
console.log("RdDCombat.choixParticuliere >>>", rollData, choix);
|
console.log("RdDCombat.choixParticuliere >>>", rollData, choix);
|
||||||
|
|
||||||
if (choix != "rapidite") {
|
if (choix != "rapidite") {
|
||||||
this.attacker.incDecItemUse(rollData.arme._id);
|
this.attacker.incDecItemUse(rollData.arme.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
this.removeChatMessageActionsPasseArme(rollData.passeArme);
|
||||||
@ -1101,11 +1101,11 @@ export class RdDCombat {
|
|||||||
|
|
||||||
const dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor;
|
const dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor;
|
||||||
let arme = defenderRoll.arme;
|
let arme = defenderRoll.arme;
|
||||||
let resistance = Misc.toInt(arme.data.resistance);
|
let resistance = Misc.toInt(arme.system.resistance);
|
||||||
if (arme.data.magique) {
|
if (arme.system.magique) {
|
||||||
defenderRoll.show.deteriorationArme = 'resiste'; // Par défaut
|
defenderRoll.show.deteriorationArme = 'resiste'; // Par défaut
|
||||||
if (arme.data.resistance_magique == undefined) arme.data.resistance_magique = 0; // Quick fix
|
if (arme.system.resistance_magique == undefined) arme.system.resistance_magique = 0; // Quick fix
|
||||||
if (dmg > arme.data.resistance_magique) { // Jet uniquement si dommages supérieur à résistance magique (cf. 274)
|
if (dmg > arme.system.resistance_magique) { // Jet uniquement si dommages supérieur à résistance magique (cf. 274)
|
||||||
// Jet de résistance de l'arme de parade (p.132)
|
// Jet de résistance de l'arme de parade (p.132)
|
||||||
let resistRoll = await RdDResolutionTable.rollData({
|
let resistRoll = await RdDResolutionTable.rollData({
|
||||||
caracValue: resistance,
|
caracValue: resistance,
|
||||||
@ -1113,7 +1113,7 @@ export class RdDCombat {
|
|||||||
showDice: HIDE_DICE
|
showDice: HIDE_DICE
|
||||||
});
|
});
|
||||||
if (!resistRoll.rolled.isSuccess) {
|
if (!resistRoll.rolled.isSuccess) {
|
||||||
let perteResistance = (dmg - arme.data.resistance_magique)
|
let perteResistance = (dmg - arme.system.resistance_magique)
|
||||||
resistance -= perteResistance;
|
resistance -= perteResistance;
|
||||||
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
|
defenderRoll.show.deteriorationArme = resistance <= 0 ? 'brise' : 'perte';
|
||||||
defenderRoll.show.perteResistance = perteResistance;
|
defenderRoll.show.perteResistance = perteResistance;
|
||||||
@ -1140,7 +1140,7 @@ export class RdDCombat {
|
|||||||
if (ReglesOptionelles.isUsing('defenseurDesarme') && resistance > 0 && RdDItemArme.getCategorieParade(defenderRoll.arme) != 'boucliers') {
|
if (ReglesOptionelles.isUsing('defenseurDesarme') && resistance > 0 && RdDItemArme.getCategorieParade(defenderRoll.arme) != 'boucliers') {
|
||||||
let desarme = await RdDResolutionTable.rollData({
|
let desarme = await RdDResolutionTable.rollData({
|
||||||
caracValue: this.defender.getForce(),
|
caracValue: this.defender.getForce(),
|
||||||
finalLevel: Misc.toInt(defenderRoll.competence.data.niveau) - dmg,
|
finalLevel: Misc.toInt(defenderRoll.competence.system.niveau) - dmg,
|
||||||
showDice: HIDE_DICE
|
showDice: HIDE_DICE
|
||||||
});
|
});
|
||||||
defenderRoll.show.desarme = desarme.rolled.isEchec;
|
defenderRoll.show.desarme = desarme.rolled.isEchec;
|
||||||
@ -1183,7 +1183,7 @@ export class RdDCombat {
|
|||||||
_computeImpactRecul(attaque) {
|
_computeImpactRecul(attaque) {
|
||||||
const taille = this.defender.getTaille();
|
const taille = this.defender.getTaille();
|
||||||
const force = this.attacker.getForce();
|
const force = this.attacker.getForce();
|
||||||
const dommages = attaque.arme.data.dommagesReels ?? attaque.arme.data.dommages;
|
const dommages = attaque.arme.system.dommagesReels ?? attaque.arme.system.dommages;
|
||||||
return taille - (force + dommages);
|
return taille - (force + dommages);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1254,7 +1254,7 @@ export class RdDCombat {
|
|||||||
isSonne: actor.getSonne(),
|
isSonne: actor.getSonne(),
|
||||||
blessuresStatus: actor.computeResumeBlessure(),
|
blessuresStatus: actor.computeResumeBlessure(),
|
||||||
SConst: actor.getSConst(),
|
SConst: actor.getSConst(),
|
||||||
actorId: actor.data._id,
|
actorId: actor.id,
|
||||||
isGrave: false,
|
isGrave: false,
|
||||||
isCritique: false
|
isCritique: false
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ export class RdDPossession {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static searchPossessionFromEntite( attacker, defender) {
|
static searchPossessionFromEntite( attacker, defender) {
|
||||||
let poss = attacker.data.items.find( poss => poss.type == 'possession' && poss.data.data.possedeid == defender.data._id);
|
let poss = attacker.items.find( poss => poss.type == 'possession' && poss.system.possedeid == defender.id);
|
||||||
if (!poss) {
|
if (!poss) {
|
||||||
poss = defender.data.items.find( poss => poss.type == 'possession' && poss.data.data.possedeid == defender.data._id);
|
poss = defender.items.find( poss => poss.type == 'possession' && poss.system.possedeid == defender.id);
|
||||||
}
|
}
|
||||||
return poss && duplicate(poss) || undefined;
|
return poss && duplicate(poss) || undefined;
|
||||||
}
|
}
|
||||||
@ -31,11 +31,11 @@ export class RdDPossession {
|
|||||||
possession.ptsConjuration = 0
|
possession.ptsConjuration = 0
|
||||||
possession.ptsPossession = 0
|
possession.ptsPossession = 0
|
||||||
console.log("Possession", possession)
|
console.log("Possession", possession)
|
||||||
if ( possession.data.compteur > 0) {
|
if ( possession.system.compteur > 0) {
|
||||||
possession.ptsPossession = possession.data.compteur
|
possession.ptsPossession = possession.system.compteur
|
||||||
}
|
}
|
||||||
if ( possession.data.compteur < 0) {
|
if ( possession.system.compteur < 0) {
|
||||||
possession.ptsConjuration = Math.abs(possession.data.compteur)
|
possession.ptsConjuration = Math.abs(possession.system.compteur)
|
||||||
}
|
}
|
||||||
possession.isPosseder = false
|
possession.isPosseder = false
|
||||||
possession.isConjurer = false
|
possession.isConjurer = false
|
||||||
@ -49,14 +49,14 @@ export class RdDPossession {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async resultConjuration( rollData) {
|
static async resultConjuration( rollData) {
|
||||||
let actor = game.actors.get(rollData.possession.data.possedeid)
|
let actor = game.actors.get(rollData.possession.system.possedeid)
|
||||||
if ( !rollData.rolled.isSuccess ) {
|
if ( !rollData.rolled.isSuccess ) {
|
||||||
if( rollData.isECNIDefender) {
|
if( rollData.isECNIDefender) {
|
||||||
rollData.possession.data.compteur--
|
rollData.possession.system.compteur--
|
||||||
} else {
|
} else {
|
||||||
rollData.possession.data.compteur++
|
rollData.possession.system.compteur++
|
||||||
}
|
}
|
||||||
let update = { _id: rollData.possession._id, "data.compteur": rollData.possession.data.compteur }
|
let update = { _id: rollData.possession._id, "system.compteur": rollData.possession.system.compteur }
|
||||||
await actor.updateEmbeddedDocuments('Item', [update])
|
await actor.updateEmbeddedDocuments('Item', [update])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,9 +72,9 @@ export class RdDPossession {
|
|||||||
let attacker = game.actors.get(attackerId)
|
let attacker = game.actors.get(attackerId)
|
||||||
let defender = game.actors.get(defenderId)
|
let defender = game.actors.get(defenderId)
|
||||||
|
|
||||||
let possession = attacker.items.find( item => item.type =='possession' && item.data.data.possessionid == possessionId)
|
let possession = attacker.items.find( item => item.type =='possession' && item.system.possessionid == possessionId)
|
||||||
if ( !possession ) {
|
if ( !possession ) {
|
||||||
possession = defender.items.find( item => item.type =='possession' && item.data.data.possessionid == possessionId)
|
possession = defender.items.find( item => item.type =='possession' && item.system.possessionid == possessionId)
|
||||||
if ( !possession) {
|
if ( !possession) {
|
||||||
ui.notifications.warn("Une erreur s'est produite : Aucune possession trouvée !!")
|
ui.notifications.warn("Une erreur s'est produite : Aucune possession trouvée !!")
|
||||||
return
|
return
|
||||||
@ -89,15 +89,15 @@ export class RdDPossession {
|
|||||||
rollData.actor = defender
|
rollData.actor = defender
|
||||||
if ( defender.type == "personnage") {
|
if ( defender.type == "personnage") {
|
||||||
rollData.competence = duplicate(defender.getDraconicOrZero())
|
rollData.competence = duplicate(defender.getDraconicOrZero())
|
||||||
rollData.competence.data.defaut_carac = 'reve-actuel'
|
rollData.competence.system.defaut_carac = 'reve-actuel'
|
||||||
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: defender.getReveActuel() } }
|
rollData.forceCarac = { 'reve-actuel': { label: "Rêve Actuel", value: defender.getReveActuel() } }
|
||||||
rollData.selectedCarac = defender.data.data.carac.reve
|
rollData.selectedCarac = defender.system.carac.reve
|
||||||
rollData.isECNIDefender = false
|
rollData.isECNIDefender = false
|
||||||
} else {
|
} else {
|
||||||
rollData.competence = duplicate(defender.getCompetence("Possession"))
|
rollData.competence = duplicate(defender.getCompetence("Possession"))
|
||||||
rollData.competence.data.defaut_carac = "reve"
|
rollData.competence.system.defaut_carac = "reve"
|
||||||
rollData.forceCarac = { 'reve': { label: "Rêve", value: defender.data.data.carac.reve.value } }
|
rollData.forceCarac = { 'reve': { label: "Rêve", value: defender.system.carac.reve.value } }
|
||||||
rollData.selectedCarac = defender.data.data.carac.reve
|
rollData.selectedCarac = defender.system.carac.reve
|
||||||
rollData.isECNIDefender = true
|
rollData.isECNIDefender = true
|
||||||
//RdDItemCompetenceCreature.setRollDataCreature( rollData )
|
//RdDItemCompetenceCreature.setRollDataCreature( rollData )
|
||||||
}
|
}
|
||||||
@ -154,8 +154,8 @@ export class RdDPossession {
|
|||||||
possession: possession,
|
possession: possession,
|
||||||
possede: defender.name,
|
possede: defender.name,
|
||||||
possesseur: attacker.name,
|
possesseur: attacker.name,
|
||||||
attackerId: attacker.data._id,
|
attackerId: attacker.id,
|
||||||
defenderId: defender.data._id,
|
defenderId: defender.id,
|
||||||
mode: "possession"
|
mode: "possession"
|
||||||
};
|
};
|
||||||
if ( attacker.isCreature()) {
|
if ( attacker.isCreature()) {
|
||||||
@ -182,7 +182,7 @@ export class RdDPossession {
|
|||||||
let possessionData = {
|
let possessionData = {
|
||||||
name: "Possession en cours de " + attacker.name, type: 'possession',
|
name: "Possession en cours de " + attacker.name, type: 'possession',
|
||||||
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
img: "systems/foundryvtt-reve-de-dragon/icons/entites/possession2.webp",
|
||||||
data: { description: "", typepossession: attacker.name, possede: false, possessionid: randomID(16), possesseurid: attacker.data._id, possedeid: defender.data._id, date: 0, compteur: 0 }
|
data: { 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
|
// Creates only the possession on the personnage side
|
||||||
let poss = await defender.createEmbeddedDocuments('Item', [possessionData])
|
let poss = await defender.createEmbeddedDocuments('Item', [possessionData])
|
||||||
|
@ -56,7 +56,7 @@ export class RdDRoll extends Dialog {
|
|||||||
useMoral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
useMoral: false, /* Est-ce que le joueur demande d'utiliser le moral ? Utile si le joueur change plusieurs fois de carac associée. */
|
||||||
perteMoralEchec: false, /* Pour l'affichage dans le chat */
|
perteMoralEchec: false, /* Pour l'affichage dans le chat */
|
||||||
use: { libre: true, conditions: true, surenc: false, encTotal: false },
|
use: { libre: true, conditions: true, surenc: false, encTotal: false },
|
||||||
isMalusEncombrementTotal: RdDItemCompetence.isMalusEncombrementTotal(rollData.competence),
|
isMalusEncombrementTotal: rollData.competence ? RdDItemCompetence.isMalusEncombrementTotal(rollData.competence) : 0,
|
||||||
useMalusEncTotal: false,
|
useMalusEncTotal: false,
|
||||||
encTotal: actor.getEncTotal(),
|
encTotal: actor.getEncTotal(),
|
||||||
ajustementAstrologique: actor.ajustementAstrologique(),
|
ajustementAstrologique: actor.ajustementAstrologique(),
|
||||||
|
@ -10,21 +10,22 @@ export class RdDRollTables {
|
|||||||
table = await pack.getDocument(entry._id);
|
table = await pack.getDocument(entry._id);
|
||||||
}
|
}
|
||||||
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
|
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
|
||||||
console.log("RdDRollTables", tableName, toChat, ":", draw);
|
//console.log("RdDRollTables", tableName, toChat, ":", draw);
|
||||||
return draw.results.length > 0 ? draw.results[0] : undefined;
|
return draw.results.length > 0 ? draw.results[0] : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async drawItemFromRollTable(tableName, toChat = false) {
|
static async drawItemFromRollTable(tableName, toChat = false) {
|
||||||
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
|
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
|
||||||
const pack = game.packs.get(drawResult.data.collection);
|
const pack = game.packs.get(drawResult.documentCollection)
|
||||||
return await pack.getDocument(drawResult.data.resultId);
|
let doc = await pack.getDocument(drawResult.documentId)
|
||||||
|
return doc
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async drawTextFromRollTable(tableName, toChat) {
|
static async drawTextFromRollTable(tableName, toChat) {
|
||||||
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
|
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
|
||||||
return drawResult.data.text;
|
return drawResult.system.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -78,12 +78,12 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
loadCasesSpeciales() {
|
loadCasesSpeciales() {
|
||||||
this.casesSpeciales = this.actor.data.items.filter(item => Draconique.isCaseTMR(item));
|
this.casesSpeciales = this.actor.items.filter(item => Draconique.isCaseTMR(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
loadSortsReserve() {
|
loadSortsReserve() {
|
||||||
this.sortsReserves = Misc.data(this.actor).data.reve.reserve.list;
|
this.sortsReserves = this.actor.system.reve.reserve.list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -141,17 +141,16 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
return EffetsDraconiques.rencontre.token(this.pixiTMR, rencontre, () => rencontre.coord);
|
return EffetsDraconiques.rencontre.token(this.pixiTMR, rencontre, () => rencontre.coord);
|
||||||
}
|
}
|
||||||
_tokenCaseSpeciale(casetmr) {
|
_tokenCaseSpeciale(casetmr) {
|
||||||
const caseData = Misc.data(casetmr);
|
const caseData = casetmr;
|
||||||
const draconique = Draconique.get(caseData.data.specific);
|
const draconique = Draconique.get(caseData.system.specific);
|
||||||
return draconique?.token(this.pixiTMR, caseData, () => caseData.data.coord);
|
return draconique?.token(this.pixiTMR, caseData, () => caseData.system.coord);
|
||||||
}
|
}
|
||||||
_tokenSortEnReserve(sortEnReserve) {
|
_tokenSortEnReserve(sortEnReserve) {
|
||||||
return EffetsDraconiques.sortReserve.token(this.pixiTMR, sortEnReserve.sort, () => sortEnReserve.coord);
|
return EffetsDraconiques.sortReserve.token(this.pixiTMR, sortEnReserve.sort, () => sortEnReserve.coord);
|
||||||
}
|
}
|
||||||
|
|
||||||
_tokenDemiReve() {
|
_tokenDemiReve() {
|
||||||
const actorData = Misc.data(this.actor);
|
return EffetsDraconiques.demiReve.token(this.pixiTMR, this.actor.system, () => this.actor.system.reve.tmrpos.coord);
|
||||||
return EffetsDraconiques.demiReve.token(this.pixiTMR, actorData, () => actorData.data.reve.tmrpos.coord);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateDemiReve() {
|
_updateDemiReve() {
|
||||||
@ -160,7 +159,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getActorCoord() {
|
_getActorCoord() {
|
||||||
return Misc.data(this.actor).data.reve.tmrpos.coord;
|
return this.actor.system.reve.tmrpos.coord;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -244,12 +243,11 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async updateValuesDisplay() {
|
async updateValuesDisplay() {
|
||||||
const coord = this._getActorCoord();
|
const coord = this._getActorCoord();
|
||||||
const actorData = Misc.data(this.actor);
|
|
||||||
|
|
||||||
HtmlUtility._showControlWhen($(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord));
|
HtmlUtility._showControlWhen($(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord));
|
||||||
|
|
||||||
let ptsreve = document.getElementById("tmr-pointsreve-value");
|
let ptsreve = document.getElementById("tmr-pointsreve-value");
|
||||||
ptsreve.innerHTML = actorData.data.reve.reve.value;
|
ptsreve.innerHTML = this.actor.system.reve.reve.value;
|
||||||
|
|
||||||
let tmrpos = document.getElementById("tmr-pos");
|
let tmrpos = document.getElementById("tmr-pos");
|
||||||
if (this.isDemiReveCache()) {
|
if (this.isDemiReveCache()) {
|
||||||
@ -262,12 +260,12 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
etat.innerHTML = this.actor.getEtatGeneral();
|
etat.innerHTML = this.actor.getEtatGeneral();
|
||||||
|
|
||||||
let refoulement = document.getElementById("tmr-refoulement-value");
|
let refoulement = document.getElementById("tmr-refoulement-value");
|
||||||
refoulement.innerHTML = actorData.data.reve.refoulement.value;
|
refoulement.innerHTML = this.actor.system.reve.refoulement.value;
|
||||||
|
|
||||||
if (ReglesOptionelles.isUsing("appliquer-fatigue")) {
|
if (ReglesOptionelles.isUsing("appliquer-fatigue")) {
|
||||||
let fatigueItem = document.getElementById("tmr-fatigue-table");
|
let fatigueItem = document.getElementById("tmr-fatigue-table");
|
||||||
//console.log("Refresh : ", actorData.data.sante.fatigue.value);
|
//console.log("Refresh : ", actorData.data.sante.fatigue.value);
|
||||||
fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(actorData.data.sante.fatigue.value, actorData.data.sante.endurance.max).html() + "</table>";
|
fatigueItem.innerHTML = "<table class='table-fatigue'>" + RdDUtility.makeHTMLfatigueMatrix(this.actor.system.sante.fatigue.value, this.actor.system.sante.endurance.max).html() + "</table>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,7 +505,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
const presentCite = this.casesSpeciales.find(c => EffetsDraconiques.presentCites.isCase(c, tmr.coord));
|
const presentCite = this.casesSpeciales.find(c => EffetsDraconiques.presentCites.isCase(c, tmr.coord));
|
||||||
if (presentCite) {
|
if (presentCite) {
|
||||||
this.minimize();
|
this.minimize();
|
||||||
const caseData = Misc.data(presentCite);
|
const caseData = presentCite;
|
||||||
EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr, postRencontre)));
|
EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr, postRencontre)));
|
||||||
}
|
}
|
||||||
return presentCite;
|
return presentCite;
|
||||||
@ -589,7 +587,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
maitrise: { verbe: 'maîtriser', action: 'Maîtriser le fleuve' }
|
maitrise: { verbe: 'maîtriser', action: 'Maîtriser le fleuve' }
|
||||||
}
|
}
|
||||||
rollData.double = EffetsDraconiques.isDoubleResistanceFleuve(this.actor) ? true : undefined,
|
rollData.double = EffetsDraconiques.isDoubleResistanceFleuve(this.actor) ? true : undefined,
|
||||||
rollData.competence.data.defaut_carac = 'reve-actuel';
|
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||||
await this._rollMaitriseCaseHumide(rollData);
|
await this._rollMaitriseCaseHumide(rollData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -714,7 +712,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.actor.getReveActuel() } },
|
forceCarac: { 'reve-actuel': { label: "Rêve Actuel", value: this.actor.getReveActuel() } },
|
||||||
maitrise: { verbe: 'conquérir', action: options.action }
|
maitrise: { verbe: 'conquérir', action: options.action }
|
||||||
};
|
};
|
||||||
rollData.competence.data.defaut_carac = 'reve-actuel';
|
rollData.competence.system.defaut_carac = 'reve-actuel';
|
||||||
|
|
||||||
await this._maitriserTMR(rollData, r => this._onResultatConquerir(r, options));
|
await this._maitriserTMR(rollData, r => this._onResultatConquerir(r, options));
|
||||||
}
|
}
|
||||||
@ -813,7 +811,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
//this.updateSortReserve();
|
//this.updateSortReserve();
|
||||||
console.log("declencheSortEnReserve", sortReserve)
|
console.log("declencheSortEnReserve", sortReserve)
|
||||||
this._tellToUserAndGM(`Vous avez déclenché le sort en réserve <strong> ${sortReserve.sort.name}</strong>
|
this._tellToUserAndGM(`Vous avez déclenché le sort en réserve <strong> ${sortReserve.sort.name}</strong>
|
||||||
avec ${sortReserve.sort.data.ptreve_reel} points de Rêve
|
avec ${sortReserve.sort.system.ptreve_reel} points de Rêve
|
||||||
en ${sortReserve.coord} (${TMRUtility.getTMRLabel(sortReserve.coord)})
|
en ${sortReserve.coord} (${TMRUtility.getTMRLabel(sortReserve.coord)})
|
||||||
`);
|
`);
|
||||||
this.close();
|
this.close();
|
||||||
@ -959,8 +957,8 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
this.updateValuesDisplay();
|
this.updateValuesDisplay();
|
||||||
game.socket.emit(SYSTEM_SOCKET_ID, {
|
game.socket.emit(SYSTEM_SOCKET_ID, {
|
||||||
msg: "msg_tmr_move", data: {
|
msg: "msg_tmr_move", data: {
|
||||||
actorId: this.actor.data._id,
|
actorId: this.actor.id,
|
||||||
tmrPos: Misc.data(this.actor).data.reve.tmrpos
|
tmrPos: this.actor.system.reve.tmrpos
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -32,14 +32,14 @@ export class Conquete extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _creerConquete(actor, queue) {
|
async _creerConquete(actor, queue) {
|
||||||
let existants = actor.data.items.filter(it => this.isCase(it)).map(it => Misc.data(it).data.coord);
|
let existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
let possibles = TMRUtility.filterTMR(tmr => !TMRUtility.isCaseHumide(tmr) && !existants.includes(tmr.coord));
|
let possibles = TMRUtility.filterTMR(tmr => !TMRUtility.isCaseHumide(tmr) && !existants.includes(tmr.coord));
|
||||||
let conquete = await RdDDice.rollOneOf(possibles);
|
let conquete = await RdDDice.rollOneOf(possibles);
|
||||||
await this.createCaseTmr(actor, 'Conquête: ' + conquete.label, conquete, queue.id);
|
await this.createCaseTmr(actor, 'Conquête: ' + conquete.label, conquete, queue.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onActorDeleteCaseTmr(actor, casetmr) {
|
async onActorDeleteCaseTmr(actor, casetmr) {
|
||||||
await actor.deleteEmbeddedDocuments('Item', [casetmr.data.sourceid]);
|
await actor.deleteEmbeddedDocuments('Item', [casetmr.system.sourceid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ export class Debordement extends Draconique {
|
|||||||
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('debordement'); }
|
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('debordement'); }
|
||||||
manualMessage() { return false }
|
manualMessage() { return false }
|
||||||
async onActorCreateOwned(actor, souffle) {
|
async onActorCreateOwned(actor, souffle) {
|
||||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
const tmr = await TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.coord)));
|
const tmr = await TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.coord)));
|
||||||
await this.createCaseTmr(actor, 'Debordement: ' + tmr.label, tmr, souffle.id);
|
await this.createCaseTmr(actor, 'Debordement: ' + tmr.label, tmr, souffle.id);
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ export class Desorientation extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_typesPossibles(actor) {
|
_typesPossibles(actor) {
|
||||||
const dejaDesorientes = Misc.distinct(actor.data.items.filter(it => this.isCase(it)).map(it => it.type));
|
const dejaDesorientes = Misc.distinct(actor.items.filter(it => this.isCase(it)).map(it => it.type));
|
||||||
return Object.keys(TMRType).filter(it => !dejaDesorientes.includes(it));
|
return Object.keys(TMRType).filter(it => !dejaDesorientes.includes(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ export class Desorientation extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _creerCasesTmr(actor, type, souffle) {
|
async _creerCasesTmr(actor, type, souffle) {
|
||||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
let tmrs = TMRUtility.filterTMR(it => it.type == type && !existants.includes(it.coord));
|
let tmrs = TMRUtility.filterTMR(it => it.type == type && !existants.includes(it.coord));
|
||||||
for (let tmr of tmrs) {
|
for (let tmr of tmrs) {
|
||||||
await this.createCaseTmr(actor, 'Désorientation: ' + tmr.label, tmr, souffle.id);
|
await this.createCaseTmr(actor, 'Désorientation: ' + tmr.label, tmr, souffle.id);
|
||||||
|
@ -15,7 +15,7 @@ export class Draconique {
|
|||||||
static isTeteDragon(itemData) { return itemData.type == 'tete'; }
|
static isTeteDragon(itemData) { return itemData.type == 'tete'; }
|
||||||
static isQueueSouffle(itemData) { return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData); }
|
static isQueueSouffle(itemData) { return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData); }
|
||||||
|
|
||||||
tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.data.coord); }
|
tmrLabel(linkData) { return TMRUtility.getTMRLabel(linkData.system.coord); }
|
||||||
|
|
||||||
static register(draconique) {
|
static register(draconique) {
|
||||||
registeredEffects[draconique.code()] = draconique;
|
registeredEffects[draconique.code()] = draconique;
|
||||||
@ -38,7 +38,7 @@ export class Draconique {
|
|||||||
* @returns true si l'item correspond
|
* @returns true si l'item correspond
|
||||||
*/
|
*/
|
||||||
match(item) {
|
match(item) {
|
||||||
const itemData = Misc.data(item);
|
const itemData = item;
|
||||||
return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData) || Draconique.isTeteDragon(itemData);
|
return Draconique.isQueueDragon(itemData) || Draconique.isSouffleDragon(itemData) || Draconique.isTeteDragon(itemData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,34 +116,32 @@ export class Draconique {
|
|||||||
* @param {*} coord les coordonnées d'une case. Si undefined toute case du type correspondra,
|
* @param {*} coord les coordonnées d'une case. Si undefined toute case du type correspondra,
|
||||||
*/
|
*/
|
||||||
isCase(item, coord = undefined) {
|
isCase(item, coord = undefined) {
|
||||||
const itemData = Misc.data(item);
|
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && (coord ? item.system.coord == coord : true);
|
||||||
return Draconique.isCaseTMR(itemData) && itemData.data.specific == this.code() && (coord ? itemData.data.coord == coord : true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
find(list, coord = undefined) {
|
find(list, coord = undefined) {
|
||||||
return list.find(c => this.isCase(Misc.data(c), coord));
|
return list.find(c => this.isCase(c, coord));
|
||||||
}
|
}
|
||||||
|
|
||||||
async createCaseTmr(actor, label, tmr, sourceId = undefined) {
|
async createCaseTmr(actor, label, tmr, sourceId = undefined) {
|
||||||
const casetmrData = {
|
const casetmrData = {
|
||||||
name: label, type: 'casetmr', img: this.img(),
|
name: label, type: 'casetmr', img: this.img(),
|
||||||
data: { coord: tmr.coord, specific: this.code(), sourceid: sourceId }
|
system: { coord: tmr.coord, specific: this.code(), sourceid: sourceId }
|
||||||
};
|
};
|
||||||
await actor.createEmbeddedDocuments('Item', [casetmrData]);
|
await actor.createEmbeddedDocuments('Item', [casetmrData]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteCasesTmr(actor, draconique) {
|
async deleteCasesTmr(actor, draconique) {
|
||||||
let caseTmrs = actor.data.items.filter(it => this.isCaseForSource(it, draconique));
|
let caseTmrs = actor.items.filter(it => this.isCaseForSource(it, draconique));
|
||||||
await actor.deleteEmbeddedDocuments('Item', caseTmrs.map(it => it.id));
|
await actor.deleteEmbeddedDocuments('Item', caseTmrs.map(it => it.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
isCaseForSource(item, draconique) {
|
isCaseForSource(item, draconique) {
|
||||||
const itemData = Misc.data(item);
|
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && item.system.sourceid == draconique.id;
|
||||||
return Draconique.isCaseTMR(itemData) && itemData.data.specific == this.code() && itemData.data.sourceid == draconique.id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async onVisiteSupprimer(actor, tmr, onRemoveToken) {
|
async onVisiteSupprimer(actor, tmr, onRemoveToken) {
|
||||||
let existants = actor.data.items.filter(it => this.isCase(it, tmr.coord));
|
let existants = actor.items.filter(it => this.isCase(it, tmr.coord));
|
||||||
await actor.deleteEmbeddedDocuments('Item', existants.map(it => it.id));
|
await actor.deleteEmbeddedDocuments('Item', existants.map(it => it.id));
|
||||||
for (let casetmr of existants) {
|
for (let casetmr of existants) {
|
||||||
onRemoveToken(tmr, casetmr);
|
onRemoveToken(tmr, casetmr);
|
||||||
|
@ -95,7 +95,7 @@ export class EffetsDraconiques {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isSortImpossible(actor) {
|
static isSortImpossible(actor) {
|
||||||
return actor.data.items.find(it =>
|
return actor.items.find(it =>
|
||||||
EffetsDraconiques.conquete.match(it) ||
|
EffetsDraconiques.conquete.match(it) ||
|
||||||
EffetsDraconiques.periple.match(it) ||
|
EffetsDraconiques.periple.match(it) ||
|
||||||
EffetsDraconiques.urgenceDraconique.match(it) ||
|
EffetsDraconiques.urgenceDraconique.match(it) ||
|
||||||
@ -104,7 +104,7 @@ export class EffetsDraconiques {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isSortReserveImpossible(actor) {
|
static isSortReserveImpossible(actor) {
|
||||||
return actor.data.items.find(it =>
|
return actor.items.find(it =>
|
||||||
EffetsDraconiques.conquete.match(it) ||
|
EffetsDraconiques.conquete.match(it) ||
|
||||||
EffetsDraconiques.periple.match(it) ||
|
EffetsDraconiques.periple.match(it) ||
|
||||||
EffetsDraconiques.pelerinage.match(it)
|
EffetsDraconiques.pelerinage.match(it)
|
||||||
@ -112,7 +112,7 @@ export class EffetsDraconiques {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static filterItems(actor, filter, name) {
|
static filterItems(actor, filter, name) {
|
||||||
return actor.data.items.filter(filter)
|
return actor.filter(filter)
|
||||||
.filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
.filter(it => Grammar.includesLowerCaseNoAccent(it.name, name));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -150,11 +150,11 @@ export class EffetsDraconiques {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static isPontImpraticable(actor) {
|
static isPontImpraticable(actor) {
|
||||||
return actor.data.items.find(it => EffetsDraconiques.pontImpraticable.match(it));
|
return actor.items.find(it => EffetsDraconiques.pontImpraticable.match(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
static isUrgenceDraconique(actor) {
|
static isUrgenceDraconique(actor) {
|
||||||
return actor.data.items.find(it => EffetsDraconiques.urgenceDraconique.match(it));
|
return actor.items.find(it => EffetsDraconiques.urgenceDraconique.match(it));
|
||||||
}
|
}
|
||||||
|
|
||||||
static isPeage(actor) {
|
static isPeage(actor) {
|
||||||
|
@ -30,7 +30,7 @@ export class FermetureCites extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _fermerLesCites(actor, souffle) {
|
async _fermerLesCites(actor, souffle) {
|
||||||
let existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
let existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
let ouvertes = TMRUtility.filterTMR(it => it.type == 'cite' && !existants.includes(it.coord));
|
let ouvertes = TMRUtility.filterTMR(it => it.type == 'cite' && !existants.includes(it.coord));
|
||||||
for (let tmr of ouvertes) {
|
for (let tmr of ouvertes) {
|
||||||
await this.createCaseTmr(actor, 'Fermeture: ' + tmr.label, tmr, souffle.id);
|
await this.createCaseTmr(actor, 'Fermeture: ' + tmr.label, tmr, souffle.id);
|
||||||
|
@ -33,7 +33,7 @@ export class Pelerinage extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async onActorDeleteCaseTmr(actor, casetmr) {
|
async onActorDeleteCaseTmr(actor, casetmr) {
|
||||||
await actor.deleteEmbeddedDocuments('Item', [casetmr.data.sourceid]);
|
await actor.deleteEmbeddedDocuments('Item', [casetmr.system.sourceid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ export class PresentCites extends Draconique {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _ajouterPresents(actor, tete) {
|
async _ajouterPresents(actor, tete) {
|
||||||
let existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
let existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
if (existants.length > 0) {
|
if (existants.length > 0) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||||
|
@ -12,8 +12,8 @@ export class ReserveExtensible extends Draconique {
|
|||||||
match(item) { return Draconique.isTeteDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes("reserve extensible"); }
|
match(item) { return Draconique.isTeteDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes("reserve extensible"); }
|
||||||
manualMessage() { return "Vous pouvez re-configurer votre Réserve extensible" }
|
manualMessage() { return "Vous pouvez re-configurer votre Réserve extensible" }
|
||||||
async onActorCreateOwned(actor, tete) {
|
async onActorCreateOwned(actor, tete) {
|
||||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
const tmr = await TMRUtility.getTMRAleatoire(it => !(it.type == 'fleuve' || existants.includes(it.coord)));
|
const tmr = await TMRUtility.getTMRAleatoire(it => !(it.type == 'fleuve' || existants.includes(it.system.coord)));
|
||||||
await this.createCaseTmr(actor, "Nouvelle Réserve extensible", tmr, tete.id);
|
await this.createCaseTmr(actor, "Nouvelle Réserve extensible", tmr, tete.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ export class TrouNoir extends Draconique {
|
|||||||
manualMessage() { return false }
|
manualMessage() { return false }
|
||||||
|
|
||||||
async onActorCreateOwned(actor, souffle) {
|
async onActorCreateOwned(actor, souffle) {
|
||||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||||
const tmr = await TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.coord)));
|
const tmr = await TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.system.coord)));
|
||||||
await this.createCaseTmr(actor, 'Trou noir: ' + tmr.label, tmr, souffle.id);
|
await this.createCaseTmr(actor, 'Trou noir: ' + tmr.label, tmr, souffle.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,12 +44,12 @@
|
|||||||
{{#each data.carac as |carac key|}}
|
{{#each data.carac as |carac key|}}
|
||||||
<li class="flexrow list-item" data-attribute="{{key}}">
|
<li class="flexrow list-item" data-attribute="{{key}}">
|
||||||
{{#if (eq key 'taille')}}
|
{{#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}}
|
{{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>
|
name={{key}}>{{carac.label}}</a></span>
|
||||||
{{/if}}
|
{{/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}}" />
|
value="{{carac.value}}" data-dtype="{{carac.type}}" />
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@ -63,26 +63,26 @@
|
|||||||
<ol class="carac-list alterne-list">
|
<ol class="carac-list alterne-list">
|
||||||
{{#each data.attributs as |attr key|}}
|
{{#each data.attributs as |attr key|}}
|
||||||
<li class="flexrow list-item" data-attribute="{{key}}">
|
<li class="flexrow list-item" data-attribute="{{key}}">
|
||||||
<span class="carac-label" name="data.attributs.{{key}}.label">{{attr.label}}</span>
|
<span class="carac-label" name="system.attributs.{{key}}.label">{{attr.label}}</span>
|
||||||
<input type="text" name="data.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" />
|
<input type="text" name="system.attributs.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.type}}" />
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<li class="flexrow list-item" data-attribute="vie">
|
<li class="flexrow list-item" data-attribute="vie">
|
||||||
<span class="competence-label" name="data.sante.vie.label">Vie</span>
|
<span class="competence-label" name="data.sante.vie.label">Vie</span>
|
||||||
<span class="flexrow" >
|
<span class="flexrow" >
|
||||||
<input type="text" name="data.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number" /> /
|
<input type="text" name="system.sante.vie.value" value="{{data.sante.vie.value}}" data-dtype="Number" /> /
|
||||||
<input type="text" name="data.sante.vie.max" value="{{data.sante.vie.max}}" data-dtype="Number" />
|
<input type="text" name="system.sante.vie.max" value="{{data.sante.vie.max}}" data-dtype="Number" />
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="flexrow list-item" data-attribute="endurance">
|
<li class="flexrow list-item" data-attribute="endurance">
|
||||||
<span class="competence-label" name="data.sante.endurance.label">Endurance</span>
|
<span class="competence-label" name="system.sante.endurance.label">Endurance</span>
|
||||||
<span class="flexrow" >
|
<span class="flexrow" >
|
||||||
<input type="text" name="data.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number" /> /
|
<input type="text" name="system.sante.endurance.value" value="{{data.sante.endurance.value}}" data-dtype="Number" /> /
|
||||||
<input type="text" name="data.sante.endurance.max" value="{{data.sante.endurance.max}}" data-dtype="Number" />
|
<input type="text" name="system.sante.endurance.max" value="{{data.sante.endurance.max}}" data-dtype="Number" />
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="flexrow list-item" data-attribute="etat">
|
<li class="flexrow list-item" data-attribute="etat">
|
||||||
<span class="competence-label" name="data.compteurs.etat.label">Etat Général</span>
|
<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="{{data.compteurs.etat.value}}" disabled />
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
@ -102,11 +102,11 @@
|
|||||||
<span class="competence-label">{{comp.name}}</span>
|
<span class="competence-label">{{comp.name}}</span>
|
||||||
</a>
|
</a>
|
||||||
<input class="competence-value creature-carac" type="text" compname="{{comp.name}}"
|
<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}}"
|
<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}}"
|
<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">
|
<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-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-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
@ -162,7 +162,7 @@
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span class="item-name"><h4>Race</h4></span>
|
<span class="item-name"><h4>Race</h4></span>
|
||||||
<input type="text" name="data.race" value="{{data.race}}" data-dtype="String" />
|
<input type="text" name="system.race" value="{{data.race}}" data-dtype="String" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group editor">
|
<div class="form-group editor">
|
||||||
|
@ -600,7 +600,7 @@
|
|||||||
{{#each hautreve.sortsReserve as |reserve key|}}
|
{{#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-item-id="{{reserve._id}}" data-attribute="{{key}}">
|
||||||
<img class="sheet-competence-img" src="{{reserve.sort.img}}" />
|
<img class="sheet-competence-img" src="{{reserve.sort.img}}" />
|
||||||
<span class="display-label">{{reserve.sort.name}} r{{reserve.sort.data.ptreve_reel}}</span>
|
<span class="display-label">{{reserve.sort.name}} r{{reserve.sort.system.ptreve_reel}}</span>
|
||||||
<span>{{reserve.coord}} - {{caseTmr-label reserve.coord}}</span>
|
<span>{{reserve.coord}} - {{caseTmr-label reserve.coord}}</span>
|
||||||
<div class="item-controls flex-shrink">
|
<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="item-control item-delete flex-shrink" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||||
@ -618,10 +618,10 @@
|
|||||||
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}">
|
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}">
|
||||||
<span class="display-label flex-grow">
|
<span class="display-label flex-grow">
|
||||||
<a data-item-id="{{sort._id}}">{{sort.name}}
|
<a data-item-id="{{sort._id}}">{{sort.name}}
|
||||||
- {{#if sort.data.caseTMRspeciale}}{{sort.data.caseTMRspeciale}}{{else}}{{upperFirst sort.data.caseTMR}}{{/if}}
|
- {{#if sort.system.caseTMRspeciale}}{{sort.system.caseTMRspeciale}}{{else}}{{upperFirst sort.system.caseTMR}}{{/if}}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span>{{sort.data.draconic}} / {{sort.data.difficulte}}</span>
|
<span>{{sort.system.draconic}} / {{sort.system.difficulte}}</span>
|
||||||
<div class="item-controls flex-shrink">
|
<div class="item-controls flex-shrink">
|
||||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
@ -633,7 +633,7 @@
|
|||||||
<ul class="item-list">
|
<ul class="item-list">
|
||||||
{{#each meditations as |meditation key|}}
|
{{#each meditations as |meditation key|}}
|
||||||
<li class="item flexrow" data-item-id="{{meditation._id}}" data-attribute="{{key}}">
|
<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.data.competence}}</a></span>
|
<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">
|
<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-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-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||||
@ -648,7 +648,7 @@
|
|||||||
{{#each hautreve.casesTmr as |casetmr key|}}
|
{{#each hautreve.casesTmr as |casetmr key|}}
|
||||||
<li class="item flexrow" data-item-id="{{casetmr._id}}" data-attribute="{{key}}">
|
<li class="item flexrow" data-item-id="{{casetmr._id}}" data-attribute="{{key}}">
|
||||||
<span class="display-label"><a data-item-id="{{casetmr._id}}">{{casetmr.name}}</a></span>
|
<span class="display-label"><a data-item-id="{{casetmr._id}}">{{casetmr.name}}</a></span>
|
||||||
<span>{{casetmr.data.coord}} - {{caseTmr-label casetmr.data.coord}}</span>
|
<span>{{casetmr.system.coord}} - {{caseTmr-label casetmr.system.coord}}</span>
|
||||||
<div class="item-controls flex-shrink">
|
<div class="item-controls flex-shrink">
|
||||||
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Supprimer"><i class="fas fa-trash"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="{{herbe.img}}" alt="fabrication" />
|
<img class="chat-icon" src="{{herbe.img}}" alt="fabrication" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} a fabriqué une potion de {{herbe.data.categorie}} de {{herbe.name}}, avec {{herbe.nbBrins}} brins.
|
{{alias}} a fabriqué une potion de {{herbe.system.categorie}} de {{herbe.name}}, avec {{herbe.nbBrins}} brins.
|
||||||
</h4>
|
</h4>
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de chanter : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
{{alias}} tente de chanter : {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de danser : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
{{alias}} tente de danser : {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} joue à : {{oeuvre.name}}
|
{{alias}} joue à : {{oeuvre.name}}
|
||||||
</h4>
|
</h4>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
{{#if rolled.isSuccess}}
|
{{#if rolled.isSuccess}}
|
||||||
{{alias}} aperçoit un signe draconique éphémère, qu'il faut aller lire en <strong>{{typeTmr-name meditation.data.tmr}}</strong>.
|
{{alias}} aperçoit un signe draconique éphémère, qu'il faut aller lire en <strong>{{typeTmr-name meditation.system.tmr}}</strong>.
|
||||||
{{else}}
|
{{else}}
|
||||||
La méditation de {{alias}} ne porte pas ses fruits, il ne distingue aucun signe Draconique.
|
La méditation de {{alias}} ne porte pas ses fruits, il ne distingue aucun signe Draconique.
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de jouer le morceau : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
{{alias}} tente de jouer le morceau : {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
@ -12,4 +12,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<h4><img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<h4><img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
|
|
||||||
{{alias}} tente d'interpréter {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
{{alias}} tente d'interpréter {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
<br>{{upperFirst oeuvre.data.default_carac}} / {{oeuvre.data.competence}}
|
<br>{{upperFirst oeuvre.data.default_carac}} / {{oeuvre.data.competence}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
@ -13,4 +13,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{{#if (eq mode "possession")}}
|
{{#if (eq mode "possession")}}
|
||||||
{{#if possession.isSuccess}}
|
{{#if possession.isSuccess}}
|
||||||
<a class='defense-possession chat-card-button' data-attackerId='{{attackerId}}'
|
<a class='defense-possession chat-card-button' data-attackerId='{{attackerId}}'
|
||||||
data-defenderId='{{defenderId}}' data-possessionId='{{possession.data.possessionid}}'>Résister à la possession</a>
|
data-defenderId='{{defenderId}}' data-possessionId='{{possession.system.possessionid}}'>Résister à la possession</a>
|
||||||
</a>
|
</a>
|
||||||
{{else}}
|
{{else}}
|
||||||
La Tentative de Possession a échouée !
|
La Tentative de Possession a échouée !
|
||||||
@ -32,9 +32,9 @@
|
|||||||
<br>Points de Conjuration: {{possession.ptsConjuration}}
|
<br>Points de Conjuration: {{possession.ptsConjuration}}
|
||||||
|
|
||||||
{{#if possession.isPosseder}}
|
{{#if possession.isPosseder}}
|
||||||
<br><strong>Vous êtes été possédé par {{possession.data.typepossession}} ! La possession en cours a été supprimée.</strong>
|
<br><strong>Vous êtes été possédé par {{possession.system.typepossession}} ! La possession en cours a été supprimée.</strong>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if possession.isConjurer}}
|
{{#if possession.isConjurer}}
|
||||||
<br><strong>Vous avez conjuré {{possession.data.typepossession}} ! La possession en cours a été supprimée.</strong>
|
<br><strong>Vous avez conjuré {{possession.system.typepossession}} ! La possession en cours a été supprimée.</strong>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.data.competence}}" />
|
<img class="chat-icon" src="{{competence.img}}" alt="{{oeuvre.system.competence}}" />
|
||||||
<h4>
|
<h4>
|
||||||
{{alias}} tente de cuisiner la recette : {{oeuvre.name}} (niveau {{oeuvre.data.niveau}})
|
{{alias}} tente de cuisiner la recette : {{oeuvre.name}} (niveau {{oeuvre.system.niveau}})
|
||||||
</h4>
|
</h4>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-infojet.html"}}
|
||||||
<hr>
|
<hr>
|
||||||
@ -21,4 +21,4 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.data}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-description.html" oeuvre.system}}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
{{#if rolled.isETotal}}Echec TOTAL
|
{{#if rolled.isETotal}}Echec TOTAL
|
||||||
{{else if rolled.isEchec}}Echec
|
{{else if rolled.isEchec}}Echec
|
||||||
{{else}}Réussite{{/if}}
|
{{else}}Réussite{{/if}}
|
||||||
du {{#if selectedSort.data.isrituel}}rituel{{else}}sort{{/if}},
|
du {{#if selectedSort.system.isrituel}}rituel{{else}}sort{{/if}},
|
||||||
{{#if (eq depenseReve 0)}}pas de dépense de rêve
|
{{#if (eq depenseReve 0)}}pas de dépense de rêve
|
||||||
{{else if (eq depenseReve 1)}}1 point de rêve a été dépensé
|
{{else if (eq depenseReve 1)}}1 point de rêve a été dépensé
|
||||||
{{else}}{{depenseReve}} points de rêve ont été dépensés
|
{{else}}{{depenseReve}} points de rêve ont été dépensés
|
||||||
@ -25,5 +25,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="poesie-extrait poesie-overflow">
|
<div class="poesie-extrait poesie-overflow">
|
||||||
{{{selectedSort.data.description}}}
|
{{{selectedSort.system.description}}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,11 +8,11 @@
|
|||||||
<div>
|
<div>
|
||||||
{{alias}} a obtenu {{rolled.ptTache}} point{{~#unless (eq rolled.ptTache 1)}}s{{/unless}} de tâche,
|
{{alias}} a obtenu {{rolled.ptTache}} point{{~#unless (eq rolled.ptTache 1)}}s{{/unless}} de tâche,
|
||||||
son avancement est de
|
son avancement est de
|
||||||
<span class="rdd-roll-{{#if (gt tache.data.points_de_tache_courant 0)}}norm{{else}}etotal{{/if}}">{{tache.data.points_de_tache_courant}}
|
<span class="rdd-roll-{{#if (gt tache.system.points_de_tache_courant 0)}}norm{{else}}etotal{{/if}}">{{tache.system.points_de_tache_courant}}
|
||||||
{{#unless tache.data.cacher_points_de_tache}} sur {{tache.data.points_de_tache}}{{/unless}}</span>
|
{{#unless tache.system.cacher_points_de_tache}} sur {{tache.system.points_de_tache}}{{/unless}}</span>
|
||||||
point{{~#unless (eq tache.data.points_de_tache_courant 1)}}s{{/unless}} de tâche
|
point{{~#unless (eq tache.system.points_de_tache_courant 1)}}s{{/unless}} de tâche
|
||||||
({{~#unless (eq tache.data.tentatives 1)}}{{tache.data.tentatives}} tentatives{{else}}première tentative{{/unless~}}).
|
({{~#unless (eq tache.system.tentatives 1)}}{{tache.system.tentatives}} tentatives{{else}}première tentative{{/unless~}}).
|
||||||
{{#if (and tache.data.fatigue appliquerFatigue)}}<br><span>Il s'est fatigué de {{tache.data.fatigue}} case{{~#if (gt tache.data.fatigue 1)}}s{{/if}}.</span>{{/if}}
|
{{#if (and tache.system.fatigue appliquerFatigue)}}<br><span>Il s'est fatigué de {{tache.system.fatigue}} case{{~#if (gt tache.system.fatigue 1)}}s{{/if}}.</span>{{/if}}
|
||||||
{{#if rolled.isETotal}}<br><span>Son échec total augmente de 1 la difficulté de la tâche!</span>{{/if~}}
|
{{#if rolled.isETotal}}<br><span>Son échec total augmente de 1 la difficulté de la tâche!</span>{{/if~}}
|
||||||
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
{{> "systems/foundryvtt-reve-de-dragon/templates/chat-info-appel-au-moral.html"}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
{{#if item.img}}
|
{{#if item.img}}
|
||||||
<img class="chat-icon" src="{{item.img}}" title="{{item.name}}" alt="{{item.name}}" />
|
<img class="chat-icon" src="{{item.img}}" title="{{item.name}}" alt="{{item.name}}" />
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<div class="poesie-extrait poesie-overflow card-content">{{{item.data.description}}}</div>
|
<div class="poesie-extrait poesie-overflow card-content">{{{item.system.description}}}</div>
|
||||||
<p>
|
<p>
|
||||||
{{#each properties as |property p|}}
|
{{#each properties as |property p|}}
|
||||||
<span>{{{property}}}</span><br>
|
<span>{{{property}}}</span><br>
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
<div class="flex-group-left">
|
<div class="flex-group-left">
|
||||||
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
<img class="chat-icon" src="{{competence.img}}" alt="{{competence.name}}"/>
|
||||||
<div class="grid grid-2col">
|
<div class="grid grid-2col">
|
||||||
<label>Type:</label><label class="flex-grow">{{oeuvre.data.type}}</label>
|
<label>Type:</label><label class="flex-grow">{{oeuvre.system.type}}</label>
|
||||||
<label for="carac">Caractéristique:</label>{{>"systems/foundryvtt-reve-de-dragon/templates/partial-select-carac.html"}}
|
<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.niveauReel decimals=0 sign=true}}</label></label>
|
<label>{{competence.name}}:</label><label class="flex-grow">{{numberFormat competence.system.niveauReel decimals=0 sign=true}}</label></label>
|
||||||
<label>Niveau de base:</label><label class="flex-grow">{{oeuvre.data.base}}</label>
|
<label>Niveau de base:</label><label class="flex-grow">{{oeuvre.system.base}}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-group-left">
|
<div class="flex-group-left">
|
||||||
|
Loading…
Reference in New Issue
Block a user