From ff7897b59d78642ffa25d1e2f05b3f7d52639e91 Mon Sep 17 00:00:00 2001 From: sanguinerarogue Date: Fri, 10 Jan 2025 18:59:31 -0700 Subject: [PATCH] adjusts to level scaling --- ui/core/components/character_stats.tsx | 11 ------ ui/core/components/encounter_picker.ts | 12 ------- ui/core/player.ts | 46 ++++++++++++++------------ 3 files changed, 25 insertions(+), 44 deletions(-) diff --git a/ui/core/components/character_stats.tsx b/ui/core/components/character_stats.tsx index abd69dccf..fa11dcbd1 100644 --- a/ui/core/components/character_stats.tsx +++ b/ui/core/components/character_stats.tsx @@ -575,15 +575,4 @@ export class CharacterStats extends Component { private shouldShowMeleeCritCap(player: Player): boolean { return [Spec.SpecEnhancementShaman, Spec.SpecRetributionPaladin, Spec.SpecRogue, Spec.SpecWarrior, Spec.SpecHunter].includes(player.spec); } - - /*private meleeCritCapDisplayString(player: Player, _: Stats): string { - const playerCritCapDelta = player.getMeleeCritCap(); - - if (playerCritCapDelta === 0.0) { - return 'Exact'; - } - - const prefix = playerCritCapDelta > 0 ? 'Over by ' : 'Under by '; - return `${prefix} ${Math.abs(playerCritCapDelta).toFixed(2)}%`; - }*/ } diff --git a/ui/core/components/encounter_picker.ts b/ui/core/components/encounter_picker.ts index feabb5074..829de2723 100644 --- a/ui/core/components/encounter_picker.ts +++ b/ui/core/components/encounter_picker.ts @@ -320,18 +320,6 @@ class TargetPicker extends Input { { name: '62', value: 62 }, { name: '61', value: 61 }, { name: '60', value: 60 }, - { name: '53', value: 53 }, - { name: '52', value: 52 }, - { name: '51', value: 51 }, - { name: '50', value: 50 }, - { name: '43', value: 43 }, - { name: '42', value: 42 }, - { name: '41', value: 41 }, - { name: '40', value: 40 }, - { name: '28', value: 28 }, - { name: '27', value: 27 }, - { name: '26', value: 26 }, - { name: '25', value: 25 }, ], changedEvent: () => encounter.targetsChangeEmitter, getValue: () => this.getTarget().level, diff --git a/ui/core/player.ts b/ui/core/player.ts index 5cc398fea..0c31b902d 100644 --- a/ui/core/player.ts +++ b/ui/core/player.ts @@ -177,8 +177,8 @@ export interface MeleeCritCapInfo { meleeCrit: number; meleeHit: number; expertise: number; - suppression: number; glancing: number; + suppression: number; debuffCrit: number; hasOffhandWeapon: boolean; meleeHitCap: number; @@ -690,13 +690,14 @@ export class Player { } getMeleeCritCapInfo(weapon: WeaponType, has2hWeapon: boolean): MeleeCritCapInfo { - let defenderDefense = 315.0; // Initializes at level 63 until UI is loaded + let targetLevel = 63; // Initializes at level 63 until UI is loaded if (this.sim.encounter.targets) { - const targetlevel = this.sim.encounter?.primaryTarget.level; - defenderDefense = targetlevel * 5; + targetLevel = this.sim.encounter?.primaryTarget.level; } - const suppression = 4.8; - const glancing = 40.0; + const levelDiff = targetLevel - Mechanics.MAX_CHARACTER_LEVEL; + const defenderDefense = targetLevel * 5; + const glancing = (1 + levelDiff) * 10.0; + const suppression = levelDiff === 3 ? levelDiff + 1.8 : levelDiff; let weaponSkill = 300.0; const meleeCrit = (this.currentStats.finalStats?.stats[Stat.StatMeleeCrit] || 0.0) / Mechanics.MELEE_CRIT_RATING_PER_CRIT_CHANCE; @@ -704,24 +705,26 @@ export class Player { const expertise = (this.currentStats.finalStats?.stats[Stat.StatExpertise] || 0.0) / Mechanics.EXPERTISE_PER_QUARTER_PERCENT_REDUCTION / 4; const hasOffhandWeapon = this.getGear().getEquippedItem(ItemSlot.ItemSlotOffHand)?.item.weaponType !== undefined; + const getWeaponSkillForWeaponType = (skill: PseudoStat) => this.currentStats.talentsStats?.pseudoStats[skill] || 0.0; + if (!has2hWeapon) { switch (weapon) { case WeaponType.WeaponTypeUnknown: break; case WeaponType.WeaponTypeAxe: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatAxesSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatAxesSkill); break; case WeaponType.WeaponTypeDagger: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatDaggersSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatDaggersSkill); break; case WeaponType.WeaponTypeFist: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatUnarmedSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatUnarmedSkill); break; case WeaponType.WeaponTypeMace: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatMacesSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatMacesSkill); break; case WeaponType.WeaponTypeSword: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatSwordsSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatSwordsSkill); break; } } @@ -730,26 +733,27 @@ export class Player { case WeaponType.WeaponTypeUnknown: break; case WeaponType.WeaponTypeAxe: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatTwoHandedAxesSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatTwoHandedAxesSkill); break; case WeaponType.WeaponTypeMace: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatTwoHandedMacesSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatTwoHandedMacesSkill); break; case WeaponType.WeaponTypeSword: - weaponSkill += this.currentStats.talentsStats?.pseudoStats[PseudoStat.PseudoStatTwoHandedSwordsSkill] || 0.0; + weaponSkill += getWeaponSkillForWeaponType(PseudoStat.PseudoStatTwoHandedSwordsSkill); break; } } + const skillDiff = defenderDefense - weaponSkill; // Due to warrior HS bug, hit cap for crit cap calculation ignores the 19% penalty - let meleeHitCap = - defenderDefense - weaponSkill <= 10 - ? 5.0 + (defenderDefense - weaponSkill) * 0.1 - : 5.0 + (defenderDefense - weaponSkill) * 0.2 + (defenderDefense - weaponSkill - 10) * 0.2; + let meleeHitCap = skillDiff <= 10 ? 5.0 + skillDiff * 0.1 : 5.0 + skillDiff * 0.2 + (skillDiff - 10) * 0.2; meleeHitCap = hasOffhandWeapon && this.spec !== Spec.SpecWarrior ? meleeHitCap + 19.0 : meleeHitCap + 0.0; - const dodgeCap = 5.0 + (defenderDefense - weaponSkill) * 0.1; - const parryCap = this.getInFrontOfTarget() ? 14.0 : 0; + const dodgeCap = 5.0 + skillDiff * 0.1; + let parryCap = 0.0; + if (this.getInFrontOfTarget()) { + parryCap = levelDiff === 3 ? 14.0 : 5.0 + skillDiff * 0.1; // 14% parry at +3 level and follows dodge scaling otherwise + } const remainingMeleeHitCap = Math.max(meleeHitCap - meleeHit, 0.0); const remainingDodgeCap = Math.max(dodgeCap - expertise, 0.0); const remainingParryCap = Math.max(parryCap - expertise, 0.0); @@ -774,8 +778,8 @@ export class Player { meleeCrit, meleeHit, expertise, - suppression, glancing, + suppression, debuffCrit, hasOffhandWeapon, meleeHitCap,