Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rogue] Some small fixes after Beta testing, + Fix for DB Generator #42

Merged
merged 14 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sim/core/energy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/wowsims/cata/sim/core/proto"
"github.com/wowsims/cata/sim/core/stats"
)

// Time between energy ticks.
Expand Down Expand Up @@ -217,7 +218,8 @@ func (eb *energyBar) RunTask(sim *Simulation) time.Duration {
return eb.nextEnergyTick
}

crossedThreshold := eb.addEnergyInternal(sim, EnergyPerTick*eb.EnergyTickMultiplier, eb.regenMetrics)
hasteMultiplier := 1.0 + eb.unit.GetStat(stats.MeleeHaste)/(100*eb.unit.PseudoStats.MeleeHasteRatingPerHastePercent)
crossedThreshold := eb.addEnergyInternal(sim, EnergyPerTick*hasteMultiplier*eb.EnergyTickMultiplier, eb.regenMetrics)
eb.onEnergyGain(sim, crossedThreshold)

eb.nextEnergyTick = sim.CurrentTime + EnergyTickDuration
Expand Down
2 changes: 1 addition & 1 deletion sim/core/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func NewPseudoStats() PseudoStats {
DamageDealtMultiplier: 1,
SchoolDamageDealtMultiplier: NewSchoolFloatArray(),

MeleeHasteRatingPerHastePercent: 32.79,
MeleeHasteRatingPerHastePercent: 128.057160,

BlockValueMultiplier: 1,

Expand Down
6 changes: 4 additions & 2 deletions sim/rogue/assassination/venomous_wounds.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ func (sinRogue *AssassinationRogue) registerVenomousWounds() {

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
vwDamage := vwBaseTickDamage + 0.176*spell.MeleeAttackPower()
spell.CalcAndDealDamage(sim, target, vwDamage, spell.OutcomeMagicCrit)
sinRogue.AddEnergy(sim, 10, vwMetrics)
result := spell.CalcAndDealDamage(sim, target, vwDamage, spell.OutcomeMagicHitAndCrit)
if result.Landed() {
sinRogue.AddEnergy(sim, 10, vwMetrics)
}
},
})
}
2 changes: 1 addition & 1 deletion sim/rogue/backstab.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (rogue *Rogue) registerBackstabSpell() {
if result.DidCrit() && hasGlyph {
rogue.AddEnergy(sim, 5, glyphOfBackstabMetrics)
}
if result.DidCrit() && sim.IsExecutePhase35() && rogue.Talents.MurderousIntent > 0 {
if sim.IsExecutePhase35() && rogue.Talents.MurderousIntent > 0 {
totalRecovery := 15 * rogue.Talents.MurderousIntent
rogue.AddEnergy(sim, float64(totalRecovery), murderousIntentMetrics)
}
Expand Down
17 changes: 11 additions & 6 deletions sim/rogue/combat/restless_blades.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ func (comRogue *CombatRogue) applyRestlessBlades() {
return
}

cdReduction := time.Duration(comRogue.Talents.RestlessBlades) * time.Second
comRogue.RestlessBladesAura = comRogue.RegisterAura(core.Aura{
Label: "Restless Blades",
ActionID: core.ActionID{SpellID: 79096},
Duration: core.NeverExpires,

OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if spell.Unit == &comRogue.Unit && spell.Flags.Matches(rogue.SpellFlagFinisher) {
ksNewTime := comRogue.KillingSpree.CD.Timer.ReadyAt() - cdReduction
arNewTime := comRogue.AdrenalineRush.CD.Timer.ReadyAt() - cdReduction
comRogue.KillingSpree.CD.Timer.Set(ksNewTime)
comRogue.AdrenalineRush.CD.Timer.Set(arNewTime)
if spell.Flags.Matches(rogue.SpellFlagFinisher) {
cdReduction := time.Duration(comRogue.Talents.RestlessBlades) * time.Second * time.Duration(comRogue.ComboPoints())

if comRogue.KillingSpree != nil {
ksNewTime := comRogue.KillingSpree.CD.Timer.ReadyAt() - cdReduction
comRogue.KillingSpree.CD.Timer.Set(ksNewTime)
}
if comRogue.AdrenalineRush != nil {
arNewTime := comRogue.AdrenalineRush.CD.Timer.ReadyAt() - cdReduction
comRogue.AdrenalineRush.CD.Timer.Set(arNewTime)
}
}
},
})
Expand Down
22 changes: 14 additions & 8 deletions sim/rogue/combat/revealing_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func (comRogue *CombatRogue) registerRevealingStrike() {
hasGlyph := comRogue.HasPrimeGlyph(proto.RoguePrimeGlyph_GlyphOfRevealingStrike)
multiplier := 1 + core.TernaryFloat64(hasGlyph, .45, .35)
actionID := core.ActionID{SpellID: 84617}
isApplied := false

// Enemy Debuff Aura for Finisher Damage
rvsAura := comRogue.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
Expand All @@ -24,18 +25,23 @@ func (comRogue *CombatRogue) registerRevealingStrike() {
ActionID: actionID,
Duration: 15 * time.Second,

// Technically this _could_ cause problems in a target swapping situation, but it's good enough.
OnGain: func(aura *core.Aura, sim *core.Simulation) {
comRogue.Eviscerate.DamageMultiplier *= multiplier
comRogue.Envenom.DamageMultiplier *= multiplier
comRogue.Rupture.DamageMultiplier *= multiplier
if !isApplied {
comRogue.Eviscerate.DamageMultiplier *= multiplier
comRogue.Envenom.DamageMultiplier *= multiplier
comRogue.Rupture.DamageMultiplier *= multiplier
isApplied = true
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
comRogue.Eviscerate.DamageMultiplier /= multiplier
comRogue.Envenom.DamageMultiplier /= multiplier
comRogue.Rupture.DamageMultiplier /= multiplier
isApplied = false
aura.Deactivate(sim)
Comment on lines +29 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revealing Strike is applied to each target as a debuff right? This implementation flat buffs the rogue's next strike regardless of target. I think the right way to do this would be to register a debuff on the target, then in the various finisher calculations, check if the buff is active and apply the multiplier

},

OnSpellHitTaken: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.Landed() && spell.Flags.Matches(rogue.SpellFlagFinisher) {
comRogue.Eviscerate.DamageMultiplier /= multiplier
comRogue.Envenom.DamageMultiplier /= multiplier
comRogue.Rupture.DamageMultiplier /= multiplier
aura.Deactivate(sim)
}
},
Expand Down
61 changes: 40 additions & 21 deletions sim/rogue/subtlety/hemorrhage.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,22 @@ func (subRogue *SubtletyRogue) registerHemorrhageSpell() {
return
}

actionID := core.ActionID{SpellID: 16511}
hemoActionID := core.ActionID{SpellID: 16511}
hemoDotActionID := core.ActionID{SpellID: 89775}
hasGlyph := subRogue.HasPrimeGlyph(proto.RoguePrimeGlyph_GlyphOfHemorrhage)
hemoAuras := subRogue.NewEnemyAuraArray(core.HemorrhageAura)
var lastHemoDamage float64

subRogue.Rogue.Hemorrhage = subRogue.RegisterSpell(core.SpellConfig{
ActionID: actionID,
// Hemorrhage DoT has a chance to proc MH weapon effects/poisons, so must be defined as its own spell
hemoDot := subRogue.RegisterSpell(core.SpellConfig{
ActionID: hemoDotActionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | rogue.SpellFlagBuilder | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: subRogue.GetGeneratorCostModifier(35 - 2*float64(subRogue.Talents.SlaughterFromTheShadows)),
Refund: 0.8,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
},
Flags: core.SpellFlagIgnoreAttackerModifiers, // From initial testing, Hemo DoT only benefits from debuffs on target, such as 30% bleed damage

DamageMultiplier: core.TernaryFloat64(subRogue.HasDagger(core.MainHand), 3.25, 2.24),
CritMultiplier: subRogue.MeleeCritMultiplier(true),
ThreatMultiplier: 1,
CritMultiplier: 1,
DamageMultiplier: 1,

Dot: core.DotConfig{
Aura: core.Aura{
Expand All @@ -51,13 +43,41 @@ func (subRogue *SubtletyRogue) registerHemorrhageSpell() {
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, _ bool) {
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
dot.SnapshotAttackerMultiplier = 1
},
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
dot.CalcAndDealPeriodicSnapshotDamage(sim, target, dot.OutcomeSnapshotCrit)
},
},

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dot := spell.Dot(target)
dot.SnapshotBaseDamage = lastHemoDamage * .05
dot.Apply(sim)
},
})

subRogue.Rogue.Hemorrhage = subRogue.RegisterSpell(core.SpellConfig{
ActionID: hemoActionID,
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | rogue.SpellFlagBuilder | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: subRogue.GetGeneratorCostModifier(35 - 2*float64(subRogue.Talents.SlaughterFromTheShadows)),
Refund: 0.8,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
GCD: time.Second,
},
IgnoreHaste: true,
},

DamageMultiplier: core.TernaryFloat64(subRogue.HasDagger(core.MainHand), 3.25, 2.24),
CritMultiplier: subRogue.MeleeCritMultiplier(true),
ThreatMultiplier: 1,

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
subRogue.BreakStealth(sim)
baseDamage := 0 +
Expand All @@ -70,9 +90,8 @@ func (subRogue *SubtletyRogue) registerHemorrhageSpell() {
subRogue.AddComboPoints(sim, 1, spell.ComboPointMetrics())
hemoAuras.Get(target).Activate(sim)
if hasGlyph {
dot := spell.Dot(target)
dot.SnapshotBaseDamage = result.Damage * .05
dot.Apply(sim)
lastHemoDamage = result.Damage
hemoDot.Cast(sim, target)
}
} else {
spell.IssueRefund(sim)
Expand Down
8 changes: 6 additions & 2 deletions sim/rogue/subtlety/sanguinary_vein.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (subRogue *SubtletyRogue) registerSanguinaryVein() {
if subRogue.Rupture != nil {
subRogue.Rupture.RelatedAuras = append(subRogue.Rupture.RelatedAuras, svDebuffArray)
}
if subRogue.Hemorrhage != nil && subRogue.HasPrimeGlyph(proto.RoguePrimeGlyph_GlyphOfHemorrhage) {
if subRogue.Hemorrhage != nil && hasGlyph {
subRogue.Hemorrhage.RelatedAuras = append(subRogue.Hemorrhage.RelatedAuras, svDebuffArray)
}
})
Expand All @@ -63,11 +63,15 @@ func (subRogue *SubtletyRogue) registerSanguinaryVein() {
return
}

if spell == subRogue.Rupture || (spell == subRogue.Hemorrhage && hasGlyph) {
if spell == subRogue.Rupture {
aura := svDebuffArray.Get(result.Target)
dot := spell.Dot(result.Target)
aura.Duration = dot.TickLength * time.Duration(dot.NumberOfTicks)
aura.Activate(sim)
} else if spell == subRogue.Hemorrhage && hasGlyph {
aura := svDebuffArray.Get(result.Target)
aura.Duration = 24 * time.Second
aura.Activate(sim)
}
},
})
Expand Down
2 changes: 1 addition & 1 deletion ui/core/constants/mechanics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Spec } from "../proto/common";
export const CHARACTER_LEVEL = 85;
export const BOSS_LEVEL = CHARACTER_LEVEL + 3;

export const EXPERTISE_PER_QUARTER_PERCENT_REDUCTION = 32.79 / 4;
export const EXPERTISE_PER_QUARTER_PERCENT_REDUCTION = 32.014286;
export const MELEE_CRIT_RATING_PER_CRIT_CHANCE = 179.28;
export const MELEE_HIT_RATING_PER_HIT_CHANCE = 120.11;
export const ARMOR_PEN_PER_PERCENT_ARMOR = 13.99;
Expand Down
7 changes: 6 additions & 1 deletion ui/core/proto_utils/action_id.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getWowheadLanguagePrefix } from '../constants/lang.js';
import { CHARACTER_LEVEL } from '../constants/mechanics.js';
import { ResourceType } from '../proto/api.js';
import { ActionID as ActionIdProto, OtherAction, ItemRandomSuffix } from '../proto/common.js';
import { ActionID as ActionIdProto, ItemRandomSuffix,OtherAction } from '../proto/common.js';
import { IconData, UIItem as Item } from '../proto/ui.js';
import { Database } from './database.js';

Expand Down Expand Up @@ -325,6 +325,11 @@ export class ActionId {
name += ' (Off Hand)';
}
break;
case 'Hemorrhage':
if (this.spellId == 89775) {
name += " (DoT)";
}
break;
case 'Chain Lightning':
case 'Lightning Bolt':
if (this.tag == 6) {
Expand Down
Loading