public static float GlancingReduction(Character character) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; return((Math.Min(0.91f, 1.3f - (0.05f * (calcOpts.TargetLevel - character.Level) * 5.0f)) + Math.Max(0.99f, 1.2f - (0.03f * (calcOpts.TargetLevel - character.Level) * 5.0f))) / 2); }
protected override void LoadCalculationOptions() { _loadingCalculationOptions = true; if (Character.CalculationOptions == null) { Character.CalculationOptions = new CalculationOptionsProtWarr(); } CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; comboBoxTargetLevel.SelectedItem = calcOpts.TargetLevel.ToString(); trackBarTargetArmor.Value = calcOpts.TargetArmor; trackBarBossAttackValue.Value = calcOpts.BossAttackValue; trackBarThreatScale.Value = (int)calcOpts.ThreatScale; trackBarMitigationScale.Value = calcOpts.MitigationScale; trackBarShieldBlockUptime.Value = (int)calcOpts.ShieldBlockUptime; checkBoxUseShieldBlock.Checked = calcOpts.UseShieldBlock; checkBoxEnforceMetagemRequirements.Checked = Character.EnforceMetagemRequirements; radioButtonAldor.Checked = calcOpts.ShattrathFaction == "Aldor"; radioButtonScryer.Checked = calcOpts.ShattrathFaction == "Scryer"; labelTargetArmorDescription.Text = trackBarTargetArmor.Value.ToString() + (armorBosses.ContainsKey(trackBarTargetArmor.Value) ? armorBosses[trackBarTargetArmor.Value] : ""); labelBossAttackValue.Text = trackBarBossAttackValue.Value.ToString(); labelThreatScale.Text = trackBarThreatScale.Value.ToString(); labelMitigationScale.Text = trackBarMitigationScale.Value.ToString(); labelShieldBlockUptime.Text = trackBarShieldBlockUptime.Value.ToString() + "%"; _loadingCalculationOptions = false; }
private void checkBoxUseShieldBlock_CheckedChanged(object sender, EventArgs e) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; calcOpts.UseShieldBlock = checkBoxUseShieldBlock.Checked; Character.OnItemsChanged(); }
public static float ArmorReduction(Character character, Stats stats) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; return(StatConversion.GetArmorDamageReduction(calcOpts.TargetLevel, stats.Armor, 0.0f, 0.0f, 0.0f)); // return Math.Max(0.0f, Math.Min(0.75f, stats.Armor / (stats.Armor + (467.5f * calcOpts.TargetLevel - 22167.5f)))); }
public static float MagicReduction(Character character, Stats stats, DamageType school) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; float damageReduction = Lookup.StanceDamageReduction(character, stats, school); float totalResist = stats.AllResist; float resistScale = 0.0f; switch (school) { case DamageType.Arcane: totalResist += stats.ArcaneResistance; break; case DamageType.Fire: totalResist += stats.FireResistance; break; case DamageType.Frost: totalResist += stats.FrostResistance; break; case DamageType.Nature: totalResist += stats.NatureResistance; break; case DamageType.Shadow: totalResist += stats.ShadowResistance; break; } if ((calcOpts.TargetLevel - character.Level) < 3) { resistScale = 400.0f; } else { // This number is still being tested by many and may be slightly higher resistScale = 510.0f; } return(Math.Max(0.0f, (1.0f - (totalResist / (resistScale + totalResist))) * damageReduction)); }
private void checkBoxEnforceMetagemRequirements_CheckedChanged(object sender, EventArgs e) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; Character.EnforceMetagemRequirements = checkBoxEnforceMetagemRequirements.Checked; Character.OnItemsChanged(); }
private void calculationOptionControl_Changed(object sender, EventArgs e) { if (!_loadingCalculationOptions) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; // Attacker Stats LB_BossAttackValue.Text = Bar_BossAttackValue.Value.ToString(); LB_BossAttackSpeedValue.Text = String.Format("{0:0.00}s", ((float)(Bar_BossAttackSpeed.Value) * 0.25f)); // Ranking System LB_ThreatScale.Text = String.Format("{0:0.0}", ((float)(Bar_ThreatScale.Value) * 0.1f)); LB_MitigationScaleValue.Text = String.Format("{0:0.0}", ((float)(Bar_MitigationScale.Value) * 0.1f)); // Warrior Abilities LB_VigilanceValue.Text = Bar_VigilanceValue.Value.ToString(); LB_HSFrequencyValue.Text = Bar_HSFrequency.Value.ToString() + "%"; calcOpts.TargetLevel = int.Parse(CB_TargetLevel.Text.ToString()); calcOpts.TargetArmor = int.Parse(CB_TargetArmor.Text); calcOpts.BossAttackValue = Bar_BossAttackValue.Value; calcOpts.BossAttackSpeed = ((float)(Bar_BossAttackSpeed.Value) * 0.25f); calcOpts.ThreatScale = ((float)(Bar_ThreatScale.Value) * 0.1f * 8.0f); calcOpts.MitigationScale = ((float)(Bar_MitigationScale.Value) * 0.1f / 8.0f); calcOpts.VigilanceValue = Bar_VigilanceValue.Value; calcOpts.HeroicStrikeFrequency = ((float)Bar_HSFrequency.Value / 100.0f); Character.OnCalculationsInvalidated(); } }
public AttackModel(Character character, Stats stats, AttackModelMode attackModelMode, RageModelMode rageModelMode) { Character = character; Options = Character.CalculationOptions as CalculationOptionsProtWarr; Stats = stats; DefendTable = new DefendTable(character, stats); ParryModel = new ParryModel(character, stats); _attackModelMode = attackModelMode; _rageModelMode = rageModelMode; Abilities.Add(Ability.None, character, stats); Abilities.Add(Ability.Cleave, character, stats); Abilities.Add(Ability.ConcussionBlow, character, stats); Abilities.Add(Ability.DamageShield, character, stats); Abilities.Add(Ability.DeepWounds, character, stats); Abilities.Add(Ability.Devastate, character, stats); Abilities.Add(Ability.HeroicStrike, character, stats); Abilities.Add(Ability.HeroicThrow, character, stats); Abilities.Add(Ability.Rend, character, stats); Abilities.Add(Ability.Revenge, character, stats); Abilities.Add(Ability.ShieldSlam, character, stats); Abilities.Add(Ability.Shockwave, character, stats); Abilities.Add(Ability.Slam, character, stats); Abilities.Add(Ability.SunderArmor, character, stats); Abilities.Add(Ability.ThunderClap, character, stats); Abilities.Add(Ability.Vigilance, character, stats); Calculate(); }
protected override void LoadCalculationOptions() { _loadingCalculationOptions = true; if (Character.CalculationOptions == null) { Character.CalculationOptions = new CalculationOptionsProtWarr(); } CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; // Attacker Stats CB_TargetLevel.Text = calcOpts.TargetLevel.ToString(); CB_TargetArmor.Text = (CB_TargetArmor.Items.Contains(calcOpts.TargetArmor.ToString()) ? calcOpts.TargetArmor.ToString() : CB_TargetArmor.Items[0].ToString()); Bar_BossAttackValue.Value = calcOpts.BossAttackValue; Bar_BossAttackSpeed.Value = (int)(calcOpts.BossAttackSpeed / 0.25f); CB_UseParryHaste.Checked = calcOpts.UseParryHaste; // Stupid hack since you can't put in newlines into the VS editor properties LB_UseParryHaste.ToolTipText = LB_UseParryHaste.ToolTipText.Replace("May not", Environment.NewLine + "May not"); // Fix for Saves With TankPoints Still Enabled if (calcOpts.RankingMode == 2) { calcOpts.RankingMode = 1; } // Ranking System if (calcOpts.ThreatScale > 24.0f) { calcOpts.ThreatScale = 8f; } // Old scale value being saved, reset to default if (calcOpts.MitigationScale > 1.0f) { calcOpts.MitigationScale = (1f / 8f); } // Old scale value being saved, reset to default Bar_ThreatScale.Value = Convert.ToInt32(calcOpts.ThreatScale / 8f / 0.1f); Bar_MitigationScale.Value = Convert.ToInt32((calcOpts.MitigationScale * 8.0f / 0.1f)); RB_MitigationScale.Checked = (calcOpts.RankingMode == 1); //RB_TankPoints.Checked = (calcOpts.RankingMode == 2); RB_BurstTime.Checked = (calcOpts.RankingMode == 3); RB_DamageOutput.Checked = (calcOpts.RankingMode == 4); Bar_ThreatScale.Enabled = LB_ThreatScale.Enabled = (calcOpts.RankingMode != 4); Bar_MitigationScale.Enabled = LB_MitigationScaleValue.Enabled = (calcOpts.RankingMode == 1); // Warrior Abilities CB_UseVigilance.Checked = calcOpts.UseVigilance; Bar_VigilanceValue.Enabled = calcOpts.UseVigilance; Bar_VigilanceValue.Value = (int)calcOpts.VigilanceValue; Bar_HSFrequency.Value = (int)Math.Round(calcOpts.HeroicStrikeFrequency * 100.0f, 0); // Label Text LB_BossAttackValue.Text = Bar_BossAttackValue.Value.ToString(); LB_BossAttackSpeedValue.Text = String.Format("{0:0.00}s", ((float)(Bar_BossAttackSpeed.Value) * 0.25f)); LB_ThreatScale.Text = String.Format("{0:0.0}", ((float)(Bar_ThreatScale.Value) * 0.1f)); LB_MitigationScaleValue.Text = String.Format("{0:0.0}", ((float)(Bar_MitigationScale.Value) * 0.1f)); LB_VigilanceValue.Text = Bar_VigilanceValue.Value.ToString(); LB_HSFrequencyValue.Text = Bar_HSFrequency.Value.ToString() + "%"; _loadingCalculationOptions = false; }
protected void Initialize(Character character, Stats stats, CalculationOptionsProtWarr options, Ability ability) { Character = character; Options = options; Stats = stats; Ability = ability; Calculate(); }
private void checkBoxUseParryHaste_CheckedChanged(object sender, EventArgs e) { if (!_loadingCalculationOptions) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; calcOpts.UseParryHaste = CB_UseParryHaste.Checked; Character.OnCalculationsInvalidated(); } }
public DefendModel(Character character, Stats stats) { Character = character; Stats = stats; Options = Character.CalculationOptions as CalculationOptionsProtWarr; ParryModel = new ParryModel(character, stats); DefendTable = new DefendTable(character, stats); Calculate(); }
public Player(Character character) { this.Character = character; this.Stats = new Base.StatsWarrior(); this.Talents = this.Character.WarriorTalents; this.CalcOpts = this.Character.CalculationOptions as CalculationOptionsProtWarr; this.BossOpts = this.Character.BossOptions; this.DefendModel = null; this.AttackModel = null; }
public ParryModel(Character character, Stats stats, CalculationOptionsProtWarr options) { Character = character; Stats = stats; Options = options; AttackTable = new AttackTable(character, stats, options); DefendTable = new DefendTable(character, stats, options); Calculate(); }
private void checkBoxUseVigilance_CheckedChanged(object sender, EventArgs e) { if (!_loadingCalculationOptions) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; calcOpts.UseVigilance = CB_UseVigilance.Checked; Bar_VigilanceValue.Enabled = CB_UseVigilance.Checked; Character.OnCalculationsInvalidated(); } }
public void LoadCalculationOptions() { _loadingCalculationOptions = true; if (Character.CalculationOptions == null) { Character.CalculationOptions = new CalculationOptionsProtWarr(); } calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; // Model Specific Code // _loadingCalculationOptions = false; }
public static float TargetArmorReduction(Character character, Stats stats) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; int targetArmor = calcOpts.TargetArmor; float ignoreArmor = 0.0f; if (character.MainHand != null && (character.MainHand.Type == ItemType.OneHandMace)) { ignoreArmor += character.WarriorTalents.MaceSpecialization * 0.03f; } return(StatConversion.GetArmorDamageReduction(character.Level, targetArmor, stats.ArmorPenetration, ignoreArmor, stats.ArmorPenetrationRating)); }
public AbilityModel(Character character, Stats stats, Ability ability) { Character = character; Stats = stats; Ability = ability; Options = Character.CalculationOptions as CalculationOptionsProtWarr; Talents = Character.WarriorTalents; AttackTable = new AttackTable(character, stats, ability); Name = Lookup.Name(Ability); ArmorReduction = Lookup.TargetArmorReduction(Character, Stats); DamageMultiplier = Lookup.StanceDamageMultipler(Character, Stats); CalculateDamage(); CalculateThreat(); }
public void LoadCalculationOptions() { _loadingCalculationOptions = true; if (Character.CalculationOptions == null) Character.CalculationOptions = new CalculationOptionsProtWarr(); calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; // Model Specific Code bool showSliders = false; if (calcOpts.RankingMode == 1) showSliders = true; LB_HitsToSurvive.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); NUD_HitsToSurvive.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); LB_ThreatScale.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); NUD_ThreatScale.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); _loadingCalculationOptions = false; }
public static float AvoidanceChance(Character character, Stats stats, HitResult avoidanceType) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; return(StatConversion.GetDRAvoidanceChance(character, stats, avoidanceType, calcOpts.TargetLevel)); /* * float defSkill = (float)Math.Floor(stats.DefenseRating * ProtWarr.DefenseRatingToDefense); * float baseAvoid = 0.0f; * float modifiedAvoid = 0.0f; * * switch (avoidanceType) * { * case HitResult.Dodge: * baseAvoid = stats.Dodge + (stats.BaseAgility * ProtWarr.AgilityToDodge) - LevelModifier(character); * modifiedAvoid = ((stats.Agility - stats.BaseAgility) * ProtWarr.AgilityToDodge) + * (stats.DodgeRating * ProtWarr.DodgeRatingToDodge) + (defSkill * ProtWarr.DefenseToDodge); * modifiedAvoid = 1.0f / (1.0f / 88.129021f + 0.9560f / modifiedAvoid); * break; * case HitResult.Parry: * baseAvoid = stats.Parry - LevelModifier(character); * modifiedAvoid = (stats.ParryRating * ProtWarr.ParryRatingToParry) + (defSkill * ProtWarr.DefenseToParry); * modifiedAvoid = 1.0f / (1.0f / 47.003525f + 0.9560f / modifiedAvoid); * break; * case HitResult.Miss: * baseAvoid = stats.Miss * 100f - LevelModifier(character); * modifiedAvoid = (defSkill * ProtWarr.DefenseToMiss); * modifiedAvoid = 1.0f / (1.0f / 16.0f + 0.9560f / modifiedAvoid); * break; * case HitResult.Block: * // The 5% base block should be moved into stats.Block as a base value like the others * baseAvoid = 5.0f + stats.Block - LevelModifier(character); * modifiedAvoid = (stats.BlockRating * ProtWarr.BlockRatingToBlock) + (defSkill * ProtWarr.DefenseToBlock); * break; * case HitResult.Crit: * modifiedAvoid = (defSkill * ProtWarr.DefenseToCritReduction) + (stats.Resilience * ProtWarr.ResilienceRatingToCritReduction); * break; * } * * // Many of the base values are whole numbers, so need to get it back to decimal. * // May want to look at making this more consistant in the future. * return (baseAvoid + modifiedAvoid) / 100.0f; */ }
public static float BonusCritPercentage(Character character, Stats stats) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; return(Math.Max(0.0f, Math.Min(1.0f, StatConversion.GetPhysicalCritFromRating(stats.CritRating, CharacterClass.Warrior) + StatConversion.GetPhysicalCritFromAgility(stats.Agility, CharacterClass.Warrior) + stats.PhysicalCrit - StatConversion.NPC_LEVEL_CRIT_MOD[calcOpts.TargetLevel - character.Level]))); /* * if ((calcOpts.TargetLevel - character.Level) < 3) * // This formula may or may not be accurate anymore, as the modifier on +1/2 mobs is untested * return Math.Min(1.0f, (((stats.CritRating * ProtWarr.CritRatingToCrit) + (stats.Agility * ProtWarr.AgilityToCrit) * - LevelModifier(character)) / 100.0f) + stats.PhysicalCrit); * else * // 4.8% critical hit supression as tested on bosses * return Math.Min(1.0f, (((stats.CritRating * ProtWarr.CritRatingToCrit) + (stats.Agility * ProtWarr.AgilityToCrit) * - 4.8f) / 100.0f) + stats.PhysicalCrit); */ }
public static float TargetAvoidanceChance(Character character, Stats stats, HitResult avoidanceType) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; switch (avoidanceType) { case HitResult.Miss: return(StatConversion.WHITE_MISS_CHANCE_CAP[calcOpts.TargetLevel - 80]); case HitResult.Dodge: return(StatConversion.YELLOW_DODGE_CHANCE_CAP[calcOpts.TargetLevel - 80] - (0.01f * character.WarriorTalents.WeaponMastery)); case HitResult.Parry: return(StatConversion.YELLOW_PARRY_CHANCE_CAP[calcOpts.TargetLevel - 80]); case HitResult.Glance: return(0.06f + ((calcOpts.TargetLevel - character.Level) * 0.06f)); default: return(0.0f); } }
private void calculationOptionControl_Changed(object sender, EventArgs e) { if (!_loadingCalculationOptions) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; trackBarTargetArmor.Value = 100 * (trackBarTargetArmor.Value / 100); labelTargetArmorDescription.Text = trackBarTargetArmor.Value.ToString() + (armorBosses.ContainsKey(trackBarTargetArmor.Value) ? armorBosses[trackBarTargetArmor.Value] : ""); labelBossAttackValue.Text = trackBarBossAttackValue.Value.ToString(); labelThreatScale.Text = trackBarThreatScale.Value.ToString(); labelMitigationScale.Text = trackBarMitigationScale.Value.ToString(); labelShieldBlockUptime.Text = trackBarShieldBlockUptime.Value.ToString() + "%"; calcOpts.TargetLevel = int.Parse(comboBoxTargetLevel.SelectedItem.ToString()); calcOpts.TargetArmor = trackBarTargetArmor.Value; calcOpts.BossAttackValue = trackBarBossAttackValue.Value; calcOpts.ThreatScale = trackBarThreatScale.Value; calcOpts.MitigationScale = trackBarMitigationScale.Value; calcOpts.ShieldBlockUptime = trackBarShieldBlockUptime.Value; calcOpts.ShattrathFaction = radioButtonAldor.Checked ? "Aldor" : "Scryer"; Character.OnItemsChanged(); } }
private void radioButton_CheckedChanged(object sender, EventArgs e) { if (!_loadingCalculationOptions) { CalculationOptionsProtWarr calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; //if (RB_TankPoints.Checked ) { calcOpts.RankingMode = 2; Bar_ThreatScale.Value = 10; } if (RB_BurstTime.Checked) { calcOpts.RankingMode = 3; Bar_ThreatScale.Value = 0; } else if (RB_DamageOutput.Checked) { calcOpts.RankingMode = 4; Bar_ThreatScale.Value = 10; } else { calcOpts.RankingMode = 1; Bar_ThreatScale.Value = 10; } Bar_ThreatScale.Enabled = LB_ThreatScale.Enabled = (calcOpts.RankingMode != 4); Bar_MitigationScale.Enabled = LB_MitigationScaleValue.Enabled = (calcOpts.RankingMode == 1); Character.OnCalculationsInvalidated(); } }
public void LoadCalculationOptions() { _loadingCalculationOptions = true; if (Character.CalculationOptions == null) { Character.CalculationOptions = new CalculationOptionsProtWarr(); } calcOpts = Character.CalculationOptions as CalculationOptionsProtWarr; // Model Specific Code bool showSliders = false; if (calcOpts.RankingMode == 1) { showSliders = true; } LB_HitsToSurvive.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); NUD_HitsToSurvive.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); LB_ThreatScale.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); NUD_ThreatScale.Visibility = (showSliders ? Visibility.Visible : Visibility.Collapsed); _loadingCalculationOptions = false; }
public static float LevelModifier(Character character) { CalculationOptionsProtWarr calcOpts = character.CalculationOptions as CalculationOptionsProtWarr; return((calcOpts.TargetLevel - character.Level) * 0.2f); }
public AttackTable(Character character, Stats stats, CalculationOptionsProtWarr options, Ability ability) { Initialize(character, stats, options, ability); }
public DefendTable(Character character, Stats stats, CalculationOptionsProtWarr options) { Initialize(character, stats, options, Ability.None); }
public AttackModel(Character character, Stats stats, CalculationOptionsProtWarr options, AttackModelMode attackModelMode) : this(character, stats, options, attackModelMode, RageModelMode.Infinite) { }
public void Add(Ability ability, Character character, Stats stats, CalculationOptionsProtWarr options) { this.Add(new AbilityModel(character, stats, options, ability)); }