forked from public/foundryvtt-reve-de-dragon
Fix competencecreatures/competences
This commit is contained in:
@@ -16,7 +16,6 @@ import { RdDRollResult } from "../rdd-roll-result.js";
|
||||
|
||||
import { RdDItemArme } from "../item/arme.js";
|
||||
import { RdDItemCompetence } from "../item-competence.js";
|
||||
import { RdDItemCompetenceCreature } from "../item-competencecreature.js";
|
||||
|
||||
import { ChatUtility } from "../chat-utility.js";
|
||||
import { DialogValidationEncaissement } from "../dialog-validation-encaissement.js";
|
||||
@@ -25,6 +24,7 @@ import { RdDEmpoignade } from "../rdd-empoignade.js";
|
||||
import { RdDPossession } from "../rdd-possession.js";
|
||||
import { BASE_CORPS_A_CORPS, BASE_ESQUIVE, POSSESSION_SANS_DRACONIC } from "../item/base-items.js";
|
||||
import { RollDataAjustements } from "../rolldata-ajustements.js";
|
||||
import { MappingCreatureArme } from "../item/mapping-creature-arme.mjs";
|
||||
|
||||
/**
|
||||
* Classe de base pour les acteurs disposant de rêve (donc, pas des objets)
|
||||
@@ -114,7 +114,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
listActions({ isAttaque = false, isEquipe = false }) {
|
||||
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||
.filter(it => it.isAttaque())
|
||||
.map(it => RdDItemCompetenceCreature.attaqueCreature(it))
|
||||
.map(it => it.attaqueCreature())
|
||||
.filter(it => it != undefined);
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
}
|
||||
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||
const token = RdDUtility.getSelectedToken(this)
|
||||
const arme = RdDItemCompetenceCreature.armeCreature(competence)
|
||||
const arme = MappingCreatureArme.armeCreature(competence)
|
||||
if (arme && options.tryTarget && Targets.hasTargets()) {
|
||||
Targets.selectOneTargetToken(target => {
|
||||
if (arme.action == "possession") {
|
||||
@@ -430,7 +430,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
||||
return;
|
||||
}
|
||||
// Transformer la competence de créature
|
||||
RdDItemCompetenceCreature.setRollDataCreature(rollData)
|
||||
MappingCreatureArme.setRollDataCreature(rollData)
|
||||
}
|
||||
const dialogLabel = 'Jet ' + Grammar.apostrophe('de', competence.name);
|
||||
await this.openRollDialog({
|
||||
|
@@ -9,6 +9,7 @@ import { RdDAudio } from "../rdd-audio.js";
|
||||
import { RdDConfirm } from "../rdd-confirm.js";
|
||||
import { RdDUtility } from "../rdd-utility.js";
|
||||
import { SystemCompendiums } from "../settings/system-compendiums.js";
|
||||
import { RdDItem } from "../item.js";
|
||||
|
||||
export class RdDBaseActor extends Actor {
|
||||
|
||||
@@ -499,7 +500,8 @@ export class RdDBaseActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async computeEncTotal() {
|
||||
if (!this.pack) {
|
||||
this.encTotal = this.items.map(it => it.getEncTotal()).reduce(Misc.sum(), 0);
|
||||
this.encTotal = this.items.filter(it => RdDItem.getItemTypesInventaire().includes(it.type))
|
||||
.map(it => it.getEncTotal()).reduce(Misc.sum(), 0)
|
||||
return this.encTotal;
|
||||
}
|
||||
return 0;
|
||||
@@ -758,10 +760,10 @@ export class RdDBaseActor extends Actor {
|
||||
getCaracInit(competence) { return 0 }
|
||||
|
||||
listAttaques() {
|
||||
return this.listActions({ isAttaque: true, isEquipe:false })
|
||||
return this.listActions({ isAttaque: true, isEquipe: false })
|
||||
}
|
||||
|
||||
listActions({ isAttaque = false, isEquipe=false }) { return [] }
|
||||
listActions({ isAttaque = false, isEquipe = false }) { return [] }
|
||||
|
||||
listActionsPossessions() {
|
||||
return this.itemTypes[ITEM_TYPES.possession]
|
||||
|
@@ -3,7 +3,7 @@ import { SYSTEM_RDD } from "../../constants.js";
|
||||
import { Misc } from "../../misc.js";
|
||||
import { EXPORT_CSV_SCRIPTARIUM, OptionsAvancees } from "../../settings/options-avancees.js";
|
||||
import { ExportScriptarium } from "./export-scriptarium.js";
|
||||
import { CATEGORIES_COMPETENCES, CATEGORIES_DRACONIC, Mapping } from "./mapping.js";
|
||||
import { CATEGORIES_COMPETENCES_BASE, CATEGORIES_DRACONIC, Mapping } from "./mapping.js";
|
||||
|
||||
export class RdDActorExportSheet extends RdDActorSheet {
|
||||
static init() {
|
||||
@@ -44,7 +44,7 @@ export class RdDActorExportSheet extends RdDActorSheet {
|
||||
formData.context = Mapping.prepareContext(this.actor)
|
||||
formData.attaques = this.actor.listActionsAttaque()
|
||||
formData.export = this.getMappingValues(formData.context, this.actor)
|
||||
formData.competences = this.getCompetences(CATEGORIES_COMPETENCES)
|
||||
formData.competences = this.getCompetences(CATEGORIES_COMPETENCES_BASE)
|
||||
formData.draconic = this.getCompetences(CATEGORIES_DRACONIC)
|
||||
const legeres = this.actor.nbBlessuresLegeres()
|
||||
const graves = this.actor.nbBlessuresGraves()
|
||||
|
@@ -9,7 +9,7 @@ import { RdDBonus } from "../../rdd-bonus.js"
|
||||
import { TMRType } from "../../tmr-utility.js"
|
||||
|
||||
|
||||
export const CATEGORIES_COMPETENCES = [
|
||||
export const CATEGORIES_COMPETENCES_BASE = [
|
||||
"generale",
|
||||
"particuliere",
|
||||
"specialisee",
|
||||
@@ -88,7 +88,7 @@ const MAPPING_BASE = [
|
||||
{ column: "endurance_actuel", rollClass: 'jet-endurance', getter: (actor, context) => actor.system.sante.endurance.value },
|
||||
{ column: "esquive", getter: (actor, context) => Mapping.getEsquive(context) },
|
||||
{ column: "esquive_armure", getter: (actor, context) => Mapping.getEsquiveArmure(context) },
|
||||
{ column: "competences", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_COMPETENCES) },
|
||||
{ column: "competences", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_COMPETENCES_BASE) },
|
||||
{ column: "draconic", getter: (actor, context) => Mapping.getCompetences(actor, CATEGORIES_DRACONIC) },
|
||||
]
|
||||
|
||||
|
Reference in New Issue
Block a user