From f96141c6c7849cdbfba56c0b30ae92c157fc9960 Mon Sep 17 00:00:00 2001 From: Jeff Hitchcock Date: Sun, 4 Aug 2024 11:01:19 -0700 Subject: [PATCH] [#3912] Add `DamageActivity` & `HealingActivity` data & sheets Two simple activity types for apply damage (e.g. Magic Missile) and healing (e.g. Healing Word) without any other rolls invovled. `DamageActivity` stores an array of damage parts just like the other damaging activities and has a setting for indicating whether critical damage can be rolled. `HealingActivity` only contains a single healing part and no other options. Note: Does not contain any functionality for rolling. --- icons/LICENSE | 2 + icons/svg/activity/damage.svg | 6 + icons/svg/activity/healing.svg | 6 + lang/en.json | 150 +++++++++++++----- module/applications/activity/_module.mjs | 2 + .../applications/activity/activity-sheet.mjs | 2 + module/applications/activity/attack-sheet.mjs | 1 + module/applications/activity/damage-sheet.mjs | 28 ++++ .../applications/activity/healing-sheet.mjs | 40 +++++ module/applications/activity/save-sheet.mjs | 1 + module/config.mjs | 6 + module/data/activity/_module.mjs | 2 + module/data/activity/damage-data.mjs | 24 +++ module/data/activity/healing-data.mjs | 17 ++ module/data/shared/damage-field.mjs | 5 - module/documents/activity/_module.mjs | 2 + module/documents/activity/damage.mjs | 27 ++++ module/documents/activity/healing.mjs | 27 ++++ module/documents/activity/mixin.mjs | 4 +- templates/activity/damage-effect.hbs | 4 + templates/activity/healing-effect.hbs | 4 + templates/activity/parts/attack-damage.hbs | 2 +- templates/activity/parts/damage-damage.hbs | 5 + templates/activity/parts/damage-part.hbs | 49 ++++++ templates/activity/parts/damage-parts.hbs | 50 +----- templates/activity/parts/healing-damage.hbs | 5 + templates/activity/parts/save-damage.hbs | 2 +- 27 files changed, 377 insertions(+), 96 deletions(-) create mode 100644 icons/svg/activity/damage.svg create mode 100644 icons/svg/activity/healing.svg create mode 100644 module/applications/activity/damage-sheet.mjs create mode 100644 module/applications/activity/healing-sheet.mjs create mode 100644 module/data/activity/damage-data.mjs create mode 100644 module/data/activity/healing-data.mjs create mode 100644 module/documents/activity/damage.mjs create mode 100644 module/documents/activity/healing.mjs create mode 100644 templates/activity/damage-effect.hbs create mode 100644 templates/activity/healing-effect.hbs create mode 100644 templates/activity/parts/damage-damage.hbs create mode 100644 templates/activity/parts/damage-part.hbs create mode 100644 templates/activity/parts/healing-damage.hbs diff --git a/icons/LICENSE b/icons/LICENSE index 4208bec0aa..6c74291066 100644 --- a/icons/LICENSE +++ b/icons/LICENSE @@ -28,6 +28,8 @@ The dnd5e system for Foundry Virtual Tabletop includes icon artwork licensed fro /svg/vehicle.svg - "Ship's wheel" by Delapouite under CC BY 3.0 /svg/versatile.svg - "Swiss army knife" by Delapouite under CC BY 3.0 /svg/activity/attack.svg - "Sword clash" by Lorc under CC BY 3.0 +/svg/activity/damage.svg - "Earth spit" by Lorc under CC BY 3.0 +/svg/activity/healing.svg - "Health increase" by sbed under CC BY 3.0 /svg/activity/save.svg - "Shield reflect" by Lorc under CC BY 3.0 /svg/activity/summon.svg - "Pentagram rose" by Lorc under CC BY 3.0 /svg/activity/utility.svg - "Spanner" by Lorc under CC BY 3.0 diff --git a/icons/svg/activity/damage.svg b/icons/svg/activity/damage.svg new file mode 100644 index 0000000000..8402daa043 --- /dev/null +++ b/icons/svg/activity/damage.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/icons/svg/activity/healing.svg b/icons/svg/activity/healing.svg new file mode 100644 index 0000000000..edf1349636 --- /dev/null +++ b/icons/svg/activity/healing.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/lang/en.json b/lang/en.json index ac3881f89d..b15c4fb69e 100644 --- a/lang/en.json +++ b/lang/en.json @@ -936,48 +936,63 @@ "Half": "Half" } }, + "DND5E.DAMAGE": { + "Title": "Damage", "FIELDS": { - "number": { - "label": "Die Number", - "hint": "Number of dice to roll." - }, - "denomination": { - "label": "Die Denomination", - "hint": "Denomination of the dice to roll." - }, - "bonus": { - "label": "Damage Bonus", - "hint": "Bonus added to the damage roll." - }, - "types": { - "label": "Damage Types", - "hint": "Type of damage inflicted or multiple for the user to select from." - }, - "custom": { - "label": "Custom Damage Formula", - "enabled": { - "label": "Enable Custom Formula", - "hint": "Should the custom formula be used rather than the default dice." - }, - "formula": { - "label": "Damage Formula", - "hint": "Custom damage formula." - } - }, - "scaling": { - "label": "Damage Scaling", - "mode": { - "label": "Scaling Mode", - "hint": "Method by which the scaling increase is calculated." - }, - "number": { - "label": "Dice Scaling", - "hint": "Number of dice to increase for each scaling step. Will be applied to the first die found in the damage formula if more than one is present." + "damage": { + "label": "Damage", + "allowCritical": { + "label": "Allow Critical", + "hint": "Should the use be able to roll critical damage?" }, - "formula": { - "label": "Scaling Formula", - "hint": "Arbitrary scaling formula that will be multiplied for each scaling step and added to the original formula." + "parts": { + "label": "Damage Parts", + "hint": "Individual damage parts to include with the roll.", + "FIELDS": { + "bonus": { + "label": "Damage Bonus", + "hint": "Bonus added to the damage roll." + }, + "custom": { + "label": "Custom Damage Formula", + "enabled": { + "label": "Enable Custom Formula", + "hint": "Should the custom formula be used rather than the default dice." + }, + "formula": { + "label": "Damage Formula", + "hint": "Custom damage formula." + } + }, + "denomination": { + "label": "Die Denomination", + "hint": "Denomination of the dice to roll." + }, + "number": { + "label": "Die Number", + "hint": "Number of dice to roll." + }, + "scaling": { + "label": "Damage Scaling", + "mode": { + "label": "Scaling Mode", + "hint": "Method by which the scaling increase is calculated." + }, + "number": { + "label": "Dice Scaling", + "hint": "Number of dice to increase for each scaling step. Will be applied to the first die found in the damage formula if more than one is present." + }, + "formula": { + "label": "Scaling Formula", + "hint": "Arbitrary scaling formula that will be multiplied for each scaling step and added to the original formula." + } + }, + "types": { + "label": "Damage Types", + "hint": "Type of damage inflicted or multiple for the user to select from." + } + } } } }, @@ -993,6 +1008,7 @@ "Whole": "Every Level" } }, + "DND5E.DamImm": "Damage Immunities", "DND5E.DamMod": "Damage Modification", "DND5E.DamRes": "Damage Resistances", @@ -1401,6 +1417,58 @@ }, "DND5E.Hair": "Hair", "DND5E.HalfProficient": "Half Proficient", + +"DND5E.HEALING": { + "Title": "Healing", + "FIELDS": { + "healing": { + "label": "Healing", + "bonus": { + "label": "Healing Bonus", + "hint": "Bonus added to the healing roll." + }, + "custom": { + "label": "Custom Healing Formula", + "enabled": { + "label": "Enable Custom Formula", + "hint": "Should the custom formula be used rather than the default dice." + }, + "formula": { + "label": "Healing Formula", + "hint": "Custom healing formula." + } + }, + "denomination": { + "label": "Die Denomination", + "hint": "Denomination of the dice to roll." + }, + "number": { + "label": "Die Number", + "hint": "Number of dice to roll." + }, + "scaling": { + "label": "Healing Scaling", + "mode": { + "label": "Scaling Mode", + "hint": "Method by which the scaling increase is calculated." + }, + "number": { + "label": "Dice Scaling", + "hint": "Number of dice to increase for each scaling step. Will be applied to the first die found in the healing formula if more than one is present." + }, + "formula": { + "label": "Scaling Formula", + "hint": "Arbitrary scaling formula that will be multiplied for each scaling step and added to the original formula." + } + }, + "types": { + "label": "Healing Types", + "hint": "Type of healing inflicted or multiple for the user to select from." + } + } + } +}, + "DND5E.Healing": "Healing", "DND5E.HealingRoll": "Healing Roll", "DND5E.HealingTemp": "Healing (Temporary)", @@ -1813,6 +1881,10 @@ "Full": "Full Damage", "Half": "Half Damage", "None": "No Damage" + }, + "parts": { + "label": "Damage Parts", + "hint": "Individual damage parts to include with the roll." } }, "save": { diff --git a/module/applications/activity/_module.mjs b/module/applications/activity/_module.mjs index c731d5c8de..a3f2e17cd4 100644 --- a/module/applications/activity/_module.mjs +++ b/module/applications/activity/_module.mjs @@ -1,6 +1,8 @@ export {default as ActivitySheet} from "./activity-sheet.mjs"; export {default as AttackSheet} from "./attack-sheet.mjs"; +export {default as DamageSheet} from "./damage-sheet.mjs"; export {default as EnchantSheet} from "./enchant-sheet.mjs"; +export {default as HealingSheet} from "./healing-sheet.mjs"; export {default as SummonSheet} from "./summon-sheet.mjs"; export {default as UtilitySheet} from "./utility-sheet.mjs"; diff --git a/module/applications/activity/activity-sheet.mjs b/module/applications/activity/activity-sheet.mjs index 0bc76e987a..3f95ce150a 100644 --- a/module/applications/activity/activity-sheet.mjs +++ b/module/applications/activity/activity-sheet.mjs @@ -548,6 +548,7 @@ export default class ActivitySheet extends Application5e { * @param {HTMLElement} target Button that was clicked. */ static async #addEffect(event, target) { + if ( !this.activity.effects ) return; const effectData = this._addEffectData(); const [created] = await this.item.createEmbeddedDocuments("ActiveEffect", [effectData]); this.activity.update({ effects: [...this.activity.toObject().effects, { _id: created.id }] }); @@ -629,6 +630,7 @@ export default class ActivitySheet extends Application5e { * @param {HTMLElement} target Button that was clicked. */ static async #deleteEffect(event, target) { + if ( !this.activity.effects ) return; const effectId = target.closest("[data-effect-id]")?.dataset.effectId; const result = await this.item.effects.get(effectId)?.deleteDialog(); if ( result instanceof ActiveEffect ) { diff --git a/module/applications/activity/attack-sheet.mjs b/module/applications/activity/attack-sheet.mjs index 9f7ef8afd6..645a3f35c2 100644 --- a/module/applications/activity/attack-sheet.mjs +++ b/module/applications/activity/attack-sheet.mjs @@ -28,6 +28,7 @@ export default class AttackSheet extends ActivitySheet { ...super.PARTS.effect.templates, "systems/dnd5e/templates/activity/parts/attack-damage.hbs", "systems/dnd5e/templates/activity/parts/attack-details.hbs", + "systems/dnd5e/templates/activity/parts/damage-part.hbs", "systems/dnd5e/templates/activity/parts/damage-parts.hbs" ] } diff --git a/module/applications/activity/damage-sheet.mjs b/module/applications/activity/damage-sheet.mjs new file mode 100644 index 0000000000..099ddd9556 --- /dev/null +++ b/module/applications/activity/damage-sheet.mjs @@ -0,0 +1,28 @@ +import ActivitySheet from "./activity-sheet.mjs"; + +/** + * Sheet for the damage activity. + */ +export default class DamageSheet extends ActivitySheet { + + /** @inheritDoc */ + static DEFAULT_OPTIONS = { + classes: ["damage-activity"] + }; + + /* -------------------------------------------- */ + + /** @inheritDoc */ + static PARTS = { + ...super.PARTS, + effect: { + template: "systems/dnd5e/templates/activity/damage-effect.hbs", + templates: [ + ...super.PARTS.effect.templates, + "systems/dnd5e/templates/activity/parts/damage-damage.hbs", + "systems/dnd5e/templates/activity/parts/damage-part.hbs", + "systems/dnd5e/templates/activity/parts/damage-parts.hbs" + ] + } + }; +} diff --git a/module/applications/activity/healing-sheet.mjs b/module/applications/activity/healing-sheet.mjs new file mode 100644 index 0000000000..068daf0203 --- /dev/null +++ b/module/applications/activity/healing-sheet.mjs @@ -0,0 +1,40 @@ +import ActivitySheet from "./activity-sheet.mjs"; + +/** + * Sheet for the healing activity. + */ +export default class HealingSheet extends ActivitySheet { + + /** @inheritDoc */ + static DEFAULT_OPTIONS = { + classes: ["healing-activity"] + }; + + /* -------------------------------------------- */ + + /** @inheritDoc */ + static PARTS = { + ...super.PARTS, + effect: { + template: "systems/dnd5e/templates/activity/healing-effect.hbs", + templates: [ + ...super.PARTS.effect.templates, + "systems/dnd5e/templates/activity/parts/damage-part.hbs", + "systems/dnd5e/templates/activity/parts/healing-damage.hbs" + ] + } + }; + + /* -------------------------------------------- */ + /* Rendering */ + /* -------------------------------------------- */ + + /** @inheritDoc */ + async _prepareEffectContext(context) { + context = await super._prepareEffectContext(context); + context.typeOptions = Object.entries(CONFIG.DND5E.healingTypes).map(([value, config]) => ({ + value, label: config.label, selected: context.activity.healing.types.has(value) + })); + return context; + } +} diff --git a/module/applications/activity/save-sheet.mjs b/module/applications/activity/save-sheet.mjs index 8d684a55f4..d4d8fb3fae 100644 --- a/module/applications/activity/save-sheet.mjs +++ b/module/applications/activity/save-sheet.mjs @@ -19,6 +19,7 @@ export default class AttackSheet extends ActivitySheet { template: "systems/dnd5e/templates/activity/save-effect.hbs", templates: [ ...super.PARTS.effect.templates, + "systems/dnd5e/templates/activity/parts/damage-part.hbs", "systems/dnd5e/templates/activity/parts/damage-parts.hbs", "systems/dnd5e/templates/activity/parts/save-damage.hbs", "systems/dnd5e/templates/activity/parts/save-details.hbs", diff --git a/module/config.mjs b/module/config.mjs index 645729c240..2a66e79e62 100644 --- a/module/config.mjs +++ b/module/config.mjs @@ -3236,9 +3236,15 @@ DND5E.activityTypes = { attack: { documentClass: activities.AttackActivity }, + damage: { + documentClass: activities.DamageActivity + }, enchant: { documentClass: activities.EnchantActivity }, + healing: { + documentClass: activities.HealingActivity + }, save: { documentClass: activities.SaveActivity }, diff --git a/module/data/activity/_module.mjs b/module/data/activity/_module.mjs index c65af89ff9..36e32ab5f3 100644 --- a/module/data/activity/_module.mjs +++ b/module/data/activity/_module.mjs @@ -1,7 +1,9 @@ export {default as BaseActivityData} from "./base-activity.mjs"; export {default as AttackActivityData} from "./attack-data.mjs"; +export {default as DamageActivityData} from "./damage-data.mjs"; export {default as EnchantActivityData} from "./enchant-data.mjs"; +export {default as HealingActivityData} from "./healing-data.mjs"; export {default as SaveActivityData} from "./save-data.mjs"; export {default as SummonActivityData} from "./summon-data.mjs"; export {default as UtilityActivityData} from "./utility-data.mjs"; diff --git a/module/data/activity/damage-data.mjs b/module/data/activity/damage-data.mjs new file mode 100644 index 0000000000..21e8bb3fa2 --- /dev/null +++ b/module/data/activity/damage-data.mjs @@ -0,0 +1,24 @@ +import DamageField from "../shared/damage-field.mjs"; +import BaseActivityData from "./base-activity.mjs"; + +const { ArrayField, BooleanField, SchemaField } = foundry.data.fields; + +/** + * Data model for an damage activity. + * + * @property {object} damage + * @property {boolean} damage.allowCritical Can this damage be critical? + * @property {DamageData[]} damage.parts Parts of damage to inflict. + */ +export default class DamageActivityData extends BaseActivityData { + /** @inheritDoc */ + static defineSchema() { + return { + ...super.defineSchema(), + damage: new SchemaField({ + allowCritical: new BooleanField(), + parts: new ArrayField(new DamageField()) + }) + }; + } +} diff --git a/module/data/activity/healing-data.mjs b/module/data/activity/healing-data.mjs new file mode 100644 index 0000000000..b3f2e535f1 --- /dev/null +++ b/module/data/activity/healing-data.mjs @@ -0,0 +1,17 @@ +import DamageField from "../shared/damage-field.mjs"; +import BaseActivityData from "./base-activity.mjs"; + +/** + * Data model for an healing activity. + * + * @property {DamageData} healing + */ +export default class HealingActivityData extends BaseActivityData { + /** @inheritDoc */ + static defineSchema() { + return { + ...super.defineSchema(), + healing: new DamageField() + }; + } +} diff --git a/module/data/shared/damage-field.mjs b/module/data/shared/damage-field.mjs index bd00816134..76d81619df 100644 --- a/module/data/shared/damage-field.mjs +++ b/module/data/shared/damage-field.mjs @@ -35,11 +35,6 @@ export class DamageData extends foundry.abstract.DataModel { /* Model Configuration */ /* -------------------------------------------- */ - /** @override */ - static LOCALIZATION_PREFIXES = ["DND5E.DAMAGE"]; - - /* -------------------------------------------- */ - /** @override */ static defineSchema() { return { diff --git a/module/documents/activity/_module.mjs b/module/documents/activity/_module.mjs index de7c2ebe94..7d63adce34 100644 --- a/module/documents/activity/_module.mjs +++ b/module/documents/activity/_module.mjs @@ -1,7 +1,9 @@ export {default as ActivityMixin} from "./mixin.mjs"; export {default as AttackActivity} from "./attack.mjs"; +export {default as DamageActivity} from "./damage.mjs"; export {default as EnchantActivity} from "./enchant.mjs"; +export {default as HealingActivity} from "./healing.mjs"; export {default as SaveActivity} from "./save.mjs"; export {default as SummonActivity} from "./summon.mjs"; export {default as UtilityActivity} from "./utility.mjs"; diff --git a/module/documents/activity/damage.mjs b/module/documents/activity/damage.mjs new file mode 100644 index 0000000000..38e007a55d --- /dev/null +++ b/module/documents/activity/damage.mjs @@ -0,0 +1,27 @@ +import DamageSheet from "../../applications/activity/damage-sheet.mjs"; +import DamageActivityData from "../../data/activity/damage-data.mjs"; +import ActivityMixin from "./mixin.mjs"; + +/** + * Activity for rolling damage. + */ +export default class DamageActivity extends ActivityMixin(DamageActivityData) { + /* -------------------------------------------- */ + /* Model Configuration */ + /* -------------------------------------------- */ + + /** @inheritDoc */ + static LOCALIZATION_PREFIXES = [...super.LOCALIZATION_PREFIXES, "DND5E.DAMAGE"]; + + /* -------------------------------------------- */ + + /** @inheritDoc */ + static metadata = Object.freeze( + foundry.utils.mergeObject(super.metadata, { + type: "damage", + img: "systems/dnd5e/icons/svg/activity/damage.svg", + title: "DND5E.DAMAGE.Title", + sheetClass: DamageSheet + }, { inplace: false }) + ); +} diff --git a/module/documents/activity/healing.mjs b/module/documents/activity/healing.mjs new file mode 100644 index 0000000000..6be4564667 --- /dev/null +++ b/module/documents/activity/healing.mjs @@ -0,0 +1,27 @@ +import HealingSheet from "../../applications/activity/healing-sheet.mjs"; +import HealingActivityData from "../../data/activity/healing-data.mjs"; +import ActivityMixin from "./mixin.mjs"; + +/** + * Activity for rolling healing. + */ +export default class HealingActivity extends ActivityMixin(HealingActivityData) { + /* -------------------------------------------- */ + /* Model Configuration */ + /* -------------------------------------------- */ + + /** @inheritDoc */ + static LOCALIZATION_PREFIXES = [...super.LOCALIZATION_PREFIXES, "DND5E.HEALING"]; + + /* -------------------------------------------- */ + + /** @inheritDoc */ + static metadata = Object.freeze( + foundry.utils.mergeObject(super.metadata, { + type: "healing", + img: "systems/dnd5e/icons/svg/activity/healing.svg", + title: "DND5E.HEALING.Title", + sheetClass: HealingSheet + }, { inplace: false }) + ); +} diff --git a/module/documents/activity/mixin.mjs b/module/documents/activity/mixin.mjs index 82f97abbf0..0b0499e282 100644 --- a/module/documents/activity/mixin.mjs +++ b/module/documents/activity/mixin.mjs @@ -39,7 +39,9 @@ export default Base => class extends PseudoDocumentMixin(Base) { static localize() { Localization.localizeDataModel(this); const fields = this.schema.fields; - if ( fields.damage?.fields.parts ) this._localizeSchema(fields.damage.fields.parts.element, ["DND5E.DAMAGE"]); + if ( fields.damage?.fields.parts ) { + this._localizeSchema(fields.damage.fields.parts.element, ["DND5E.DAMAGE.FIELDS.damage.parts"]); + } this._localizeSchema(fields.consumption.fields.targets.element, ["DND5E.ACTIVITY.FIELDS.consumption.targets"]); this._localizeSchema(fields.uses.fields.recovery.element, ["DND5E.USES.FIELDS.uses.recovery"]); } diff --git a/templates/activity/damage-effect.hbs b/templates/activity/damage-effect.hbs new file mode 100644 index 0000000000..9d21aec125 --- /dev/null +++ b/templates/activity/damage-effect.hbs @@ -0,0 +1,4 @@ +
+ {{> "systems/dnd5e/templates/activity/parts/damage-damage.hbs" }} + {{> "systems/dnd5e/templates/activity/parts/activity-effects.hbs" }} +
diff --git a/templates/activity/healing-effect.hbs b/templates/activity/healing-effect.hbs new file mode 100644 index 0000000000..6dc06486fa --- /dev/null +++ b/templates/activity/healing-effect.hbs @@ -0,0 +1,4 @@ +
+ {{> "systems/dnd5e/templates/activity/parts/healing-damage.hbs" }} + {{> "systems/dnd5e/templates/activity/parts/activity-effects.hbs" }} +
diff --git a/templates/activity/parts/attack-damage.hbs b/templates/activity/parts/attack-damage.hbs index 1f6eb43b06..af0b8f96c2 100644 --- a/templates/activity/parts/attack-damage.hbs +++ b/templates/activity/parts/attack-damage.hbs @@ -3,5 +3,5 @@ {{#if hasBaseDamage}} {{ formField fields.damage.fields.includeBase value=source.damage.includeBase }} {{/if}} - {{> "systems/dnd5e/templates/activity/parts/damage-parts.hbs"}} + {{> "systems/dnd5e/templates/activity/parts/damage-parts.hbs" }} diff --git a/templates/activity/parts/damage-damage.hbs b/templates/activity/parts/damage-damage.hbs new file mode 100644 index 0000000000..f30902e3a2 --- /dev/null +++ b/templates/activity/parts/damage-damage.hbs @@ -0,0 +1,5 @@ +
+ {{ localize "DND5E.DAMAGE.FIELDS.damage.label" }} + {{ formField fields.damage.fields.allowCritical value=source.damage.allowCritical }} + {{> "systems/dnd5e/templates/activity/parts/damage-parts.hbs" }} +
diff --git a/templates/activity/parts/damage-part.hbs b/templates/activity/parts/damage-part.hbs new file mode 100644 index 0000000000..e50838261b --- /dev/null +++ b/templates/activity/parts/damage-part.hbs @@ -0,0 +1,49 @@ +
+ {{ formInput fields.custom.fields.enabled name=(concat prefix "custom.enabled") + value=data.custom.enabled }} + {{#unless data.custom.enabled}} + + {{ formField fields.number name=(concat prefix "number") value=data.number stacked=true hint=false }} + d + {{ formField fields.denomination name=(concat prefix "denomination") value=data.denomination + options=denominationOptions stacked=true hint=false }} + + + {{ formField fields.bonus name=(concat prefix "bonus") value=data.bonus stacked=true hint=false }} + + + {{else}} + + {{ formField fields.custom.fields.formula name=(concat prefix "custom.formula") + value=data.custom.formula stacked=true hint=false }} + + + + + {{/unless}} + {{#unless singleton}} +
+ +
+ {{/unless}} +
+ +{{ formField fields.types name=(concat prefix "types") value=data.types options=typeOptions hint=false }} + +{{#if canScale}} +{{#with fields.scaling.fields as |fields|}} +
+ {{ formField fields.mode name=(concat ../prefix "scaling.mode") value=../data.scaling.mode + options=../scalingOptions stacked=true hint=false }} + {{#if ../data.scaling.mode}} + {{ formField fields.number name=(concat ../prefix "scaling.number") value=../data.scaling.number + stacked=true hint=false }} + {{ formField fields.formula name=(concat ../prefix "scaling.formula") value=../data.scaling.formula + stacked=true hint=false }} + {{/if}} +
+{{/with}} +{{/if}} diff --git a/templates/activity/parts/damage-parts.hbs b/templates/activity/parts/damage-parts.hbs index acdb8aad51..c66c731936 100644 --- a/templates/activity/parts/damage-parts.hbs +++ b/templates/activity/parts/damage-parts.hbs @@ -1,55 +1,7 @@ diff --git a/templates/activity/parts/healing-damage.hbs b/templates/activity/parts/healing-damage.hbs new file mode 100644 index 0000000000..821872de4a --- /dev/null +++ b/templates/activity/parts/healing-damage.hbs @@ -0,0 +1,5 @@ +
+ {{ localize "DND5E.HEALING.FIELDS.healing.label" }} + {{> "systems/dnd5e/templates/activity/parts/damage-part.hbs" singleton=true + fields=fields.healing.fields data=source.healing prefix="healing." }} +
diff --git a/templates/activity/parts/save-damage.hbs b/templates/activity/parts/save-damage.hbs index 0e94167694..a1c1ce9291 100644 --- a/templates/activity/parts/save-damage.hbs +++ b/templates/activity/parts/save-damage.hbs @@ -1,5 +1,5 @@
{{ localize "DND5E.SAVE.FIELDS.damage.label" }} {{ formField fields.damage.fields.onSave value=source.damage.onSave options=onSaveOptions }} - {{> "systems/dnd5e/templates/activity/parts/damage-parts.hbs"}} + {{> "systems/dnd5e/templates/activity/parts/damage-parts.hbs" }}