- Code: Select all
public virtual int CalculateSpellResistChance(GameLiving target)
{
if (m_spellLine.KeyName == GlobalSpellsLines.Combat_Styles_Effect)
return 0;
if (HasPositiveEffect)
return 0;
return 100 - CalculateToHitChance(target);
}
The inconsistency problem is that some inheriting classes choose to override CalcTHC and some choose to override CalcSRC. You can see there are two checks in the above method that should always be applied - these checks should not have to be duplicated in other code that decided to ignore CalcSRC and only utilize CalcTHC, but they are. Or they're ignored when they shouldn't be. This stands out as a bug to me which should be fixed, but fixing it would have a side-effect necessitating other fixes - since it's been in place so long, people have adopted the habit of assigning all style effect entries in the database to the "Combat Style Effects" spell line. I believe in fact we need two combat style effect lines - one for resistable effects, one for non-resistable. Or are all style effects supposed to be non-resistable (including Reaver Leviathan, Valewalker Blizzard Blade)?
After re-reading this, it occurred to me that the current system may have been intentional, but it strikes me as an odd (and undesirable) approach:
1. Set the base behavior to give Combat Style Effects 0% chance of being resisted.
2. In all inheriting spell handlers that want to adhere to 0% resist chance for combat style effects, use default CalcTHC/CalcSRC, or override CalcTHC for customized resist calcs.
3. In all inheriting spell handlers that don't want a 0% resist chance for combat style effects, override CalcSRC and possibly CalcTHC for customized resist calcs.
If this was intentional, it strikes me as a poor use of OOP and creates confusing code. Better to explicitly state in the style definition "this is a non-resistable style effect" or "this is a resistable style effect."