diff --git a/lang/en.json b/lang/en.json index 3a1340e0..a853d5f9 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1281,6 +1281,13 @@ "diceValue": "Dice Value", "die": "Die" }, + "OutcomeType": { + "default": "Default Outcome", + "successHope": "Success/ Hope", + "successFear": "Success/ Fear", + "failureHope": "Failure/ Hope", + "failureFear": "Failure/ Fear" + }, "Range": { "self": { "name": "Self", @@ -2353,7 +2360,9 @@ "triggers": "Triggers", "deathMoves": "Deathmoves", "sources": "Sources", - "packs": "Packs" + "packs": "Packs", + "range": "Range", + "outcomes": "Outcomes" }, "Tiers": { "singular": "Tier", diff --git a/module/applications/sheets-configs/action-base-config.mjs b/module/applications/sheets-configs/action-base-config.mjs index e83dfae4..33f4d9cb 100644 --- a/module/applications/sheets-configs/action-base-config.mjs +++ b/module/applications/sheets-configs/action-base-config.mjs @@ -1,3 +1,4 @@ +import { AltDamageOutcome } from '../../data/fields/action/damageField.mjs'; import { getUnusedDamageTypes } from '../../helpers/utils.mjs'; import DaggerheartSheet from '../sheets/daggerheart-sheet.mjs'; @@ -9,6 +10,8 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) this.action = action; this.openSection = null; this.openTrigger = this.action.triggers.length > 0 ? 0 : null; + + this.outcomeTabs = DHActionBaseConfig.getOutcomeTabs(action); } get title() { @@ -25,14 +28,11 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) position: { width: 600, height: 'auto' }, actions: { toggleSection: this.toggleSection, - addEffect: this.addEffect, - removeEffect: this.removeEffect, addElement: this.addElement, removeElement: this.removeElement, removeTransformActor: this.removeTransformActor, - editEffect: this.editEffect, - addDamage: this.addDamage, - removeDamage: this.removeDamage, + addDamage: this.onAddDamage, + removeDamage: this.onRemoveDamage, editDoc: this.editDoc, addTrigger: this.addTrigger, removeTrigger: this.removeTrigger, @@ -62,9 +62,13 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) id: 'configuration', template: 'systems/daggerheart/templates/sheets-settings/action-settings/configuration.hbs' }, - effect: { - id: 'effect', - template: 'systems/daggerheart/templates/sheets-settings/action-settings/effect.hbs' + range: { + id: 'range', + template: 'systems/daggerheart/templates/sheets-settings/action-settings/range.hbs' + }, + outcomes: { + id: 'outcomes', + template: 'systems/daggerheart/templates/sheets-settings/action-settings/outcomes.hbs' }, trigger: { id: 'trigger', @@ -89,13 +93,21 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) icon: null, label: 'DAGGERHEART.GENERAL.Tabs.configuration' }, - effect: { + range: { active: false, cssClass: '', group: 'primary', - id: 'effect', + id: 'range', icon: null, - label: 'DAGGERHEART.GENERAL.Tabs.effects' + label: 'DAGGERHEART.GENERAL.Tabs.range' + }, + outcomes: { + active: false, + cssClass: '', + group: 'primary', + id: 'outcomes', + icon: null, + label: 'DAGGERHEART.GENERAL.Tabs.outcomes' }, trigger: { active: false, @@ -109,6 +121,75 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) static CLEAN_ARRAYS = ['cost', 'effects', 'summon']; + /* Needs to consider effect altOutcomes aswell */ + static getOutcomeTabs(action) { + const outcomeKeys = [ + 'default', + ...Object.keys(action.damage?.altOutcomes ?? {}).filter(key => action.damage.altOutcomes[key]) + ]; + return outcomeKeys.reduce((acc, key, index) => { + acc[key] = { + active: index === 0, + cssClass: '', + group: 'outcomes', + id: key, + icon: null, + label: game.i18n.localize(CONFIG.DH.ACTIONS.outcomeTypes[key].label) + }; + return acc; + }, {}); + } + + /* Needs to consider effect altOutcomes aswell */ + static selectOutcome(action, callback) { + const choices = Object.entries(CONFIG.DH.ACTIONS.outcomeTypes).reduce((acc, [key, value]) => { + if (action.damage.altOutcomes[key] === null) acc.push({ id: key, label: game.i18n.localize(value.label) }); + + return acc; + }, []); + const content = new foundry.data.fields.StringField({ + label: game.i18n.localize('Outcome'), + choices, + required: true + }).toFormGroup( + {}, + { + name: 'outcome', + localize: true, + nameAttr: 'value', + labelAttr: 'label' + } + ).outerHTML; + + const callbackWrapper = (_, button) => { + const choiceIndex = button.form.elements.outcome.value; + callback(choices[choiceIndex]?.id); + }; + + const typeDialog = new foundry.applications.api.DialogV2({ + buttons: [ + foundry.utils.mergeObject( + { + action: 'ok', + label: 'Confirm', + icon: 'fas fa-check', + default: true + }, + { callback: callbackWrapper } + ) + ], + content: content, + rejectClose: false, + modal: false, + window: { + title: game.i18n.localize('Add Outcome') + }, + position: { width: 300 } + }); + + typeDialog.render(true); + } + _getTabs(tabs) { for (const v of Object.values(tabs)) { v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active; @@ -155,6 +236,10 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) context.openSection = this.openSection; context.tabs = this._getTabs(this.constructor.TABS); + + context.outcomeTabs = this._getTabs(this.outcomeTabs); + context.allOutcomesAssigned = Object.keys(this.outcomeTabs).length >= 4; + context.config = CONFIG.DH; if (this.action.damage) { context.allDamageTypesUsed = !getUnusedDamageTypes(this.action.damage.parts).length; @@ -299,10 +384,13 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } - static addDamage(_event) { + static onAddDamage(_event, button) { if (!this.action.damage.parts) return; - const choices = getUnusedDamageTypes(this.action._source.damage.parts); + const outcome = button.dataset.outcome; + const source = this.action._source; + const outcomeParts = outcome === 'default' ? source.damage.parts : source.damage.altOutcomes[outcome].parts; + const choices = getUnusedDamageTypes(outcomeParts); const content = new foundry.data.fields.StringField({ label: game.i18n.localize('Damage Type'), choices, @@ -322,24 +410,23 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) const type = choices[button.form.elements.type.value].value; const part = this.action.schema.fields.damage.fields.parts.element.getInitialValue(); part.applyTo = type; - if (type === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) + if (type === CONFIG.DH.GENERAL.healingTypes.hitPoints.id) { part.type = this.action.schema.fields.damage.fields.parts.element.fields.type.element.initial; - - data.damage.parts[type] = part; + } + if (outcome !== 'default') data.damage.altOutcomes[outcome] ??= new AltDamageOutcome(); + (outcome === 'default' ? data.damage : data.damage.altOutcomes[outcome]).parts[type] = part; this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); }; const typeDialog = new foundry.applications.api.DialogV2({ buttons: [ - foundry.utils.mergeObject( - { - action: 'ok', - label: 'Confirm', - icon: 'fas fa-check', - default: true - }, - { callback: callback } - ) + { + action: 'ok', + label: 'Confirm', + icon: 'fas fa-check', + default: true, + callback + } ], content: content, rejectClose: false, @@ -353,12 +440,12 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) typeDialog.render(true); } - static removeDamage(_event, button) { + static onRemoveDamage(_event, button) { if (!this.action.damage.parts) return; const data = this.action.toObject(); - const key = button.dataset.key; - delete data.damage.parts[key]; - data.damage.parts[`${key}`] = _del; + const { key, outcome } = button.dataset; + const parts = outcome === 'default' ? data.damage.parts : data.damage.altOutcomes[outcome].parts; + parts[key] = _del; this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } @@ -448,11 +535,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2) this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); } - /** Specific implementation in extending classes **/ - static async addEffect(_event) {} - static removeEffect(_event, _button) {} - static editEffect(_event) {} - async close(options) { this.tabGroups.primary = 'base'; await super.close(options); diff --git a/module/applications/sheets-configs/action-config.mjs b/module/applications/sheets-configs/action-config.mjs index ef529e9b..a4b0a6c4 100644 --- a/module/applications/sheets-configs/action-config.mjs +++ b/module/applications/sheets-configs/action-config.mjs @@ -1,3 +1,4 @@ +import { AltDamageOutcome } from '../../data/fields/action/damageField.mjs'; import DHActionBaseConfig from './action-base-config.mjs'; export default class DHActionConfig extends DHActionBaseConfig { @@ -5,6 +6,8 @@ export default class DHActionConfig extends DHActionBaseConfig { ...DHActionBaseConfig.DEFAULT_OPTIONS, actions: { ...DHActionBaseConfig.DEFAULT_OPTIONS.actions, + addOutcome: this.onAddOutcome, + removeOutcome: this.onRemoveOutcome, addEffect: this.addEffect, removeEffect: this.removeEffect, editEffect: this.editEffect @@ -19,6 +22,28 @@ export default class DHActionConfig extends DHActionBaseConfig { return context; } + static onAddOutcome() { + const data = this.action.toObject(); + + DHActionBaseConfig.selectOutcome(this.action, key => { + if (!key) return; + + data.damage.altOutcomes[key] = new AltDamageOutcome(); + this.outcomeTabs = DHActionBaseConfig.getOutcomeTabs(data); + this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); + }); + } + + static onRemoveOutcome(_event, button) { + const { outcome } = button.dataset; + const data = this.action.toObject(); + + data.damage.altOutcomes[outcome] = null; + this.outcomeTabs = DHActionBaseConfig.getOutcomeTabs(data); + + this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); + } + static async addEffect(event) { const { areaIndex } = event.target.dataset; if (!this.action.effects) return; diff --git a/module/config/actionConfig.mjs b/module/config/actionConfig.mjs index a6c04e18..83a2d669 100644 --- a/module/config/actionConfig.mjs +++ b/module/config/actionConfig.mjs @@ -122,3 +122,26 @@ export const areaTypes = { label: 'Placed Area' } }; + +export const outcomeTypes = { + default: { + key: 'default', + label: 'DAGGERHEART.CONFIG.OutcomeType.default' + }, + successHope: { + key: 'successHope', + label: 'DAGGERHEART.CONFIG.OutcomeType.successHope' + }, + successFear: { + key: 'successFear', + label: 'DAGGERHEART.CONFIG.OutcomeType.successFear' + }, + failureHope: { + key: 'failureHope', + label: 'DAGGERHEART.CONFIG.OutcomeType.failureHope' + }, + failureFear: { + key: 'failureFear', + label: 'DAGGERHEART.CONFIG.OutcomeType.failureFear' + } +}; diff --git a/module/data/fields/action/damageField.mjs b/module/data/fields/action/damageField.mjs index 9b21d3ba..e4d919fe 100644 --- a/module/data/fields/action/damageField.mjs +++ b/module/data/fields/action/damageField.mjs @@ -4,6 +4,15 @@ import IterableTypedObjectField from '../iterableTypedObjectField.mjs'; const fields = foundry.data.fields; +const getDamageBaseFields = () => ({ + parts: new IterableTypedObjectField(DHDamageData), + includeBase: new fields.BooleanField({ + initial: false, + label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label' + }), + direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' }) +}); + export default class DamageField extends fields.SchemaField { /** * Action Workflow order @@ -13,12 +22,13 @@ export default class DamageField extends fields.SchemaField { /** @inheritDoc */ constructor(options, context = {}) { const damageFields = { - parts: new IterableTypedObjectField(DHDamageData), - includeBase: new fields.BooleanField({ - initial: false, - label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label' + ...getDamageBaseFields(), + altOutcomes: new fields.SchemaField({ + successHope: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }), + successFear: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }), + failureHope: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }), + failureFear: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null }) }), - direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' }), groupAttack: new fields.StringField({ choices: CONFIG.DH.GENERAL.groupAttackRange, blank: true, @@ -28,6 +38,12 @@ export default class DamageField extends fields.SchemaField { super(damageFields, options, context); } + getDamageData(outcome) { + if (outcome === 'successHope') return this; + + return this.altOutcomes[outcome].data; + } + /** * Roll Damage/Healing Action Workflow part. * Must be called within Action context or similar. @@ -323,3 +339,18 @@ export class DHDamageData extends DHResourceData { }; } } + +export class AltDamageOutcome extends foundry.abstract.DataModel { + static defineSchema() { + return { + ...getDamageBaseFields() + }; + } + + get data() { + return { + ...this.parent, + ...this + }; + } +} diff --git a/styles/less/sheets/actions/actions.less b/styles/less/sheets/actions/actions.less index 485f8e91..19912a98 100644 --- a/styles/less/sheets/actions/actions.less +++ b/styles/less/sheets/actions/actions.less @@ -153,4 +153,23 @@ align-items: center; gap: 4px; } + + .inner-tabs { + justify-content: left; + + .inner-tab { + line-height: 1.5; + border: 1px solid light-dark(@beige, @beige); + border-radius: 6px; + padding: 0 4px; + background: light-dark(@beige, @dark-blue); + color: light-dark(@dark-blue, @beige); + + a { + &.active { + + } + } + } + } } diff --git a/templates/actionTypes/damage.hbs b/templates/actionTypes/damage.hbs index 03300840..fef6591e 100644 --- a/templates/actionTypes/damage.hbs +++ b/templates/actionTypes/damage.hbs @@ -6,20 +6,20 @@ {{else}} {{localize "DAGGERHEART.GENERAL.damage"}} {{/if}} - {{#unless (eq path 'system.attack.')}}{{/unless}} + {{#unless (eq path 'system.attack.')}}{{/unless}}
{{#if @root.hasBaseDamage}} - {{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase name="damage.includeBase" classes="checkbox" localize=true }} + {{formField @root.fields.damage.fields.includeBase value=@root.source.damage.includeBase name=(concat basePath ".includeBase") classes="checkbox" localize=true }} {{/if}} {{#unless (eq @root.source.type 'healing')}} - {{formField baseFields.direct value=source.direct name=(concat path "damage.direct") localize=true classes="checkbox"}} + {{formField baseFields.direct value=source.direct name=(concat path basePath ".direct") localize=true classes="checkbox"}} {{/unless}} {{#if (and @root.isNPC (not (eq path 'system.attack.')))}} - {{formField baseFields.groupAttack value=source.groupAttack name=(concat path "damage.groupAttack") localize=true classes="select"}} + {{formField baseFields.groupAttack value=source.groupAttack name=(concat path basePath ".groupAttack") localize=true classes="select"}} {{/if}}
- + {{!-- Handlebars uses Symbol.Iterator to produce index|key. This isn't compatible with our parts object, so we instead use applyTo, which is the same value --}} {{#each source.parts as |dmg key|}}
@@ -27,44 +27,44 @@ {{localize (concat "DAGGERHEART.CONFIG.HealingType." dmg.applyTo ".name")}} {{#unless (or dmg.base ../path)}} - + {{/unless}} {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base))}} - {{formField ../fields.resultBased value=dmg.resultBased name=(concat "damage.parts." dmg.applyTo ".resultBased") localize=true classes="checkbox"}} + {{formField ../fields.resultBased value=dmg.resultBased name=(concat ../basePath ".parts." dmg.applyTo ".resultBased") localize=true classes="checkbox"}} {{/if}} {{#if (and (not @root.isNPC) @root.hasRoll (not dmg.base) dmg.resultBased)}}
{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.hope")}} - {{> formula fields=../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" key=dmg.applyTo path=../path}} + {{> formula fields=../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" key=dmg.applyTo path=../path outcomePath=../outcomePath}}
{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.fear")}} - {{> formula fields=../fields.valueAlt.fields type=../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" key=dmg.applyTo path=../path}} + {{> formula fields=../fields.valueAlt.fields type=../fields.type dmg=dmg source=dmg.valueAlt target="valueAlt" key=dmg.applyTo path=../path outcomePath=../outcomePath}}
{{else}} - {{> formula fields=../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" key=dmg.applyTo path=../path}} + {{> formula fields=../fields.value.fields type=../fields.type dmg=dmg source=dmg.value target="value" key=dmg.applyTo path=../path outcomePath=../outcomePath}} {{/if}} {{#if (and (eq dmg.applyTo 'hitPoints') (ne @root.source.type 'healing'))}} - {{formField ../fields.type value=dmg.type name=(concat ../path "damage.parts." dmg.applyTo ".type") localize=true}} + {{formField ../fields.type value=dmg.type name=(concat ../path ../basePath ".parts." dmg.applyTo ".type") localize=true}} {{/if}} {{#if ../horde}}
{{localize "DAGGERHEART.ACTORS.Adversary.hordeDamage"}}
- - {{formField ../fields.valueAlt.fields.flatMultiplier value=dmg.valueAlt.flatMultiplier name=(concat ../path "damage.parts." dmg.applyTo ".valueAlt.flatMultiplier") label="DAGGERHEART.ACTIONS.Settings.multiplier" classes="inline-child" localize=true }} - {{formField ../fields.valueAlt.fields.dice value=dmg.valueAlt.dice name=(concat ../path "damage.parts." dmg.applyTo ".valueAlt.dice") classes="inline-child" localize=true}} - {{formField ../fields.valueAlt.fields.bonus value=dmg.valueAlt.bonus name=(concat ../path "damage.parts." dmg.applyTo ".valueAlt.bonus") localize=true classes="inline-child"}} + + {{formField ../fields.valueAlt.fields.flatMultiplier value=dmg.valueAlt.flatMultiplier name=(concat ../path ../basePath ".parts." dmg.applyTo ".valueAlt.flatMultiplier") label="DAGGERHEART.ACTIONS.Settings.multiplier" classes="inline-child" localize=true }} + {{formField ../fields.valueAlt.fields.dice value=dmg.valueAlt.dice name=(concat ../path ../basePath ".parts." dmg.applyTo ".valueAlt.dice") classes="inline-child" localize=true}} + {{formField ../fields.valueAlt.fields.bonus value=dmg.valueAlt.bonus name=(concat ../path ../basePath ".parts." dmg.applyTo ".valueAlt.bonus") localize=true classes="inline-child"}}
{{/if}} - +
{{/each}} @@ -72,21 +72,21 @@ {{#*inline "formula"}} {{#unless dmg.base}} - {{formField fields.custom.fields.enabled value=source.custom.enabled name=(concat path "damage.parts." key "." target ".custom.enabled") classes="checkbox" localize=true}} + {{formField fields.custom.fields.enabled value=source.custom.enabled name=(concat path outcomePath ".parts." key "." target ".custom.enabled") classes="checkbox" localize=true}} {{/unless}} {{#if source.custom.enabled}} - {{formField fields.custom.fields.formula value=source.custom.formula name=(concat path "damage.parts." key "." target ".custom.formula") localize=true}} + {{formField fields.custom.fields.formula value=source.custom.formula name=(concat path outcomePath ".parts." key "." target ".custom.formula") localize=true}} {{else}}
{{#unless @root.isNPC}} - {{formField fields.multiplier value=source.multiplier name=(concat path "damage.parts." key "." target ".multiplier") localize=true}} + {{formField fields.multiplier value=source.multiplier name=(concat path outcomePath ".parts." key "." target ".multiplier") localize=true}} {{/unless}} - {{#if (eq source.multiplier 'flat')}}{{formField fields.flatMultiplier value=source.flatMultiplier name=(concat path "damage.parts." key "." target ".flatMultiplier") localize=true }}{{/if}} - {{formField fields.dice value=source.dice name=(concat path "damage.parts." key "." target ".dice") localize=true}} - {{formField fields.bonus value=source.bonus name=(concat path "damage.parts." key "." target ".bonus") localize=true}} + {{#if (eq source.multiplier 'flat')}}{{formField fields.flatMultiplier value=source.flatMultiplier name=(concat path outcomePath ".parts." key "." target ".flatMultiplier") localize=true }}{{/if}} + {{formField fields.dice value=source.dice name=(concat path outcomePath ".parts." key "." target ".dice") localize=true}} + {{formField fields.bonus value=source.bonus name=(concat path outcomePath ".parts." key "." target ".bonus") localize=true}}
{{/if}} {{#if @root.isNPC}} - + {{/if}} {{/inline}} \ No newline at end of file diff --git a/templates/sheets-settings/action-settings/configuration.hbs b/templates/sheets-settings/action-settings/configuration.hbs index 8df528c9..9fb54cc8 100644 --- a/templates/sheets-settings/action-settings/configuration.hbs +++ b/templates/sheets-settings/action-settings/configuration.hbs @@ -3,8 +3,8 @@ data-group="primary" data-tab="config" > + {{#if fields.roll}}{{> 'systems/daggerheart/templates/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}} + {{#if fields.save}}{{> 'systems/daggerheart/templates/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}} {{> 'systems/daggerheart/templates/actionTypes/uses.hbs' fields=fields.uses.fields source=source.uses}} {{> 'systems/daggerheart/templates/actionTypes/cost.hbs' fields=fields.cost.element.fields source=source.cost costOptions=costOptions}} - {{> 'systems/daggerheart/templates/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}} - {{> 'systems/daggerheart/templates/actionTypes/areas.hbs' fields=fields.areas.element.fields source=source.areas}} \ No newline at end of file diff --git a/templates/sheets-settings/action-settings/effect.hbs b/templates/sheets-settings/action-settings/effect.hbs deleted file mode 100644 index 567cb81c..00000000 --- a/templates/sheets-settings/action-settings/effect.hbs +++ /dev/null @@ -1,15 +0,0 @@ -
- {{#if fields.roll}}{{> 'systems/daggerheart/templates/actionTypes/roll.hbs' fields=fields.roll.fields source=source.roll}}{{/if}} - {{#if fields.save}}{{> 'systems/daggerheart/templates/actionTypes/save.hbs' fields=fields.save.fields source=source.save}}{{/if}} - {{#if fields.damage}}{{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=fields.damage.fields.parts.element.fields source=source.damage baseFields=fields.damage.fields }}{{/if}} - {{#if fields.macro}}{{> 'systems/daggerheart/templates/actionTypes/macro.hbs' fields=fields.macro source=source.macro}}{{/if}} - {{#if fields.effects}}{{> 'systems/daggerheart/templates/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}} - {{#if fields.beastform}}{{> 'systems/daggerheart/templates/actionTypes/beastform.hbs' fields=fields.beastform.fields source=source.beastform}}{{/if}} - {{#if fields.summon}}{{> 'systems/daggerheart/templates/actionTypes/summon.hbs' fields=fields.summon.element.fields source=source.summon}}{{/if}} - {{#if fields.countdown}}{{> 'systems/daggerheart/templates/actionTypes/countdown.hbs' fields=fields.countdown.element.fields source=source.countdown}}{{/if}} - {{#if fields.transform}}{{> 'systems/daggerheart/templates/actionTypes/transform.hbs' fields=fields.transform.fields source=source.transform}}{{/if}} -
\ No newline at end of file diff --git a/templates/sheets-settings/action-settings/outcomes.hbs b/templates/sheets-settings/action-settings/outcomes.hbs new file mode 100644 index 00000000..442333a4 --- /dev/null +++ b/templates/sheets-settings/action-settings/outcomes.hbs @@ -0,0 +1,43 @@ +
+ + + {{#each outcomeTabs as |tab|}} +
+ {{#if ../fields.damage}} + {{#if (eq tab.id 'default')}} + {{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=../fields.damage.fields.parts.element.fields source=../source.damage baseFields=../fields.damage.fields outcome=tab.id outcomePath="damage" isDefaultDamage="true" }} + {{else}} + {{#with (lookup ../fields.damage.fields.altOutcomes.fields tab.id) as |field|}} + {{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=field.fields.parts.element.fields source=(lookup ../../source.damage.altOutcomes ../id) baseFields=field.fields outcome=../id outcomePath=(concat "damage.altOutcomes." tab.id) }} + {{/with }} + {{/if}} + {{/if}} + +
+ {{/each}} + + {{#if fields.macro}}{{> 'systems/daggerheart/templates/actionTypes/macro.hbs' fields=fields.macro source=source.macro}}{{/if}} + {{#if fields.effects}}{{> 'systems/daggerheart/templates/actionTypes/effect.hbs' fields=fields.effects.element.fields source=source.effects}}{{/if}} + {{#if fields.beastform}}{{> 'systems/daggerheart/templates/actionTypes/beastform.hbs' fields=fields.beastform.fields source=source.beastform}}{{/if}} + {{#if fields.summon}}{{> 'systems/daggerheart/templates/actionTypes/summon.hbs' fields=fields.summon.element.fields source=source.summon}}{{/if}} + {{#if fields.countdown}}{{> 'systems/daggerheart/templates/actionTypes/countdown.hbs' fields=fields.countdown.element.fields source=source.countdown}}{{/if}} + {{#if fields.transform}}{{> 'systems/daggerheart/templates/actionTypes/transform.hbs' fields=fields.transform.fields source=source.transform}}{{/if}} +
\ No newline at end of file diff --git a/templates/sheets-settings/action-settings/range.hbs b/templates/sheets-settings/action-settings/range.hbs new file mode 100644 index 00000000..273e89c9 --- /dev/null +++ b/templates/sheets-settings/action-settings/range.hbs @@ -0,0 +1,8 @@ +
+ {{> 'systems/daggerheart/templates/actionTypes/range-target.hbs' fields=(object range=fields.range target=fields.target.fields) source=(object target=source.target range=source.range)}} + {{> 'systems/daggerheart/templates/actionTypes/areas.hbs' fields=fields.areas.element.fields source=source.areas}} +
\ No newline at end of file