mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
More work on actionConfig outcomes
This commit is contained in:
parent
f260d221a8
commit
ec404a61d9
7 changed files with 180 additions and 58 deletions
|
|
@ -1275,6 +1275,13 @@
|
|||
"diceValue": "Dice Value",
|
||||
"die": "Die"
|
||||
},
|
||||
"OutcomeType": {
|
||||
"successHope": "Success/ Hope",
|
||||
"successFear": "Success/ Fear",
|
||||
"failureHope": "Failure/ Hope",
|
||||
"failureFear": "Failure/ Fear",
|
||||
"simpleOutcome": "Outcome"
|
||||
},
|
||||
"Range": {
|
||||
"self": {
|
||||
"name": "Self",
|
||||
|
|
|
|||
|
|
@ -10,12 +10,87 @@ 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() {
|
||||
return `${game.i18n.localize('DAGGERHEART.GENERAL.Tabs.settings')}: ${this.action.name}`;
|
||||
}
|
||||
|
||||
/* Needs to consider effect altOutcomes aswell */
|
||||
static getOutcomeTabs(action) {
|
||||
const outcomeKeys = [
|
||||
'successHope',
|
||||
...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:
|
||||
outcomeKeys.length === 1
|
||||
? game.i18n.localize('DAGGERHEART.CONFIG.OutcomeType.simpleOutcome')
|
||||
: 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 (key !== 'successHope' && 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);
|
||||
}
|
||||
|
||||
static DEFAULT_OPTIONS = {
|
||||
tag: 'form',
|
||||
classes: ['daggerheart', 'dh-style', 'action-config', 'dialog', 'max-800'],
|
||||
|
|
@ -31,6 +106,8 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
addElement: this.addElement,
|
||||
removeElement: this.removeElement,
|
||||
removeTransformActor: this.removeTransformActor,
|
||||
addOutcome: this.addOutcome,
|
||||
removeOutcome: this.removeOutcome,
|
||||
editEffect: this.editEffect,
|
||||
addDamage: this.addDamage,
|
||||
removeDamage: this.removeDamage,
|
||||
|
|
@ -120,25 +197,6 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
}
|
||||
};
|
||||
|
||||
static OUTCOME_TABS = {
|
||||
successHope: {
|
||||
active: true,
|
||||
cssClass: '',
|
||||
group: 'outcomes',
|
||||
id: 'successHope',
|
||||
icon: null,
|
||||
label: 'Success With Hope'
|
||||
},
|
||||
successFear: {
|
||||
active: false,
|
||||
cssClass: '',
|
||||
group: 'outcomes',
|
||||
id: 'successFear',
|
||||
icon: null,
|
||||
label: 'Success With Fear'
|
||||
},
|
||||
};
|
||||
|
||||
static CLEAN_ARRAYS = ['cost', 'effects', 'summon'];
|
||||
|
||||
_getTabs(tabs) {
|
||||
|
|
@ -188,7 +246,8 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
context.openSection = this.openSection;
|
||||
context.tabs = this._getTabs(this.constructor.TABS);
|
||||
|
||||
context.outcomeTabs = this._getTabs(this.constructor.OUTCOME_TABS);
|
||||
context.outcomeTabs = this._getTabs(this.outcomeTabs);
|
||||
context.allOutcomesAssigned = Object.keys(this.outcomeTabs).length >= 4;
|
||||
|
||||
context.config = CONFIG.DH;
|
||||
if (this.action.damage) {
|
||||
|
|
@ -338,7 +397,11 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
if (!this.action.damage.parts) return;
|
||||
|
||||
const outcome = button.dataset.outcome;
|
||||
const choices = getUnusedDamageTypes(this.action._source.damage.parts);
|
||||
const outcomeParts =
|
||||
outcome === 'successHope'
|
||||
? this.action._source.damage.parts
|
||||
: this.action._source.damage.altOutcomes[outcome].parts;
|
||||
const choices = getUnusedDamageTypes(outcomeParts);
|
||||
const content = new foundry.data.fields.StringField({
|
||||
label: game.i18n.localize('Damage Type'),
|
||||
choices,
|
||||
|
|
@ -361,8 +424,7 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
if (type === CONFIG.DH.GENERAL.healingTypes.hitPoints.id)
|
||||
part.type = this.action.schema.fields.damage.fields.parts.element.fields.type.element.initial;
|
||||
|
||||
if (outcome === 'successHope')
|
||||
data.damage.parts[type] = part;
|
||||
if (outcome === 'successHope') data.damage.parts[type] = part;
|
||||
else {
|
||||
if (!data.damage.altOutcomes[outcome]) {
|
||||
data.damage.altOutcomes[outcome] = new AltDamageOutcome();
|
||||
|
|
@ -401,9 +463,15 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
static removeDamage(_event, button) {
|
||||
if (!this.action.damage.parts) return;
|
||||
const data = this.action.toObject();
|
||||
const key = button.dataset.key;
|
||||
const { key, outcome } = button.dataset;
|
||||
if (outcome === 'successHope') {
|
||||
delete data.damage.parts[key];
|
||||
data.damage.parts[`${key}`] = _del;
|
||||
} else {
|
||||
delete data.damage.altOutcomes[outcome].parts[key];
|
||||
data.damage.altOutcomes[outcome].parts[`${key}`] = _del;
|
||||
}
|
||||
|
||||
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) });
|
||||
}
|
||||
|
||||
|
|
@ -494,6 +562,8 @@ export default class DHActionBaseConfig extends DaggerheartSheet(ApplicationV2)
|
|||
}
|
||||
|
||||
/** Specific implementation in extending classes **/
|
||||
static addOutcome(_event) {}
|
||||
static removeOutcome(_event) {}
|
||||
static async addEffect(_event) {}
|
||||
static removeEffect(_event, _button) {}
|
||||
static editEffect(_event) {}
|
||||
|
|
|
|||
|
|
@ -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.addOutcome,
|
||||
removeOutcome: this.removeOutcome,
|
||||
addEffect: this.addEffect,
|
||||
removeEffect: this.removeEffect,
|
||||
editEffect: this.editEffect
|
||||
|
|
@ -19,6 +22,28 @@ export default class DHActionConfig extends DHActionBaseConfig {
|
|||
return context;
|
||||
}
|
||||
|
||||
static addOutcome() {
|
||||
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 removeOutcome(_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;
|
||||
|
|
|
|||
|
|
@ -122,3 +122,22 @@ export const areaTypes = {
|
|||
label: 'Placed Area'
|
||||
}
|
||||
};
|
||||
|
||||
export const outcomeTypes = {
|
||||
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'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ const getDamageBaseFields = () => ({
|
|||
initial: false,
|
||||
label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label'
|
||||
}),
|
||||
direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' }),
|
||||
direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' })
|
||||
});
|
||||
|
||||
export default class DamageField extends fields.SchemaField {
|
||||
|
|
@ -26,8 +26,7 @@ export default class DamageField extends fields.SchemaField {
|
|||
altOutcomes: new fields.SchemaField({
|
||||
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 }),
|
||||
critical: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null })
|
||||
failureFear: new fields.EmbeddedDataField(AltDamageOutcome, { nullable: true, initial: null })
|
||||
}),
|
||||
groupAttack: new fields.StringField({
|
||||
choices: CONFIG.DH.GENERAL.groupAttackRange,
|
||||
|
|
@ -347,14 +346,14 @@ export class AltDamageOutcome extends foundry.abstract.DataModel {
|
|||
static defineSchema() {
|
||||
return {
|
||||
useStandardHitPointDamage: new fields.BooleanField({ required: true, initial: true }),
|
||||
...getDamageBaseFields(),
|
||||
}
|
||||
...getDamageBaseFields()
|
||||
};
|
||||
}
|
||||
|
||||
get data() {
|
||||
return {
|
||||
...this.parent,
|
||||
...this,
|
||||
}
|
||||
...this
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -10,13 +10,13 @@
|
|||
</legend>
|
||||
<div class="nest-inputs">
|
||||
{{#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}}
|
||||
</div>
|
||||
|
||||
|
|
@ -27,44 +27,44 @@
|
|||
<legend class="with-icon">
|
||||
{{localize (concat "DAGGERHEART.CONFIG.HealingType." dmg.applyTo ".name")}}
|
||||
{{#unless (or dmg.base ../path)}}
|
||||
<a data-action="removeDamage" data-key="{{dmg.applyTo}}"><i class="fas fa-trash"></i></a>
|
||||
<a data-action="removeDamage" data-key="{{dmg.applyTo}}" data-outcome="{{../outcome}}"><i class="fas fa-trash"></i></a>
|
||||
{{/unless}}
|
||||
</legend>
|
||||
|
||||
{{#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)}}
|
||||
<div class="nest-inputs">
|
||||
<fieldset class="one-column">
|
||||
<legend>{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.hope")}}</legend>
|
||||
{{> 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}}
|
||||
</fieldset>
|
||||
<fieldset class="one-column">
|
||||
<legend>{{localize "DAGGERHEART.GENERAL.withThing" thing=(localize "DAGGERHEART.GENERAL.fear")}}</legend>
|
||||
{{> 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}}
|
||||
</fieldset>
|
||||
</div>
|
||||
{{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}}
|
||||
<fieldset class="one-column">
|
||||
<legend>{{localize "DAGGERHEART.ACTORS.Adversary.hordeDamage"}}</legend>
|
||||
<div class="nest-inputs">
|
||||
<input type="hidden" name="{{../path}}damage.parts.{{dmg.applyTo}}.valueAlt.multiplier" value="flat">
|
||||
{{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"}}
|
||||
<input type="hidden" name="{{../path}}{{../basePath}}.parts.{{dmg.applyTo}}.valueAlt.multiplier" value="flat">
|
||||
{{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"}}
|
||||
</div>
|
||||
</fieldset>
|
||||
{{/if}}
|
||||
<input type="hidden" name="{{concat ../path "damage.parts." dmg.applyTo ".base"}}" value="{{dmg.base}}">
|
||||
<input type="hidden" name="{{concat ../path ../basePath ".parts." dmg.applyTo ".base"}}" value="{{dmg.base}}">
|
||||
</fieldset>
|
||||
</div>
|
||||
{{/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}}
|
||||
<div class="nest-inputs">
|
||||
{{#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}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if @root.isNPC}}
|
||||
<input type="hidden" name="{{path}}damage.parts.{{key}}.{{target}}.multiplier" value="flat">
|
||||
<input type="hidden" name="{{concat path outcomePath ".parts.{{key}}.{{target}}.multiplier"}}" value="flat">
|
||||
{{/if}}
|
||||
{{/inline}}
|
||||
|
|
@ -9,8 +9,10 @@
|
|||
<a class='{{tab.id}} {{tab.cssClass}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
||||
{{localize tab.label}}
|
||||
</a>
|
||||
{{#unless (eq tab.id 'successHope')}}<a data-outcome="{{tab.id}}" data-action="removeOutcome"><i class="fa-solid fa-trash"></i></a>{{/unless}}
|
||||
</div>
|
||||
{{/each}}
|
||||
<a data-action="addOutcome" {{#if allOutcomesAssigned}}disabled{{/if}}><i class="fa-solid fa-plus"></i></a>
|
||||
</nav>
|
||||
|
||||
{{#each outcomeTabs as |tab|}}
|
||||
|
|
@ -20,10 +22,10 @@
|
|||
data-tab="{{tab.id}}"
|
||||
>
|
||||
{{#if (eq tab.id 'successHope')}}
|
||||
{{#if ../fields.damage}}{{> 'systems/daggerheart/templates/actionTypes/damage.hbs' fields=../fields.damage.fields.parts.element.fields source=../source.damage baseFields=../fields.damage.fields outcome=tab.id }}{{/if}}
|
||||
{{#if ../fields.damage}}{{> '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" }}{{/if}}
|
||||
{{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 }}
|
||||
{{> '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}}
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue