mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] Downtime Actions (#1295)
* Fixed so downtime actiosn can be used again * Update module/data/fields/action/targetField.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> * . --------- Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
fe8e98ef35
commit
b9d67e44da
13 changed files with 86 additions and 32 deletions
|
|
@ -24,7 +24,7 @@ export default class TargetField extends fields.SchemaField {
|
|||
if (!this.target?.type) return (config.targets = []);
|
||||
config.hasTarget = true;
|
||||
let targets;
|
||||
// If the Action is configured as self-targeted, set targets as the owner.
|
||||
// If the Action is configured as self-targeted, set targets as the owner. Probably better way than to fallback to getDependentTokens
|
||||
if (this.target?.type === CONFIG.DH.GENERAL.targetTypes.self.id)
|
||||
targets = [this.actor.token ?? this.actor.prototypeToken];
|
||||
else {
|
||||
|
|
@ -72,17 +72,17 @@ export default class TargetField extends fields.SchemaField {
|
|||
|
||||
/**
|
||||
* Format actor to useful datas for Action roll workflow.
|
||||
* @param {*} actor Actor object to format.
|
||||
* @param {*} token Token object to format.
|
||||
* @returns {*} Formatted Actor.
|
||||
*/
|
||||
static formatTarget(actor) {
|
||||
static formatTarget(token) {
|
||||
return {
|
||||
id: actor.id,
|
||||
actorId: actor.actor.uuid,
|
||||
name: actor.actor.name,
|
||||
img: actor.actor.img,
|
||||
difficulty: actor.actor.system.difficulty,
|
||||
evasion: actor.actor.system.evasion,
|
||||
id: token.id,
|
||||
actorId: token.actor.uuid,
|
||||
name: token.actor.name,
|
||||
img: token.actor.img,
|
||||
difficulty: token.actor.system.difficulty,
|
||||
evasion: token.actor.system.evasion,
|
||||
saved: {
|
||||
value: null,
|
||||
success: null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue