mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/112 items use action datamodel (#194)
* Fix action for items * Cost & Range #1 * remove log * actions * Split methods * Roll classes * Begin damage * g * Actions * before main merge * Fix d20RollDialog costs check * Fix submit on close * Add uses in action dialog * Adversary Attack * 166 - Damage Reduction (#180) * Temp * Fixed Stress Reductions * Changed from index based to object * Fixed stress resources management for DamageReduction * Fix Adversary attack multiplier * Auto add Attack action to newly created weapon * Few fixes * 164 - Add Hope/Fear formula * 163 - Actor Sub Datas (#182) * Added rules/bonuses for all classes and subclasses * More * Add Save * Fix delete action button --------- Co-authored-by: WBHarry <williambjrklund@gmail.com> Co-authored-by: WBHarry <89362246+WBHarry@users.noreply.github.com>
This commit is contained in:
parent
1135669d0b
commit
3593f44612
77 changed files with 3707 additions and 1828 deletions
|
|
@ -233,3 +233,29 @@ Roll.replaceFormulaData = function (formula, data, { missing, warn = false } = {
|
|||
formula = terms.reduce((a, c) => a.replaceAll(`@${c.term}`, data[c.term] ?? c.default), formula);
|
||||
return nativeReplaceFormulaData(formula, data, { missing, warn });
|
||||
};
|
||||
|
||||
export const getDamageLabel = damage => {
|
||||
switch (damage) {
|
||||
case 3:
|
||||
return game.i18n.localize('DAGGERHEART.General.Damage.Severe');
|
||||
case 2:
|
||||
return game.i18n.localize('DAGGERHEART.General.Damage.Major');
|
||||
case 1:
|
||||
return game.i18n.localize('DAGGERHEART.General.Damage.Minor');
|
||||
case 0:
|
||||
return game.i18n.localize('DAGGERHEART.General.Damage.None');
|
||||
}
|
||||
};
|
||||
|
||||
export const damageKeyToNumber = key => {
|
||||
switch (key) {
|
||||
case 'severe':
|
||||
return 3;
|
||||
case 'major':
|
||||
return 2;
|
||||
case 'minor':
|
||||
return 1;
|
||||
case 'none':
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue