Compare commits
2 Commits
a65326d658
...
a622814295
Author | SHA1 | Date | |
---|---|---|---|
a622814295 | |||
2aa8fcb980 |
@ -1602,7 +1602,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
computeDraconicAndSortIndex(sortList) {
|
computeDraconicAndSortIndex(sortList) {
|
||||||
let draconicList = this.getDraconicList();
|
let draconicList = this.getDraconicList();
|
||||||
for (let sort of sortList) {
|
for (let sort of sortList) {
|
||||||
let draconicsSort = this.getDraconicsSort(draconicList, sort).map(it => it.name);
|
let draconicsSort = RdDItemSort.getDraconicsSort(draconicList, sort).map(it => it.name);
|
||||||
for (let index = 0; index < draconicList.length && sort.system.listIndex == undefined; index++) {
|
for (let index = 0; index < draconicList.length && sort.system.listIndex == undefined; index++) {
|
||||||
if (draconicsSort.includes(draconicList[index].name)) {
|
if (draconicsSort.includes(draconicList[index].name)) {
|
||||||
sort.system.listIndex = index;
|
sort.system.listIndex = index;
|
||||||
@ -1612,19 +1612,6 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
return draconicList;
|
return draconicList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
getDraconicsSort(draconicList, sort) {
|
|
||||||
//console.log(draconicList, bestDraconic, draconic, voie);
|
|
||||||
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
|
||||||
case "lecture d'aura":
|
|
||||||
case "detection d'aura":
|
|
||||||
return draconicList;
|
|
||||||
case "annulation de magie":
|
|
||||||
return draconicList.filter(it => !RdDItemCompetence.isThanatos(it));
|
|
||||||
}
|
|
||||||
return [RdDItemCompetence.getVoieDraconic(draconicList, sort.system.draconic)];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollUnSort(coord) {
|
async rollUnSort(coord) {
|
||||||
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
RdDEmpoignade.checkEmpoignadeEnCours(this)
|
||||||
|
@ -115,6 +115,7 @@ export class Mapping {
|
|||||||
static prepareArmes(actor) {
|
static prepareArmes(actor) {
|
||||||
return actor.items.filter(it => it.type == ITEM_TYPES.arme)
|
return actor.items.filter(it => it.type == ITEM_TYPES.arme)
|
||||||
.map(arme => {
|
.map(arme => {
|
||||||
|
// TODO: gestion armes 1 ou 2 mains
|
||||||
const compToUse = RdDItemArme.getCompetenceArme(arme, 'competence');
|
const compToUse = RdDItemArme.getCompetenceArme(arme, 'competence');
|
||||||
const comp = actor.getCompetence(compToUse);
|
const comp = actor.getCompetence(compToUse);
|
||||||
const bonusDom = Mapping.calculBonusDom(comp, actor)
|
const bonusDom = Mapping.calculBonusDom(comp, actor)
|
||||||
@ -183,7 +184,7 @@ export class Mapping {
|
|||||||
static prepareSorts(actor) {
|
static prepareSorts(actor) {
|
||||||
return actor.itemTypes[ITEM_TYPES.sort].map(it => {
|
return actor.itemTypes[ITEM_TYPES.sort].map(it => {
|
||||||
return {
|
return {
|
||||||
voie: it.system.voie,
|
voie: RdDItemSort.getCodeDraconic(it),
|
||||||
description: Mapping.descriptionSort(it),
|
description: Mapping.descriptionSort(it),
|
||||||
bonus: Mapping.bonusCase(it)
|
bonus: Mapping.bonusCase(it)
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,43 @@
|
|||||||
|
import { Grammar } from "./grammar.js";
|
||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { TMRUtility } from "./tmr-utility.js";
|
import { TMRUtility } from "./tmr-utility.js";
|
||||||
|
|
||||||
|
const VOIES_DRACONIC = [
|
||||||
|
{ code: 'O', label: "Voie d'Oniros", short: 'Oniros'},
|
||||||
|
{ code: 'H', label: "Voie d'Hypnos" , short:'Hypnos' },
|
||||||
|
{ code: 'N', label: "Voie de Narcos", short: 'Narcos' },
|
||||||
|
{ code: 'T', label: "Voie de Thanatos", short:'Thanatos' },
|
||||||
|
{ code: 'O/H/N/T', label: "Oniros/Hypnos/Narcos/Thanatos", short:'Oniros/Hypnos/Narcos/Thanatos' },
|
||||||
|
{ code: 'O/H/N', label: "Oniros/Hypnos/Narcos" }
|
||||||
|
]
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDItemSort extends Item {
|
export class RdDItemSort extends Item {
|
||||||
|
|
||||||
|
static getDraconicsSort(draconicList, sort) {
|
||||||
|
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
||||||
|
case "lecture d'aura":
|
||||||
|
case "detection d'aura":
|
||||||
|
return draconicList;
|
||||||
|
case "annulation de magie":
|
||||||
|
return draconicList.filter(it => !RdDItemCompetence.isThanatos(it));
|
||||||
|
}
|
||||||
|
return [RdDItemCompetence.getVoieDraconic(draconicList, sort.system.draconic)];
|
||||||
|
}
|
||||||
|
|
||||||
|
static getCodeDraconic(sort) {
|
||||||
|
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
||||||
|
case "lecture d'aura":
|
||||||
|
case "detection d'aura":
|
||||||
|
return 'O/H/N/T'
|
||||||
|
case "annulation de magie":
|
||||||
|
return 'O/H/N'
|
||||||
|
}
|
||||||
|
const voie = VOIES_DRACONIC.find(it => it.label.includes(sort.system.draconic))
|
||||||
|
return voie?.code ?? sort.system.draconic
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isDifficulteVariable(sort) {
|
static isDifficulteVariable(sort) {
|
||||||
return sort && (sort.system.difficulte.toLowerCase() == "variable");
|
return sort && (sort.system.difficulte.toLowerCase() == "variable");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<h4>Tirage aléatoire: {{typeName}}</h4>
|
<h4>Tirage aléatoire: {{document.name}}</h4>
|
||||||
<div>{{document.pack}}</div>
|
<div>Tirage de {{typeName}} aléatoire depuis {{document.pack}}</div>
|
||||||
<div>Jet {{roll.formula}} : {{roll.total}}{{percentages}}</div>
|
<div>Jet {{roll.formula}} : {{roll.total}}{{percentages}}</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
|
@ -3,3 +3,5 @@
|
|||||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
<option value="O/H/N/T">Oniros/Hypnos/Narcos/Thanatos</option>
|
||||||
|
<option value="O/H/N">Oniros/Hypnos/Narcos</option>
|
||||||
|
Loading…
Reference in New Issue
Block a user