forked from foundryvtt/dnd5e
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request foundryvtt#3928 from foundryvtt/activity/other-for…
…mula [foundryvtt#1964] Add arbitrary roll to `UtilityActivity`
- Loading branch information
Showing
7 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export {default as ActivitySheet} from "./activity-sheet.mjs"; | ||
export {default as AttackSheet} from "./attack-sheet.mjs"; | ||
export {default as SummonSheet} from "./summon-sheet.mjs"; | ||
export {default as UtilitySheet} from "./utility-sheet.mjs"; | ||
|
||
export {default as ActivityUsageDialog} from "./activity-usage-dialog.mjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import ActivitySheet from "./activity-sheet.mjs"; | ||
|
||
/** | ||
* Sheet for the utility activity. | ||
*/ | ||
export default class UtilitySheet extends ActivitySheet { | ||
|
||
/** @inheritDoc */ | ||
static DEFAULT_OPTIONS = { | ||
classes: ["utility-activity"] | ||
}; | ||
|
||
/* -------------------------------------------- */ | ||
|
||
/** @inheritDoc */ | ||
static PARTS = { | ||
...super.PARTS, | ||
effect: { | ||
template: "systems/dnd5e/templates/activity/utility-effect.hbs", | ||
templates: super.PARTS.effect.templates | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import FormulaField from "../fields/formula-field.mjs"; | ||
import BaseActivityData from "./base-activity.mjs"; | ||
|
||
const { SchemaField, StringField } = foundry.data.fields; | ||
|
||
/** | ||
* Data model for an utility activity. | ||
* | ||
* @property {object} roll | ||
* @property {string} roll.formula Arbitrary formula that can be rolled. | ||
* @property {string} roll.name Label for the rolling button. | ||
*/ | ||
export default class UtilityActivityData extends BaseActivityData { | ||
/** @inheritDoc */ | ||
static defineSchema() { | ||
return { | ||
...super.defineSchema(), | ||
roll: new SchemaField({ | ||
formula: new FormulaField(), | ||
name: new StringField() | ||
}) | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<section class="tab activity-{{ tab.id }} {{ tab.cssClass }}" data-tab="{{ tab.id }}" data-group="{{ tab.group }}"> | ||
{{> "systems/dnd5e/templates/activity/parts/activity-effects.hbs" }} | ||
<fieldset> | ||
<legend>{{ localize "DND5E.UTILITY.FIELDS.roll.label" }}</legend> | ||
{{ formField fields.roll.fields.name value=source.roll.name }} | ||
{{ formField fields.roll.fields.formula value=source.roll.formula }} | ||
</fieldset> | ||
</section> |