Compare commits

...

13 Commits

Author SHA1 Message Date
f6a3ec8634 Merge pull request '10.0.32' (#570) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#570
2022-10-31 23:04:41 +01:00
Vincent Vandemeulebrouck
7870263656 Fix tooltip de niveau
La présence des deux tooltips se génaient (car sur le même span):
- augmenter de niveau
- expérience requise
2022-10-31 19:29:44 +01:00
Vincent Vandemeulebrouck
fd934a5eae Ne pas re-trier les compétences
dans les catégories, elles sont déjà triées (avec la survie en
extérieur avant les autres)
2022-10-31 19:28:13 +01:00
Vincent Vandemeulebrouck
2ab8db94c5 Lien d'aperçu et nouvel aperçu 2022-10-31 19:26:59 +01:00
Vincent Vandemeulebrouck
37bbcf38df Version 10.0.32
- tâches sans compétences
- tri alphabétique des compétences
- affichage du jet de refoulement
2022-10-31 15:23:35 +01:00
Vincent Vandemeulebrouck
086ad4f23a Affichage du jet de refoulement 2022-10-31 15:21:03 +01:00
Vincent Vandemeulebrouck
cf4be389b4 Tri des alphabétique des compétences
Dans lmes sélections, c'est plus facile de s'y retrouver
2022-10-31 15:21:03 +01:00
Vincent Vandemeulebrouck
f1d7cfa1f8 Tâches sans compétences 2022-10-31 15:21:03 +01:00
269b4ec0ca Fix odorat-gout 2022-10-28 08:47:35 +02:00
637be29b7b Merge pull request 'Fix roll Odorat-goût' (#568) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: public/foundryvtt-reve-de-dragon#568
2022-10-28 08:45:47 +02:00
Vincent Vandemeulebrouck
f388d6550c Fix: recherche carac plus lisible 2022-10-27 22:37:20 +02:00
Vincent Vandemeulebrouck
5d32f7e493 Fix: rollCarac pour odorat-goût
Recherche d'abord par clé (name)
2022-10-27 22:28:31 +02:00
Vincent Vandemeulebrouck
d10c86c684 Support manifest-plus
https://foundryvtt.wiki/en/development/manifest-plus
2022-10-22 00:53:56 +02:00
17 changed files with 82 additions and 42 deletions

View File

@@ -1426,34 +1426,32 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async actionRefoulement(item) {
const refoulement = item?.system.refoulement ?? 0;
if (refoulement>0) {
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 () => {
ChatMessage.create({
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
content: `${this.name} a refoulé une queue ${item.nname} pour ${refoulement} points de refoulement`
});
await this.ajouterRefoulement(refoulement);
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;
}
/* -------------------------------------------- */
@@ -3142,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;
}

View File

@@ -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);

View File

@@ -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();

View File

@@ -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")) {

BIN
styles/img/apercu.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View File

@@ -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;

View File

@@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "10.0.30",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.0.30.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",
@@ -338,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"
}
]
}

View File

@@ -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,

View File

@@ -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">

View File

@@ -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}}" />

View File

@@ -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')}}

View File

@@ -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}}

View File

@@ -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}}

View File

@@ -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}}

View File

@@ -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}}