forked from phenom/healer-man
Release Healer Man 0.1.49
This commit is contained in:
1 parent
39425f2494
commit
612170afd0
91 files changed
+2278
-263
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import type { ClassId } from "../app/characterCatalog";
|
||||
import {
|
||||
abilitiesForClass,
|
||||
abilityAtLevel,
|
||||
learnedAbilityForBuild,
|
||||
type AbilityDefinition,
|
||||
} from "./abilityCatalog";
|
||||
import {
|
||||
@@ -82,21 +82,14 @@ const PRIMARY_LOADOUT_CONTROLS: readonly ActionBindingControl[] = [
|
||||
"face-right",
|
||||
];
|
||||
|
||||
function learnedTalentRank(ability: AbilityDefinition, talentRanks: Readonly<Record<string, number>>): number {
|
||||
return ability.talentEntryId === undefined
|
||||
? 0
|
||||
: Math.max(0, Math.trunc(talentRanks[`coa-entry-${ability.talentEntryId}`] ?? 0));
|
||||
}
|
||||
|
||||
function isSelectableClientSpell(
|
||||
ability: AbilityDefinition,
|
||||
level: number,
|
||||
talentRanks: Readonly<Record<string, number>>,
|
||||
): boolean {
|
||||
return !ability.passive
|
||||
&& ability.unlockLevel <= level
|
||||
&& CLIENT_GROUNDED_SOURCES.has(ability.source)
|
||||
&& (ability.talentEntryId === undefined || learnedTalentRank(ability, talentRanks) > 0);
|
||||
&& learnedAbilityForBuild(ability, level, talentRanks) !== null;
|
||||
}
|
||||
|
||||
export function manastormActiveSpellLoadoutModel(
|
||||
@@ -108,7 +101,7 @@ export function manastormActiveSpellLoadoutModel(
|
||||
const options = abilitiesForClass(classId)
|
||||
.filter((ability) => isSelectableClientSpell(ability, level, talentRanks))
|
||||
.map((ability) => {
|
||||
const resolved = abilityAtLevel(ability, level, learnedTalentRank(ability, talentRanks));
|
||||
const resolved = learnedAbilityForBuild(ability, level, talentRanks)!;
|
||||
return Object.freeze({
|
||||
id: ability.id,
|
||||
abilityId: ability.id,
|
||||
|
||||
Reference in new issue
Block a user