Add optionnal modifier
This commit is contained in:
@@ -495,6 +495,7 @@
|
|||||||
"max": "Max",
|
"max": "Max",
|
||||||
"maximum": "Maximum",
|
"maximum": "Maximum",
|
||||||
"modifier": "Modifier",
|
"modifier": "Modifier",
|
||||||
|
"numericModifier": "Additionnal Modifier",
|
||||||
"multiplier": "Multiplier",
|
"multiplier": "Multiplier",
|
||||||
"newArmor": "New Armor",
|
"newArmor": "New Armor",
|
||||||
"newWeapon": "New Weapon",
|
"newWeapon": "New Weapon",
|
||||||
|
|||||||
@@ -144,6 +144,20 @@ export const MODIFIER_CHOICES = {
|
|||||||
"impossible6": { id: "impossible6", label: "FTLNOMAD.Label.Impossible6", value: "-6" }
|
"impossible6": { id: "impossible6", label: "FTLNOMAD.Label.Impossible6", value: "-6" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const NUMERIC_MODIFIER_CHOICES = {
|
||||||
|
"-5": { label: "-5", value: -5 },
|
||||||
|
"-4": { label: "-4", value: -4 },
|
||||||
|
"-3": { label: "-3", value: -3 },
|
||||||
|
"-2": { label: "-2", value: -2 },
|
||||||
|
"-1": { label: "-1", value: -1 },
|
||||||
|
"0": { label: "0", value: 0 },
|
||||||
|
"+1": { label: "+1", value: 1 },
|
||||||
|
"+2": { label: "+2", value: 2 },
|
||||||
|
"+3": { label: "+3", value: 3 },
|
||||||
|
"+4": { label: "+4", value: 4 },
|
||||||
|
"+5": { label: "+5", value: 5 }
|
||||||
|
}
|
||||||
|
|
||||||
export const STARSHIP_HULL = {
|
export const STARSHIP_HULL = {
|
||||||
"pod": { id: "pod", label: "FTLNOMAD.Starship.Hull.Pod" },
|
"pod": { id: "pod", label: "FTLNOMAD.Starship.Hull.Pod" },
|
||||||
"micro": { id: "micro", label: "FTLNOMAD.Starship.Hull.Micro" },
|
"micro": { id: "micro", label: "FTLNOMAD.Starship.Hull.Micro" },
|
||||||
@@ -163,6 +177,7 @@ export const STARSHIP_HULL = {
|
|||||||
export const SYSTEM = {
|
export const SYSTEM = {
|
||||||
id: SYSTEM_ID,
|
id: SYSTEM_ID,
|
||||||
MODIFIER_CHOICES,
|
MODIFIER_CHOICES,
|
||||||
|
NUMERIC_MODIFIER_CHOICES,
|
||||||
ATTACK_MODIFIERS,
|
ATTACK_MODIFIERS,
|
||||||
TECH_AGES,
|
TECH_AGES,
|
||||||
WEAPON_TYPES,
|
WEAPON_TYPES,
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
fullFormula = `${options.formula} + ${options.damageModifier}D6 `
|
fullFormula = `${options.formula} + ${options.damageModifier}D6 `
|
||||||
} else {
|
} else {
|
||||||
let mod = options.rollItem?.value || 0
|
let mod = options.rollItem?.value || 0
|
||||||
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D`
|
fullFormula = `${options.formula} + ${options.skillModifier}D + ${mod} + ${options.rangeModifier}D + ${options.numericModifier}D + ${options.numericModifierSelect}`
|
||||||
}
|
}
|
||||||
// Replace all the "+ -" with "-"
|
// Replace all the "+ -" with "-"
|
||||||
fullFormula = fullFormula.replace(/\+\s*\-/g, "- ")
|
fullFormula = fullFormula.replace(/\+\s*\-/g, "- ")
|
||||||
@@ -116,6 +116,7 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const choiceModifier = SYSTEM.MODIFIER_CHOICES
|
const choiceModifier = SYSTEM.MODIFIER_CHOICES
|
||||||
|
const choiceNumericModifier = SYSTEM.NUMERIC_MODIFIER_CHOICES
|
||||||
let choiceRangeModifier = {}
|
let choiceRangeModifier = {}
|
||||||
let rangeModifier = 0
|
let rangeModifier = 0
|
||||||
if (options.weapon) {
|
if (options.weapon) {
|
||||||
@@ -129,8 +130,10 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
let damageModifier = "0"
|
let damageModifier = "0"
|
||||||
|
|
||||||
let modifier = "0"
|
let modifier = "0"
|
||||||
|
let numericModifierSelect = 0
|
||||||
options.skillModifier = 0
|
options.skillModifier = 0
|
||||||
options.numericModifier = 0
|
options.numericModifier = 0
|
||||||
|
options.numericModifierSelect = 0
|
||||||
options.rangeModifier = rangeModifier
|
options.rangeModifier = rangeModifier
|
||||||
options.damageModifier = damageModifier
|
options.damageModifier = damageModifier
|
||||||
let fullFormula = `${formula} + ${options.rollItem.value}`
|
let fullFormula = `${formula} + ${options.rollItem.value}`
|
||||||
@@ -152,6 +155,7 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
rollModes,
|
rollModes,
|
||||||
fieldRollMode,
|
fieldRollMode,
|
||||||
choiceModifier,
|
choiceModifier,
|
||||||
|
choiceNumericModifier,
|
||||||
choiceRangeModifier,
|
choiceRangeModifier,
|
||||||
choiceDamageModifier,
|
choiceDamageModifier,
|
||||||
rangeModifier,
|
rangeModifier,
|
||||||
@@ -159,6 +163,7 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
formula,
|
formula,
|
||||||
hasTarget: options.hasTarget,
|
hasTarget: options.hasTarget,
|
||||||
modifier,
|
modifier,
|
||||||
|
numericModifierSelect,
|
||||||
}
|
}
|
||||||
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
|
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-ftl-nomad/templates/roll-dialog.hbs", dialogContext)
|
||||||
|
|
||||||
@@ -189,6 +194,10 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
options.skillModifier = Number(event.target.value)
|
options.skillModifier = Number(event.target.value)
|
||||||
FTLNomadRoll.updateFullFormula(options)
|
FTLNomadRoll.updateFullFormula(options)
|
||||||
})
|
})
|
||||||
|
$(".roll-numeric-modifier").change(event => {
|
||||||
|
options.numericModifierSelect = Number(event.target.value)
|
||||||
|
FTLNomadRoll.updateFullFormula(options)
|
||||||
|
})
|
||||||
$(".roll-damage-modifier").change(event => {
|
$(".roll-damage-modifier").change(event => {
|
||||||
options.damageModifier = Number(event.target.value)
|
options.damageModifier = Number(event.target.value)
|
||||||
FTLNomadRoll.updateFullFormula(options)
|
FTLNomadRoll.updateFullFormula(options)
|
||||||
@@ -223,8 +232,10 @@ export default class FTLNomadRoll extends Roll {
|
|||||||
options.numericModifier = Number(rollData.numericModifier) || 0
|
options.numericModifier = Number(rollData.numericModifier) || 0
|
||||||
options.skillModifier = Number(rollData.skillModifier) || 0
|
options.skillModifier = Number(rollData.skillModifier) || 0
|
||||||
options.rangeModifier = Number(rollData.rangeModifier) || 0
|
options.rangeModifier = Number(rollData.rangeModifier) || 0
|
||||||
|
options.numericModifierSelect = Number(rollData.numericModifierSelect) || 0
|
||||||
options.finalModifier = options.numericModifier + options.skillModifier + options.rangeModifier
|
options.finalModifier = options.numericModifier + options.skillModifier + options.rangeModifier
|
||||||
let mod = options.rollItem?.value || 0
|
let mod = options.rollItem?.value || 0
|
||||||
|
mod += options.numericModifierSelect
|
||||||
|
|
||||||
// Build the dice formula
|
// Build the dice formula
|
||||||
let diceFormula = "2d6"
|
let diceFormula = "2d6"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000099
|
MANIFEST-000103
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2025/10/18-17:56:08.077097 7f7b75bfa6c0 Recovering log #97
|
2025/10/27-20:03:18.716726 7f2a22ffd6c0 Recovering log #101
|
||||||
2025/10/18-17:56:08.086491 7f7b75bfa6c0 Delete type=3 #95
|
2025/10/27-20:03:18.728612 7f2a22ffd6c0 Delete type=3 #99
|
||||||
2025/10/18-17:56:08.086541 7f7b75bfa6c0 Delete type=0 #97
|
2025/10/27-20:03:18.728755 7f2a22ffd6c0 Delete type=0 #101
|
||||||
2025/10/18-18:03:15.510704 7f7b6f3ff6c0 Level-0 table #102: started
|
2025/10/27-20:06:09.635606 7f2a213ff6c0 Level-0 table #106: started
|
||||||
2025/10/18-18:03:15.510749 7f7b6f3ff6c0 Level-0 table #102: 0 bytes OK
|
2025/10/27-20:06:09.635675 7f2a213ff6c0 Level-0 table #106: 0 bytes OK
|
||||||
2025/10/18-18:03:15.548325 7f7b6f3ff6c0 Delete type=0 #100
|
2025/10/27-20:06:09.644064 7f2a213ff6c0 Delete type=0 #104
|
||||||
2025/10/18-18:03:15.624002 7f7b6f3ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
|
2025/10/27-20:06:09.658912 7f2a213ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2025/10/16-19:48:48.571698 7f18a4ffa6c0 Recovering log #93
|
2025/10/18-17:56:08.077097 7f7b75bfa6c0 Recovering log #97
|
||||||
2025/10/16-19:48:48.582163 7f18a4ffa6c0 Delete type=3 #91
|
2025/10/18-17:56:08.086491 7f7b75bfa6c0 Delete type=3 #95
|
||||||
2025/10/16-19:48:48.582233 7f18a4ffa6c0 Delete type=0 #93
|
2025/10/18-17:56:08.086541 7f7b75bfa6c0 Delete type=0 #97
|
||||||
2025/10/16-19:50:49.674486 7f189e7fc6c0 Level-0 table #98: started
|
2025/10/18-18:03:15.510704 7f7b6f3ff6c0 Level-0 table #102: started
|
||||||
2025/10/16-19:50:49.674520 7f189e7fc6c0 Level-0 table #98: 0 bytes OK
|
2025/10/18-18:03:15.510749 7f7b6f3ff6c0 Level-0 table #102: 0 bytes OK
|
||||||
2025/10/16-19:50:49.681475 7f189e7fc6c0 Delete type=0 #96
|
2025/10/18-18:03:15.548325 7f7b6f3ff6c0 Delete type=0 #100
|
||||||
2025/10/16-19:50:49.691929 7f189e7fc6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
|
2025/10/18-18:03:15.624002 7f7b6f3ff6c0 Manual compaction at level-0 from '!folders!AuBtSOj1mJmh88qx' @ 72057594037927935 : 1 .. '!items!zv9dwgL3p7ThQn7j' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000077
|
MANIFEST-000081
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2025/10/18-17:56:08.089616 7f7b6ffff6c0 Recovering log #75
|
2025/10/27-20:03:18.738218 7f2a23fff6c0 Recovering log #79
|
||||||
2025/10/18-17:56:08.099835 7f7b6ffff6c0 Delete type=3 #73
|
2025/10/27-20:03:18.749460 7f2a23fff6c0 Delete type=3 #77
|
||||||
2025/10/18-17:56:08.099933 7f7b6ffff6c0 Delete type=0 #75
|
2025/10/27-20:03:18.749597 7f2a23fff6c0 Delete type=0 #79
|
||||||
2025/10/18-18:03:15.586602 7f7b6f3ff6c0 Level-0 table #80: started
|
2025/10/27-20:06:09.651196 7f2a213ff6c0 Level-0 table #84: started
|
||||||
2025/10/18-18:03:15.586654 7f7b6f3ff6c0 Level-0 table #80: 0 bytes OK
|
2025/10/27-20:06:09.651261 7f2a213ff6c0 Level-0 table #84: 0 bytes OK
|
||||||
2025/10/18-18:03:15.623769 7f7b6f3ff6c0 Delete type=0 #78
|
2025/10/27-20:06:09.658656 7f2a213ff6c0 Delete type=0 #82
|
||||||
2025/10/18-18:03:15.624032 7f7b6f3ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
|
2025/10/27-20:06:09.658955 7f2a213ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2025/10/16-19:48:48.588685 7f189f7fe6c0 Recovering log #71
|
2025/10/18-17:56:08.089616 7f7b6ffff6c0 Recovering log #75
|
||||||
2025/10/16-19:48:48.599841 7f189f7fe6c0 Delete type=3 #69
|
2025/10/18-17:56:08.099835 7f7b6ffff6c0 Delete type=3 #73
|
||||||
2025/10/16-19:48:48.599924 7f189f7fe6c0 Delete type=0 #71
|
2025/10/18-17:56:08.099933 7f7b6ffff6c0 Delete type=0 #75
|
||||||
2025/10/16-19:50:49.586198 7f189e7fc6c0 Level-0 table #76: started
|
2025/10/18-18:03:15.586602 7f7b6f3ff6c0 Level-0 table #80: started
|
||||||
2025/10/16-19:50:49.586239 7f189e7fc6c0 Level-0 table #76: 0 bytes OK
|
2025/10/18-18:03:15.586654 7f7b6f3ff6c0 Level-0 table #80: 0 bytes OK
|
||||||
2025/10/16-19:50:49.598518 7f189e7fc6c0 Delete type=0 #74
|
2025/10/18-18:03:15.623769 7f7b6f3ff6c0 Delete type=0 #78
|
||||||
2025/10/16-19:50:49.610365 7f189e7fc6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
|
2025/10/18-18:03:15.624032 7f7b6f3ff6c0 Manual compaction at level-0 from '!actors!0FQ6XaRi24OorI21' @ 72057594037927935 : 1 .. '!folders!vRnrOJqSMlxbSgyX' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -40,6 +40,10 @@
|
|||||||
<select name="modifier" class="roll-skill-modifier">
|
<select name="modifier" class="roll-skill-modifier">
|
||||||
{{selectOptions choiceModifier selected=modifier localize=true}}
|
{{selectOptions choiceModifier selected=modifier localize=true}}
|
||||||
</select>
|
</select>
|
||||||
|
<label>{{localize "FTLNOMAD.Label.numericModifier"}}</label>
|
||||||
|
<select name="numericModifierSelect" class="roll-numeric-modifier">
|
||||||
|
{{selectOptions choiceNumericModifier selected=numericModifierSelect}}
|
||||||
|
</select>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if (eq rollType "weapon")}}
|
{{#if (eq rollType "weapon")}}
|
||||||
|
|||||||
Reference in New Issue
Block a user