mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Added Modifiers
This commit is contained in:
parent
51a0fb82eb
commit
e32454b7c7
9 changed files with 344 additions and 205 deletions
|
|
@ -1,5 +1,33 @@
|
|||
export const BaseBPPerEncounter = nrCharacters => 3 * nrCharacters + 2;
|
||||
|
||||
export const AdversaryBPPerEncounter = (adversaries, characters) => {
|
||||
const adversaryTypes = CONFIG.DH.ACTOR.allAdversaryTypes();
|
||||
return adversaries
|
||||
.reduce((acc, adversary) => {
|
||||
const existingEntry = acc.find(
|
||||
x => x.adversary.name === adversary.name && x.adversary.type === adversary.type
|
||||
);
|
||||
if (existingEntry) {
|
||||
existingEntry.nr += 1;
|
||||
} else {
|
||||
acc.push({ adversary, nr: 1 });
|
||||
}
|
||||
return acc;
|
||||
}, [])
|
||||
.reduce((acc, entry) => {
|
||||
const adversary = entry.adversary;
|
||||
const type = adversaryTypes[adversary.type];
|
||||
const bpCost = type.bpCost ?? 0;
|
||||
if (type.partyAmountPerBP) {
|
||||
acc += characters.length === 0 ? 0 : Math.ceil(entry.nr / characters.length);
|
||||
} else {
|
||||
acc += bpCost;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, 0);
|
||||
};
|
||||
|
||||
export const adversaryTypeCostBrackets = {
|
||||
1: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue