This commit is contained in:
Vendored
+9
-3
@@ -999,9 +999,11 @@ var WeaponDataModel = class extends foundry.abstract.TypeDataModel {
|
||||
const stringField = (initial = "") => new fields.StringField({ required: true, nullable: false, initial });
|
||||
const htmlField = (initial = "") => new fields.HTMLField({ required: true, nullable: false, initial, textSearch: true });
|
||||
const intField = (initial = 0, opts = {}) => new fields.NumberField({ required: true, nullable: false, integer: true, initial, ...opts });
|
||||
const boolField = (initial = false) => new fields.BooleanField({ required: true, initial });
|
||||
return {
|
||||
reference: stringField(""),
|
||||
description: htmlField(""),
|
||||
hasSpeciality: boolField(false),
|
||||
weaponType: stringField("melee"),
|
||||
material: stringField(""),
|
||||
damageAspect: stringField("metal"),
|
||||
@@ -1758,7 +1760,8 @@ async function rollForActor(actor, rollKey) {
|
||||
const wpBonusAusp = Number(wParams.bonusauspiciousdice ?? 0);
|
||||
const wpThrowMode = Number(wParams.typeofthrow ?? 0);
|
||||
const wpDamageBase = wpItem.system.damageBase ?? 0;
|
||||
const wpTotalDice = wpSkillDice + wpAspectDice + wpRangeMalus + wpBonusMalus - wpWoundMalus;
|
||||
const wpSpecialtyBonus = wpItem.system.hasSpeciality ? 1 : 0;
|
||||
const wpTotalDice = wpSkillDice + wpAspectDice + wpRangeMalus + wpBonusMalus - wpWoundMalus + wpSpecialtyBonus;
|
||||
if (wpTotalDice <= 0) {
|
||||
ui.notifications.warn(game.i18n.localize("CDE.Error0"));
|
||||
return;
|
||||
@@ -1774,8 +1777,11 @@ async function rollForActor(actor, rollKey) {
|
||||
if (wpBonusMalus !== 0) wpModParts.push(`${wpBonusMalus > 0 ? "+" : ""}${wpBonusMalus} ${game.i18n.localize("CDE.BonusMalus")}`);
|
||||
if (wpWoundMalus !== 0) wpModParts.push(`-${wpWoundMalus} ${game.i18n.localize("CDE.WoundMalus")}`);
|
||||
if (wpBonusAusp !== 0) wpModParts.push(`+${wpBonusAusp} ${game.i18n.localize("CDE.BonusAuspiciousDice")}`);
|
||||
const wpDamageAspectValue = sys.aspect?.[ASPECT_NAMES[wpAspFinal]]?.value ?? 0;
|
||||
const wpDamageAspectLabel = game.i18n.localize(ASPECT_LABELS[ASPECT_NAMES[wpAspFinal]] ?? "");
|
||||
const wpDamageAspectRaw = wpItem.system.damageAspect ?? "metal";
|
||||
const wpDamageAspectIdx = WEAPON_ASPECT_INDEX[wpDamageAspectRaw] ?? 0;
|
||||
const wpDamageAspectName = ASPECT_NAMES[wpDamageAspectIdx];
|
||||
const wpDamageAspectValue = sys.aspect?.[wpDamageAspectName]?.value ?? 0;
|
||||
const wpDamageAspectLabel = game.i18n.localize(ASPECT_LABELS[wpDamageAspectName] ?? "");
|
||||
const wpMsg = await sendResultMessage(actor, {
|
||||
rollLabel: `${wpItem.name}`,
|
||||
aspectName: wpAspectName,
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user