Compare commits

...

5 Commits

15 changed files with 98 additions and 40 deletions

View File

@ -218,7 +218,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
}
// Points de reve actuel
this.html.find('.ptreve-actuel a').click(async event => this.actor.rollCarac('reve-actuel', true))
this.html.find('.roll-reve-actuel').click(async event => this.actor.rollCarac('reve-actuel', true))
this.html.find('.empoignade-label a').click(async event => RdDEmpoignade.onAttaqueEmpoignadeFromItem(RdDSheetUtility.getItem(event, this.actor)))
this.html.find('.arme-label a').click(async event => this.actor.rollArme(foundry.utils.duplicate(this._getEventArmeCombat(event))))

View File

@ -25,7 +25,7 @@ export class RdDBaseActorReveSheet extends RdDBaseActorSheet {
if (!this.options.editable) return;
this.html.find('.encaisser-direct').click(async event => this.actor.encaisser())
this.html.find('.roll-carac').click(async event => this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes.name.value)));
this.html.find('.roll-carac a').click(async event => this.actor.rollCarac(Grammar.toLowerCaseNoAccent(event.currentTarget.attributes.name.value)));
this.html.find('.roll-competence').click(async event => this.actor.rollCompetence(RdDSheetUtility.getItemId(event)));
this.html.find('.endurance-plus').click(async event => this.actor.santeIncDec("endurance", 1));
this.html.find('.endurance-moins').click(async event => this.actor.santeIncDec("endurance", -1));

View File

