forked from phenom/healer-man
Complete RoM pair elite mechanics and creature family rules
This commit is contained in:
1 parent
c8b3a3d95a
commit
0206fda9e2
21 files changed
+1082
-134
No files matched your search
@@ -13,7 +13,8 @@ import {
|
||||
type RotationFriendlyTarget,
|
||||
} from "./combatRotation";
|
||||
import { spendDeathKnightRunes } from "./combatResources";
|
||||
import { equipmentAdjustedCombatAmount, type MobCombatState } from "./combatStore";
|
||||
import { resolveResourceValue } from "./combatAuras";
|
||||
import { equipmentAdjustedCombatAmount, useCombatStore, type MobCombatState } from "./combatStore";
|
||||
import type { PartyMember } from "./partyStore";
|
||||
import { baseResourcesFor } from "./wotlkStats";
|
||||
import { companionResourceMaximum } from "./combatActorAuthority";
|
||||
@@ -51,12 +52,20 @@ function currentResource(member: PartyMember, type: ResourceType): number {
|
||||
}
|
||||
|
||||
function abilityCosts(member: PartyMember, ability: AbilityDefinition): readonly { resource: ResourceType; amount: number }[] {
|
||||
return (ability.costs?.length ? ability.costs : [ability.cost]).map((cost) => ({
|
||||
resource: cost.resource,
|
||||
amount: cost.percentage ? cost.amount / 100 * (cost.percentageBasis === "base-mana"
|
||||
const auras = useCombatStore.getState().auras.filter((aura) => aura.targetId === member.id);
|
||||
return (ability.costs?.length ? ability.costs : [ability.cost]).map((cost) => {
|
||||
const maximum = cost.percentageBasis === "base-mana"
|
||||
? baseResourcesFor(member.classId, member.level).mana
|
||||
: cost.resource === "health" ? member.maxHealth : companionResourceMaximum(member, cost.resource)) : cost.amount,
|
||||
}));
|
||||
: cost.resource === "health" ? member.maxHealth : companionResourceMaximum(member, cost.resource);
|
||||
const baseAmount = cost.percentage ? cost.amount / 100 * maximum : cost.amount;
|
||||
const adjusted = resolveResourceValue(
|
||||
resolveResourceValue(baseAmount, auras, cost.resource, "cost"),
|
||||
auras,
|
||||
"power",
|
||||
"cost",
|
||||
);
|
||||
return { resource: cost.resource, amount: Math.max(0, Math.round(adjusted)) };
|
||||
});
|
||||
}
|
||||
|
||||
export function partyAbilityIsReady(
|
||||
|
||||
Reference in new issue
Block a user