#70-classes-as-items (#92)

Co-authored-by: LeFrique <lefrique@live.de>
Reviewed-on: #92
This commit was merged in pull request #92.
This commit is contained in:
2024-03-23 19:17:54 +01:00
co-authored by Le-Frique
parent af6fdbbf89
commit 12e6412a9f
11 changed files with 399 additions and 75 deletions
+11 -6
View File
@@ -18,7 +18,7 @@ export class M5Item extends Item {
calc.containers = null;
if (actor) {
const actorCalc = actor.derivedData({ containers: false, items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = actor.derivedData({ containers: false, items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.containers = actorCalc.gear.containers;
}
@@ -47,12 +47,14 @@ export class M5Item extends Item {
if (character) {
const actorCalc = character.derivedData({
containers: true,
skills: true,
items: true,
spells: true,
effects: true,
kampfkuenste: true,
encumbrance: true,
class: true,
});
if (actorCalc?.skillMods && Object.keys(actorCalc.skillMods).indexOf(itemId) !== -1) {
pairs = pairs.concat(actorCalc.skillMods[itemId]);
@@ -89,7 +91,7 @@ export class M5Item extends Item {
calc.containers = null;
if (actor) {
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.ew += actorCalc.stats.attackBonus.value;
calc.combatSkills = actorCalc.skills.combat;
@@ -124,7 +126,7 @@ export class M5Item extends Item {
calc.containers = null;
if (actor) {
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.ew += actorCalc.stats.defense.value + actorCalc.stats.defenseBonus.value;
calc.combatSkills = actorCalc.skills.combat;
@@ -157,7 +159,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({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = actor.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.containers = actorCalc.gear.containers;
}
@@ -171,7 +173,7 @@ export class M5Item extends Item {
} else if (itemType === "spell") {
calc.fw = 0;
if (actor) {
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = character.derivedData({ containers: true, items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.ew = actorCalc.stats.spellCasting.value;
}
@@ -183,7 +185,7 @@ export class M5Item extends Item {
calc.generalSkills = null;
if (actor) {
const actorCalc = character.derivedData({ items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true });
const actorCalc = character.derivedData({ containers: true, items: true, spells: true, effects: true, kampfkuenste: true, encumbrance: true, class: true });
if (actorCalc) {
calc.generalSkills = actorCalc.skills.general;
}
@@ -197,6 +199,9 @@ export class M5Item extends Item {
itemData.rolls.formulas[0].label = skill.name;
}
}
} else if (itemType === "class") {
itemData.mods[0] = { type: "stat", id: "resistanceBody", operation: "add", value: itemData.resistanceBody };
itemData.mods[1] = { type: "stat", id: "resistanceMind", operation: "add", value: itemData.resistanceMind };
}
if (itemData?.mods) {
calc.mods = {};