5.6 KiB
Essence Refining Investigation Findings
Bug 15: Essence Refining Effect Not Applied
Executive Summary
The Essence Refining skill (and related enchantPower perks) are NOT WORKING. The skill sets up the enchantPower stat, but this stat is never applied to enchantment effects.
Root Cause
-
Skill Definition (
/src/lib/game/constants/skills.ts, line 22):essenceRefiningskill is defined with description "+10% enchantment effect power"- Max level: 1, so provides +10% when learned
-
Perk Definitions (
/src/lib/game/skill-evolution.ts):- Multiple perks set
enchantPowermultiplier (e.g.,Essence Weave+15%,Greater Weave+25%) - These perks correctly create effects with
{ type: 'multiplier', stat: 'enchantPower', value: 0.15 }
- Multiple perks set
-
MISSING IMPLEMENTATION (
/src/lib/game/upgrade-effects.ts):- The
computeEffects()function processes all upgrade effects enchantPoweris NOT handled in the switch statement (lines ~260-300)- The
ComputedEffectsinterface does NOT have anenchantPowerfield
- The
-
MISSING APPLICATION (
/src/lib/game/effects.ts):- The
computeEquipmentEffects()function processes enchantment effects enchantPowermultiplier is NEVER applied to enchantment values- Enchantment bonuses and multipliers are computed without any
enchantPowerscaling
- The
Enchantment Types Analysis
Based on /src/lib/game/data/enchantments/, here are all enchantment types and their compatibility:
1. Spell Effects (spell-effects.ts)
- Effect Type:
spell(grants ability to cast spells) - Compatible with Essence Refining: NO - Spell effects just grant spell access, no numeric values to multiply
- Examples:
spell_fireball,spell_lightningBolt,spell_pyroclasm
2. Mana Effects (mana-effects.ts)
- Effect Type:
bonus(for stats likemaxMana,regen,clickMana,weaponManaMax,weaponManaRegen) - Compatible with Essence Refining: YES - Bonus values should be multiplied
- Examples:
mana_cap_50(+50 max mana),mana_regen_1(+1 regen),weapon_mana_cap_20(+20 weapon mana)
3. Combat Effects (combat-effects.ts)
- Effect Type:
bonus(forbaseDamage,critChance) andmultiplier(forbaseDamage,attackSpeed) - Compatible with Essence Refining: YES - Both bonus and multiplier values should be scaled
- Examples:
damage_5(+5 damage),damage_pct_10(+10% damage),crit_5(+5% crit),attack_speed_10(+10% attack speed)
4. Elemental Effects (elemental-effects.ts)
- Effect Type:
special(forfireBlade,frostBlade,lightningBlade,voidBlade) - Compatible with Essence Refining: PARTIAL - Special effects may have internal damage values that should be scaled, but currently the special effects system doesn't support numeric scaling
- Examples:
sword_fire,sword_frost,sword_lightning,sword_void
5. Defense Effects (defense-effects.ts)
- Effect Type: Currently empty
- Compatible with Essence Refining: N/A
6. Utility Effects (utility-effects.ts)
- Effect Type:
multiplier(formeditationEfficiency,studySpeed,insightGain) - Compatible with Essence Refining: YES - Multiplier values should be scaled
- Examples:
meditate_10(+10% meditation),study_10(+10% study speed),insight_5(+5% insight)
7. Special Effects (special-effects.ts)
- Effect Type:
special(forspellEcho10,overpower,firstStrike,comboMaster,adrenalineRush) andmultiplier(forguardianDamage) - Compatible with Essence Refining: PARTIAL - The
guardianDamagemultiplier can be scaled, but pure special effects cannot - Examples:
spell_echo_10,guardian_dmg_10(+10% guardian damage),overpower_80,combo_master
Required Fix
To fix Bug 15, the following changes are needed:
-
Add
enchantPowertoComputedEffectsinterface (upgrade-effects.ts):export interface ComputedEffects { // ... existing fields ... enchantPower: number; // Multiplier for enchantment effects (1.0 = 100%) } -
Handle
enchantPowerincomputeEffects()(upgrade-effects.ts):- Initialize
enchantPower: 1in the default effects - Add case for
enchantPowerin the multiplier switch:case 'enchantPower': effects.enchantPower *= effect.value; break;
- Initialize
-
Apply
enchantPowerincomputeEquipmentEffects()(effects.ts):- Get
enchantPowerfromComputedEffects(viaupgradeEffects) - Multiply bonus values by
enchantPower - For multiplier effects, apply
enchantPowerto the base value before compounding
- Get
-
Consider special effects: For
specialtype effects that have damage/effectiveness values, the special effect handling code needs to also respectenchantPower.
Testing Recommendations
- Learn
Essence Refiningskill (+10% enchantment power) - Apply a
+50 max manaenchantment - should give +55 with skill - Apply a
+10% damageenchantment - should give +11% with skill - Verify spell effects are NOT affected (they don't have numeric values)
- Test with higher tier perks like
Essence Weave(+15%) andGreater Weave(+25%)
Files Requiring Modification
/src/lib/game/upgrade-effects.ts- AddenchantPowerhandling/src/lib/game/effects.ts- ApplyenchantPowerto equipment effects- Potentially
/src/lib/game/data/enchantments/special-effects.ts- If special effects need scaling
Priority
HIGH - This is a core enchanting skill that players expect to work. Currently, players are spending time learning Essence Refining and choosing enchantPower perks with no benefit.