Corrections mise sort en réserve
La mise en réserve de sorts depuis la feuille de personne ne marchait pas à cause de rêve variables
This commit is contained in:
@@ -1092,12 +1092,13 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
|
||||
$createSortReserve(sort) {
|
||||
const ptReve = Number.isInteger(sort.system.ptreve) ? Number(sort.system.ptreve) :Number(sort.system.ptreve.match(/\d+/))
|
||||
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' }
|
||||
system: { sortid: sort.id, draconic: sort.system.draconic, ptreve: ptReve, coord: 'A1', heurecible: 'Vaisseau' }
|
||||
}],
|
||||
{ renderSheet: true })
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { RdDItemCompetence } from "./item-competence.js";
|
||||
import { ITEM_TYPES } from "./constants.js";
|
||||
import { Misc } from "./misc.js";
|
||||
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
|
||||
export const VOIES_DRACONIC = [
|
||||
{ code: 'O', label: "Voie d'Oniros", short: 'Oniros', ordre: 'a' },
|
||||
@@ -14,7 +15,7 @@ export const VOIES_DRACONIC = [
|
||||
]
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDItemSort extends Item {
|
||||
export class RdDItemSort extends RdDItem {
|
||||
static preloadHandlebars() {
|
||||
Handlebars.registerHelper('itemSort-codeDraconic', voie => RdDItemSort.getCode(voie))
|
||||
Handlebars.registerHelper('itemSort-shortDraconic', voie => RdDItemSort.getShortVoie(voie))
|
||||
@@ -62,7 +63,7 @@ export class RdDItemSort extends Item {
|
||||
|
||||
|
||||
static diffReve(sort) { return RdDItemSort.toVar((sort.system.difficulte.match(/\-?(\d)+/) ? 'R' : 'R ') + sort.system.difficulte) }
|
||||
static coutReve(sort) { return RdDItemSort.toVar((Number.isInteger(sort.system.ptreve || sort.system.ptreve.match(/(\d)+\+?/)) ? 'r' : 'r ') + sort.system.ptreve) }
|
||||
static coutReve(sort) { return RdDItemSort.toVar((Number.isInteger(sort.system.ptreve) || sort.system.ptreve.match(/(\d)+\+?/) ? 'r' : 'r ') + sort.system.ptreve) }
|
||||
static getDraconicsSort(competencesDraconic, sort) {
|
||||
// se baser sur la voie du sort?
|
||||
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
||||
|
||||
Reference in New Issue
Block a user