diff --git a/src/module/entities/TwodsixActor.ts b/src/module/entities/TwodsixActor.ts index 9846f44bb..b4f1395eb 100644 --- a/src/module/entities/TwodsixActor.ts +++ b/src/module/entities/TwodsixActor.ts @@ -15,6 +15,7 @@ import { applyToAllActors } from "../utils/migration-utils"; import { TwodsixShipActions } from "../utils/TwodsixShipActions"; import { updateFinances } from "../hooks/updateFinances"; import { applyEncumberedEffect, applyWoundedEffect } from "../utils/showStatusIcons"; +import { TwodsixActiveEffect } from "./TwodsixActiveEffect"; /** * Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system. @@ -459,7 +460,20 @@ export default class TwodsixActor extends Actor { let maxEncumbrance = 0; const encumbFormula = game.settings.get('twodsix', 'maxEncumbrance'); if (Roll.validate(encumbFormula)) { - maxEncumbrance = Roll.safeEval(Roll.replaceFormulaData(encumbFormula, this.getRollData(), {missing: "0", warn: false})); + let rollData:object; + if (game.settings.get('twodsix', 'ruleset') === 'CT') { + rollData = foundry.utils.duplicate(this.getRollData()); //Not celar why deepClone doesn't work here + const encumberedEffect:TwodsixActiveEffect = this.effects.find(eff => eff.statuses.has('encumbered')); + if (encumberedEffect) { + for (const change of encumberedEffect.changes) { + const rollKey = change.key.replace('system.', ''); + foundry.utils.mergeObject(rollData, {[rollKey]: foundry.utils.getProperty(this, change.key) - parseInt(change.value)}); + } + } + } else { + rollData = this.getRollData(); + } + maxEncumbrance = Roll.safeEval(Roll.replaceFormulaData(encumbFormula, rollData, {missing: "0", warn: false})); } return Math.max(maxEncumbrance, 0); } diff --git a/static/styles/twodsix.css b/static/styles/twodsix.css index 29420c4be..02862663b 100644 --- a/static/styles/twodsix.css +++ b/static/styles/twodsix.css @@ -928,12 +928,12 @@ h2 { } .status-icons.npc { - position: relative !important; - top: -20.5ch; - /* height: -webkit-fill-available !important; */ + position: absolute !important; + top: 2ch; + left: 1ch !important; align-content: flex-start; - /* flex-wrap: wrap; */ } + .condition-icon { height: auto; width: 3ch; diff --git a/static/styles/twodsix_basic.css b/static/styles/twodsix_basic.css index 7aace0bf3..aef076ba8 100644 --- a/static/styles/twodsix_basic.css +++ b/static/styles/twodsix_basic.css @@ -549,8 +549,9 @@ img.character-info-mask { } .status-icons.npc { - position: relative !important; - top: -22.5ch; + position: absolute !important; + top: 2ch; + left: 1ch !important; align-content: flex-start; }