@ -301,6 +301,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
}
RdDEmpoignade.checkEmpoignadeEnCours(this)
let selectedCarac = this.getCaracByName(caracName)
console.log("selectedCarac", selectedCarac)
await this.openRollDialog({
name: 'jet-' + caracName,
label: 'Jet ' + Grammar.apostrophe('de', selectedCarac.label),

View File

@ -10,7 +10,9 @@ export class RdDActorExportSheet extends RdDActorSheet {
await loadTemplates([
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/arme.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-compteur.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/esquive.hbs",
"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs",
@ -46,6 +48,7 @@ export class RdDActorExportSheet extends RdDActorSheet {
return Object.fromEntries(Mapping.getMapping().map(it => [it.column, {
colName: it.colName ?? it.column,
column: it.column,
rollClass: it.rollClass,
value: it.getter(this.actor, context)
}]))
}

View File

@ -57,35 +57,38 @@ const MAPPING_BASE = [
{ column: "metier", colName: 'Métier', getter: (actor, context) => actor.system.metier },
{ column: "biographie", colName: 'Biographie', getter: (actor, context) => actor.system.biographie },
{ column: "taille", getter: (actor, context) => actor.system.carac.taille.value },
{ column: "apparence", getter: (actor, context) => actor.system.carac.apparence.value },
{ column: "constitution", getter: (actor, context) => actor.system.carac.constitution.value },
{ column: "force", getter: (actor, context) => actor.system.carac.force.value },
{ column: "agilite", colName: 'Agilité', getter: (actor, context) => actor.system.carac.agilite.value },
{ column: "dexterite", colName: 'Dextérité', getter: (actor, context) => actor.system.carac.dexterite.value },
{ column: "vue", getter: (actor, context) => actor.system.carac.vue.value },
{ column: "ouie", colName: 'Ouïe', getter: (actor, context) => actor.system.carac.ouie.value },
{ column: "odoratgout", colName: 'Odo-goût', getter: (actor, context) => actor.system.carac.odoratgout.value },
{ column: "volonte", colName: 'Volonté', getter: (actor, context) => actor.system.carac.volonte.value },
{ column: "intellect", getter: (actor, context) => actor.system.carac.intellect.value },
{ column: "empathie", getter: (actor, context) => actor.system.carac.empathie.value },
{ column: "reve", colName: 'Rêve', getter: (actor, context) => actor.system.carac.reve.value },
{ column: "chance", getter: (actor, context) => actor.system.carac.chance.value },
{ column: "melee", colName: 'Mêlée', getter: (actor, context) => actor.system.carac.melee.value },
{ column: "tir", getter: (actor, context) => actor.system.carac.tir.value },
{ column: "lancer", getter: (actor, context) => actor.system.carac.lancer.value },
{ column: "derobee", colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value },
{ column: "apparence", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.apparence.value },
{ column: "constitution", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.constitution.value },
{ column: "force", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.force.value },
{ column: "agilite", rollClass: 'roll-carac', colName: 'Agilité', getter: (actor, context) => actor.system.carac.agilite.value },
{ column: "dexterite", rollClass: 'roll-carac', colName: 'Dextérité', getter: (actor, context) => actor.system.carac.dexterite.value },
{ column: "vue", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.vue.value },
{ column: "ouie", rollClass: 'roll-carac', colName: 'Ouïe', getter: (actor, context) => actor.system.carac.ouie.value },
{ column: "odoratgout", rollClass: 'roll-carac', colName: 'Odo-goût', getter: (actor, context) => actor.system.carac.odoratgout.value },
{ column: "volonte", rollClass: 'roll-carac', colName: 'Volonté', getter: (actor, context) => actor.system.carac.volonte.value },
{ column: "intellect", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.intellect.value },
{ column: "empathie", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.empathie.value },
{ column: "reve", rollClass: 'roll-carac', colName: 'Rêve', getter: (actor, context) => actor.system.carac.reve.value },
{ column: "chance", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.chance.value },
{ column: "melee", rollClass: 'roll-carac', colName: 'Mêlée', getter: (actor, context) => actor.system.carac.melee.value },
{ column: "tir", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.tir.value },
{ column: "lancer", rollClass: 'roll-carac', getter: (actor, context) => actor.system.carac.lancer.value },
{ column: "derobee", rollClass: 'roll-carac', colName: 'Dérobée', getter: (actor, context) => actor.system.carac.derobee.value },
{ column: "vie", getter: (actor, context) => actor.system.sante.vie.max },
{ column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max },
{ column: "plusdom", colName: '+dom', getter: (actor, context) => actor.system.attributs.plusdom.value },
{ column: "protectionnaturelle", colName: 'Protection naturelle', getter: (actor, context) => actor.system.attributs.protection.value > 0 ? actor.system.attributs.protection.value : '' },
{ column: "endurance", getter: (actor, context) => actor.system.sante.endurance.max },
{ column: "description", getter: (actor, context) => Mapping.getDescription(actor) },
{ column: "armure", getter: (actor, context) => Mapping.getArmure(actor, context) },
{ column: "protectionarmure", colName: 'Protection', getter: (actor, context) => Mapping.getProtectionArmure(actor, context) },
{ column: "malus_armure", getter: (actor, context) => Mapping.getMalusArmure(actor, context) },
{ column: "reve_actuel", rollClass: 'roll-reve-actuel', colName: 'Rêve actuel', getter: (actor, context) => actor.system.reve.reve.value },
{ column: "vie_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.vie.value },
{ column: "endurance_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.endurance.value },
{ column: "esquive", getter: (actor, context) => Mapping.getEsquive(context) },
{ column: "esquive_armure", getter: (actor, context) => Mapping.getEsquiveArmure(context) },
{ column: "competences", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_COMPETENCES) },
{ column: "draconic", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_DRACONIC) },
{ column: "draconic", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_DRACONIC) },
]
const MAPPING_ARMES = TABLEAU_ARMES.map(i => ColumnMappingFactory.createMappingArme('name', i))
@ -212,7 +215,7 @@ export class Mapping {
}
static prepareSorts(actor) {
const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC)
const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC)
.map(it => RdDItemSort.getVoieCode(it))
return actor.itemTypes[ITEM_TYPES.sort].map(it => Mapping.prepareSort(it, codeVoies))
@ -263,7 +266,7 @@ export class Mapping {
const poids = actor.system.poids
const cheveux = actor.system.cheveux ? `cheveux ${actor.system.cheveux}` : undefined
const yeux = actor.system.yeux ? `yeux ${actor.system.yeux}` : undefined
const beaute = actor.system.beaute ? `Beauté ${actor.system.beaute}` : undefined
const beaute = actor.system.beaute ? `beauté ${actor.system.beaute}` : undefined
const list = [race, hn, age, taille, poids, cheveux, yeux, beaute]
return Misc.join(list.filter(it => it), ', ')
}

View File

@ -292,6 +292,7 @@ export class RdDUtility {
Handlebars.registerHelper('array-includes', (array, value) => array.includes(value));
Handlebars.registerHelper('min', (...args) => Math.min(...args.slice(0, -1)));
Handlebars.registerHelper('isLastIndex', (index, list) => index+1 >= list.length);
Handlebars.registerHelper('regle-optionnelle', (option) => ReglesOptionnelles.isUsing(option));
Handlebars.registerHelper('trier', list => list.sort((a, b) => a.name.localeCompare(b.name)));
Handlebars.registerHelper('filtreTriCompetences', competences => RdDItemCompetence.triVisible(competences));

View File

@ -1,8 +1,8 @@
{
"id": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon",
"version": "12.0.12",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.12.zip",
"version": "12.0.13",
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.13.zip",
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json",
"changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md",
"compatibility": {

View File

@ -26,7 +26,7 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.volonte}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.empathie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.intellect}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.reve}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-compteur.hbs" carac=export.reve actuel=export.reve_actuel}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac.hbs" carac=export.chance}}
</div>
<div class="flexcol flex-group-top">
@ -34,8 +34,8 @@
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.tir}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.lancer}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.derobee}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.vie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.endurance}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs" carac=export.vie actuel=export.vie_actuel}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee-compteur.hbs" carac=export.endurance actuel=export.vie_actuel}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=export.plusdom}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/protection.hbs" export}}
</div>
@ -60,11 +60,11 @@
</div>
<hr>
<div>
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences= competences}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences=competences}}
</div>
<hr>
<div>
{{export.draconic.value}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/competences.hbs" competences=draconic }}
</div>
<hr>
<div>

View File

@ -0,0 +1,19 @@
<div class="flexrow">
<div>
{{#if carac.rollClass}}
<a class="{{carac.rollClass}}" name="{{carac.column}}">
{{upper carac.colName}}
</a>
{{else}}
{{upper carac.colName}}
{{/if}}
</div>
<div class="flex-group-right {{actuel.rollClass}}">
<a>
{{#unless (eq carac.value actuel.value)}}
{{actuel.value}} /
{{/unless}}
{{carac.value}}
</a>
</div>
</div>

View File

@ -0,0 +1,19 @@
<div class="flexrow">
<div>
{{#if carac.rollClass}}
<a class="{{carac.rollClass}}" name="{{carac.column}}">
{{upperFirst carac.colName}}
</a>
{{else}}
{{upperFirst carac.colName}}
{{/if}}
</div>
<div class="flex-group-right {{actuel.rollClass}}">
<a>
{{#unless (eq carac.value actuel.value)}}
{{actuel.value}} /
{{/unless}}
{{carac.value}}
</a>
</div>
</div>

View File

@ -1,4 +1,12 @@
<div class="flexrow">
<div>{{upperFirst carac.colName}}</div>
<div>
{{#if carac.rollClass}}
<a class="{{carac.rollClass}}" name="{{carac.column}}">
{{upperFirst carac.colName}}
</a>
{{else}}
{{upperFirst carac.colName}}
{{/if}}
</div>
<div class="flex-group-right">{{carac.value}}</div>
</div>

View File

@ -1,4 +1,10 @@
<div class="flexrow">
<div><a class="roll-carac" name="{{carac.column}}">{{upper carac.colName}}</a></div>
<div>
{{#if carac.rollClass}}
<a class="{{carac.rollClass}}" name="{{carac.column}}">{{upper carac.colName}}</a>
{{else}}
{{upper carac.colName}}
{{/if}}
</div>
<div class="flex-group-right">{{carac.value}}</div>
</div>

View File

@ -1,10 +1,9 @@
{{#each competences as |group|}}
{{#if @index}}/{{/if}}
{{#each group.list as |comp|}}
{{#if @index}}, {{/if}}
<span class="item" data-item-id="{{comp._id}}">
<a class="roll-competence">{{comp.name}}</a>
</span>
{{#with group}}
{{#each list as |comp|}}
<span class="item" data-item-id="{{comp._id}}"><a class="roll-competence">{{comp.name}}</a></span>{{~#unless (isLastIndex @index ../list)~}},{{/unless~}}
{{/each}}
{{numberFormat group.niveau decimals=0 sign=true}}
{{numberFormat niveau decimals=0 sign=true}}
{{/with}}
{{/each}}

View File

@ -1,7 +1,6 @@
{{#if protectionnaturelle.value}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=protectionnaturelle}}
{{/if}}
{{log 'protectionarmure' protectionarmure}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/export-scriptarium/carac-derivee.hbs" carac=protectionarmure}}
{{#if armure.value}}
<div class="flexrow flex-group-right"><i>{{armure.value}}</i></div>

View File

@ -30,7 +30,7 @@
</li>
<li>
<label class="compteur">
<span class="ptreve-actuel" data-tooltip="Faire un jet de Rêve actuel (ou jet de résistance)"><a>Rêve</a></span>
<span class="roll-reve-actuel" data-tooltip="Faire un jet de Rêve actuel (ou jet de résistance)"><a>Rêve</a></span>
<a class="ptreve-actuel-moins"><i class="fa-solid fa-square-minus"></i></a>
<input class="resource-content" class="pointsreve-value" type="text" name="system.reve.reve.value" value="{{system.reve.reve.value}}" data-dtype="Number" />
<span>/ {{system.reve.seuil.value}}</span>