Validate RoM primary five hybrid stats and pair mechanics
This commit is contained in:
1 parent
8e95480d4f
commit
c8b3a3d95a
18 files changed
+2061
-48
No files matched your search
@@ -0,0 +1,213 @@
|
||||
import type { AbilityDefinition, AbilityEffect } from "./abilityCatalog";
|
||||
import type { RomGeneratedAbilityLike } from "./romAbilitySemantics";
|
||||
|
||||
function passiveState(sourceId: number, name: string, tag: string): readonly AbilityEffect[] {
|
||||
return [{
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
id: `rom-pair-passive-${sourceId}`,
|
||||
name,
|
||||
disposition: "buff",
|
||||
durationMs: null,
|
||||
utilityTags: [tag],
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: -1,
|
||||
miscValue: 0,
|
||||
triggerSpellId: sourceId,
|
||||
}];
|
||||
}
|
||||
|
||||
/** Source-specific pair mechanics that the generic component translator cannot infer. */
|
||||
export function overrideRomPriestKnightEffects(
|
||||
row: RomGeneratedAbilityLike,
|
||||
translated: readonly AbilityEffect[],
|
||||
): readonly AbilityEffect[] | null {
|
||||
switch (row.sourceSkillId) {
|
||||
case 492355: // Enhanced Grace of Life: Grace of Life also raises maximum MP.
|
||||
return passiveState(492355, row.name, "rom-enhanced-grace-of-life");
|
||||
case 492361: // Life Link: Urgent Heal also heals its caster.
|
||||
return passiveState(492361, row.name, "rom-life-link");
|
||||
case 499968: // Splendor Ripple: a triggered extra heal on source skill 499967.
|
||||
return passiveState(499968, row.name, "rom-splendor-ripple");
|
||||
case 499957: // Light Guidance: activate healing bonus only with source state 499966.
|
||||
return passiveState(499957, row.name, "rom-light-guidance");
|
||||
case 491610: // Enhanced Holy Strike: improves Holy Strike weapon damage.
|
||||
return passiveState(491610, row.name, "rom-enhanced-holy-strike");
|
||||
case 490066: // Weaken Weapon Strength: Heavenly Arrow weakens target physical damage.
|
||||
return passiveState(490066, row.name, "rom-weaken-weapon-strength");
|
||||
case 499926: // Evil Shackles: Holy Chains can root any creature with shorter duration.
|
||||
return passiveState(499926, row.name, "rom-evil-shackles");
|
||||
case 499923: // Blood Punishment: source skill 499924 grants conditional bonuses.
|
||||
return passiveState(499923, row.name, "rom-blood-punishment");
|
||||
case 491648: // Last Prayer affects only the next spell's cast time.
|
||||
return [{
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
id: "rom-pair-last-prayer-next-spell",
|
||||
name: row.name,
|
||||
disposition: "buff",
|
||||
durationMs: null,
|
||||
utilityTags: ["rom-last-prayer"],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 51,
|
||||
miscValue: -1_000,
|
||||
triggerSpellId: 0,
|
||||
}];
|
||||
case 493271: // Light Fairy has source lifetime -1; keep it until dismissal or session end.
|
||||
return translated.map((effect) => effect.kind === "summon"
|
||||
? { ...effect, durationMs: 86_400_000 }
|
||||
: effect);
|
||||
case 492639: // Calm Heart, component 502908: 10 seconds of Fear immunity.
|
||||
return [{
|
||||
kind: "apply-aura",
|
||||
recipient: "ability-target",
|
||||
aura: {
|
||||
id: "rom-pair-calm-heart-fear-immunity",
|
||||
name: row.name,
|
||||
disposition: "buff",
|
||||
durationMs: 10_000,
|
||||
controlImmunities: ["fear"],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: -1,
|
||||
miscValue: 0,
|
||||
triggerSpellId: 0,
|
||||
}];
|
||||
case 493046: // Sacred Protection, component 503290: +100 shield block for 20 seconds.
|
||||
return [{
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
id: "rom-pair-sacred-protection-block",
|
||||
name: row.name,
|
||||
disposition: "buff",
|
||||
durationMs: 20_000,
|
||||
modifiers: [{ kind: "stat", stat: "block-chance", operation: "flat", value: 100 }],
|
||||
utilityTags: ["rom-sacred-protection"],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 172,
|
||||
miscValue: 100,
|
||||
triggerSpellId: 0,
|
||||
}];
|
||||
case 493273: // Disregard Danger: redirect 40% of one hit; caster gains 20 Parry.
|
||||
return [
|
||||
{
|
||||
kind: "apply-aura",
|
||||
recipient: "ability-target",
|
||||
aura: {
|
||||
id: "rom-pair-disregard-danger-redirect",
|
||||
name: row.name,
|
||||
disposition: "buff",
|
||||
durationMs: 10_000,
|
||||
redirectDamagePercent: 0.4,
|
||||
utilityTags: ["rom-disregard-danger-one-hit"],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 143,
|
||||
miscValue: 40,
|
||||
triggerSpellId: 491614,
|
||||
},
|
||||
{
|
||||
kind: "apply-aura",
|
||||
recipient: "caster",
|
||||
aura: {
|
||||
id: "rom-pair-disregard-danger-parry",
|
||||
name: `${row.name}: Parry`,
|
||||
disposition: "buff",
|
||||
durationMs: 10_000,
|
||||
modifiers: [{ kind: "stat", stat: "parry", operation: "flat", value: 20 }],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 22,
|
||||
miscValue: 20,
|
||||
triggerSpellId: 0,
|
||||
},
|
||||
];
|
||||
case 491613: // Holy Chains only roots; source flag 67 is not three controls.
|
||||
return translated.filter((effect) => effect.kind === "apply-aura" && effect.control?.kind === "root");
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function hasTag(tags: readonly string[] | ReadonlySet<string>, tag: string): boolean {
|
||||
return Array.isArray(tags) ? tags.includes(tag) : (tags as ReadonlySet<string>).has(tag);
|
||||
}
|
||||
|
||||
/** Apply passive pair upgrades when their parent skill is actually cast. */
|
||||
export function romPriestKnightCastEffects(
|
||||
ability: AbilityDefinition,
|
||||
effects: readonly AbilityEffect[],
|
||||
passiveTags: readonly string[] | ReadonlySet<string>,
|
||||
casterMaxHealth: number,
|
||||
): readonly AbilityEffect[] {
|
||||
if (ability.source !== "runewaker" || casterMaxHealth <= 0) return effects;
|
||||
switch (ability.dbcSpellId) {
|
||||
case 490290: // Enhanced Grace of Life mirrors source Grace's +50 and +1% HP as MP.
|
||||
if (!hasTag(passiveTags, "rom-enhanced-grace-of-life")) return effects;
|
||||
return [...effects, {
|
||||
kind: "apply-aura",
|
||||
recipient: "ability-target",
|
||||
aura: {
|
||||
id: "rom-pair-enhanced-grace-mana",
|
||||
name: "Enhanced Grace of Life: Mana",
|
||||
disposition: "buff",
|
||||
durationMs: 1_800_000,
|
||||
modifiers: [
|
||||
{ kind: "resource", resource: "mana", property: "maximum", operation: "flat", value: 50 },
|
||||
{ kind: "resource", resource: "mana", property: "maximum", operation: "percent", value: 0.01 },
|
||||
],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: 8,
|
||||
miscValue: 50,
|
||||
triggerSpellId: 492355,
|
||||
}];
|
||||
case 491147: // Life Link duplicates Urgent Heal's effective payload on the caster.
|
||||
if (!hasTag(passiveTags, "rom-life-link")) return effects;
|
||||
return [...effects, ...effects.filter((effect) => effect.kind === "heal")
|
||||
.map((effect) => ({ ...effect, recipient: "caster" as const }))];
|
||||
case 490148: // Enhanced Holy Strike adds a conservative hybrid weapon bonus.
|
||||
if (!hasTag(passiveTags, "rom-enhanced-holy-strike")) return effects;
|
||||
return effects.map((effect) => effect.kind === "damage"
|
||||
? { ...effect, coefficient: effect.coefficient * 1.1 }
|
||||
: effect);
|
||||
case 491354: // Weaken Weapon Strength debuffs targets hit by Heavenly Arrow.
|
||||
if (!hasTag(passiveTags, "rom-weaken-weapon-strength")) return effects;
|
||||
return [...effects, {
|
||||
kind: "apply-aura",
|
||||
recipient: "ability-target",
|
||||
aura: {
|
||||
id: "rom-pair-heavenly-arrow-weaken",
|
||||
name: "Weaken Weapon Strength",
|
||||
disposition: "debuff",
|
||||
durationMs: 10_000,
|
||||
modifiers: [{ kind: "damage", direction: "dealt", school: "physical", operation: "percent", value: -0.1 }],
|
||||
dispelCategory: "magic",
|
||||
},
|
||||
sourceEffectType: -1,
|
||||
sourceAuraType: -1,
|
||||
miscValue: -10,
|
||||
triggerSpellId: 490066,
|
||||
}];
|
||||
case 491613: { // Evil Shackles halves duration on non-undead/demon targets.
|
||||
if (!hasTag(passiveTags, "rom-evil-shackles") || hasTag(passiveTags, "rom-target-undead-demon")) return effects;
|
||||
return effects.map((effect) => effect.kind === "apply-aura" && effect.control?.kind === "root"
|
||||
? { ...effect, aura: { ...effect.aura, durationMs: Math.max(1_000, Math.round((effect.aura.durationMs ?? 10_000) / 2)) } }
|
||||
: effect);
|
||||
}
|
||||
default:
|
||||
return effects;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user