Compare commits

...

3 Commits

9 changed files with 42 additions and 15 deletions

View File

@ -2,6 +2,9 @@
## 12.0.27 - Les vêtements d'Astrobazzarh
- Ajout de la liste des armures dans l'onglet caractéristiques
- Correction des ajouts de blessures (prise en compte de l'endurance et des contusions)
- Correction du choix d'une cible parmi toutes les cibles pour les combats
- Le Gardien peut créer des sorts en réserve parmi les sorts d'un personnage
- Correction des rituels de Détection et Lecture d'Aura des personnages prétirés
## 12.0.26 - Astrobazzarh le Haut-rêvant
- bouton pour le don de haut-rêve en un clic

View File

@ -215,7 +215,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
// Boutons spéciaux MJs
this.html.find('.forcer-tmr-aleatoire').click(async event => this.actor.reinsertionAleatoire("Action MJ"))
this.html.find('.don-de-haut-reve').click(async event => this.actor.addDonDeHautReve())
this.html.find('.nouveau-sort-reserve').click(async event => this.actor.addSortReserve())
this.html.find('.afficher-tmr').click(async event => this.actor.changeTMRVisible())
}

View File

@ -40,6 +40,7 @@ import { RdDItemArme } from "./item-arme.js";
import { RdDCombatManager } from "./rdd-combat.js";
import { RdDItemTete } from "./item/tete.js";
import { SystemCompendiums } from "./settings/system-compendiums.js";
import { DialogSelect } from "./dialog-select.js";
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
@ -990,6 +991,22 @@ export class RdDActor extends RdDBaseActorSang {
}
}
async addSortReserve() {
const selectSortReserve = {
title: "Créer un sort en réserve",
label: "Choisir un sort",
list: this.itemTypes[ITEM_TYPES.sort].filter(it => !it.system.isrituel)
}
DialogSelect.select(selectSortReserve, sort =>
this.createEmbeddedDocuments("Item",
[{
type: ITEM_TYPES.sortreserve,
name: sort.name,
img: sort.img,
system: { sortid: sort.id, draconic: sort.system.draconic, ptreve: Number(sort.system.ptreve.match(/\d+/)), coord: 'A1', heurecible: 'Vaisseau' }
}],
{ renderSheet: true }))
}
/* -------------------------------------------- */
async reinsertionAleatoire(raison, accessible = tmr => true) {
const innaccessible = this.buildTMRInnaccessible();

View File

@ -2,11 +2,11 @@
export class DialogSelect extends Dialog {
static extractIdNameImg(it) { return { id: it.id, name: it.name, img: it.img } }
static async select(selectData, onSelectChoice) {
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.html", selectData)
static async select(selectionData, onSelectChoice) {
const html = await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/dialog-select.html", selectionData)
const dialogData = {
title: selectData.title ?? selectData.label,
title: selectionData.title ?? selectionData.label,
content: html,
buttons: {}
}
@ -18,7 +18,7 @@ export class DialogSelect extends Dialog {
'max-height': 600,
'z-index': 99999
}
new DialogSelect(dialogData, dialogOptions, selectData, onSelectChoice).render(true)
new DialogSelect(dialogData, dialogOptions, selectionData, onSelectChoice).render(true)
}
constructor(dialogData, dialogOptions, selectionData, onSelectChoice) {
@ -36,7 +36,7 @@ export class DialogSelect extends Dialog {
}
choiceSelected(selectedId) {
const selected = this.selectionData.find(it => it.id == selectedId)
const selected = this.selectionData.list.find(it => it.id == selectedId)
this.close()
if (selected) {
this.onSelectChoice(selected)

View File

@ -11,7 +11,12 @@ export class Targets {
}
static extractTokenData(target) {
return { id: target?.id, name: target?.document.name, img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg' };
return {
id: target?.id,
name: target?.document.name,
img: target?.document.texture.src ?? target?.actor.img ?? 'icons/svg/mystery-man.svg',
target
};
}
static buildActorTokenData(tokenId, actor) {
return { id: tokenId, name: actor.name, img: actor.img ?? 'icons/svg/mystery-man.svg' };
@ -35,7 +40,7 @@ export class Targets {
label: "Choisir une seule des cibles",
list: targets.map(it => Targets.extractTokenData(it))
};
DialogSelect.select(selectData, onSelectTarget)
DialogSelect.select(selectData, t => onSelectTarget(t.target))
}
}
}

View File

@ -2101,7 +2101,7 @@ items:
ptreve: '1'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:
@ -2168,7 +2168,7 @@ items:
ptreve: '3'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:

View File

@ -2259,7 +2259,7 @@ items:
ptreve: '3'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:
@ -2317,7 +2317,7 @@ items:
ptreve: '1'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:

View File

@ -2457,7 +2457,7 @@ items:
ptreve: '1'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:
@ -2524,7 +2524,7 @@ items:
ptreve: '3'
xp: 0
bonuscase: ''
isrituel: false
isrituel: true
coutseuil: 0
folder: null
ownership:

View File

@ -1,5 +1,7 @@
{{#if sortsReserve.length}}
<h3>Sorts en Réserve</h3>
<h3>Sorts en Réserve{{#if options.isGM}} <a class="nouveau-sort-reserve"><i class="fa-solid fa-sparkles"></i>
</a>{{/if}}
</h3>
<ul class="item-list alterne-list">
{{#each (trier sortsReserve) as |sort key|}}
<li class="item list-item flexrow" data-item-id="{{sort._id}}" data-attribute="{{key}}"