Big WIP...
This commit is contained in:
parent
698ff79d41
commit
255c0a77b4
@ -36,12 +36,12 @@ export class RdDActorEntiteSheet extends ActorSheet {
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.actor.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
// items: items,
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.system))),
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
};
|
||||
|
||||
formData.options.isGM = game.user.isGM;
|
||||
|
@ -93,7 +93,6 @@ export class RdDActorSheet extends ActorSheet {
|
||||
RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.data.carac);
|
||||
formData.esquives = this.actor.getCompetences("Esquive").map(i => foundry.utils.deepClone(i.system))
|
||||
formData.combat = RdDCombatManager.finalizeArmeList(formData.combat, formData.competences, formData.data.carac);
|
||||
console.log("COMBAT STUFF", formData.combat, formData.armes)
|
||||
this.armesList = formData.combat;
|
||||
|
||||
// Common data
|
||||
@ -382,12 +381,12 @@ export class RdDActorSheet extends ActorSheet {
|
||||
if (this.options.editCaracComp) {
|
||||
// On carac change
|
||||
html.find('.carac-value').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("data.carac.", "");
|
||||
let caracName = event.currentTarget.name.replace(".value", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
this.actor.updateCarac(caracName, parseInt(event.target.value));
|
||||
});
|
||||
html.find('.carac-xp').change(async event => {
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("data.carac.", "");
|
||||
let caracName = event.currentTarget.name.replace(".xp", "").replace("system.carac.", "");
|
||||
//console.log("Value changed :", event, caracName);
|
||||
this.actor.updateCaracXP(caracName, parseInt(event.target.value));
|
||||
});
|
||||
|
@ -37,11 +37,11 @@ export class RdDActorVehiculeSheet extends ActorSheet {
|
||||
editable: this.isEditable,
|
||||
cssClass: this.isEditable ? "editable" : "locked",
|
||||
data: foundry.utils.deepClone(this.object.system),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e)),
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i.data))),
|
||||
itemsByType: Misc.classify(this.object.items.map(i => foundry.utils.deepClone(i))),
|
||||
};
|
||||
|
||||
RdDUtility.filterItemsPerTypeForSheet(formData);
|
||||
|
100
module/actor.js
100
module/actor.js
@ -415,7 +415,7 @@ export class RdDActor extends Actor {
|
||||
);
|
||||
if (index >= 0) {
|
||||
reserve.list.splice(index, 1);
|
||||
await this.update({ "data.reve.reserve": reserve });
|
||||
await this.update({ "system.reve.reserve": reserve });
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ export class RdDActor extends Actor {
|
||||
await this._recupererBlessures(message, "legere", blessures.legeres.liste.filter(b => b.active), []);
|
||||
await this._recupererBlessures(message, "grave", blessures.graves.liste.filter(b => b.active), blessures.legeres.liste);
|
||||
await this._recupererBlessures(message, "critique", blessures.critiques.liste.filter(b => b.active), blessures.graves.liste);
|
||||
await this.update({ "data.blessures": blessures });
|
||||
await this.update({ "system.blessures": blessures });
|
||||
await this._recupererVie(message);
|
||||
|
||||
const moralActuel = Misc.toInt(this.system.compteurs.moral.value);
|
||||
@ -472,7 +472,7 @@ export class RdDActor extends Actor {
|
||||
await this._recupererBlessures(message, "legere", blessures.legeres.liste.filter(b => b.active), []);
|
||||
await this._recupererBlessures(message, "grave", blessures.graves.liste.filter(b => b.active), blessures.legeres.liste);
|
||||
await this._recupererBlessures(message, "critique", blessures.critiques.liste.filter(b => b.active), blessures.graves.liste);
|
||||
await this.update({ "data.blessures": blessures });
|
||||
await this.update({ "system.blessures": blessures });
|
||||
await this._recupererVie(message);
|
||||
await this._jetDeMoralChateauDormant(message);
|
||||
await this._recupereChance();
|
||||
@ -607,7 +607,7 @@ export class RdDActor extends Actor {
|
||||
this._supprimerBlessure(blessure);
|
||||
}
|
||||
}
|
||||
await this.update({ "data.blessures": blessures });
|
||||
await this.update({ "system.blessures": blessures });
|
||||
}
|
||||
if (this.isPersonnage()) {
|
||||
await this.setEthylisme(1);
|
||||
@ -676,7 +676,7 @@ export class RdDActor extends Actor {
|
||||
message.content += `Vous dégrisez un peu (${RdDUtility.getNomEthylisme(ethylisme.value)}). `;
|
||||
}
|
||||
}
|
||||
await this.update({ "data.compteurs.ethylisme": ethylisme });
|
||||
await this.update({ "system.compteurs.ethylisme": ethylisme });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -697,7 +697,7 @@ export class RdDActor extends Actor {
|
||||
return;
|
||||
}
|
||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue));
|
||||
await this.update({ "data.sante.fatigue.value": fatigue });
|
||||
await this.update({ "system.sante.fatigue.value": fatigue });
|
||||
if (fatigue == 0) {
|
||||
message.content += "Vous êtes complêtement reposé. ";
|
||||
}
|
||||
@ -835,7 +835,7 @@ export class RdDActor extends Actor {
|
||||
async sortMisEnReserve(rollData, sort) {
|
||||
let reserve = duplicate(this.system.reve.reserve.list);
|
||||
reserve.push({ coord: rollData.tmr.coord, sort: sort, draconic: duplicate(rollData.competence) });
|
||||
await this.update({ "data.reve.reserve.list": reserve });
|
||||
await this.update({ "system.reve.reserve.list": reserve });
|
||||
this.currentTMR.updateTokens();
|
||||
}
|
||||
|
||||
@ -886,7 +886,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
carac.xp = xp;
|
||||
carac.value = value;
|
||||
await this.update({ [`data.carac.${caracName}`]: carac });
|
||||
await this.update({ [`system.carac.${caracName}`]: carac });
|
||||
this.updateExperienceLog("Carac +", xp, caracName + " passée à " + value);
|
||||
}
|
||||
}
|
||||
@ -902,8 +902,8 @@ export class RdDActor extends Actor {
|
||||
niveau++;
|
||||
}
|
||||
await competence.update({
|
||||
"data.xp": xp,
|
||||
"data.niveau": niveau,
|
||||
"system.xp": xp,
|
||||
"system.niveau": niveau,
|
||||
});
|
||||
this.updateExperienceLog("Compétence +", xp, competence.name + " passée à " + niveau);
|
||||
}
|
||||
@ -944,11 +944,11 @@ export class RdDActor extends Actor {
|
||||
if (competence) {
|
||||
const update = { _id: competence.id }
|
||||
if (fieldName == "niveau")
|
||||
update['data.niveau'] = compValue;
|
||||
update['system.niveau'] = compValue;
|
||||
else if (fieldName == "dommages")
|
||||
update['data.dommages'] = compValue;
|
||||
update['system.dommages'] = compValue;
|
||||
else
|
||||
update['data.carac_value'] = compValue;
|
||||
update['system.carac_value'] = compValue;
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // updates one EmbeddedEntity
|
||||
}
|
||||
}
|
||||
@ -973,7 +973,7 @@ export class RdDActor extends Actor {
|
||||
content: message
|
||||
});
|
||||
}
|
||||
const update = { _id: competence.id, 'data.niveau': nouveauNiveau };
|
||||
const update = { _id: competence.id, 'system.niveau': nouveauNiveau };
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
} else {
|
||||
console.log("Competence not found", idOrName);
|
||||
@ -1000,7 +1000,7 @@ export class RdDActor extends Actor {
|
||||
let competence = this.getCompetence(idOrName);
|
||||
if (competence) {
|
||||
if (isNaN(compValue) || typeof (compValue) != 'number') compValue = 0;
|
||||
const update = { _id: competence.id, 'data.xp_sort': compValue };
|
||||
const update = { _id: competence.id, 'system.xp_sort': compValue };
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + competence.name);
|
||||
} else {
|
||||
@ -1013,7 +1013,7 @@ export class RdDActor extends Actor {
|
||||
let competence = this.getCompetence(idOrName);
|
||||
if (competence) {
|
||||
compValue = compValue ?? 0;
|
||||
const update = { _id: competence.id, 'data.niveau_archetype': compValue };
|
||||
const update = { _id: competence.id, 'system.niveau_archetype': compValue };
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
} else {
|
||||
console.log("Competence not found", idOrName);
|
||||
@ -1029,20 +1029,20 @@ export class RdDActor extends Actor {
|
||||
mode: Misc.upperFirst(modeXP), valeur: valeurXP, raison: Misc.upperFirst(raisonXP),
|
||||
daterdd: game.system.rdd.calendrier.getDateFromIndex(), datereel: `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}`
|
||||
});
|
||||
await this.update({ [`data.experiencelog`]: expLog });
|
||||
await this.update({ [`system.experiencelog`]: expLog });
|
||||
console.log("Add XP log", expLog);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
||||
await this.update({ [`data.compteurs.${fieldName}.value`]: fieldValue });
|
||||
await this.update({ [`system.compteurs.${fieldName}.value`]: fieldValue });
|
||||
await this.addStressExperienceLog(fieldName, fieldValue, 'forcé: ' + raison);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async addCompteurValue(fieldName, fieldValue, raison = 'Inconnue') {
|
||||
let oldValue = this.system.compteurs[fieldName].value;
|
||||
await this.update({ [`data.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) });
|
||||
await this.update({ [`system.compteurs.${fieldName}.value`]: Number(oldValue) + Number(fieldValue) });
|
||||
await this.addStressExperienceLog(fieldName, fieldValue, raison);
|
||||
}
|
||||
|
||||
@ -1069,7 +1069,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updateAttributeValue(fieldName, fieldValue) {
|
||||
await this.update({ [`data.attributs.${fieldName}.value`]: fieldValue });
|
||||
await this.update({ [`system.attributs.${fieldName}.value`]: fieldValue });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1261,7 +1261,7 @@ export class RdDActor extends Actor {
|
||||
console.log('New conteneur filling!', newConteneur, newItemId, item);
|
||||
let contenu = duplicate(this.system.contenu);
|
||||
contenu.push(newItemId);
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: newConteneurId, 'data.contenu': contenu }]);
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: newConteneurId, 'system.contenu': contenu }]);
|
||||
}
|
||||
}
|
||||
for (let item of itemsList) {
|
||||
@ -1389,7 +1389,7 @@ export class RdDActor extends Actor {
|
||||
computeEtatGeneral() {
|
||||
// Pas d'état général pour les entités forçage à 0
|
||||
if (this.type == 'entite') {
|
||||
this.compteurs.etat.value = 0;
|
||||
this.system.compteurs.etat.value = 0;
|
||||
return
|
||||
}
|
||||
// Pour les autres
|
||||
@ -1416,7 +1416,7 @@ export class RdDActor extends Actor {
|
||||
refoulement = 0;
|
||||
await this.ajouterSouffle({ chat: true });
|
||||
}
|
||||
await this.update({ "data.reve.refoulement.value": refoulement });
|
||||
await this.update({ "system.reve.refoulement.value": refoulement });
|
||||
return refoulement == 0 ? "souffle" : "none";
|
||||
}
|
||||
|
||||
@ -1439,7 +1439,7 @@ export class RdDActor extends Actor {
|
||||
let queue;
|
||||
if (this.system.reve.reve.thanatosused) {
|
||||
queue = await RdDRollTables.getOmbre();
|
||||
await this.update({ "data.reve.reve.thanatosused": false });
|
||||
await this.update({ "system.reve.reve.thanatosused": false });
|
||||
}
|
||||
else {
|
||||
queue = await RdDRollTables.getQueue();
|
||||
@ -1456,10 +1456,10 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async cacheTMR() {
|
||||
await this.update({ 'data.reve.tmrpos.cache': true });
|
||||
await this.update({ 'system.reve.tmrpos.cache': true });
|
||||
}
|
||||
async montreTMR() {
|
||||
await this.update({ 'data.reve.tmrpos.cache': false });
|
||||
await this.update({ 'system.reve.tmrpos.cache': false });
|
||||
}
|
||||
isTMRCache() {
|
||||
return this.system.reve.tmrpos.cache;
|
||||
@ -1517,7 +1517,7 @@ export class RdDActor extends Actor {
|
||||
let rencontres = this.getTMRRencontres();
|
||||
let newRencontres = rencontres.filter(it => it.coord != this.getDemiReve());
|
||||
if (newRencontres.length != rencontres.length) {
|
||||
await this.update({ "data.reve.rencontre.list": newRencontres });
|
||||
await this.update({ "system.reve.rencontre.list": newRencontres });
|
||||
}
|
||||
}
|
||||
|
||||
@ -1527,7 +1527,7 @@ export class RdDActor extends Actor {
|
||||
let newRencontres = rencontres.filter(it => it.coord != this.getDemiReve());
|
||||
if (newRencontres.length == rencontres.length) {
|
||||
newRencontres.push(currentRencontre);
|
||||
await this.update({ "data.reve.rencontre.list": newRencontres });
|
||||
await this.update({ "system.reve.rencontre.list": newRencontres });
|
||||
}
|
||||
}
|
||||
|
||||
@ -1794,7 +1794,7 @@ export class RdDActor extends Actor {
|
||||
if (!blessure.active) {
|
||||
this._supprimerBlessure(blessure);
|
||||
}
|
||||
await this.update({ 'data.blessures': listBlessures });
|
||||
await this.update({ 'system.blessures': listBlessures });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1807,7 +1807,7 @@ export class RdDActor extends Actor {
|
||||
blessure.soins_complets = pcomplets;
|
||||
blessure.jours = jours;
|
||||
blessure.loc = loc;
|
||||
await this.update({ 'data.blessures': listBlessures });
|
||||
await this.update({ 'system.blessures': listBlessures });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1876,7 +1876,7 @@ export class RdDActor extends Actor {
|
||||
if (degre == 1) {
|
||||
ethylisme.jet_moral = false;
|
||||
}
|
||||
await this.update({ "data.compteurs.ethylisme": ethylisme });
|
||||
await this.update({ "system.compteurs.ethylisme": ethylisme });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -2404,7 +2404,7 @@ export class RdDActor extends Actor {
|
||||
rollData.depenseReve = Number(selectedSort.system.ptreve_reel);
|
||||
|
||||
if (rollData.competence.name.includes('Thanatos')) { // Si Thanatos
|
||||
await this.update({ "data.reve.reve.thanatosused": true });
|
||||
await this.update({ "system.reve.reve.thanatosused": true });
|
||||
}
|
||||
let reveActuel = this.system.reve.reve.value;
|
||||
if (rolled.isSuccess) { // Réussite du sort !
|
||||
@ -2437,7 +2437,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
reveActuel = Math.max(reveActuel - rollData.depenseReve, 0);
|
||||
await this.update({ "data.reve.reve.value": reveActuel });
|
||||
await this.update({ "system.reve.reve.value": reveActuel });
|
||||
|
||||
if (rollData.isSortReserve) {
|
||||
this.currentTMR.maximize(); // Re-display TMR
|
||||
@ -2736,12 +2736,12 @@ export class RdDActor extends Actor {
|
||||
const sust = artData.oeuvre.system.sust * artData.proportions;
|
||||
artData.qualiteFinale = Math.min(baseQualite, artData.oeuvre.system.niveau) + artData.rolled.ptQualite;
|
||||
artData.exotismeFinal = Math.min(Math.min(artData.qualiteFinale, artData.oeuvre.system.exotisme ?? 0), 0);
|
||||
console.log("OEUVRE", artData.art, artData)
|
||||
//console.log("OEUVRE", artData.art, artData)
|
||||
const platCuisine = {
|
||||
name: artData.oeuvre.name,
|
||||
type: 'nourritureboisson',
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/objets/provision_cuite.webp',
|
||||
data: {
|
||||
system: {
|
||||
"description": artData.oeuvre.system.description,
|
||||
"sust": Math.min(sust, 1),
|
||||
"qualite": artData.qualiteFinale,
|
||||
@ -2898,7 +2898,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
rollData.xpSort = RdDItemSigneDraconique.getXpSortSigneDraconique(rollData.rolled.code, rollData.signe);
|
||||
if (rollData.xpSort > 0) {
|
||||
await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'data.xp_sort': Misc.toInt(compData.system.xp_sort) + rollData.xpSort }]);
|
||||
await this.updateEmbeddedDocuments("Item", [{ _id: compData._id, 'system.xp_sort': Misc.toInt(compData.system.xp_sort) + rollData.xpSort }]);
|
||||
await this.updateExperienceLog("XP Sort", rollData.xpSort, "Signe draconique en " + rollData.competence.name);
|
||||
}
|
||||
await this.deleteEmbeddedDocuments("Item", [rollData.signe._id]);
|
||||
@ -3018,7 +3018,7 @@ export class RdDActor extends Actor {
|
||||
async _xpCompetence(xpData) {
|
||||
if (xpData.competence) {
|
||||
const newXp = Misc.toInt(xpData.competence.system.xp) + xpData.xpCompetence;
|
||||
let update = { _id: xpData.competence._id, 'data.xp': newXp };
|
||||
let update = { _id: xpData.competence._id, 'system.xp': newXp };
|
||||
await this.updateEmbeddedDocuments('Item', [update]);
|
||||
xpData.checkComp = await this.checkCompetenceXP(xpData.competence.name, undefined, false);
|
||||
this.updateExperienceLog("XP", xpData.xp, "XP gagné en " + xpData.competence.name);
|
||||
@ -3032,7 +3032,7 @@ export class RdDActor extends Actor {
|
||||
let selectedCarac = RdDActor._findCaracByName(carac, xpData.caracName);
|
||||
if (!selectedCarac.derivee) {
|
||||
selectedCarac.xp = Misc.toInt(selectedCarac.xp) + xpData.xpCarac;
|
||||
await this.update({ "data.carac": carac });
|
||||
await this.update({ "system.carac": carac });
|
||||
xpData.checkCarac = await this.checkCaracXP(selectedCarac.label, false);
|
||||
this.updateExperienceLog("XP", xpData.xpCarac, "XP gagné en " + xpData.caracName);
|
||||
} else {
|
||||
@ -3458,7 +3458,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
|
||||
encaissement.endurance = Math.max(encaissement.endurance, -endActuelle);
|
||||
this.update({ "data.blessures": blessures });
|
||||
this.update({ "system.blessures": blessures });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3587,7 +3587,7 @@ export class RdDActor extends Actor {
|
||||
console.log('RdDActor.optimizeArgent', fortuneTotale, 'nouvelleFortune', nouvelleFortune, 'monnaie_par_valeur',parValeur);
|
||||
let updates = [];
|
||||
for (const [valeur, nombre] of Object.entries(nouvelleFortune)) {
|
||||
updates.push({ _id: parValeur[valeur].id, 'data.quantite': nombre });
|
||||
updates.push({ _id: parValeur[valeur].id, 'system.quantite': nombre });
|
||||
}
|
||||
await this.updateEmbeddedDocuments('Item', updates);
|
||||
}
|
||||
@ -3674,7 +3674,7 @@ export class RdDActor extends Actor {
|
||||
let monnaie = this.getMonnaie(id);
|
||||
if (monnaie) {
|
||||
const quantite = Math.max(0, monnaie.system.quantite + value);
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: monnaie.id, 'data.quantite': quantite }]);
|
||||
await this.updateEmbeddedDocuments('Item', [{ _id: monnaie.id, 'system.quantite': quantite }]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3724,7 +3724,7 @@ export class RdDActor extends Actor {
|
||||
vendeur.deleteEmbeddedDocuments("Item", [itemId])
|
||||
}
|
||||
else {
|
||||
vendeur.updateEmbeddedDocuments("Item", [{ _id: itemId, 'data.quantite': resteQuantite }]);
|
||||
vendeur.updateEmbeddedDocuments("Item", [{ _id: itemId, 'system.quantite': resteQuantite }]);
|
||||
}
|
||||
}
|
||||
if (acheteur) {
|
||||
@ -3879,11 +3879,11 @@ export class RdDActor extends Actor {
|
||||
//console.log("Ajout acteur : ", actor, this);
|
||||
if (subActor && !subActor.owner) {
|
||||
if (subActortype == 'vehicule') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'data.subacteurs.vehicules', 'Ce Véhicule');
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.vehicules, 'system.subacteurs.vehicules', 'Ce Véhicule');
|
||||
} else if (subActor.type == 'creature') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'data.subacteurs.montures', 'Cette Monture');
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.montures, 'system.subacteurs.montures', 'Cette Monture');
|
||||
} else if (subActor.type == 'personnage') {
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'data.subacteurs.suivants', 'Ce Suivant');
|
||||
this.pushSubacteur(subActor, this.system.subacteurs.suivants, 'system.subacteurs.suivants', 'Ce Suivant');
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Vous n'avez pas les droits sur l'acteur que vous attachez.")
|
||||
@ -3895,9 +3895,9 @@ export class RdDActor extends Actor {
|
||||
let newVehicules = this.system.subacteurs.vehicules.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
let newSuivants = this.system.subacteurs.suivants.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
let newMontures = this.system.subacteurs.montures.filter(function (obj, index, arr) { return obj.id != actorId });
|
||||
await this.update({ 'data.subacteurs.vehicules': newVehicules });
|
||||
await this.update({ 'data.subacteurs.suivants': newSuivants });
|
||||
await this.update({ 'data.subacteurs.montures': newMontures });
|
||||
await this.update({ 'system.subacteurs.vehicules': newVehicules });
|
||||
await this.update({ 'system.subacteurs.suivants': newSuivants });
|
||||
await this.update({ 'system.subacteurs.montures': newMontures });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3929,7 +3929,7 @@ export class RdDActor extends Actor {
|
||||
guerisonData.list.push("1 Blessure Légère (2 points)");
|
||||
}
|
||||
}
|
||||
await this.update({ "data.blessures": blessures });
|
||||
await this.update({ "system.blessures": blessures });
|
||||
|
||||
let pvManquants = myData.sante.vie.max - myData.sante.vie.value;
|
||||
let pvSoignees = Math.min(pvManquants, Math.floor(pointsGuerison / 2));
|
||||
@ -4008,7 +4008,7 @@ export class RdDActor extends Actor {
|
||||
let newPotion = {
|
||||
name: `Potion de ${herbeData.system.categorie} (${herbeData.name})`, type: 'potion',
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/objets/fiole_verre.webp",
|
||||
data: {
|
||||
system: {
|
||||
quantite: 1, valeur_deniers: 1, encombrement: 0.01,
|
||||
categorie: herbeData.system.categorie,
|
||||
herbe: herbeData.name,
|
||||
|
@ -158,7 +158,6 @@ export class RdDCombatManager extends Combat {
|
||||
let armeData = duplicate(arme)
|
||||
if (armeData.system.equipe) {
|
||||
let compData = competences.find(c => c.name.toLowerCase() == armeData.system.competence.toLowerCase())
|
||||
console.log("ARME", arme, compData, armeData.system.competence, competences)
|
||||
|
||||
armesEquipe.push(armeData)
|
||||
armeData.system.dommagesReels = Number(armeData.system.dommages)
|
||||
|
Loading…
Reference in New Issue
Block a user