Make Items with mods equippable (#11)
Changes: + Items that can influence you stats are equippable + only equipped items influence your stats + Armor now influences your stats + move mods into a partial for easier changes
This commit is contained in:
@@ -105,6 +105,11 @@ export class M5Item extends Item {
|
||||
calc.fw += skillData.fw;
|
||||
}
|
||||
}
|
||||
} else if (itemType === "armor") {
|
||||
itemData.mods[0] = { type: "stat", id: "defenseBonus", operation: "add", value: itemData.stats.defenseBonus };
|
||||
itemData.mods[1] = { type: "stat", id: "attackBonus", operation: "add", value: itemData.stats.attackBonus };
|
||||
itemData.mods[2] = { type: "stat", id: "movement", operation: "add", value: itemData.stats.movementBonus };
|
||||
itemData.mods[3] = { type: "attribute", id: "gw", operation: "add100", value: itemData.attributeMod.gw };
|
||||
} else if (itemType === "spell") {
|
||||
calc.fw = 0;
|
||||
if (actor) {
|
||||
@@ -134,8 +139,10 @@ export class M5Item extends Item {
|
||||
itemData.rolls.formulas[0].label = skill.name;
|
||||
}
|
||||
}
|
||||
} else if (itemType === "item" || itemType === "effect") {
|
||||
}
|
||||
if (itemData?.mods) {
|
||||
calc.mods = {};
|
||||
|
||||
Object.keys(itemData?.mods).forEach((key) => {
|
||||
const mod = itemData.mods[key];
|
||||
const modCalc = {};
|
||||
@@ -243,6 +250,7 @@ export class M5Item extends Item {
|
||||
}
|
||||
|
||||
const roll = new M5Roll(rollData, this.actor, item.name);
|
||||
console.log(roll);
|
||||
return roll.toMessage();
|
||||
} else {
|
||||
ChatMessage.create({
|
||||
|
||||
Reference in New Issue
Block a user