Merge pull request 'v10.7.20 - la cuirasse de Sémolosse' (#662) from VincentVk/foundryvtt-reve-de-dragon:v10 into v10
Reviewed-on: #662
This commit is contained in:
commit
54df875451
@ -1,5 +1,12 @@
|
||||
# v10.7 - L'os de Sémolosse
|
||||
|
||||
## v10.7.20 - la poigne de Sémolosse
|
||||
- correction de méthodes qui filtrent les items
|
||||
- recherche de cases TMR
|
||||
- recherche de tâches de lecture
|
||||
- recherche d'armure (pour le malus armure)
|
||||
- recherche de potions
|
||||
|
||||
## v10.7.20 - la poigne de Sémolosse
|
||||
- correction de l'empoignade
|
||||
- les items d'empoignade sont ajoutés par le MJ quand nécessaire
|
||||
|
@ -298,7 +298,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async verifierPotionsEnchantees() {
|
||||
let potionsEnchantees = this.filterItems(it => it.type == 'potion' && it.system.categorie.toLowerCase().includes('enchant'));
|
||||
let potionsEnchantees = this.filterItems(it => it.system.categorie.toLowerCase().includes('enchant'), 'potion');
|
||||
for (let potion of potionsEnchantees) {
|
||||
if (!potion.system.prpermanent) {
|
||||
console.log(potion);
|
||||
@ -1124,7 +1124,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async computeMalusArmure() {
|
||||
if (this.isPersonnage()) {
|
||||
const malusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe)
|
||||
const malusArmure = this.filterItems(it => it.system.equipe, 'armure')
|
||||
.map(it => it.system.malus ?? 0)
|
||||
.reduce(Misc.sum(), 0);
|
||||
// Mise à jour éventuelle du malus armure
|
||||
@ -1297,8 +1297,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
buildTMRInnaccessible() {
|
||||
const tmrInnaccessibles = this.filterItems(it => Draconique.isCaseTMR(it) &&
|
||||
EffetsDraconiques.isInnaccessible(it));
|
||||
const tmrInnaccessibles = this.filterItems(it => Draconique.isCaseTMR(it) && EffetsDraconiques.isInnaccessible(it));
|
||||
return tmrInnaccessibles.map(it => it.system.coord);
|
||||
}
|
||||
|
||||
@ -2363,8 +2362,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
/* -------------------------------------------- */
|
||||
async creerTacheDepuisLivre(item, options = { renderSheet: true }) {
|
||||
const nomTache = "Lire " + item.name;
|
||||
const filterTacheLecture = it => it.type == 'tache' && it.name == nomTache;
|
||||
let tachesExistantes = this.filterItems(filterTacheLecture);
|
||||
let tachesExistantes = findTache(nomTache);
|
||||
if (tachesExistantes.length == 0) {
|
||||
const tache = {
|
||||
name: nomTache, type: 'tache',
|
||||
@ -2380,13 +2378,17 @@ export class RdDActor extends RdDBaseActor {
|
||||
}
|
||||
}
|
||||
await this.createEmbeddedDocuments('Item', [tache], options);
|
||||
tachesExistantes = this.filterItems(filterTacheLecture);
|
||||
tachesExistantes = findTache(nomTache)
|
||||
}
|
||||
return tachesExistantes.length > 0 ? tachesExistantes[0] : undefined;
|
||||
|
||||
function findTache(name) {
|
||||
return this.filterItems(it => it.name == name, 'tache');
|
||||
}
|
||||
}
|
||||
|
||||
blessuresASoigner() {
|
||||
// TODO or not TODO: filtrer les blessures poour lesquels on ne peut plus faire de premiers soins?
|
||||
// TODO or not TODO: filtrer les blessures pour lesquelles on ne peut plus faire de premiers soins?
|
||||
return this.filterItems(it => it.system.gravite > 0 && it.system.gravite <= 6 && !(it.system.premierssoins.done && it.system.soinscomplets.done), 'blessure')
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
listItems(type = undefined) { return (type ? this.itemTypes[type] : this.items); }
|
||||
filterItems(filter, type = undefined) { return type ? this.itemTypes[type]?.filter(filter) ?? [] : []; }
|
||||
filterItems(filter, type = undefined) { return (type ? this.itemTypes[type] : this.items)?.filter(filter); }
|
||||
findItemLike(idOrName, type) {
|
||||
return this.getItem(idOrName, type)
|
||||
?? Misc.findFirstLike(idOrName, this.listItems(type), { description: Misc.typeName('Item', type) });
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"id": "foundryvtt-reve-de-dragon",
|
||||
"title": "Rêve de Dragon",
|
||||
"version": "10.7.20",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.20.zip",
|
||||
"version": "10.7.21",
|
||||
"download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-10.7.21.zip",
|
||||
"manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v10/system.json",
|
||||
"compatibility": {
|
||||
"minimum": "10",
|
||||
|
Loading…
Reference in New Issue
Block a user