forked from phenom/healer-man
Update Healer Man server
This commit is contained in:
1 parent
6114a2295f
commit
69809f7228
593 files changed
+903643
-40774
No files matched your search
@@ -3,6 +3,8 @@ import type { AbilityDefinition } from "./abilityCatalog";
|
||||
/** CoA tree node 5744 / source spell 804414: Decapitate is usable below 35% health. */
|
||||
export const COA_BARBARIAN_DECAPITATE_TALENT_ENTRY_ID = 5744;
|
||||
export const COA_BARBARIAN_DECAPITATE_HEALTH_THRESHOLD = 0.35;
|
||||
/** Source node 6744 / spell 705222 refunds maximum Energy on a Decapitate kill. */
|
||||
export const COA_BARBARIAN_BEHEADER_TALENT_ENTRY_ID = 6744;
|
||||
|
||||
type CoaBarbarianDecapitateIdentity = Pick<AbilityDefinition, "classId" | "talentEntryId">;
|
||||
|
||||
@@ -30,3 +32,16 @@ export function coaBarbarianDecapitateTargetAllowed(
|
||||
|| target.health! <= 0 || target.maxHealth! <= 0) return false;
|
||||
return target.health! / target.maxHealth! < COA_BARBARIAN_DECAPITATE_HEALTH_THRESHOLD;
|
||||
}
|
||||
|
||||
export function coaBarbarianBeheaderEnergyRefund(
|
||||
ability: CoaBarbarianDecapitateIdentity,
|
||||
talentRanks: Readonly<Record<string, number>>,
|
||||
maximumEnergy: number,
|
||||
result: { readonly amount: number; readonly killed: boolean },
|
||||
): number {
|
||||
if (!isCoaBarbarianDecapitate(ability)
|
||||
|| !(talentRanks[`coa-entry-${COA_BARBARIAN_BEHEADER_TALENT_ENTRY_ID}`] > 0)
|
||||
|| !result.killed || !(result.amount > 0)
|
||||
|| !Number.isFinite(maximumEnergy) || maximumEnergy <= 0) return 0;
|
||||
return maximumEnergy;
|
||||
}
|
||||
Reference in new issue
Block a user