mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Merge 56b2688fc4 into 5dbcd94480
This commit is contained in:
commit
6bc28bed9c
11 changed files with 305 additions and 80 deletions
11
lang/en.json
11
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",
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
)
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@
|
|||
{{else}}
|
||||
{{localize "DAGGERHEART.GENERAL.damage"}}
|
||||
{{/if}}
|
||||
{{#unless (eq path 'system.attack.')}}<a data-action="addDamage" {{#if @root.allDamageTypesUsed}}disabled{{/if}}><i class="fa-solid fa-plus icon-button"></i></a>{{/unless}}
|
||||
{{#unless (eq path 'system.attack.')}}<a data-action="addDamage" data-outcome="{{outcome}}" {{#if @root.allDamageTypesUsed}}disabled{{/if}}><i class="fa-solid fa-plus icon-button"></i></a>{{/unless}}
|
||||
</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}}
|
||||
|
|
@ -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}}
|
||||
</section>
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
<section
|
||||
class="tab {{this.tabs.effect.cssClass}}"
|
||||
data-group="primary"
|
||||
data-tab="effect"
|
||||
>
|
||||
{{#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}}
|
||||
</section>
|
||||
43
templates/sheets-settings/action-settings/outcomes.hbs
Normal file
43
templates/sheets-settings/action-settings/outcomes.hbs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<section
|
||||
class="tab {{this.tabs.outcomes.cssClass}}"
|
||||
data-group="primary"
|
||||
data-tab="outcomes"
|
||||
>
|
||||
<nav class='inner-tabs tabs' data-group='outcomes'>
|
||||
{{#each outcomeTabs as |tab|}}
|
||||
<div class="inner-tab">
|
||||
<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 'default')}}<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|}}
|
||||
<section
|
||||
class="tab {{lookup (lookup ../outcomeTabs tab.id) 'cssClass'}}"
|
||||
data-group="outcomes"
|
||||
data-tab="{{tab.id}}"
|
||||
>
|
||||
{{#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}}
|
||||
|
||||
</section>
|
||||
{{/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}}
|
||||
</section>
|
||||
8
templates/sheets-settings/action-settings/range.hbs
Normal file
8
templates/sheets-settings/action-settings/range.hbs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<section
|
||||
class="tab {{this.tabs.range.cssClass}}"
|
||||
data-group="primary"
|
||||
data-tab="range"
|
||||
>
|
||||
{{> '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}}
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue