protected override void Calculate() { float tableSize = 0.0f; // Miss Miss = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Miss, Options.TargetLevel)); tableSize += Miss; // Dodge Dodge = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Dodge, Options.TargetLevel)); tableSize += Dodge; // Parry Parry = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Parry, Options.TargetLevel)); tableSize += Parry; // Block if (Character.OffHand != null && Character.OffHand.Type == ItemType.Shield) { Block = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Character, Stats, HitResult.Block, Options.TargetLevel)); tableSize += Block; } // Critical Hit Critical = Math.Min(1.0f - tableSize, Lookup.TargetCritChance(Character, Stats, Options.TargetLevel)); tableSize += Critical; // Normal Hit Hit = Math.Max(0.0f, 1.0f - tableSize); }
protected override void Calculate() { float tableSize = 0.0f; // Miss Miss = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Player, HitResult.Miss)); tableSize += Miss; // Dodge Dodge = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Player, HitResult.Dodge)); tableSize += Dodge; // Parry Parry = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Player, HitResult.Parry)); tableSize += Parry; // Block if (Player.Character.OffHand != null && Player.Character.OffHand.Type == ItemType.Shield) { Block = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Player, HitResult.Block)); BaseBlock = Block; BuffedBlock = Block; CriticalBlock = Block * Math.Min(1.0f, Lookup.AvoidanceChance(Player, HitResult.CritBlock)); BaseCriticalBlock = CriticalBlock; BuffedCriticalBlock = CriticalBlock; // Average in Shield Block if Enabled if (Player.CalcOpts.UseShieldBlock) { float shieldBlockUptime = 10.0f / Player.CalcOpts.ShieldBlockInterval; BuffedBlock = Math.Min(1.0f - tableSize, Lookup.AvoidanceChance(Player, HitResult.Block) + 0.25f); BuffedCriticalBlock = BuffedBlock * Math.Min(1.0f, Lookup.AvoidanceChance(Player, HitResult.CritBlock) + (0.25f - (BuffedBlock - Block))); Block = (Block * (1.0f - shieldBlockUptime)) + (BuffedBlock * shieldBlockUptime); CriticalBlock = (CriticalBlock * (1.0f - shieldBlockUptime)) + (BuffedCriticalBlock * shieldBlockUptime); } tableSize += Block; Block -= CriticalBlock; BaseBlock -= BaseCriticalBlock; BuffedBlock -= BuffedCriticalBlock; } // Critical Hit Critical = Math.Min(1.0f - tableSize, Lookup.TargetCritChance(Player)); tableSize += Critical; // Normal Hit Hit = Math.Max(0.0f, 1.0f - tableSize); }