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 Weapon Specializations #3485

Merged
merged 1 commit into from
Aug 18, 2023
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
10 changes: 5 additions & 5 deletions sim/core/spell_outcome.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (dot *Dot) OutcomeTickCounted(sim *Simulation, result *SpellResult, attackT
}

func (dot *Dot) OutcomeTickPhysicalCrit(sim *Simulation, result *SpellResult, attackTable *AttackTable) {
if dot.Spell.PhysicalCritCheck(sim, result.Target, attackTable) {
if dot.Spell.PhysicalCritCheck(sim, attackTable) {
result.Outcome = OutcomeCrit
result.Damage *= dot.Spell.CritMultiplier
} else {
Expand Down Expand Up @@ -415,7 +415,7 @@ func (spell *Spell) fixedCritCheck(sim *Simulation, critChance float64) bool {
}

func (result *SpellResult) applyAttackTableMiss(spell *Spell, attackTable *AttackTable, roll float64, chance *float64) bool {
missChance := attackTable.BaseMissChance - spell.PhysicalHitChance(result.Target)
missChance := attackTable.BaseMissChance - spell.PhysicalHitChance(attackTable)
if spell.Unit.AutoAttacks.IsDualWielding && !spell.Unit.PseudoStats.DisableDWMissPenalty {
missChance += 0.19
}
Expand All @@ -431,7 +431,7 @@ func (result *SpellResult) applyAttackTableMiss(spell *Spell, attackTable *Attac
}

func (result *SpellResult) applyAttackTableMissNoDWPenalty(spell *Spell, attackTable *AttackTable, roll float64, chance *float64) bool {
missChance := attackTable.BaseMissChance - spell.PhysicalHitChance(result.Target)
missChance := attackTable.BaseMissChance - spell.PhysicalHitChance(attackTable)
*chance = MaxFloat(0, missChance)

if roll < *chance {
Expand Down Expand Up @@ -500,7 +500,7 @@ func (result *SpellResult) applyAttackTableCrit(spell *Spell, attackTable *Attac
if spell.CritMultiplier == 0 {
panic("Spell " + spell.ActionID.String() + " missing CritMultiplier")
}
*chance += spell.PhysicalCritChance(result.Target, attackTable)
*chance += spell.PhysicalCritChance(attackTable)

if roll < *chance {
result.Outcome = OutcomeCrit
Expand All @@ -515,7 +515,7 @@ func (result *SpellResult) applyAttackTableCritSeparateRoll(sim *Simulation, spe
if spell.CritMultiplier == 0 {
panic("Spell " + spell.ActionID.String() + " missing CritMultiplier")
}
if spell.PhysicalCritCheck(sim, result.Target, attackTable) {
if spell.PhysicalCritCheck(sim, attackTable) {
result.Outcome = OutcomeCrit
spell.SpellMetrics[result.Target.UnitIndex].Crits++
result.Damage *= spell.CritMultiplier
Expand Down
19 changes: 8 additions & 11 deletions sim/core/spell_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,21 @@ func (spell *Spell) ExpertisePercentage() float64 {
return expertiseRating / ExpertisePerQuarterPercentReduction / 400
}

func (spell *Spell) PhysicalHitChance(target *Unit) float64 {
func (spell *Spell) PhysicalHitChance(attackTable *AttackTable) float64 {
hitRating := spell.Unit.stats[stats.MeleeHit] +
spell.BonusHitRating +
target.PseudoStats.BonusMeleeHitRatingTaken
attackTable.Defender.PseudoStats.BonusMeleeHitRatingTaken
return hitRating / (MeleeHitRatingPerHitChance * 100)
}

func (spell *Spell) physicalCritRating(target *Unit) float64 {
return spell.Unit.stats[stats.MeleeCrit] +
func (spell *Spell) PhysicalCritChance(attackTable *AttackTable) float64 {
critRating := spell.Unit.stats[stats.MeleeCrit] +
spell.BonusCritRating +
target.PseudoStats.BonusCritRatingTaken
attackTable.Defender.PseudoStats.BonusCritRatingTaken
return critRating/(CritRatingPerCritChance*100) - attackTable.CritSuppression
}
func (spell *Spell) PhysicalCritChance(target *Unit, attackTable *AttackTable) float64 {
critRating := spell.physicalCritRating(target)
return (critRating / (CritRatingPerCritChance * 100)) - attackTable.CritSuppression
}
func (spell *Spell) PhysicalCritCheck(sim *Simulation, target *Unit, attackTable *AttackTable) bool {
return sim.RandomFloat("Physical Crit Roll") < spell.PhysicalCritChance(target, attackTable)
func (spell *Spell) PhysicalCritCheck(sim *Simulation, attackTable *AttackTable) bool {
return sim.RandomFloat("Physical Crit Roll") < spell.PhysicalCritChance(attackTable)
}

func (spell *Spell) SpellPower() float64 {
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/diseases.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (dk *Deathknight) doWanderingPlague(sim *core.Simulation, spell *core.Spell
}

attackTable := dk.AttackTables[result.Target.UnitIndex]
physCritChance := spell.PhysicalCritChance(result.Target, attackTable)
physCritChance := spell.PhysicalCritChance(attackTable)
if sim.RandomFloat("Wandering Plague Roll") < physCritChance {
dk.LastTickTime = sim.CurrentTime
dk.LastDiseaseDamage = result.Damage / dk.WanderingPlague.TargetDamageMultiplier(attackTable, false)
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/feral/feral.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (cat *FeralDruid) GetDruid() *druid.Druid {

func (cat *FeralDruid) MissChance() float64 {
at := cat.AttackTables[cat.CurrentTarget.UnitIndex]
miss := at.BaseMissChance - cat.Shred.PhysicalHitChance(cat.CurrentTarget)
miss := at.BaseMissChance - cat.Shred.PhysicalHitChance(at)
dodge := at.BaseDodgeChance - cat.Shred.ExpertisePercentage() - cat.CurrentTarget.PseudoStats.DodgeReduction
return miss + dodge
}
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/lacerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (druid *Druid) registerLacerateSpell() {
if !isRollover {
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.Spell.DamageMultiplier = tickDamageMul
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
}
},
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/rake.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (druid *Druid) registerRakeSpell() {
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.SnapshotBaseDamage = 358 + 0.06*dot.Spell.MeleeAttackPower()
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
},
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/rip.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (druid *Druid) registerRipSpell() {

if !isRollover {
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
}
},
Expand Down
2 changes: 1 addition & 1 deletion sim/encounters/toc/gormok25h_ai.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (ai *Gormok25HAI) registerImpaleSpell(target *core.Target) {
if !isRollover {
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.Spell.DamageMultiplier = 1
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
}
},
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/explosive_shot.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (hunter *Hunter) makeExplosiveShotSpell(timer *core.Timer, downrank bool) *
OnSnapshot: func(sim *core.Simulation, target *core.Unit, dot *core.Dot, isRollover bool) {
dot.SnapshotBaseDamage = sim.Roll(minFlatDamage, maxFlatDamage) + 0.14*dot.Spell.RangedAttackPower(target)
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
},
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/serpent_sting.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (hunter *Hunter) registerSerpentStingSpell() {
dot.SnapshotBaseDamage = 242 + 0.04*dot.Spell.RangedAttackPower(target)
if !isRollover {
attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
}
},
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/volley.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (hunter *Hunter) registerVolleySpell() {
dot.SnapshotBaseDamage *= sim.Encounter.AOECapMultiplier()

attackTable := dot.Spell.Unit.AttackTables[target.UnitIndex]
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(target, attackTable)
dot.SnapshotCritChance = dot.Spell.PhysicalCritChance(attackTable)
dot.SnapshotAttackerMultiplier = dot.Spell.AttackerDamageMultiplier(attackTable)
},
OnTick: func(sim *core.Simulation, target *core.Unit, dot *core.Dot) {
Expand Down
Loading
Loading