Rework des fiches creature/PJ et Tinji/Loksyu
This commit is contained in:
+23
-20
@@ -250,6 +250,9 @@ async function sendResultMessage(actor, resultData, roll, rollMode) {
|
||||
content: html,
|
||||
rolls: [roll],
|
||||
rollMode,
|
||||
flags: {
|
||||
"fvtt-chroniques-de-l-etrange": { rollResult: { ...resultData } },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -297,43 +300,43 @@ export async function rollForActor(actor, rollKey) {
|
||||
title = game.i18n.localize(`CDE.${skillLibel.charAt(0).toUpperCase() + skillLibel.slice(1)}`)
|
||||
break
|
||||
case "skill":
|
||||
numberofdice = sys.skills[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.skills[skillLibel]?.label ?? "CDE.Roll")
|
||||
numberofdice = sys.skills?.[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.skills?.[skillLibel]?.label ?? "CDE.Roll")
|
||||
break
|
||||
case "special":
|
||||
numberofdice = sys.skills[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.skills[skillLibel]?.label ?? "CDE.Roll")
|
||||
numberofdice = sys.skills?.[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.skills?.[skillLibel]?.label ?? "CDE.Roll")
|
||||
title += ` [${game.i18n.localize("CDE.Speciality")}]`
|
||||
isSpecial = true
|
||||
if (!sys.skills[skillLibel]?.specialities) {
|
||||
if (!sys.skills?.[skillLibel]?.specialities) {
|
||||
ui.notifications.warn(game.i18n.localize("CDE.Error2"))
|
||||
return
|
||||
}
|
||||
break
|
||||
case "resource":
|
||||
numberofdice = sys.resources[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.resources[skillLibel]?.label ?? "CDE.Roll")
|
||||
numberofdice = sys.resources?.[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.resources?.[skillLibel]?.label ?? "CDE.Roll")
|
||||
break
|
||||
case "field":
|
||||
numberofdice = sys.resources[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.resources[skillLibel]?.label ?? "CDE.Roll")
|
||||
numberofdice = sys.resources?.[skillLibel]?.value ?? 0
|
||||
title = game.i18n.localize(sys.resources?.[skillLibel]?.label ?? "CDE.Roll")
|
||||
title += ` [${game.i18n.localize("CDE.Field")}]`
|
||||
isSpecial = true
|
||||
if (!sys.resources[skillLibel]?.specialities) {
|
||||
if (!sys.resources?.[skillLibel]?.specialities) {
|
||||
ui.notifications.warn(game.i18n.localize("CDE.Error4"))
|
||||
return
|
||||
}
|
||||
break
|
||||
case "magic":
|
||||
numberofdice = sys.magics[skillLibel]?.value ?? 0
|
||||
numberofdice = sys.magics?.[skillLibel]?.value ?? 0
|
||||
isMagic = true
|
||||
title = game.i18n.localize(MAGIC_I18N_KEYS[skillLibel] ?? "CDE.Magics")
|
||||
break
|
||||
case "magicspecial":
|
||||
numberofdice = sys.magics[skillLibel]?.value ?? 0
|
||||
numberofdice = sys.magics?.[skillLibel]?.value ?? 0
|
||||
isMagicSpecial = true
|
||||
isMagic = true
|
||||
if (!sys.magics[skillLibel]?.speciality?.[specialLibel]?.check) {
|
||||
if (!sys.magics?.[skillLibel]?.speciality?.[specialLibel]?.check) {
|
||||
ui.notifications.warn(game.i18n.localize("CDE.Error6"))
|
||||
return
|
||||
}
|
||||
@@ -344,8 +347,8 @@ export async function rollForActor(actor, rollKey) {
|
||||
const kfItem = actor.items.get(skillLibel)
|
||||
if (!kfItem) { ui.notifications.warn(game.i18n.localize("CDE.Error0")); return }
|
||||
const kfSkill = kfItem.system.skill ?? "kungfu"
|
||||
numberofdice = sys.skills[kfSkill]?.value ?? 0
|
||||
title = `${kfItem.name} [${game.i18n.localize(sys.skills[kfSkill]?.label ?? "CDE.KungFu")}]`
|
||||
numberofdice = sys.skills?.[kfSkill]?.value ?? 0
|
||||
title = `${kfItem.name} [${game.i18n.localize(sys.skills?.[kfSkill]?.label ?? "CDE.KungFu")}]`
|
||||
kfDefaultAspect = ASPECT_NAMES.indexOf(kfItem.system.aspect ?? "metal")
|
||||
if (kfDefaultAspect < 0) kfDefaultAspect = 0
|
||||
break
|
||||
@@ -357,7 +360,7 @@ export async function rollForActor(actor, rollKey) {
|
||||
|
||||
const wpType = wpItem.system.weaponType ?? "melee"
|
||||
const wpSkill = WEAPON_TYPE_SKILL[wpType] ?? "kungfu"
|
||||
numberofdice = sys.skills[wpSkill]?.value ?? 0
|
||||
numberofdice = sys.skills?.[wpSkill]?.value ?? 0
|
||||
|
||||
const wpAspectRaw = wpItem.system.damageAspect ?? "metal"
|
||||
const wpAspectIdx = WEAPON_ASPECT_INDEX[wpAspectRaw] ?? 0
|
||||
@@ -372,7 +375,7 @@ export async function rollForActor(actor, rollKey) {
|
||||
|
||||
// Show weapon-specific prompt
|
||||
const wParams = await showWeaponPrompt({
|
||||
title: `${wpItem.name} [${game.i18n.localize(sys.skills[wpSkill]?.label ?? "CDE.WeaponRoll")}]`,
|
||||
title: `${wpItem.name} [${game.i18n.localize(sys.skills?.[wpSkill]?.label ?? "CDE.WeaponRoll")}]`,
|
||||
numberofdice,
|
||||
weaponName: wpItem.name,
|
||||
weaponTypeLabel: WEAPON_TYPE_LABELS[wpType] ?? "CDE.Weapon",
|
||||
@@ -392,7 +395,7 @@ export async function rollForActor(actor, rollKey) {
|
||||
|
||||
// Resolve final pool from weapon prompt values
|
||||
const wpChosenSkill = wParams.weaponskill ?? wpSkill
|
||||
const wpSkillDice = sys.skills[wpChosenSkill]?.value ?? 0
|
||||
const wpSkillDice = sys.skills?.[wpChosenSkill]?.value ?? 0
|
||||
const wpAspFinal = Number(wParams.aspect ?? wpAspectIdx)
|
||||
const wpAspectDice = sys.aspect[ASPECT_NAMES[wpAspFinal]]?.value ?? 0
|
||||
const wpRangeMalus = RANGE_MALUS[wParams.effectiverange ?? "contact"] ?? 0
|
||||
@@ -537,7 +540,7 @@ export async function rollForActor(actor, rollKey) {
|
||||
rollDifficulty = Math.max(1, Number(params.rolldifficulty ?? 1))
|
||||
throwMode = Number(params.typeofthrow ?? 0)
|
||||
// magic: magic skill + aspect + bonuses + 1 (speciality base) + HEI spent
|
||||
const aspectDice = sys.aspect[ASPECT_NAMES[aspectIndex]]?.value ?? 0
|
||||
const aspectDice = sys.aspect?.[ASPECT_NAMES[aspectIndex]]?.value ?? 0
|
||||
const bonusSpec = Number(params.bonusmalusspeciality ?? 0)
|
||||
const heiDice = Number(params.heispend ?? 0)
|
||||
numberofdice = numberofdice + aspectDice + bonusMalus + 1 + bonusSpec + heiDice
|
||||
@@ -549,7 +552,7 @@ export async function rollForActor(actor, rollKey) {
|
||||
throwMode = Number(params.typeofthrow ?? 0)
|
||||
|
||||
const aspectDice = (typeLibel !== "aspect")
|
||||
? (sys.aspect[ASPECT_NAMES[aspectIndex]]?.value ?? 0)
|
||||
? (sys.aspect?.[ASPECT_NAMES[aspectIndex]]?.value ?? 0)
|
||||
: 0
|
||||
|
||||
numberofdice = numberofdice + aspectDice + bonusMalus - woundMalus
|
||||
|
||||
Reference in New Issue
Block a user