mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Merged in main
This commit is contained in:
commit
b3c0344b91
11 changed files with 16 additions and 24 deletions
|
|
@ -39,7 +39,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
this.availableStressReductions = Object.keys(actor.system.rules.damageReduction.stressDamageReduction).reduce(
|
this.availableStressReductions = Object.keys(actor.system.rules.damageReduction.stressDamageReduction).reduce(
|
||||||
(acc, key) => {
|
(acc, key) => {
|
||||||
const dr = actor.system.rules.damageReduction.stressDamageReduction[key];
|
const dr = actor.system.rules.damageReduction.stressDamageReduction[key];
|
||||||
if (dr.enabled) {
|
if (dr.cost) {
|
||||||
if (acc === null) acc = {};
|
if (acc === null) acc = {};
|
||||||
|
|
||||||
const damage = damageKeyToNumber(key);
|
const damage = damageKeyToNumber(key);
|
||||||
|
|
@ -260,7 +260,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
|
||||||
const reducedDamage = currentDamage !== this.damage ? getDamageLabel(currentDamage) : null;
|
const reducedDamage = currentDamage !== this.damage ? getDamageLabel(currentDamage) : null;
|
||||||
const currentDamageLabel = reducedDamage ?? getDamageLabel(this.damage);
|
const currentDamageLabel = reducedDamage ?? getDamageLabel(this.damage);
|
||||||
|
|
||||||
if (stressReduction.from !== currentDamageLabel) return;
|
if (!stressReduction.any && stressReduction.from !== currentDamageLabel) return;
|
||||||
|
|
||||||
stressReduction.selected = true;
|
stressReduction.selected = true;
|
||||||
this.render();
|
this.render();
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ export default class DamageField extends fields.SchemaField {
|
||||||
initial: false,
|
initial: false,
|
||||||
label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label'
|
label: 'DAGGERHEART.ACTIONS.Settings.includeBase.label'
|
||||||
}),
|
}),
|
||||||
direct: new fields.BooleanField({ initial: false, label: "DAGGERHEART.CONFIG.DamageType.direct.name" })
|
direct: new fields.BooleanField({ initial: false, label: 'DAGGERHEART.CONFIG.DamageType.direct.name' })
|
||||||
};
|
};
|
||||||
super(damageFields, options, context);
|
super(damageFields, options, context);
|
||||||
}
|
}
|
||||||
|
|
@ -30,7 +30,7 @@ export class DHActionDiceData extends foundry.abstract.DataModel {
|
||||||
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }),
|
bonus: new fields.NumberField({ nullable: true, initial: null, label: 'Bonus' }),
|
||||||
custom: new fields.SchemaField({
|
custom: new fields.SchemaField({
|
||||||
enabled: new fields.BooleanField({ label: 'Custom Formula' }),
|
enabled: new fields.BooleanField({ label: 'Custom Formula' }),
|
||||||
formula: new FormulaField({ label: 'Formula' })
|
formula: new FormulaField({ label: 'Formula', initial: '' })
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ export class ActionsField extends MappingField {
|
||||||
*/
|
*/
|
||||||
export class ActionField extends foundry.data.fields.ObjectField {
|
export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
getModel(value) {
|
getModel(value) {
|
||||||
|
if (value && !value.type) value.type = 'attack';
|
||||||
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +100,6 @@ export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
initialize(value, model, options = {}) {
|
initialize(value, model, options = {}) {
|
||||||
if (value && !value.type) value.type = 'attack';
|
|
||||||
const cls = this.getModel(value);
|
const cls = this.getModel(value);
|
||||||
if (cls) return new cls(value, { parent: model, ...options });
|
if (cls) return new cls(value, { parent: model, ...options });
|
||||||
return foundry.utils.deepClone(value);
|
return foundry.utils.deepClone(value);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ const resourceField = (max = 0, initial = 0, label, reverse = false, maxLabel) =
|
||||||
|
|
||||||
const stressDamageReductionRule = localizationPath =>
|
const stressDamageReductionRule = localizationPath =>
|
||||||
new fields.SchemaField({
|
new fields.SchemaField({
|
||||||
enabled: new fields.BooleanField({ required: true, initial: false }),
|
|
||||||
cost: new fields.NumberField({
|
cost: new fields.NumberField({
|
||||||
integer: true,
|
integer: true,
|
||||||
label: `${localizationPath}.label`,
|
label: `${localizationPath}.label`,
|
||||||
|
|
|
||||||
|
|
@ -227,13 +227,13 @@ export const registerRollDiceHooks = () => {
|
||||||
if (!actor) return;
|
if (!actor) return;
|
||||||
if (config.roll.isCritical || config.roll.result.duality === 1)
|
if (config.roll.isCritical || config.roll.result.duality === 1)
|
||||||
updates.push({ key: 'hope', value: 1, total: -1, enabled: true });
|
updates.push({ key: 'hope', value: 1, total: -1, enabled: true });
|
||||||
if (config.roll.isCritical) updates.push({ key: 'stress', value: -1, total: 1, enabled: true });
|
if (config.roll.isCritical) updates.push({ key: 'stress', value: 1, total: -1, enabled: true });
|
||||||
if (config.roll.result.duality === -1) updates.push({ key: 'fear', value: 1, total: -1, enabled: true });
|
if (config.roll.result.duality === -1) updates.push({ key: 'fear', value: 1, total: -1, enabled: true });
|
||||||
|
|
||||||
if (config.rerolledRoll) {
|
if (config.rerolledRoll) {
|
||||||
if (config.rerolledRoll.isCritical || config.rerolledRoll.result.duality === 1)
|
if (config.rerolledRoll.isCritical || config.rerolledRoll.result.duality === 1)
|
||||||
updates.push({ key: 'hope', value: -1, total: 1, enabled: true });
|
updates.push({ key: 'hope', value: -1, total: 1, enabled: true });
|
||||||
if (config.rerolledRoll.isCritical) updates.push({ key: 'stress', value: 1, total: -1, enabled: true });
|
if (config.rerolledRoll.isCritical) updates.push({ key: 'stress', value: -1, total: 1, enabled: true });
|
||||||
if (config.rerolledRoll.result.duality === -1)
|
if (config.rerolledRoll.result.duality === -1)
|
||||||
updates.push({ key: 'fear', value: -1, total: 1, enabled: true });
|
updates.push({ key: 'fear', value: -1, total: 1, enabled: true });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ foundry.dice.terms.Die.prototype.selfCorrecting = function (modifier) {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDamageKey = damage => {
|
export const getDamageKey = damage => {
|
||||||
return ['none', 'minor', 'major', 'severe'][damage];
|
return ['none', 'minor', 'major', 'severe', 'any'][damage];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getDamageLabel = damage => {
|
export const getDamageLabel = damage => {
|
||||||
|
|
@ -210,7 +210,8 @@ export const damageKeyToNumber = key => {
|
||||||
none: 0,
|
none: 0,
|
||||||
minor: 1,
|
minor: 1,
|
||||||
major: 2,
|
major: 2,
|
||||||
severe: 3
|
severe: 3,
|
||||||
|
any: 4
|
||||||
}[key];
|
}[key];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ const registerMenus = () => {
|
||||||
hint: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.variantRules.hint'),
|
hint: game.i18n.localize('DAGGERHEART.SETTINGS.Menu.variantRules.hint'),
|
||||||
icon: CONFIG.DH.SETTINGS.menu.VariantRules.Icon,
|
icon: CONFIG.DH.SETTINGS.menu.VariantRules.Icon,
|
||||||
type: DhVariantRuleSettings,
|
type: DhVariantRuleSettings,
|
||||||
restricted: false
|
restricted: true
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,12 +45,6 @@
|
||||||
"mode": 5,
|
"mode": 5,
|
||||||
"value": "1",
|
"value": "1",
|
||||||
"priority": null
|
"priority": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.damageReduction.stressDamageReduction.severe.enabled",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1",
|
|
||||||
"priority": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"disabled": false,
|
"disabled": false,
|
||||||
|
|
|
||||||
|
|
@ -101,12 +101,6 @@
|
||||||
"mode": 5,
|
"mode": 5,
|
||||||
"value": "1",
|
"value": "1",
|
||||||
"priority": null
|
"priority": null
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.damageReduction.stressDamageReduction.any.enabled",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1",
|
|
||||||
"priority": null
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"disabled": false,
|
"disabled": false,
|
||||||
|
|
|
||||||
|
|
@ -671,6 +671,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tagify__dropdown {
|
.tagify__dropdown {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.0.2",
|
"version": "1.0.4",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13",
|
"minimum": "13",
|
||||||
"verified": "13.347",
|
"verified": "13.347",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue