mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Merge branch 'v14-Dev' into v14/effect-stacking
This commit is contained in:
commit
b2a900db16
149 changed files with 3336 additions and 1535 deletions
|
|
@ -50,9 +50,9 @@ export default class DamageField extends fields.SchemaField {
|
|||
formulas = DamageField.formatFormulas.call(this, formulas, config);
|
||||
|
||||
const damageConfig = {
|
||||
dialog: {},
|
||||
...config,
|
||||
roll: formulas,
|
||||
dialog: {},
|
||||
data: this.getRollData()
|
||||
};
|
||||
delete damageConfig.evaluate;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export default class EffectsField extends fields.ArrayField {
|
|||
static async execute(config, targets = null, force = false) {
|
||||
if (!config.hasEffect) return;
|
||||
let message = config.message ?? ui.chat.collection.get(config.parent?._id);
|
||||
if (!message) {
|
||||
if (!message && !config.skips.createMessage) {
|
||||
const roll = new CONFIG.Dice.daggerheart.DHRoll('');
|
||||
roll._evaluated = true;
|
||||
message = config.message = await CONFIG.Dice.daggerheart.DHRoll.toMessage(roll, config);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export default class SaveField extends fields.SchemaField {
|
|||
if (!config.hasSave) return;
|
||||
let message = config.message ?? ui.chat.collection.get(config.parent?._id);
|
||||
|
||||
if (!message) {
|
||||
if (!message && !config.skips.createMessage) {
|
||||
const roll = new CONFIG.Dice.daggerheart.DHRoll('');
|
||||
roll._evaluated = true;
|
||||
message = config.message = await CONFIG.Dice.daggerheart.DHRoll.toMessage(roll, config);
|
||||
|
|
|
|||
|
|
@ -82,6 +82,24 @@ class ResourcesField extends fields.TypedObjectField {
|
|||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Foundry bar attributes are unable to handle finding the schema field nor the label normally.
|
||||
* This returns the element if its a valid resource key and overwrites the element's label for that retrieval.
|
||||
*/
|
||||
_getField(path) {
|
||||
if (path.length === 0) return this;
|
||||
const first = path.shift();
|
||||
if (first === this.element.name) return this.element_getField(path);
|
||||
|
||||
const resources = CONFIG.DH.RESOURCE[this.actorType].all;
|
||||
if (first in resources) {
|
||||
this.element.label = resources[first].label;
|
||||
return this.element._getField(path);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export { attributeField, ResourcesField, stressDamageReductionRule, bonusField };
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ export default class IterableTypedObjectField extends foundry.data.fields.TypedO
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The prototype of an iterable object.
|
||||
/**
|
||||
* The prototype of an iterable object.
|
||||
* This allows the functionality of a class but also allows foundry.utils.getType() to return "Object" instead of "Unknown".
|
||||
*/
|
||||
const IterableObjectPrototype = {
|
||||
[Symbol.iterator]: function*() {
|
||||
[Symbol.iterator]: function* () {
|
||||
for (const value of Object.values(this)) {
|
||||
yield value;
|
||||
}
|
||||
|
|
@ -29,4 +29,4 @@ const IterableObjectPrototype = {
|
|||
map: function (func) {
|
||||
return Array.from(this, func);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue