mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
[Feature] ActiveEffect Autocomplete (#338)
* Fixed translation of TrackedAttributeChoices * Styling improvements * Added hints * fix autocomplete style, fix tagify style, fix magical and physical tag style and fix lang in details adversary settings * Removed commented out code * Some companion fixes --------- Co-authored-by: moliloo <dev.murilobrito@gmail.com>
This commit is contained in:
parent
37c1d7ad88
commit
0dd5b53313
31 changed files with 501 additions and 171 deletions
|
|
@ -102,7 +102,7 @@ export default class D20Roll extends DHRoll {
|
|||
value: this.options.data.experiences[m].value
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
this.addModifiers();
|
||||
if (this.options.extraFormula) {
|
||||
this.terms.push(
|
||||
|
|
@ -123,15 +123,17 @@ export default class D20Roll extends DHRoll {
|
|||
|
||||
applyBaseBonus() {
|
||||
const modifiers = [];
|
||||
|
||||
if(this.options.roll.bonus)
|
||||
|
||||
if (this.options.roll.bonus)
|
||||
modifiers.push({
|
||||
label: 'Bonus to Hit',
|
||||
value: this.options.roll.bonus
|
||||
});
|
||||
|
||||
modifiers.push(...this.getBonus(`roll.${this.options.type}`, `${this.options.type.capitalize()} Bonus`));
|
||||
modifiers.push(...this.getBonus(`roll.${this.options.roll.type}`, `${this.options.roll.type.capitalize()} Bonus`));
|
||||
modifiers.push(
|
||||
...this.getBonus(`roll.${this.options.roll.type}`, `${this.options.roll.type.capitalize()} Bonus`)
|
||||
);
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,16 +34,16 @@ export default class DamageRoll extends DHRoll {
|
|||
});
|
||||
const weapons = ['primaryWeapon', 'secondaryWeapon'];
|
||||
weapons.forEach(w => {
|
||||
if(this.options.source.item && this.options.source.item === this.data[w]?.id)
|
||||
if (this.options.source.item && this.options.source.item === this.data[w]?.id)
|
||||
modifiers.push(...this.getBonus(`${type}.${w}`, 'Weapon Bonus'));
|
||||
});
|
||||
|
||||
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
constructFormula(config) {
|
||||
super.constructFormula(config);
|
||||
|
||||
|
||||
if (config.isCritical) {
|
||||
const tmpRoll = new Roll(this._formula)._evaluateSync({ maximize: true }),
|
||||
criticalBonus = tmpRoll.total - this.constructor.calculateTotalModifiers(tmpRoll);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export default class DHRoll extends Roll {
|
|||
baseTerms = [];
|
||||
constructor(formula, data, options) {
|
||||
super(formula, data, options);
|
||||
if(!this.data || !Object.keys(this.data).length) this.data = options.data;
|
||||
if (!this.data || !Object.keys(this.data).length) this.data = options.data;
|
||||
}
|
||||
|
||||
static messageType = 'adversaryRoll';
|
||||
|
|
@ -100,7 +100,7 @@ export default class DHRoll extends Roll {
|
|||
}
|
||||
|
||||
formatModifier(modifier) {
|
||||
if(Array.isArray(modifier)) {
|
||||
if (Array.isArray(modifier)) {
|
||||
return [
|
||||
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
|
||||
...this.constructor.parse(modifier.join(' + '), this.options.data)
|
||||
|
|
@ -127,12 +127,12 @@ export default class DHRoll extends Roll {
|
|||
getBonus(path, label) {
|
||||
const bonus = foundry.utils.getProperty(this.data.bonuses, path),
|
||||
modifiers = [];
|
||||
if(bonus?.bonus)
|
||||
if (bonus?.bonus)
|
||||
modifiers.push({
|
||||
label: label,
|
||||
value: bonus?.bonus
|
||||
});
|
||||
if(bonus?.dice?.length)
|
||||
if (bonus?.dice?.length)
|
||||
modifiers.push({
|
||||
label: label,
|
||||
value: bonus?.dice
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ export default class DualityRoll extends D20Roll {
|
|||
applyBaseBonus() {
|
||||
const modifiers = super.applyBaseBonus();
|
||||
|
||||
if(this.options.roll.trait && this.data.traits[this.options.roll.trait])
|
||||
if (this.options.roll.trait && this.data.traits[this.options.roll.trait])
|
||||
modifiers.unshift({
|
||||
label: `DAGGERHEART.CONFIG.Traits.${this.options.roll.trait}.name`,
|
||||
value: this.data.traits[this.options.roll.trait].value
|
||||
|
|
@ -129,7 +129,7 @@ export default class DualityRoll extends D20Roll {
|
|||
|
||||
const weapons = ['primaryWeapon', 'secondaryWeapon'];
|
||||
weapons.forEach(w => {
|
||||
if(this.options.source.item && this.options.source.item === this.data[w]?.id)
|
||||
if (this.options.source.item && this.options.source.item === this.data[w]?.id)
|
||||
modifiers.push(...this.getBonus(`roll.${w}`, 'Weapon Bonus'));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue