feat: separate skill value/max (transcendence pool vs level)
Release Creation / build (release) Successful in 58s
Release Creation / build (release) Successful in 58s
- skill.value = spendable transcendence pool (editable select) - skill.max = max level (locked by default, unlock btn) - computeRollFormula/computeResults/confront use skill.max - clamp transcendence spend to skill.value - resetTranscendence button in Bio&Notes - v14 compat: duplicate→deepClone, mergeObject→spread, socket fixes - Dialog v1 removed, DragDrop dedup, await fixes
This commit is contained in:
@@ -48,7 +48,7 @@ export class EcrymeConfrontDialog extends HandlebarsApplicationMixin(foundry.app
|
||||
async _prepareContext() {
|
||||
return {
|
||||
...this.rollData,
|
||||
config: game.system.ecryme.config,
|
||||
config: game.ecryme.config,
|
||||
buttonDisabled: this.buttonDisabled,
|
||||
}
|
||||
}
|
||||
@@ -200,14 +200,14 @@ export class EcrymeConfrontDialog extends HandlebarsApplicationMixin(foundry.app
|
||||
|
||||
rollData.executionTotal = rollData.availableDices
|
||||
.filter(d => d.location === "execution")
|
||||
.reduce((acc, d) => acc + d.result, rollData.skill.value)
|
||||
.reduce((acc, d) => acc + d.result, rollData.skill.max)
|
||||
rollData.executionTotal = rollData.confrontBonus
|
||||
.filter(d => d.location === "execution")
|
||||
.reduce((acc) => acc + 1, rollData.executionTotal)
|
||||
|
||||
rollData.preservationTotal = rollData.availableDices
|
||||
.filter(d => d.location === "preservation")
|
||||
.reduce((acc, d) => acc + d.result, rollData.skill.value)
|
||||
.reduce((acc, d) => acc + d.result, rollData.skill.max)
|
||||
rollData.preservationTotal = rollData.confrontBonus
|
||||
.filter(d => d.location === "preservation")
|
||||
.reduce((acc) => acc + 1, rollData.preservationTotal)
|
||||
@@ -216,7 +216,7 @@ export class EcrymeConfrontDialog extends HandlebarsApplicationMixin(foundry.app
|
||||
|
||||
// Specialization
|
||||
if (rollData.selectedSpecs?.length > 0) {
|
||||
rollData.spec = foundry.utils.duplicate(actor.getSpecialization(rollData.selectedSpecs[0]))
|
||||
rollData.spec = foundry.utils.deepClone(actor.getSpecialization(rollData.selectedSpecs[0]))
|
||||
rollData.specApplied = true
|
||||
rollData.executionTotal += 2
|
||||
rollData.preservationTotal += 2
|
||||
@@ -232,11 +232,11 @@ export class EcrymeConfrontDialog extends HandlebarsApplicationMixin(foundry.app
|
||||
for (const t of rollData.traitsMalus) t.activated = false
|
||||
|
||||
for (const id of (rollData.traitsBonusSelected ?? [])) {
|
||||
const trait = rollData.traitsBonus.find(t => t._id === id)
|
||||
const trait = rollData.traitsBonus.find(t => t.id === id)
|
||||
if (trait) { trait.activated = true; rollData.bonusMalusTraits += Number(trait.system.level) }
|
||||
}
|
||||
for (const id of (rollData.traitsMalusSelected ?? [])) {
|
||||
const trait = rollData.traitsMalus.find(t => t._id === id)
|
||||
const trait = rollData.traitsMalus.find(t => t.id === id)
|
||||
if (trait) { trait.activated = true; rollData.bonusMalusTraits -= Number(trait.system.level) }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user