Fix competencecreatures/competences
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ITEM_TYPES } from "./constants.js";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { RdDInitiative } from "./initiative.mjs";
|
||||
import { RdDItemArme } from "./item/arme.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class RdDItemCompetenceCreature extends RdDItem {
|
||||
@@ -12,38 +13,37 @@ export class RdDItemCompetenceCreature extends RdDItem {
|
||||
isParade() { return this.system.iscombat && (this.system.categorie_parade ?? '') != '' }
|
||||
isBouclier() { return this.system.categorie_parade.includes('bouclier') }
|
||||
|
||||
static attaqueCreature(comp) {
|
||||
const categorieAttaque = comp.getCategorieAttaque()
|
||||
attaqueCreature() {
|
||||
const categorieAttaque = this.getCategorieAttaque()
|
||||
if (categorieAttaque != undefined) {
|
||||
const initative = RdDInitiative.calculInitiative(comp.system.niveau, comp.system.carac_value);
|
||||
const armeComp = new RdDItem({
|
||||
name: comp.name,
|
||||
type: ITEM_TYPES.arme,
|
||||
img: comp.img,
|
||||
system: {
|
||||
competence: comp.name,
|
||||
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
||||
niveau: comp.system.niveau,
|
||||
initiative: initative,
|
||||
mortalite: comp.system.mortalite,
|
||||
dommages: comp.system.dommages,
|
||||
equipe: true,
|
||||
resistance: 100,
|
||||
penetration: 0,
|
||||
force: 0,
|
||||
rapide: true,
|
||||
}
|
||||
});
|
||||
const initative = RdDInitiative.calculInitiative(this.system.niveau, this.system.carac_value);
|
||||
const attaque = {
|
||||
name: comp.name,
|
||||
action: comp.isCompetencePossession() ? 'possession' : 'attaque',
|
||||
name: this.name,
|
||||
action: this.isCompetencePossession() ? 'possession' : 'attaque',
|
||||
initOnly: false,
|
||||
arme: armeComp,
|
||||
comp: comp,
|
||||
carac: { key: comp.name, value: comp.system.carac_value },
|
||||
arme: new RdDItemArme({
|
||||
name: this.name,
|
||||
type: ITEM_TYPES.arme,
|
||||
img: this.img,
|
||||
system: {
|
||||
competence: this.name,
|
||||
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
||||
niveau: this.system.niveau,
|
||||
initiative: initative,
|
||||
mortalite: this.system.mortalite,
|
||||
dommages: this.system.dommages,
|
||||
equipe: true,
|
||||
resistance: 100,
|
||||
penetration: 0,
|
||||
force: 0,
|
||||
rapide: true,
|
||||
}
|
||||
}),
|
||||
comp: this,
|
||||
carac: { key: this.name, value: this.system.carac_value },
|
||||
equipe: true,
|
||||
mortalite: comp.system.mortalite,
|
||||
dmg: comp.system.dommages,
|
||||
mortalite: this.system.mortalite,
|
||||
dmg: this.system.dommages,
|
||||
initiative: initative
|
||||
};
|
||||
return attaque
|
||||
|
Reference in New Issue
Block a user