fix: utiliser skill.value dans les formules de jets (pas skill.max)
Release Creation / build (release) Successful in 40s
Release Creation / build (release) Successful in 40s
- computeRollFormula, computeResults, confrontations utilisent la valeur actuelle - skill.max sert uniquement de plafond et d'affichage
This commit is contained in:
@@ -444,8 +444,8 @@ export class EcrymeActor extends Actor {
|
|||||||
let rollData = this.getCommonSkill(categKey, skillKey)
|
let rollData = this.getCommonSkill(categKey, skillKey)
|
||||||
rollData.mode = "skill"
|
rollData.mode = "skill"
|
||||||
rollData.title = game.i18n.localize("ECRY.ui.confrontation") + " : " + game.i18n.localize(rollData.skill.name)
|
rollData.title = game.i18n.localize("ECRY.ui.confrontation") + " : " + game.i18n.localize(rollData.skill.name)
|
||||||
rollData.executionTotal = rollData.skill.max
|
rollData.executionTotal = rollData.skill.value
|
||||||
rollData.preservationTotal = rollData.skill.max
|
rollData.preservationTotal = rollData.skill.value
|
||||||
rollData.applyTranscendence = "execution"
|
rollData.applyTranscendence = "execution"
|
||||||
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
||||||
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
||||||
@@ -463,8 +463,8 @@ export class EcrymeActor extends Actor {
|
|||||||
rollData.skill.categKey = "cephaly"
|
rollData.skill.categKey = "cephaly"
|
||||||
rollData.skill.skillKey = skillKey
|
rollData.skill.skillKey = skillKey
|
||||||
rollData.title = game.i18n.localize("ECRY.ui.cephaly") + " : " + game.i18n.localize(rollData.skill.name)
|
rollData.title = game.i18n.localize("ECRY.ui.cephaly") + " : " + game.i18n.localize(rollData.skill.name)
|
||||||
rollData.executionTotal = rollData.skill.max
|
rollData.executionTotal = rollData.skill.value
|
||||||
rollData.preservationTotal = rollData.skill.max
|
rollData.preservationTotal = rollData.skill.value
|
||||||
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
||||||
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
||||||
rollData.applyTranscendence = "execution"
|
rollData.applyTranscendence = "execution"
|
||||||
@@ -484,8 +484,8 @@ export class EcrymeActor extends Actor {
|
|||||||
rollData.mode = "weapon"
|
rollData.mode = "weapon"
|
||||||
rollData.weapon = foundry.utils.deepClone(weapon)
|
rollData.weapon = foundry.utils.deepClone(weapon)
|
||||||
rollData.title = game.i18n.localize("ECRY.ui.confrontation") + " : " + game.i18n.localize(rollData.skill.name)
|
rollData.title = game.i18n.localize("ECRY.ui.confrontation") + " : " + game.i18n.localize(rollData.skill.name)
|
||||||
rollData.executionTotal = rollData.skill.max
|
rollData.executionTotal = rollData.skill.value
|
||||||
rollData.preservationTotal = rollData.skill.max
|
rollData.preservationTotal = rollData.skill.value
|
||||||
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsBonus = foundry.utils.deepClone(rollData.traits)
|
||||||
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
rollData.traitsMalus = foundry.utils.deepClone(rollData.traits)
|
||||||
rollData.applyTranscendence = "execution"
|
rollData.applyTranscendence = "execution"
|
||||||
|
|||||||
@@ -229,19 +229,19 @@ export class EcrymeUtility {
|
|||||||
let maxMargin // Dummy max
|
let maxMargin // Dummy max
|
||||||
if (confront.marginExecution > 0) { // Successful hit
|
if (confront.marginExecution > 0) { // Successful hit
|
||||||
// Limit with skill+spec
|
// Limit with skill+spec
|
||||||
maxMargin = confront.rollData1.skill.max + ((confront.rollData1.spec) ? 2 : 0)
|
maxMargin = confront.rollData1.skill.value + ((confront.rollData1.spec) ? 2 : 0)
|
||||||
confront.marginExecution = Math.min(confront.marginExecution, maxMargin)
|
confront.marginExecution = Math.min(confront.marginExecution, maxMargin)
|
||||||
} else { // Failed hit
|
} else { // Failed hit
|
||||||
maxMargin = confront.rollData2.skill.max + ((confront.rollData2.spec) ? 2 : 0)
|
maxMargin = confront.rollData2.skill.value + ((confront.rollData2.spec) ? 2 : 0)
|
||||||
confront.marginExecution = -Math.min(Math.abs(confront.marginExecution), maxMargin)
|
confront.marginExecution = -Math.min(Math.abs(confront.marginExecution), maxMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (confront.marginPreservation > 0) { // Successful defense
|
if (confront.marginPreservation > 0) { // Successful defense
|
||||||
// Limit with skill+spec
|
// Limit with skill+spec
|
||||||
maxMargin = confront.rollData1.skill.max + ((confront.rollData1.spec) ? 2 : 0)
|
maxMargin = confront.rollData1.skill.value + ((confront.rollData1.spec) ? 2 : 0)
|
||||||
confront.marginPreservation = Math.min(confront.marginPreservation, maxMargin)
|
confront.marginPreservation = Math.min(confront.marginPreservation, maxMargin)
|
||||||
} else { // Failed defense
|
} else { // Failed defense
|
||||||
maxMargin = confront.rollData2.skill.max + ((confront.rollData2.spec) ? 2 : 0)
|
maxMargin = confront.rollData2.skill.value + ((confront.rollData2.spec) ? 2 : 0)
|
||||||
confront.marginPreservation = - Math.min(Math.abs(confront.marginPreservation), maxMargin)
|
confront.marginPreservation = - Math.min(Math.abs(confront.marginPreservation), maxMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,7 +551,7 @@ export class EcrymeUtility {
|
|||||||
rollData.margin = rollData.total - rollData.difficulty
|
rollData.margin = rollData.total - rollData.difficulty
|
||||||
if (rollData.total > rollData.difficulty) {
|
if (rollData.total > rollData.difficulty) {
|
||||||
rollData.isSuccess = true
|
rollData.isSuccess = true
|
||||||
let maxMargin = rollData.skill.max + ((rollData.spec) ? 2 : 0)
|
let maxMargin = rollData.skill.value + ((rollData.spec) ? 2 : 0)
|
||||||
rollData.margin = Math.min(rollData.margin, maxMargin)
|
rollData.margin = Math.min(rollData.margin, maxMargin)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -567,7 +567,7 @@ export class EcrymeUtility {
|
|||||||
diceFormula = (isConfrontation) ? "5d6kl2" : "3d6kl2"
|
diceFormula = (isConfrontation) ? "5d6kl2" : "3d6kl2"
|
||||||
}
|
}
|
||||||
if (rollData.skill) {
|
if (rollData.skill) {
|
||||||
diceFormula += "+" + rollData.skill.max
|
diceFormula += "+" + rollData.skill.value
|
||||||
}
|
}
|
||||||
if (rollData.skillTranscendence) {
|
if (rollData.skillTranscendence) {
|
||||||
let toSpend = Math.min(rollData.skillTranscendence, rollData.skill.value)
|
let toSpend = Math.min(rollData.skillTranscendence, rollData.skill.value)
|
||||||
|
|||||||
@@ -200,14 +200,14 @@ export class EcrymeConfrontDialog extends HandlebarsApplicationMixin(foundry.app
|
|||||||
|
|
||||||
rollData.executionTotal = rollData.availableDices
|
rollData.executionTotal = rollData.availableDices
|
||||||
.filter(d => d.location === "execution")
|
.filter(d => d.location === "execution")
|
||||||
.reduce((acc, d) => acc + d.result, rollData.skill.max)
|
.reduce((acc, d) => acc + d.result, rollData.skill.value)
|
||||||
rollData.executionTotal = rollData.confrontBonus
|
rollData.executionTotal = rollData.confrontBonus
|
||||||
.filter(d => d.location === "execution")
|
.filter(d => d.location === "execution")
|
||||||
.reduce((acc) => acc + 1, rollData.executionTotal)
|
.reduce((acc) => acc + 1, rollData.executionTotal)
|
||||||
|
|
||||||
rollData.preservationTotal = rollData.availableDices
|
rollData.preservationTotal = rollData.availableDices
|
||||||
.filter(d => d.location === "preservation")
|
.filter(d => d.location === "preservation")
|
||||||
.reduce((acc, d) => acc + d.result, rollData.skill.max)
|
.reduce((acc, d) => acc + d.result, rollData.skill.value)
|
||||||
rollData.preservationTotal = rollData.confrontBonus
|
rollData.preservationTotal = rollData.confrontBonus
|
||||||
.filter(d => d.location === "preservation")
|
.filter(d => d.location === "preservation")
|
||||||
.reduce((acc) => acc + 1, rollData.preservationTotal)
|
.reduce((acc) => acc + 1, rollData.preservationTotal)
|
||||||
|
|||||||
Reference in New Issue
Block a user