Soins des blessures
Maintenant, les tâches peuvent être créées directement dans l'onglet combat, à côté des blessures. Les tâches des oins sont dans cet onglet
This commit is contained in:
@ -151,6 +151,15 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
this.html.find('.creer-tache').click(async event => {
|
||||
this.createEmptyTache();
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-legere').click(async event => {
|
||||
this.actor.createTacheBlessure('legere');
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-grave').click(async event => {
|
||||
this.actor.createTacheBlessure('grave');
|
||||
});
|
||||
this.html.find('.creer-tache-blessure-critique').click(async event => {
|
||||
this.actor.createTacheBlessure('critique');
|
||||
});
|
||||
this.html.find('.creer-une-oeuvre').click(async event => {
|
||||
this.selectTypeOeuvreToCreate();
|
||||
});
|
||||
@ -477,7 +486,6 @@ export class RdDActorSheet extends RdDBaseActorSheet {
|
||||
async createEmptyTache() {
|
||||
await this.actor.createItem('tache', 'Nouvelle tache');
|
||||
}
|
||||
|
||||
_optionRecherche(target) {
|
||||
if (!target.value?.length) {
|
||||
return undefined;
|
||||
|
@ -35,6 +35,7 @@ import { Targets } from "./targets.js";
|
||||
import { DialogRepos } from "./dialog-repos.js";
|
||||
import { RdDBaseActor } from "./actor/base-actor.js";
|
||||
import { RdDTimestamp } from "./rdd-timestamp.js";
|
||||
import { RdDItemTache } from "./item-tache.js";
|
||||
|
||||
const POSSESSION_SANS_DRACONIC = {
|
||||
img: 'systems/foundryvtt-reve-de-dragon/icons/entites/possession.webp',
|
||||
@ -46,7 +47,6 @@ const POSSESSION_SANS_DRACONIC = {
|
||||
};
|
||||
|
||||
const PAS_DE_BLESSURE = { "active": false, "psdone": false, "scdone": false, "premiers_soins": 0, "soins_complets": 0, "jours": 0, "loc": "" };
|
||||
|
||||
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -2325,6 +2325,13 @@ export class RdDActor extends RdDBaseActor {
|
||||
return tachesExistantes.length > 0 ? tachesExistantes[0] : undefined;
|
||||
}
|
||||
|
||||
async createTacheBlessure(gravite) {
|
||||
const tache = RdDItemTache.prepareTacheSoin(gravite)
|
||||
if (tache) {
|
||||
await this.createEmbeddedDocuments('Item', [tache], { renderSheet: false });
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollTache(id) {
|
||||
const tacheData = this.getTache(id)
|
||||
|
@ -1,4 +1,18 @@
|
||||
export class RdDItemTache extends Item {
|
||||
|
||||
const BASE_TACHE_SOIN_BLESSURE = { type: "tache", img: 'systems/foundryvtt-reve-de-dragon/icons/competence_chirurgie.webp', system: { carac: "dexterite", competence: "Chirurgie", periodicite: "1 round", fatigue: 0, } }
|
||||
const TACHES_SOIN_BLESSURE = {
|
||||
'critique': { name: 'Blessure critique', system: { difficulte: -6, points_de_tache: 6 } },
|
||||
'grave': { name: 'Blessure grave', system: { difficulte: -4, points_de_tache: 4 } },
|
||||
'legere': { name: 'Blessure légère', system: { difficulte: -2, points_de_tache: 2 } },
|
||||
}
|
||||
|
||||
export class RdDItemTache extends Item {
|
||||
|
||||
static prepareTacheSoin(gravite) {
|
||||
const blessure = TACHES_SOIN_BLESSURE[gravite]
|
||||
if (blessure) {
|
||||
return mergeObject(duplicate(BASE_TACHE_SOIN_BLESSURE), blessure)
|
||||
}
|
||||
ui.notifications.warn(`Pas de tâche de soins pour une blessure ${gravite}`)
|
||||
return undefined;
|
||||
}
|
||||
}
|
@ -149,6 +149,7 @@ export class RdDUtility {
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/jeux.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/alchimie.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/astrologie.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/chirurgie.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/non-haut-revant.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/haut-revant.html',
|
||||
'systems/foundryvtt-reve-de-dragon/templates/actor/dragon-queues.html',
|
||||
|
Reference in New Issue
Block a user