mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Fix conflicts
This commit is contained in:
commit
3ff6ec4f5e
164 changed files with 2542 additions and 749 deletions
|
|
@ -115,7 +115,6 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
if (!this.actor) throw new Error("An Action can't be used outside of an Actor context.");
|
||||
|
||||
if (this.chatDisplay) await this.toChat();
|
||||
|
||||
let { byPassRoll } = options,
|
||||
config = this.prepareConfig(event, byPassRoll);
|
||||
for (let i = 0; i < this.constructor.extraSchemas.length; i++) {
|
||||
|
|
@ -221,16 +220,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const resources = config.costs
|
||||
.filter(c =>
|
||||
c.enabled !== false
|
||||
&&
|
||||
(
|
||||
(!successCost && (!c.consumeOnSuccess || config.roll?.success))
|
||||
||
|
||||
(successCost && c.consumeOnSuccess)
|
||||
)
|
||||
.filter(
|
||||
c =>
|
||||
c.enabled !== false &&
|
||||
((!successCost && (!c.consumeOnSuccess || config.roll?.success)) ||
|
||||
(successCost && c.consumeOnSuccess))
|
||||
)
|
||||
.map(c => {
|
||||
const resource = usefulResources[c.key];
|
||||
|
|
@ -243,14 +239,12 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
});
|
||||
|
||||
await this.actor.modifyResource(resources);
|
||||
if (config.uses?.enabled
|
||||
&&
|
||||
(
|
||||
(!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success))
|
||||
||
|
||||
(successCost && config.uses?.consumeOnSuccess)
|
||||
)
|
||||
) this.update({ 'uses.value': this.uses.value + 1 });
|
||||
if (
|
||||
config.uses?.enabled &&
|
||||
((!successCost && (!config.uses?.consumeOnSuccess || config.roll?.success)) ||
|
||||
(successCost && config.uses?.consumeOnSuccess))
|
||||
)
|
||||
this.update({ 'uses.value': this.uses.value + 1 });
|
||||
|
||||
if(config.roll?.success || successCost) {
|
||||
setTimeout(() => {
|
||||
|
|
@ -309,11 +303,9 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
}
|
||||
|
||||
async applyEffect(effect, actor) {
|
||||
const origin = effect.parent?.parent ? effect.parent.parent.uuid : effect.parent.uuid;
|
||||
// Enable an existing effect on the target if it originated from this effect
|
||||
const existingEffect = actor.effects.find(e => e.origin === origin);
|
||||
const existingEffect = actor.effects.find(e => e.origin === effect.uuid);
|
||||
if (existingEffect) {
|
||||
return existingEffect.update(
|
||||
return effect.update(
|
||||
foundry.utils.mergeObject({
|
||||
...effect.constructor.getInitialDuration(),
|
||||
disabled: false
|
||||
|
|
@ -326,7 +318,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
...effect.toObject(),
|
||||
disabled: false,
|
||||
transfer: false,
|
||||
origin: origin
|
||||
origin: effect.uuid
|
||||
});
|
||||
await ActiveEffect.implementation.create(effectData, { parent: actor });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue