forked from public/foundryvtt-reve-de-dragon
Compare commits
23 Commits
foundryvtt
...
foundryvtt
| Author | SHA1 | Date | |
|---|---|---|---|
| f6a3ec8634 | |||
|
|
7870263656 | ||
|
|
fd934a5eae | ||
|
|
2ab8db94c5 | ||
|
|
37bbcf38df | ||
|
|
086ad4f23a | ||
|
|
cf4be389b4 | ||
|
|
f1d7cfa1f8 | ||
| 269b4ec0ca | |||
| 637be29b7b | |||
|
|
f388d6550c | ||
|
|
5d32f7e493 | ||
|
|
d10c86c684 | ||
| 484f02277b | |||
|
|
0ef9123cd5 | ||
|
|
e6b71faa02 | ||
|
|
9a1a464cb6 | ||
|
|
32af9bf1b4 | ||
|
|
362fd964d0 | ||
| e4f9b0f589 | |||
| 975e525fd5 | |||
|
|
296bff2c5d | ||
|
|
3e65bcb848 |
@@ -393,7 +393,7 @@ export class RdDActor extends Actor {
|
||||
potionImg: potion.img
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, messageData)
|
||||
});
|
||||
}
|
||||
@@ -801,7 +801,7 @@ export class RdDActor extends Actor {
|
||||
rollData.poesie = await Poetique.getExtrait();
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-reve-de-dragon.html`, rollData)
|
||||
});
|
||||
}
|
||||
@@ -946,7 +946,7 @@ export class RdDActor extends Actor {
|
||||
message += "<br>" + troncName;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name),
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name),
|
||||
content: message
|
||||
});
|
||||
}
|
||||
@@ -1187,8 +1187,8 @@ export class RdDActor extends Actor {
|
||||
const src = this.getObjet(srcId);
|
||||
const dest = this.getObjet(destId);
|
||||
const cible = this.getContenantOrParent(dest);
|
||||
const messageEquipementDifferent = item.messageEquipementDifferent(dest);
|
||||
if (dest && !messageEquipementDifferent) {
|
||||
const [empilable, message] = item.isEquipementEmpilable(dest);
|
||||
if (empilable) {
|
||||
await this.regrouperEquipementsSimilaires(item, dest);
|
||||
result = false;
|
||||
}
|
||||
@@ -1196,9 +1196,11 @@ export class RdDActor extends Actor {
|
||||
else if (!cible || this.conteneurPeutContenir(cible, item)) {
|
||||
await this.enleverDeConteneur(item, src, params.onEnleverConteneur);
|
||||
await this.ajouterDansConteneur(item, cible, params.onAjouterDansConteneur);
|
||||
}
|
||||
else {
|
||||
ui.notifications.info(messageEquipementDifferent);
|
||||
if (message && !dest.isConteneur()) {
|
||||
ui.notifications.info(cible
|
||||
? `${message}<br>${item.name} a été déplacé dans: ${cible.name}`
|
||||
: `${message}<br>${item.name} a été sorti du conteneur`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1424,22 +1426,32 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async actionRefoulement(item) {
|
||||
const refoulement = item?.system.refoulement ?? 0;
|
||||
if (refoulement>0){
|
||||
await this.ajouterRefoulement(refoulement);
|
||||
await item.delete();
|
||||
if (refoulement > 0) {
|
||||
RdDConfirm.confirmer({
|
||||
settingConfirmer: "confirmation-refouler",
|
||||
content: `<p>Prennez-vous le risque de refouler ${item.name} pour ${refoulement} points de refoulement ?</p>`,
|
||||
title: 'Confirmer la refoulement',
|
||||
buttonLabel: 'Refouler',
|
||||
onAction: async () => {
|
||||
await this.ajouterRefoulement(refoulement, `une queue ${item.name}`);
|
||||
await item.delete();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ajouterRefoulement(value = 1) {
|
||||
let refoulement = this.system.reve.refoulement.value + value;
|
||||
let total = await RdDDice.rollTotal("1d20");
|
||||
if (total <= refoulement) {
|
||||
async ajouterRefoulement(value = 1, refouler) {
|
||||
const refoulement = this.system.reve.refoulement.value + value;
|
||||
const roll = new Roll("1d20");
|
||||
await roll.evaluate({ async: true });
|
||||
await roll.toMessage({ flavor: `${this.name} refoule ${refouler} pour ${value} points de refoulement (total: ${refoulement})` });
|
||||
if (roll.total <= refoulement) {
|
||||
refoulement = 0;
|
||||
await this.ajouterSouffle({ chat: true });
|
||||
}
|
||||
await this.update({ "system.reve.refoulement.value": refoulement });
|
||||
return refoulement == 0 ? "souffle" : "none";
|
||||
return roll;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -1449,7 +1461,7 @@ export class RdDActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', [souffle]);
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: this.name + " subit un Souffle de Dragon : " + souffle.name
|
||||
});
|
||||
}
|
||||
@@ -1469,7 +1481,7 @@ export class RdDActor extends Actor {
|
||||
await this.createEmbeddedDocuments('Item', [queue]);
|
||||
if (options.chat) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: this.name + " subit une Queue de Dragon : " + queue.name
|
||||
});
|
||||
}
|
||||
@@ -1507,7 +1519,7 @@ export class RdDActor extends Actor {
|
||||
let tmr = await TMRUtility.getTMRAleatoire(tmr => accessible(tmr) && !innaccessible.includes(tmr.coord));
|
||||
ChatMessage.create({
|
||||
content: `${raison} : ré-insertion aléatoire.`,
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name)
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name)
|
||||
});
|
||||
await this.forcerPositionTMRInconnue(tmr);
|
||||
return tmr;
|
||||
@@ -1677,7 +1689,7 @@ export class RdDActor extends Actor {
|
||||
const result = await this._jetEndurance(this.system.sante.endurance.value)
|
||||
const message = {
|
||||
content: "Jet d'Endurance : " + result.roll.total + " / " + endurance + "<br>",
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
};
|
||||
if (result.sonne) {
|
||||
message.content += `${this.name} a échoué son Jet d'Endurance et devient Sonné`;
|
||||
@@ -1727,7 +1739,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
const message = {
|
||||
content: msgText,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
};
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
@@ -1836,7 +1848,7 @@ export class RdDActor extends Actor {
|
||||
const jetMoral = await this._jetDeMoral(situation);
|
||||
const finMessage = (jetMoral.succes ? messageReussi : messageManque) ?? (jetMoral.ajustement == 0 ? "Vous gardez votre moral" : jetMoral.ajustement > 0 ? "Vous gagnez du moral" : "Vous perdez du moral");
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${finMessage} - jet ${jetMoral.succes ? "réussi" : "manqué"} en situation ${situation} (${jetMoral.jet}/${jetMoral.difficulte}).`
|
||||
});
|
||||
return jetMoral.ajustement;
|
||||
@@ -2131,7 +2143,7 @@ export class RdDActor extends Actor {
|
||||
};
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-transformer-stress.html`, stressRollData)
|
||||
});
|
||||
|
||||
@@ -2382,7 +2394,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
ChatMessage.create({
|
||||
content: "Vous êtes sous le coup d'une Mauvaise Rencontre en Persective." + addMsg,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return rencSpecial;
|
||||
@@ -2394,7 +2406,7 @@ export class RdDActor extends Actor {
|
||||
if (countInertieDraconique > 0) {
|
||||
ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'Inertie Draconique : vous perdrez ${countInertieDraconique + 1} cases de Fatigue par déplacement au lieu d'une.`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return countInertieDraconique + 1;
|
||||
@@ -2406,7 +2418,7 @@ export class RdDActor extends Actor {
|
||||
await this.reveActuelIncDec(-1);
|
||||
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).",
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -3013,7 +3025,7 @@ export class RdDActor extends Actor {
|
||||
// Cas de désir lancinant, pas d'expérience sur particulière
|
||||
ChatMessage.create({
|
||||
content: `Vous souffrez au moins d'un Désir Lancinant, vous ne pouvez pas gagner d'expérience sur une Particulière tant que le désir n'est pas assouvi`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
@@ -3128,7 +3140,12 @@ export class RdDActor extends Actor {
|
||||
case 'chance-actuelle': case 'chance actuelle':
|
||||
return carac.chance;
|
||||
}
|
||||
let entry = Misc.findFirstLike(name, Object.entries(carac), { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
|
||||
const caracList = Object.entries(carac);
|
||||
let entry = Misc.findFirstLike(name, caracList, { mapper: it => it[0], description: 'caractéristique' });
|
||||
if (!entry || entry.length ==0) {
|
||||
entry = Misc.findFirstLike(name, caracList, { mapper: it => it[1].label, description: 'caractéristique' });
|
||||
}
|
||||
return entry && entry.length > 0 ? carac[entry[0]] : undefined;
|
||||
}
|
||||
|
||||
@@ -3143,7 +3160,7 @@ export class RdDActor extends Actor {
|
||||
if (countMonteeLaborieuse > 0) {
|
||||
ChatMessage.create({
|
||||
content: `Vous êtes sous le coup d'une Montée Laborieuse : vos montées en TMR coûtent ${countMonteeLaborieuse} Point de Rêve de plus.`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
}
|
||||
return countMonteeLaborieuse;
|
||||
@@ -3183,7 +3200,7 @@ export class RdDActor extends Actor {
|
||||
if (this.getReveActuel() < minReveValue) {
|
||||
ChatMessage.create({
|
||||
content: `Vous n'avez les ${minReveValue} Points de Reve nécessaires pour monter dans les Terres Médianes`,
|
||||
whisper: ChatMessage.getWhisperRecipients(game.user.name)
|
||||
whisper: ChatMessage.getWhisperRecipients(this.name)
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -3701,7 +3718,7 @@ export class RdDActor extends Actor {
|
||||
system: mergeObject(vente.item.system, { quantite: isItemEmpilable ? achat.quantiteTotal : undefined }),
|
||||
}
|
||||
let listeAchat = isItemEmpilable ? [achatData] : Array.from({ length: achat.quantiteTotal }, (_, i) => achatData)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat)
|
||||
let items = await acheteur.createEmbeddedDocuments("Item", listeAchat);
|
||||
if (achat.choix.consommer && vente.item.type == 'nourritureboisson') {
|
||||
achat.choix.doses = achat.choix.nombreLots;
|
||||
await acheteur.consommerNourritureboisson(items[0], achat.choix);
|
||||
@@ -3929,7 +3946,7 @@ export class RdDActor extends Actor {
|
||||
this.bonusRecuperationPotion = potionData.system.herbeBonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-soin.html`, potionData)
|
||||
});
|
||||
}
|
||||
@@ -3962,7 +3979,7 @@ export class RdDActor extends Actor {
|
||||
this.bonusRepos = potionData.system.herbeBonus;
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-repos.html`, potionData)
|
||||
});
|
||||
}
|
||||
@@ -4000,7 +4017,7 @@ export class RdDActor extends Actor {
|
||||
this.diminuerQuantiteObjet(herbeData._id, herbeData.nbBrins);
|
||||
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-fabriquer-potion-base.html`, messageData)
|
||||
});
|
||||
}
|
||||
@@ -4025,7 +4042,7 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
}
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-consommer-potion-generique.html`, potionData)
|
||||
});
|
||||
}
|
||||
@@ -4160,7 +4177,7 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
notifyGestionTeteSouffleQueue(item, manualMessage = true) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `${this.name} a reçu un/une ${item.type}: ${item.name}, qui ${manualMessage ? "n'est pas" : "est"} géré(e) automatiquement. ${manualMessage ? manualMessage : ''}`
|
||||
});
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ export class RdDItemCompetence extends Item {
|
||||
/* -------------------------------------------- */
|
||||
static getVoieDraconic(competences, voie) {
|
||||
return RdDItemCompetence.findFirstItem(competences, voie, {
|
||||
preFilter: it => it.isCompetence() && RdDItemCompetence.isDraconic(it),
|
||||
description: 'Draconic',
|
||||
});
|
||||
preFilter: it => it.isCompetence() && RdDItemCompetence.isDraconic(it),
|
||||
description: 'Draconic',
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@@ -199,7 +199,7 @@ export class RdDItemCompetence extends Item {
|
||||
item.system.isStressLevelUp = (xpManquant > 0 && stressTransforme >= xpManquant && item.system.niveau < item.system.niveau_archetype);
|
||||
item.system.stressXpMax = 0;
|
||||
if (xpManquant > 0 && stressTransforme > 0 && item.system.niveau < item.system.niveau_archetype) {
|
||||
item.system.stressXpMax = Math.min(xpManquant , stressTransforme);
|
||||
item.system.stressXpMax = Math.min(xpManquant, stressTransforme);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,10 +219,10 @@ export class RdDItemCompetence extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static findCompetence(list, idOrName, options = {}) {
|
||||
if (idOrName == undefined) {
|
||||
return undefined;
|
||||
if (idOrName == undefined || idOrName == "") {
|
||||
return RdDItemCompetence.sansCompetence();
|
||||
}
|
||||
options = mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence' }, {overwrite: false});
|
||||
options = mergeObject(options, { preFilter: it => it.isCompetence(), description: 'compétence' }, { overwrite: false });
|
||||
return RdDItemCompetence.findFirstItem(list, idOrName, options);
|
||||
}
|
||||
|
||||
@@ -231,6 +231,23 @@ export class RdDItemCompetence extends Item {
|
||||
return Misc.findAllLike(name, list, { filter: it => it.isCompetence(), description: 'compétence' });
|
||||
}
|
||||
|
||||
static sansCompetence() {
|
||||
return {
|
||||
name: "Sans compétence",
|
||||
type: "competence",
|
||||
img: "systems/foundryvtt-reve-de-dragon/icons/templates/icone_parchement_vierge.webp",
|
||||
system: {
|
||||
niveau: 0,
|
||||
default_diffLibre: 0,
|
||||
base: 0,
|
||||
categorie: "Aucune",
|
||||
description: "",
|
||||
descriptionmj: "",
|
||||
defaut_carac: "",
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
static findFirstItem(list, idOrName, options) {
|
||||
return list.find(it => it.id == idOrName && options.preFilter(it))
|
||||
?? Misc.findFirstLike(idOrName, list, options);
|
||||
|
||||
@@ -250,9 +250,9 @@ export class RdDItemSheet extends ItemSheet {
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/** @override */
|
||||
_updateObject(event, formData) { // Deprecated en v0.8 à clarifier
|
||||
_updateObject(event, formData) {
|
||||
// Données de bonus de cases ?
|
||||
formData = RdDItemSort.buildBonusCaseStringFromFormData(formData);
|
||||
formData['system.bonuscase'] = RdDItemSort.buildBonusCaseStringFromFormData(formData.bonusValue, formData.caseValue);
|
||||
|
||||
return this.item.update(formData);
|
||||
}
|
||||
|
||||
@@ -63,26 +63,21 @@ export class RdDItemSort extends Item {
|
||||
/** Met à jour les données de formulaire
|
||||
* si static des bonus de cases sont présents
|
||||
* */
|
||||
static buildBonusCaseStringFromFormData( formData ) {
|
||||
if ( formData.bonusValue ) {
|
||||
static buildBonusCaseStringFromFormData( bonuses, cases ) {
|
||||
if ( bonuses ) {
|
||||
let list = [];
|
||||
let caseCheck = {};
|
||||
for(let i=0; i<formData.bonusValue.length; i++) {
|
||||
let coord = formData.caseValue[i] || 'A1';
|
||||
coord = coord.toUpperCase();
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) ) { // Sanity check
|
||||
let bonus = formData.bonusValue[i] || 0;
|
||||
if ( bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
for (let i=0; i<bonuses.length; i++) {
|
||||
let coord = cases[i]?.toUpperCase() || 'A1';
|
||||
let bonus = bonuses[i] || 0;
|
||||
if ( TMRUtility.verifyTMRCoord( coord ) && bonus > 0 && caseCheck[coord] == undefined ) {
|
||||
caseCheck[coord] = bonus;
|
||||
list.push( coord+":"+bonus );
|
||||
}
|
||||
}
|
||||
formData.bonusValue = undefined;
|
||||
formData.caseValue = undefined;
|
||||
formData.system.bonuscase = list.toString(); // Reset
|
||||
return list.toString();
|
||||
}
|
||||
return formData;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
@@ -242,30 +242,32 @@ export class RdDItem extends Item {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// détermine si deux équipements sont similaires: de même type, et avec les même champs hormis la quantité
|
||||
messageEquipementDifferent(other) {
|
||||
if (!other || !this.isEquipement()) return undefined;
|
||||
isEquipementEmpilable(other) {
|
||||
if (!other || !this.isEquipement()) {
|
||||
return [false, undefined];
|
||||
}
|
||||
|
||||
let message = undefined;
|
||||
if (this.system.quantite == undefined) {
|
||||
message = `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`;
|
||||
return [false, `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`];
|
||||
}
|
||||
else if (this.type != other.type) {
|
||||
message = `Impossible de regrouper des ${this.type} avec des ${other.type}`;
|
||||
return [false, `Impossible de regrouper des ${this.type} avec des ${other.type}`];
|
||||
}
|
||||
else if (this.name != other.name) {
|
||||
message = `Impossible de regrouper ${this.name} avec ${other.name}`;
|
||||
return [false, `Impossible de regrouper ${this.name} avec ${other.name}`];
|
||||
}
|
||||
else {
|
||||
const differences = Object.entries(this.system)
|
||||
.filter(([key, value]) => !['quantite', 'cout'].includes(key) && value != other.system[key]);
|
||||
.filter(([key, value]) => !['quantite', 'cout', 'encTotal'].includes(key) && value != other.system[key]);
|
||||
if (differences.length > 0) {
|
||||
message = `Impossible de regrouper les ${this.type} ${this.name}: `;
|
||||
let message = `Impossible de regrouper les ${this.type} ${this.name}: `;
|
||||
for (const [key, value] of differences) {
|
||||
message += `<br>${key}: ${value} vs ${other.system[key]}`;
|
||||
}
|
||||
return [false, message];
|
||||
}
|
||||
}
|
||||
return message;
|
||||
return [true, undefined];
|
||||
}
|
||||
|
||||
async proposerVente() {
|
||||
|
||||
@@ -148,7 +148,7 @@ Hooks.once("init", async function () {
|
||||
};
|
||||
|
||||
/* -------------------------------------------- */
|
||||
game.socket.on(SYSTEM_SOCKET_ID, sockmsg => {
|
||||
game.socket.on(SYSTEM_SOCKET_ID, async (sockmsg) => {
|
||||
console.log(">>>>> MSG RECV", sockmsg);
|
||||
try {
|
||||
RdDUtility.onSocketMessage(sockmsg);
|
||||
|
||||
@@ -289,9 +289,8 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async refouler() {
|
||||
this._tellToGM(this.actor.name + " a refoulé : " + this.currentRencontre.name);
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.refoulement ?? 1, `une rencontre ${this.currentRencontre.name}`);
|
||||
await this.actor.deleteTMRRencontreAtPosition(); // Remove the stored rencontre if necessary
|
||||
await this.actor.ajouterRefoulement(this.currentRencontre.refoulement ?? 1);
|
||||
this.updateTokens();
|
||||
console.log("-> refouler", this.currentRencontre)
|
||||
this.updateValuesDisplay();
|
||||
@@ -300,7 +299,7 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async ignorerRencontre() {
|
||||
this._tellToGM(this.actor.name + " a ignoré : " + this.currentRencontre.name);
|
||||
this._tellToGM(this.actor.name + " a ignoré: " + this.currentRencontre.name);
|
||||
await this.actor.deleteTMRRencontreAtPosition(); // Remove the stored rencontre if necessary
|
||||
this.updateTokens();
|
||||
this.updateValuesDisplay();
|
||||
|
||||
@@ -280,7 +280,7 @@ export class RdDUtility {
|
||||
Handlebars.registerHelper('typeTmr-name', coord => TMRUtility.typeTmrName(coord));
|
||||
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
|
||||
Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionelles.isUsing(option));
|
||||
|
||||
Handlebars.registerHelper('trier', competences => competences.sort((a, b) => a.name.localeCompare(b.name)));
|
||||
Handlebars.registerHelper('filtreTriCompetences', competences => competences.filter(it => it.system.isVisible)
|
||||
.sort((a, b) => {
|
||||
if (a.name.startsWith("Survie") && b.name.startsWith("Survie")) {
|
||||
|
||||
@@ -18,8 +18,9 @@ const listeReglesOptionelles = [
|
||||
{ group: 'Règles générales', name: 'appliquer-fatigue', descr: "Appliquer les règles de fatigue"},
|
||||
{ group: 'Règles générales', name: 'afficher-colonnes-reussite', descr: "Afficher le nombre de colonnes de réussite ou d'échec", default: false },
|
||||
|
||||
{ group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-vider', descr: "Confirmer pour vider l'équipement", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-tmr', descr: "Confirmer pour monter dans les TMR", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-refouler', descr: "Confirmer avant de refouler", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-vider', descr: "Confirmer pour vider l'équipement", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-lien-acteur', descr: "Confirmer pour détacher un animal/suivant/véhicule", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-equipement', descr: "Confirmer la suppression des équipements", scope: "client"},
|
||||
{ group: 'Confirmations', name: 'confirmation-supprimer-oeuvre', descr: "Confirmer la suppression des oeuvres", scope: "client"},
|
||||
|
||||
BIN
styles/img/apercu.webp
Normal file
BIN
styles/img/apercu.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 193 KiB |
BIN
styles/img/reve-de-dragon-cover.webp
Normal file
BIN
styles/img/reve-de-dragon-cover.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
BIN
styles/img/reve-de-dragon-icon.webp
Normal file
BIN
styles/img/reve-de-dragon-icon.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
@@ -1583,7 +1583,7 @@ display: inline-flex;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.tooltip .ttt-xp {
|
||||
.tooltip :is(.ttt-xp,.ttt-levelup) {
|
||||
width: 250px;
|
||||
background: rgba(220,220,210,0.95) !important;
|
||||
border-radius: 6px;
|
||||
|
||||
27
system.json
27
system.json
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.0.28",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.28.zip",
|
||||
"version": "10.0.32",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.32.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
"verified": "10.288"
|
||||
"verified": "10",
|
||||
"maximum": "10"
|
||||
},
|
||||
"description": "Rêve de Dragon RPG for FoundryVTT",
|
||||
"authors": [
|
||||
@@ -337,5 +338,23 @@
|
||||
"gridDistance": 1,
|
||||
"gridUnits": "m",
|
||||
"primaryTokenAttribute": "sante.vie",
|
||||
"secondaryTokenAttribute": "sante.endurance"
|
||||
"secondaryTokenAttribute": "sante.endurance",
|
||||
"manifestPlusVersion": "1.2.0",
|
||||
"media": [
|
||||
{
|
||||
"type": "icon",
|
||||
"url": "systems/foundryvtt-reve-de-dragon/styles/img/reve-de-dragon-icon.webp",
|
||||
"caption": "Logo Rêve de Dragon"
|
||||
},
|
||||
{
|
||||
"type": "cover",
|
||||
"url": "systems/foundryvtt-reve-de-dragon/styles/img/reve-de-dragon-cover.webp",
|
||||
"caption": "Logo Rêve de Dragon"
|
||||
},
|
||||
{
|
||||
"type": "screenshot",
|
||||
"url": "systems/foundryvtt-reve-de-dragon/styles/img/apercu.webp",
|
||||
"caption": "Capture d'écran de Rêve de Dragon sur Foundry"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -746,9 +746,9 @@
|
||||
"carac": "",
|
||||
"competence": "",
|
||||
"periodicite": "",
|
||||
"fatigue": 0,
|
||||
"fatigue": 1,
|
||||
"difficulte": 0,
|
||||
"points_de_tache": 0,
|
||||
"points_de_tache": 4,
|
||||
"points_de_tache_courant": 0,
|
||||
"nb_jet_echec": 0,
|
||||
"nb_jet_succes": 0,
|
||||
|
||||
@@ -11,13 +11,13 @@
|
||||
<label class="carac-xp"/>
|
||||
{{else}}
|
||||
{{#if carac.derivee}}
|
||||
<span class="carac-label" name="system.carac.{{key}}.label"> <a name={{key}}>{{carac.label}}</a></span>
|
||||
<span class="carac-label" name="system.carac.{{key}}.label"><a name={{key}}>{{carac.label}}</a></span>
|
||||
<label class="competence-value">{{carac.value}}</label>
|
||||
<label class="carac-xp"/>
|
||||
{{else}}
|
||||
{{#if carac.isLevelUp}}
|
||||
<span class="carac-label tooltip" name="system.carac.{{key}}.label">
|
||||
<span class="tooltiptext ttt-xp">
|
||||
<span class="tooltiptext ttt-levelup">
|
||||
Vous pouvez dépenser {{carac.xpNext}} points d'Experience pour augmenter de 1 votre caractéristique {{carac.label}}
|
||||
</span>
|
||||
<a name={{key}}>{{carac.label}}</a></span>
|
||||
@@ -26,8 +26,8 @@
|
||||
{{/if}}
|
||||
<input class="carac-value" type="text" name="system.carac.{{key}}.value" value="{{carac.value}}" data-dtype="{{carac.type}}" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||
<span class="carac-xp tooltip">
|
||||
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
|
||||
<input class="carac-xp" type="text" name="system.carac.{{key}}.xp" value="{{carac.xp}}" data-dtype="number" {{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||
<span class="tooltiptext ttt-xp">Vous devez acquérir {{carac.xpNext}} points d'Experience pour augmenter de 1 votre {{carac.label}}</span>
|
||||
</span>
|
||||
{{#if carac.isLevelUp}}
|
||||
<a class="carac-xp-augmenter" name="augmenter.{{key}}" title="Augmenter">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<ol class="item-list alterne-list">
|
||||
{{#each competences as |comp key|}}
|
||||
{{#each (trier competences) as |comp key|}}
|
||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||
<a class="competence-label">
|
||||
<img class="sheet-competence-img" src="{{comp.img}}" />
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</a>
|
||||
|
||||
{{#if system.isLevelUp}}
|
||||
<span class="tooltiptext ttt-xp">Vous pouvez dépenser {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
|
||||
<span class="tooltiptext ttt-levelup">Vous pouvez dépenser {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
|
||||
<a class="competence-xp-augmenter" compname="{{name}}" title="Augmenter">
|
||||
<i class="fas fa-arrow-alt-circle-up"></i>
|
||||
</a>
|
||||
@@ -17,10 +17,12 @@
|
||||
{{#unless @root.options.vueDetaillee}}disabled{{/unless}} />
|
||||
|
||||
{{#if @root.options.vueDetaillee}}
|
||||
<span class="competence-xp tooltip">
|
||||
<span class="competence-xp {{#unless system.isLevelUp}}tooltip{{/unless}}">
|
||||
<input class="competence-xp " type="text" compname="{{name}}" name="comp-xp-{{name}}"
|
||||
value="{{numberFormat system.xp decimals=0 sign=false}}" data-dtype="number"/>
|
||||
{{#unless system.isLevelUp}}
|
||||
<span class="tooltiptext left-competence ttt-xp">Vous devez acquérir {{system.xpNext}} points d'Experience pour augmenter de 1 votre compétence {{name}}</span>
|
||||
{{/unless}}
|
||||
</span>
|
||||
{{/if}}
|
||||
{{#if (eq system.categorie 'draconic')}}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<label for="xp">Compétence</label>
|
||||
<select name="system.competence" id="competenceselect" data-dtype="String">
|
||||
{{#select system.competence}}
|
||||
{{#each competences as |competence key|}}
|
||||
{{#each (trier competences) as |competence key|}}
|
||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<label for="xp">Compétence</label>
|
||||
<select name="system.competence" id="competenceselect" data-dtype="String">
|
||||
{{#select system.competence}}
|
||||
{{#each competences as |competence key|}}
|
||||
{{#each (trier competences) as |competence key|}}
|
||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<label>Compétence</label>
|
||||
<select name="system.competence" id="competenceselect" data-dtype="String">
|
||||
{{#select system.competence}}
|
||||
{{#each competences as |competence key|}}
|
||||
{{#each (trier competences) as |competence key|}}
|
||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
<label for="xp">Compétence</label>
|
||||
<select name="system.competence" id="competenceselect" data-dtype="String">
|
||||
{{#select system.competence}}
|
||||
{{#each competences as |competence key|}}
|
||||
<option value="">Sans compétence</option>
|
||||
{{#each (trier competences) as |competence key|}}
|
||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
|
||||
Reference in New Issue
Block a user