Update Healer Man server
This commit is contained in:
1 parent
35dfdaed61
commit
4fb7a0b9c8
161 files changed
+24618
-529
No files matched your search
@@ -1,6 +1,9 @@
|
||||
import type { AbilityEffect } from "./abilityCatalog";
|
||||
import type { RomGeneratedAbilityLike } from "./romAbilitySemantics";
|
||||
|
||||
export const ROM_DRUID_GREEN_GUARDIAN_TAG = "rom-druid-green-guardian";
|
||||
export const ROM_DRUID_MOTHER_EARTH_PROTECTION_TAG = "rom-druid-mother-earth-protection";
|
||||
|
||||
function sourceDurationMs(row: RomGeneratedAbilityLike, fallbackSeconds: number): number {
|
||||
const duration = row.source?.components?.find((component) => (component.effectTime ?? 0) > 0)?.effectTime;
|
||||
return Math.max(1_000, Math.round((duration ?? fallbackSeconds) * 1_000));
|
||||
@@ -83,6 +86,26 @@ export function overrideRomDruidEffects(
|
||||
translated: readonly AbilityEffect[],
|
||||
): readonly AbilityEffect[] | null {
|
||||
switch (row.sourceSkillId) {
|
||||
case 493533:
|
||||
case 493558: { // Both Mother Earth's Protection ranks can trigger Green Guardian on expiry.
|
||||
let tagged = false;
|
||||
return translated.map((effect) => {
|
||||
if (tagged || effect.kind !== "apply-aura" || effect.aura.durationMs === null) return effect;
|
||||
tagged = true;
|
||||
return {
|
||||
...effect,
|
||||
aura: {
|
||||
...effect.aura,
|
||||
utilityTags: [...(effect.aura.utilityTags ?? []), ROM_DRUID_MOTHER_EARTH_PROTECTION_TAG],
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
case 494331: // Keep source HoT payloads on the learned passive for its expiry trigger.
|
||||
return [
|
||||
passiveState(494331, row.name, ROM_DRUID_GREEN_GUARDIAN_TAG),
|
||||
...translated.filter((effect) => effect.kind === "hot"),
|
||||
];
|
||||
case 493531: // Savage Blessing buffs a selected friendly target.
|
||||
return translated.map((effect) => effect.kind === "apply-aura" ? {
|
||||
...effect,
|
||||
@@ -134,7 +157,7 @@ function hasTag(tags: readonly string[] | ReadonlySet<string>, tag: string): boo
|
||||
}
|
||||
|
||||
function naturePowerDrain(): AbilityEffect {
|
||||
return { kind: "resource-drain", amount: 1, burn: false, resource: "nature-power" };
|
||||
return { kind: "resource-drain", amount: 1, burn: false, resource: "nature-power", recipient: "caster" };
|
||||
}
|
||||
|
||||
function spendBeforeNaturePowerRefund(effects: readonly AbilityEffect[]): readonly AbilityEffect[] {
|
||||
@@ -144,6 +167,18 @@ function spendBeforeNaturePowerRefund(effects: readonly AbilityEffect[]): readon
|
||||
return [...effects.slice(0, refundIndex), naturePowerDrain(), ...effects.slice(refundIndex)];
|
||||
}
|
||||
|
||||
function selectSeedModifierBranch(
|
||||
effects: readonly AbilityEffect[],
|
||||
componentIds: readonly [number, number],
|
||||
selectedComponentId: number,
|
||||
): readonly AbilityEffect[] {
|
||||
return effects.filter((effect) => {
|
||||
if (effect.kind !== "apply-aura") return true;
|
||||
const sourceComponentId = componentIds.find((id) => effect.aura.id.includes(`-${id}-`));
|
||||
return sourceComponentId === undefined || sourceComponentId === selectedComponentId;
|
||||
});
|
||||
}
|
||||
|
||||
/** Resolve Druid source branches that depend on current Nature Power or learned passive state. */
|
||||
export function romDruidCastEffects(
|
||||
ability: import("./abilityCatalog").AbilityDefinition,
|
||||
@@ -161,6 +196,32 @@ export function romDruidCastEffects(
|
||||
};
|
||||
|
||||
switch (ability.dbcSpellId) {
|
||||
case 494373: // Essence Extraction's 10% MP conversion is already represented as its cast cost.
|
||||
return effects.filter((effect) => !(effect.kind === "resource-drain" && effect.resource === "mana"));
|
||||
case 494937: { // Grace of the Forest only applies RuneWaker's second component while Nature Power is held.
|
||||
if (ability.classId !== "rom-druid" || ability.secondaryClassId !== "rom-warden") return effects;
|
||||
if (naturePower < 1) return effects.filter((effect) => effect.kind !== "apply-aura"
|
||||
|| !effect.aura.id.includes("-494937-505711-"));
|
||||
const poweredHealingPresent = effects.some((effect) => effect.kind === "apply-aura"
|
||||
&& effect.aura.id.includes("-494937-505711-")
|
||||
&& effect.aura.modifiers?.some((modifier) => modifier.kind === "healing"
|
||||
&& modifier.direction === "done" && modifier.operation === "percent" && modifier.value === 0.03));
|
||||
return poweredHealingPresent ? effects : [...effects, {
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
id: "rom-druid-grace-of-the-forest-powered-healing",
|
||||
name: `${ability.name}: Nature Power`,
|
||||
disposition: "buff",
|
||||
durationMs: 4_000,
|
||||
modifiers: [{ kind: "healing", direction: "done", operation: "percent", value: 0.03 }],
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 149,
|
||||
miscValue: 3,
|
||||
triggerSpellId: 494937,
|
||||
}];
|
||||
}
|
||||
case 493529: { // DMG1 is baseline; DMG0 is the one-point Nature Power branch.
|
||||
const selected = heals[empowered ? 1 : 0] ?? heals[0];
|
||||
if (!selected) return effects;
|
||||
@@ -175,9 +236,14 @@ export function romDruidCastEffects(
|
||||
...(empowered ? [naturePowerDrain()] : []),
|
||||
];
|
||||
}
|
||||
case 493546: // Weakening Seed consumes and refunds one point when powered.
|
||||
case 493545: // Withering Seed has the same source resource branch.
|
||||
return empowered ? spendBeforeNaturePowerRefund(effects) : effects;
|
||||
case 493546: { // Buff1 is the base branch; Buff0 is the powered branch.
|
||||
const selected = selectSeedModifierBranch(effects, [503815, 620458], empowered ? 620458 : 503815);
|
||||
return empowered ? spendBeforeNaturePowerRefund(selected) : selected;
|
||||
}
|
||||
case 493545: { // Buff1 is the base branch; Buff0 is the powered branch.
|
||||
const selected = selectSeedModifierBranch(effects, [503814, 620457], empowered ? 620457 : 503814);
|
||||
return empowered ? spendBeforeNaturePowerRefund(selected) : selected;
|
||||
}
|
||||
case 493549: { // Select DMG1/DMG0, keep the single source DoT, and consume one point if powered.
|
||||
const selectedDamage = damage[empowered ? 1 : 0];
|
||||
if (!selectedDamage) return effects;
|
||||
|
||||
Reference in new issue
Block a user