Co-authored-by: LeFrique <lefrique@live.de> Reviewed-on: #52
This commit was merged in pull request #52.
This commit is contained in:
@@ -14,22 +14,22 @@ export class M5Item extends Item {
|
||||
const itemData = (this as any).system;
|
||||
const calc = itemData.calc;
|
||||
|
||||
if (itemType === "item") {
|
||||
calc.containers = null;
|
||||
if (itemType === "item") {
|
||||
calc.containers = null;
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = actor.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
if (actorCalc) {
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
if (actor) {
|
||||
const actorCalc = actor.derivedData({ containers: false, items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
const container = character.getItem(itemData.containerId);
|
||||
//console.log("M5Item.prepareDerivedData:containers", itemData, container?.system)
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
} else if (itemType === "skill") {
|
||||
} else if (itemType === "skill") {
|
||||
calc.fw = itemData.fw;
|
||||
calc.bonus = 0;
|
||||
|
||||
@@ -46,7 +46,14 @@ export class M5Item extends Item {
|
||||
];
|
||||
|
||||
if (character) {
|
||||
const actorCalc = character.derivedData({ skills: true, weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({
|
||||
skills: true,
|
||||
items: true,
|
||||
spells: true,
|
||||
effects: true,
|
||||
kampfkuenste: true,
|
||||
encumbrance: true,
|
||||
});
|
||||
if (actorCalc?.skillMods && Object.keys(actorCalc.skillMods).indexOf(itemId) !== -1) {
|
||||
pairs = pairs.concat(actorCalc.skillMods[itemId]);
|
||||
}
|
||||
@@ -81,9 +88,8 @@ export class M5Item extends Item {
|
||||
calc.combatSkills = null;
|
||||
calc.containers = null;
|
||||
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.attackBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
@@ -94,8 +100,8 @@ export class M5Item extends Item {
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const skill = character.getItem(itemData.skillId);
|
||||
//console.log("M5Item.prepareDerivedData:weapon", itemData, skill?.system)
|
||||
if (skill) {
|
||||
@@ -115,7 +121,7 @@ export class M5Item extends Item {
|
||||
calc.containers = null;
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value;
|
||||
calc.combatSkills = actorCalc.skills.combat;
|
||||
@@ -127,7 +133,7 @@ export class M5Item extends Item {
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
|
||||
const skill = character.getItem(itemData.skillId);
|
||||
//console.log("M5Item.prepareDerivedData:weapon", itemData, skill?.system)
|
||||
@@ -148,7 +154,7 @@ export class M5Item extends Item {
|
||||
itemData.mods[5] = { type: "stat", id: "apProtection", operation: "set", value: itemData.apProtection };
|
||||
calc.containers = null;
|
||||
if (actor) {
|
||||
const actorCalc = actor.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = actor.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.containers = actorCalc.gear.containers;
|
||||
}
|
||||
@@ -157,12 +163,12 @@ export class M5Item extends Item {
|
||||
if (container) {
|
||||
container.prepareDerivedData();
|
||||
const containerData = container.system;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (itemType === "spell") {
|
||||
calc.fw = 0;
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.ew = actorCalc.stats.spellCasting.value;
|
||||
}
|
||||
@@ -174,7 +180,7 @@ export class M5Item extends Item {
|
||||
calc.generalSkills = null;
|
||||
|
||||
if (actor) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
|
||||
if (actorCalc) {
|
||||
calc.generalSkills = actorCalc.skills.general;
|
||||
}
|
||||
@@ -217,7 +223,13 @@ export class M5Item extends Item {
|
||||
}
|
||||
case M5ModType.SKILL: {
|
||||
if (character) {
|
||||
const actorCalc = character.derivedData({ weapons: true, defensiveWeapons: true, armor: true, items: true, spells: true, effects: true, kampfkuenste: true });
|
||||
const actorCalc = character.derivedData({
|
||||
items: true,
|
||||
spells: true,
|
||||
effects: true,
|
||||
kampfkuenste: true,
|
||||
encumbrance: true,
|
||||
});
|
||||
if (actorCalc) {
|
||||
let category = (game as Game).i18n.localize("midgard5.skill");
|
||||
Object.keys(actorCalc.skills.general).forEach((skillId) => {
|
||||
|
||||
Reference in New Issue
Block a user