mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
Move scaling data to actorConfig
This commit is contained in:
parent
ea9edf6f98
commit
3d77ab82a8
2 changed files with 308 additions and 310 deletions
|
|
@ -494,3 +494,309 @@ export const subclassFeatureLabels = {
|
|||
2: 'DAGGERHEART.ITEMS.DomainCard.specializationTitle',
|
||||
3: 'DAGGERHEART.ITEMS.DomainCard.masteryTitle'
|
||||
};
|
||||
|
||||
/**
|
||||
* @typedef {Object} TierData
|
||||
* @property {number} difficulty
|
||||
* @property {number} majorThreshold
|
||||
* @property {number} severeThreshold
|
||||
* @property {number} hp
|
||||
* @property {number} stress
|
||||
* @property {number} attack
|
||||
* @property {number[]} damage
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {Record<string, Record<2 | 3 | 4, TierData> & Record<1, { damage: number[] }>}
|
||||
* Scaling data used to change an adversary's tier. Each rank is applied incrementally.
|
||||
*/
|
||||
export const adversaryScalingData = {
|
||||
bruiser: {
|
||||
1: {
|
||||
damage: [8, 11]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 2,
|
||||
attack: 2,
|
||||
damage: [12, 16]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [18, 22]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [30, 45]
|
||||
}
|
||||
},
|
||||
horde: {
|
||||
1: {
|
||||
damage: [5, 8]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 8,
|
||||
hp: 2,
|
||||
stress: 0,
|
||||
attack: 0,
|
||||
damage: [9, 13]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 12,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [14, 19]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 10,
|
||||
severeThreshold: 15,
|
||||
hp: 2,
|
||||
stress: 0,
|
||||
attack: 0,
|
||||
damage: [20, 30]
|
||||
}
|
||||
},
|
||||
leader: {
|
||||
1: {
|
||||
damage: [6, 9]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 6,
|
||||
severeThreshold: 10,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [12, 15]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 6,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [15, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 3,
|
||||
damage: [25, 35]
|
||||
}
|
||||
},
|
||||
minion: {
|
||||
1: {
|
||||
damage: [1, 3]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [2, 4]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [5, 8]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [10, 12]
|
||||
}
|
||||
},
|
||||
ranged: {
|
||||
1: {
|
||||
damage: [6, 9]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 6,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [12, 16]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 14,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [15, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [25, 35]
|
||||
}
|
||||
},
|
||||
skulk: {
|
||||
1: {
|
||||
damage: [5, 8]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [9, 13]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 12,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [14, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [20, 35]
|
||||
}
|
||||
},
|
||||
solo: {
|
||||
1: {
|
||||
damage: [8, 11]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [15, 20]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 2,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [20, 30]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 3,
|
||||
damage: [30, 45]
|
||||
}
|
||||
},
|
||||
standard: {
|
||||
1: {
|
||||
damage: [4, 6]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [8, 12]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [12, 17]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 10,
|
||||
severeThreshold: 15,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [17, 20]
|
||||
}
|
||||
},
|
||||
support: {
|
||||
1: {
|
||||
damage: [3, 5]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [5, 12]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 12,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [13, 16]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [18, 25]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import { ActionField } from '../fields/actionField.mjs';
|
|||
import BaseDataActor, { commonActorRules } from './base.mjs';
|
||||
import { resourceField, bonusField } from '../fields/actorField.mjs';
|
||||
import { parseTermsFromSimpleFormula } from '../../helpers/utils.mjs';
|
||||
import { adversaryScalingData } from '../../config/actorConfig.mjs';
|
||||
|
||||
export default class DhpAdversary extends BaseDataActor {
|
||||
static LOCALIZATION_PREFIXES = ['DAGGERHEART.ACTORS.Adversary'];
|
||||
|
|
@ -199,7 +200,7 @@ export default class DhpAdversary extends BaseDataActor {
|
|||
.fill(0)
|
||||
.map((_, idx) => idx + Math.min(tier, this.tier) + 1);
|
||||
if (tier < this.tier) tiers.reverse();
|
||||
const typeData = ADVERSARY_DATA[source.system.type] ?? ADVERSARY_DATA[source.system.standard];
|
||||
const typeData = adversaryScalingData[source.system.type] ?? adversaryScalingData[source.system.standard];
|
||||
const tierEntries = tiers.map(t => ({ tier: t, ...typeData[t] }));
|
||||
|
||||
// Apply simple tier changes
|
||||
|
|
@ -232,10 +233,6 @@ export default class DhpAdversary extends BaseDataActor {
|
|||
value.flatMultiplier = Math.max(0, value.flatMultiplier + tier - source.system.tier);
|
||||
const baseAverage = (value.flatMultiplier * (Number(value.dice.replace('d', '')) + 1)) / 2;
|
||||
value.bonus = Math.round(newMean - baseAverage);
|
||||
} else {
|
||||
ui.notifications.error(
|
||||
`Failed to convert item ${item.name}: Other kinds of damage is currently unsupported`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -288,308 +285,3 @@ export default class DhpAdversary extends BaseDataActor {
|
|||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} TierData
|
||||
* @property {number} difficulty
|
||||
* @property {number} majorThreshold
|
||||
* @property {number} severeThreshold
|
||||
* @property {number} hp
|
||||
* @property {number} stress
|
||||
* @property {number} attack
|
||||
* @property {number[]} damage
|
||||
*/
|
||||
|
||||
/** @typedef {Record<2 | 3 | 4, TierData> & Record<1, { damage: number[] }} AdversaryScalingData */
|
||||
|
||||
/** @type {Record<string, AdversaryScalingData>} */
|
||||
export const ADVERSARY_DATA = {
|
||||
bruiser: {
|
||||
1: {
|
||||
damage: [8, 11]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 2,
|
||||
attack: 2,
|
||||
damage: [12, 16]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [18, 22]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [30, 45]
|
||||
}
|
||||
},
|
||||
horde: {
|
||||
1: {
|
||||
damage: [5, 8]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 8,
|
||||
hp: 2,
|
||||
stress: 0,
|
||||
attack: 0,
|
||||
damage: [9, 13]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 12,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [14, 19]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 10,
|
||||
severeThreshold: 15,
|
||||
hp: 2,
|
||||
stress: 0,
|
||||
attack: 0,
|
||||
damage: [20, 30]
|
||||
}
|
||||
},
|
||||
leader: {
|
||||
1: {
|
||||
damage: [6, 9]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 6,
|
||||
severeThreshold: 10,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [12, 15]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 6,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 2,
|
||||
damage: [15, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 3,
|
||||
damage: [25, 35]
|
||||
}
|
||||
},
|
||||
minion: {
|
||||
1: {
|
||||
damage: [1, 3]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [2, 4]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [5, 8]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 0,
|
||||
severeThreshold: 0,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [10, 12]
|
||||
}
|
||||
},
|
||||
ranged: {
|
||||
1: {
|
||||
damage: [6, 9]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 6,
|
||||
hp: 1,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [12, 16]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 14,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [15, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [25, 35]
|
||||
}
|
||||
},
|
||||
skulk: {
|
||||
1: {
|
||||
damage: [5, 8]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [9, 13]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 12,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [14, 18]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [20, 35]
|
||||
}
|
||||
},
|
||||
solo: {
|
||||
1: {
|
||||
damage: [8, 11]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 5,
|
||||
severeThreshold: 10,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [15, 20]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 2,
|
||||
stress: 1,
|
||||
attack: 2,
|
||||
damage: [20, 30]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 12,
|
||||
severeThreshold: 25,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 3,
|
||||
damage: [30, 45]
|
||||
}
|
||||
},
|
||||
standard: {
|
||||
1: {
|
||||
damage: [4, 6]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [8, 12]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 15,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [12, 17]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 10,
|
||||
severeThreshold: 15,
|
||||
hp: 0,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [17, 20]
|
||||
}
|
||||
},
|
||||
support: {
|
||||
1: {
|
||||
damage: [3, 5]
|
||||
},
|
||||
2: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 3,
|
||||
severeThreshold: 8,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [5, 12]
|
||||
},
|
||||
3: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 7,
|
||||
severeThreshold: 12,
|
||||
hp: 0,
|
||||
stress: 0,
|
||||
attack: 1,
|
||||
damage: [13, 16]
|
||||
},
|
||||
4: {
|
||||
difficulty: 2,
|
||||
majorThreshold: 8,
|
||||
severeThreshold: 10,
|
||||
hp: 1,
|
||||
stress: 1,
|
||||
attack: 1,
|
||||
damage: [18, 25]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue