Skip to content

Commit 879353d

Browse files
authored
Merge pull request #14511 from taloncore/master
Draw Steel Sheet - Include Kit Stamina Changes. Improves import from Forged Steel
2 parents ad3db54 + 5f39a5e commit 879353d

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

Draw Steel/draw-steel.html

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4223,13 +4223,32 @@ <h5 class="panel-title" data-i18n="conditions"></h5>
42234223
const disengage = calculateCombatStat(allFeatures, 'Disengage', 1);
42244224
const stability = calculateCombatStat(allFeatures, 'Stability', 0);
42254225

4226-
const stamina_max = allFeatures
4227-
.filter(f => f.type === FEATURE_TYPES.BONUS && f.data.field === 'Stamina')
4228-
.reduce((sum, f) => sum + (f.data.value + ((level - 1) * f.data.valuePerLevel)), 0);
4229-
4226+
// --- Stamina & Recoveries (including Kit stats) ---
4227+
// 1) Base stamina from Bonus features (class, ancestry, etc.)
4228+
const staminaFromBonuses = allFeatures
4229+
.filter(f => f.type === FEATURE_TYPES.BONUS && f.data.field === 'Stamina')
4230+
.reduce((sum, f) => {
4231+
const base = Number(f.data.value) || 0;
4232+
const perLevel = Number(f.data.valuePerLevel) || 0;
4233+
return sum + base + ((level - 1) * perLevel);
4234+
}, 0);
4235+
4236+
// 2) Stamina from Kits (KitStats), using the highest equipped kit value
4237+
// This mirrors how calculateCombatStat uses KIT_STATS for Speed/Stability.
4238+
const staminaFromKits = Math.max(
4239+
0, // avoid -Infinity if no kits
4240+
...allFeatures
4241+
.filter(f => f.type === FEATURE_TYPES.KIT_STATS)
4242+
.map(f => Number(f.stamina) || 0)
4243+
);
4244+
4245+
// 3) Final maximum Stamina
4246+
const stamina_max = staminaFromBonuses + staminaFromKits;
4247+
42304248
const recoveries_max = allFeatures
4231-
.filter(f => f.type === FEATURE_TYPES.BONUS && f.data.field === 'Recoveries')
4232-
.reduce((sum, f) => sum + f.data.value, 0);
4249+
.filter(f => f.type === FEATURE_TYPES.BONUS && f.data.field === 'Recoveries')
4250+
.reduce((sum, f) => sum + (Number(f.data.value) || 0), 0);
4251+
42334252

42344253
const immunity = getDamageModifiers(allFeatures, level, 'Immunity');
42354254
const weakness = getDamageModifiers(allFeatures, level, 'Weakness');

0 commit comments

Comments
 (0)